/* KaDok — native-app look: grouped surfaces, large title, hero record block, tab bar. */
:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --ink: #111114;
  --ink-2: #6e6e73;
  --sep: #e5e5ea;
  --accent: #1f9d55;
  --accent-dark: #146c3a;
  --accent-soft: #e6f6ec;
  --red: #ff3b30;
  --r: 16px;
  --tap: 50px;
  --tab-h: 64px;
  --font: -apple-system, system-ui, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.app { max-width: 600px; margin: 0 auto; padding: 0 16px calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
.app section > * + * { margin-top: 20px; }

/* Header */
.hdr { padding-top: calc(14px + env(safe-area-inset-top)); display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hdr h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.hdr .sub { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.hdr.nav { align-items: center; padding-top: calc(10px + env(safe-area-inset-top)); }
.hdr.nav h1 { font-size: 18px; font-weight: 600; }
.iconbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 999px; background: var(--surface); color: var(--accent); font-weight: 600; font-size: 15px; }
.iconbtn svg { width: 18px; height: 18px; }

/* Grouped forms */
.grp-title { font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 6px 16px; }
.grp { background: var(--surface); border-radius: var(--r); overflow: hidden; }
.grp > * + * { border-top: 1px solid var(--sep); }
.cell { display: block; padding: 10px 16px; }
.cell span { display: block; font-size: 12px; color: var(--ink-2); }
.cell input, .cell select { width: 100%; min-height: 30px; padding: 2px 0 0; border: 0; background: transparent; font-size: 17px; outline: none; }
.cell input::placeholder { color: #c7c7cc; }
.cell select { -webkit-appearance: none; appearance: none; }
.split { display: grid; grid-template-columns: 1fr 1fr; }
.split > * + * { border-top: 0; border-left: 1px solid var(--sep); }
input[type="date"] { display: block; -webkit-appearance: none; appearance: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2px; background: var(--bg); padding: 2px; border-radius: 9px; margin-top: 6px; }
.seg label { text-align: center; padding: 6px 0; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.seg input { display: none; }
.seg input:checked + label { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
textarea { width: 100%; display: block; border: 0; padding: 14px 16px; background: transparent; resize: vertical; font-size: 16px; line-height: 1.5; outline: none; }
textarea::placeholder { color: #c7c7cc; }
.file { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: var(--tap); color: var(--accent); font-weight: 600; cursor: pointer; }
.file input { display: none; }
.file .n { margin-left: auto; color: var(--ink-2); font-weight: 400; font-size: 14px; }

/* Hero record block */
.hero-rec { background: linear-gradient(160deg, var(--accent) 0%, var(--accent-dark) 100%); color: #fff; border-radius: 22px; padding: 22px 20px 18px; }
.hero-rec .t { font-size: 20px; font-weight: 700; }
.hero-rec .s { font-size: 14px; opacity: .85; margin-top: 2px; }
.mic { margin: 22px auto 14px; width: 96px; height: 96px; border-radius: 50%; border: 0; background: #fff; color: var(--accent-dark); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.22); transition: transform .1s; }
.mic svg { width: 40px; height: 40px; stroke-width: 2; }
.mic:active { transform: scale(.94); }
.mic.rec { background: var(--red); color: #fff; animation: pulse 1.3s ease-out infinite; }
.mic.rec svg.on { display: none; }
.mic:not(.rec) svg.off { display: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.45); } 100% { box-shadow: 0 0 0 22px rgba(255,255,255,0); } }
.status { text-align: center; font-variant-numeric: tabular-nums; font-size: 15px; min-height: 1.5em; opacity: .95; }
.chips { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip svg { width: 18px; height: 18px; }
.chip.rec { background: #fff; color: var(--red); }
.err { color: var(--red); font-weight: 600; font-size: 15px; padding: 0 4px; }
.err:empty { display: none; }

/* CTA + tab bar */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 600px; margin: 0 auto; min-height: 54px; padding: 12px 20px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 700; box-shadow: 0 6px 20px rgba(31,157,85,.35); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn:active { transform: translateY(1px); }
body.busy .btn::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(255,255,255,.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--sep); display: flex; }
.tabbar button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.tabbar button.on { color: var(--accent); }
.tabbar svg { width: 24px; height: 24px; }
.fabslot { flex: 1; position: relative; }
#fab { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--bg); background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(31,157,85,.4); }
#fab svg { width: 28px; height: 28px; stroke-width: 2; }
#fab:active { transform: translateX(-50%) scale(.94); }
#fab.rec { background: var(--red); box-shadow: 0 6px 18px rgba(255,59,48,.4); animation: pulse 1.3s ease-out infinite; }
#fab.rec svg.on, #fab:not(.rec) svg.off { display: none; }

/* Invite */
.welcome { min-height: 88svh; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 24px; }
.welcome .logo { width: 72px; height: 72px; border-radius: 18px; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(31,157,85,.3); }
.welcome .logo svg { width: 36px; height: 36px; }
.welcome h1 { font-size: 36px; font-weight: 800; letter-spacing: -.02em; margin-top: 22px; }
.welcome p { color: var(--ink-2); font-size: 17px; margin: 8px 0 28px; }
.welcome .grp { margin-bottom: 12px; }
.welcome .btn { position: static; }
.welcome .fine { font-size: 13px; color: var(--ink-2); margin-top: 18px; }

/* History */
.hist { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r); overflow: hidden; }
.hist > * + * { border-top: 1px solid var(--sep); }
.hist-item { display: flex; align-items: center; }
.hist-item .open { flex: 1; min-width: 0; text-align: left; padding: 14px 16px; border: 0; background: none; min-height: var(--tap); display: flex; align-items: center; gap: 14px; }
.hist-item .open .av { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-dark); display: grid; place-items: center; font-weight: 700; flex: none; }
.hist-item .open b { display: block; font-size: 17px; font-weight: 600; }
.hist-item .open .txt { min-width: 0; color: var(--ink); }
.hist-item .open .txt span { display: block; color: var(--ink-2); font-size: 14px; }
.hist-item .del { border: 0; background: none; color: var(--red); padding: 14px 16px; min-height: var(--tap); }
.empty { padding: 48px 16px; text-align: center; color: var(--ink-2); }

/* Result */
.report { background: var(--surface); border-radius: var(--r); padding: 16px; overflow-x: auto; }
.nav-actions { display: flex; gap: 8px; }

  /* --- Report: mirrors Hasil-Konsultasi-Prof-Talib.pdf --- */
  #result { font-size: 9pt; line-height: 1.4; color: #111; }
  #result h1 { font-size: 14pt; font-weight: 700; margin: 0 0 .25rem; }
  #result .meta { font-size: 8pt; color: #333; margin: 0; }
  #result h2 { font-size: 10pt; font-weight: 700; margin: 1.1rem 0 .4rem; padding-bottom: .15rem; border-bottom: 1px solid #555; }
  #result table { border-collapse: collapse; width: 100%; margin: 0; font-size: 9pt; }
  #result th, #result td { border: 1px solid #999; padding: .3rem .45rem; vertical-align: top; text-align: left; }
  #result th { background: #e6e6e6; font-weight: 700; }
  #result td.w { width: 9rem; font-weight: 700; }
  #result ul { list-style: disc; padding-left: 1.1rem; margin: 0; }
  #result li { margin: .1rem 0; }
  #result .box { border: 1px solid #c00; padding: .45rem .6rem; }
  #result .small { font-size: 7.8pt; color: #555; }
  #result .distop { text-decoration: line-through; color: #888; }
  #result .red { color: #c00; font-weight: 700; margin-left: .3rem; }
  #result .footer { border-top: 1px solid #555; margin-top: 1.6rem; padding-top: .4rem; }
  @page { size: A4; margin: 15mm 14mm; }
  @media print {
    .no-print { display: none !important; }
    body { padding: 0; max-width: none; }
    #screen-result { display: block !important; }
  }
@media screen { .report #result { zoom: 1.25; } } /* readable on phone; print keeps the PDF scale */
@media print {
  .app { padding: 0; max-width: none; }
  .report { padding: 0; border-radius: 0; }
}

.welcome .tagline { font-weight: 700; font-size: 1.1rem; margin: .2rem 0 .4rem; }
