*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --dialog-text-size: 14px;
  --dialog-text-caption: 16px;
  --dialog-button-text-size: 16px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: none;
  --shadow-md: none;
}

html,
body {
  background: var(--bg);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

.startup-loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 243, 238, 0.88);
  backdrop-filter: blur(3px);
  z-index: 500;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.startup-loading.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.startup-loading-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 22px 26px;
  min-width: 260px;
  text-align: center;
}

.startup-loading-text {
  font-size: 14px;
  color: #5c6181;
}

.startup-loading-track {
  width: 100%;
  height: 10px;
  margin-top: 14px;
  background: rgba(181, 187, 216, 0.28);
  border-radius: 999px;
  overflow: hidden;
}

.startup-loading-bar {
  width: 0%;
  height: 100%;
  background: #5f71db;
  border-radius: 999px;
  transition: width 0.12s ease;
}

/* Header */
header {
  background: var(--bg);
  border-bottom: 1.5px solid var(--border);
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  width: min(1100px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  min-width: 0;
  flex: 1 1 0%;
}

.header-app-update {
  flex-shrink: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-brand-strong, var(--accent));
  background: var(--brand-50, color-mix(in srgb, var(--accent) 12%, transparent));
  border: 1px solid var(--stroke-brand-strong, color-mix(in srgb, var(--accent) 35%, var(--border)));
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.header-app-update:hover {
  background: var(--fill-brand, color-mix(in srgb, var(--accent) 18%, transparent));
}

.logo {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--accent);
  letter-spacing: -0.02em;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo span { color: var(--text-muted); font-size: 13px; font-family: 'DM Sans', sans-serif; font-weight: 300; margin-left: 6px; }

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: none;
  padding: 6px;
  display: none;
  z-index: 150;
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--fill-brand);
}

.visually-hidden {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
  white-space: nowrap;
}

.btn:hover { background: var(--surface2); border-color: var(--border-hover); }
.btn:active { transform: scale(0.98); }
.btn svg { flex-shrink: 0; }

.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: rgba(58, 79, 195, 0.9); border-color: rgba(58, 79, 195, 0.9); }

.btn-outline-accent { color: var(--accent); border-color: var(--accent); }
.btn-outline-accent:hover { background: var(--accent-light); }

.btn-danger { color: var(--danger); border-color: #fca5a5; }
.btn-danger:hover { background: var(--danger-light); border-color: var(--danger); }

.btn-sm { padding: 9px 10px; font-size: 12px; border-radius: 10px; }

/* Main layout */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  background: #F5F6FC;
}

/* Inline category header row — same grid as .vocab-row / .table-head */
.cat-header-row {
  display: grid;
  gap: 0;
  align-items: center;
  padding: 6px 8px;
  background: var(--accent-light);
  border-top: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.cat-header-row:first-child { border-top: none; }

.cat-header-lead {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 32px;
  gap: 4px;
}

/* # column: folder icon (same token color as .vocab-row-num on word rows) */
.cat-header-lead .cat-header-lead-icon.vocab-row-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 0;
  flex-shrink: 0;
  overflow: visible;
}
.cat-header-lead .cat-header-lead-icon.vocab-row-num svg {
  display: block;
  width: 12px;
  height: 12px;
  overflow: visible;
}

.cat-header-main {
  grid-column: 2 / -2;
  min-width: 0;
  display: flex;
  align-items: center;
  /* Match .word-input / .word-display horizontal inset so title lines up with word text */
  padding-left: 10px;
}

.cat-header-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.cat-header-actions-sep {
  flex-shrink: 0;
  width: 1px;
  height: 22px;
  background: var(--border);
}

.cat-header-toggle {
  width: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 10px;
  transition: transform .15s;
  cursor: pointer;
}

.cat-header-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding-left: 0;
  min-width: 0;
}

.cat-header-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-brand-weak);
}

.cat-header-title {
  display: block;
}

.cat-header-summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 12px;
}

.cat-header-folder-indicator,
.cat-header-image-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  color: var(--text-brand-weak);
}

.cat-header-folder-indicator svg,
.cat-header-image-indicator svg {
  display: block;
  width: 10px;
  height: 10px;
}

.cat-header-folder-indicator.hidden,
.cat-header-image-indicator.hidden {
  display: none;
}

.cat-header-edit-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-hint);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  transition: background .12s, color .12s;
}
.cat-header-edit-btn:hover { background: var(--accent-light); color: var(--accent); }

.cat-header-del-btn {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-hint);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  transition: background .12s, color .12s;
}
.cat-header-del-btn:hover { background: var(--danger-light); color: var(--danger); }

.cat-edit-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}
.cat-edit-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cat-edit-input {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: var(--surface2);
  transition: border-color .12s, background .12s;
}
.cat-edit-input:hover { border-color: var(--border); background: var(--surface2); }
.cat-edit-input:focus {
  border-color: var(--text-brand-weak);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--text-brand-weak);
}

.cat-header-lang2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding-left: 4px;
}

.direction-shell {
  margin-bottom: 1.5rem;
}

/* First-run welcome hint banner. Reuses the visibility panel look so it
   sits naturally above the language pair shell. Hidden by default; shown
   when settings.firstHint !== true. */
.welcome-hint {
  margin-bottom: 1.5rem;
  border: 1.5px solid var(--stroke-brand-strong);
  border-radius: var(--radius);
  background: var(--brand-50);
  padding: 14px 44px 16px 18px;
  position: relative;
}

.welcome-hint[hidden] {
  display: none;
}

.welcome-hint-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.welcome-hint-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-brand-strong);
  margin: 0 0 2px;
}

.welcome-hint-content p {
  margin: 0;
  font-size: 14px;
  color: var(--text-neutral-strong);
}

.welcome-hint-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-brand-weak);
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: absolute;
  top: 6px;
  right: 6px;
}

.welcome-hint-close:hover {
  background: color-mix(in srgb, var(--fill-purchase) 82%, white);
  color: var(--text);
}

/* Config bar */
.config-bar {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 0;
  flex-wrap: wrap;
  box-shadow: none;
}

.direction-toolbar {
  align-items: center;
  flex-wrap: nowrap;
}

.direction-toolbar-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

.direction-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
}

.direction-picker {
  position: relative;
  flex: 0 0 240px;
  width: 240px;
  min-width: 240px;
}

.direction-trigger {
  width: 100%;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1.5px solid var(--select-border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.direction-trigger:hover {
  border-color: var(--border-hover);
  background: var(--surface);
}

.direction-trigger-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.direction-trigger-chevron {
  display: inline-flex;
  align-items: center;
  color: var(--text-brand-weak);
  flex-shrink: 0;
  transition: transform 0.12s ease;
}

.direction-picker.open .direction-trigger-chevron,
.direction-visibility-btn[aria-expanded="true"] .direction-trigger-chevron {
  transform: rotate(180deg);
}

.direction-picker-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 210;
  width: 100%;
  min-width: 260px;
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  display: none;
  box-shadow: none;
}

.direction-picker.open .direction-picker-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.direction-option {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}

.direction-option:hover,
.direction-option.is-selected {
  background: var(--fill-brand);
}

.direction-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.direction-option-check {
  flex-shrink: 0;
  color: var(--text-brand-strong);
  display: inline-flex;
}

.direction-option-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
  width: 100%;
}

.direction-option-main {
  flex: 1;
  min-width: 0;
}

.direction-option-delete {
  flex-shrink: 0;
  width: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.direction-option-delete:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.direction-option-empty {
  padding: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.direction-add-btn,
.direction-visibility-btn {
  min-height: 38px;
  flex-shrink: 0;
  min-width: 38px;
  width: 38px;
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
}

#ttsConfig .col-config-btn,
button[data-open-settings] {
  width: 38px;
  min-width: 38px;
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
}

.direction-toolbar-utility {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.direction-visibility-panel {
  margin-top: 12px;
  border: 1.5px solid var(--stroke-purchase-middle);
  border-radius: var(--radius);
  background: var(--brand-25);
  padding: 10px 14px 12px;
  display: none;
  position: relative;
}

.direction-visibility-panel.open {
  display: block;
}

.direction-visibility-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-purchase-weak);
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 28px;
  position: absolute;
  top: 6px;
  right: 6px;
}

.direction-visibility-close:hover {
  background: color-mix(in srgb, var(--fill-purchase) 82%, white);
  color: var(--text);
}

.direction-visibility-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.direction-visibility-column {
  padding: 4px 20px 0 2px;
  background: transparent;
}

.direction-visibility-column + .direction-visibility-column {
  border-left: 1px solid var(--stroke-purchase-strong);
  padding-left: 20px;
  padding-right: 2px;
}

.direction-visibility-language {
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--text-brand-weak);
  font-weight: 600;
}

.direction-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.direction-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 30px;
  cursor: pointer;
  user-select: none;
}

.direction-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.direction-check-box {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1.5px solid var(--stroke-neutral-middle);
  border-radius: 4px;
  background: #fff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.direction-check-box svg {
  width: 13px;
  height: 13px;
  display: block;
}

.direction-check-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.direction-check input:checked + .direction-check-box {
  border-color: var(--text-brand-weak);
  background: var(--text-brand-weak);
  color: #fff;
}

.direction-check-locked {
  cursor: default;
}

.direction-check-locked .direction-check-label {
  color: var(--text);
}

.direction-check-locked .direction-check-box {
  border-color: var(--text-brand-weak);
  background: var(--text-brand-weak);
  color: #fff;
}

.direction-check input:disabled + .direction-check-box {
  opacity: 1;
}

.pair-modal {
  max-width: 520px;
}

.pair-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 36px;
}

.pair-modal-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.config-label { font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

.lang-pair {
  display: flex; align-items: center; gap: 8px; flex: 1 1 520px;
}

.custom-lang-select {
  position: relative;
  min-width: 180px;
}

.custom-lang-select-import {
  min-width: 0;
  width: 100%;
}

.lang-pair .custom-lang-select {
  flex: 0 0 180px;
}

.lang-select-native {
  position: absolute;
  inset: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.custom-lang-trigger {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 10px;
  border: 1.5px solid var(--select-border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  text-align: left;
}

.custom-lang-trigger:focus,
.custom-lang-trigger:active,
.custom-lang-select.open .custom-lang-trigger {
  border-width: 1.5px;
  border-color: var(--select-active);
  outline: none;
}

.custom-lang-chevron {
  color: var(--text-brand-weak);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.12s ease;
}

.custom-lang-select.open .custom-lang-chevron {
  transform: rotate(180deg);
}

.custom-lang-labels {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.custom-lang-native {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-lang-english {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-lang-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(320px, 100vw - 32px);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  z-index: 240;
  display: none;
}

.custom-lang-select-import .custom-lang-panel {
  width: 100%;
}

.custom-lang-select.open .custom-lang-panel {
  display: block;
}

.custom-lang-search-wrap {
  margin-bottom: 8px;
}

.custom-lang-search {
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  border: 1.5px solid var(--select-border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  outline: none;
}

.custom-lang-search:focus {
  border-width: 1.5px;
  border-color: var(--select-active);
}

.custom-lang-options {
  max-height: 280px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.custom-lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.custom-lang-option:hover,
.custom-lang-option.is-selected {
  background: var(--fill-brand);
}

.custom-lang-check {
  color: var(--text-brand-strong);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.custom-lang-empty {
  padding: 12px 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.lang-select {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 34px 9px 10px;
  border: 1.5px solid var(--select-border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%237e88bb' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.lang-select:focus {
  border-width: 2px;
  border-color: var(--select-active);
}

.lang-select:active {
  border-width: 2px;
  border-color: var(--select-active);
}

.arrow-icon { color: var(--text-hint); font-size: 16px; }

.divider { width: 1px; height: 28px; background: var(--border); }

/* Column config button + panel */
.col-config-dropdown {
  position: relative;
}

.col-config-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 9px 10px;
  background: var(--surface2);
  border: 1.5px solid var(--select-border);
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  transition: border-color 0.15s, background 0.15s;
}

.col-config-btn:hover {
  border-color: var(--border-hover);
  background: var(--surface);
}

.col-config-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--accent);
  color: #fff;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

.col-config-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 230px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 10px 16px;
  z-index: 200;
}

.col-config-dropdown.open .col-config-panel {
  display: block;
}

/* TTS settings panel */
.tts-settings-panel {
  width: 280px;
  left: auto;
  right: 0;
}

.tts-panel-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-hint);
  margin-bottom: 2px;
}

.tts-setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}

.tts-setting-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  width: 48px;
  flex-shrink: 0;
}

.tts-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.tts-slider-wrap input[type=range] {
  flex: 1;
  accent-color: var(--text-brand-strong);
  cursor: pointer;
}

.tts-slider-val {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 30px;
  text-align: right;
}

.tts-voice-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px 0;
}

.tts-voice-row + .tts-voice-row {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 10px;
}

.tts-voice-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tts-voice-select-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.tts-voice-select {
  flex: 1;
  min-width: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 34px 9px 10px;
  border: 1.5px solid var(--select-border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%237e88bb' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.tts-voice-select:focus {
  border-width: 2px;
  border-color: var(--select-active);
}

.tts-test-btn {
  flex-shrink: 0;
  width: 32px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.tts-test-btn:hover { border-color: var(--border-hover); color: var(--text); background: var(--surface); }
.tts-test-btn.speaking { color: var(--text-brand-strong); border-color: var(--text-brand-weak); background: var(--fill-brand); }

.col-config-header {
  display: none;
}

.col-config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.col-config-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.col-config-item-caption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.col-config-divider {
  height: 1px;
  background: var(--border);
}

.col-config-toggle-locked {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.stat-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  box-shadow: none;
  flex: 1; min-width: 110px;
}

.stat-card .label { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.stat-card .value { font-size: 22px; font-weight: 600; color: var(--text); line-height: 1; }
.stat-card.green .value { color: var(--accent); }
.stat-card.blue .value { color: var(--accent2); }
.stat-card.amber .value { color: var(--amber); }

/* Table */
.table-wrap {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  overflow: hidden;
}

.category-toolbar {
  margin-bottom: 12px;
}

.category-toolbar-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-toolbar-default-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-toolbar-bulk-slot {
  display: none;
  align-items: center;
  gap: 8px;
}

.category-selection-summary {
  display: none;
  margin: 0;
  padding: 0 4px 0 0;
  font-size: 14px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-brand-strong);
  line-height: 1.2;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-toolbar.action-mode .category-selection-summary {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.category-toolbar.action-mode .category-toolbar-default-cluster {
  display: none !important;
}

.category-toolbar.action-mode .category-toolbar-bulk-slot {
  display: flex;
}

.category-path-shell {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-width: 0;
  padding-left: 16px;
}

.category-toolbar.action-mode .category-path-shell {
  padding-left: 0;
  gap: 10px;
}

.category-selection-back-btn {
  display: none;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  margin-right: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-brand-strong);
  cursor: pointer;
}

.category-selection-back-btn:hover {
  background: var(--brand-50);
}

.category-toolbar.action-mode .category-selection-back-btn {
  display: inline-flex;
}

.category-toolbar.action-mode .category-path {
  display: none;
}

.category-path {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  padding-left: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-path::-webkit-scrollbar {
  display: none;
}

.category-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.category-path-item {
  display: inline-flex;
  align-items: center;
  border: none;
  background: transparent;
  color: var(--text-neutral-weak);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
  white-space: nowrap;
}

.category-path-item.current {
  color: var(--text-brand-strong);
  cursor: default;
}

.category-path-sep {
  color: var(--text-neutral-weak);
  display: inline-flex;
  align-items: center;
  margin: 0 4px;
  line-height: 0;
}

.table-head {
  display: grid;
  gap: 0;
  background: var(--stroke-brand-weak);
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
}

.th {
  padding: 10px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-brand-strong);
}

.th:empty { text-align: center; padding: 10px 0; }
.th-num { text-align: center; color: var(--text-brand-strong); }
.th.lang1 { color: var(--text-brand-strong); text-align: center; padding-left: 0; }
.th.lang2 { color: var(--text-brand-strong); text-align: center; padding-left: 0; }
.th.photo { color: var(--text-brand-strong); text-align: center; }
.th.gender,
.th.trans,
.th.sample { text-align: center; }
.th-trans1,
.th-trans2 {
  color: var(--text-brand-strong);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.rows-body { display: flex; flex-direction: column; }

.vocab-row {
  display: grid;
  gap: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 6px 8px;
  overflow: visible;
  transition: background 0.1s;
  animation: rowIn 0.18s ease;
}

.vocab-row:last-child { border-bottom: none; }
.vocab-row:hover { background: var(--brand-50); }
.vocab-row:focus-within {
  background: var(--brand-50);
}

.vocab-row-lead {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 32px;
}

.vocab-row-select-wrap {
  display: none;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0;
  cursor: pointer;
}

.vocab-row-checkbox,
.category-row-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vocab-row-checkbox-box {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1.5px solid var(--stroke-neutral-middle);
  border-radius: 4px;
  background: #fff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.vocab-row-checkbox-box svg {
  width: 13px;
  height: 13px;
  display: block;
}

.vocab-row-checkbox:checked + .vocab-row-checkbox-box,
.category-row-checkbox:checked + .vocab-row-checkbox-box {
  border-color: var(--text-brand-weak);
  background: var(--text-brand-weak);
  color: #fff;
}

.vocab-row-checkbox:focus-visible + .vocab-row-checkbox-box,
.category-row-checkbox:focus-visible + .vocab-row-checkbox-box {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.table-wrap.action-mode .vocab-row-select-wrap {
  display: flex;
}

.table-wrap.action-mode .vocab-row-num {
  display: none;
}

.table-wrap.action-mode .vocab-row-checkbox-box {
  cursor: pointer;
}

.table-wrap.action-mode .th-num {
  opacity: 0;
  pointer-events: none;
}

.table-wrap.action-mode .vocab-row .del-row-btn {
  display: none;
}

.table-wrap.action-mode .cat-header-row .cat-header-actions {
  display: none !important;
}

.vocab-row-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-brand-weak);
  line-height: 1;
}

@keyframes rowIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}


/* Word cell (input + TTS button wrapper) */
.word-cell {
  display: flex;
  align-items: stretch;
  position: relative;
  min-width: 0;
  gap: 2px;
  overflow: visible;
}
.col-divider {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
  width: 0.5px;
}
.col-divider::before {
  content: '';
  display: block;
  width: 0.5px;
  height: 30%;
  background: var(--border);
}
.word-cell:has(.lang2) { margin-left: 12px; }
.tts-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-hint);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  transition: color 0.12s, background 0.12s;
}
.tts-btn:hover { color: var(--text-brand-strong); background: var(--stroke-brand-weak); }
.tts-btn.speaking { color: var(--text-brand-strong); background: var(--stroke-brand-weak); }

.word-input {
  display: block;
  width: 100%;
  min-width: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 10px 10px;
  outline: none;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
}

.word-display {
  width: 100%;
  display: block;
  padding: 8px 10px 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: text;
}

.word-display-text {
  display: block;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.word-display.is-empty {
  color: var(--text-hint);
}

.word-cell .word-input {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
}

.word-cell:hover .word-display {
  border-color: transparent;
  background: var(--brand-25);
}

.word-cell.is-editing .word-display,
.word-cell:focus-within .word-display {
  visibility: hidden;
}

.word-cell.is-editing .word-input,
.word-cell:focus-within .word-input {
  opacity: 1;
  pointer-events: auto;
}

.word-input::placeholder { color: var(--text-hint); }
.word-input:hover { border-color: transparent; background: var(--brand-25); }
.word-input:focus {
  border-color: var(--text-brand-weak);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(26,79,173,0.1);
}
.word-input.lang2:focus {
  border-color: var(--text-brand-weak);
  box-shadow: 0 0 0 3px rgba(76,99,217,0.1);
}

.transcription-input {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-style: normal;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}

.transcription-input::placeholder { color: var(--text-hint); font-style: italic; }
.transcription-input:hover { border-color: transparent; background: var(--brand-25); }
.transcription-input:focus { border-color: var(--accent2); background: var(--surface); box-shadow: 0 0 0 3px rgba(26,79,173,0.1); }
.transcription-input.t2:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(76,99,217,0.1); }

.th.trans { color: var(--text-brand-strong); font-style: normal; }

.sample-input {
  display: block;
  width: 100%;
  min-width: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 10px 10px;
  outline: none;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
  resize: none;
  overflow: hidden;
}

.sample-input::placeholder { color: var(--text-hint); }
.sample-input:hover { border-color: transparent; background: var(--brand-25); }
.sample-input:focus { border-color: var(--accent2); background: var(--surface); box-shadow: 0 0 0 3px rgba(26,79,173,0.1); }
.sample-input.s2:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(76,99,217,0.1); }

.gender-trigger {
  width: 60%;
  max-width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 7px;
  outline: none;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}

.gender-trigger:hover {
  border-color: transparent;
  background-color: var(--brand-25);
}

.gender-trigger:focus {
  border-color: var(--text-brand-weak);
  box-shadow: 0 0 0 3px rgba(26,79,173,0.1);
}

.gender-trigger.is-empty {
  color: var(--text-hint);
}

.gender-cell {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 0 6px 0 12px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gender-cell.is-editing {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}

.gender-inline-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 2px 0;
}

.gender-inline-confirm {
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-brand-strong);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  padding: 2px 4px;
  cursor: pointer;
  transition: color 0.12s, transform 0.12s;
}

.gender-inline-confirm:hover {
  color: var(--text-brand-weak);
}

.gender-inline-confirm:focus {
  outline: none;
  color: var(--text-brand-weak);
}

.gender-inline-empty {
  color: var(--text-hint);
  font-size: 12px;
  font-weight: 500;
}

/* Transcription toggle */
.trans-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted); font-weight: 500;
  cursor: pointer; user-select: none;
}

.trans-toggle input[type=checkbox] { display: none; }

.toggle-track {
  width: 32px; height: 18px;
  background: var(--border);
  border-radius: 99px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-thumb {
  width: 12px; height: 12px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px; left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.trans-toggle input:checked + .toggle-track { background: var(--accent2); }
.trans-toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(14px); }

.trans-toggles { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.trans-toggles-label { font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* Hide/show transcription columns */
.hide-trans1 .th-trans1,
.hide-trans1 .td-trans1 { display: none; }
.hide-trans2 .th-trans2,
.hide-trans2 .td-trans2 { display: none; }

/* Hide/show samples columns */
.hide-samples1 .th-samples1,
.hide-samples1 .td-samples1 { display: none; }
.hide-samples2 .th-samples2,
.hide-samples2 .td-samples2 { display: none; }

/* Hide/show gender columns */
.hide-gender1 .th-gender1,
.hide-gender1 .td-gender1 { display: none; }
.hide-gender2 .th-gender2,
.hide-gender2 .td-gender2 { display: none; }

.hide-photo .th.photo,
.hide-photo .img-cell { display: none; }

/* Grid template is managed dynamically via JS (updateColumnVisibility) */

/* Image cell */
.img-cell {
  position: relative;
  width: 90px;
  height: 60px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--stroke-brand-middle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background: var(--surface2);
  transition: border-color 0.15s, background 0.15s;
  margin: 0 auto;
}

.img-cell:hover { border-color: var(--stroke-brand-strong); background: var(--fill-brand); }
.img-cell.has-img { border-style: solid; border-color: var(--border); cursor: zoom-in; }
.img-cell.has-img:hover { border-color: var(--border-hover); background: var(--surface2); }

.img-cell img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: calc(var(--radius-sm) - 2px);
  display: block;
}

.img-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  pointer-events: none;
  color: var(--text-hint);
}

.img-placeholder span { font-size: 10px; font-weight: 500; }

.img-cell input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0;
}

.img-remove-btn {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 12px;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center; justify-content: center;
  line-height: 1;
  z-index: 2;
  padding: 0;
}

.img-cell:hover .img-remove-btn { display: flex; }

/* Image lightbox */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex; align-items: center; justify-content: center;
  z-index: 400;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  cursor: zoom-out;
}

.lightbox-overlay.open { opacity: 1; pointer-events: all; }

.lightbox-img {
  max-width: 90vw; max-height: 88vh;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  object-fit: contain;
  cursor: default;
}

/* Delete row */
.del-row-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-hint);
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0;
  justify-self: end;
  align-self: center;
  position: relative;
  transition: background 0.12s, color 0.12s;
}

/* Separator between row content (e.g. image / last field) and delete */
.vocab-row > .del-row-btn::before {
  content: '';
  position: absolute;
  right: 100%;
  margin-right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 22px;
  width: 1px;
  background: var(--border);
}

.del-row-btn:hover { background: var(--danger-light); color: var(--danger); }

/* Import drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 1.5rem;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.drop-zone svg { display: block; margin: 0 auto 8px; opacity: 0.5; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 24px 28px;
  max-width: 440px;
  width: 90%;
  transform: translateY(10px);
  transition: transform 0.2s;
}

/* Severity dialog panel: solid overlay base + translucent token on top (::before). */
.modal.severity-success,
.modal.severity-warning,
.modal.severity-error {
  position: relative;
  isolation: isolate;
  background: var(--background-overlay-color);
}
.modal.severity-success::before,
.modal.severity-warning::before,
.modal.severity-error::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}
.modal.severity-success > *,
.modal.severity-warning > *,
.modal.severity-error > * {
  position: relative;
  z-index: 1;
}
.modal.severity-success::before {
  background: var(--green-50);
}
.modal.severity-warning::before {
  background: var(--amber-50);
}
.modal.severity-error::before {
  background: var(--red-50);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal h2 { font-family: 'DM Sans', sans-serif; font-size: 18px; margin-bottom: 10px; color: #1d2450; }
.modal p { font-size: var(--dialog-text-size); color: var(--text-muted); margin-bottom: 10px; line-height: 1.6; }
#deleteCatModal .modal p,
#deleteItemsModal .modal p,
#deleteRecordModal .modal p {
  margin-bottom: 32px;
}
.clear-modal-list {
  list-style: none;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.clear-modal-list li {
  font-size: var(--dialog-text-size);
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--surface2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.clear-modal-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-brand-weak);
  flex-shrink: 0;
}
.modal .modal-btns { display: flex; gap: 8px; justify-content: flex-end; }
.modal .modal-btns .btn { font-size: var(--dialog-button-text-size); font-weight: 700; padding: 10px 16px; flex: 1; }

.message-dialog.modal .modal-btns .btn {
  flex: 0 0 auto;
}

.startup-message-dialog.modal {
  max-width: min(520px, calc(100vw - 24px));
}

.startup-message-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.startup-message-dialog-head h2 {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.startup-message-dialog-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: -4px -4px 0 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.startup-message-dialog-copy:hover {
  background: var(--surface-muted, rgba(0, 0, 0, 0.06));
  color: var(--text-brand-strong);
}

.startup-message-dialog-copy.is-copied {
  color: var(--text-brand-strong);
}

.startup-message-dialog-copy-icon {
  display: inline-flex;
  line-height: 0;
}

.startup-message-dialog-lead {
  font-size: var(--dialog-text-size);
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 10px;
}

.startup-message-dialog-details {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: min(40vh, 240px);
  overflow-y: auto;
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.instruction-modal.modal {
  max-width: min(560px, calc(100vw - 24px));
}

.instruction-dialog-body {
  font-size: var(--dialog-text-size);
  color: var(--text-muted);
  line-height: 1.55;
  max-height: min(55vh, 420px);
  overflow-y: auto;
  margin-bottom: 12px;
}

.instruction-dialog-body p {
  margin: 0 0 10px;
}

.instruction-dialog-body p:last-child {
  margin-bottom: 0;
}

.instruction-dialog-body ul {
  margin: 6px 0 14px;
  padding-left: 1.35em;
}

.instruction-dialog-body li {
  margin-bottom: 5px;
}

.instruction-dialog-body li:last-child {
  margin-bottom: 0;
}

.instruction-dialog-body h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #1d2450;
  margin: 18px 0 8px;
}

.instruction-dialog-body .instruction-dialog-mail {
  color: var(--text-brand-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.instruction-dialog-body .instruction-dialog-mail:hover {
  color: var(--text);
}

.instruction-modal .modal-btns .btn {
  flex: 0 0 auto;
  min-width: 112px;
}

.header-instruction-btn {
  min-width: 38px;
  justify-content: center;
  padding-left: 10px;
  padding-right: 10px;
}

.gender-picker-modal {
  max-width: 420px;
  background: #fff;
}

.gender-picker-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 18px;
}

.gender-option {
  min-width: 0;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  --gender-color: var(--text-brand-weak);
  --gender-color-unchecked: rgba(95, 113, 219, 0.13);
  --gender-color-checked: rgba(95, 113, 219, 1);
  --gender-text-unchecked: rgba(95, 113, 219, 0.63);
  --gender-text-checked: #fff;
  border: 1px solid var(--gender-color-unchecked);
  border-radius: 999px;
  background: var(--gender-color-unchecked);
  color: var(--gender-text-unchecked);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
  padding: 2px 6px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s, box-shadow 0.12s;
}

.gender-option:hover {
  border-color: var(--gender-color-checked);
  background: var(--gender-color-unchecked);
  color: var(--gender-text-unchecked);
}

.gender-option:focus {
  outline: none;
}

.gender-option.selected {
  border-color: var(--gender-color-checked);
  background: var(--gender-color-checked);
  color: var(--gender-text-checked);
  box-shadow: inset 0 0 0 1px var(--gender-color-checked);
}

.gender-option.selected:focus {
  box-shadow: inset 0 0 0 1px var(--gender-color-checked);
}

.gender-picker-empty {
  margin-top: 14px;
}

.import-modal-overlay {
  z-index: 260;
}

.import-modal {
  position: relative;
  background: var(--background-overlay-color);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  width: min(660px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  transform: translateY(10px);
  transition: transform 0.2s;
}

.import-modal-overlay.open .import-modal {
  transform: translateY(0);
}

.import-progress-overlay {
  z-index: 270;
}

.import-progress-modal {
  background: var(--background-overlay-color);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  width: min(420px, calc(100vw - 32px));
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.import-progress-modal h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  color: #1d2450;
  margin: 0;
}

.import-progress-modal p {
  font-size: var(--dialog-text-size);
  color: #4d5478;
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.import-progress-track {
  width: 100%;
  height: 10px;
  background: rgba(181, 187, 216, 0.28);
  border-radius: 999px;
  overflow: hidden;
}

.import-progress-bar {
  width: 0%;
  height: 100%;
  background: #5f71db;
  border-radius: 999px;
  transition: width 0.12s ease;
}

.import-progress-overlay.is-indeterminate .import-progress-bar {
  width: 38%;
  animation: indeterminateProgress 1.05s ease-in-out infinite;
}

@keyframes indeterminateProgress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

.import-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #8d91b1;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.import-modal-header {
  padding-right: 54px;
}

.import-modal-header h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: 24px;
  line-height: 1.05;
  color: #1d2450;
  margin-bottom: 12px;
}

.import-modal-header p {
  font-size: var(--dialog-text-size);
  line-height: 1.45;
  color: #4d5478;
  max-width: 600px;
}

.export-modal-top-words-block {
  margin-top: 14px;
}

.export-modal-top-words-block[hidden] {
  display: none !important;
}

.import-modal-lang-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 0 16px 0 0;
}

.export-modal {
  width: min(560px, calc(100vw - 32px));
}

.export-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.export-modal-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #38406a;
  font-size: 14px;
  font-weight: 700;
}

.export-modal-input {
  width: 100%;
}

.import-lang-select {
  min-height: 48px;
  border-radius: 12px;
  border: 1.5px solid var(--select-border);
  background: transparent;
  color: #525b85;
  font-size: 14px;
  font-weight: 500;
  padding: 0 40px 0 14px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%237e88bb' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.import-lang-select:focus {
  border-width: 2px;
  border-color: var(--select-active);
}

.import-lang-select:active {
  border-width: 2px;
  border-color: var(--select-active);
}

.import-mapping-scroll {
  overflow: auto;
  padding-right: 6px;
}

.import-mapping-sections {
  display: grid;
  gap: 18px;
}

.import-map-card {
  background: transparent;
  border: 1.5px solid var(--select-border);
  border-radius: 12px;
  padding: 16px;
}

.import-map-card h3 {
  font-family: 'DM Sans', sans-serif;
  color: #1d2450;
  font-size: var(--dialog-text-caption);
  margin-bottom: 8px;
}

.import-map-divider {
  height: 1.5px;
  background: rgba(181, 187, 216, 0.5);
  border-radius: 999px;
  margin-bottom: 12px;
}

.import-map-grid {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(220px, 1.3fr);
  gap: 10px 18px;
  align-items: center;
}

.import-map-label {
  color: #283155;
  font-size: var(--dialog-text-size);
  font-weight: 500;
}

.import-map-required {
  color: #5268d7;
}

.import-map-dropdown {
  position: relative;
  width: 100%;
}

.import-map-trigger {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 12px;
  border: 1.5px solid var(--select-border);
  background-color: var(--surface);
  color: #525b85;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 0 12px 0 14px;
  outline: none;
  box-shadow: none;
  cursor: pointer;
  text-align: left;
}

.import-map-trigger:focus,
.import-map-trigger:active,
.import-map-dropdown.open .import-map-trigger {
  border-width: 1.5px;
  border-color: var(--select-active);
  box-shadow: 0 0 0 2px rgba(76, 99, 217, 0.08);
}

.import-map-selected-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-map-chevron {
  color: var(--text-brand-weak);
  display: inline-flex;
  flex-shrink: 0;
}

.import-map-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  z-index: 280;
  display: none;
  max-height: 240px;
  overflow: auto;
}

.import-map-dropdown.open .import-map-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.import-map-option {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #525b85;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.import-map-option span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-map-option:hover,
.import-map-option.is-selected {
  background: var(--fill-brand);
}

.import-map-hint {
  margin-top: 8px;
  font-size: 13px;
  color: #7b81a4;
}

.import-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.import-modal-footer .btn {
  font-size: var(--dialog-button-text-size);
  font-weight: 700;
  padding: 10px 16px;
  min-width: 190px;
}

.PrimaryButton {
  background: var(--text-brand-strong);
  border-color: var(--text-brand-strong);
  color: var(--background-color);
  border-radius: 10px;
  border-width: 1.5px;
  text-align: center;
  justify-content: center;
}

.PrimaryButton:hover {
  background: var(--text-brand-strong);
  border-color: var(--text-brand-strong);
}

.SecondaryButton {
  background: transparent;
  border-color: var(--text-brand-weak);
  color: var(--text-brand-strong);
  border-radius: 10px;
  border-width: 1.5px;
  text-align: center;
  justify-content: center;
}

.SecondaryButton:hover {
  background: var(--fill-brand-opaque);
  border-color: var(--text-brand-weak);
  color: var(--text-brand-strong);
}

.SecondaryButton:focus,
.SecondaryButton:active {
  border-width: 1.5px;
}

/* Button severity: add e.g. severity-warning alongside PrimaryButton / SecondaryButton / SecondaryNeutralButton (default = omit = normal). */
.PrimaryButton.severity-success {
  background: var(--green-1000);
  border-color: var(--green-1000);
  color: var(--background-color);
}
.PrimaryButton.severity-success:hover {
  background: var(--green-800);
  border-color: var(--green-800);
}

.PrimaryButton.severity-warning {
  background: var(--amber-1000);
  border-color: var(--amber-1000);
  color: var(--background-color);
}
.PrimaryButton.severity-warning:hover {
  background: var(--amber-800);
  border-color: var(--amber-800);
}

.PrimaryButton.severity-error {
  background: var(--red-1000);
  border-color: var(--red-1000);
  color: var(--background-color);
}
.PrimaryButton.severity-error:hover {
  background: var(--red-800);
  border-color: var(--red-800);
}

.SecondaryButton.severity-success {
  background: transparent;
  border-color: var(--green-1000);
  color: var(--green-1000);
}
.SecondaryButton.severity-success:hover {
  background: var(--green-50);
  border-color: var(--green-1000);
  color: var(--green-1000);
}

.SecondaryButton.severity-warning {
  background: transparent;
  border-color: var(--amber-1000);
  color: var(--amber-1000);
}
.SecondaryButton.severity-warning:hover {
  background: var(--amber-50);
  border-color: var(--amber-1000);
  color: var(--amber-1000);
}

.SecondaryButton.severity-error {
  background: transparent;
  border-color: var(--red-1000);
  color: var(--red-1000);
}
.SecondaryButton.severity-error:hover {
  background: var(--red-50);
  border-color: var(--red-1000);
  color: var(--red-1000);
}

.SecondaryNeutralButton.severity-success {
  border-color: var(--green-1000);
  color: var(--green-1000);
}
.SecondaryNeutralButton.severity-success:hover {
  background: var(--green-50);
  border-color: var(--green-1000);
  color: var(--green-1000);
}

.SecondaryNeutralButton.severity-warning {
  border-color: var(--amber-1000);
  color: var(--amber-1000);
}
.SecondaryNeutralButton.severity-warning:hover {
  background: var(--amber-50);
  border-color: var(--amber-1000);
  color: var(--amber-1000);
}

.SecondaryNeutralButton.severity-error {
  border-color: var(--red-1000);
  color: var(--red-1000);
}
.SecondaryNeutralButton.severity-error:hover {
  background: var(--red-50);
  border-color: var(--red-1000);
  color: var(--red-1000);
}

.clear-all-btn {
  font-weight: 600;
}

.settings-modal {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  width: min(920px, calc(100vw - 32px));
  max-width: 100%;
  min-height: min(560px, calc(100vh - 48px));
  transform: translateY(10px);
  transition: transform 0.2s;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
}

.modal-overlay.open .settings-modal {
  transform: translateY(0);
}

.settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.settings-modal-header h2 {
  margin-bottom: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 24px;
  line-height: 1.1;
  color: #1d2450;
}

.settings-modal-header p {
  color: var(--text-brand-weak);
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
}

.settings-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-hint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.settings-sidebar {
  background: var(--fill-brand-weak-opaque);
  border-right: 1.5px solid var(--border);
  padding: 34px 28px 28px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.settings-content {
  position: relative;
  padding: 34px 44px 36px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-tab {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  padding: 9px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.settings-tab.active {
  color: var(--text-brand-strong);
  font-weight: 700;
  background: var(--fill-brand);
}

.settings-tab:not(.active):hover {
  background: var(--fill-neutral);
  color: var(--text-neutral-strong);
}

.settings-tab-accent {
  width: 3px;
  align-self: stretch;
  border-radius: 999px;
  background: transparent;
}

.settings-tab.active .settings-tab-accent {
  background: var(--text-brand-weak);
}

.settings-page {
  display: none;
}

.settings-page.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

.settings-page-title {
  color: #1d2450;
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--border);
}

.settings-panel {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: auto;
}

.settings-panel p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.5;
  max-width: 460px;
}

.settings-about-list {
  padding: 0;
}

.settings-stats-list {
  padding: 0;
}

.settings-data-list {
  padding: 0;
}

.settings-about-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0;
}

.settings-data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0;
}

.settings-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0;
}

.settings-about-row span {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.settings-data-row span {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.settings-stats-row span {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.settings-about-row strong {
  color: #1d2450;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.settings-data-row strong {
  color: #1d2450;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.settings-stats-row strong {
  color: #1d2450;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.settings-stats-row.green strong { color: var(--accent); }
.settings-stats-row.blue strong { color: var(--accent2); }
.settings-stats-row.amber strong { color: var(--amber); }

.SecondaryNeutralButton {
  background: transparent;
  border-color: var(--stroke-neutral-middle);
  color: var(--text-neutral-strong);
  border-radius: 10px;
  border-width: 1.5px;
  text-align: center;
  justify-content: center;
}

.SecondaryNeutralButton:hover {
  background: var(--fill-neutral);
  border-color: var(--stroke-neutral-middle);
  color: var(--text-neutral-strong);
}

.SecondaryNeutralButton:focus,
.SecondaryNeutralButton:active {
  border-width: 1.5px;
}

.import-confirm-btn {
  border-radius: 14px;
  font-size: var(--dialog-button-text-size);
  justify-content: center;
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: #1c1a17; color: #e8e5df;
  padding: 10px 20px; border-radius: 99px;
  font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 300;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* Responsive */
@media (max-width: 500px) {
  .header-inner { padding: 0 1rem; gap: 8px; }
  .logo span { display: none; }
  main { padding: 1rem; }
  /* Lang pair row: full-width picker; all toolbar buttons on the row below */
  .direction-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .direction-toolbar-main {
    flex-basis: 100%;
    width: 100%;
    min-width: 0;
  }
  .direction-toolbar-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .direction-picker {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .direction-toolbar-utility {
    margin-left: auto;
    flex-shrink: 0;
    justify-content: flex-end;
  }
  .direction-visibility-header {
    flex-direction: column;
    align-items: stretch;
  }
  .direction-visibility-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .pair-modal-grid {
    grid-template-columns: 1fr;
  }
  /* Stacked languages: full-width blocks, no faux column gutter / vertical rule */
  .direction-visibility-column {
    padding: 4px 12px 0;
  }
  .direction-visibility-column + .direction-visibility-column {
    border-left: none;
    padding-left: 12px;
    padding-right: 12px;
  }
  .img-cell { width: 70px; }
  .img-cell { width: 64px; height: 46px; }
  .import-modal {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 12px);
    border-radius: 16px;
    padding: 22px 18px 18px;
  }
  .import-modal-header h2 {
    font-size: 28px;
  }
  .import-modal-lang-row {
    grid-template-columns: 1fr;
  }
  .import-map-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .import-confirm-btn {
    width: 100%;
  }
  .import-modal-footer {
    flex-direction: column-reverse;
  }
  .settings-modal {
    width: calc(100vw - 18px);
    min-height: auto;
    max-height: calc(100vh - 18px);
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .settings-sidebar {
    border-right: none;
    border-bottom: 1.5px solid var(--border);
    padding: 22px 18px 16px;
  }
  .settings-content {
    padding: 22px 18px 18px;
  }
  .settings-tabs {
    gap: 8px;
  }
  .settings-panel {
    align-items: stretch;
    flex-direction: column;
  }
  .settings-about-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .settings-about-row strong {
    text-align: left;
  }
}
