/* InfoGizi — hand-written, no build step */

:root {
  /* Brand: --brand for accents (bars, borders, rings); --brand-dark for filled
     surfaces and links, since white on --brand fails AA contrast (3.5:1). */
  --brand: #0f9d6b;
  --brand-dark: #0b7a53;
  --brand-deep: #075236;
  --brand-light: #e6f7f0;
  --good: #16a34a;
  --good-bg: #dcfce7;
  --good-ink: #14532d;
  --good-border: #bbf0cf;
  --bad: #dc2626;
  --bad-bg: #fee2e2;
  --bad-ink: #7f1d1d;
  --bad-border: #f3c9c9;
  --amber: #f59e0b;
  --warn-bg: #fff7e6;
  --warn-ink: #92610b;
  --warn-border: #f0cf8f;
  --ink: #16211c;
  --ink-raised: #2c372f;
  --ink-soft: #4b5a52;
  --ink-faint: #8a9a91;
  --on-ink: #ffffff;
  --on-ink-soft: #cdd9d1;
  --border: #dfe7e2;
  --bg: #f7faf8;
  --card: #ffffff;
  --surface-muted: #eef3f0;
  --surface-hover: #f2f6f4;
  --surface-subtle: #fafcfb;
  --tap: 44px;
  --header-h: 57px; /* height of the sticky .site-header (one row, ≥820px); app.js keeps it measured at every width. Sticky table headers sit under it */
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 4px 12px rgba(16, 40, 30, .05);
  --max-width: 1180px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--brand-light); color: var(--brand-deep); }
input, textarea, select { accent-color: var(--brand-dark); caret-color: var(--brand-dark); }
:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
a { text-underline-offset: .18em; }
img { max-width: 100%; display: block; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  background: var(--brand-dark);
  color: var(--on-ink);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
}
.skip-link:focus { top: 12px; text-decoration: none; }
main:focus { outline: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  flex-wrap: wrap;
}
.brand-logo {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
.brand-logo:hover { text-decoration: none; }
.logo-mark { flex-shrink: 0; display: block; }
/* Wordmark (DESIGN.md "Logo"): text, not an image. "Gizi" uses pandan-dark: plain pandan is 3.5:1 on white. */
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.wordmark { font-size: 1.2rem; letter-spacing: -.01em; white-space: nowrap; }
.wordmark-a { color: var(--ink); font-weight: 500; }
.wordmark-b { color: var(--brand-dark); font-weight: 800; }
/* The tagline sits under the wordmark from 768 px; hidden on phones so the header never wraps at 360 px. */
.brand-tagline { display: none; font-size: .72rem; font-weight: 500; color: var(--ink-soft); white-space: nowrap; }
@media (min-width: 768px) { .brand-tagline { display: block; } }
.admin-sidebar .logo-mark, .login-title .logo-mark { flex-shrink: 0; }
.login-title .wordmark { font-size: inherit; }
.admin-sidebar .brand, .login-title { display: flex; align-items: center; gap: 6px; }
.login-title { justify-content: center; }
.main-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.main-nav a { color: var(--ink-soft); font-weight: 600; font-size: .95rem; display: inline-flex; align-items: center; min-height: 32px; }
.main-nav a:hover, .main-nav a.active { color: var(--brand-dark); text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  background: var(--brand-dark);
  color: var(--on-ink);
  min-height: 40px;
  justify-content: center;
}
.btn:hover { background: var(--brand-deep); text-decoration: none; color: var(--on-ink); }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-hover); color: var(--ink); }
.btn.danger { background: var(--card); color: var(--bad); border-color: var(--bad-border); }
.btn.danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn.small { padding: 5px 11px; font-size: .82rem; min-height: 32px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; }
.btn.is-disabled:hover { background: var(--brand-dark); }
/* Selected toggle ("✓ Dibandingkan"): a tinted, checked look that differs from both the filled
   primary and the white secondary, and sets its own text colour so neither variant leaves dark
   ink on green. :hover is listed so .btn.secondary:hover cannot whiten it. */
.btn.is-active, .btn.is-active:hover { background: var(--brand-light); color: var(--brand-deep); border-color: var(--brand); }

/* ---------- Search ---------- */
.search-box { position: relative; }
.brand-search, .category-search, .saved-search { max-width: 480px; margin: 12px 0; }
.search-form { display: flex; gap: 8px; }
.search-form input[type=search],
.search-form input[type=text] {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}
.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
}
.search-box .autocomplete-list:not(.open) { display: none; }
.autocomplete-list li a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  color: var(--ink);
}
.autocomplete-list li a:hover, .autocomplete-list li a.active { background: var(--brand-light); text-decoration: none; }
.autocomplete-list .ac-brand { color: var(--ink-soft); font-size: .85rem; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--brand-light), var(--bg));
  padding: 48px 0 32px;
  text-align: center;
}
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.hero p.lead { color: var(--ink-soft); max-width: 640px; margin: 0 auto 24px; }
.hero .search-box { max-width: 620px; margin: 0 auto; }
.suggestion-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.suggestion-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .82rem;
  color: var(--ink-soft);
}
.suggestion-chips a:hover { border-color: var(--brand); color: var(--brand-dark); text-decoration: none; }

/* ---------- Section headings ---------- */
.section { padding: 32px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.section-head h2 { font-size: 1.3rem; }
.section-head a.see-all { font-size: .88rem; font-weight: 600; }

/* ---------- Grids / cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
/* The thumb is an <a>: it must be a block for aspect-ratio to hold, otherwise a portrait
   packshot (e.g. 563×1000) sets its own height and stretches the whole grid row. */
.product-card .thumb {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-muted) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23a9bdb2' stroke-width='1.5'%3E%3Cpath d='M3 7h18M3 12h18M3 17h18'/%3E%3C/svg%3E") no-repeat center/32px;
}
.product-card .thumb:has(img) { background: var(--card); }
/* contain, not cover: the whole package stays visible instead of losing its top and bottom. */
.product-card .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.product-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-card .cat-badge { font-size: .72rem; color: var(--brand-dark); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.product-card .name { font-weight: 700; font-size: .98rem; overflow-wrap: anywhere; }
.product-card .brand { color: var(--ink-soft); font-size: .85rem; }
/* Numbers-First: the value is bolder than its label. */
.product-card .nutri-mini { display: flex; gap: 12px; font-size: .82rem; color: var(--ink-soft); margin-top: 4px; font-variant-numeric: tabular-nums; }
.product-card .nutri-mini strong { color: var(--ink); font-weight: 700; }
.product-card .actions { margin-top: auto; padding-top: 8px; display: flex; gap: 6px; }
.product-card .compare-toggle { flex: 1; }

.category-card, .brand-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: block;
}
/* Home shows exactly 8 of each: four columns on wide screens fill two complete rows. */
@media (min-width: 860px) {
  .card-grid.is-four, .product-grid.is-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 640px) and (max-width: 859px) {
  .card-grid.is-four, .product-grid.is-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.category-card:hover, .brand-card:hover { border-color: var(--brand); text-decoration: none; }
.category-card .name, .brand-card .name { font-weight: 700; margin-bottom: 4px; }
.category-card .count, .brand-card .count { color: var(--ink-soft); font-size: .85rem; }

/* ---------- Filter chips ---------- */
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: .83rem;
  color: var(--ink-soft);
  font-weight: 600;
}
.filter-chip:hover { border-color: var(--brand); color: var(--brand-dark); text-decoration: none; }
.filter-chip.active { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--on-ink); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.sort-select { padding: 8px 10px; min-height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); font: inherit; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 36px;
  text-align: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-size: .88rem;
}
.pagination a:hover { border-color: var(--brand); text-decoration: none; }
.pagination .current { background: var(--brand-dark); color: var(--on-ink); border-color: var(--brand-dark); font-weight: 700; }
.pagination .disabled { color: var(--ink-faint); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 48px 16px; color: var(--ink-soft); }
.empty-state h3 { color: var(--ink); }

/* ---------- Call-to-action band ---------- */
.cta-band {
  background: var(--brand-light);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}
.cta-band h2 { font-size: 1.3rem; }
.cta-band p { color: var(--ink-soft); max-width: 56ch; margin: 0 auto 18px; }

/* ---------- Product detail ---------- */
.product-detail { display: grid; grid-template-columns: 1fr; gap: 28px; padding: 28px 0; }
/* Wide screens: photo and the buy box share the left column; the facts own the right column.
   Phones keep DOM order, so buying comes after the nutrition panel. */
@media (min-width: 860px) {
  .product-detail {
    grid-template-columns: 380px 1fr;
    grid-template-areas: "gallery main" "buy main" ". main";
    grid-template-rows: auto auto 1fr;
    align-items: start;
    row-gap: 20px;
  }
  .product-gallery { grid-area: gallery; }
  .product-main { grid-area: main; }
  .buy-box { grid-area: buy; }
}
.product-gallery .thumb-large {
  aspect-ratio: 1 / 1;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
/* Phones: a shorter frame so the name and the numbers start within the first screen. */
@media (max-width: 859px) { .product-gallery .thumb-large { aspect-ratio: 4 / 3; } }
/* contain: tall packs stay whole, like the product cards. */
.product-gallery .thumb-large img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
/* The main photo is a button that opens the lightbox. */
.product-gallery button.thumb-large { display: block; width: 100%; padding: 0; font: inherit; cursor: zoom-in; }

/* Every photo of the product as small squares; arrows appear only when the row overflows. */
.gallery-strip { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.gallery-thumbs {
  list-style: none; margin: 0; padding: 2px; display: flex; gap: 8px; flex: 1; min-width: 0;
  overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none;
}
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumbs li { flex: 0 0 auto; }
.gallery-thumbs button {
  display: block; width: 64px; height: 64px; padding: 4px; background: var(--card);
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.gallery-thumbs button:hover { border-color: var(--ink-faint); }
.gallery-thumbs button[aria-current="true"] { border-color: var(--brand-dark); box-shadow: 0 0 0 1px var(--brand-dark); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.gallery-scroll {
  flex: 0 0 auto; width: 32px; height: 64px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 0 3px;
}
.gallery-scroll:hover:not(:disabled) { background: var(--surface-hover); }
.gallery-scroll:disabled { color: var(--ink-faint); cursor: default; }
.gallery-scroll[hidden] { display: none; }

/* Zoomable lightbox (product gallery, admin photos): the photo zooms (buttons, wheel, double-click) and pans by dragging once zoomed. */
dialog.zoom-lightbox .zoom-stage { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
dialog.zoom-lightbox img { max-height: 100%; transform-origin: center; user-select: none; cursor: zoom-in; }
dialog.zoom-lightbox.is-zoomed img { cursor: grab; }
dialog.zoom-lightbox.is-dragging img { cursor: grabbing; }
dialog.zoom-lightbox .zoom-controls { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
dialog.zoom-lightbox .zoom-controls button { position: static; width: var(--tap); height: var(--tap); font-size: 1.4rem; }
dialog.zoom-lightbox .zoom-controls .zoom-level { width: auto; min-width: 64px; padding: 0 10px; border-radius: 22px; font-size: .85rem; font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  dialog.zoom-lightbox:not(.is-dragging) img { transition: transform .15s ease; }
}

.buy-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.buy-box .block-title { margin-top: 0; }
.buy-lead { font-size: .9rem; color: var(--ink-soft); margin: 0 0 12px; }
/* One row per store listing: pack size, then the seller's title, so a carton isn't mistaken for one bottle. */
.offer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.offer {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 10px 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px; color: var(--ink);
}
.offer:hover { background: var(--surface-hover); text-decoration: none; }
.offer-pack {
  flex-shrink: 0; min-width: 5.6em; padding: 2px 8px; border-radius: 999px; text-align: center; white-space: nowrap;
  background: var(--surface-muted); color: var(--ink); font-size: .8rem; font-weight: 700;
}
.offer-pack.is-unknown { background: none; border: 1px dashed var(--border); color: var(--ink-soft); font-weight: 600; }
.offer-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.offer-title {
  font-size: .88rem; line-height: 1.3; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.offer-store { font-size: .82rem; font-weight: 600; color: var(--brand-dark); }
.offer-store:first-child { font-size: .95rem; }
.offer-out { color: var(--ink-soft); }
.offer-more summary { cursor: pointer; font-weight: 600; color: var(--brand-dark); display: inline-flex; align-items: center; min-height: var(--tap); }
.buy-box .affiliate-note { margin: 12px 0 0; }
.btn-icon { flex-shrink: 0; }
.breadcrumb { font-size: .82rem; color: var(--ink-soft); margin-bottom: 8px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0; padding: 0; list-style: none; }
.breadcrumb li { min-width: 0; overflow-wrap: anywhere; }
.breadcrumb li + li::before { content: "›"; margin: 0 6px; color: var(--ink-faint); }
.breadcrumb [aria-current] { color: var(--ink-soft); }
.product-main h1 { font-size: 1.6rem; }
.product-main .meta-line { color: var(--ink-soft); margin-bottom: 12px; }
.product-main .action-row { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }

.product-description { margin: 0 0 20px; max-width: 65ch; color: var(--ink-raised); line-height: 1.6; }

/* Allergens read as facts, not alarms: the pack's own sentence ("Mengandung kedelai, krustasea"), one
   line per status. The status is a word in a small tinted tag, so it never depends on colour alone. */
.allergen-block { margin: 0 0 18px; }
.allergen-block .block-title { margin: 0 0 8px; }
@media (min-width: 560px) {
  .allergen-block { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: baseline; }
  .allergen-block .block-title { margin: 0; }
}
.allergen-statement { display: grid; gap: 6px; }
/* Inline flow, not flex: the names run on right after the tag and wrap under it on phones. */
.allergen-line { margin: 0; line-height: 1.6; }
.allergen-kind {
  display: inline-block;
  margin-right: 8px;
  line-height: 1.4;
  vertical-align: 1px;
  white-space: nowrap;
  border-radius: var(--radius-xs, 4px);
  padding: 2px 7px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: var(--bad-bg);
  color: var(--bad-ink);
}
.allergen-line.may-contain .allergen-kind { background: var(--warn-bg); color: var(--warn-ink); box-shadow: inset 0 0 0 1px var(--warn-border); }
.allergen-names { min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.allergen-names strong { font-weight: 600; white-space: nowrap; }
.allergen-sep { padding: 0 4px; color: var(--ink-faint); }
.allergen-line.may-contain .allergen-names { color: var(--ink-raised); }

/* Single allergen tag on the ingredient page. */
.allergen-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
  font-size: .85rem;
  font-weight: 600;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--bad-border);
}

.ingredient-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ingredient-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: .85rem;
  color: inherit;
  text-decoration: none;
}
.ingredient-chip:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--surface-hover); text-decoration: none; }
.ingredient-chip.unsafe { border-color: var(--bad-border); color: var(--bad-ink); }
/* Ingredient page explainer: label over value on phones, a label column from 640px */
.ingredient-facts { margin: 16px 0 32px; padding: 4px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); max-width: 760px; }
.ingredient-facts > div { padding: 12px 0; }
.ingredient-facts > div + div { border-top: 1px solid var(--border); }
.ingredient-facts dt { color: var(--ink-soft); font-weight: 700; text-transform: uppercase; font-size: .72rem; letter-spacing: .03em; margin-bottom: 4px; }
.ingredient-facts dd { margin: 0; font-size: .95rem; line-height: 1.6; max-width: 65ch; }
@media (min-width: 640px) {
  .ingredient-facts { padding: 4px 20px; }
  .ingredient-facts > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 16px; padding: 14px 0; }
  .ingredient-facts dt { margin: 0; padding-top: .3em; }
}
.safe-flag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 9px; border-radius: 999px; font-size: .88rem; font-weight: 700; line-height: 1.4; }
.safe-flag svg { flex: none; }
.safe-flag.safe { background: var(--good-bg); color: var(--good-ink); border: 1px solid var(--good-border); }
.safe-flag.unsafe { background: var(--bad-bg); color: var(--bad-ink); border: 1px solid var(--bad-border); }.ingredients-text { margin: 0 0 10px; font-size: .92rem; line-height: 1.6; color: var(--ink-raised); overflow-wrap: anywhere; }

.block-title { font-size: 1rem; font-weight: 800; margin: 20px 0 10px; }
/* The "Nilai Gizi" heading is visually hidden (the panel titles itself); keep its anchor clear of the sticky header. */
#nilai-gizi { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ---------- Nutrition facts table ---------- */
.nutrition-panel {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 16px;
}
.nutrition-panel h3 { font-size: 1.15rem; margin-bottom: 2px; }
.nutrition-panel .serving-line { font-size: .85rem; color: var(--ink-soft); border-bottom: 8px solid var(--ink); padding-bottom: 8px; margin-bottom: 6px; }
/* label | amount | % AKG, like the printed label; the % column stays aligned even when a row has none. */
.nutrition-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  column-gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
}
.nutrition-row.sub { padding-left: 16px; font-size: .87rem; }
.nutrition-row .label { font-weight: 600; }
.nutrition-row.sub .label { font-weight: 500; color: var(--ink-soft); }
/* Numbers-First: the amount outranks its label, sub-rows included (gula is the number people look for). */
.nutrition-row .value { white-space: nowrap; font-weight: 700; text-align: right; }
.nutrition-row.sub .value { font-weight: 600; }
.nutrition-row .akg, .nutrition-head span { min-width: 3.6em; text-align: right; white-space: nowrap; }
.nutrition-row .akg { color: var(--ink-soft); font-size: .85rem; }
.nutrition-head { display: flex; justify-content: flex-end; padding: 2px 0 4px; border-bottom: 1px solid var(--border); font-size: .74rem; font-weight: 700; color: var(--ink-soft); }
.akg-bar-track { width: 88px; height: 6px; background: var(--surface-muted); border-radius: 999px; overflow: hidden; align-self: center; }
.akg-bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.nutrition-foot { font-size: .76rem; color: var(--ink-soft); margin-top: 10px; }

.related-section { padding: 28px 0 48px; }

/* ---------- Compare ---------- */
.notice {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-ink);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .9rem;
}
/* Neutral information (e.g. "compared per 100 ml") is not a warning. */
.notice.info { background: var(--brand-light); border-color: transparent; color: var(--brand-deep); }
.notice code, .empty-state code { font-size: .85em; background: var(--surface-muted); padding: 1px 5px; border-radius: 4px; }
.no-data { color: var(--ink-soft); font-style: italic; font-weight: 400; font-size: .85rem; }

/* Verdict strip: the answer to the shopping question, numbers first */
.verdicts { margin: 8px 0 24px; }
.verdicts h2 { font-size: 1.15rem; }
.verdict-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.verdict { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.verdict-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--ink-soft); margin: 0 0 4px;
}
.verdict-value { font-size: 1.6rem; font-weight: 800; line-height: 1.15; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.verdict-value.is-missing { font-size: 1rem; font-weight: 600; color: var(--ink-soft); }
/* "Tergantung ukuran kemasan" is an answer, not missing data: ink, not grey. */
.verdict-value.is-depends { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.nowrap { white-space: nowrap; }
.verdict-who { font-size: .85rem; color: var(--ink-soft); margin: 0; }
.verdict-headline { font-size: 1rem; margin: 0 0 12px; max-width: 70ch; }
.verdict-gap { font-size: .8rem; color: var(--ink-soft); margin: 4px 0 0; }
.verdict-pack { font-size: .8rem; color: var(--ink); margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.verdict-pack.is-equal { font-weight: 600; font-size: .85rem; }
.name-short { display: none; }
.show-all-toggle { display: none; }
.near-tag {
  display: inline-block; margin: 2px 0 0 4px; padding: 4px 8px; border-radius: 999px; line-height: 1.2;
  background: var(--surface-muted); color: var(--ink-soft);
  font-size: .75rem; font-weight: 600; vertical-align: 1px;
}
.verdict-note { font-size: .8rem; color: var(--ink-soft); font-style: italic; margin: 4px 0 0; }
.summary-more { list-style: disc; padding-left: 20px; margin-top: 14px; color: var(--ink-soft); font-size: .9rem; }
.summary-more li { margin-bottom: 4px; }

.compare-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin: 0 0 6px; }
.diff-toggle[aria-pressed="true"] { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--on-ink); }
.legend-help { font-size: .82rem; color: var(--ink-soft); margin: 0 0 12px; max-width: 70ch; }
.legend-help summary { cursor: pointer; font-weight: 600; color: var(--brand-dark); display: inline-flex; align-items: center; min-height: 32px; }
.legend-help p { margin: 4px 0 0; }
table.compare-table.only-diff tr[data-hide], table.compare-table.only-diff tbody[data-hide] { display: none; }
.diff-status { font-size: .82rem; color: var(--ink-soft); margin: 0 0 6px; }
.diff-status:empty { display: none; }
/* The legend shrinks before the toggle drops to its own row. */
.compare-legend { flex: 1 1 0; min-width: min(100%, 420px); display: flex; gap: 8px 18px; margin: 0; font-size: .82rem; color: var(--ink-soft); flex-wrap: wrap; align-items: center; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item.best, .legend-item.worst { padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.legend-item.best { background: var(--good-bg); color: var(--good-ink); }
.legend-item.worst { color: var(--bad-ink); padding-left: 0; padding-right: 0; }

/* overflow: clip rounds the corners without creating a scroll container, so the header can stay sticky. */
.compare-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: clip; background: var(--card); }
table.compare-table { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; }
table.compare-table th, table.compare-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
table.compare-table .corner { width: 230px; }
table.compare-table thead th, table.compare-table thead td {
  position: sticky;
  top: var(--header-h);
  z-index: 3;
  background: var(--surface-hover);
  font-size: .9rem;
  vertical-align: bottom;
}
table.compare-table th.row-label { font-weight: 700; }
table.compare-table tr.is-sub th.row-label { padding-left: 28px; font-weight: 500; color: var(--ink-soft); }
table.compare-table tr.group-row th {
  background: var(--surface-subtle);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--ink-soft);
  padding-top: 14px; padding-bottom: 6px;
}
table.compare-table tbody:last-child tr:last-child > * { border-bottom: 0; }
table.compare-table td.best { background: var(--good-bg); color: var(--good-ink); font-weight: 700; }
table.compare-table td.worst .mark { color: var(--bad); }

table.compare-table td.text-cell { font-size: .85rem; color: var(--ink-soft); }
table.compare-table .mark { display: inline-block; vertical-align: -2px; margin-left: 4px; }
.compare-product-head a { font-weight: 700; }

/* Product key chips (A–D): name each product once, then refer to it by letter */
.key {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 20px; height: 20px; border-radius: 999px;
  background: var(--ink); color: var(--on-ink);
  font-size: .72rem; font-weight: 700; font-style: normal; line-height: 1;
}
.compare-product-head .key { margin-right: 6px; vertical-align: 1px; }
.product-keys { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.product-keys li {
  display: flex; align-items: center; gap: 8px; max-width: 100%;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 4px 4px 8px; font-size: .88rem;
}
.product-keys li.add-product { background: none; border: 0; padding: 0; }
.product-keys img { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; background: var(--surface-muted); flex-shrink: 0; }
.product-key-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.remove-product {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 999px; color: var(--ink-soft);
}
.remove-product:hover { background: var(--bad-bg); color: var(--bad-ink); text-decoration: none; }

/* Closing block: where to go after comparing */
.compare-next { margin-top: 32px; }
.compare-next h2 { font-size: 1.15rem; }
.next-list { margin: 0 0 14px; }
.next-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.next-list .key { margin-top: 2px; }
.next-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.next-name { font-weight: 700; }
.next-wins { font-size: .85rem; color: var(--ink-soft); }
.next-links { display: flex; flex-wrap: wrap; gap: 4px 14px; flex-shrink: 0; }
.next-links a { font-weight: 600; display: inline-flex; align-items: center; min-height: 32px; }
.affiliate-tag {
  margin-left: 6px; padding: 0 6px; border-radius: 4px;
  background: var(--surface-muted); color: var(--ink-soft);
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.affiliate-note { font-size: .82rem; color: var(--ink-soft); margin: 0 0 14px; max-width: 70ch; }
.next-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.cell-product { display: none; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; }
.cell-name {
  color: var(--ink-soft); font-weight: 400; font-size: .82rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.label-line { display: block; font-size: .8rem; font-weight: 400; color: var(--ink-soft); }
td.best .label-line, td.best .per-unit { color: inherit; opacity: .85; }
.per-unit { font-size: .85rem; font-weight: 600; color: var(--ink-soft); margin-left: 2px; }
.no-data.is-warn { color: var(--warn-ink); font-style: normal; font-weight: 600; }

.page-body { padding-top: 28px; padding-bottom: 48px; }
.empty-state h2 { font-size: 1.2rem; color: var(--ink); }

/* ---------- 404 ---------- */
.not-found { display: grid; gap: 32px; align-items: start; }
.not-found h1 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin-bottom: 8px; }
.not-found-lead { color: var(--ink-soft); max-width: 60ch; margin: 0 0 20px; }
.not-found .search-box { max-width: 560px; }
.not-found-primary { margin: 16px 0 0; }
.not-found-subhead { font-size: 1rem; font-weight: 800; margin: 32px 0 6px; }
.not-found-links { list-style: none; margin: 0; padding: 0; max-width: 560px; }
.not-found-links li { border-bottom: 1px solid var(--border); }
.not-found-links a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--tap); font-weight: 600; color: var(--ink);
}
.not-found-links a svg { color: var(--ink-soft); flex-shrink: 0; transition: transform .2s cubic-bezier(.16, 1, .3, 1); }
.not-found-links a:hover { color: var(--brand-dark); text-decoration: none; }
.not-found-links a:hover svg { color: var(--brand-dark); transform: translateX(3px); }
.not-found-debug { margin-top: 24px; font-size: .82rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.not-found-label { max-width: 360px; }
.not-found-label h2 { font-size: 1.15rem; margin-bottom: 2px; }
.not-found-path { display: block; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; margin-top: 2px; }
.not-found-label .value { font-weight: 800; font-variant-numeric: tabular-nums; }
@media (min-width: 860px) {
  .not-found { grid-template-columns: minmax(0, 600px) 300px; gap: 80px; padding-top: 56px; }
}
@media (prefers-reduced-motion: reduce) { .not-found-links a svg { transition: none; } }
.tray-hint { color: var(--ink); font-weight: 600; }

/* ---------- Compare tray ---------- */
#compare-tray {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--ink);
  color: var(--on-ink);
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  z-index: 60;
  display: none;
}
#compare-tray.open { display: block; }
#compare-tray .tray-inner { max-width: var(--max-width); margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#compare-tray .tray-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
#compare-tray .tray-chip { background: var(--ink-raised); border-radius: 999px; padding: 2px 2px 2px 12px; font-size: .8rem; display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }
#compare-tray .tray-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
#compare-tray .tray-chip button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
  background: none; border: none; border-radius: 999px;
  color: var(--on-ink-soft); cursor: pointer;
}
#compare-tray .tray-chip button:hover { color: var(--on-ink); background: rgba(255, 255, 255, .12); }
#compare-tray .tray-status { flex-basis: 100%; order: 3; margin: 0; font-size: .82rem; color: var(--on-ink-soft); }
#compare-tray .tray-status:empty { display: none; }
#compare-tray :focus-visible { outline-color: var(--on-ink); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 5px; }
.field .hint { font-size: .78rem; color: var(--ink-soft); margin-top: 4px; }
.field input[type=text], .field input[type=number], .field input[type=email],
.field input[type=password], .field input[type=file], .field input[type=url], .field input[type=search],
.field select, .field textarea,
table.admin-table input[type=text], table.admin-table input[type=url], table.admin-table input[type=number] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
}
table.admin-table input[type=text], table.admin-table input[type=url], table.admin-table input[type=number] { padding: 6px 9px; font-size: .88rem; min-height: 34px; }
.field input:hover, .field select:hover, .field textarea:hover, table.admin-table input:hover { border-color: var(--ink-faint); }
/* Browser autofill: Embun Pandan instead of the browser's blue. Chrome ignores background here, so an
   inset shadow paints over it; the long transition keeps Chrome's own colour from flashing back. */
input:-webkit-autofill, select:-webkit-autofill, textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--brand-dark);
  box-shadow: inset 0 0 0 1000px var(--brand-light);
  transition: background-color 9999s step-end;
}
.field textarea { min-height: 90px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.unit-pair { display: flex; gap: 8px; }
.unit-pair select { max-width: 90px; }
.form-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.form-section h2, .form-section h3 { font-size: 1.05rem; margin-bottom: 14px; }
.field-row.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .field-row.is-three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .field-row.is-three { grid-template-columns: 1fr; } }
.field .hint, .form-section .hint { font-size: .82rem; color: var(--ink-soft); margin: 4px 0 0; }
.req { color: var(--bad); font-weight: 700; }
.chip-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-select label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .85rem;
  cursor: pointer;
  background: var(--card);
  font-weight: 500;
}
.chip-select input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip-select label { position: relative; }
.chip-select label:hover { border-color: var(--brand); }
.chip-select label:has(input:focus-visible) { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
.chip-select label.checked { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--on-ink); }

/* Ingredient pills (product form): the box looks like a text field, pills wrap before the entry. */
.tag-input:has(.tag-entry) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  cursor: text;
}
.tag-input:has(.tag-entry):hover { border-color: var(--ink-faint); }
.tag-input:has(.tag-entry:focus-visible) { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
.tag-list { display: contents; list-style: none; margin: 0; padding: 0; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 4px 3px 10px;
  border: 1px solid var(--good-border);
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--ink);
  font-size: .85rem;
  overflow-wrap: anywhere;
}
.tag.is-new { background: var(--warn-bg); border: 1px dashed var(--warn-border); }
.tag-badge, .tag-new-sample {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--warn-ink);
}
.tag-new-sample { padding: 0 6px; border: 1px dashed var(--warn-border); border-radius: 999px; background: var(--warn-bg); }
.tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.tag-remove:hover, .tag-remove:focus-visible { background: var(--bad); color: var(--on-ink); }
.field .tag-input .tag-entry {
  flex: 1 1 12rem;
  min-width: 8rem;
  width: auto;
  padding: 5px 6px;
  border: 0;
  outline: none;
  background: transparent;
}
.field .hint p { margin: 0 0 2px; }
.field [data-tag-fill] { margin-top: 8px; }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }
.alert.error { background: var(--bad-bg); color: var(--bad-ink); border: 1px solid var(--bad-border); }
.alert.success { background: var(--good-bg); color: var(--good-ink); border: 1px solid var(--good-border); }

/* ---------- Admin layout ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 232px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--ink);
  color: var(--on-ink-soft);
  padding: 16px 10px;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 18px; padding-left: 8px; }
.admin-sidebar .brand { min-width: 0; color: var(--on-ink); font-weight: 800; white-space: nowrap; }
.admin-sidebar .brand:hover { text-decoration: none; }
.admin-sidebar .brand-tag { font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--on-ink-soft); border: 1px solid var(--ink-raised); border-radius: 999px; padding: 1px 7px; }
.sidebar-toggle { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--on-ink-soft); cursor: pointer; }
.sidebar-toggle:hover { background: var(--ink-raised); color: var(--on-ink); }
.admin-sidebar nav { flex: 1; }
.admin-sidebar .nav-item { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; margin-bottom: 2px; border: 0; border-radius: 6px; background: none; color: var(--on-ink-soft); font-weight: 600; font-size: .9rem; text-align: left; white-space: nowrap; cursor: pointer; }
.admin-sidebar .nav-item:hover, .admin-sidebar .nav-item.active { background: var(--ink-raised); color: var(--on-ink); text-decoration: none; }
.nav-icon { flex-shrink: 0; }
.admin-sidebar .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-group.has-active > .nav-item { color: var(--on-ink); }
.nav-caret { flex-shrink: 0; opacity: .7; }
.nav-group.is-open > .nav-item .nav-caret { transform: rotate(90deg); }
.nav-children { display: none; margin: 0 0 6px 19px; padding-left: 10px; border-left: 1px solid var(--ink-raised); }
.nav-group.is-open > .nav-children { display: block; }
.nav-children a { display: block; padding: 6px 10px; margin-bottom: 1px; border-radius: 6px; color: var(--on-ink-soft); font-weight: 600; font-size: .86rem; white-space: nowrap; }
.nav-children a:hover, .nav-children a.active { background: var(--ink-raised); color: var(--on-ink); text-decoration: none; }
.nav-flyout-title { display: none; }
.sidebar-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ink-raised); }
.sidebar-foot form { margin: 0; }
.admin-sidebar .admin-who { margin: 0 10px 6px; font-size: .82rem; color: var(--on-ink-soft); }
.admin-sidebar :focus-visible { outline-color: var(--on-ink); }
.admin-main { flex: 1; padding: 24px 28px; min-width: 0; }
@media (prefers-reduced-motion: no-preference) {
  .admin-sidebar { transition: width .18s ease; }
  .nav-caret, .sidebar-toggle svg { transition: transform .18s ease; }
}

/* Hidden sidebar: an icon rail. Labels stay for screen readers; plain links show a tooltip and
   groups open a flyout on hover or keyboard focus. The rail does not scroll, so flyouts are not clipped. */
@media (min-width: 721px) {
  .is-collapsed .admin-sidebar { width: 64px; overflow: visible; z-index: 20; }
  .is-collapsed .sidebar-head { flex-direction: column; gap: 10px; padding-left: 0; }
  .is-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
  .is-collapsed .admin-sidebar .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .is-collapsed .nav-caret, .is-collapsed .admin-sidebar .admin-who { display: none; }
  .is-collapsed .admin-sidebar .nav-item { justify-content: center; padding: 9px 0; }
  .is-collapsed .admin-sidebar .nav-badge { position: absolute; top: 1px; right: 4px; min-width: 16px; margin: 0; padding: 0 4px; font-size: .66rem; line-height: 16px; }
  .is-collapsed .nav-item[data-tip]:hover::after, .is-collapsed .nav-item[data-tip]:focus-visible::after {
    content: attr(data-tip);
    position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); z-index: 40;
    padding: 5px 9px; border-radius: 6px; background: var(--ink); color: var(--on-ink);
    font-size: .8rem; white-space: nowrap; pointer-events: none;
    box-shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 4px 12px rgba(16, 40, 30, .05);
  }
  .is-collapsed .nav-group { position: relative; }
  .is-collapsed .nav-group.has-active > .nav-item { background: var(--ink-raised); }
  .is-collapsed .nav-children, .is-collapsed .nav-group.is-open > .nav-children { display: none; }
  .is-collapsed .nav-group:hover > .nav-children, .is-collapsed .nav-group:focus-within > .nav-children {
    display: block; position: absolute; left: calc(100% + 10px); top: 0; z-index: 40;
    min-width: 180px; margin: 0; padding: 6px; border: 1px solid var(--ink-raised); border-radius: 8px; background: var(--ink);
    box-shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 4px 12px rgba(16, 40, 30, .05);
  }
  /* Bridges the gap between icon and flyout so the pointer can cross it. */
  .is-collapsed .nav-children::before { content: ""; position: absolute; top: 0; bottom: 0; left: -11px; width: 11px; }
  .is-collapsed .nav-flyout-title { display: block; padding: 4px 10px 6px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--on-ink-soft); }
}

@media (max-width: 720px) {
  .admin-main { padding: 20px 16px; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { position: static; width: 100%; height: auto; overflow: visible; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; }
  .sidebar-head { margin: 0; padding: 0; }
  .sidebar-toggle { display: none; }
  .admin-sidebar nav, .sidebar-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
  .admin-sidebar .nav-item { width: auto; margin: 0; }
  .sidebar-foot { margin: 0; padding: 0; border: 0; }
  .admin-sidebar .admin-who { margin: 0 6px 0 0; }
  .nav-group { position: relative; }
  .nav-group.is-open > .nav-children { position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; min-width: 180px; margin: 0; padding: 6px; border: 1px solid var(--ink-raised); border-radius: 8px; background: var(--ink); }
}
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.admin-topbar h1 { font-size: 1.35rem; margin: 0; }
.admin-topbar .quick-actions { margin: 0; }

/* Laporan */
.period-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.report-section { margin-bottom: 32px; }
.report-section h2 { font-size: 1.15rem; margin-bottom: 12px; }
.report-section h3 { font-size: .95rem; margin: 0 0 8px; }
.report-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; align-items: start; }
.admin-card.is-table.is-compact table.admin-table { min-width: 0; }
table.admin-table .num-col { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Laporan page: a section index, ruled sections, and figures that sit together on the right. */
.report-toc { margin: -8px 0 24px; }
.report-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.report-toc a { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--ink-soft); font-size: .82rem; font-weight: 600; text-decoration: none; }
.report-toc a:hover { border-color: var(--brand); color: var(--brand-dark); }
@media (pointer: coarse) { .report-toc a { min-height: 44px; } }
.laporan .report-section { margin: 0; padding: 28px 0 32px; border-top: 1px solid var(--border); scroll-margin-top: 16px; }
.laporan .report-section h2 { margin-bottom: 16px; }
.laporan .report-section .stat-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 240px)); margin-bottom: 20px; }
.laporan .stat-card .num { font-variant-numeric: tabular-nums; line-height: 1.2; }
.laporan .report-section > .admin-note + .report-columns,
.laporan .report-section > .admin-card + .admin-card,
.laporan .report-section > .admin-card + .report-columns { margin-top: 24px; }
.laporan table.admin-table th.num-col, .laporan table.admin-table .fit-col { width: 1%; padding-left: 28px; }
.laporan .admin-card.is-narrow { max-width: 760px; }
@media (max-width: 640px) { .laporan table.admin-table th.num-col, .laporan table.admin-table .fit-col { padding-left: 12px; } .laporan .report-section { padding: 20px 0 24px; } }
.laporan .stat-card .no-data { font-size: inherit; font-style: normal; font-weight: inherit; }
.admin-note { color: var(--ink-soft); font-size: .82rem; margin: 8px 0 0; max-width: 70ch; }
.admin-subtitle { margin: 2px 0 0; color: var(--ink-soft); font-size: .88rem; }
.back-link { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; margin-left: -4px; font-size: .88rem; font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-card .num { font-size: 1.7rem; font-weight: 800; }
.stat-card .label { color: var(--ink-soft); font-size: .85rem; }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }

.admin-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
/* A table card: rows run edge to edge, and a narrow screen scrolls the table instead of the page. */
.admin-card.is-table { padding: 4px 0; overflow-x: auto; }
.admin-card.is-table table.admin-table { min-width: 720px; }
.admin-card.is-table th:first-child, .admin-card.is-table td:first-child { padding-left: 20px; }
.admin-card.is-table th:last-child, .admin-card.is-table td:last-child { padding-right: 20px; }
.admin-card.is-table tbody tr:last-child td { border-bottom: 0; }
.admin-card.is-table tbody tr:hover { background: var(--surface-subtle); }
table.admin-table .col-thumb { width: 66px; }
table.admin-table .col-actions { width: 1%; white-space: nowrap; }
table.admin-table .row-title { color: var(--ink); font-weight: 600; }
table.admin-table .row-title:hover { color: var(--brand-dark); }
table.admin-table .table-empty { text-align: center; color: var(--ink-soft); padding: 32px 16px; }
.todo-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; border: 1px dashed var(--warn-border); background: var(--warn-bg); color: var(--warn-ink); font-size: .76rem; font-weight: 700; white-space: nowrap; }
table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th, table.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: .9rem; vertical-align: middle; }
table.admin-table th { color: var(--ink-soft); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
/* Actions stay a table cell (a flex td drops out of the row's borders and alignment); font-size 0 swallows the whitespace between buttons. */
table.admin-table td.row-actions { white-space: nowrap; font-size: 0; }
table.admin-table td.row-actions > * { display: inline-flex; vertical-align: middle; }
table.admin-table td.row-actions > * + * { margin-left: 6px; }
.thumb-sm { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; background: var(--surface-muted); }
/* A thumbnail with a photo opens it in the zoom lightbox. */
.thumb-button { display: inline-flex; padding: 0; border: 0; border-radius: 6px; background: none; cursor: zoom-in; vertical-align: middle; }
.thumb-button:hover .thumb-sm { box-shadow: 0 0 0 2px var(--brand-dark); }
/* No photo yet: the same dashed "to do" look as .todo-tag, so it stands out when scanning without reading as an error. */
.thumb-missing { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; background: var(--warn-bg); color: var(--warn-ink); border: 1px dashed var(--warn-border); }

.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.status-pill.published { background: var(--good-bg); color: var(--good-ink); }
.status-pill.draft { background: var(--surface-muted); color: var(--ink-soft); }

.admin-search { display: flex; gap: 8px; margin-bottom: 16px; max-width: 520px; flex-wrap: wrap; align-items: center; }
.admin-search.is-wide { max-width: none; }
.admin-search input[type=text], .admin-search input[type=search], .admin-search select {
  min-height: 40px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px;
  font: inherit; font-size: .95rem; color: var(--ink); background: var(--card);
}
.admin-search input[type=text], .admin-search input[type=search] { flex: 1 1 260px; min-width: 0; max-width: 420px; }
.admin-search select { width: auto; flex: 0 1 auto; max-width: 100%; }
.admin-search .reset-link { font-size: .88rem; font-weight: 600; display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; }
/* Product list: search on the first line, the labelled select filters in an even grid below it. */
.admin-search .filter-grid { flex: 1 1 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px 10px; margin-top: 4px; }
.admin-search .filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.admin-search .filter-field label { color: var(--ink-soft); font-size: .78rem; font-weight: 600; }
.admin-search .filter-field select { flex: none; width: 100%; text-overflow: ellipsis; }
@media (max-width: 560px) {
  .admin-search input[type=text], .admin-search input[type=search] { flex-basis: 100%; max-width: none; }
  .admin-search select { flex: 1 1 140px; }
}
.admin-toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
/* Admin product photos: a row you drag to reorder (leftmost = main photo), click to enlarge. */
.image-grid { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; padding: 0; list-style: none; }
.image-grid:empty { display: none; }
.image-grid .img-item { position: relative; width: 96px; text-align: center; font-size: .72rem; color: var(--ink-soft); touch-action: none; user-select: none; -webkit-user-select: none; }
.image-grid .img-open { display: block; padding: 0; border: 0; background: none; border-radius: 8px; cursor: grab; }
.image-grid .img-item img { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--card); }
.image-grid .img-item.primary img { border: 2px solid var(--brand); }
.image-grid .img-label { display: block; min-height: 1.4em; margin-top: 2px; font-weight: 700; color: var(--brand-dark); }
.image-grid .img-delete {
  position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; padding: 0; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card); color: var(--ink-soft); font-size: 1.1rem; line-height: 1;
  cursor: pointer; box-shadow: var(--shadow);
}
/* The 28 px circle gets a full touch target without growing visually. */
.image-grid .img-delete::after { content: ""; position: absolute; inset: -8px; }
.image-grid .img-delete:hover, .image-grid .img-delete:focus-visible { color: var(--on-ink); background: var(--bad); border-color: var(--bad); }
.image-grid .img-item.dragging { z-index: 2; opacity: .85; }
.image-grid .img-item.dragging img { box-shadow: 0 8px 20px rgba(16, 40, 30, .25); transform: scale(1.05); }
.image-grid .img-item.dragging .img-open { cursor: grabbing; }
.image-grid .img-item.busy { opacity: .5; pointer-events: none; }
.image-grid .img-item.busy .img-label { color: var(--ink-soft); font-weight: 400; }
.image-status:empty { display: none; }
.image-status.is-error { color: var(--bad); font-weight: 600; }

/* 100% rather than 100vw: vw counts the page scrollbar, which pushed the right-hand buttons off screen. */
dialog.lightbox { border: none; padding: 0; margin: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; overflow: hidden; }
dialog.lightbox::backdrop { background: rgba(10, 16, 13, .88); }
dialog.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 56px 64px 16px; }
dialog.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; border-radius: 6px; background: #fff; }
dialog.lightbox figcaption { color: #e8eee9; font-size: .88rem; text-align: center; }
dialog.lightbox figcaption a { color: #fff; font-weight: 600; margin-left: 8px; }
dialog.lightbox button { position: absolute; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; line-height: 1; }
dialog.lightbox button:hover, dialog.lightbox button:focus-visible { background: rgba(255, 255, 255, .28); }
dialog.lightbox :focus-visible { outline-color: #fff; }
dialog.lightbox .lightbox-close { top: 12px; right: 12px; width: var(--tap); height: var(--tap); font-size: 1.6rem; }
dialog.lightbox .lightbox-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 2.2rem; padding-bottom: 4px; }
dialog.lightbox .lightbox-nav.prev { left: 10px; }
dialog.lightbox .lightbox-nav.next { right: 10px; }
dialog.lightbox .lightbox-nav[hidden] { display: none; }
@media (max-width: 560px) {
  dialog.lightbox figure { padding: 56px 8px 72px; }
  dialog.lightbox img { max-height: calc(100vh - 150px); }
  dialog.lightbox .lightbox-nav { top: auto; bottom: 12px; transform: none; }
  dialog.lightbox .lightbox-nav.prev { left: calc(50% - 60px); }
  dialog.lightbox .lightbox-nav.next { right: calc(50% - 60px); }
}
@media (prefers-reduced-motion: no-preference) {
  .image-grid .img-item img { transition: transform .12s ease, box-shadow .12s ease; }
}

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--brand-light); padding: 20px; }
.login-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; width: 100%; max-width: 380px; }
.login-card h1 { text-align: center; font-size: 1.3rem; }

/* ---------- Admin picker modal (Shopee Affiliate) ---------- */
.input-qty { max-width: 6.5em; }
.affiliate-actions { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
dialog.picker-modal { border: none; border-radius: var(--radius); padding: 20px 22px; max-width: 720px; width: calc(100vw - 32px); max-height: calc(100vh - 48px); box-shadow: var(--shadow); }
dialog.picker-modal::backdrop { background: rgba(15, 25, 20, .45); }
.picker-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.picker-head h4 { margin: 0; }
dialog.picker-modal .admin-search { max-width: none; margin-bottom: 8px; }
dialog.picker-modal .admin-search input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--card); }
.picker-list { list-style: none; margin: 0; padding: 0; }
.picker-list li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.picker-list .picker-info { flex: 1; min-width: 0; }
.picker-list .picker-name { font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.picker-list .picker-meta { font-size: .78rem; color: var(--ink-soft); margin-top: 2px; overflow-wrap: anywhere; }
.picker-list .picker-match { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; background: var(--good-bg); color: var(--good-ink); margin-left: 6px; }
dialog.picker-modal .pagination { margin-top: 14px; }
dialog.picker-modal .pagination button { min-width: 36px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--ink); font-size: .88rem; cursor: pointer; }
dialog.picker-modal .pagination button:hover { border-color: var(--brand); }
dialog.picker-modal .pagination button[disabled] { color: var(--ink-faint); cursor: default; }
dialog.picker-modal .pagination .current { background: var(--brand-dark); color: var(--on-ink); border-color: var(--brand-dark); font-weight: 700; }

/* ---------- Static pages ---------- */
.prose { max-width: 720px; }
.prose h1 { margin-bottom: 18px; }

/* Long-form documents (Tentang, Kontak, Privasi, Syarat). Reading comfort first:
   ~68ch measure, looser leading, real list markers, underlined links in running text. */
.doc { max-width: 760px; }
.doc-head { margin-bottom: 28px; }
.doc-head h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); letter-spacing: -.01em; margin-bottom: 10px; }
.doc-meta { font-size: .88rem; color: var(--ink-soft); margin: 0 0 16px; }
.doc-lead { font-size: 1.125rem; line-height: 1.6; color: var(--ink-raised); max-width: 64ch; margin: 0; }

.doc-body { font-size: 1.0625rem; line-height: 1.7; max-width: 68ch; }
.doc-body h2 {
  font-size: 1.3rem; letter-spacing: -.005em;
  margin: 36px 0 10px; padding-top: 24px; border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.doc-body > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.doc-body h3 { font-size: 1.05rem; margin: 26px 0 4px; }
.doc-body h2 + h3 { margin-top: 14px; }
.doc-body p { margin-bottom: .9em; }
.doc-body ul { list-style: disc; padding-left: 1.3em; margin: 0 0 1em; }
.doc-body li { margin-bottom: .5em; padding-left: .2em; }
.doc-body li::marker { color: var(--brand); }
.doc-body a { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--brand-dark) 45%, transparent); }
.doc-body a:hover { text-decoration-color: currentColor; }
.doc-body strong { font-weight: 700; color: var(--ink); }
.doc-body code { font-size: .86em; background: var(--surface-muted); border-radius: 4px; padding: 1px 6px; overflow-wrap: anywhere; }
.h-num { font-variant-numeric: tabular-nums; color: var(--brand-dark); margin-right: .4em; }

/* A quiet aside inside the running text, e.g. the "bukan nasihat medis" note. */
.doc-note { background: var(--surface-muted); border-radius: var(--radius); padding: 18px 20px; margin: 40px 0 0; }
.doc-note h2 { margin-top: 0; padding-top: 0; border-top: 0; font-size: 1.1rem; }
.doc-note p:last-child { margin-bottom: 0; }

/* Table of contents: a compact box above the text on phones, a sticky rail beside it on wide screens. */
.doc-toc { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 14px 16px; margin-bottom: 32px; font-size: .92rem; }
.doc-toc h2 { font-size: .8rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 6px; }
.doc-toc ol { list-style: none; margin: 0; padding: 0; }
.doc-toc a { display: flex; align-items: center; min-height: 34px; color: var(--ink-soft); font-weight: 600; line-height: 1.3; }
.doc-toc a:hover { color: var(--brand-dark); text-decoration: none; }
@media (pointer: coarse) { .doc-toc a { min-height: var(--tap); } }
@media (min-width: 1024px) {
  .doc.has-toc { max-width: 1040px; display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 56px; }
  .doc.has-toc > .breadcrumb, .doc.has-toc > .doc-head { grid-column: 2; }
  .doc.has-toc > .doc-toc {
    grid-column: 1; grid-row: 3; align-self: start;
    position: sticky; top: calc(var(--header-h) + 24px);
    border: 0; background: none; padding: 0; margin: 0;
  }
  .doc.has-toc > .doc-toc a { min-height: 30px; padding: 3px 0 3px 12px; border-left: 1px solid var(--border); font-size: .88rem; }
  .doc.has-toc > .doc-toc a:hover { border-left-color: var(--brand); }
  .doc.has-toc > .doc-body { grid-column: 2; grid-row: 3; }
}
@media (max-width: 639px) {
  .doc-body h2 { scroll-margin-top: 120px; margin-top: 32px; padding-top: 24px; }
  .doc-lead { font-size: 1.06rem; }
}

/* Contact: the email address is the whole call to action, so it gets its own block. */
.contact-box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 20px; margin-bottom: 40px; max-width: 68ch; }
.contact-box .contact-email { display: inline-block; font-size: clamp(1.25rem, 4.5vw, 1.6rem); font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; margin-bottom: 4px; }
.contact-box p { color: var(--ink-soft); margin: 0 0 16px; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.contact-actions .btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.contact-actions [data-copy-status] { font-size: .85rem; color: var(--good-ink); }
@media (max-width: 639px) { .contact-actions .btn { flex: 1; justify-content: center; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; margin-top: 40px; color: var(--ink-soft); font-size: .85rem; }
.site-footer .foot-links { display: flex; gap: 4px 16px; flex-wrap: wrap; margin-top: 10px; }
.site-footer .foot-links a { display: inline-flex; align-items: center; min-height: 32px; }
/* Keeps the last footer row clear of the fixed compare tray. */
body:has(#compare-tray.open) .site-footer { padding-bottom: 160px; }

.nutrition-group { border-top: 1px solid var(--border); }
.nutrition-group summary { cursor: pointer; font-weight: 600; font-size: .95rem; display: flex; align-items: center; gap: 10px; min-height: 44px; list-style: none; }
.nutrition-group summary::-webkit-details-marker { display: none; }
/* Drawn chevron in place of the browser's triangle; turns when the group opens. */
.nutrition-group summary::before {
  content: ""; width: 7px; height: 7px; flex-shrink: 0; margin: 0 3px 0 2px;
  border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft);
  transform: rotate(-45deg); transition: transform .15s ease-out;
}
.nutrition-group[open] summary::before { transform: rotate(45deg); }
.nutrition-group summary:hover .group-name { color: var(--brand-dark); }
.nutrition-group .group-count { margin-left: auto; font-size: .78rem; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.nutrition-group .group-count.has-values { color: var(--good-ink); }
.nutrient-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 16px; padding: 4px 0 18px; }
.nutrient-grid .field { margin: 0; }
.nutrient-grid .field label { font-weight: 500; font-size: .85rem; }
/* Unit inside the field, so labels stay short and the unit sits next to the number it qualifies. */
.input-unit { position: relative; }
.field .input-unit input { padding-right: 52px; font-variant-numeric: tabular-nums; }
.input-unit .unit { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-size: .8rem; color: var(--ink-soft); pointer-events: none; white-space: nowrap; }

/* ---------- Admin product form ---------- */
.admin-form-page { max-width: 1040px; }
.form-legend { margin: -12px 0 16px; font-size: .85rem; color: var(--ink-soft); }
.form-section.is-pending { background: var(--surface-subtle); border-style: dashed; }
.form-section.is-separate { margin-top: 32px; }
.upload-field { margin: 4px 0 0; }
.affiliate-add { margin-top: 16px; grid-template-columns: minmax(110px, 1fr) minmax(0, 2fr) minmax(0, 2fr) 92px auto; align-items: end; }
.affiliate-add .field { margin: 0; }
@media (max-width: 1100px) { .affiliate-add { grid-template-columns: 1fr 1fr; } .affiliate-add .affiliate-actions { grid-column: 1 / -1; } }
@media (max-width: 560px) { .affiliate-add { grid-template-columns: 1fr; } }
.shopee-crawl-form { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: end; margin-top: 12px; }
.shopee-crawl-form .field { margin: 0; }
@media (max-width: 560px) { .shopee-crawl-form { grid-template-columns: 1fr; } }
[data-crawl-status].is-error { color: var(--bad); font-weight: 600; }
[data-crawl-fallback] { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
[data-crawl-fallback][hidden] { display: none; }
/* Save stays in reach while scrolling the long form; it leaves with the form, before the separate
   affiliate forms. It floats over the fields, so it takes the floating shadow. */
.form-actions {
  position: sticky; bottom: 12px; z-index: 5;
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
@media (max-width: 560px) { .form-actions .btn { flex: 1; } }

.autocomplete { position: relative; }
/* Admin brand picker (opens via the [hidden] attribute, not .open) */
.autocomplete .autocomplete-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 260px; overflow-y: auto; list-style: none; margin: 0; padding: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
}
.autocomplete .autocomplete-list[hidden] { display: none; }
.autocomplete .autocomplete-list li { padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: .93rem; }
.autocomplete .autocomplete-list li:hover, .autocomplete .autocomplete-list li.active { background: var(--brand-light); }
.autocomplete .autocomplete-list li.empty { color: var(--ink-soft); cursor: default; background: none; }

/* ---------- Small screens ---------- */
@media (max-width: 639px) {
  .hero { padding: 32px 0 24px; }
  /* Two columns of cards on a phone instead of one screen-tall card per product */
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-card .body { padding: 10px 10px 12px; }
  .product-card .name { font-size: .92rem; }
  .product-card .nutri-mini { flex-wrap: wrap; gap: 2px 10px; }
  .category-card, .brand-card { padding: 14px 12px; }
  .section { padding: 24px 0; }
  .section-head h2 { font-size: 1.15rem; }
  #compare-tray .tray-chips { flex-wrap: nowrap; overflow-x: auto; flex-basis: 100%; scrollbar-width: none; }
  #compare-tray .tray-chip { flex-shrink: 0; }
  #compare-tray .tray-chip-name { max-width: 16ch; }
  #compare-tray .tray-inner .btn { flex: 1; }

  /* Compare: one card per nutrient, each line keyed by product name, instead of a
     sideways-scrolling table that loses which column is which. */
  .verdict-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .verdict { padding: 12px; }
  .verdict-value { font-size: 1.35rem; }
  .compare-table-wrap { border: 0; background: none; overflow: visible; }
  table.compare-table, table.compare-table tbody, table.compare-table tr,
  table.compare-table th, table.compare-table td { display: block; width: auto; }
  /* The product list above the table names each product (with links), so the header row is dropped
     entirely rather than clipped, which would leave its links in the tab order. */
  table.compare-table thead { display: none; }
  .cell-name { -webkit-line-clamp: 1; }
  table.compare-table tr {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 12px; margin-bottom: 8px;
  }
  table.compare-table tr.group-row { background: none; border: 0; padding: 0; margin: 18px 0 8px; }
  table.compare-table tr.group-row th { background: none; padding: 0; }
  table.compare-table th.row-label { padding: 0 0 4px; border: 0; }
  /* Sub-nutrients (gula under karbohidrat) keep a visible step in, so the hierarchy survives the card layout. */
  table.compare-table tr.is-sub { margin-left: 14px; }
  table.compare-table tr.is-sub th.row-label { padding-left: 0; }
  table.compare-table.is-collapsed .is-extra { display: none; }
  /* Collapsed, a sub-row (gula) has no visible parent row, so it drops the step in. */
  table.compare-table.is-collapsed tr.is-sub { margin-left: 0; }
  table.compare-table.is-collapsed tr.is-sub th.row-label { font-weight: 700; color: var(--ink); }
  .diff-toggle[data-needs-expanded]:not(.is-expanded) { display: none; }
  .name-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .name-short { display: inline; }
  .show-all-toggle { display: flex; width: 100%; margin-top: 4px; }
  table.compare-table td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 6px 0; border-bottom: 0; border-top: 1px solid var(--border);
  }
  table.compare-table td .cell-product { display: flex; }
  table.compare-table td .cell-value { flex-shrink: 0; max-width: 55%; text-align: right; }
  table.compare-table td.best { padding: 6px 8px; margin: 0 -8px; border-radius: 6px; border-top-color: transparent; }
  .next-list li { flex-wrap: wrap; }
  .next-links { flex-basis: 100%; padding-left: 30px; }
  table.compare-table td.text-cell { display: block; }
  table.compare-table td.text-cell .cell-product { margin-bottom: 2px; }
  table.compare-table td.text-cell .cell-value { max-width: none; text-align: left; display: block; }
  .product-keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .product-keys li { padding: 2px 2px 2px 6px; gap: 6px; font-size: .8rem; }
  .product-keys img { display: none; }
  .product-key-name {
    flex: 1; white-space: normal; max-width: none;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  .product-keys li.add-product .btn { width: 100%; }
  .compare-toolbar .diff-toggle { width: 100%; }
}

/* ---------- Touch input: 44px targets ---------- */
@media (pointer: coarse) {
  .btn, .btn.small, .sort-select { min-height: var(--tap); }
  .main-nav a, .suggestion-chips a, .filter-chip, .ingredient-chip,
  .pagination a, .pagination span, .site-footer .foot-links a, .section-head a.see-all {
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
  }
  .pagination a, .pagination span { min-width: var(--tap); justify-content: center; }
  #compare-tray .tray-chip button { width: var(--tap); height: var(--tap); margin: -6px -2px -6px 0; }
  .remove-product { width: var(--tap); height: var(--tap); }
  .next-links a, .legend-help summary { min-height: var(--tap); }
  .saved-pick { min-height: var(--tap); }
  .saved-remove { min-width: var(--tap); }
  .autocomplete-list li a { padding-block: 12px; }
}
/* Pilihan: one shopping question answered by a label-value ranking */
.pilihan-method { color: var(--ink-soft); max-width: 65ch; }
.pilihan-intro { max-width: 65ch; }
.pilihan-meta { color: var(--ink-soft); font-size: .9rem; max-width: 70ch; margin-bottom: 8px; }
.pilihan-updated { white-space: nowrap; }
.pilihan-cta { margin: 16px 0 20px; }
.pilihan-section-title { font-size: 1.2rem; margin: 24px 0 12px; }
.pilihan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pilihan-item {
  display: grid;
  grid-template-columns: 40px 56px minmax(0, 1fr);
  grid-template-areas: "rank thumb body" "actions actions actions";
  gap: 8px 12px;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.pilihan-rank { grid-area: rank; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pilihan-rank-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink); color: var(--on-ink); font-weight: 800; font-variant-numeric: tabular-nums;
}
.pilihan-tie { font-size: .72rem; font-weight: 700; color: var(--ink-soft); background: var(--surface-muted); border-radius: 999px; padding: 0 7px; }
.pilihan-thumb { grid-area: thumb; display: block; width: 56px; height: 56px; border-radius: 6px; background: var(--surface-muted); overflow: hidden; }
.pilihan-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pilihan-body { grid-area: body; min-width: 0; }
.pilihan-name { display: block; color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.pilihan-sub { display: block; color: var(--ink-soft); font-size: .85rem; margin-bottom: 4px; }
.pilihan-value { margin: 0; font-size: 1.15rem; }
.pilihan-value strong { font-weight: 800; font-variant-numeric: tabular-nums; }
.pilihan-value .per { color: var(--ink-soft); font-size: .9rem; }
.pilihan-label { margin: 0; color: var(--ink-soft); font-size: .85rem; overflow-wrap: anywhere; }
.pilihan-actions { grid-area: actions; }
.pilihan-actions .btn { width: 100%; }
.pilihan-foot { color: var(--ink-soft); font-size: .85rem; margin-top: 8px; }
.pilihan-unranked h3 { font-size: 1rem; margin: 16px 0 6px; }
.pilihan-unranked-list { display: flex; flex-direction: column; gap: 4px; padding-left: 0; }
.pilihan-unranked-list a { overflow-wrap: anywhere; }
.pilihan-disclaimer { margin-top: 32px; color: var(--ink-soft); font-size: .8rem; max-width: 70ch; }
.pilihan-group { margin-top: 24px; }
.pilihan-group h2 { font-size: 1.2rem; }
.pilihan-link-list { display: grid; gap: 8px; }
.pilihan-link-list li { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.pilihan-link-list a { font-weight: 700; display: block; overflow-wrap: anywhere; }
.pilihan-link-list span { color: var(--ink-soft); font-size: .85rem; }
.pilihan-badges { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; }
.pilihan-badges a { display: inline-block; background: var(--brand-light); color: var(--brand-deep); border-radius: 8px; padding: 6px 10px; font-size: .88rem; font-weight: 600; overflow-wrap: anywhere; }
@media (min-width: 640px) {
  .pilihan-item { grid-template-columns: 44px 72px minmax(0, 1fr) auto; grid-template-areas: "rank thumb body actions"; align-items: center; }
  .pilihan-thumb { width: 72px; height: 72px; }
  .pilihan-actions .btn { width: auto; }
}
.pilihan-link-list.is-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
fieldset.field { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
fieldset.field legend { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 8px; padding: 0; }
.pilihan-preview h3 { font-size: .95rem; margin: 16px 0 8px; }
.preview-top { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: .9rem; }

/* ---------------- R2: Laporkan data salah ---------------- */
.flash-region:empty { display: none; }
.flash-notice { margin: 16px 0 0; }
.report-link { margin: 8px 0 20px; font-size: .88rem; }
.no-data-note { color: var(--ink-soft); font-size: .9rem; }
.report-page { max-width: 640px; }
.report-lead { color: var(--ink-soft); }
.report-errors .alert ul { list-style: disc; padding-left: 20px; margin: 0; }
.report-errors .alert p { margin-bottom: 6px; }
.report-form .req, .report-form .opt { font-weight: 400; color: var(--ink-soft); }
.field-error { color: var(--bad-ink); font-size: .84rem; font-weight: 600; margin: 4px 0 0; }
.field-error::before { content: "! "; }
.report-note { font-size: .85rem; color: var(--ink-soft); }
/* Honeypot: off screen for people, still in the form for bots. */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.nav-badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--on-ink); color: var(--ink); font-size: .74rem; font-weight: 800; text-align: center; line-height: 20px; }
.stat-card.is-link { color: inherit; }
.stat-card.is-link:hover { border-color: var(--brand); text-decoration: none; }
.muted { color: var(--ink-soft); font-size: .85rem; }
/* Status is always the word; the tint only repeats it. */
.report-status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--surface-muted); color: var(--ink-soft); }
.report-status.is-new { background: var(--warn-bg); color: var(--warn-ink); }
.report-status.is-resolved { background: var(--good-bg); color: var(--good-ink); }
.report-facts { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 8px 16px; margin: 0 0 16px; }
.report-facts dt { font-weight: 600; color: var(--ink-soft); font-size: .88rem; }
.report-facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .report-facts { grid-template-columns: 1fr; gap: 2px; } .report-facts dd { margin-bottom: 10px; } }
.report-photo { max-width: 100%; max-height: 520px; border: 1px solid var(--border); border-radius: 8px; }
.inline-form { margin-bottom: 16px; }

/* ---------------- R2: Kelengkapan data ---------------- */
.completeness h2 { margin-top: 28px; }
.completeness h2:first-child { margin-top: 0; }
.completeness .admin-card { margin-bottom: 8px; }
.completeness .section-note { margin: -4px 0 12px; max-width: 95ch; }
.gap-table td.num-col { font-weight: 700; }
.completeness .gap-done { color: var(--ink-soft); }
.completeness tr.is-done td:first-child { color: var(--ink-soft); }
/* Share of published products: neutral fill for what is missing, pandan for what is complete. */
.share-col { width: 1%; white-space: nowrap; }
table.admin-table th.share-col { text-align: right; }
.share-meter { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; font-variant-numeric: tabular-nums; }
.share-track { width: 120px; height: 6px; background: var(--surface-muted); border-radius: 999px; overflow: hidden; }
.share-fill { display: block; height: 100%; background: var(--ink-soft); border-radius: 999px; }
.share-meter.is-good .share-track { width: 56px; }
.share-meter.is-good .share-fill { background: var(--brand); }
.share-value { min-width: 3.4em; text-align: right; }
.gap-table .share-value { color: var(--ink-soft); }
.ready-callout { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px 18px; }
.ready-callout p { margin: 0; flex: 1 1 32ch; }
.ready-num { font-size: 1.35rem; font-weight: 800; margin-right: 2px; font-variant-numeric: tabular-nums; }
.category-table th { vertical-align: bottom; }
.category-table .th-sub { display: block; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-soft); }
.category-table td { vertical-align: top; }
.category-table td.row-title { min-width: 9em; }
.rank-count { display: block; white-space: nowrap; font-weight: 600; }
.rank-unit { font-weight: 400; font-size: .82rem; color: var(--ink-soft); }
.candidate-list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 14rem; }
.candidate-list a.todo-tag:hover { border-style: solid; text-decoration: none; }
.candidate-n { font-weight: 600; font-variant-numeric: tabular-nums; }
.gap-tags { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.gap-tags li { padding: 1px 9px; border-radius: 999px; background: var(--surface-muted); color: var(--ink-soft); font-size: .8rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) {
  .gap-table .share-track { display: none; }
  .gap-table th.share-col { white-space: normal; }
  .ready-callout { padding: 12px 14px; }
}

/* Pilihan: the sort rule sits under the title; candidates are one row per category. */
.pilihan-count { margin: 0 0 8px; }
table.admin-table .row-meta { display: block; margin-top: 2px; color: var(--ink-soft); font-size: .82rem; }
.pilihan-candidates { margin-top: 32px; }
.pilihan-candidates h2 { margin-bottom: 0; }
.pilihan-candidates .admin-note { margin: 4px 0 12px; }
.count-note { color: var(--ink-soft); font-weight: 600; font-size: .95rem; font-variant-numeric: tabular-nums; }
.admin-card.is-table table.admin-table.candidate-table { min-width: 560px; }
table.admin-table.candidate-table tbody th { width: 200px; color: var(--ink); font-size: .9rem; font-weight: 600; text-transform: none; letter-spacing: 0; vertical-align: top; padding-top: 14px; }
.candidate-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.candidate-chips .btn { gap: 5px; font-weight: 600; }
.candidate-chips .chip-unit { color: var(--ink-soft); font-weight: 400; }
.candidate-chips .chip-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-muted); color: var(--ink-soft); font-size: .76rem; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.candidate-chips .btn:hover { border-color: var(--brand); }
.candidate-chips .btn:hover .chip-count { background: var(--brand-light); color: var(--brand-deep); }
@media (max-width: 560px) {
  .admin-card.is-table table.admin-table.candidate-table { min-width: 0; }
  .candidate-table thead { display: none; }
  table.admin-table.candidate-table tbody th, .candidate-table tbody td { display: block; width: auto; }
  table.admin-table.candidate-table tbody th { border-bottom: 0; padding-bottom: 6px; }
  .candidate-table tbody td { padding-top: 0; padding-bottom: 14px; padding-left: 20px; }
}

/* Dashboard: "Perlu tindakan" cards with nothing to do step back onto the page. */
.report-section .stat-grid { margin-bottom: 0; }
.stat-card.is-done { background: transparent; }
.stat-card.is-done .num { color: var(--ink-soft); font-weight: 700; }
.report-section .section-head { margin-bottom: 12px; flex-wrap: wrap; }
.report-section .section-head h2 { font-size: 1.15rem; margin: 0; }

/* Audit: changes per day above the list; each day is a link to that day. */
.audit-days h2 { font-size: 1rem; margin: 0; }
.audit-days .admin-note { margin: 2px 0 10px; }
.day-strip { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; }
.day-strip a { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; min-height: 100px; padding: 6px 2px; border: 1px solid transparent; border-radius: 6px; color: var(--ink); font-size: .76rem; font-variant-numeric: tabular-nums; text-decoration: none; }
.day-strip a:hover { border-color: var(--border); text-decoration: none; }
.day-strip a[aria-current] { border-color: var(--brand); background: var(--surface-subtle); }
.day-bar { width: 100%; max-width: 22px; background: var(--series-1); border-radius: 3px 3px 0 0; }
.day-bar.is-zero { background: var(--border); }
.day-date { color: var(--ink-soft); }
@media (max-width: 560px) { .day-strip { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

/* ---------------- R2: Perbandingan ---------------- */
.comparison-intro { max-width: 65ch; margin: 0 0 8px; }
.comparison-meta { color: var(--ink-soft); font-size: .88rem; }
/* Sits beside the other next-step buttons until its link and status appear, then takes the full row. */
.share-widget { flex: 0 1 auto; display: flex; flex-direction: column; gap: 10px; }
.share-widget:has([data-share-options]:not([hidden])), .share-widget:has(.share-status:not(:empty)) { flex-basis: 100%; }
.share-options label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 5px; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-row input { flex: 1 1 220px; min-width: 0; padding: 9px 12px; font-size: 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-subtle); color: var(--ink); }
.share-status { margin: 0; font-size: .9rem; color: var(--ink-soft); min-height: 1.2em; }
.share-status:empty { min-height: 0; }
.comparison-group { margin-bottom: 24px; }
.comparison-group h2 { font-size: 1.15rem; }
.comparison-links { display: grid; gap: 8px; }
.comparison-links a { display: block; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); font-weight: 600; overflow-wrap: anywhere; }
.comparison-links a:hover { border-color: var(--brand); text-decoration: none; }
.comparison-block { margin: 24px 0; }
.comparison-block h2 { font-size: 1.1rem; }
@media (pointer: coarse) { .share-row .btn, .share-row input { min-height: var(--tap); } }
.og-preview { width: 100%; max-width: 600px; height: auto; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 16px; }
.comparison-preview { overflow-x: auto; }

/* ---------------- R3: zero-result search page ---------------- */
.zero-results .did-you-mean { font-size: 1.05rem; color: var(--ink); }
.zero-results .did-you-mean a { font-weight: 600; }
.zero-cat-title { margin: 20px 0 8px; }
.zero-cat-list { list-style: none; padding: 0; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 640px; }
.zero-cat-list a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--ink); text-decoration: none; }
.zero-cat-list a:hover, .zero-cat-list a:focus-visible { border-color: var(--brand); color: var(--brand-dark); }
.zero-request { margin-top: 20px; }
.admin-tabs { margin: 0 0 16px; }

/* ---------------- R3: barcode ---------------- */
.main-nav .nav-scan { gap: 4px; }
.main-nav .nav-scan svg { flex-shrink: 0; }
.hero-scan { margin: 12px 0 0; color: var(--ink-soft); font-size: .92rem; }
.hero-scan a { font-weight: 600; }
.barcode-page { max-width: 720px; }
.barcode-lead { color: var(--ink-soft); }
.scanner { margin: 16px 0; }
.scanner-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.scanner-controls .btn { min-height: var(--tap); }
.scanner-view { position: relative; margin-top: 12px; border-radius: var(--radius); overflow: hidden; background: #000; max-width: 480px; }
.scanner-view video { display: block; width: 100%; height: auto; max-height: 60vh; object-fit: cover; }
.scanner-frame { position: absolute; inset: 22% 10%; border: 3px solid #fff; border-radius: 8px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); pointer-events: none; }
/* The sweeping line says "looking for a barcode" while the camera runs. */
.scanner-frame::after { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; border-radius: 2px; background: var(--brand); opacity: .9; }
@media (prefers-reduced-motion: no-preference) {
  .scanner-frame::after { animation: scanner-sweep 1.8s cubic-bezier(.45, 0, .55, 1) infinite alternate; }
}
@keyframes scanner-sweep { from { top: 12%; } to { top: 86%; } }
.scanner-status { margin: 10px 0 0; font-weight: 600; color: var(--ink); min-height: 1.5em; }
.scanner-status:empty { min-height: 0; margin: 0; }
.scanner-status[data-tone] { font-weight: 400; font-size: .92rem; border-radius: 8px; padding: 10px 14px; border: 1px solid transparent; }
.scanner-status[data-tone="info"] { background: var(--brand-light); color: var(--brand-deep); }
.scanner-status[data-tone="warn"] { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-ink); }
.barcode-form { margin: 24px 0; }
.barcode-form label { display: block; font-weight: 600; margin-bottom: 6px; }
.barcode-form-row { display: flex; gap: 8px; }
.barcode-form-row input { flex: 1; min-width: 0; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); font-size: 1.1rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.barcode-form-row input:focus { border-color: var(--brand-dark); }
.barcode-form-row .btn { min-height: var(--tap); padding-inline: 24px; font-size: 1rem; }
.barcode-hint { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.barcode-hint .hint { margin: 0; font-size: .88rem; color: var(--ink-soft); }
.barcode-guide { flex-shrink: 0; color: var(--ink-soft); }
.barcode-guide-digits { fill: var(--brand-light); stroke: var(--brand); stroke-width: 1; }
.barcode-guide text { font: 600 8.5px/1 system-ui, sans-serif; fill: var(--brand-deep); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.barcode-privacy { font-size: .88rem; color: var(--ink-soft); }
.barcode-matches { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.barcode-matches a { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--ink); }
.barcode-matches img { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; }
.barcode-match-name { display: block; font-weight: 600; }
.barcode-match-sub { display: block; font-size: .9rem; color: var(--ink-soft); }
.barcode-contribute { margin-top: 28px; }
.product-picker { position: relative; }
.product-picker .autocomplete-list { list-style: none; margin: 0; padding: 4px 0; top: auto; }
.product-picker .autocomplete-list:not(.open) { display: none; }
.product-picker .autocomplete-list li { padding: 10px 14px; cursor: pointer; min-height: var(--tap); }
.product-picker .autocomplete-list li:hover, .product-picker .autocomplete-list li:focus { background: var(--brand-light); outline: none; }
.barcode-submission { margin-bottom: 16px; }
.admin-form-inline .field { margin-bottom: 8px; }

/* ---------------- R3: Pilihan sejenis ---------------- */
.alternatives { margin-top: 28px; }
.alt-block { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); margin: 10px 0; }
.alt-block > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; min-height: var(--tap); display: flex; align-items: center; gap: 10px; list-style: none; }
.alt-block > summary::-webkit-details-marker { display: none; }
/* Same drawn chevron as .nutrition-group: display:flex drops the browser's triangle. */
.alt-block > summary::before {
  content: ""; width: 7px; height: 7px; flex-shrink: 0; margin: 0 3px 0 2px;
  border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft);
  transform: rotate(-45deg); transition: transform .15s ease-out;
}
.alt-block[open] > summary::before { transform: rotate(45deg); }
.alt-block > summary:hover { color: var(--brand-dark); }
.alt-block[open] > summary { border-bottom: 1px solid var(--border); }
.alt-block .alt-note { margin: 0; padding: 12px 14px; color: var(--ink-soft); }
.alt-list { list-style: none; margin: 0; padding: 0; }
.alt-item { display: flex; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); min-width: 0; }
.alt-item:first-child { border-top: 0; }
.alt-thumb { flex: 0 0 64px; }
.alt-thumb img { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; background: var(--surface-subtle); }
.alt-body { min-width: 0; flex: 1; }
.alt-name { font-weight: 600; display: block; overflow-wrap: anywhere; }
.alt-sub { display: block; font-size: .88rem; color: var(--ink-soft); }
.alt-key { margin: 6px 0 2px; }
.alt-label, .alt-tradeoffs { margin: 2px 0; font-size: .9rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.alt-compare { margin-top: 8px; }
.alt-foot { font-size: .85rem; color: var(--ink-soft); margin-top: 8px; }
.compare-alternatives { margin: 24px 0; }
.compare-alternatives .alt-list { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.pilihan-alt-link { display: inline-block; margin-top: 6px; font-size: .9rem; }

/* ---------------- R4: audit trail, roles, password reset ---------------- */
.login-subtitle { font-size: 1.1rem; margin: 0 0 8px; }
.login-foot { margin: 14px 0 0; font-size: .9rem; text-align: center; }
.audit-filters { flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.audit-filters .field { margin: 0; }
.audit-filters label { display: block; font-size: .8rem; font-weight: 600; }
.checkbox-field label, .checkbox-label, .field label.checkbox-label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.audit-table td { vertical-align: top; }
.audit-diff { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.audit-diff li { margin: 0 0 4px; overflow-wrap: anywhere; }
.audit-diff del { color: var(--bad-ink); }
.audit-diff ins { color: var(--good-ink); text-decoration: none; font-weight: 600; }
.audit-field { font-weight: 600; }
.audit-note { margin: 6px 0 0; font-size: .85rem; color: var(--ink-soft); }
.audit-tag { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); font-size: .75rem; font-weight: 700; }
.correction-fields { border: 1px solid var(--border); border-radius: var(--radius); }
.correction-fields legend h2 { margin: 0; }
.nowrap { white-space: nowrap; }

/* Public "Sesuai label kemasan" note under the Nutrition Facts panel (products.label_verified) */
.label-verified { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 10px 12px; border: 1px solid var(--good-border); border-radius: 10px; background: var(--good-bg); color: var(--good-ink); font-size: .88rem; line-height: 1.45; }
.label-verified svg { flex: none; margin-top: 1px; color: var(--brand-dark); }
/* Admin list: "Label" next to the status pill */
.label-tag { display: inline-block; margin-left: 4px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--good-border); color: var(--good-ink); font-size: .72rem; font-weight: 700; }

/* Public "Data terakhir diperbarui" / "Riwayat koreksi" under the Nutrition Facts panel */
.data-history { margin: 8px 0 0; font-size: .88rem; color: var(--ink-soft); }
.data-updated { margin: 0 0 6px; }
.correction-history summary { cursor: pointer; font-weight: 600; color: var(--brand-dark); min-height: var(--tap); display: flex; align-items: center; }
.correction-list { margin: 4px 0 0; padding-left: 20px; color: var(--ink); }
.correction-list > li { margin: 0 0 10px; }
.correction-meta { margin: 0 0 2px; color: var(--ink-soft); }
.correction-lines { margin: 0; padding-left: 18px; }
.correction-note { margin: 4px 0; }

/* ---------------- R4: offline-friendly site and "Disimpan" ---------------- */
.offline-banner { background: var(--warn-bg); color: var(--warn-ink); border-bottom: 1px solid var(--warn-border); padding: 10px 16px; font-size: .9rem; text-align: center; }
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--brand-dark); color: var(--on-ink); font-size: .75rem; font-weight: 700; }
.install-hint { margin-top: 12px; }
.install-ios { margin: 6px 0 0; font-size: .85rem; }
.save-toggle.is-active { border-color: var(--brand-dark); color: var(--brand-dark); }
.alt-item .save-toggle { margin-left: 6px; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
/* Every tile in a row shares one height, and long names stop at two lines. */
.recent-list li { position: relative; display: flex; min-width: 0; }
.recent-head-actions { display: flex; align-items: center; gap: 16px; }
.recent-clear { display: inline-flex; align-items: center; padding: 0; background: none; border: 0; color: var(--ink-soft); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.recent-clear:hover { color: var(--bad); text-decoration: underline; text-underline-offset: 3px; }
.recent-confirm { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--bad-border); border-radius: var(--radius); background: var(--card); }
/* Remove × sits inside the tile's corner so the swipe row on phones never clips it.
   Quiet at rest like .saved-remove: ten red marks would outshout the products themselves. */
.recent-list li .recent-link { padding-right: 32px; }
.recent-remove { position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--ink-soft); cursor: pointer; transition: opacity .15s ease-out, background-color .15s ease-out, color .15s ease-out; }
.recent-remove svg { width: 10px; height: 10px; }
.recent-remove:hover { background: var(--bad-bg); color: var(--bad); }
.recent-remove:focus-visible { outline-offset: 0; }
/* With a mouse the × waits for the tile to be hovered; keyboard focus always shows it. */
@media (hover: hover) and (pointer: fine) {
  .recent-remove { opacity: 0; }
  .recent-list li:hover .recent-remove, .recent-remove:focus-visible { opacity: 1; }
}
/* Touch: the × stays visible, and its hit area grows to the 44 px tap size without moving it. */
@media (pointer: coarse) {
  .recent-remove::before { content: ""; position: absolute; inset: -10px; }
  .recent-clear { min-height: var(--tap); }
}
@media (prefers-reduced-motion: reduce) { .recent-remove { transition: none; } }
.recent-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 8px 10px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--ink); font-weight: 600; font-size: .9rem; line-height: 1.35; }
.recent-link span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.recent-section .hint { margin: 10px 0 0; font-size: .85rem; color: var(--ink-soft); }
.recent-link:hover { border-color: var(--brand); text-decoration: none; }
.recent-link img { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; background: var(--surface-muted); flex-shrink: 0; }
/* One bar: what to do and how many are picked on the left, the actions on the right. */
.saved-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin: 16px 0 0; padding: 10px 12px 10px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.saved-bar-text { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.saved-picked { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: 4px; }
.saved-bar-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-bar-buttons [hidden] { display: none; }
.saved-bar .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.saved-bar .btn[aria-disabled="true"]:hover { background: var(--brand-dark); }
.saved-compare-count { font-variant-numeric: tabular-nums; }
.saved-confirm { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); font-weight: 600; }
.saved-confirm span { margin-right: auto; }
.saved-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.saved-search-result, .saved-search-empty { margin: 8px 0 0; color: var(--ink-soft); font-size: .92rem; }
/* The card fills its row so the pick/remove footers line up across the row. */
.saved-item { display: flex; flex-direction: column; min-width: 0; }
.saved-item > .product-card { flex: 1; }
.saved-item.is-picked > .product-card { border-color: var(--brand-dark); box-shadow: inset 0 0 0 1px var(--brand-dark); }
.saved-item .actions { align-items: center; padding-top: 10px; }
.saved-pick { flex: 1; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 11px; border: 1px solid var(--border); border-radius: 8px; font-size: .82rem; font-weight: 600; cursor: pointer; }
.saved-pick:hover { background: var(--surface-hover); }
.saved-pick input { width: 16px; height: 16px; margin: 0; }
.saved-pick:has(input:checked) { background: var(--brand-light); border-color: var(--brand); color: var(--brand-deep); }
.saved-pick:has(input:disabled) { color: var(--ink-faint); cursor: not-allowed; background: none; }
.saved-pick:has(input:focus-visible) { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
.saved-remove { padding: 5px 7px; color: var(--ink-soft); }
.saved-remove:hover { color: var(--bad); border-color: var(--bad-border); background: var(--bad-bg); }
.saved-item.is-gone { flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-subtle); }
.saved-gone-name { margin: 0; overflow-wrap: anywhere; }
.saved-gone-note { margin: 0 0 6px; color: var(--ink-soft); font-size: .9rem; }
.saved-item.is-gone .btn { margin-top: auto; }
.saved-status { margin: 12px 0 0; color: var(--ink-soft); font-size: .92rem; }
.saved-status:empty { display: none; }
.saved-empty { margin: 24px 0 0; padding: 40px 24px; text-align: center; background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); }
.saved-empty p { max-width: 42ch; margin: 0 auto 8px; color: var(--ink-soft); }
.saved-empty .saved-empty-title { color: var(--ink); font-weight: 700; font-size: 1.1rem; }
.saved-empty p:last-child { margin: 16px auto 0; }
.saved-empty-icon { color: var(--brand); margin-bottom: 8px; }
.offline-list { padding-left: 20px; }
.offline-list li { margin: 0 0 8px; }
.offline-kind { color: var(--ink-soft); font-size: .85rem; }
@media (max-width: 640px) {
  .saved-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .saved-bar { padding: 12px; }
  .saved-bar-buttons { width: 100%; }
  .saved-bar-buttons [data-saved-compare] { flex: 1; }
  /* History is secondary: one swipeable row instead of ten stacked rows ahead of the catalogue.
     The tile peeking at the right edge shows there is more. */
  .recent-list {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 -16px; padding: 0 16px 2px; scroll-padding-inline: 16px;
  }
  .recent-list::-webkit-scrollbar { display: none; }
  .recent-list li { flex: 0 0 72%; scroll-snap-align: start; }
}
.nav-quick { display: contents; }
/* Below the width where logo and all links share one row (820 px): Pindai and Disimpan sit beside
   the logo and the other links take the second row, never a third header row. */
@media (max-width: 819px) {
  .site-header .bar { position: relative; gap: 4px 16px; padding: 8px 16px; }
  .brand-logo { min-height: var(--tap); }
  .main-nav { width: 100%; }
  .nav-quick { display: flex; align-items: center; gap: 18px; position: absolute; top: 8px; right: 16px; height: var(--tap); }
}
/* Phones: Pindai becomes an icon, so the five main links fit one row at 360 px with no horizontal scroll. */
@media (max-width: 639px) {
  .nav-quick { gap: 8px; }
  .main-nav .nav-scan { min-width: var(--tap); min-height: var(--tap); justify-content: center; }
  .nav-scan svg { width: 22px; height: 22px; }
  .nav-scan-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .main-nav { justify-content: space-between; column-gap: 8px; }
}
@media (max-width: 359px) {
  .main-nav { column-gap: 4px; }
  .main-nav a { font-size: .84rem; }
  .brand-logo { gap: 4px; }
  .wordmark { font-size: 1.05rem; }
  .nav-quick { gap: 0; }
  .nav-count { min-width: 18px; margin-left: 3px; padding: 0 5px; }
}

/* The hidden attribute always wins over a component display value (e.g. .saved-confirm, .nav-count). */
[hidden] { display: none !important; }

/* ---------------- R4: Panduan ---------------- */
.panduan-page { max-width: 1000px; }
.panduan-summary { font-size: 1.1rem; color: var(--ink-soft); max-width: 65ch; }
.panduan-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .88rem; color: var(--ink-soft); margin: 0 0 24px; }
.panduan-meta span:not(:last-child)::after { content: "·"; margin-left: 8px; }
.panduan-cover { display: block; width: 100%; height: auto; border-radius: var(--radius); margin: 0 0 20px; }
.panduan-layout { display: grid; gap: 24px; }
.panduan-toc { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 14px; align-self: start; }
.panduan-toc summary { cursor: pointer; font-weight: 700; min-height: var(--tap); display: flex; align-items: center; }
.panduan-toc ol { margin: 0 0 10px; padding-left: 18px; font-size: .9rem; }
.panduan-toc li { margin: 0 0 6px; }
.panduan-toc .toc-level-3 { margin-left: 12px; list-style-type: circle; }
.panduan-body { max-width: 68ch; min-width: 0; line-height: 1.65; }
.panduan-body h2 { margin-top: 32px; scroll-margin-top: calc(var(--header-h) + 12px); }
.panduan-body h3 { margin-top: 24px; scroll-margin-top: calc(var(--header-h) + 12px); }
/* The global ul reset strips markers; prose lists from the guide's Markdown need them back. */
.panduan-body > ul, .panduan-body > ol { margin: 0 0 1em; padding-left: 1.4em; }
.panduan-body > ul { list-style: disc; }
.panduan-body > ul > li, .panduan-body > ol > li { margin: 0 0 6px; padding-left: 2px; }
.panduan-body > ul > li::marker, .panduan-body > ol > li::marker { color: var(--ink-soft); }
.panduan-body img { max-width: 100%; height: auto; }
.panduan-body pre { overflow-x: auto; background: var(--surface-muted); padding: 12px; border-radius: 8px; }
.panduan-sources { margin-top: 32px; font-size: .9rem; }
.panduan-sources li { overflow-wrap: anywhere; margin-bottom: 6px; }
.panduan-disclaimer { margin-top: 24px; padding: 12px 14px; background: var(--surface-muted); border-radius: 8px; font-size: .9rem; color: var(--ink-soft); }
.panduan-related, .panduan-category { margin-top: 32px; max-width: 68ch; }
.panduan-link-list { margin: 0; padding: 0; border-top: 1px solid var(--border); }
.panduan-link-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.panduan-link-list a { font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.panduan-link-topic { display: block; margin-top: 2px; font-size: .82rem; color: var(--ink-soft); }
.panduan-index h2 { font-size: 1.3rem; }
.panduan-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
/* The whole card is the link's hit area (the title's ::after covers it); only the title is announced. */
.panduan-card { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; transition: border-color .15s ease-out; }
.panduan-card:hover { border-color: var(--brand); }
.panduan-card:has(.panduan-card-title:focus-visible) { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
.panduan-card-title { font-weight: 700; font-size: 1.05rem; line-height: 1.35; text-wrap: balance; overflow-wrap: anywhere; }
.panduan-card-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.panduan-card-title:focus-visible { outline: none; }
.panduan-card:hover .panduan-card-title { text-decoration: underline; }
.panduan-card p { margin: 6px 0 0; font-size: .92rem; color: var(--ink-soft); }
.panduan-card .panduan-card-meta { margin-top: auto; padding-top: 12px; color: var(--ink-soft); font-size: .82rem; }
.panduan-highlights { display: grid; gap: 32px; margin: 28px 0 48px; }
.panduan-popular { align-self: start; }
.panduan-rank-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; border-top: 1px solid var(--border); }
.panduan-rank-list li { counter-increment: rank; display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.panduan-rank-list li::before { content: counter(rank); font-weight: 800; font-size: 1.05rem; line-height: 1.4; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.panduan-rank-list a { font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.panduan-topic-grid { display: grid; gap: 12px; }
.panduan-topic { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.panduan-topic h3 { font-size: 1.05rem; margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.panduan-topic-count { font-size: .82rem; font-weight: 400; color: var(--ink-soft); }
.panduan-topic-list li { border-bottom: 1px solid var(--border); }
.panduan-topic-list a { display: block; padding: 10px 0; line-height: 1.35; overflow-wrap: anywhere; }
.panduan-topic .see-all { align-self: flex-start; margin-top: auto; padding-top: 10px; font-size: .88rem; font-weight: 600; }
@media (pointer: coarse) {
  .panduan-topic-list a { display: flex; align-items: center; min-height: var(--tap); padding: 6px 0; }
  .panduan-topic .see-all { display: inline-flex; align-items: center; min-height: var(--tap); padding-top: 4px; }
}
.lead-text { color: var(--ink-soft); max-width: 65ch; }
.preview-banner { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-border); border-radius: 8px; padding: 10px 14px; }
.embed-problems, .embed-problem { background: var(--bad-bg); color: var(--bad-ink); border: 1px solid var(--bad-border); border-radius: 8px; padding: 10px 14px; overflow-wrap: anywhere; }
.embed { margin: 20px 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); line-height: 1.5; }
.embed-kicker { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft); }
.embed-title { margin: 2px 0 6px; font-weight: 700; font-size: 1.02rem; }
.embed-meta { margin: 0 0 8px; font-size: .88rem; color: var(--ink-soft); }
.embed-more { margin: 10px 0 0; font-size: .9rem; font-weight: 600; }
.embed-foot { margin: 8px 0 0; font-size: .78rem; color: var(--ink-soft); }
.embed .pilihan-list { margin: 8px 0 0; }
.embed-keys { list-style: none; margin: 0 0 8px; padding: 0; font-size: .9rem; }
.embed-keys li { margin: 0 0 4px; }
.embed-keys .key { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-size: .75rem; font-weight: 700; }
.embed-rows { list-style: none; margin: 0; padding: 0; }
.embed-rows li { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid var(--border); font-size: .9rem; }
.embed-row-label { font-weight: 700; }
.embed-row-verdict { color: var(--ink-soft); }
.embed-product { display: flex; gap: 12px; align-items: center; }
.embed-product img { width: 72px; height: 72px; object-fit: contain; background: var(--surface-muted); border-radius: 6px; flex-shrink: 0; }
.embed-nutrients { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0; }
.embed-nutrients div { padding: 8px; background: var(--surface-subtle); border-radius: 6px; }
.embed-nutrients dt { font-size: .8rem; color: var(--ink-soft); }
.embed-nutrients dd { margin: 2px 0 0; font-size: .82rem; color: var(--ink-soft); text-wrap: balance; }
.embed-nutrients dd strong { display: block; font-size: 1.05rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.embed .alternatives { margin: 0; }
.embed .alternatives > .block-title { margin: 0; font-size: 1.02rem; font-weight: 700; }
.alt-for { margin: 2px 0 0; font-size: .88rem; color: var(--ink-soft); }
/* Inside an embed the details block is a section of the card, not a second card. */
.embed .alt-block { margin: 12px -14px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; }
.embed .alt-block[open] > summary { border-bottom-style: dashed; }
.embed .alt-foot { margin: 0 -14px; padding: 10px 14px 0; border-top: 1px solid var(--border); }
/* Admin editor */
.embed-helper { border: 1px dashed var(--border); border-radius: var(--radius); padding: 12px; margin: 0 0 12px; background: var(--surface-subtle); }
.embed-helper-title { margin: 0 0 8px; font-weight: 700; }
.embed-helper .field label { display: block; margin-top: 6px; }
.embed-helper .btn { margin-top: 6px; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9rem; }
.ref-list { padding-left: 18px; }
.plain-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.flag-list { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.flag-bad { color: var(--bad-ink); }
.flag-warn { color: var(--warn-ink); font-weight: 700; }
.alert.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-border); }
.cover-preview { display: block; max-width: 100%; height: auto; border-radius: 8px; margin-bottom: 8px; }
.publish-form { margin-top: 12px; }
@media (min-width: 860px) {
  .panduan-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .panduan-toc { position: sticky; top: calc(var(--header-h) + 12px); }
  .panduan-highlights { grid-template-columns: 2fr 1fr; }
  /* Line the after-article sections up with the body column, not the table of contents. */
  .panduan-layout:has(.panduan-toc) ~ .panduan-related, .panduan-layout:has(.panduan-toc) ~ .panduan-category { margin-left: calc(220px + 24px); }
  .panduan-topic-grid { grid-template-columns: 1fr 1fr; }
  .embed-rows li { grid-template-columns: 120px 1fr auto; align-items: baseline; gap: 12px; }
}
@media (min-width: 560px) {
  .embed-nutrients { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Absolutely positioned .sr-only text inside a scrolling table must be clipped by it, not widen the page. */
.admin-card.is-table, .table-wrap { position: relative; overflow-x: auto; }

/* ---------------- Admin dashboard: traffic KPIs and charts ---------------- */
/* Series colours: a categorical order checked for colour-blind separation; aqua and yellow sit
   under 3:1 on white, so every chart carries a legend and a table view. */
.traffic, .audit-days {
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --chart-grid: #e8ece9;
  --chart-baseline: #c9d3cd;
}
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-label { color: var(--ink-soft); font-size: .85rem; font-weight: 600; }
.kpi-value { font-size: 1.7rem; font-weight: 800; line-height: 1.2; }
.kpi-delta { font-size: .8rem; font-weight: 600; }
.kpi-delta-icon { width: 11px; height: 11px; vertical-align: -1px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kpi-delta .muted { font-size: inherit; font-weight: 400; }
.kpi-delta.is-good { color: var(--good-ink); }
.kpi-delta.is-bad { color: var(--bad); }
.kpi-delta.is-flat { color: var(--ink-soft); font-weight: 400; }
.kpi-spark { width: 100%; height: 32px; margin-top: 6px; overflow: visible; }
.kpi-spark polyline { fill: none; stroke: var(--series-1); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.kpi-note { color: var(--ink-faint); font-size: .75rem; }

.chart-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 14px; }
.chart-card { margin: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.chart-card.is-wide { grid-column: 1 / -1; }
.chart-card figcaption h3 { margin-bottom: 2px; }
.chart-card figcaption .admin-note { margin: 0 0 12px; }
.chart { position: relative; min-height: 120px; }
.chart svg { display: block; overflow: visible; touch-action: pan-y; }
.chart .chart-axis { fill: var(--ink-faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .chart-panel-title { fill: var(--ink-soft); font-size: 12px; font-weight: 600; }
.chart .chart-grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .chart-baseline { stroke: var(--chart-baseline); stroke-width: 1; }
.chart .chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .chart-dot { stroke: var(--card); stroke-width: 2; }
.chart .chart-cross { stroke: var(--ink-faint); stroke-width: 1; pointer-events: none; }
.chart .chart-hover { fill: var(--surface-muted); pointer-events: none; }
.chart-tip { position: absolute; top: 0; z-index: 2; pointer-events: none; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font-size: .8rem; white-space: nowrap; }
.chart-tip-title { color: var(--ink-soft); margin-bottom: 2px; }
.chart-tip-row { display: flex; align-items: center; gap: 6px; }
.chart-tip-row strong { font-variant-numeric: tabular-nums; }
.chart-tip-key { width: 10px; height: 2px; border-radius: 1px; flex: none; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 10px; font-size: .85rem; }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--series); flex: none; }
.chart-legend .muted { font-size: inherit; }
.chart-card:has(.chart-empty) { display: flex; flex-direction: column; }
.chart-empty { flex: 1; display: grid; place-items: center; min-height: 120px; margin: 0; padding: 16px; border: 1px dashed var(--border); border-radius: 8px; color: var(--ink-soft); font-size: .88rem; text-align: center; }
.chart-table { margin-top: 10px; font-size: .85rem; }
.chart-table summary { cursor: pointer; color: var(--brand-dark); font-weight: 600; }
.chart-table .admin-card { margin-top: 8px; max-height: 320px; overflow-y: auto; }

.hbar-list { display: grid; gap: 10px; }
.hbar-list li { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: .88rem; }
.hbar-track { height: 12px; display: block; }
.hbar-fill { display: block; height: 100%; min-width: 2px; background: var(--series-1); border-radius: 0 4px 4px 0; }
.hbar-value { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbar-value .muted { font-size: .8rem; }
@media (max-width: 480px) {
  .hbar-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .hbar-track { grid-column: 1 / -1; grid-row: 2; }
}

/* ======================= R5: member accounts ======================= */
.nav-account { gap: 6px; }
.nav-account svg { flex: none; }
@media (max-width: 639px) {
  .main-nav .nav-account { min-width: var(--tap); min-height: var(--tap); justify-content: center; }
  .nav-account svg { width: 22px; height: 22px; }
  .nav-account-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
}

/* A member's "Akun" opens a menu (details/summary, so it works without JS; app.js closes it on an
   outside click or Escape). The panel hangs from the right edge, so it never leaves a phone screen. */
.account-menu { position: relative; display: inline-flex; }
.account-menu > summary {
  display: inline-flex; align-items: center; min-height: 32px; cursor: pointer; list-style: none;
  color: var(--ink-soft); font-weight: 600; font-size: .95rem; border-radius: 6px;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover, .account-menu > summary.active, .account-menu[open] > summary { color: var(--brand-dark); }
.account-menu-caret { flex: none; margin-left: -2px; transition: transform .18s cubic-bezier(.2, .8, .2, 1); }
.account-menu[open] .account-menu-caret { transform: rotate(180deg); }
.account-menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50;
  width: max-content; min-width: 240px; max-width: calc(100vw - 32px); padding: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transform-origin: top right;
}
.account-menu[open] .account-menu-panel { animation: account-menu-in .16s cubic-bezier(.2, .8, .2, 1); }
@keyframes account-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
  .account-menu[open] .account-menu-panel { animation: none; }
  .account-menu-caret { transition: none; }
}
.account-menu-who { margin: 0 0 6px; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); font-size: .8rem; line-height: 1.35; color: var(--ink-soft); }
.account-menu-who strong { display: block; margin-top: 2px; color: var(--ink); font-size: .92rem; font-weight: 700; overflow-wrap: anywhere; }
.account-menu-panel ul { display: grid; gap: 2px; }
.main-nav .account-menu-panel a, .account-menu-panel button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border-radius: 6px;
  color: var(--ink); font: inherit; font-weight: 500; font-size: .95rem; text-align: left;
}
.main-nav .account-menu-panel a:hover, .account-menu-panel button:hover { background: var(--surface-hover); color: var(--brand-dark); text-decoration: none; }
/* Current page: a tinted row plus weight, not colour alone. */
.main-nav .account-menu-panel a[aria-current="page"] { background: var(--brand-light); color: var(--brand-deep); font-weight: 700; }
.account-menu-panel form { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--border); }
.account-menu-panel button { background: none; border: 0; cursor: pointer; color: var(--ink-soft); }
.account-menu-panel button svg { flex: none; }
@media (pointer: coarse) {
  .main-nav .account-menu-panel a, .account-menu-panel button { min-height: var(--tap); }
}
@media (max-width: 639px) {
  .account-menu > summary { min-width: var(--tap); min-height: var(--tap); justify-content: center; }
  .account-menu-caret { display: none; }
}

.member-page { max-width: 560px; }
.member-page.account-page { max-width: 760px; }
.member-lead { color: var(--ink-soft); margin-bottom: 20px; }
.member-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.member-form.is-inline { background: none; border: 0; padding: 0; }
.member-form .field input[type=email], .member-form .field input[type=password], .member-form .field input[type=text] { min-height: var(--tap); }
.member-form .btn, .member-page .btn { min-height: var(--tap); }
/* Member forms are short: the action row sits at the end of the card, not as the admin's floating bar */
.member-form .form-actions { position: static; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
.member-page:not(.account-page) .member-form .form-actions .btn { flex: 1; }

/* Google sign-in (Google's branding: white fill, grey outline, full-colour "G", dark label) */
.google-signin { margin-bottom: 20px; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: var(--tap); padding: 9px 16px;
  background: var(--card); color: var(--ink); border: 1px solid var(--ink-faint); border-radius: 8px;
  font-weight: 600; font-size: .95rem;
  transition: background-color .15s, border-color .15s;
}
.btn-google:hover { background: var(--surface-hover); border-color: var(--ink-soft); color: var(--ink); text-decoration: none; }
.btn-google-logo { flex: none; }
.google-signin-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; color: var(--ink-soft); font-size: .85rem; }
.google-signin-or::before, .google-signin-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.member-check { font-weight: 500; min-height: var(--tap); gap: 10px; }
.member-check input { width: 20px; height: 20px; margin: 0; flex: none; }
/* "Tetap masuk" and "Lupa kata sandi?" share a row under the password; the link drops below on narrow cards */
.member-form-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 16px; margin: -4px 0 12px; }
.member-form-row .member-check { margin: 0; }
.member-form-row a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 600; }
.member-note { font-size: .85rem; color: var(--ink-soft); margin: 4px 0 16px; }
.member-switch { margin: 8px 0; }
.member-switch a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 600; }
.member-steps { list-style: disc; padding-left: 20px; margin: 8px 0 20px; color: var(--ink-soft); }
.member-steps li { margin-bottom: 4px; }

.password-wrap { display: flex; gap: 8px; align-items: stretch; }
.password-wrap input { flex: 1; min-width: 0; }
.password-toggle { flex: none; white-space: nowrap; }

.member-intent { background: var(--brand-light); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; color: var(--ink-soft); }
.member-intent p { margin: 0 0 8px; }
.member-intent p:last-child, .member-intent ul:last-child { margin-bottom: 0; }
.member-intent ul { list-style: disc; padding-left: 20px; margin: 0 0 8px; }
.member-intent strong { color: var(--ink); font-weight: 600; }
.member-intent-title { font-size: 1.05rem; font-weight: 700; line-height: 1.3; color: var(--ink); text-wrap: balance; }
/* Which product gets saved: the same thumb + brand + name a product card shows. */
.member-intent-product { display: flex; align-items: center; gap: 12px; margin: 12px 0; padding: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; }
.member-intent-thumb { flex: none; width: 56px; height: 56px; border-radius: 6px; background: var(--surface-muted); overflow: hidden; }
.member-intent-thumb img { width: 100%; height: 100%; object-fit: contain; background: var(--surface-subtle); }
.member-intent-product-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.member-intent-brand { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.member-intent-name { font-size: .95rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.account-chevron { flex: none; color: var(--ink-faint); transition: transform .15s cubic-bezier(.2, .8, .2, 1), color .15s; }
.account-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 32px; }
/* The link stretches over the whole card; the card shows hover and keyboard focus. */
.account-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 6px;
  transition: border-color .15s;
}
.account-card:hover { border-color: var(--brand); }
.account-card:has(a:focus-visible) { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
.account-card h2 { font-size: .95rem; font-weight: 600; color: var(--ink-soft); margin: 0 0 6px; }
.account-card-stat { margin: 0; color: var(--ink); font-size: .95rem; font-weight: 600; }
.account-card-stat strong { font-size: 1.9rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-right: 2px; }
.account-card-stat.is-empty { font-size: 1.15rem; font-weight: 700; line-height: 1.8; }
.account-card-meta { margin: 2px 0 0; color: var(--ink-soft); font-size: .88rem; }
.account-card a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: auto; padding-top: 10px; min-height: var(--tap); font-weight: 600; font-size: .92rem;
}
.account-card a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.account-card a:focus-visible { outline: none; }
.account-card a:hover { text-decoration: none; }
.account-card:hover .account-chevron { color: var(--brand-dark); transform: translateX(2px); }
/* Phones: one compact row per card; the action text stays for screen readers, the chevron shows it. */
@media (max-width: 639px) {
  .account-cards { grid-template-columns: 1fr; gap: 8px; }
  .account-card { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; padding: 12px 12px 12px 16px; }
  .account-card > :not(a) { grid-column: 1; }
  .account-card a { grid-column: 2; grid-row: 1 / span 3; margin: 0; padding: 0; min-height: 0; font-size: 0; }
  .account-card-stat strong { font-size: 1.6rem; }
}
.account-section-title { font-size: 1.15rem; margin: 0 0 10px; }
.account-links { margin: 0 0 32px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.account-links li + li { border-top: 1px solid var(--border); }
.account-links a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 4px 12px 4px 16px; color: var(--ink); font-weight: 600;
}
.account-links a:hover { background: var(--surface-hover); color: var(--brand-dark); text-decoration: none; }
.account-links a:hover .account-chevron { color: currentColor; transform: translateX(2px); }
.account-links a:focus-visible { outline-offset: -2px; }
.account-links a.is-danger { color: var(--bad); }
.account-links a.is-danger:hover { background: var(--bad-bg); color: var(--bad-ink); }
@media (prefers-reduced-motion: reduce) { .account-chevron, .account-card { transition: none; } }

.account-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.account-panel p { margin: 0 0 12px; color: var(--ink-soft); max-width: 62ch; }
.account-panel p:last-child, .account-panel form:last-child { margin-bottom: 0; }
.account-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 8px; }
.account-panel-head .account-section-title { margin: 0; }
.account-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; line-height: 1.2;
  background: var(--surface-muted); color: var(--ink-soft); font-size: .78rem; font-weight: 600;
}
.account-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.account-status.is-on { background: var(--good-bg); color: var(--good-ink); }
.account-recent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.member-form.account-logout { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }

/* R5: sign-up prompt (native <dialog>; .signup-prompt-inline is the no-<dialog> fallback) */
dialog.signup-prompt { border: 0; border-radius: var(--radius); padding: 0; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 2px 4px rgba(16, 40, 30, .08), 0 16px 40px rgba(16, 40, 30, .18); color: var(--ink); background: var(--card); }
dialog.signup-prompt::backdrop { background: rgba(22, 33, 28, .5); }
.signup-prompt-inner { padding: 24px; }
.signup-prompt-inline { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin: 12px 0; }
.signup-prompt-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.signup-prompt-title { flex: 1; font-size: 1.25rem; line-height: 1.3; margin: 0; padding-top: 6px; text-wrap: balance; }
/* The title only takes focus so a screen reader starts there; it is not a control, so no ring. */
.signup-prompt-title:focus { outline: none; }
.signup-prompt-close { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -4px -10px 0 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.signup-prompt-close:hover { background: var(--surface-hover); color: var(--ink); }
.signup-prompt-body { color: var(--ink-soft); }
.signup-prompt-body strong { color: var(--ink); font-weight: 600; }
.signup-prompt-body p { margin: 0 0 10px; }
.signup-prompt-body p:last-child { margin-bottom: 0; }
.signup-prompt-body ul { list-style: disc; padding-left: 20px; margin: 0 0 12px; }
.signup-prompt-body li { margin-bottom: 4px; }
/* What an account adds: the substance of the prompt, so it reads in ink with a check, not grey bullets. */
.signup-prompt-body .signup-prompt-benefits { list-style: none; padding: 0; margin: 4px 0 16px; display: grid; gap: 8px; }
.signup-prompt-benefits li { display: flex; gap: 10px; margin: 0; color: var(--ink); line-height: 1.45; }
.signup-prompt-check { flex: none; margin-top: 2px; color: var(--brand-dark); }
.signup-prompt-note { background: var(--surface-muted); border-radius: 8px; padding: 10px 12px; font-size: .92rem; }
.signup-prompt-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.signup-prompt-actions .btn { min-height: var(--tap); justify-content: center; width: 100%; font-size: .95rem; }
.signup-prompt-later { align-self: center; min-height: var(--tap); padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; }
.signup-prompt-later:hover { color: var(--ink); background: var(--surface-hover); }
@media (pointer: coarse) {
  .signup-prompt-close { width: var(--tap); height: var(--tap); margin: -6px -12px 0 0; }
}
@media (max-width: 639px) {
  /* Phone: a bottom sheet, so the buttons sit under the thumb. */
  dialog.signup-prompt { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: calc(100dvh - 24px); }
  .signup-prompt-inner { padding: 20px 16px calc(12px + env(safe-area-inset-bottom)); }
  .signup-prompt-actions { margin-top: 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog.signup-prompt[open] { animation: signup-prompt-in .22s cubic-bezier(.16, 1, .3, 1); }
  dialog.signup-prompt[open]::backdrop { animation: signup-prompt-fade .22s ease-out; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 639px) {
  dialog.signup-prompt[open] { animation-name: signup-prompt-up; animation-duration: .28s; }
}
@keyframes signup-prompt-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes signup-prompt-up { from { transform: translateY(100%); } }
@keyframes signup-prompt-fade { from { opacity: 0; } }

/* R5: compare tray over the guest limit, /compare guest banner */
.tray-limit { flex-basis: 100%; margin: 0; font-size: .85rem; color: var(--on-ink); }
.tray-limit a { color: var(--on-ink); font-weight: 700; text-decoration: underline; display: inline-flex; align-items: center; min-height: var(--tap); }
.compare-limit { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 20px; }
.compare-limit-title { font-size: 1.05rem; margin-bottom: 6px; }
.compare-limit-text { margin: 0 0 8px; }
.compare-limit-notice { margin: 0 0 8px; font-weight: 600; }
.compare-limit-form fieldset { border: 0; padding: 0; margin: 8px 0; min-width: 0; }
.compare-limit-form legend { font-weight: 700; margin-bottom: 4px; }
.compare-limit-list li { margin: 0; }
.compare-limit-form .btn, .compare-limit-actions .btn { min-height: var(--tap); }
.compare-limit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.compare-member-cta { margin: 20px 0; padding: 12px 16px; background: var(--brand-light); border-radius: var(--radius); }
.compare-member-cta a { font-weight: 700; display: inline-flex; align-items: center; min-height: var(--tap); }
.pilihan-cta-login { display: inline-flex; align-items: center; min-height: var(--tap); margin-left: 12px; font-weight: 600; }

/* R5: account-backed Simpan (a real form), member /disimpan */
.save-form { display: inline-flex; margin: 0; }
.save-account.is-active { border-color: var(--brand-dark); color: var(--brand-dark); }
.alt-item .save-form { margin-left: 6px; }
.saved-remove-form { display: inline-flex; margin: 0; }
.saved-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 16px; }
.saved-tabs a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; font-weight: 600; color: var(--ink-soft); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.saved-tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand-dark); text-decoration: none; }
.saved-comparisons { display: grid; gap: 12px; }
.saved-comparison { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.saved-comparison.is-incomplete { border-style: dashed; }
.saved-comparison-title { font-size: 1.05rem; margin-bottom: 4px; }
.saved-comparison-products { color: var(--ink-soft); margin: 0 0 8px; }
.saved-comparison-note { font-size: .88rem; color: var(--warn-ink); margin: 0 0 8px; }
.saved-comparison-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.saved-comparison-actions form { margin: 0; }
.saved-comparison-actions .btn, .saved-comparison-rename .btn { min-height: var(--tap); }
.saved-comparison-rename summary { cursor: pointer; display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 600; color: var(--brand-dark); }
.saved-comparison-rename .field { margin: 8px 0 0; }
.compare-save { margin: 16px 0; padding: 12px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.compare-save .field { margin-bottom: 8px; }
.import-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.import-offer p { margin: 0; flex-basis: 100%; }
.import-offer .btn { min-height: var(--tap); }

/* R5: personal allergen warnings (icon + text, role="note"; colour only supports the words) */
.allergen-warning { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); font-size: .92rem; line-height: 1.45; }
.allergen-warning svg { flex: none; margin-top: 1px; }
.allergen-warning.is-contains { background: var(--bad-bg); border-color: var(--bad-border); color: var(--bad-ink); font-weight: 600; }
.allergen-warning.is-may_contain { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-ink); }
.allergen-warning.is-incomplete { background: var(--surface-muted); color: var(--ink); }
.allergen-warning.is-compact { padding: 6px 8px; font-size: .84rem; margin: 6px 0 0; }
.allergen-personal { margin: 0 0 16px; }
.allergen-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; }
.member-consent { background: var(--surface-muted); border-radius: 8px; padding: 10px 12px; }
.member-consent .checkbox-label { align-items: flex-start; }
.member-consent input { margin-top: 3px; flex: none; }

/* R5: /akun/laporan */
.member-table { width: 100%; border-collapse: collapse; background: var(--card); font-size: .92rem; }
.member-table th, .member-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.member-table thead th { background: var(--surface-muted); font-size: .82rem; }
.report-status { font-weight: 700; }
.table-scroll { overflow-x: auto; position: relative; border: 1px solid var(--border); border-radius: var(--radius); }

/* R5 admin: member detail */
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 8px; }
.detail-list dt { font-weight: 600; color: var(--ink-soft); }
.detail-list dd { margin: 0; }
@media (max-width: 560px) { .detail-list { grid-template-columns: 1fr; } .detail-list dd { margin-bottom: 6px; } }
.danger-zone { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.danger-zone .btn { margin-top: 8px; }
