/* WINQURAN — Prompter Khatib
   Dipakai di halaman /prompter (bersama site.css) dan di versi offline (berdiri sendiri). */

.pr-app {
    --pr-bg: var(--bg, #f7f6f2);
    --pr-surface: var(--surface, #ffffff);
    --pr-surface-2: var(--surface-2, #f1efe8);
    --pr-text: var(--text, #1d2321);
    --pr-muted: var(--muted, #66706c);
    --pr-border: var(--border, #e2dfd6);
    --pr-accent: var(--accent, #0f766e);
    --pr-accent-ink: var(--accent-ink, #ffffff);
    --pr-font-ar: var(--font-ar, "WinQuranMushaf", "KFGQPC HAFS Uthmanic Script", "Amiri Quran", "Scheherazade New", "Traditional Arabic", "Noto Naskh Arabic", serif);
    color: var(--pr-text);
}

.pr-standalone { background: #f7f6f2; color: #1d2321; }
.pr-standalone .pr-app { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
@media (prefers-color-scheme: dark) {
    .pr-standalone { background: #121614; }
    .pr-standalone .pr-app {
        --pr-bg: #121614; --pr-surface: #1a201d; --pr-surface-2: #222a26; --pr-text: #e7ece9;
        --pr-muted: #9aa6a0; --pr-border: #2d3732; --pr-accent: #2dd4bf; --pr-accent-ink: #062b27;
    }
}
.pr-footnote { text-align: center; color: #8a918d; font-size: .8rem; padding: 0 16px 24px; }

/* ------------------------------------------------------------------ editor */
.pr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.pr-head h1 { margin: 0 0 4px; font-size: 1.6rem; }
.pr-sub { margin: 0; color: var(--pr-muted); max-width: 680px; }
.pr-sub code, .pr-help code { background: var(--pr-surface-2); padding: 1px 6px; border-radius: 6px; font-size: .88em; }
.pr-badge { background: var(--pr-surface-2); color: var(--pr-accent); font-weight: 600; font-size: .85rem; padding: 6px 12px; border-radius: 999px; }

.pr-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 12px; }
.pr-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px;
    border: 1px solid var(--pr-border); background: var(--pr-surface); color: var(--pr-text);
    font: inherit; font-size: .9rem; cursor: pointer; text-decoration: none;
}
.pr-btn:hover { border-color: var(--pr-accent); text-decoration: none; }
.pr-btn-primary { background: var(--pr-accent); border-color: var(--pr-accent); color: var(--pr-accent-ink); font-weight: 600; }
.pr-btn-ghost { white-space: nowrap; }
.pr-saved { color: var(--pr-muted); font-size: .82rem; margin-left: 4px; }

.pr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.pr-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
#pr-text {
    width: 100%; min-height: 62vh; resize: vertical; box-sizing: border-box;
    padding: 14px 16px; border-radius: 14px; border: 1px solid var(--pr-border);
    background: var(--pr-surface); color: var(--pr-text);
    font: 1rem/1.7 "Segoe UI", system-ui, sans-serif;
}
#pr-text:focus { outline: 2px solid var(--pr-accent); outline-offset: 1px; }

.pr-side { display: flex; flex-direction: column; gap: 12px; }
.pr-panel { background: var(--pr-surface); border: 1px solid var(--pr-border); border-radius: 14px; padding: 14px 16px; }
.pr-panel h2 { font-size: 1rem; margin: 0 0 10px; }
.pr-panel h3 { font-size: .85rem; margin: 12px 0 6px; }
.pr-field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--pr-muted); margin-bottom: 10px; }
.pr-field input[type="number"] { width: 90px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--pr-border); background: var(--pr-surface); color: var(--pr-text); font: inherit; }
.pr-field input[type="range"], .pr-check input { accent-color: var(--pr-accent); }
.pr-check { display: flex; align-items: center; gap: 8px; font-size: .88rem; margin: 6px 0; cursor: pointer; }
.pr-voice { border-top: 1px solid var(--pr-border); margin-top: 10px; padding-top: 10px; }
.pr-voice .pr-voice-lang { margin: 6px 0 4px 26px; }
.pr-voice select { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--pr-border); background: var(--pr-surface); color: var(--pr-text); font: inherit; }
.pr-tag { font-size: .7rem; font-weight: 600; color: var(--pr-accent); background: var(--pr-surface-2); padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.pr-voice-note { font-size: .78rem; line-height: 1.5; color: var(--pr-muted); margin: 6px 0 0; }
.pr-voice-warn { font-size: .8rem; color: #b45309; background: rgba(245, 158, 11, .12); border-radius: 8px; padding: 6px 8px; margin: 8px 0 0; }
.pr-voice-warn[hidden] { display: none; }
.pr-check input:disabled + * , .pr-check:has(input:disabled) { opacity: .6; cursor: not-allowed; }
.pr-start { width: 100%; justify-content: center; margin-top: 10px; padding: 12px; font-size: 1rem; }
.pr-help summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
.pr-help ul { margin: 8px 0 0; padding-left: 18px; font-size: .84rem; line-height: 1.6; color: var(--pr-muted); }
.pr-keys { list-style: none; padding-left: 0 !important; }
kbd { display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid var(--pr-border); border-bottom-width: 2px; border-radius: 5px; background: var(--pr-surface-2); font: .78rem/1.6 Consolas, monospace; text-align: center; }

@media (max-width: 860px) {
    .pr-grid { grid-template-columns: 1fr; }
    #pr-text { min-height: 45vh; }
}

/* ------------------------------------------------------------------ layar prompter */
.pr-stage {
    position: fixed; inset: 0; z-index: 1000; background: #000; color: #f5f5f0;
    --pr-size: 48px;
}
.pr-stage[hidden] { display: none; }
.pr-scroll {
    position: absolute; inset: 0; overflow-y: auto; scrollbar-width: none;
    padding: 0 6vw; box-sizing: border-box;
}
.pr-scroll::-webkit-scrollbar { display: none; }
.pr-content { max-width: 1400px; margin: 0 auto; padding: 38vh 0 70vh; font-size: var(--pr-size); line-height: 1.5; }
.pr-content.mirror { transform: scaleX(-1); }

.pr-content p { margin: 0 0 .55em; }
.pr-content .pr-ar, .pr-content .pr-ayat-ar {
    font-family: var(--pr-font-ar, "WinQuranMushaf", "Traditional Arabic", serif);
    direction: rtl; text-align: right; font-size: 1.25em; line-height: 1.9;
}
.pr-content .pr-h {
    font-size: .55em; text-transform: uppercase; letter-spacing: .12em; color: #2dd4bf;
    border-top: 1px solid #2c3a36; padding-top: .8em; margin: 1.6em 0 .7em;
}
.pr-content .pr-note { font-size: .45em; color: #f6c56b; font-style: italic; margin-bottom: 1em; }
.pr-content .pr-note::before { content: "Catatan: "; font-weight: 700; font-style: normal; }
.pr-content hr { border: 0; border-top: 1px dashed #444; margin: 1em 0; }
.pr-ayat { border-left: 4px solid #2dd4bf; padding: .2em 0 .2em .6em; margin: 0 0 .9em; }
.pr-ayat .pr-latin { font-size: .62em; color: #e9d29a; font-style: italic; margin-top: .2em; }
.pr-ayat .pr-tr { font-size: .62em; color: #c9d4cf; margin-top: .3em; }
.pr-ayat .pr-ref { font-size: .4em; color: #8fa39b; margin-top: .3em; letter-spacing: .04em; }
.pr-ayat .pr-missing { font-size: .5em; color: #ff8f8f; }
.pr-end-mark { font-family: var(--pr-font-ar, serif); color: #2dd4bf; padding: 0 .15em; }
.pr-hide-latin .pr-latin, .pr-hide-trans .pr-tr { display: none; }

/* garis bantu baca */
.pr-guide {
    position: absolute; left: 0; right: 0; top: 38vh; height: 0; z-index: 2; pointer-events: none;
    border-top: 2px solid rgba(45, 212, 191, .55);
}
.pr-guide::before {
    content: ""; position: absolute; left: 10px; top: -9px;
    border: 8px solid transparent; border-left: 12px solid #2dd4bf;
}

/* bilah kendali */
.pr-bar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 3;
    display: flex; align-items: center; gap: 14px; padding: 10px 16px;
    background: linear-gradient(#000 60%, rgba(0, 0, 0, 0));
    font-family: "Segoe UI", system-ui, sans-serif; transition: opacity .3s;
}
.pr-stage.idle .pr-bar { opacity: 0; }
.pr-timer {
    font: 700 1.6rem/1 Consolas, "Cascadia Mono", monospace; padding: 6px 12px; border-radius: 10px;
    background: #1d2b28; color: #fff; cursor: pointer; min-width: 92px; text-align: center;
}
.pr-timer.paused { opacity: .6; }
.pr-timer.warn { background: #b45309; }
.pr-timer.over { background: #b91c1c; }
.pr-section { flex: 1; color: #9fb1aa; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-mic { font-size: .85rem; color: #9fb1aa; white-space: nowrap; }
.pr-mic[hidden] { display: none; }
.pr-mic.on { color: #2dd4bf; }
.pr-mic.err { color: #fca5a5; }
.pr-w-on { background: rgba(45, 212, 191, .28); border-radius: .15em; box-shadow: 0 0 0 .08em rgba(45, 212, 191, .28); }
.pr-speed { color: #9fb1aa; font-size: .85rem; white-space: nowrap; }
.pr-actions { display: flex; gap: 4px; }
.pr-actions button {
    min-width: 40px; height: 38px; border-radius: 10px; border: 1px solid #2f3d39;
    background: #141c1a; color: #e7ece9; font: 600 .95rem system-ui, sans-serif; cursor: pointer;
}
.pr-actions button:hover { background: #22302c; }
.pr-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #111; z-index: 3; }
.pr-progress span { display: block; height: 100%; width: 0; background: #2dd4bf; }

@media (max-width: 700px) {
    .pr-bar { flex-wrap: wrap; gap: 8px; }
    .pr-section { order: 3; flex-basis: 100%; }
    .pr-actions button { min-width: 34px; height: 34px; }
}

/* ------------------------------------------------------------------ bantuan menyusun naskah (AI gratis) */
.pr-btn-ai { border-color: var(--pr-accent); color: var(--pr-accent); font-weight: 600; }
.pr-ai { margin: 0 0 16px; }
.pr-ai[hidden] { display: none; }
.pr-ai-head h2 { margin: 0 0 4px; font-size: 1.05rem; }
.pr-ai-head p { margin: 0; color: var(--pr-muted); font-size: .88rem; line-height: 1.55; }
.pr-ai-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.pr-ai-step { background: var(--pr-surface-2); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.pr-ai-step h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .92rem; }
.pr-ai-step h3 span {
    display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
    background: var(--pr-accent); color: var(--pr-accent-ink); font-size: .78rem;
}
.pr-ai-step .pr-field { color: var(--pr-text); }
.pr-ai-step input[type="text"], .pr-ai-step select, .pr-ai-step textarea {
    width: 100%; box-sizing: border-box; padding: 7px 9px; border-radius: 8px;
    border: 1px solid var(--pr-border); background: var(--pr-surface); color: var(--pr-text);
    font: .88rem/1.5 "Segoe UI", system-ui, sans-serif;
}
.pr-ai-step textarea { resize: vertical; }
.pr-ai-prompt { font-family: Consolas, "Cascadia Mono", monospace !important; font-size: .78rem !important; color: var(--pr-muted) !important; }
.pr-ai-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pr-ai-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pr-ai-buttons .pr-btn { padding: 7px 11px; font-size: .84rem; }
.pr-hint { font-size: .78rem; color: var(--pr-muted); margin: 6px 0 0; line-height: 1.5; }
.pr-ai-warn { font-size: .82rem; color: #b45309; background: rgba(245, 158, 11, .12); border-radius: 10px; padding: 8px 12px; margin: 14px 0 0; line-height: 1.5; }
.pr-ai-check { margin-top: 10px; font-size: .82rem; }
.pr-ai-check h4 { margin: 0 0 4px; font-size: .88rem; }
.pr-ai-check ul { margin: 4px 0 8px; padding-left: 18px; line-height: 1.5; }
.pr-ai-check li.ok strong { color: var(--pr-accent); }
.pr-ai-check li.bad { color: #b91c1c; }
.pr-ai-check li.warn { color: #b45309; }
@media (max-width: 960px) {
    .pr-ai-steps { grid-template-columns: 1fr; }
}
