    /* ── Themes ──────────────────────────────────────────────────── */
    :root {
      --bg:          #FFFFFF;
      --bg-sub:      #F7F7F7;
      --bg-hover:    #F1F1F1;
      --bg-focus:    oklch(0.97 0.02 192);
      --text:        #111111;
      --muted:       #8F8F8F;
      --faint:       #D8D8D8;
      --border:      #E8E8E8;
      --border-f:    oklch(0.75 0.09 192);
      --accent:      oklch(0.50 0.13 192);
      --accent-h:    oklch(0.44 0.13 192);
      --accent-lt:   oklch(0.95 0.04 192);
      --accent-mid:  oklch(0.72 0.09 192);
      --shadow-lg:   0 8px 32px rgba(0,0,0,0.10);
      --footer-bg:   oklch(0.50 0.13 192);
      --footer-text: rgba(255,255,255,0.85);
      --kbd-bg:      #F0F0F0;
      --kbd-b:       #D0D0D0;
      --hl-bg:       oklch(0.90 0.12 80);
      --hl-text:     #111;
      --edit-color:  oklch(0.52 0.18 25);

      /* Skala radius/spacing — diselaraskan dengan editor Marktaba */
      --radius-sm: 6px;
      --radius:    10px;
      --radius-lg: 16px;
      --space-2xs: 1px;
      --space-xs:  2px;
      --space-sm:  4px;
      --space-md:  6px;
      --space-lg:  8px;
      --space-xl:  10px;
      --space-2xl: 12px;
      --space-3xl: 14px;
    }
    [data-theme="dark"] {
      --bg:          #0E0E10;
      --bg-sub:      #161618;
      --bg-hover:    #1C1C1F;
      --bg-focus:    oklch(0.14 0.03 192);
      --text:        #EBEBEB;
      --muted:       #52525A;
      --faint:       #252530;
      --border:      #202025;
      --border-f:    oklch(0.55 0.12 192);
      --accent:      oklch(0.66 0.14 192);
      --accent-h:    oklch(0.72 0.14 192);
      --accent-lt:   oklch(0.18 0.05 192);
      --accent-mid:  oklch(0.42 0.10 192);
      --shadow-lg:   0 10px 40px rgba(0,0,0,0.60);
      --footer-bg:   oklch(0.28 0.05 192);
      --footer-text: oklch(0.78 0.05 192 / 0.9);
      --kbd-bg:      #1C1C1F;
      --kbd-b:       #2C2C32;
      --hl-bg:       oklch(0.32 0.10 80);
      --hl-text:     #fff;
      --edit-color:  oklch(0.62 0.18 25);
    }

    /* ── Reset ───────────────────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html, body { height: 100%; overflow: hidden; display: flex; flex-direction: column; }
    body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); font-size: 16px; transition: background 0.2s, color 0.2s; }

    /* Font Arab self-host — tidak bergantung CDN */
    @font-face { font-family: 'Scheherazade New'; src: url('/fonts/ScheherazadeNew-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
    @font-face { font-family: 'Scheherazade New'; src: url('/fonts/ScheherazadeNew-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
    @font-face { font-family: 'Scheherazade New'; src: url('/fonts/ScheherazadeNew-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
    @font-face { font-family: 'Scheherazade New'; src: url('/fonts/ScheherazadeNew-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
    /* Font teks Uthmani KFGQPC — untuk kutipan mushaf hasil shortcode {Q} */
    @font-face { font-family: 'KFGQPC HAFS Uthmanic'; src: url('/fonts/KFGQPC_HAFS_Uthmanic_Script_H.woff2') format('woff2'); font-weight: 400; font-display: swap; }

    ::-webkit-scrollbar { width: 4px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--faint); }

    /* ── Tooltip ─────────────────────────────────────────────────── */
    #ui-tooltip {
      position: fixed; background: rgba(20,20,24,0.92); color: #F0F0F0;
      font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 400;
      padding: 4px 9px; border-radius: var(--radius-sm); pointer-events: none;
      opacity: 0; transition: opacity 0.12s; z-index: 9999; white-space: nowrap;
      box-shadow: 0 2px 8px rgba(0,0,0,0.25); letter-spacing: 0.01em;
    }
    #ui-tooltip.visible { opacity: 1; }

    /* ── Topbar ──────────────────────────────────────────────────── */
    .topbar {
      height: 46px; display: flex; align-items: center;
      padding: 0 0.875rem; gap: 5px; flex-shrink: 0;
      border-bottom: 1px solid var(--border); background: var(--bg);
    }
    .topbar-title {
      font-weight: 600; font-size: 13px; letter-spacing: -0.015em; color: var(--text);
    }
    .topbar-nav {
      display: flex; align-items: center; gap: var(--space-xs);
      padding-left: 0.6rem; border-left: 1px solid var(--border); margin-left: 4px;
    }
    .topbar-link {
      height: 24px; padding: 0 8px; background: none; border: none;
      cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 400;
      border-radius: 5px; text-decoration: none; display: inline-flex;
      align-items: center; font-family: 'DM Sans', sans-serif; transition: color 0.13s;
    }
    .topbar-link:hover { color: var(--accent); }
    .topbar-link.active { color: var(--accent); font-weight: 500; }
    .topbar-sep { color: var(--faint); font-size: 12px; user-select: none; }
    .topbar-spacer { flex: 1; }
    .topbar-divider { width: 1px; height: 18px; background: var(--border); margin: 0 2px; flex-shrink: 0; }

    /* ── Buttons ─────────────────────────────────────────────────── */
    .icon-btn {
      width: 24px; height: 24px; display: flex; align-items: center;
      justify-content: center; background: none; border: 1px solid transparent;
      border-radius: 8px; cursor: pointer; color: var(--muted);
      transition: all 0.13s; line-height: 0; flex-shrink: 0;
    }
    .icon-btn:hover { background: var(--accent-lt); color: var(--text); border-color: transparent; }
    .icon-btn.active { background: var(--accent-lt); border-color: var(--border-f); color: var(--accent); }
    .icon-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }

    .lang-btn {
      height: 24px; padding: 0 9px; background: var(--bg-sub);
      border: 1px solid var(--border); border-radius: 7px; cursor: pointer;
      color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
      font-family: 'DM Sans', sans-serif; transition: all 0.13s; flex-shrink: 0;
    }
    .lang-btn:hover { color: var(--accent); border-color: var(--border-f); }

    /* File upload button (label wrapping input) */
    .upload-label {
      width: 24px; height: 24px; display: flex; align-items: center;
      justify-content: center; background: none; border: 1px solid transparent;
      border-radius: 8px; cursor: pointer; color: var(--muted);
      transition: all 0.13s; line-height: 0; flex-shrink: 0;
    }
    .upload-label:hover { background: var(--accent-lt); color: var(--text); }
    .upload-label svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }

    /* ── System Dropdown ─────────────────────────────────────────── */
    .sys-wrapper { position: relative; display: inline-flex; align-items: center; }
    #systemSelect { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
    .sys-trigger {
      display: flex; align-items: center; gap: var(--space-md); height: 28px; padding: 0 9px;
      background: var(--bg-sub); border: 1px solid var(--border);
      border-radius: 8px; cursor: pointer; color: var(--text); font-size: 12px;
      font-weight: 500; font-family: 'DM Sans', sans-serif; transition: border-color 0.15s;
      white-space: nowrap;
    }
    .sys-trigger:hover { border-color: var(--border-f); }
    .sys-trigger.open { border-color: var(--border-f); }
    .sys-trigger .sys-icon { color: var(--accent); line-height: 0; }
    .sys-trigger .sys-icon svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; display: block; }
    .sys-trigger .sys-chev { color: var(--muted); line-height: 0; transition: transform 0.2s; }
    .sys-trigger.open .sys-chev { transform: rotate(180deg); }
    .sys-trigger .sys-chev svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; display: block; }

    .sys-panel {
      display: none; position: absolute; top: calc(100% + 5px); left: 0;
      background: var(--bg); border: 1px solid var(--border);
      border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 500;
      min-width: 168px; overflow: hidden;
    }
    .sys-panel.open { display: block; }
    .sys-option {
      padding: 7px 12px; font-size: 12px; cursor: pointer;
      display: flex; align-items: center; gap: var(--space-lg);
      color: var(--text); background: transparent; font-family: 'DM Sans', sans-serif;
      transition: background 0.1s;
    }
    .sys-option:hover { background: var(--bg-hover); }
    .sys-option.selected { background: var(--accent-lt); color: var(--accent); font-weight: 600; }
    .sys-option.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
    .sys-option .opt-check { width: 13px; flex-shrink: 0; line-height: 0; }
    .sys-option .opt-check svg { width: 13px; height: 13px; stroke: var(--accent); fill: none; stroke-width: 2.2; display: block; opacity: 0; }
    .sys-option.selected .opt-check svg { opacity: 1; }
    .sys-option .opt-soon {
      margin-left: auto; font-size: 9px; font-weight: 600; letter-spacing: 0.05em;
      text-transform: uppercase; color: var(--accent-mid); background: var(--accent-lt);
      border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; flex-shrink: 0;
    }
    .sys-divider { height: 1px; background: var(--border); margin: 3px 0; }
    .sys-group-label {
      padding: 6px 10px 2px; font-size: 10px; font-weight: 700;
      letter-spacing: 0.08em; text-transform: uppercase;
      color: var(--muted); user-select: none;
    }
    .sys-option .opt-slug {
      margin-left: auto; font-size: 9px; font-weight: 600; letter-spacing: 0.05em;
      text-transform: uppercase; color: #6366f1; background: #ede9fe;
      border: 1px solid #c4b5fd; border-radius: 4px; padding: 1px 5px; flex-shrink: 0;
    }
    .dark .sys-option .opt-slug { color: #a5b4fc; background: #1e1b4b; border-color: #3730a3; }
    .sys-option .opt-desc {
      display: block; font-size: 10px; color: var(--muted); font-weight: 400;
      margin-top: 1px; line-height: 1.3;
    }

    /* ── Upload hint strip ───────────────────────────────────────── */
    #upload-hint {
      display: none; align-items: center; gap: 0.5rem;
      padding: 0 0.875rem; height: 28px;
      background: var(--bg-sub); border-bottom: 1px solid var(--border);
      font-size: 12px; color: var(--muted); flex-shrink: 0;
    }
    #upload-hint.show { display: flex; }
    #upload-hint.error { color: var(--edit-color); background: color-mix(in srgb, var(--edit-color) 10%, var(--bg-sub)); }
    #upload-hint .hint-close { margin-left: auto; cursor: pointer; color: var(--faint); font-size: 14px; line-height: 1; transition: color 0.13s; }
    #upload-hint .hint-close:hover { color: var(--muted); }

    /* ── Search strip ────────────────────────────────────────────── */
    #search-strip {
      display: none; align-items: center; gap: var(--space-lg);
      padding: 0 0.875rem; height: 36px;
      border-bottom: 1px solid var(--border); background: var(--bg-sub); flex-shrink: 0;
    }
    #search-strip.show { display: flex; }
    #search-strip .search-icon { color: var(--accent); line-height: 0; }
    #search-strip .search-icon svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; display: block; }
    #search-input {
      flex: 1; border: none; outline: none; background: transparent;
      font-size: 13px; color: var(--text); font-family: 'DM Sans', sans-serif;
    }
    #search-input::placeholder { color: var(--muted); }
    #search-count { font-size: 11px; color: var(--muted); flex-shrink: 0; }
    .search-nav-btn { background: none; border: none; cursor: pointer; color: var(--muted); line-height: 0; padding: 4px; border-radius: 4px; transition: color 0.13s, background 0.13s; }
    .search-nav-btn:hover { color: var(--accent); background: var(--accent-lt); }
    .search-nav-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; display: block; }
    .row-pair.search-current { outline: 2px solid var(--accent); outline-offset: -1px; }
    #search-clear { background: none; border: none; cursor: pointer; color: var(--muted); line-height: 0; padding: 4px; }
    #search-clear svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; display: block; }

    /* ── Pane headers ────────────────────────────────────────────── */
    #pane-headers {
      display: flex; flex-shrink: 0;
      border-bottom: 1px solid var(--border); padding-right: 4px;
    }
    #pane-headers::after {
      content: ''; width: 4px; background: var(--bg-sub);
      border-left: 1px solid var(--border); flex-shrink: 0;
    }
    .pane-header {
      display: flex; align-items: center; gap: 7px;
      padding: 0 1.25rem; height: 30px; background: var(--bg-sub);
    }
    .pane-header:first-child { width: 50%; flex-shrink: 0; }
    .pane-header:nth-child(2) { flex: 1; border-left: 1px solid var(--border); }
    .pane-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
    .pane-label { font-size: 10px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); }
    .pane-lang { font-size: 10px; color: var(--muted); }
    .pane-spacer { flex: 1; }
    .pane-btn {
      width: 24px; height: 24px; background: none; border: none; cursor: pointer;
      color: var(--muted); display: flex; align-items: center; justify-content: center;
      border-radius: 5px; transition: color 0.12s; line-height: 0;
    }
    .pane-btn:hover { color: var(--text); }
    .pane-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }

    /* ── Aligned view ────────────────────────────────────────────── */
    #aligned-view { flex: 1; min-height: 0; overflow-y: scroll; scrollbar-gutter: stable; }

    /* ── Row pair ────────────────────────────────────────────────── */
    .row-pair {
      display: flex; border-bottom: 1px solid var(--border);
      min-height: 52px; position: relative; transition: opacity 0.2s;
    }
    .row-pair.empty-row { border-bottom-color: transparent; }
    .row-pair.empty-row .row-lat { border-left-color: transparent; }
    .row-pair.faded { opacity: 0.15; }

    /* Arabic cell */
    .row-ar {
      width: 50%; flex-shrink: 0; min-width: 0;
      padding: 0.65rem 1.25rem 0.65rem 2.5rem;
      font-family: 'Scheherazade New', serif;
      font-size: 1.435rem; line-height: 2;
      direction: rtl; text-align: right;
      word-break: break-word; outline: none; cursor: text;
      transition: background 0.13s; position: relative;
    }
    .row-ar:empty::before {
      content: attr(data-placeholder);
      color: var(--faint); font-size: 1.1rem; pointer-events: none;
    }
    .row-ar:hover { background: var(--bg-hover); }
    .row-ar:focus { background: var(--bg-focus); }
    /* Kutipan Uthmani ﴿…﴾ hasil shortcode — font mushaf KFGQPC */
    .row-ar .q-uthmani { font-family: 'KFGQPC HAFS Uthmanic', 'Scheherazade New', serif; font-size: 1.15em; }

    /* Vocalize button on Arabic side */
    .row-vocalize-btn {
      display: none; position: absolute; left: 0.5rem; top: 50%;
      transform: translateY(-50%); width: 26px; height: 26px;
      border: none; background: var(--accent-lt); color: var(--accent);
      border-radius: var(--radius-sm); cursor: pointer; align-items: center;
      justify-content: center; transition: background 0.12s, color 0.12s; line-height: 0;
      font-family: 'Scheherazade New', serif;
      font-size: 1.25rem; z-index: 2;
    }
    .row-pair:hover .row-vocalize-btn { display: flex; }
    .row-vocalize-btn:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
    .row-vocalize-btn.loading { opacity: 0.6; cursor: wait; pointer-events: none; }
    .row-vocalize-btn.done { background: var(--accent); color: #fff; }
    .row-vocalize-btn svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }

    /* Latin cell */
    .row-lat {
      width: 50%; flex-shrink: 0; min-width: 0;
      padding: 0.65rem 2.5rem 0.65rem 1.25rem;
      border-left: 1px solid var(--border);
      font-family: 'Alegreya', serif; font-size: 16px; line-height: 1.85;
      color: var(--text); display: flex; align-items: center;
      position: relative; word-break: break-word;
    }
    .row-lat.empty-lat { color: var(--muted); font-style: italic; font-size: 13px; }
    .row-lat.error-lat { color: oklch(0.52 0.18 25); font-size: 13px; font-style: italic; }
    .row-lat.editable { cursor: text; }
    .row-lat.editable:focus-within { background: var(--bg-focus); }

    /* Diff coloring */
    .lat-added { color: var(--edit-color); font-style: normal; }
    .row-lat.has-edit .lat-edit-wrap:not(:focus) { color: var(--text); }
    .row-lat.has-edit .lat-edit-wrap:not(:focus) .lat-added { color: var(--edit-color); }

    /* Edit indicator group */
    .edit-indicator-group { display: none; position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); align-items: center; }
    .row-lat.has-edit .edit-indicator-group { display: flex; }
    .row-lat.has-edit .lat-edit-wrap { padding-left: 1.5rem; color: var(--edit-color); }
    .reset-btn {
      width: 18px; height: 18px; border: none; background: transparent;
      color: var(--edit-color); opacity: 0.45; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      padding: 0; border-radius: 3px; transition: opacity 0.15s, background 0.15s;
    }
    .reset-btn:hover { opacity: 1; background: color-mix(in srgb, var(--edit-color) 12%, transparent); }
    .reset-btn svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; display: block; }

    /* Editable lat content */
    .lat-edit-wrap {
      flex: 1; min-width: 0; word-break: break-word; white-space: pre-wrap;
      outline: none; caret-color: var(--edit-color); line-height: inherit;
      font-family: inherit; font-size: inherit;
    }

    /* Copy button */
    .row-copy-btn {
      display: none; position: absolute; right: 0.5rem; top: 50%;
      transform: translateY(-50%); width: 26px; height: 26px;
      border: none; background: var(--accent-lt); color: var(--accent);
      border-radius: var(--radius-sm); cursor: pointer; align-items: center; justify-content: center;
      transition: background 0.12s, color 0.12s; line-height: 0;
    }
    .row-pair:hover .row-copy-btn { display: flex; }
    .row-copy-btn:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
    .row-copy-btn.copied { background: var(--accent); color: #fff; }
    .row-copy-btn svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 1.8; display: block; }



    /* Search highlight */
    mark { background: var(--hl-bg); color: var(--hl-text); border-radius: 2px; padding: 0 1px; }

    /* ── Modal ───────────────────────────────────────────────────── */
    .modal-overlay {
      position: fixed; inset: 0; background: rgba(0,0,0,0.5);
      backdrop-filter: blur(8px); display: none; align-items: center;
      justify-content: center; z-index: 2000; opacity: 0; transition: opacity 0.25s;
    }
    .modal-overlay.show { display: flex; opacity: 1; }
    .modal-card {
      background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
      width: 580px; max-width: 92vw; max-height: 85vh;
      box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
      transform: scale(0.95) translateY(16px);
      transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
    }
    .modal-overlay.show .modal-card { transform: scale(1) translateY(0); }
    .modal-header {
      padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between;
      background: var(--bg-sub); flex-shrink: 0;
    }
    .modal-header-title { display: flex; align-items: center; gap: var(--space-lg); font-weight: 600; font-size: 13px; color: var(--text); }
    .modal-header-title svg { color: var(--accent); width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
    .modal-close { background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; line-height: 0; border-radius: var(--radius-sm); }
    .modal-close:hover { color: var(--text); }
    .modal-close svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
    .modal-body { padding: 1.5rem; overflow-y: auto; font-size: 13px; line-height: 1.75; color: var(--text); }
    .modal-body h4 { color: var(--accent); font-weight: 600; font-size: 13px; margin: 1.25rem 0 0.5rem; padding-left: 10px; border-left: 3px solid var(--accent); }
    .modal-body h4:first-child { margin-top: 0; }
    .modal-body p { margin-bottom: 0.875rem; color: var(--muted); }
    .modal-body strong { color: var(--text); }
    .modal-body a { color: var(--accent); }
    .modal-body code { background: var(--bg-sub); padding: 2px 6px; border-radius: 4px; color: var(--accent); font-family: monospace; font-size: 0.92em; }
    .modal-body ul { padding-left: 1.25rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
    .modal-body li { color: var(--muted); }
    .modal-logo { display: flex; justify-content: center; padding: 1rem 0 1.75rem; }
    .modal-logo img { max-width: 160px; height: auto; }
    .modal-maktabah { display: flex; justify-content: center; padding: 0.5rem 0 0.25rem; }
    [data-theme="dark"] .maktabah-icon path[style*="#23292a"],
    [data-theme="dark"] .maktabah-icon path[style*="#999999"] { fill: #ffffff !important; }
    .app-badges { display: flex; gap: 0.75rem; margin: 0.75rem 0 1.25rem; flex-wrap: wrap; }
    .app-badge img { height: 36px; width: auto; transition: transform 0.2s; }
    .app-badge:hover img { transform: translateY(-2px); }
    .contact-links { display: flex; flex-direction: column; gap: var(--space-lg); margin-top: 0.75rem; }
    .contact-link { display: flex; align-items: center; gap: var(--space-lg); color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 500; }
    .contact-link svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }

    /* Shortcuts modal kbd */
    .kbd-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 1.25rem; }
    .kbd-row:nth-child(even) { background: var(--bg-sub); }
    .kbd-row-desc { font-size: 13px; color: var(--muted); }
    .kbd-keys { display: flex; gap: var(--space-sm); }
    kbd {
      background: var(--kbd-bg); border: 1px solid var(--kbd-b); border-radius: 5px;
      padding: 1px 6px; font-size: 11px; font-family: 'DM Sans', monospace;
      color: var(--text); font-weight: 500; line-height: 1.7; display: inline-block;
    }

    /* ── Drag overlay ────────────────────────────────────────────── */
    body.dragover-global::after {
      content: var(--drag-overlay-text, '📄 Drop .docx or .txt here');
      position: fixed; inset: 0; z-index: 8000;
      display: flex; align-items: center; justify-content: center;
      font-size: 1.3rem; font-weight: 600; font-family: 'DM Sans', sans-serif;
      color: var(--accent); background: rgba(0,0,0,0.5);
      border: 3px dashed var(--accent); border-radius: 12px; margin: 12px;
      pointer-events: none;
    }

    /* ── Footer ──────────────────────────────────────────────────── */
    .site-footer {
      flex-shrink: 0; height: 24px; display: flex; align-items: center;
      justify-content: center; gap: var(--space-md); background: var(--footer-bg);
      color: var(--footer-text); font-size: 10px; letter-spacing: 0.04em;
      transition: background 0.2s;
    }
    .site-footer a { color: inherit; text-decoration: none; font-weight: 600; transition: opacity 0.15s; }
    .site-footer a:hover { opacity: 0.7; }

    /* ── Tour ────────────────────────────────────────────────────── */
    #tour-tooltip {
      position: fixed; z-index: 9010; background: var(--bg); color: var(--text);
      border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.2rem;
      max-width: 280px; box-shadow: var(--shadow-lg);
      font-size: 0.88rem; line-height: 1.55; transition: opacity 0.2s;
      pointer-events: all;
    }
    #tour-tooltip.hidden { opacity: 0; pointer-events: none; }
    #tour-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.4rem; color: var(--accent); display: flex; align-items: center; gap: 0.4rem; }
    #tour-title svg { flex-shrink: 0; width: 16px; height: 16px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    #tour-body { margin-bottom: 0.9rem; color: var(--text); }
    #tour-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
    .tour-dots { display: flex; gap: 5px; }
    .tour-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: background 0.2s; }
    .tour-dot.active { background: var(--accent); }
    #tour-next { background: var(--accent); color: #fff; border: none; border-radius: 7px; padding: 0.35rem 0.9rem; font-size: 0.82rem; cursor: pointer; font-weight: 600; font-family: 'DM Sans', sans-serif; transition: background 0.15s; }
    #tour-next:hover { background: var(--accent-h); }
    #tour-skip { background: none; border: none; color: var(--muted); font-size: 0.78rem; cursor: pointer; padding: 0; font-family: 'DM Sans', sans-serif; transition: color 0.15s; }
    #tour-skip:hover { color: var(--text); }
    .tour-highlight { outline: 2px solid var(--accent) !important; outline-offset: 3px; border-radius: 8px; }

    /* ── Touch / Mobile ──────────────────────────────────────────── */
    @media (pointer: coarse) {
      .row-pair:hover .row-copy-btn { display: flex; opacity: 0.65; }
      .row-pair:hover .row-vocalize-btn { display: flex; opacity: 0.65; }
      /* Target sentuh lebih besar di layar touch (icon tetap 14px, cuma area tap-nya) */
      .icon-btn, .upload-label { width: 40px; height: 40px; }
      .row-copy-btn, .row-vocalize-btn { width: 34px; height: 34px; }
      .lang-btn { height: 34px; }
      .pane-btn { width: 32px; height: 32px; }
      .search-nav-btn, #search-clear, .modal-close { padding: 8px; }
    }
    /* Stacking Arab/Latin — breakpoint disamakan dengan stacking
       editor/preview di Marktaba (editor kitab), biar "titik pindah
       layout" konsisten across ekosistem. */
    @media (max-width: 1024px) {
      .row-pair { flex-direction: column; }
      .row-ar { width: 100% !important; }
      .row-lat { width: 100% !important; border-left: none; border-top: 1px solid var(--border); }
      /* Baris menumpuk vertikal — header bukan lagi kolom 50/50,
         melainkan legenda: kiri mengisi ruang, kanan merapat ke tombol */
      .pane-header { padding: 0 0.75rem; }
      .pane-header:first-child { width: auto; flex: 1; }
      .pane-header:nth-child(2) { flex: none; }
    }
    @media (max-width: 768px) {
      /* Topbar */
      .topbar { flex-wrap: wrap; height: auto; padding: 6px 0.75rem; gap: 0.4rem; }
      .topbar-spacer { display: none; }
      .topbar-title { font-size: 0.78rem; }
      .topbar-divider { display: none; }
      /* Hide nav labels on very small screens — keep icon buttons */
      .topbar-nav { gap: var(--space-2xs); }
      .topbar-link { padding: 0 5px; font-size: 11px; }
      /* System panel — full width di mobile */
      .sys-panel { left: auto; right: 0; min-width: 160px; }
    }

    @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
