/* MACRW identity, light: white panels on #f2f2f2, near-black ink, MACRW Red #C80404, Outfit,
   uppercase spaced labels, pill buttons. Base shared with MACRW Skin Analyzer; colour-analysis parts at the end. */
@font-face {
  font-family: "Outfit"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/outfit-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Outfit"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/outfit-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f2f2f2;
  --panel: #fff;
  --panel2: #f2f2f2;
  --panel3: #e5e5e5;
  --line: rgba(0, 0, 0, .1);
  --line-hi: rgba(0, 0, 0, .24);
  --text: #0d0d0d;
  --muted: rgba(0, 0, 0, .52);
  --soft: rgba(0, 0, 0, .72);
  --accent: #c80404;
  --accent-hi: #a80303;
  --accent-soft: rgba(200, 4, 4, .08);
  --accent-text: #c80404;
  --stage: #1a1a1a;
  --scan: #c80404;
  --good: #138a4b;
  --good-soft: rgba(19, 138, 75, .1);
  --watch: #b26b00;
  --watch-soft: rgba(178, 107, 0, .1);
  --concern: #c80404;
  --concern-soft: rgba(200, 4, 4, .08);
  --radius: 14px;
  --ease: cubic-bezier(0, 0, .3642, 1);
  --font: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--font); }
h1, h2, h3, h4 { margin: 0; font-weight: 500; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.k, .eyebrow, .ck, .chip-s, .pill, .btn, .routine h4, .ingr h4 { text-transform: uppercase; letter-spacing: 1.5px; }

/* top bar (same as MACRW Clipper) */
.top {
  position: sticky; top: 0; z-index: 10; min-height: 58px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px;
  padding-block: 10px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.brand img { height: 26px; display: block; }
.brand .divider { width: 1px; height: 22px; background: var(--line-hi); }
.brand .app-name { text-transform: uppercase; letter-spacing: 3px; font-size: 12px; font-weight: 500; }
.brand .app-name b { color: var(--accent); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-s { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 500; padding: 5px 11px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.chip-s i { width: 7px; height: 7px; border-radius: 50%; background: var(--panel3); }
.chip-s.ok { color: var(--text); } .chip-s.ok i { background: var(--good); }
.chip-s.wait i { background: var(--watch); animation: blink 1s infinite alternate; }
.chip-s.off i { background: var(--accent); }
@keyframes blink { to { opacity: .3; } }

.wrap {
  max-width: 1320px; margin: 0 auto; display: grid; gap: 28px;
  padding-block: 32px 56px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* hero */
.hero { display: grid; gap: 10px; }
.eyebrow { font-size: 11px; font-weight: 500; color: var(--accent); letter-spacing: 3px; }
.hero h1 { font-size: clamp(34px, 5.5vw, 60px); line-height: 1.05; font-weight: 500; letter-spacing: -.01em; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--muted); max-width: 62ch; font-size: 16px; }

.main { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1000px) { .main { grid-template-columns: minmax(0, 1fr) 370px; } }

/* viewer */
.viewer { display: grid; gap: 12px; min-width: 0; }
.stage { position: relative; width: 100%; aspect-ratio: var(--ratio, 16 / 9); max-height: 72vh; margin: 0 auto; background: var(--stage); border-radius: var(--radius); overflow: hidden; }
.stage video, .stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.stage video.mirror { transform: scaleX(-1); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: rgba(255,255,255,.6); text-align: center; padding: 16px; }
.stage-empty svg { width: 86px; color: rgba(255,255,255,.35); }
.stage-empty p { text-transform: uppercase; letter-spacing: 3px; font-size: 11px; }
.guide { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: rgba(13,13,13,.8); color: #fff; font-size: 13px; font-weight: 500; padding: 7px 16px; border-radius: 999px; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; letter-spacing: .3px; }
.guide.ready { background: rgba(19, 138, 75, .92); }
.scan-hud { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 3px var(--accent); border-radius: var(--radius); }
.scan-hud .scanline { position: absolute; left: 0; right: 0; height: 3px; background: var(--accent); box-shadow: 0 0 22px 6px rgba(200, 4, 4, .55); animation: sweep 1.5s ease-in-out infinite alternate; }
.scan-hud .count { position: absolute; right: 18px; bottom: 10px; font-size: 56px; font-weight: 600; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.5); font-variant-numeric: tabular-nums; }
@keyframes sweep { from { top: 0; } to { top: calc(100% - 3px); } }
@media (prefers-reduced-motion: reduce) { .scan-hud .scanline { animation: none; top: 50%; } .chip-s.wait i { animation: none; } }

.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.ck { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 500; padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.ck i { width: 7px; height: 7px; border-radius: 50%; background: var(--panel3); }
.ck.ok { color: var(--text); } .ck.ok i { background: var(--good); }
.ck.bad { color: var(--accent-text); border-color: rgba(200, 4, 4, .35); background: var(--accent-soft); } .ck.bad i { background: var(--accent); }

.controls { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 20px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; white-space: nowrap;
  font-size: 11px; font-weight: 500;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { border-color: var(--line-hi); background: var(--panel3); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; letter-spacing: 2px; font-weight: 600; }
.btn.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.controls .btn.primary { margin-left: auto; min-width: 200px; }
.btn.toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
@media (max-width: 560px) {
  .controls .btn { flex: 1 1 0; padding-inline: 10px; letter-spacing: 1px; }
  .controls .btn.toggle { flex: 0 0 auto; padding-inline: 14px; }
  .controls .btn.primary { margin-left: 0; flex-basis: 100%; min-height: 50px; font-size: 12px; letter-spacing: 2px; }
}
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.status { min-height: 1.5em; font-size: 13px; color: var(--muted); }
.status.err { color: var(--accent-text); }

/* live panel */
.live { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 18px; min-width: 0; }
.live-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.live-head h2 { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.live-head h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite alternate; }
.live-top { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fact { display: grid; gap: 3px; min-width: 0; }
.k { font-size: 10px; font-weight: 500; color: var(--muted); }
.fact .v { font-size: 19px; font-weight: 600; line-height: 1.25; }
.fact .v.big { font-weight: 500; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.fact .s { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fact .s.plain { font-family: var(--font); }
.fitz { display: grid; gap: 7px; }
.swatches { display: flex; gap: 3px; }
.sw { flex: 1; height: 28px; border-radius: 999px; display: grid; place-items: center; font-size: 10px; font-weight: 600; color: rgba(0,0,0,.6); border: 2px solid transparent; transition: transform .2s var(--ease); }
.sw.dk { color: rgba(255,255,255,.88); }
.sw.on { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 4px 10px rgba(200, 4, 4, .2); }
.live-metrics { display: grid; gap: 11px; }
.lm { display: grid; gap: 5px; }
.lm .row { display: flex; justify-content: space-between; font-size: 13px; }
.lm .row b { font-weight: 500; }
.lm .row span { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { height: 5px; border-radius: 999px; background: var(--panel3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; transition: width .3s var(--ease); }
.bar i.good { background: var(--good); } .bar i.watch { background: var(--watch); } .bar i.concern { background: var(--accent); }
.hint { font-size: 12px; color: var(--muted); }

/* report */
.report { display: grid; gap: 22px; border-top: 1px solid var(--line); padding-top: 28px; scroll-margin-top: 80px; }
.report-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 16px; }
.report-head h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 500; line-height: 1.1; }
.report-head h2::before { content: "Hasil pindaian"; display: block; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 500; padding: 4px 11px; border-radius: 999px; background: var(--panel3); color: var(--soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.watch { background: var(--watch-soft); color: var(--watch); }
.pill.concern { background: var(--accent-soft); color: var(--accent-text); }
.pill.busy::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink .7s infinite alternate; }

.report-body { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .report-body { grid-template-columns: 270px minmax(0, 1fr); align-items: start; } }
.snap { display: grid; gap: 8px; }
.snap img { width: 100%; border-radius: var(--radius); display: block; }
.snap p { font-size: 12px; color: var(--muted); }
.report-main { display: grid; gap: 22px; min-width: 0; }

.vitals { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.ring { position: relative; width: 132px; height: 132px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--panel3); }
.ring .val { stroke: var(--accent); stroke-linecap: round; }
.ring .num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .num b { font-weight: 600; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.ring .num span { font-size: 9px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; margin-top: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 20px; min-width: 0; }
@media (max-width: 560px) { .vitals { grid-template-columns: 1fr; justify-items: center; } .facts { width: 100%; } }

.summary { font-size: 17px; max-width: 70ch; line-height: 1.6; }
.notice { padding: 13px 16px; border-radius: 12px; font-size: 14px; display: grid; gap: 3px; }
.notice.warn { background: var(--watch-soft); border: 1px solid rgba(178, 107, 0, .3); }
.notice.alert { background: var(--accent-soft); border: 1px solid rgba(200, 4, 4, .35); }
.notice b { font-weight: 600; }

.section { display: grid; gap: 12px; }
.section h3 { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; font-weight: 600; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 9px; min-width: 0; }
.metric .row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.metric .name { font-weight: 500; }
.metric .score { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 15px; }
.metric .note { font-size: 13px; color: var(--muted); }
.zones { display: grid; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px; }
.zone { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.zone:last-child { border-bottom: 0; }
.zone .zn { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.zone .zd { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.zd.good { background: var(--good); } .zd.watch { background: var(--watch); } .zd.concern { background: var(--accent); }
.zone p { font-size: 14px; color: var(--muted); }
@media (max-width: 480px) { .zone { grid-template-columns: 1fr; gap: 2px; } }
.routine, .ingr { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.routine .col { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 8px; align-content: start; }
.routine h4, .ingr h4 { font-size: 10px; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.routine ol { margin: 0; padding-left: 20px; display: grid; gap: 7px; font-size: 14px; }
.routine li::marker { color: var(--accent); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--good-soft); color: var(--text); }
.tag.no { background: var(--accent-soft); }

.foot { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; max-width: 95ch; }

/* live readout on the camera itself, so phones see it without scrolling */
.stage-hud { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; max-width: calc(100% - 90px); }
.stage-hud span { background: rgba(13,13,13,.78); color: #fff; border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stage-hud b { color: #ff6a6a; font-weight: 600; margin-left: 4px; }

/* phone */
@media (max-width: 640px) {
  .top { position: static; min-height: 0; padding-block: 12px; gap: 10px; }
  .brand img { height: 22px; }
  .brand .app-name { font-size: 11px; letter-spacing: 2.5px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip-s { font-size: 9px; padding: 4px 9px; flex: none; }
  .wrap { padding-block: 22px 40px; gap: 22px; }
  .hero p { font-size: 15px; }
  .stage { border-radius: 12px; max-height: 70vh; }
  .guide { font-size: 12px; top: 10px; }
  .scan-hud .count { font-size: 44px; }
  .live { padding: 16px; }
  .fact .v.big { font-size: 34px; }
  .snap img { max-width: 260px; }
  .report-main { gap: 18px; }
  .vitals { padding: 16px; }
}

/* single-column grids never grow past their container (long nowrap labels used to push the live panel wider) */
.wrap, .hero, .viewer, .live, .report, .report-main, .section, .fitz, .live-metrics, .lm, .metric { grid-template-columns: minmax(0, 1fr); }
.live-head, .report-head { flex-wrap: wrap; }
.live-top .fact, .facts .fact { overflow-wrap: anywhere; }
.k { letter-spacing: 1.2px; }
.sw { min-width: 0; }
@media (max-width: 360px) {
  .live-top { gap: 12px; }
  .fact .v.big { font-size: 30px; }
  .fact .v { font-size: 17px; }
  .live-head h2 { letter-spacing: 2px; }
  .sw { height: 24px; font-size: 9px; }
  .controls .btn { font-size: 10px; letter-spacing: .5px; }
}
@media (max-width: 560px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .ring { width: 116px; height: 116px; } }

/* portrait camera on phones: the stream is cropped (cover) into a 3:4 frame */
.stage.portrait { width: min(100%, calc(70vh * 3 / 4)); max-height: none; }
.stage.portrait video { object-fit: cover; }

/* header: brand + one status; detailed status lives under the hero */
.top { flex-wrap: nowrap; }
.top-status { display: inline-flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--soft); white-space: nowrap; }
.top-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--watch); box-shadow: 0 0 0 4px var(--watch-soft); }
.top-status.ok i { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.top-status.off i { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.top-status.wait i { animation: blink .8s infinite alternate; }

.sys { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.sys .chip-s { all: unset; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sys .chip-s svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sys .chip-s .lbl { color: var(--text); font-weight: 500; }
.sys .chip-s .note { font-size: 12px; }
.sys .chip-s .note::before { content: "· "; }
.sys .chip-s .note:empty { display: none; }
.sys .chip-s.ok svg { color: var(--good); } .sys .chip-s.ok .note { color: var(--good); }
.sys .chip-s.wait svg { color: var(--watch); animation: blink .8s infinite alternate; }
.sys .chip-s.off svg { color: var(--accent); } .sys .chip-s.off .note { color: var(--accent-text); }
@media (max-width: 640px) {
  .top { position: sticky; flex-wrap: nowrap; padding-block: 10px; }
  .top-status { font-size: 9px; letter-spacing: 1px; }
  .sys { gap: 6px 16px; }
  .sys .chip-s { font-size: 12px; }
  .sys .chip-s svg { width: 16px; height: 16px; }
}
@media (prefers-reduced-motion: reduce) { .top-status.wait i, .sys .chip-s.wait svg { animation: none; } }

.ck em { font-style: normal; font-weight: 600; letter-spacing: .5px; text-transform: none; font-variant-numeric: tabular-nums; }
.ck em:empty { display: none; }
.ck em::before { content: "· "; font-weight: 400; }
.brand { min-width: 0; }
.guide { white-space: normal; text-align: center; line-height: 1.3; width: max-content; max-width: calc(100% - 24px); border-radius: 16px; overflow: visible; text-overflow: clip; }
@media (max-width: 480px) {
  .top-status span { display: none; }
  .top-status { padding: 6px; }
  .brand { gap: 10px; }
  .brand .divider { height: 18px; }
}

/* report header: title + one muted meta line, one status pill */
.report-title { display: grid; gap: 4px; }
.report-head .meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.snap p b { color: var(--text); font-weight: 500; }
@media (max-width: 640px) {
  .report { padding-top: 22px; gap: 18px; }
  .report-head { align-items: flex-start; }
  .report-head h2 { font-size: 30px; }
  .pill { font-size: 9px; letter-spacing: 1px; padding: 4px 10px; }
  /* compact snapshot: thumbnail beside its caption instead of a full-width photo */
  .snap { grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
  .snap img { width: 92px; height: 92px; max-width: none; object-fit: cover; border-radius: 10px; }
  .snap p { font-size: 13px; }
  .notice { font-size: 13px; padding: 12px 14px; }
}

/* camera controls on the stage */
.cam-ctrl { position: absolute; right: 12px; top: 56px; display: grid; gap: 8px; z-index: 3; }
.cam-ctrl button { display: grid; justify-items: center; gap: 3px; width: 64px; padding: 9px 4px 7px; border: 0; border-radius: 14px; background: rgba(13,13,13,.62); color: #fff; cursor: pointer; font: 500 9px/1.1 var(--font); letter-spacing: .5px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cam-ctrl button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cam-ctrl button[aria-pressed="true"] { background: #fff; color: var(--accent); }
.cam-ctrl button[aria-pressed="true"] svg { fill: var(--accent); stroke: var(--accent); }
.shutter { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: 68px; height: 68px; border-radius: 50%; border: 4px solid #fff; background: rgba(255,255,255,.18); padding: 5px; cursor: pointer; z-index: 3; box-shadow: 0 4px 18px rgba(0,0,0,.35); }
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--accent); transition: transform .2s var(--ease), border-radius .2s var(--ease); }
.shutter:disabled { opacity: .5; cursor: default; }
.shutter.busy span { transform: scale(.55); border-radius: 8px; }
.stage-hud { bottom: 96px; }
@media (min-width: 641px) { .stage-hud { bottom: 12px; } }

/* front "flash": the whole screen around the camera turns white and lights the face */
.stage.ringlight { z-index: 60; box-shadow: 0 0 0 100vmax #fff; outline: 10px solid #fff; }
body.screen-light .top { z-index: 1; }
body.screen-light .guide { background: rgba(13,13,13,.85); }

/* after a scan: the frame stays on the result until "Pindai ulang" */
.retake { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border: 0; border-radius: 999px; background: #fff; color: var(--accent); font: 600 12px/1 var(--font); letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; box-shadow: 0 6px 22px rgba(0,0,0,.3); }
.retake svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stage.frozen::before { content: "Hasil terkunci"; position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 3; background: rgba(19, 138, 75, .92); color: #fff; font: 600 12px/1 var(--font); letter-spacing: 1.5px; text-transform: uppercase; padding: 8px 14px; border-radius: 999px; }
.stage.frozen .cam-ctrl { opacity: .4; pointer-events: none; }

/* ================= colour analysis ================= */
.wb-hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 12px; background: rgba(13,13,13,.86); color: #fff; font-size: 13px; padding: 8px 8px 8px 16px; border-radius: 999px; width: max-content; max-width: calc(100% - 24px); }
.wb-hint button { border: 0; border-radius: 999px; background: #fff; color: var(--text); font: 600 11px/1 var(--font); letter-spacing: 1px; text-transform: uppercase; padding: 8px 12px; cursor: pointer; }
.stage.picking { cursor: crosshair; box-shadow: 0 0 0 3px var(--good); }
.stage.picking.frozen::before { display: none; }

.feat { display: grid; gap: 9px; }
.fr { display: grid; grid-template-columns: 22px 64px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13px; }
.fr .dot { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }
.fr .dot.empty { background: repeating-linear-gradient(45deg, var(--panel3) 0 4px, var(--panel) 4px 8px); }
.fr b { font-weight: 500; }
.fr span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.axes { display: grid; gap: 14px; }
.ax { display: grid; gap: 6px; }
.ax .row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.ax .row b { font-weight: 500; }
.ax .row span { font-weight: 600; }
.ax .track { position: relative; height: 8px; border-radius: 999px; }
.ax .track i { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--text); transform: translate(-50%, -50%); transition: left .3s var(--ease); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.ax .ends { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.guess { display: grid; gap: 4px; padding: 12px 14px; background: var(--panel2); border-radius: 12px; }
.guess b { font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.guess b::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--fam); }

.sub { font-size: 13px; color: var(--muted); }
.res-hero { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .res-hero { grid-template-columns: minmax(0, 460px) minmax(0, 1fr); } }
.drape-box { display: grid; gap: 10px; position: sticky; top: 76px; }
@media (max-width: 899px) { .drape-box { position: static; } }
.drapes { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.drapes.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.drapes figure { margin: 0; display: grid; gap: 7px; }
.drapes canvas { width: 100%; aspect-ratio: 1; border-radius: var(--radius); display: block; background: var(--panel3); }
.drapes figcaption { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--soft); font-variant-numeric: tabular-nums; }
.drapes figcaption em { color: var(--accent-text); font-style: normal; }
.drapes figcaption .dot, .mt .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 1px solid rgba(0,0,0,.12); }
.drape-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.res-info { display: grid; gap: 16px; align-content: start; min-width: 0; }
.fam { justify-self: start; display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; background: color-mix(in srgb, var(--fam) 16%, #fff); color: color-mix(in srgb, var(--fam) 70%, #000); }
.fam::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--fam); }
.traits { display: flex; flex-wrap: wrap; gap: 6px; }
.traits .tag { background: var(--panel); border: 1px solid var(--line); font-weight: 500; }
.matches { display: grid; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.mt { display: grid; grid-template-columns: 12px minmax(0, 170px) minmax(0, 1fr) 42px; align-items: center; gap: 10px; font-size: 14px; }
.mt b { font-weight: 500; }
.mt.on b { font-weight: 600; }
.mt .bar { height: 6px; }
.mt .bar i { background: var(--text); }
.mt.on .bar i { background: var(--accent); }
.mt .pc { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .mt { grid-template-columns: 12px minmax(0, 1fr) 70px 38px; } }

.pal { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .pal { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pal.small { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.pal.tiny { grid-template-columns: repeat(4, 38px); gap: 8px; margin-bottom: 6px; }
.swb { aspect-ratio: 1; width: 100%; border-radius: 12px; border: 1px solid rgba(0,0,0,.1); cursor: pointer; padding: 0; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.pal.tiny .swb { border-radius: 50%; }
.swb:hover { transform: translateY(-2px); }
.swb.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); }
.pal.avoid .swb { position: relative; }
.pal.avoid .swb::after { content: ""; position: absolute; inset: 22% ; background: linear-gradient(45deg, transparent calc(50% - 1.5px), rgba(255,255,255,.9) calc(50% - 1.5px) calc(50% + 1.5px), transparent calc(50% + 1.5px)); }
.pal-row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 6px; }
.pal-row h4, .routine h4 { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.routine p { font-size: 14px; margin-bottom: 6px; }

.profile { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; align-content: start; }
.wb-row, .save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.save-row { border-top: 1px solid var(--line); padding-top: 22px; }

.dtest { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; scroll-margin-top: 80px; }
.dtest h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.dtest .step { font-size: 12px; color: var(--muted); letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.dt-intro { display: grid; gap: 14px; justify-items: start; }
.dt-intro p { max-width: 70ch; color: var(--soft); font-size: 14px; }
.dt-q { font-size: 22px; font-weight: 500; }
.drapes.dt { max-width: 760px; }
.dt-btns { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; max-width: 760px; }
.dt-btns .btn { min-height: 48px; }
.dt-btns [data-v="A"], .dt-btns [data-v="B"] { background: var(--text); color: #fff; border-color: var(--text); }
.dt-btns [data-v="A"]:hover, .dt-btns [data-v="B"]:hover { background: #333; }
.dt-prog { display: flex; align-items: center; gap: 6px; }
.dt-prog i { width: 26px; height: 5px; border-radius: 999px; background: var(--panel3); }
.dt-prog i.done { background: var(--text); }
.dt-prog i.cur { background: var(--accent); }
.link { margin-left: auto; border: 0; background: none; color: var(--muted); font: 500 12px var(--font); text-decoration: underline; cursor: pointer; }
@media (max-width: 480px) { .dt-btns { grid-template-columns: 1fr 1fr; } .dt-btns [data-v="0"] { grid-column: 1 / -1; order: 3; } .dt-q { font-size: 19px; } .dtest { padding: 16px; } }
.report .notice { max-width: 90ch; }
.pal { max-width: 720px; }
.pal.small { max-width: 400px; }
.pal-row { max-width: 860px; }
