/* =====================================================================
   PPT GENERATOR — gaya tampilan (simpan di: public/css/ppt-generator.css)
   ===================================================================== */
#pptApp { max-width: 1180px; margin: 0 auto; color: #e2e8f0; }
#pptApp label { display: block; font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
#pptApp select.input-custom { appearance: auto; }
#pptApp .hidden { display: none !important; }
#pptApp input, #pptApp select, #pptApp textarea, #pptApp button { box-sizing: border-box; }

.pg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.pg-head h3 { font-size: 1.3rem; font-weight: 800; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pg-head p { color: #94a3b8; font-size: 14px; margin: 0; max-width: 760px; }
.pg-head-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pg-beta { font-size: 10px; letter-spacing: .08em; background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; padding: 3px 8px; border-radius: 999px; }

.pg-card { background: #1e293b; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; padding: 22px; }
.pg-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.pg-full { grid-column: 1 / -1; }
.pg-mt { margin-top: 14px !important; }
.pg-ta { min-height: 110px; resize: vertical; font-family: inherit; }
.pg-ta-sm { min-height: 64px; }
.pg-hint { color: #94a3b8; font-size: 12px; }
.pg-center { text-align: center; }
.pg-file { font-size: 13px; color: #cbd5e1; max-width: 100%; }
.pg-file::file-selector-button { margin-right: 10px; padding: 7px 12px; border: 0; border-radius: 8px; background: #2563eb; color: #fff; font-weight: 600; cursor: pointer; }
.pg-logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pg-logo-thumb { height: 40px; width: 40px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.pg-sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; margin: 0 2px; border: 1px solid rgba(255,255,255,.3); }

.pg-checks { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 14px; }
#pptApp .pg-checks label { text-transform: none; font-size: 14px; color: #e2e8f0; font-weight: 600; letter-spacing: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; }
.pg-checks input { width: 17px; height: 17px; accent-color: #38bdf8; }

.pg-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
#pptApp .pg-radio { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid rgba(148,163,184,.35); border-radius: 12px; cursor: pointer; text-transform: none; letter-spacing: 0; margin: 0; transition: .2s; }
#pptApp .pg-radio:has(input:checked) { border-color: #38bdf8; background: rgba(56,189,248,.08); box-shadow: 0 0 0 1px #38bdf8 inset; }
.pg-radio input { margin-top: 3px; accent-color: #38bdf8; }
.pg-radio b { display: block; color: #f1f5f9; font-size: 14px; }
.pg-radio small { display: block; color: #94a3b8; font-weight: 500; font-size: 12px; margin-top: 2px; }

.pg-btn-ghost { background: rgba(148,163,184,.12); border: 1px solid rgba(148,163,184,.35); color: #e2e8f0; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 13px; cursor: pointer; transition: .2s; }
.pg-btn-ghost:hover { border-color: #38bdf8; color: #fff; }
.pg-btn-dl { background: linear-gradient(135deg, #10b981, #059669); color: #fff; border: 0; padding: 10px 18px; border-radius: 10px; font-weight: 800; cursor: pointer; transition: .2s; }
.pg-btn-dl:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(16,185,129,.6); }
.pg-btn-dl:disabled { opacity: .6; cursor: wait; transform: none; }
.pg-wide { width: 100%; padding: 14px; font-size: 15px; }
.pg-chip { background: rgba(56,189,248,.12); border: 1px solid rgba(56,189,248,.35); color: #bae6fd; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pg-chip:hover { background: rgba(56,189,248,.25); }
.pg-chip:disabled { opacity: .6; cursor: wait; }

.pg-warn { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.45); color: #fcd34d; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 10px; }
.pg-info { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.45); color: #6ee7b7; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 10px; }

/* ---------- editor kerangka ---------- */
.pg-ol-list { display: flex; flex-direction: column; gap: 10px; }
.pg-ol { background: #1e293b; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 12px 14px; }
.pg-ol-fixed { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: rgba(30,41,59,.5); border-style: dashed; color: #94a3b8; font-size: 13px; }
.pg-ol-fixed b { color: #cbd5e1; font-weight: 600; }
.pg-tag { margin-left: auto; font-size: 11px; color: #64748b; }
.pg-ol-top { display: flex; gap: 8px; align-items: center; }
.pg-num { flex: 0 0 auto; min-width: 26px; height: 26px; border-radius: 8px; background: #0ea5e9; color: #fff; font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.pg-ol-fixed .pg-num { background: #334155; }
.pg-in { background: rgba(15,23,42,.7); border: 1px solid rgba(100,116,139,.5); color: #f1f5f9; border-radius: 9px; padding: 7px 10px; font-size: 14px; outline: none; font-family: inherit; }
.pg-in:focus { border-color: #38bdf8; }
.pg-ol-title { flex: 1; min-width: 0; font-weight: 700; }
.pg-ol-layout { flex: 0 0 210px; }
.pg-ol-btns { display: flex; gap: 4px; }
.pg-ol-btns button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(100,116,139,.5); background: transparent; color: #cbd5e1; cursor: pointer; font-size: 12px; }
.pg-ol-btns button:hover:not(:disabled) { border-color: #38bdf8; color: #fff; }
.pg-ol-btns button:disabled { opacity: .3; cursor: not-allowed; }
.pg-reason { font-size: 12.5px; color: #a5b4fc; margin: 8px 0 0 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pg-alts { color: #94a3b8; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pg-kp { width: calc(100% - 34px); margin: 8px 0 0 34px; min-height: 58px; resize: vertical; font-size: 13px; }
.pg-data { margin: 8px 0 0 34px; padding: 10px; border-radius: 10px; border: 1px solid rgba(56,189,248,.35); background: rgba(56,189,248,.06); }
.pg-data-need { border-color: rgba(245,158,11,.6); background: rgba(245,158,11,.08); }
#pptApp .pg-data label { text-transform: none; letter-spacing: 0; color: #fcd34d; font-size: 12px; }
.pg-data textarea { width: 100%; min-height: 70px; resize: vertical; font-size: 13px; font-family: ui-monospace, Consolas, monospace; }

/* ---------- progres ---------- */
.pg-progress { text-align: center; padding: 48px 24px; }
.pg-progress h3 { font-size: 1.15rem; font-weight: 800; margin: 16px 0 6px; }
.pg-progress p { color: #94a3b8; font-size: 14px; margin: 0 0 18px; }
.pg-bar { height: 10px; background: rgba(148,163,184,.2); border-radius: 999px; overflow: hidden; max-width: 460px; margin: 0 auto 6px; }
.pg-bar div { height: 100%; background: linear-gradient(90deg, #0ea5e9, #8b5cf6); border-radius: 999px; transition: width .5s; }
.pg-spinner { width: 46px; height: 46px; margin: 0 auto; border-radius: 50%; border: 4px solid rgba(56,189,248,.2); border-top-color: #38bdf8; animation: pgspin 1s linear infinite; }
@keyframes pgspin { to { transform: rotate(360deg); } }

/* ---------- hasil ---------- */
.pg-toolbar { position: sticky; top: -20px; z-index: 5; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: rgba(15,23,42,.92); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 10px 12px; margin-bottom: 16px; }
.pg-themes { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.pg-tool-btns { display: flex; gap: 8px; }
.pg-theme { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 999px; border: 1px solid rgba(148,163,184,.3); background: rgba(30,41,59,.8); color: #cbd5e1; font-size: 12px; font-weight: 600; cursor: pointer; }
.pg-theme.on { border-color: #38bdf8; color: #fff; box-shadow: 0 0 0 1px #38bdf8 inset; }
.pg-theme-sw { display: inline-flex; }
.pg-theme-sw i { width: 12px; height: 12px; border-radius: 50%; margin-left: -3px; border: 1.5px solid #0f172a; }
.pg-theme-sw i:first-child { margin-left: 0; }
.pg-slides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pg-slide-card { background: #1e293b; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 8px; }
.pg-slide-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #94a3b8; padding: 2px 4px 8px; }
.pg-grow { flex: 1; }
.pg-wrap { container-type: inline-size; border-radius: 8px; overflow: hidden; box-shadow: 0 6px 18px -8px rgba(0,0,0,.6); }
.pg-notes { margin-top: 8px; font-size: 13px; color: #cbd5e1; background: rgba(15,23,42,.6); border-radius: 8px; padding: 8px 10px; line-height: 1.5; }

/* ---------- pratinjau slide (dipakai juga oleh mesin) ---------- */
.pg-slide { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; box-sizing: border-box; color: #111; }
.pg-slide * { box-sizing: border-box; }
.pg-t { position: absolute; display: flex; flex-direction: column; overflow: hidden; line-height: 1.2; padding: .35% .45%; word-break: break-word; }
.pg-p { display: flex; gap: .45em; margin: 0 0 .35em; }
.pg-p:last-child { margin-bottom: 0; }
.pg-t[style*="text-align:center"] .pg-p { justify-content: center; }
.pg-t[style*="text-align:right"] .pg-p { justify-content: flex-end; }
.pg-b { flex: 0 0 auto; }
.pg-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pg-tbl td { padding: .4em .6em; vertical-align: middle; line-height: 1.2; word-break: break-word; }
.pg-slide svg { display: block; }
.pg-slide a { color: inherit; }

@media (max-width: 900px) {
  .pg-slides { grid-template-columns: 1fr; }
  .pg-grid2, .pg-mode { grid-template-columns: 1fr; }
  .pg-ol-top { flex-wrap: wrap; }
  .pg-ol-title { flex: 1 1 100%; order: 2; }
  .pg-ol-layout { flex: 1 1 auto; order: 3; }
  .pg-ol-btns { order: 1; margin-left: auto; }
  .pg-reason, .pg-kp, .pg-data { margin-left: 0; width: 100%; }
  .pg-toolbar { position: static; }
}
.pg-chip-warn { background: rgba(245,158,11,.15); border-color: rgba(245,158,11,.5); color: #fcd34d; cursor: default; }
.pg-btn-warn { border-color: rgba(245,158,11,.6); color: #fcd34d; }

/* ---------- edit langsung, ikon, alur cerita ---------- */
.pg-edit-hint { font-size: 13px; color: #cbd5e1; background: rgba(56,189,248,.08); border: 1px dashed rgba(56,189,248,.4); border-radius: 10px; padding: 8px 12px; margin-bottom: 14px; }
.pg-slide .pg-ed { outline: none; border-radius: 3px; cursor: text; transition: box-shadow .15s, background .15s; min-width: .6em; display: inline-block; }
.pg-slide .pg-ed:hover { box-shadow: 0 0 0 1px rgba(56,189,248,.8); background: rgba(56,189,248,.08); }
.pg-slide .pg-ed:focus { box-shadow: 0 0 0 2px #38bdf8; background: rgba(255,255,255,.92); color: #0f172a !important; }
.pg-slide td.pg-ed { display: table-cell; }
.pg-slide .pg-p > .pg-ed { display: inline; }
.pg-icon svg { width: 100%; height: 100%; display: block; }
.pg-icon-ed { cursor: pointer; border-radius: 6px; }
.pg-icon-ed:hover { box-shadow: 0 0 0 2px #38bdf8; background: rgba(56,189,248,.15); }
.pg-notes-ed { margin-top: 4px; outline: none; border-radius: 6px; padding: 4px 6px; background: rgba(255,255,255,.04); border: 1px dashed rgba(148,163,184,.35); }
.pg-notes-ed:focus { border-color: #38bdf8; background: rgba(56,189,248,.06); }
.pg-stage { flex: 0 0 auto; border: 1px solid var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 800; cursor: pointer; text-transform: uppercase; letter-spacing: .04em; }
.pg-story { background: #1e293b; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.pg-story-lbl { font-size: 12.5px; color: #cbd5e1; margin-bottom: 8px; }
.pg-story-bar { display: flex; gap: 3px; border-radius: 8px; overflow: hidden; }
.pg-story-seg { color: #fff; font-size: 11px; font-weight: 800; padding: 5px 6px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pg-picker-ov { position: fixed; inset: 0; z-index: 99999; background: rgba(2,6,23,.7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pg-picker { width: min(720px, 100%); max-height: 80vh; display: flex; flex-direction: column; background: #0f172a; border: 1px solid rgba(56,189,248,.35); border-radius: 16px; overflow: hidden; color: #e2e8f0; }
.pg-picker-top { display: flex; gap: 10px; align-items: center; padding: 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.pg-picker-top input { flex: 1; min-width: 0; }
.pg-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; padding: 12px; overflow-y: auto; }
.pg-picker-grid button { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #1e293b; border: 1px solid rgba(148,163,184,.25); border-radius: 10px; cursor: pointer; color: #e2e8f0; font-size: 10px; }
.pg-picker-grid button:hover, .pg-picker-grid button.on { border-color: #38bdf8; background: rgba(56,189,248,.15); }
