/* Game Systems List Page */
.game-systems-list-page .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.game-systems-list-page .page-header h3 {
  margin: 0;
  color: var(--text-primary);
}

.game-systems-list-page .page-header-actions {
  display: flex;
  gap: 0.5rem;
}

/* Game System Detail Page - Dark Theme */
.game-system-detail-page {
  max-width: 1000px;
}

.system-info-section,
.publications-section,
.maintainers-section {
  margin-bottom: 2rem;
}

/* Heading row: name left, badges right */
.system-info-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.system-info-heading h2 {
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.system-info-badges {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.publications-section h3,
.maintainers-section h3 {
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.system-info-table,
.publications-table,
.maintainers-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.system-info-table tr {
  border-bottom: 1px solid var(--border-primary);
}

.system-info-table tr:last-child {
  border-bottom: none;
}

.system-info-table th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  width: 120px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.system-info-table td {
  padding: 0.65rem 0.75rem;
  color: var(--text-primary);
}

.system-info-table tr.description-row td {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Tags section — inline editable strip */
.tags-section {
  margin-bottom: 2rem;
}

.tags-section h3 {
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.tags-inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  background: rgba(96, 165, 250, 0.15);
  color: var(--info);
  border: 1px solid rgba(96, 165, 250, 0.4);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.tag-chip-remove {
  background: none;
  border: none;
  color: var(--info);
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.tag-chip-remove:hover {
  opacity: 1;
}

.tag-add-btn {
  background: none;
  border: 1px dashed var(--border-emphasis);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.tag-add-btn:hover:not(:disabled) {
  border-color: var(--info);
  color: var(--info);
}

.tag-add-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.tag-add-inline {
  display: inline-flex;
  align-items: center;
}

.tag-add-input {
  background: var(--bg-primary);
  border: 1px solid var(--info);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  width: 160px;
  outline: none;
}

.tag-suggestions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.tag-suggestion-chip {
  background: none;
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  color: var(--text-muted);
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.tag-suggestion-chip:hover {
  border-color: var(--info);
  color: var(--info);
}

.publications-table th,
.maintainers-table th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-align: left;
  padding: 0.75rem;
  border-bottom: 2px solid var(--border-primary);
  font-weight: 600;
}

.publications-table td,
.maintainers-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-primary);
}

.publications-table tr:hover,
.maintainers-table tr:hover {
  background: var(--bg-hover);
}

.maintainer-actions {
  margin-top: 1rem;
}

/* (badge, empty-state, loading-state defined in components.css) */

/* Text utilities */
.text-muted {
  color: var(--text-muted);
  font-style: italic;
}

/* Section headers with inline actions */
.publications-section .section-header,
.publications-management-page .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.publications-section .section-header h3 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* Cover image thumbnails */
.pub-cover-thumb {
  width: 60px;
  height: auto;
  border-radius: 3px;
  border: 1px solid var(--border-primary);
}

.pub-cover-placeholder {
  width: 60px;
  height: 80px;
  background: var(--border-primary);
  border-radius: 3px;
  border: 1px solid var(--border-emphasis);
}

/* ISBN Lookup Section */
.isbn-lookup-section {
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
}

.isbn-lookup-section h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.isbn-lookup-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.isbn-lookup-row .form-field {
  flex: 1;
}

/* ISBN Preview Card */
.isbn-preview-card {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  display: flex;
  gap: 1rem;
}

.isbn-preview-cover {
  width: 120px;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border-primary);
  flex-shrink: 0;
}

.isbn-preview-info {
  flex: 1;
}

.isbn-preview-info h4 {
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.isbn-preview-info p {
  color: var(--text-secondary);
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.isbn-preview-authors {
  color: var(--text-secondary);
  font-style: italic;
}

.isbn-preview-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.isbn-preview-actions .checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

/* Publications Management Page */
.publications-management-page {
  max-width: 1000px;
}

.publications-management-table {
  margin-top: 1.5rem;
}

.publications-management-table h3 {
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* Game System Form */
.game-system-form {
  max-width: 600px;
}

/* Edit table — inputs inside system-info-table rows */
.system-edit-table td {
  vertical-align: middle;
}

.system-edit-table .edit-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-emphasis);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.system-edit-table .edit-input:focus {
  outline: none;
  border-color: var(--accent-red);
}

.system-edit-table textarea.edit-input {
  resize: vertical;
  min-height: 4rem;
}

.system-edit-table .edit-input-narrow {
  width: 100px;
}

/* Two fields side by side */
.form-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.form-row .form-field {
  flex: 1;
}

.form-row .form-field.form-field-narrow {
  flex: 0 0 130px;
}

.slug-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.slug-input-row input {
  flex: 1;
}

.slug-suffix {
  font-family: monospace;
  color: var(--text-secondary);
  font-size: 0.95rem;
  white-space: nowrap;
}

.slug-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.game-system-edit-section {
  margin-bottom: 2rem;
}

.game-system-edit-section h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* Game System Sidebar Navigation */
.game-system-nav {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-primary);
}

.game-system-nav .nav-header {
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.game-system-nav h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-system-nav .nav-status {
  margin-top: 0.25rem;
}

.game-system-nav .nav-status .badge {
  font-size: 0.6rem;
  padding: 0.15rem 0.35rem;
}

.game-system-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.game-system-nav li {
  margin-bottom: 0.25rem;
}

.game-system-nav li.nav-divider {
  margin: 0.75rem 0;
  border-top: 1px solid var(--border-primary);
}

.game-system-nav a {
  display: block;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  font-size: 0.9rem;
}

.game-system-nav a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.game-system-nav a.active {
  background: var(--accent-red);
  color: #ffffff;
  font-weight: 500;
}

/* Attributes Editor */
.attributes-editor {
  max-width: 800px;
}

.attributes-editor h2 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.section-header h3 {
  margin-bottom: 0;
}

.preset-selector select {
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

.attribute-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.attribute-row .form-field {
  margin-bottom: 0;
}

.attribute-row .attr-key-input {
  width: 100px;
  font-family: monospace;
  text-transform: uppercase;
}

.attribute-row .attr-name-input {
  flex: 1;
}

.attribute-row .attr-actions {
  display: flex;
  gap: 0.25rem;
}

.attribute-row .attr-actions button {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

/* Config sections (scale, generation, advancement) */
.config-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
}

.config-section h3 {
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 0.5rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.config-section .admin-table {
  margin-bottom: 0;
}

.config-section .admin-table th {
  width: 200px;
}

/* Form row — horizontal form fields */
.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-row .form-field {
  flex: 1;
  min-width: 150px;
}

/* Generation method card */
.generation-method-card {
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.generation-method-card h4 {
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
}

.method-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.method-header h4 {
  margin: 0;
}

.method-header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.method-header-actions .checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.method-header-actions input[type="radio"] {
  accent-color: var(--accent-red);
}

/* Attributes editor form — full config */
.attributes-editor-form {
  max-width: 800px;
}

/* Placeholder page */
.placeholder-page {
  max-width: 800px;
}

.placeholder-page h2 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.placeholder-page p {
  color: var(--text-muted);
  font-style: italic;
}

/* Features toggle section */
.features-section {
  margin-bottom: 2rem;
}

.features-section h3 {
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.features-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.features-grid .checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  cursor: pointer;
}

.features-grid .checkbox-field input[type="checkbox"] {
  accent-color: var(--accent-red);
}

.features-grid .checkbox-field input[type="checkbox"]:disabled {
  cursor: default;
}

.features-grid .checkbox-field input[type="checkbox"]:disabled + * {
  color: var(--text-muted);
}

/* =============================================================================
   Species & Classes Editor
   ============================================================================= */

.species-editor,
.classes-editor {
  max-width: 900px;
}

.species-list,
.classes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Entry cards (accordion-style) */
.entry-card {
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  background: var(--bg-primary);
  overflow: hidden;
}

.entry-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.entry-card-header.clickable {
  cursor: pointer;
}

.entry-card-header.clickable:hover {
  background: var(--bg-primary);
}

.entry-card-header .chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 1rem;
  flex-shrink: 0;
}

.entry-card-summary {
  color: var(--text-muted);
  font-weight: normal;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.entry-card-actions {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-primary);
}

/* NPC Template Form Sections */
.npc-form-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-primary);
}

.npc-form-section h4 {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.npc-metadata-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

/* Stat Block: Attributes grid */
.npc-stat-attributes {
  margin-bottom: 1rem;
}

.npc-stat-attributes > label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.npc-attr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
}

.npc-attr-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.npc-attr-label {
  color: var(--text-primary);
  min-width: 80px;
  font-size: 0.9rem;
}

.npc-attr-row input {
  width: 80px;
}

/* Stat Block: Skills list */
.npc-stat-skills {
  margin-top: 0.75rem;
}

.npc-stat-skills > label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.npc-skill-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.npc-skill-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.npc-skill-name {
  min-width: 140px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.npc-skill-row input {
  width: 80px;
}

.npc-skill-add {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.25rem;
}

.npc-skill-add input:first-child {
  width: 160px;
}

.npc-skill-add input:nth-child(2) {
  width: 80px;
}

/* Equipment and Special Abilities lists */
.npc-list-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.npc-list-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.npc-item-name {
  color: var(--text-primary);
  flex: 1;
}

.npc-item-qty {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.npc-list-add {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.npc-list-add input:first-child {
  flex: 1;
}

.npc-ability-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.npc-ability-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.npc-ability-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.npc-ability-add {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.npc-ability-add input:first-child {
  flex: 1;
}

.npc-ability-add input:nth-child(2) {
  flex: 2;
}

/* Phase D: Template summary in display mode */
.npc-template-summary {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.npc-creature-info {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.npc-creature-detail {
  display: block;
  margin-bottom: 0.125rem;
}

/* Field groups within cards */
.field-group {
  margin-top: 0.5rem;
}

.field-group h4 {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.field-inline {
  display: inline-block;
  margin-right: 1rem;
  color: var(--text-primary);
}

/* Attribute ranges grid (OpenD6 min/max) */
.attribute-ranges-grid {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.range-row {
  display: grid;
  grid-template-columns: 120px 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
}

.range-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.range-row input {
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  border-radius: 3px;
  font-size: 0.85rem;
}

/* Requirements grid (d20 integer values) */
.requirements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.req-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.req-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  min-width: 80px;
}

.req-row input {
  width: 60px;
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  border-radius: 3px;
  font-size: 0.85rem;
}

/* Classes checkboxes */
.classes-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Ability edit row */
.ability-edit-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.25rem;
}

.ability-edit-row input {
  flex: 1;
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  border-radius: 3px;
}

.ability-edit-row input:first-child {
  flex: 0.4;
}

/* Class metadata inline display */
.class-metadata {
  padding: 0.5rem 0;
}

/* Table wrapper for wide tables */
.class-table-wrapper {
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 0.25rem;
}

.class-table-wrapper .admin-table {
  font-size: 0.8rem;
}

/* Form row for side-by-side fields */
.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-field {
  flex: 1;
}

/* Editor form spacing */
.species-editor-form,
.classes-editor-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Table Paste Widget */
.table-paste-section {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
}

.table-paste-section h4 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.table-paste-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.table-paste-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.table-paste-textarea {
  width: 100%;
  font-family: monospace;
  font-size: 0.8rem;
  padding: 0.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  resize: vertical;
}

.table-paste-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* =============================================================================
   Skills Editor
   ============================================================================= */

.skills-editor {
  max-width: 900px;
}

.skills-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.skills-editor .skill-group-header {
  color: var(--text-primary);
  font-size: 1rem;
  border-bottom: 1px solid var(--border-primary);
  padding-bottom: 0.35rem;
  margin-bottom: 0.5rem;
}

.skill-card-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--bg-primary);
  flex-wrap: wrap;
}

.skill-card-compact .skill-name {
  color: var(--text-primary);
  font-weight: 500;
}

.skill-card-compact .skill-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-left: auto;
}

.skills-editor-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skills-editor .skill-group {
  margin-bottom: 0.5rem;
}

.button-actions {
  margin-top: 0.5rem;
}

/* Equipment Catalog */
.equipment-table tbody tr {
  cursor: pointer;
}

.equipment-table tbody tr:hover {
  background: var(--bg-hover);
}

.equipment-table tbody tr.expanded {
  background: var(--bg-hover);
}

.equipment-table .row-actions {
  text-align: right;
  white-space: nowrap;
}

.equipment-form {
  padding: 0.5rem 0;
}

.equipment-form .form-row {
  margin-bottom: 0.75rem;
}

.form-field.full-width {
  flex: 1 1 100%;
}

.combat-stats-textarea {
  width: 100%;
  font-family: monospace;
  font-size: 0.85em;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  padding: 0.5rem;
  resize: vertical;
}

.combat-stats-textarea:focus {
  outline: none;
  border-color: var(--accent-red);
}

.field-error {
  display: block;
  color: var(--error);
  font-size: 0.8em;
  margin-top: 0.25rem;
}

/* Equipment Schemas Config */
.equipment-schemas-config {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.equipment-schemas-config h4 {
  margin: 0 0 0.75rem 0;
  color: var(--text-primary);
}

.equipment-schemas-config .form-field {
  margin-bottom: 0.5rem;
}

.equipment-schemas-config select {
  min-width: 200px;
}

/* Schema Domain Forms */
.equipment-combat-schemas {
  margin-top: 0.5rem;
}

.schema-domain-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.schema-domain-form h5 {
  margin: 0 0 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.9em;
}

.schema-domain-form .form-field {
  margin-bottom: 0.5rem;
}

/* Bracket Table Editor */
.bracket-table {
  margin-bottom: 0.5rem;
}

.bracket-table th,
.bracket-table td {
  padding: 0.25rem 0.5rem;
}

.bracket-input {
  width: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  border-radius: 3px;
  padding: 0.25rem 0.5rem;
  font-size: 0.85em;
}

.bracket-input:focus {
  outline: none;
  border-color: var(--accent-red);
}

.bracket-add-btn {
  margin-top: 0.25rem;
}

.bracket-remove-btn {
  padding: 0.15rem 0.4rem;
  font-size: 0.75em;
}

/* Read-only combat stats */
.combat-stats-readonly {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  padding: 0.5rem;
  font-family: monospace;
  font-size: 0.85em;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* Check config page */
.check-config-section {
  margin-bottom: 1.5rem;
}

.check-config-section h4 {
  margin: 0 0 0.25rem;
  color: var(--text-primary);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chip-list .chip {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  padding: 0.25rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.9em;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.checkbox-grid .checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--text-primary);
}

.checkbox-grid .checkbox-item input[type="checkbox"] {
  accent-color: var(--accent-red);
}

/* ---------------------------------------------------------------------------
   Generic Catalog Cards (vehicles, spells, etc.)
   --------------------------------------------------------------------------- */

.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.catalog-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: 1rem;
}

.catalog-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.catalog-card-header h4 {
  margin: 0;
  color: var(--text-primary);
}

.catalog-card-actions {
  display: flex;
  gap: 0.5rem;
}

.catalog-card .admin-table {
  margin-bottom: 0;
}

.catalog-card .admin-table th {
  width: 120px;
  white-space: nowrap;
}

.catalog-form {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: 1rem;
}

.catalog-form .form-field {
  margin-bottom: 0.75rem;
}

.catalog-add-section {
  margin-bottom: 1.5rem;
}

.catalog-add-section h3 {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.catalog-nested-editor {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.catalog-nested-editor label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.catalog-nested-editor .admin-table {
  margin-bottom: 0.5rem;
}

/* License Notice Section */
.license-notice-section {
  margin-bottom: 2rem;
}

.license-notice-section h3 {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.license-notice-badge {
  margin-bottom: 0.75rem;
}

.license-summary {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.license-text-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  padding: 1rem;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 300px;
  overflow-y: auto;
}

.license-attribution {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent-red);
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* =============================================================================
   OSR Stat Block Display
   ============================================================================= */

.osr-stat-block {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

/* Class + Level header */
.osr-class-level {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

/* Ability score grid — 3 columns across */
.osr-ability-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.osr-ability-item {
  text-align: center;
  padding: 0.4rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
}

.osr-ability-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.15rem;
}

.osr-ability-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  display: block;
}

/* Combat stats row — AC, HP, HD, Attack Bonus, Movement */
.osr-combat-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
}

.osr-combat-stat {
  text-align: center;
  min-width: 60px;
}

.osr-combat-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: block;
  margin-bottom: 0.15rem;
}

.osr-combat-stat-value {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  display: block;
}

/* Saving throws — compact 5-column table */
.osr-saves-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.osr-saves-table th {
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-primary);
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
}

.osr-saves-table td {
  text-align: center;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border-primary);
  font-weight: 500;
}

/* Derived badge — subtle indicator for calculated values */
.osr-derived-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  background: rgba(96, 165, 250, 0.15);
  color: var(--info);
  font-size: 0.7rem;
  font-weight: 500;
  vertical-align: middle;
}

/* Actions list */
.osr-actions-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.osr-action-item {
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border-primary);
}

.osr-action-item:last-child {
  border-bottom: none;
}

.osr-action-name {
  font-weight: 600;
  color: var(--text-primary);
}

/* Thief abilities grid — 2 columns */
.osr-thief-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.osr-thief-grid .osr-ability-item {
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0.5rem;
}

/* Spells per level — inline row */
.osr-spells-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.osr-spells-row .osr-ability-item {
  min-width: 50px;
  flex: 0 0 auto;
}

/* =============================================================================
   OSR Import Wizard
   ============================================================================= */

/* Wizard container */
.osr-import-wizard {
  padding: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
}

/* Step indicator */
.osr-wizard-step {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

.osr-wizard-step strong {
  color: var(--text-primary);
}

/* Derived stats panel (read-only section showing calculated values) */
.osr-derived-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: 1rem;
  margin: 1rem 0;
}

.osr-derived-panel h4 {
  margin: 0 0 0.5rem 0;
  color: var(--info);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Class/level picker row */
.osr-class-level-picker {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.osr-class-level-picker .form-field {
  flex: 1;
  margin-bottom: 0;
}

.osr-class-level-picker .form-field:last-child {
  flex: 0 0 80px;
}

/* Alignment dropdown */
.osr-alignment-select {
  margin-bottom: 1rem;
}

.osr-alignment-select .form-field {
  max-width: 250px;
  margin-bottom: 0;
}

/* Help Text Section */
.help-text-section {
  margin-top: 1rem;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  overflow: hidden;
}

.help-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  background: var(--bg-secondary);
}

.help-toggle h4 {
  margin: 0;
  font-size: 0.85rem;
}

.help-fields {
  padding: 0.75rem;
}

.help-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.help-entry {
  margin-bottom: 0.75rem;
}

.help-entry label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.help-entry input,
.help-entry textarea {
  width: 100%;
  margin-bottom: 0.25rem;
}

.help-entry textarea {
  resize: vertical;
}

/* =============================================================================
   Mobile Responsive — Game Systems
   ============================================================================= */

@media (max-width: 768px) {
  /* Game system sidebar: collapsible on mobile */
  .game-system-nav .nav-header {
    cursor: pointer;
    position: relative;
    padding-right: 2rem;
  }

  .game-system-nav .nav-header::after {
    content: "\2630";
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
  }

  .game-system-nav ul {
    display: none;
  }

  .game-system-nav.sidebar-open ul {
    display: block;
  }

  .game-system-nav.sidebar-open .nav-header::after {
    content: "\2715";
  }

  .game-system-nav ul li a {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .game-systems-list,
  .game-system-detail-page {
    max-width: 100%;
  }

  /* Info table: stack cells */
  .system-info-table td,
  .system-info-table th {
    display: block;
    width: 100%;
    padding: 0.3rem 0.5rem;
  }

  .system-info-table tr {
    display: block;
    margin-bottom: 0.5rem;
  }

  /* Edit table: same treatment */
  .system-edit-table td,
  .system-edit-table th {
    display: block;
    width: 100%;
    padding: 0.3rem 0.5rem;
  }

  .system-edit-table tr {
    display: block;
    margin-bottom: 0.5rem;
  }
}
