/* Layout: lab-notebook tool. Sticky top nav with the 7 rubric points; each page opens with its
   rubric text and a "Yang bisa diunduh" card, then tables and charts in panels.
   Palette from orbital isosurfaces: positive lobe blue, negative lobe red, on a cool neutral. */
:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #15202b;
  --muted: #5a6877;
  --line: #dbe1e7;
  --soft: #eef2f6;
  --accent: #2456c8;
  --accent-soft: #e3ebfb;
  --lobe-neg: #c4402e;
  --good: #1d7f48;
  --good-soft: #e1f3e8;
  --warn: #9a6512;
  --warn-soft: #fbf0d9;
  --bad: #bf2f2f;
  --bad-soft: #fbe4e4;
  --hl: #fff7e0;
  --f-display: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1318; --panel: #151c23; --ink: #e5eaef; --muted: #93a2b0; --line: #27323d; --soft: #1b242d;
    --accent: #7aa2ff; --accent-soft: #1c2a47; --lobe-neg: #ff8a78; --hl: #2c2614;
    --good: #57c98f; --good-soft: #163325; --warn: #e2b555; --warn-soft: #362a12; --bad: #ff7676; --bad-soft: #3a1b1b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1318; --panel: #151c23; --ink: #e5eaef; --muted: #93a2b0; --line: #27323d; --soft: #1b242d;
  --accent: #7aa2ff; --accent-soft: #1c2a47; --lobe-neg: #ff8a78; --hl: #2c2614;
  --good: #57c98f; --good-soft: #163325; --warn: #e2b555; --warn-soft: #362a12; --bad: #ff7676; --bad-soft: #3a1b1b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.55; }
img, svg, canvas { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; line-height: 1.25; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.2rem); font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 0.98rem; font-weight: 600; margin-bottom: 6px; }
p { margin: 0; }
code, pre, .num, .mono { font-family: var(--f-mono); }
code { background: var(--soft); padding: 0 4px; border-radius: 4px; font-size: 0.9em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.wrap {
  max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 24px 32px;
}
button, select, input { font: inherit; color: inherit; }
button { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--panel); font-weight: 600; }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); padding: 2px 6px; }
button.ghost:hover { color: var(--bad); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select, input[type="number"], input[type="text"] { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 5px 8px; min-width: 0; max-width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }

/* navigation */
.topnav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--panel); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--panel); }
.topnav-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 8px; }
.brand { font-family: var(--f-display); font-weight: 700; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-mark { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, var(--accent) 0 45%, transparent 46%), radial-gradient(circle at 70% 70%, var(--lobe-neg) 0 45%, transparent 46%); }
.navlinks { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; min-width: 0; }
.navlinks a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 6px; white-space: nowrap; font-size: 0.92rem; }
.navlinks a b { font-family: var(--f-mono); font-weight: 600; color: var(--accent); margin-right: 3px; }
.navlinks a:hover { background: var(--soft); color: var(--ink); }
.navlinks a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
@media (max-width: 760px) { .topnav-inner { flex-direction: column; align-items: stretch; gap: 4px; } }

/* landing */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: stretch; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero-text { display: flex; flex-direction: column; gap: 10px; padding-block: 8px; }
.hero-text .lede { max-width: 62ch; }
.eyebrow { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 600; }
.lede { font-size: 1.02rem; color: var(--ink); max-width: 75ch; }
.drop { border: 1.5px dashed var(--line); border-radius: var(--r); background: var(--panel); padding: 20px; display: flex; flex-direction: column; gap: 10px; justify-content: center; min-height: 180px; }
.drop.over, body.dragging .drop { border-color: var(--accent); background: var(--accent-soft); }
.banner { border-radius: 6px; padding: 8px 12px; background: var(--accent-soft); font-size: 0.9rem; }
.banner.err { background: var(--bad-soft); color: var(--bad); }
.steps { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 8px; max-width: 95ch; }
.sec-title { margin-bottom: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 12px; }
.card { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.card:hover { border-color: var(--accent); }
.card-no { grid-row: span 2; font-family: var(--f-mono); font-weight: 600; font-size: 1.3rem; color: var(--accent); width: 1.6em; }
.card-title { font-weight: 600; }
.card-desc { font-size: 0.86rem; color: var(--muted); }
.form-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.form-row label, .picker { display: flex; flex-direction: column; gap: 3px; font-size: 0.82rem; color: var(--muted); min-width: 0; }
.form-row input { width: 190px; }

/* page */
.page-head { display: flex; flex-direction: column; gap: 6px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.empty-state { align-items: flex-start; }
.empty { color: var(--muted); font-style: italic; font-size: 0.9rem; }
.dlcard { border: 1px solid var(--accent); border-radius: var(--r); background: var(--accent-soft); padding: 14px 16px; }
.dlcard h2 { font-size: 0.95rem; margin-bottom: 8px; }
.dlcard ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dlcard li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; align-items: center; border-top: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); padding-top: 6px; }
.dlcard li:first-child { border-top: 0; padding-top: 0; }
.dlrow { display: flex; flex-wrap: wrap; gap: 6px; }
button.dl { font-size: 0.82rem; padding: 3px 10px; border-color: var(--accent); color: var(--accent); background: var(--panel); }
button.dl:hover { background: var(--accent); color: var(--panel); }
details.how { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; }
details.how summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }
details.how ul { margin: 6px 0 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; max-width: 100ch; }
.warns { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: start; }
.grid2 > * { min-width: 0; }
.chart { margin: 0; }
.chart svg { display: block; height: auto; max-width: 760px; }

/* tables */
.scroll { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 0.8rem; }
td.r, th.r { text-align: right; }
tr.hl td { background: var(--hl); }
td select { max-width: 240px; }
td input[type="text"] { width: 150px; }

/* state */
.pill { display: inline-block; font-size: 0.74rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.ok { background: var(--good-soft); color: var(--good); }
.warnp { background: var(--warn-soft); color: var(--warn); }
.badp, .bad { background: var(--bad-soft); color: var(--bad); }
.checks { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; gap: 4px 12px; align-items: baseline; font-size: 0.9rem; }
.kv .k { color: var(--muted); }
.kv .v { font-family: var(--f-mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.chip { font-family: var(--f-mono); font-size: 0.72rem; color: var(--accent); background: var(--accent-soft); border: 0; border-radius: 4px; padding: 0 6px; cursor: pointer; white-space: nowrap; }
pre.snip { margin: 0; background: var(--soft); border-radius: 6px; padding: 10px; font-size: 0.8rem; overflow-x: auto; line-height: 1.45; min-height: 3em; }
pre.snip mark { background: var(--accent-soft); color: var(--ink); outline: 1px solid var(--accent); }

/* viewer */
.tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; font-size: 0.88rem; }
.tools label { display: inline-flex; gap: 6px; align-items: center; }
.viewers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.viewers figure { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.viewers figcaption { font-size: 0.86rem; color: var(--muted); }
.viewer { width: 100%; aspect-ratio: 4 / 3; max-width: 100%; background: var(--soft); border-radius: 6px; touch-action: none; cursor: grab; overflow: hidden; }
.viewer:active { cursor: grabbing; }
.viewer canvas { width: 100%; height: 100%; display: block; }

.foot { font-size: 0.82rem; color: var(--muted); gap: 6px; padding-block: 0 32px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
