    /* ── Themes ──────────────────────────────────────────────────── */
    :root {
      --bg:          #FFFFFF;
      --bg-sub:      #F7F7F7;
      --bg-hover:    #F1F1F1;
      --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);
      --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);

      /* 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;
      --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);
      --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);
    }

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

    ::-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; }

    .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; stroke-linecap: round; stroke-linejoin: round; }
    .modal-close { background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; line-height: 0; border-radius: var(--radius-sm); transition: color 0.13s; }
    .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; }

    .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); }
    .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; }
    .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; }

    /* ── Icon buttons (topbar right) ─────────────────────────────── */
    .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); }
    .icon-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }

    /* ── System selector (sama persis dengan index.html) ─────────── */
    .sys-wrapper { position: relative; display: inline-flex; align-items: center; }
    .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 .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-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-desc {
      display: block; font-size: 10px; color: var(--muted); font-weight: 400;
      margin-top: 1px; line-height: 1.3;
    }

    /* ── Editor layout ───────────────────────────────────────────── */
    .editor-wrap {
      flex: 1; display: flex; flex-direction: column; min-height: 0;
      padding: 0.875rem; gap: 0.875rem;
    }

    /* ── Toolbar — identik dengan pane-header di index.html ──────── */
    .editor-toolbar {
      display: flex; align-items: center;
      height: 30px;
      background: var(--bg-sub);
      border-bottom: 1px solid var(--border);
      flex-shrink: 0; overflow: hidden;
    }
    /* Zona kiri: char-panel + shorthand hint, scrollable horizontal */
    .toolbar-left {
      display: flex; align-items: center; gap: var(--space-sm);
      flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden;
      padding: 0 0.75rem; scrollbar-width: none;
    }
    .toolbar-left::-webkit-scrollbar { display: none; }
    /* Zona kanan: aksi, fixed tidak scroll */
    .toolbar-right {
      display: flex; align-items: center; gap: var(--space-xs);
      padding: 0 0.5rem 0 0;
      flex-shrink: 0;
      border-left: 1px solid var(--border);
    }
    .char-divider { width: 1px; height: 16px; background: var(--border); margin: 0 2px; flex-shrink: 0; }
    .toolbar-spacer { flex: 1; }

    /* ── Karakter diakritik button ─────────────────────────────── */
    .char-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, background 0.12s;
      font-family: 'Alegreya', serif; font-size: 15px; line-height: 1;
      flex-shrink: 0;
    }
    .char-btn:hover { color: var(--text); background: var(--bg-hover); }

    /* ── Pane-btn style (untuk copy/export/clear) ────────────────── */
    .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; }

    /* ── Textarea ────────────────────────────────────────────────── */
    #editor-ta {
      flex: 1; width: 100%; resize: none; min-height: 0;
      background: var(--bg); color: var(--text);
      border: 1px solid var(--border); border-radius: 8px;
      padding: 14px 16px;
      font-family: 'Alegreya', serif; font-size: 16px; line-height: 1.8;
      outline: none; transition: border-color 0.15s;
    }
    #editor-ta:focus { border-color: var(--border-f); }
    #editor-ta::placeholder { color: var(--muted); font-style: italic; }

    /* ── Shorthand hint ──────────────────────────────────────────── */
    #shorthand-hint {
      font-size: 11px; color: var(--muted); flex-shrink: 0;
      padding: 0 2px; white-space: nowrap; display: flex; align-items: center; gap: 5px;
    }
    #shorthand-hint kbd {
      display: inline-block; padding: 1px 5px; border-radius: 3px;
      background: var(--bg); border: 1px solid var(--faint);
      font-family: 'DM Sans', sans-serif; font-size: 10px; color: var(--muted);
    }

    @media (pointer: coarse) {
      /* Touch devices: char buttons selalu visible */
      .char-btn { opacity: 1; }
      /* Target sentuh lebih besar di layar touch (icon tetap 14px, cuma area tap-nya) */
      .icon-btn, .upload-label { width: 40px; height: 40px; }
      .lang-btn { height: 34px; }
      .char-btn { width: 32px; height: 32px; }
      .modal-close { padding: 8px; }
    }
    @media (max-width: 768px) {
      /* Topbar */
      .topbar { flex-wrap: wrap; height: auto; padding: 6px 0.75rem; gap: 0.4rem; }
      .topbar-spacer { display: none; }
      .topbar-divider { display: none; }
      .topbar-nav { gap: var(--space-2xs); }
      .topbar-link { padding: 0 5px; font-size: 11px; }
      /* System panel — right-aligned di mobile */
      .sys-panel { left: auto; right: 0; min-width: 160px; }
      /* Sembunyikan shorthand hint di mobile — hemat ruang toolbar */
      #shorthand-hint { display: none; }
      /* Textarea padding lebih kecil */
      #editor-ta { padding: 10px 12px; font-size: 15px; }
      /* Editor wrap padding lebih kecil */
      .editor-wrap { padding: 0.625rem; gap: 0.625rem; }
    }
