  :root {
    color-scheme: dark;
    --bg: #14111a;
    --surface: #1e1a26;
    --surface-2: #2a2433;
    --border: #3a3345;
    --text: #f2eef7;
    --text-dim: #a89cba;
    --primary: #ffb59a;
    --danger: #ff6b6b;
    --warn: #f5c451;
    --ok: #6bdb8f;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
  }

  /* ─────────────────────────────────────────
     Login screen
  ───────────────────────────────────────── */
  #login-screen {
    max-width: 360px;
    margin: 80px auto;
    padding: 28px;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
  }
  #login-screen h2 { margin-top: 0; }
  #login-error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 16px; }

  /* ─────────────────────────────────────────
     App shell — sidebar + main area
  ───────────────────────────────────────── */
  #app {
    display: none;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
  }

  /* ─────────────────────────────────────────
     Sidebar
  ───────────────────────────────────────── */
  .sidebar {
    width: 220px;
    flex: none;
    height: 100%;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Logo */
  .sb-logo {
    padding: 18px 16px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    flex: none;
  }
  .sb-logo-mark {
    width: 32px; height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; color: #3a1a0d;
    flex: none; letter-spacing: -0.5px;
  }
  .sb-logo-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.1; }
  .sb-logo-sub  { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }

  /* Nav */
  .sb-nav {
    flex: 1;
    padding: 10px 8px 4px;
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .sb-group { margin-bottom: 4px; }
  .sb-group-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-dim); padding: 8px 10px 4px; font-weight: 600;
    opacity: 0.7;
  }
  .sb-item {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; border-radius: 8px;
    color: var(--text-dim); text-decoration: none;
    font-size: 13px; font-weight: 500;
    transition: background 0.12s, color 0.12s;
    cursor: pointer; position: relative;
  }
  .sb-item:hover { background: var(--surface-2); color: var(--text); }
  .sb-item.active {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary);
  }
  .sb-item.active .sb-icon { opacity: 1; }
  .sb-icon { font-size: 15px; width: 20px; text-align: center; flex: none; opacity: 0.8; }
  .sb-label { flex: 1; }
  .nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: #ef4444; color: #fff;
    font-size: 10px; font-weight: 700; line-height: 1;
    min-width: 16px; height: 16px; border-radius: 999px;
    padding: 0 4px; letter-spacing: 0;
  }

  /* Footer */
  .sb-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .sb-user {
    display: flex; align-items: center; gap: 8px; min-width: 0;
  }
  .sb-avatar {
    width: 26px; height: 26px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--text-dim); font-weight: 600; flex: none;
  }
  #whoami {
    font-size: 12px; color: var(--text-dim);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
  }
  .sb-footer-btns { display: flex; gap: 6px; }
  .sb-footer-btns button { flex: 1; font-size: 12px; padding: 7px 8px; }

  /* ─────────────────────────────────────────
     Main content area (right of sidebar)
  ───────────────────────────────────────── */
  .page-body {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
  }
  .page-header { margin-bottom: 20px; max-width: 720px; margin-inline: auto; }
  .page-header h1 { margin: 0 0 4px; font-size: 22px; }
  .page-header p { margin: 0; color: var(--text-dim); font-size: 13px; }
  .page-content { max-width: 720px; margin-inline: auto; }
  .page-content.wide { max-width: 1120px; }
  .page-content.wide ~ .page-header, .page-header.wide { max-width: 1120px; }

  /* Characters page: two-view layout (list ↔ edit) */
  #characters-view {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  #list-view, #edit-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }

  /* ─────────────────────────────────────────
     Buttons & inputs
  ───────────────────────────────────────── */
  button {
    background: var(--primary);
    color: #3a1a0d;
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
  }
  button.secondary { background: var(--surface-2); color: var(--text); }
  button.danger    { background: var(--danger); color: #3a0d0d; }
  button.ok        { background: var(--ok); color: #0d3a1a; }
  button:disabled  { opacity: 0.5; cursor: default; }

  input, select, textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
  }
  input[type="file"] { padding: 6px; }
  textarea { resize: vertical; min-height: 80px; }
  label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 6px;
  }
  .field { margin-bottom: 16px; }
  .hint  { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

  /* ─────────────────────────────────────────
     Characters — toolbar, filters, table
  ───────────────────────────────────────── */
  .chars-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
  .chars-header-row h1 { margin: 0 0 4px; font-size: 22px; }
  .chars-header-row p { margin: 0; color: var(--text-dim); font-size: 13px; }
  .chars-header-row p b { color: var(--text); font-weight: 600; }

  .chars-toolbar { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 12px; align-items: center; }
  .chars-toolbar input { flex: 1 1 260px; max-width: 420px; }
  .chars-toolbar select { width: auto; min-width: 180px; }
  button.link-btn { background: none; color: var(--primary); padding: 6px 4px; font-weight: 600; }
  button.link-btn:hover { text-decoration: underline; }

  .filter-groups { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 16px; }
  .seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
  .seg-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); padding: 0 8px 0 6px; }
  .seg-btn { background: transparent; color: var(--text-dim); border-radius: 7px; padding: 5px 10px; font-size: 12px; font-weight: 600; }
  .seg-btn:hover { color: var(--text); background: var(--surface-2); }
  .seg-btn.active { background: var(--primary); color: #3a1a0d; }
  .seg-btn .cnt { font-weight: 500; opacity: 0.7; margin-left: 2px; }

  .edit-view-back { margin-bottom: 16px; }

  .table-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    overflow-x: auto;
  }
  .char-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .char-table thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--surface-2); text-align: left; padding: 10px 14px;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim);
    border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap; user-select: none;
  }
  .char-table thead th:hover { color: var(--text); }
  .char-table thead th.col-actions { cursor: default; }
  .char-table thead th .sort-arrow { display: inline-block; width: 10px; font-size: 10px; opacity: 0.8; }
  .char-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
  .char-table tbody tr:last-child td { border-bottom: none; }
  .char-table tbody tr { cursor: pointer; }
  .char-table tbody tr:hover td { background: var(--surface-2); }
  .char-table tbody tr.inactive-row td:not(.col-switch):not(.col-check) { opacity: 0.45; }
  .char-table .cell-char { display: flex; align-items: center; gap: 10px; min-width: 220px; }
  .char-table .cell-char img {
    width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none;
  }
  .char-table .cell-char .name { font-weight: 600; }
  .char-table .cell-char .bio {
    font-size: 12px; color: var(--text-dim); max-width: 280px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .char-table .cell-badges { display: flex; flex-wrap: wrap; gap: 4px; }
  .char-table .cell-char-text { min-width: 0; }
  .char-table .avatar-missing {
    width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
    border: 1px dashed var(--border); color: var(--text-dim); font-size: 13px;
  }
  .char-table td.muted { color: var(--text-dim); }
  .char-table td.nowrap { white-space: nowrap; }
  .muted { color: var(--text-dim); }
  .char-table .col-check { width: 36px; padding-right: 0; }
  .char-table .col-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
  .char-table thead th.col-check { cursor: default; }
  .char-table .col-switch { width: 70px; text-align: center; }
  .char-table tbody tr.selected td { background: color-mix(in srgb, var(--primary) 10%, transparent); }
  .char-table .cell-actions { white-space: nowrap; text-align: right; width: 80px; }
  .icon-btn {
    background: transparent; color: var(--text-dim); border-radius: 8px;
    width: 30px; height: 30px; padding: 0; font-size: 14px; line-height: 30px;
  }
  .icon-btn:hover { background: var(--surface-2); color: var(--text); }
  button.icon-btn.danger { background: transparent; color: var(--text-dim); }
  button.icon-btn.danger:hover { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }

  /* ─────────────────────────────────────────
     Toggle switch
  ───────────────────────────────────────── */
  .switch { position: relative; display: inline-block; width: 34px; height: 20px; margin: 0; cursor: pointer; vertical-align: middle; text-transform: none; }
  .switch input { opacity: 0; width: 0; height: 0; position: absolute; }
  .switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border); transition: background 0.15s; }
  .switch span::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
    border-radius: 50%; background: var(--text-dim); transition: transform 0.15s, background 0.15s;
  }
  .switch input:checked + span { background: color-mix(in srgb, var(--ok) 45%, var(--surface-2)); }
  .switch input:checked + span::after { transform: translateX(14px); background: var(--ok); }
  .switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

  /* ─────────────────────────────────────────
     Avatar zoom preview
  ───────────────────────────────────────── */
  .avatar-preview {
    position: fixed; top: 0; left: 0; z-index: 50; pointer-events: none;
    width: 320px; height: 320px; border-radius: 14px; overflow: hidden;
    background: var(--surface-2); border: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  }
  .avatar-preview[hidden] { display: none; }
  .avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .char-table .cell-char img { cursor: zoom-in; }

  /* ─────────────────────────────────────────
     Bulk action bar
  ───────────────────────────────────────── */
  .bulk-bar {
    position: sticky; bottom: 0; margin-top: 12px; z-index: 2;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 10px 14px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--primary);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.35);
  }
  .bulk-bar[hidden] { display: none; }
  .bulk-bar #bulk-count { margin-right: 8px; font-size: 13px; }
  .bulk-bar button { padding: 6px 12px; font-size: 12px; }
  .char-table-empty { padding: 40px; text-align: center; color: var(--text-dim); cursor: default; }

  /* ─────────────────────────────────────────
     Badges
  ───────────────────────────────────────── */
  .badge {
    font-size: 10px; padding: 2px 6px; border-radius: 999px;
    background: var(--surface-2); color: var(--text-dim); white-space: nowrap;
  }
  .badge.official  { background: var(--primary); color: #3a1a0d; }
  .badge.pending   { background: var(--warn); color: #3a2e0d; }
  .badge.revision  { background: var(--warn); color: #3a2e0d; }
  .badge.rejected  { background: var(--danger); color: #3a0d0d; }
  .badge.approved  { background: var(--ok); color: #0d3a1a; }
  .badge.inactive  { background: var(--border); color: var(--text-dim); }
  .badge.ios-hidden{ background: var(--border); color: var(--text-dim); }
  .badge.private   { background: transparent; color: var(--text-dim); border: 1px dashed var(--text-dim); }
  .char-row.inactive-row { opacity: 0.55; }
  .char-row.inactive-row:hover { opacity: 0.8; }

  /* ─────────────────────────────────────────
     Info card / diff view
  ───────────────────────────────────────── */
  .info-card {
    padding: 12px 16px; border-radius: 10px; margin-bottom: 20px;
    background: var(--surface-2); border: 1px solid var(--border); font-size: 13px;
  }
  .info-card .row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
  .info-card .row .k { color: var(--text-dim); }
  .info-card .row .v { text-align: right; }
  .diff-row { padding: 8px 0; border-top: 1px solid var(--border); }
  .diff-row:first-of-type { border-top: none; }
  .diff-row .diff-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 4px; }
  .diff-row .diff-old { color: var(--danger); text-decoration: line-through; opacity: 0.7; font-size: 13px; }
  .diff-row .diff-new { color: var(--ok); font-size: 13px; }

  /* ─────────────────────────────────────────
     Stat tiles (character engagement)
  ───────────────────────────────────────── */
  .stat-tiles {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
  }
  .stat-tile {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  }
  .stat-tile .n { font-size: 18px; font-weight: 700; line-height: 1.1; }
  .stat-tile .n .sub { font-size: 13px; font-weight: 400; color: var(--text-dim); }
  .stat-tile .l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-top: 3px; }
  .stat-tile[title] { cursor: help; }

  /* ─────────────────────────────────────────
     Edit pane (character editor)
  ───────────────────────────────────────── */
  .edit-pane .empty { color: var(--text-dim); text-align: center; margin-top: 100px; }
  .edit-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .grid-2 .field { margin-bottom: 0; }
  .form-section {
    border: 1px solid var(--border); border-radius: 12px;
    padding: 18px 18px 4px; margin-bottom: 18px; background: var(--surface);
  }
  .form-section > h3 {
    margin: 0 0 14px; font-size: 12px; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-dim);
  }
  .form-section > h3 .opt { text-transform: none; letter-spacing: 0; color: var(--text-dim); font-weight: 400; }
  .form-section > *:last-child { margin-bottom: 14px; }
  label .hint { text-transform: none; letter-spacing: 0; display: inline; margin: 0; }

  /* ─────────────────────────────────────────
     Voice cards
  ───────────────────────────────────────── */
  .vc-accent-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin: 24px 0 10px; }
  .vc-accent-title:first-child { margin-top: 4px; }
  .voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
  .voice-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface); }
  .voice-card.inactive { opacity: 0.55; }
  .voice-card.editing { grid-column: 1 / -1; }
  .voice-card .vc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
  .voice-card .vc-name { font-weight: 600; font-size: 14px; }
  .voice-card .vc-sub { font-size: 12px; color: var(--text-dim); font-family: monospace; margin-top: 2px; word-break: break-all; }
  .voice-card .vc-play {
    width: 38px; height: 38px; border-radius: 50%; padding: 0; font-size: 15px; flex: none;
    display: flex; align-items: center; justify-content: center;
  }
  .voice-card .vc-tags { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
  .voice-card .vc-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-dim); }
  .voice-card .vc-fields { display: none; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
  .voice-card.editing .vc-fields { display: block; }
  .voice-card .vc-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .voice-card .vc-row > label { margin: 0; }
  .checkbox-row { display: flex; align-items: center; gap: 8px; }
  .checkbox-row input { width: auto; }
  .vc-section { margin-bottom: 16px; }
  .vc-section:last-child { margin-bottom: 0; }
  .vc-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin-bottom: 8px; font-weight: 600; }
  .vc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 12px; }
  .vc-grid .field { margin-bottom: 0; }
  .vc-grid label { margin-bottom: 4px; }
  .vc-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 2px; }
  .voice-card details.vc-advanced { margin-top: 16px; }
  .voice-card details.vc-advanced summary {
    cursor: pointer; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-dim); font-weight: 600; padding: 8px 10px;
    background: var(--surface-2); border-radius: 8px; list-style: none;
    display: flex; align-items: center; gap: 6px;
  }
  .voice-card details.vc-advanced summary::-webkit-details-marker { display: none; }
  .voice-card details.vc-advanced summary::before { content: '▸'; font-size: 10px; transition: transform 0.15s; }
  .voice-card details.vc-advanced[open] summary::before { transform: rotate(90deg); }
  .voice-card details.vc-advanced summary .vc-model-hint {
    text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-dim); margin-left: auto;
  }
  .voice-card details.vc-advanced .vc-section:first-of-type { margin-top: 14px; }
  .vc-info {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border);
    font-size: 10px; font-weight: 700; font-style: italic; font-family: Georgia, serif; padding: 0;
    cursor: pointer; vertical-align: middle; margin-left: 4px; line-height: 1;
  }
  .vc-info:hover, .vc-info:focus-visible { background: var(--primary); color: #3a1a0d; border-color: var(--primary); }
  #info-modal-body code {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12px;
  }

  /* ─────────────────────────────────────────
     Misc: actions row, avatar, approval, gallery
  ───────────────────────────────────────── */
  .actions { display: flex; gap: 10px; margin-top: 24px; align-items: center; }
  #save-status { font-size: 13px; color: var(--text-dim); margin-left: 8px; }
  .avatar-row { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
  .avatar-row img {
    width: 140px; height: 140px; border-radius: 14px; object-fit: cover; background: var(--surface-2);
    border: 1px solid var(--border);
  }
  .approval-banner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-radius: 10px; margin-bottom: 20px;
    background: var(--surface-2); border: 1px solid var(--border);
  }
  .approval-banner .status-label { font-size: 13px; font-weight: 600; }
  .approval-actions { display: flex; gap: 8px; }
  .section-title {
    font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-dim); margin: 28px 0 12px;
  }
  .section-title[title] { cursor: help; border-bottom: 1px dotted var(--border); width: fit-content; }
  .gallery-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-bottom: 14px;
  }
  .gallery-item {
    position: relative; border-radius: 10px; overflow: hidden;
    background: var(--surface-2); border: 1px solid var(--border); aspect-ratio: 9 / 16;
  }
  .gallery-item img, .gallery-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
  .gallery-item .main-badge {
    position: absolute; top: 6px; left: 6px; font-size: 9px; padding: 2px 6px; border-radius: 999px;
    background: var(--primary); color: #3a1a0d; font-weight: 700;
  }
  .gallery-item .type-badge {
    position: absolute; top: 6px; right: 6px; font-size: 9px; padding: 2px 6px; border-radius: 999px;
    background: rgba(0,0,0,0.6); color: #fff;
  }
  .gallery-item .item-actions {
    position: absolute; bottom: 0; left: 0; width: 100%; display: flex; gap: 4px; padding: 6px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  }
  .gallery-item .item-actions button { flex: 1; font-size: 10px; padding: 4px 6px; border-radius: 6px; }
  .gallery-upload-row { display: flex; gap: 10px; }
  .gallery-upload-row label.upload-btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-2); color: var(--text); border: 1px dashed var(--border);
    border-radius: 8px; padding: 10px 16px; cursor: pointer; font-size: 13px; margin: 0;
  }
  .gallery-upload-row input[type="file"] { display: none; }

  .category-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .category-row input[type="text"] { flex: 1; }
  .category-row input[type="number"] { width: 70px; }
  .category-row .checkbox-row { width: auto; margin: 0; }

  /* ─────────────────────────────────────────
     Modal overlay (moderation, detail panels)
  ───────────────────────────────────────── */
  .modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 40px 20px; overflow-y: auto; z-index: 100;
  }
  .modal-panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    max-width: 620px; width: 100%; padding: 22px; margin-bottom: 40px;
  }
  .modal-panel .modal-close {
    float: right; background: var(--surface-2); color: var(--text-dim);
    width: 28px; height: 28px; border-radius: 50%; padding: 0; font-size: 14px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
  }
  .row-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
  .row-list .list-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px;
  }
  .row-list .list-row:last-child { border-bottom: none; }
  .row-list .list-row:hover { background: var(--surface-2); }
  .row-list .list-row .rl-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .row-list .list-row .rl-reason { font-weight: 600; }
  .row-list .list-row .rl-dim { color: var(--text-dim); font-size: 12px; }
  .row-list .list-row .rl-chevron { color: var(--text-dim); }

  /* ─────────────────────────────────────────
     Legacy: tab-btn kept for any in-page tabs
  ───────────────────────────────────────── */
  .tab-nav { display: flex; gap: 6px; }
  .tab-btn {
    background: var(--surface-2); color: var(--text); border: none; border-radius: 999px;
    padding: 8px 16px; font-weight: 600; cursor: pointer; font-size: 14px;
    text-decoration: none; display: inline-block;
  }
  .tab-btn.active { background: var(--primary); color: #3a1a0d; }
  a.tab-btn:hover { filter: brightness(1.1); }
