/* app.css — tampilan editor Health Promotion Studio (terang, teal + oranye Hexindo) */
:root { --d: #2f6b63; --e: #3d7a62; --t: #e3efe8; --bg: #f4f8f2; --ink: #1f2a30; --mut: #52646a; --or: #b84a0c; --or2: #eb692d; --line: #cfe0d4; --red: #b3261e; --ok: #1c7a45; --r: 14px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); display: flex; flex-direction: column; }
button, select, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--or2); outline-offset: 2px; }
.muted { color: var(--mut); } .small { font-size: 13px; }

.bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px; background: #fff; border-bottom: 4px solid var(--or2); }
.brand-logo { height: 32px; width: auto; }
.brand-t { display: flex; flex-direction: column; line-height: 1.2; margin-left: 6px; }
.brand-t strong { font-size: 16px; color: var(--d); } .brand-t small { color: var(--mut); font-size: 12px; }
.spacer { flex: 1; }
.btn { border: 2px solid var(--d); background: #fff; color: var(--d); font-weight: 700; padding: 7px 13px; border-radius: 99px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--t); } .btn.ghost { border-color: var(--line); } .btn.small { padding: 4px 11px; font-size: 13px; }
.btn.primary { background: var(--d); color: #fff; } .btn.primary:hover { background: var(--e); }
.btn.danger { border-color: var(--red); color: var(--red); }
#selContoh { border: 2px solid var(--line); border-radius: 99px; padding: 7px 12px; background: #fff; max-width: 190px; }

.app { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(360px, 46%) 1fr; }
.ed { overflow: auto; padding: 14px 16px 60px; }
.pv { display: flex; flex-direction: column; min-height: 0; padding: 12px 14px 8px; border-left: 1px solid var(--line); background: #e9f0ea; }
.pv-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pv-frame { flex: 1; min-height: 300px; display: flex; justify-content: center; background: #d5e1d8; border-radius: var(--r); overflow: hidden; }
.pv-frame iframe { border: 0; background: #fff; height: 100%; width: 100%; transition: width .2s; }
.pv-frame.hp iframe { width: 390px; max-width: 100%; box-shadow: 0 0 0 8px #263238; border-radius: 6px; margin: 8px 0; height: calc(100% - 16px); }
.hint { font-size: 12.5px; color: var(--mut); margin: 6px 0 0; text-align: center; }
.seg { display: inline-flex; border: 2px solid var(--d); border-radius: 99px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 4px 12px; font-weight: 800; color: var(--d); cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--d); color: #fff; }

.lint { margin-top: 8px; max-height: 150px; overflow: auto; font-size: 13px; }
.lint .row { display: flex; gap: 8px; padding: 3px 0; }
.lint .ok { color: var(--ok); } .lint .warn { color: var(--or); font-weight: 600; } .lint .info { color: var(--mut); }

/* kartu panel */
.panel { background: #fff; border: 2px solid var(--line); border-radius: var(--r); margin-bottom: 12px; }
.panel > summary { list-style: none; cursor: pointer; padding: 11px 14px; font-weight: 800; color: var(--d); display: flex; align-items: center; gap: 8px; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::after { content: "▾"; margin-left: auto; transition: transform .2s; }
.panel[open] > summary::after { transform: rotate(180deg); }
.panel-b { padding: 4px 14px 14px; }
.fld { display: block; margin: 9px 0; }
.fld > span { display: block; font-size: 12.5px; font-weight: 800; color: var(--mut); margin-bottom: 3px; letter-spacing: .02em; }
.fld input[type=text], .fld input[type=url], .fld input[type=number], .fld select, .fld textarea { width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; }
.fld textarea { resize: vertical; min-height: 64px; }
.fld input:focus, .fld textarea:focus, .fld select:focus { border-color: var(--d); outline: none; }
.fld .srcline { display: block; margin-top: 3px; font-size: 12.5px; color: var(--mut); background: #f0f5f1; border-radius: 8px; padding: 4px 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.chk { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-weight: 600; }
.chk input { width: 20px; height: 20px; accent-color: var(--d); }

.sec-card { border: 2px solid var(--line); border-radius: 12px; margin: 10px 0; background: #fbfdfb; }
.sec-card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.sec-card > summary::-webkit-details-marker { display: none; }
.sec-card .sn { width: 26px; height: 26px; border-radius: 50%; background: var(--d); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 900; flex: none; }
.sec-card .st { flex: 1; min-width: 0; line-height: 1.25; } .sec-card .st b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .sec-card .st small { color: var(--mut); }
.mini { border: 1.5px solid var(--line); background: #fff; border-radius: 8px; padding: 2px 8px; cursor: pointer; font-weight: 800; color: var(--d); }
.mini:hover { background: var(--t); } .mini.x { color: var(--red); }
.sec-b { padding: 2px 12px 12px; }
.hintline { font-size: 12.5px; color: var(--mut); margin: 2px 0 6px; }
.item { border: 1.5px dashed var(--line); border-radius: 10px; padding: 6px 10px 8px; margin: 8px 0; background: #fff; }
.item-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--mut); }
.item-h .sp { flex: 1; }
.ikon-in { width: 64px !important; text-align: center; font-size: 20px; }

.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin: 8px 0; }
.chars button { border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 4px; cursor: pointer; font-size: 12px; font-weight: 700; }
.chars button[aria-pressed=true] { border-color: var(--or2); background: #fff4ec; }
.chars img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.banner { background: #fff4e5; border: 2px solid var(--or); border-radius: 12px; padding: 9px 12px; margin: 0 0 12px; font-size: 13.5px; }
.langbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

dialog { border: 0; border-radius: 18px; padding: 0; width: min(640px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(20, 35, 30, .5); }
.dlg-h { padding: 14px 18px; background: var(--d); color: #fff; font-weight: 900; font-size: 17px; }
.dlg-b { padding: 14px 18px; max-height: 70vh; overflow: auto; } .dlg-f { padding: 12px 18px; display: flex; gap: 8px; justify-content: flex-end; background: #f4f8f2; }
.dlg-b textarea { width: 100%; min-height: 200px; border: 2px solid var(--line); border-radius: 10px; padding: 8px; }
.dropzone { border: 3px dashed var(--d); border-radius: 14px; padding: 18px; text-align: center; background: #f4faf6; cursor: pointer; margin-bottom: 10px; font-weight: 700; color: var(--d); }
.dropzone.on { background: var(--t); }
#toast { position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%); background: #263238; color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 99; max-width: 92vw; text-align: center; }
#toast.on { opacity: 1; }
.tabs { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .app[data-view=edit] .pv { display: none; } .app[data-view=lihat] .ed { display: none; }
  .brand-t small { display: none; } #selContoh { max-width: 120px; }
  .tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 3px solid var(--or2); z-index: 50; }
  .tabs button { flex: 1; border: 0; background: #fff; padding: 12px; font-weight: 800; color: var(--mut); }
  .tabs button[aria-pressed=true] { color: #fff; background: var(--d); }
  .pv-frame { min-height: 60vh; }
}
@media (max-width: 520px) { .row3, .row2 { grid-template-columns: 1fr; } .btn { padding: 6px 10px; font-size: 13px; } }
