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

    :root {
      --bg: #f3f4f6;
      --surface: #ffffff;
      --border: #e5e7eb;
      --text: #111827;
      --muted: #6b7280;
      --primary: #2563eb;
      --primary-h: #1d4ed8;
      --danger: #dc2626;
      --success: #16a34a;
      --radius: 8px;
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      background: var(--bg);
      color: var(--text);
      height: 100vh;
      overflow: hidden;
      font-size: 14px;
    }

    .shell { display: flex; height: 100vh; }

    .sidenav {
      width: 52px;
      flex-shrink: 0;
      background: var(--surface);
      border-right: 1px solid var(--border);
      display: none;
      flex-direction: column;
      align-items: center;
      padding: max(8px, env(safe-area-inset-top)) 0 8px;
      gap: 2px;
    }
    .sidenav.visible { display: flex; }

    .sidenav-item {
      position: relative;
      width: 36px;
      height: 36px;
      border-radius: 8px;
      border: none;
      background: none;
      cursor: pointer;
      font-size: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background .12s;
    }
    .dc-nav-badge {
      position: absolute;
      top: 2px;
      right: 2px;
      background: #dc2626;
      color: #fff;
      font-size: 9px;
      font-weight: 700;
      min-width: 14px;
      height: 14px;
      padding: 0 3px;
      border-radius: 99px;
      line-height: 14px;
      text-align: center;
      pointer-events: none;
    }
    .sidenav-item:hover { background: var(--bg); }
    .sidenav-item.active { background: rgba(37,99,235,.1); }

    #app { flex: 1; overflow-y: auto; min-width: 0; }

    /* ── Layout ── */
    .container { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
    .header { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
    .spacer { flex: 1; }

    /* ── Buttons ── */
    .btn {
      display: inline-flex; align-items: center; gap: 5px;
      padding: 7px 14px; border-radius: var(--radius); border: none;
      font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.12s, opacity 0.12s;
      font-family: inherit; white-space: nowrap;
    }
    .btn:disabled { opacity: 0.4; cursor: not-allowed; }
    .btn-primary  { background: var(--primary); color: #fff; }
    .btn-primary:hover:not(:disabled) { background: var(--primary-h); }
    .btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
    .btn-secondary:hover:not(:disabled) { background: var(--bg); }
    .btn-danger   { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
    .btn-danger:hover:not(:disabled)  { background: #fef2f2; }
    .btn-success  { background: var(--success); color: #fff; }
    .btn-success:hover:not(:disabled) { background: #15803d; }
    .btn-ghost    { background: transparent; color: var(--muted); padding: 6px 10px; }
    .btn-ghost:hover:not(:disabled)   { background: var(--border); color: var(--text); }
    .btn-sm       { padding: 5px 10px; font-size: 12px; }

    /* ── Cards ── */
    .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
    .card + .card, .card + .card-sm { margin-top: 10px; }
    .card.no-pad { padding: 0; overflow: hidden; }
    .card-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 14px; }

    /* ── Forms ── */
    .form-group { margin-bottom: 14px; }
    .form-group:last-child { margin-bottom: 0; }
    .form-group label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 5px; }
    .form-group input, .form-group textarea, .form-group select {
      width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius);
      font-size: 14px; font-family: inherit; background: var(--surface); color: var(--text);
    }
    .form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
    .form-group textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
    .form-row { display: flex; gap: 12px; }
    .form-row .form-group { flex: 1; }
    .form-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
    .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

    /* ── Color picker row ── */
    .color-row { display: flex; align-items: center; gap: 8px; }
    .color-row input[type="color"] { width: 38px; height: 34px; padding: 2px 3px; border-radius: var(--radius); cursor: pointer; flex-shrink: 0; }
    .color-row input[type="text"]  { flex: 1; }

    /* ── Setup ── */
    .setup-wrap { display: flex; align-items: center; justify-content: center; min-height: 90vh; padding: 16px; }
    .setup-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 36px; max-width: 460px; width: 100%; }
    .setup-card h1 { font-size: 22px; margin-bottom: 6px; }
    .setup-card .sub { color: var(--muted); margin-bottom: 28px; line-height: 1.5; }
    .option-btn {
      width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
      background: var(--surface); cursor: pointer; text-align: left; margin-bottom: 10px;
      transition: border-color .15s, box-shadow .15s; font-family: inherit;
    }
    .option-btn:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
    .option-btn strong { display: block; font-size: 14px; margin-bottom: 3px; color: var(--text); }
    .option-btn span { font-size: 12px; color: var(--muted); }
    #github-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }

    /* ── Category rows (multi-exam) ── */
    .cat-row {
      display: flex; align-items: center; gap: 14px;
      padding: 14px 16px; border-radius: 18px;
      background: var(--surface); border: 1px solid var(--border);
      cursor: pointer; text-align: left; width: 100%; margin-bottom: 10px;
      font-family: inherit; transition: border-color .15s, box-shadow .15s;
      position: relative;
    }
    .cat-row:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
    .cat-icon-box {
      width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
    }
    .cat-emoji { font-size: 22px; line-height: 1; }
    .cat-info { flex: 1; min-width: 0; }
    .cat-title { font-weight: 600; font-size: 14px; }
    .cat-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }
    .cat-arrow { color: var(--muted); font-size: 18px; flex-shrink: 0; margin-left: 4px; }

    /* ── 2-column tile grid (single exams) ── */
    .tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
    .tile-card {
      border-radius: 18px; border: 1px solid var(--border); background: var(--surface);
      cursor: pointer; font-family: inherit; text-align: left;
      transition: border-color .15s, box-shadow .15s;
      display: flex; flex-direction: column; min-height: 130px; padding: 0;
      position: relative;
    }
    .tile-card:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
    .tile-icon-area { padding: 14px 14px 6px; }
    .tile-icon-box { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
    .tile-emoji { font-size: 20px; line-height: 1; }
    .tile-body { padding: 6px 14px 14px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
    .tile-title { font-weight: 700; font-size: 13px; line-height: 1.3; color: var(--text); }
    .tile-count { font-size: 11px; color: var(--muted); margin-top: 3px; }

    /* ── Exam editor ── */
    .page-title { font-size: 18px; font-weight: 600; }

    /* ── Practice tests ── */
    .pt-item { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); gap: 12px; }
    .pt-item:last-child { border-bottom: none; padding-bottom: 0; }
    .pt-item:first-child { padding-top: 0; }
    .pt-body { flex: 1; }
    .pt-name { font-weight: 500; }
    .pt-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
    .pt-actions { display: flex; gap: 6px; flex-shrink: 0; }

    /* ── Country picker ── */
    .country-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
    .country-btn {
      display: flex; flex-direction: column; align-items: center; gap: 4px;
      padding: 8px 16px; border: 1.5px solid var(--border); border-radius: var(--radius);
      background: var(--surface); cursor: pointer; font-family: inherit;
      transition: border-color .12s, background .12s;
    }
    .country-btn:hover:not(.country-btn-active) { border-color: #93c5fd; background: var(--bg); }
    .country-btn-active { border-color: var(--primary); background: #eff6ff; }
    .country-btn-flag { font-size: 26px; line-height: 1; }
    .country-btn-id { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; }
    .country-btn-active .country-btn-id { color: var(--primary); }
    .country-btn-add { border-style: dashed; }
    .country-btn-add .country-btn-flag { font-size: 20px; color: var(--muted); }
    .country-btn-add .country-btn-id { color: var(--muted); }
    .country-btn-add:hover { border-color: var(--primary); background: var(--bg); }

    /* ── Tabs ── */
    .tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; }
    .tabs::-webkit-scrollbar { height: 3px; }
    .tabs::-webkit-scrollbar-track { background: transparent; }
    .tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
    .tab {
      padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border);
      background: var(--surface); font-size: 13px; cursor: pointer; white-space: nowrap;
      font-family: inherit; transition: background .12s;
    }
    .tab:hover:not(.tab-active) { background: var(--bg); }
    .tab.tab-active { background: var(--primary); color: #fff; border-color: var(--primary); }
    .tab-count { opacity: .75; font-size: 12px; }

    /* ── Toolbar ── */
    .toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
    .toolbar input { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; font-family: inherit; }
    .toolbar input:focus { outline: none; border-color: var(--primary); }

    /* ── Table ── */
    table { width: 100%; border-collapse: collapse; table-layout: fixed; }
    thead th { padding: 9px 12px; border-bottom: 2px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: left; font-weight: 600; }
    tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
    tbody tr:last-child td { border-bottom: none; }
    tbody tr.q-row { cursor: pointer; }
    tbody tr.q-row:hover td { background: #f9fafb; }
    .cell-id  { color: var(--muted); font-size: 12px; width: 52px; }
    .cell-q   { max-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cell-ans { width: 160px; color: var(--success); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cell-del { width: 36px; text-align: center; padding: 4px !important; }
    .btn-ctrl-jump { background: none; border: none; cursor: pointer; font-size: 11px; padding: 0 0 0 3px; opacity: 0.4; line-height: 1; vertical-align: middle; }
    .btn-ctrl-jump:hover { opacity: 1; }
    .table-footer { padding: 10px 12px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 13px; color: var(--muted); }

    /* ── Answer options ── */
    .ans-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
    .ans-row:last-child { margin-bottom: 0; }
    .ans-row input[type="radio"] { width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; accent-color: var(--primary); }
    .ans-letter { width: 18px; flex-shrink: 0; font-weight: 600; color: var(--muted); font-size: 13px; }
    .ans-row input[type="text"] { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; font-family: inherit; }
    .ans-row input[type="text"]:focus { outline: none; border-color: var(--primary); }

    /* ── Modal overlay ── */
    .overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
    .modal { background: var(--surface); border-radius: 12px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 24px; }
    .modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
    .modal-head h2 { font-size: 16px; font-weight: 600; }
    .modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }

    /* ── Toast ── */
    .toast {
      position: fixed; bottom: 20px; right: 20px; z-index: 200;
      padding: 10px 18px; border-radius: var(--radius);
      background: #1f2937; color: #fff; font-size: 13px;
      animation: toast-in .2s ease; box-shadow: 0 4px 12px rgba(0,0,0,.2);
    }
    .toast.toast-error { background: var(--danger); }
    @keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

    /* ── Symbol picker ── */
    .sym-pick-btn {
      width: 38px; height: 34px; padding: 0; border-radius: var(--radius);
      border: 1px solid var(--border); background: var(--surface);
      cursor: pointer; flex-shrink: 0; font-size: 18px; line-height: 1;
      display: flex; align-items: center; justify-content: center;
      transition: border-color .12s;
    }
    .sym-pick-btn:hover { border-color: var(--primary); }
    .sym-search { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; font-family: inherit; margin-bottom: 10px; }
    .sym-search:focus { outline: none; border-color: var(--primary); }
    .sym-grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 4px;
      max-height: 380px; overflow-y: auto; padding-right: 2px;
    }
    .sym-grid::-webkit-scrollbar { width: 4px; }
    .sym-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
    .sym-item {
      display: flex; flex-direction: column; align-items: center; gap: 3px;
      padding: 8px 4px; border-radius: 8px; cursor: pointer;
      border: 1.5px solid transparent; background: none; font-family: inherit;
      transition: background .1s, border-color .1s;
    }
    .sym-item:hover { background: var(--bg); border-color: var(--border); }
    .sym-item.sym-active { border-color: var(--primary); background: rgba(37,99,235,.06); }
    .sym-item-icon { font-size: 22px; line-height: 1; }
    .sym-item-abbr {
      font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.2px;
      color: var(--muted); background: var(--bg); border: 1px solid var(--border);
      border-radius: 5px; padding: 2px 4px; min-width: 28px; text-align: center;
    }
    .sym-item-name { font-size: 9px; color: var(--muted); text-align: center; line-height: 1.3; word-break: break-all; }
    .sym-status { font-size: 11px; color: var(--muted); margin-bottom: 8px; min-height: 16px; }

    /* ── Scoring mode toggle ── */
    .mode-toggle { display: flex; gap: 3px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; }
    .mode-btn { flex: 1; padding: 5px 12px; border: none; border-radius: calc(var(--radius) - 2px); font-size: 13px; font-weight: 500; cursor: pointer; background: transparent; color: var(--muted); font-family: inherit; transition: background 0.12s, color 0.12s; }
    .mode-btn-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

    /* ── Topic distribution rows ── */
    .dist-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
    .dist-row:last-child { margin-bottom: 0; }
    .dist-input { padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; font-family: inherit; background: var(--surface); color: var(--text); }
    .dist-input:focus { outline: none; border-color: var(--primary); }
    .dist-topic { flex: 1; }
    .dist-count { width: 64px; text-align: center; }
    .dist-pts { width: 64px; text-align: center; }

    /* ── Empty / misc ── */
    .empty-text { font-size: 13px; color: var(--muted); padding: 8px 0; }
    .breadcrumb { font-size: 13px; color: var(--muted); }
    .breadcrumb b { color: var(--text); font-weight: 500; }
    .divider { height: 1px; background: var(--border); margin: 16px 0; }

    /* ── Question list media column ── */
    .cell-media { width: 90px; text-align: center; }
    .q-thumb { width: 74px; height: 46px; object-fit: cover; border-radius: 5px; display: block; background: var(--bg); margin: 0 auto; }
    .q-video-badge { width: 74px; height: 46px; background: #1f2937; border-radius: 5px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; margin: 0 auto; }
    .q-ans-thumbs { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
    .q-ans-thumb { width: 32px; height: 32px; object-fit: cover; border-radius: 3px; background: var(--bg); display: block; }
    .q-ans-thumb-empty { width: 32px; height: 32px; display: block; }

    /* ── Question editor media ── */
    .qe-media-section-wrap { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; background: var(--bg); border-radius: 8px; padding: 10px; }
    .qe-media-preview-box { flex-shrink: 0; }
    .qe-media-controls { flex: 1; min-width: 0; }
    .qe-media-img { max-width: 160px; max-height: 120px; border-radius: 6px; object-fit: contain; display: block; }
    .qe-media-video { max-width: 200px; max-height: 120px; border-radius: 6px; display: block; }
    .qe-media-placeholder { width: 100px; height: 70px; background: #1f2937; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; }
    .qe-media-filename { font-size: 11px; color: var(--muted); word-break: break-all; display: block; margin-bottom: 6px; }
    .ans-media-row { padding: 2px 0 8px 34px; }
    .ans-media-controls { display: flex; align-items: center; gap: 8px; }
    .ans-thumb { width: 56px; height: 44px; object-fit: cover; border-radius: 5px; background: var(--bg); display: block; flex-shrink: 0; }
    /* ── Media modal preview ── */
    .mm-preview { max-width: 100%; max-height: 160px; border-radius: 6px; object-fit: contain; display: block; margin: 0 auto; }

    /* ── ODR notice ── */
    .odr-steps { list-style: none; padding: 0; margin: 0; }
    .odr-step { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
    .odr-step:last-child { border-bottom: none; padding-bottom: 0; }
    .odr-step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
    .odr-step-body { flex: 1; font-size: 13px; line-height: 1.5; }
    .odr-step-body strong { display: block; font-size: 13px; margin-bottom: 2px; }
    .odr-step-body code { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
    .odr-asset-box { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin-top: 10px; font-size: 12px; color: var(--muted); word-break: break-all; }

    /* ── Topic management ── */
    .topic-mgmt-header { display: flex; align-items: center; margin-bottom: 10px; }
    .topic-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
    .topic-row:last-child { border-bottom: none; padding-bottom: 0; }
    .topic-swatch { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
    .topic-label { flex: 1; font-size: 13px; font-weight: 500; }
    .topic-count { font-size: 12px; color: var(--muted); flex-shrink: 0; }

    /* ── Exam delete button ── */
    .exam-del-btn {
      position: absolute; top: 8px; right: 8px; z-index: 1;
      width: 22px; height: 22px; border-radius: 50%;
      border: 1px solid var(--border); background: var(--surface);
      color: var(--muted); font-size: 11px; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      line-height: 1; padding: 0; font-family: inherit;
      transition: background .12s, color .12s, border-color .12s;
    }
    .exam-del-btn:hover { background: #fef2f2; color: var(--danger); border-color: var(--danger); }
    .btn-danger-solid { background: var(--danger); color: #fff; border: none; }
    .btn-danger-solid:hover:not(:disabled) { background: #b91c1c; }

    /* ── Localization ── */
    .loc-wrap { display: flex; height: 100%; overflow: hidden; }

    /* ═══════════════════════════════════════════
       RESPONSIVE BREAKPOINTS
    ═══════════════════════════════════════════ */

    /* Tablet: ≤ 768px */
    @media (max-width: 768px) {
      .container { padding: 16px 12px; }

      /* Header: wrap buttons onto next line */
      .header { flex-wrap: wrap; gap: 6px; row-gap: 6px; }
      .header .spacer { flex-basis: 100%; height: 0; }
      .header .btn-ghost { padding: 5px 8px; font-size: 12px; }
      .header .page-title { flex: 1; }

      /* Form rows → stack vertically */
      .form-row { flex-direction: column; gap: 0; }

      /* Tile grid → 1 column */
      .tile-grid { grid-template-columns: 1fr; }

      /* Table: hide less important columns */
      .cell-ans { display: none; }
      .cell-id { width: 40px; font-size: 11px; }

      /* Modals: full width with more padding */
      .modal { max-width: 100%; border-radius: 12px 12px 0 0; position: fixed; bottom: 0; left: 0; right: 0; max-height: 92vh; }
      .overlay { align-items: flex-end; padding: 0; }

      /* Localization: sidebar hidden by default, toggled via class */
      .loc-sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 4px 0 16px rgba(0,0,0,.12); }
      .loc-sidebar.loc-sidebar-open { transform: translateX(0); }
      .loc-sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 49; }
      .loc-sidebar-overlay.visible { display: block; }
      .loc-topbar { padding: 10px 14px; }
      .loc-strings-list { padding: 0 14px 32px; }
      .loc-filter-bar { padding: 10px 14px; flex-wrap: wrap; }

      /* Localization string row: stack src + translation */
      .loc-row-body { grid-template-columns: 1fr; }

      /* Sidenav → bottom tab bar */
      .shell { flex-direction: column; }
      .sidenav { order: 2; width: 100%; height: auto; flex-direction: row; justify-content: space-around; padding: 6px 0 max(6px, env(safe-area-inset-bottom)); border-right: none; border-top: 1px solid var(--border); gap: 0; }
      .sidenav-item { flex: 1; height: 44px; width: auto; max-width: 80px; }
      #app { order: 1; }
      .toast { bottom: calc(60px + max(6px, env(safe-area-inset-bottom))); }
    }

    /* Mobile: ≤ 480px */
    @media (max-width: 480px) {
      body { font-size: 13px; }
      .container { padding: 12px 10px; }

      .header .btn { font-size: 12px; padding: 6px 10px; }
      .page-title { font-size: 15px; }

      .card { padding: 14px; }
      .card + .card, .card + .card-sm { margin-top: 8px; }

      .btn { padding: 6px 11px; font-size: 12px; }
      .btn-sm { padding: 4px 8px; font-size: 11px; }

      /* Practice test items: stack actions below meta */
      .pt-item { flex-wrap: wrap; }
      .pt-actions { width: 100%; justify-content: flex-end; margin-top: 6px; }

      /* Table pagination footer */
      .table-footer { flex-wrap: wrap; gap: 6px; }

      /* Tabs: smaller */
      .tab { padding: 4px 10px; font-size: 12px; }

      /* Toast: full width, above bottom nav */
      .toast { left: 10px; right: 10px; bottom: calc(58px + max(6px, env(safe-area-inset-bottom))); text-align: center; }

      /* Symbol picker grid: fewer columns */
      .sym-grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }

      /* Localization sidebar narrower */
      .loc-sidebar { width: 85vw; max-width: 280px; }
    }

    /* Sidebar */
    .loc-sidebar {
      width: 240px; flex-shrink: 0;
      border-right: 1px solid var(--border); background: var(--surface);
      display: flex; flex-direction: column; overflow: hidden;
    }
    .loc-sidebar-top { padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
    .loc-lang-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
    /* Language list */
    .loc-lang-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 8px;
    }
    .loc-lang-header-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
    .loc-lang-chip {
      font-size: 11px; font-weight: 700; color: var(--muted);
      background: var(--bg); border: 1px solid var(--border);
      border-radius: 5px; padding: 3px 7px; flex-shrink: 0;
      font-family: 'SF Mono', Consolas, monospace;
    }
    .loc-lang-chip-active { background: var(--primary); color: #fff; border-color: var(--primary); }
    .loc-lang-item {
      display: flex; align-items: center; gap: 8px;
      padding: 7px 0; border-bottom: 1px solid var(--border);
      cursor: pointer; border-radius: 0;
    }
    .loc-lang-item:last-of-type { border-bottom: none; }
    .loc-lang-item-active { background: rgba(37,99,235,.04); margin: 0 -16px; padding-left: 16px; padding-right: 16px; border-radius: 6px; }
    .loc-lang-item-body { flex: 1; min-width: 0; }
    .loc-lang-item-name { font-size: 12px; color: var(--text); display: block; }
    .loc-lang-src-badge {
      font-size: 10px; font-weight: 600; text-transform: uppercase;
      color: var(--muted); background: var(--bg); border: 1px solid var(--border);
      border-radius: 4px; padding: 1px 5px;
    }
    .loc-lang-mini-progress { display: flex; align-items: center; gap: 5px; margin-top: 3px; }
    .loc-lang-mini-bar { flex: 1; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
    .loc-lang-mini-fill { height: 100%; background: var(--success); border-radius: 2px; transition: width .3s; }
    .loc-lang-mini-label { font-size: 10px; color: var(--muted); white-space: nowrap; }
    .loc-lang-del-btn {
      width: 20px; height: 20px; border-radius: 50%;
      border: 1px solid transparent; background: none;
      color: var(--muted); font-size: 10px; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0; font-family: inherit; padding: 0;
      transition: background .1s, color .1s, border-color .1s;
    }
    .loc-lang-del-btn:hover { background: #fef2f2; color: var(--danger); border-color: var(--danger); }
    .loc-add-lang-row { display: flex; gap: 5px; align-items: center; }
    .loc-add-lang-input {
      flex: 1; padding: 5px 8px; border: 1px solid var(--border);
      border-radius: 5px; font-size: 12px; font-family: inherit;
      background: var(--surface); color: var(--text);
    }
    .loc-add-lang-input:focus { outline: none; border-color: var(--primary); }
    .loc-section-list { flex: 1; overflow-y: auto; padding: 6px 0; }
    .loc-section-list::-webkit-scrollbar { width: 3px; }
    .loc-section-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
    .loc-sec-btn {
      width: 100%; display: flex; align-items: center; gap: 8px;
      padding: 7px 16px; border: none; background: none; cursor: pointer;
      text-align: left; font-family: inherit; transition: background .1s;
    }
    .loc-sec-btn:hover { background: var(--bg); }
    .loc-sec-active { background: rgba(37,99,235,.06) !important; }
    .loc-sec-active .loc-sec-name { color: var(--primary); font-weight: 600; }
    .loc-sec-name { flex: 1; font-size: 13px; color: var(--text); line-height: 1.3; }
    .loc-sec-meta { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
    .loc-badge-todo {
      background: #fef3c7; color: #92400e; border: 1px solid #fbbf24;
      font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px;
    }
    .loc-badge-done { color: var(--success); font-size: 11px; }
    .loc-badge-count { font-size: 11px; color: var(--muted); }

    /* Main area */
    .loc-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
    .loc-topbar {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 20px; border-bottom: 1px solid var(--border);
      background: var(--surface); flex-shrink: 0;
    }
    .loc-topbar-title { font-size: 15px; font-weight: 600; }
    .loc-content { flex: 1; overflow-y: auto; }

    /* Filter bar */
    .loc-filter-bar {
      display: flex; gap: 6px; padding: 12px 24px;
      border-bottom: 1px solid var(--border);
      background: var(--surface); position: sticky; top: 0; z-index: 1;
    }
    .loc-flt {
      display: flex; align-items: center; gap: 5px;
      padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border);
      background: none; font-size: 12px; font-family: inherit;
      cursor: pointer; color: var(--muted); transition: background .1s, color .1s;
    }
    .loc-flt:hover { background: var(--bg); }
    .loc-flt-active { background: var(--primary); color: #fff; border-color: var(--primary); }
    .loc-flt-active .loc-flt-count { background: rgba(255,255,255,.25); color: #fff; }
    .loc-flt-count {
      background: var(--bg); border: 1px solid var(--border);
      border-radius: 10px; padding: 0 6px; font-size: 11px; font-weight: 600;
    }

    /* String rows */
    .loc-strings-list { padding: 0 24px 32px; }
    .loc-row { padding: 16px 0; border-bottom: 1px solid var(--border); }
    .loc-row:last-child { border-bottom: none; }
    .loc-row-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
    .loc-key {
      font-size: 11px; font-weight: 600; color: var(--muted);
      background: var(--bg); border: 1px solid var(--border);
      border-radius: 4px; padding: 2px 7px;
      font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
    }
    .loc-st {
      font-size: 11px; font-weight: 600; padding: 2px 8px;
      border-radius: 10px; flex-shrink: 0;
    }
    .st-ok   { background: #dcfce7; color: #166534; }
    .st-warn { background: #fef3c7; color: #92400e; }
    .st-miss { background: #f3f4f6; color: var(--muted); }
    .st-src  { background: #eff6ff; color: #1d4ed8; }
    .loc-comment { font-size: 11px; color: var(--muted); margin-bottom: 8px; font-style: italic; line-height: 1.4; }
    .loc-row-body { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
    .loc-src {
      font-size: 13px; color: var(--muted); line-height: 1.55;
      padding: 7px 10px; background: var(--bg); border-radius: var(--radius);
      min-height: 36px; word-break: break-word;
    }
    .loc-src em { font-style: normal; opacity: .4; }
    .loc-ta {
      width: 100%; padding: 7px 10px;
      border: 1px solid var(--border); border-radius: var(--radius);
      font-size: 13px; font-family: inherit; background: var(--surface); color: var(--text);
      resize: none; overflow: hidden; line-height: 1.55; min-height: 36px;
    }
    .loc-ta:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
    .loc-ta-full { width: 100%; }
    .loc-plural-notice {
      font-size: 12px; color: var(--muted); padding: 7px 10px;
      background: var(--bg); border-radius: var(--radius); font-style: italic;
    }
    .loc-empty-hint { text-align: center; color: var(--muted); padding: 80px 24px; font-size: 14px; }
    .loc-all-done { text-align: center; color: var(--muted); padding: 48px 24px; font-size: 14px; }

    /* ── Control review card (in question editor) ── */
    .ctrl-review-card {
      border-radius: var(--radius); border: 1px solid; border-left-width: 4px;
      padding: 12px 14px; margin-bottom: 12px;
    }
    .ctrl-review-warn  { background: #fffbeb; border-color: #fcd34d; border-left-color: #f59e0b; }
    .ctrl-review-ok    { background: #f0fdf4; border-color: #bbf7d0; border-left-color: var(--success); }
    .ctrl-review-stale { background: #eff6ff; border-color: #bfdbfe; border-left-color: #3b82f6; }
    .ctrl-review-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
    .ctrl-review-icon { font-size: 14px; font-weight: 700; flex-shrink: 0; }
    .ctrl-review-warn  .ctrl-review-icon { color: #f59e0b; }
    .ctrl-review-ok    .ctrl-review-icon { color: var(--success); }
    .ctrl-review-stale .ctrl-review-icon { color: #3b82f6; }
    .ctrl-review-title { font-size: 12px; font-weight: 600; color: var(--text); }
    .ctrl-review-flags { display: flex; gap: 6px; flex-wrap: wrap; }
    .ctrl-flag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
    .ctrl-flag-ok  { background: #dcfce7; color: #166534; }
    .ctrl-flag-bad { background: #fee2e2; color: #991b1b; }
    .ctrl-review-note {
      margin-top: 8px; font-size: 13px; line-height: 1.55; color: var(--text);
      padding: 8px 10px; background: rgba(0,0,0,.04); border-radius: 6px;
      white-space: pre-wrap;
    }

    /* ── Question Control ── */
    .ctrl-slider-wrap { position: relative; padding: 14px 0 6px; }
    .ctrl-slider-tooltip { position: absolute; top: 0; background: #1f2937; color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 4px; white-space: nowrap; pointer-events: none; transform: translateX(-50%); opacity: 0; transition: opacity .1s; }
    .ctrl-slider { width: 100%; height: 6px; -webkit-appearance: none; appearance: none; border-radius: 3px; outline: none; cursor: pointer; }
    .ctrl-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--primary); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
    .ctrl-slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--primary); cursor: pointer; border: none; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
    .ctrl-counter { display: flex; align-items: center; gap: 5px; }
    .ctrl-pos-input { width: 52px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: monospace; text-align: center; color: var(--text); background: var(--surface); -moz-appearance: textfield; }
    .ctrl-pos-input::-webkit-outer-spin-button, .ctrl-pos-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .ctrl-pos-input:focus { outline: none; border-color: var(--primary); }
    .ctrl-pos-sep { font-size: 13px; color: var(--muted); white-space: nowrap; }

    .ctrl-id-badge {
      display: inline-flex; align-items: center;
      padding: 3px 9px; background: var(--bg); border: 1px solid var(--border);
      border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--muted);
    }

    .ctrl-section { padding: 14px 0; border-bottom: 1px solid var(--border); }
    .ctrl-section:first-child { padding-top: 0; }
    .ctrl-section-label {
      font-size: 11px; font-weight: 600; text-transform: uppercase;
      letter-spacing: .06em; color: var(--muted); margin-bottom: 8px;
    }
    .ctrl-question-text { font-size: 15px; line-height: 1.65; color: var(--text); white-space: pre-wrap; }
    .ctrl-source-text {
      font-size: 13px; line-height: 1.6; color: var(--text);
      background: var(--bg); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 10px 12px;
      white-space: pre-wrap; max-height: 200px; overflow-y: auto;
    }
    .ctrl-explanation { font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }

    .ctrl-answers { display: flex; flex-direction: column; gap: 6px; }
    .ctrl-answer {
      display: flex; align-items: flex-start; gap: 10px;
      padding: 8px 12px; border-radius: var(--radius);
      border: 1px solid var(--border); background: var(--bg);
    }
    .ctrl-answer.ctrl-answer-correct { border-color: var(--success); background: #f0fdf4; }
    .ctrl-answer-letter { font-weight: 700; font-size: 13px; color: var(--muted); flex-shrink: 0; min-width: 22px; padding-top: 1px; }
    .ctrl-answer.ctrl-answer-correct .ctrl-answer-letter { color: var(--success); }
    .ctrl-answer-text { flex: 1; font-size: 14px; line-height: 1.5; color: var(--text); }
    .ctrl-answer-label { font-size: 12px; font-weight: 600; color: var(--muted); flex-shrink: 0; white-space: nowrap; }
    .ctrl-answer-tag { font-size: 12px; font-weight: 600; color: var(--success); flex-shrink: 0; white-space: nowrap; padding-top: 2px; }

    .ctrl-media-wrap { margin-top: 10px; }
    .ctrl-media-img { max-width: 100%; max-height: 280px; border-radius: var(--radius); object-fit: contain; display: block; }
    .ctrl-media-caption { font-size: 12px; color: var(--muted); margin-top: 5px; }
    .ctrl-ans-media { width: 80px; height: 55px; object-fit: cover; border-radius: 5px; background: var(--bg); display: block; margin-top: 5px; }

    .ctrl-checks { display: flex; flex-direction: column; gap: 12px; }
    .ctrl-check-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
    .ctrl-check-row input[type="checkbox"] { width: 17px; height: 17px; flex-shrink: 0; cursor: pointer; accent-color: var(--primary); }
    .ctrl-check-label { font-size: 14px; color: var(--text); user-select: none; }

    .ctrl-nav { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

    /* Control status badges in question-list table */
    .ctrl-badge {
      display: inline-flex; align-items: center; justify-content: center;
      width: 15px; height: 15px; border-radius: 50%;
      font-size: 9px; font-weight: 700;
      vertical-align: middle; margin-left: 4px; flex-shrink: 0;
    }
    .ctrl-badge-ok    { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
    .ctrl-badge-warn  { background: #fef9c3; color: #ca8a04; border: 1px solid #fef08a; }
    .ctrl-badge-none  { background: var(--bg); color: var(--border); border: 1px solid var(--border); }
    .ctrl-badge-stale { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }

    .ctrl-stale-banner {
      background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius);
      padding: 9px 14px; font-size: 13px; color: #1d4ed8; font-weight: 500;
      margin-top: 12px;
    }

    /* ── Overflow / More menu ── */
    .overflow-menu { position: relative; }
    .overflow-dropdown {
      position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
      background: var(--surface); border: 1px solid var(--border);
      border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,.12);
      min-width: 175px; padding: 4px 0;
    }
    .overflow-item {
      display: block; width: 100%; padding: 8px 14px; border: none;
      background: none; text-align: left; font-size: 13px; font-family: inherit;
      cursor: pointer; color: var(--text); transition: background .1s;
      white-space: nowrap;
    }
    .overflow-item:hover { background: var(--bg); }
    .overflow-item-danger { color: var(--danger); }
    .overflow-item-danger:hover { background: #fef2f2; }
    .overflow-separator { height: 1px; background: var(--border); margin: 4px 0; }

    /* form-footer supports spacer for left-aligned danger buttons */
    .form-footer .spacer { flex: 1; }

    /* ── Discord Feedback Screen ── */
    .dc-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
    .dc-tab { background: transparent; color: var(--muted); border: none; }
    .dc-tab:hover { background: var(--border); color: var(--text); }
    .dc-tab-active { background: var(--text) !important; color: #fff !important; }
    .dc-badge { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 99px; margin-left: 4px; background: rgba(255,255,255,.2); color: inherit; }
    .dc-tab:not(.dc-tab-active) .dc-badge { background: var(--bg); color: var(--text); }
    .dc-toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }

    .dc-group-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
    .dc-group-header:hover { background: var(--bg); }
    .dc-count { min-width: 28px; height: 28px; border-radius: 99px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; background: var(--bg); color: var(--muted); }
    .dc-count-hot { background: #fee2e2; color: var(--danger); }
    .dc-question { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .dc-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
    .dc-cat { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; margin-left: 6px; }
    .dc-edit-btn { background: none; border: none; padding: 0 0 0 8px; font-size: 11px; color: var(--muted); cursor: pointer; font-weight: 500; }
    .dc-edit-btn:hover { color: var(--text); }
    .dc-chevron { color: var(--muted); font-size: 11px; flex-shrink: 0; }

    .dc-reports { border-top: 1px solid var(--border); }
    .dc-report { padding: 12px 16px; border-bottom: 1px solid var(--border); }
    .dc-report:last-child { border-bottom: none; }
    .dc-report-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
    .dc-status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
    .dc-date { font-size: 12px; color: var(--muted); }
    .dc-link { margin-left: auto; font-size: 12px; color: #5865f2; text-decoration: none; font-weight: 500; white-space: nowrap; }
    .dc-link:hover { text-decoration: underline; }
    .dc-field { font-size: 13px; color: var(--text); margin-top: 2px; }
    .dc-field span { color: var(--muted); }
    .dc-note { font-style: italic; }
    .dc-explanation { background: #f8fafc; border-left: 3px solid #e2e8f0; padding: 6px 10px; border-radius: 0 4px 4px 0; margin-top: 4px; }
    .dc-react-btn { background: transparent; border: 1px solid var(--border); padding: 2px 6px; font-size: 14px; line-height: 1; cursor: pointer; border-radius: var(--radius); }
    .dc-react-btn:hover { background: var(--bg); }
    .dc-delete-btn { margin-left: auto; opacity: 0.4; }
    .dc-delete-btn:hover { opacity: 1; background: #fee2e2; border-color: #fca5a5; }

    .dc-filters { margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
    .dc-filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
    .dc-chip { background: var(--bg); border: 1px solid var(--border); color: var(--muted); border-radius: 99px; padding: 3px 10px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
    .dc-chip:hover { border-color: var(--text); color: var(--text); }
    .dc-chip-active { background: var(--text); color: #fff !important; border-color: var(--text); }
    .dc-chip-count { font-size: 11px; border-radius: 99px; padding: 0 5px; background: var(--surface); color: var(--text); }
    .dc-chip-active .dc-chip-count { background: rgba(255,255,255,.2); color: #fff; }
