/* Check It – "blue & yellow" theme from the design canvas */
:root {
  --bg: #F5F8FC;
  --card: #FFFFFF;
  --ink: #0F1B2D;
  --muted: #4B5872;
  --line: #D6DEEA;
  --divider: #E8EDF4;
  --accent: #1D4ED8;        /* buttons and active states */
  --accent-ink: #FFFFFF;
  --light-blue: #BFDBFE;    /* code tags, date header */
  --panel: #DCE8FF;         /* scan panel */
  --nodate: #DBEAFE;        /* "no date needed" card */
  --yellow: #FFF7C2;        /* the date you write on (picked in the design) */
  --ok-bg: #DCFCE7; --ok-ink: #14532D;
  --new-bg: #DBEAFE; --new-ink: #1E3A8A;
  --warn-bg: #FEF08A; --warn-line: #CA8A04;
  --danger: #B91C1C;
  --display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --body: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 72px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; -webkit-tap-highlight-color: transparent; }
body { min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.padx { padding: 0 16px; }

#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; }
.screen { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(var(--nav-h) + 16px); }
.screen.pad { padding: 16px; gap: 14px; padding-bottom: 24px; }
.center-screen { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; }
.brand { display: flex; align-items: center; gap: 8px; }
.wordmark { font-family: var(--display); font-size: 32px; line-height: 1; color: var(--accent); letter-spacing: .01em; }
.wordmark.big { font-size: 48px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }
.pill.new { background: var(--new-bg); color: var(--new-ink); border-color: transparent; }

.statusline { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 5px 10px; }
.status.off { background: #FEE2E2; color: #7F1D1D; }
.status.pending { background: var(--warn-bg); color: #713F12; }
.status.demo { background: var(--new-bg); color: var(--new-ink); }

/* scan panel */
.scanpanel { margin: 0 16px; background: var(--panel); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.scanpanel-row { display: flex; align-items: center; gap: 14px; }
.scanicon { width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.scan-title { font-family: var(--display); font-size: 30px; line-height: 1; }
.scan-sub { font-size: 14px; color: #334155; margin-top: 4px; }

.searchbox { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 0 14px; height: 56px; border: 2px solid transparent; color: var(--muted); }
.searchbox.strong { border-color: var(--accent); }
.searchbox input { border: 0; outline: 0; width: 100%; height: 100%; font-size: 17px; color: var(--ink); background: transparent; }
.searchbox:focus-within { border-color: var(--accent); }

/* chips & segmented controls */
.chips { display: flex; gap: 8px; padding: 16px 16px 4px; overflow-x: auto; scrollbar-width: none; }
.chip { flex-shrink: 0; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 15px; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; background: #E3E9F3; border-radius: 14px; padding: 4px; gap: 4px; }
.seg2 button { height: 44px; border-radius: 10px; border: 0; background: transparent; font-weight: 600; font-size: 15px; color: #334155; }
.seg2 button.on { background: #fff; color: var(--ink); font-weight: 800; box-shadow: 0 1px 2px #0001; }

/* lists */
.listhead { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px 8px; gap: 8px; }
.listhead h2, .sectionhead, .label { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sectionhead { margin-top: 8px; }
.list { list-style: none; margin: 0 16px; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.list li { display: flex; align-items: center; border-bottom: 1px solid var(--divider); }
.list li:last-child { border-bottom: 0; }
.row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 66px; border: 0; background: transparent; text-align: left; }
.row:active { background: #F1F5FB; }
.tag { flex-shrink: 0; width: 56px; height: 44px; border-radius: 10px; background: var(--light-blue); color: var(--ink); display: grid; place-items: center; font-family: var(--display); font-size: 28px; line-height: 1; }
.tag.none { background: var(--divider); color: var(--muted); font-size: 22px; }
.tag.big { width: 64px; height: 50px; font-size: 32px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.row-meta { font-size: 13px; color: var(--muted); margin-top: 3px; display: block; }
.row-date { font-family: var(--display); font-size: 28px; white-space: nowrap; line-height: 1; }
.row-x { width: 48px; height: 48px; margin-right: 6px; border: 0; background: transparent; color: var(--muted); border-radius: 10px; }
.empty { margin: 8px 16px; padding: 20px; text-align: center; background: #fff; border: 1px dashed #A9B6CC; border-radius: 18px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty p { margin: 0; line-height: 1.45; }

.cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.card-title { font-family: var(--display); font-size: 28px; line-height: 1.05; margin: 4px 0; }
.card .row-name { white-space: normal; }
.linkrow { display: flex; align-items: center; gap: 12px; }
.linkrow .row-name { white-space: normal; }

/* item screen */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn-back { display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 16px 0 10px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 15px; }
.meta { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.titlerow { display: flex; align-items: center; gap: 12px; }
.h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.02; }
.h1.lg { font-size: 40px; }
.datecard { background: #fff; border: 2px solid var(--accent); border-radius: 20px; overflow: hidden; }
.datecard-head { background: var(--light-blue); font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 10px 18px; }
.datecard-body { background: var(--yellow); text-align: center; padding: 16px 16px 20px; }
.wd { font-family: var(--display); font-size: 30px; line-height: 1; color: var(--muted); }
.bigdate { font-family: var(--display); font-size: clamp(72px, 28vw, 128px); line-height: .95; white-space: nowrap; }
.explain { font-size: 15px; color: var(--muted); margin-top: 10px; }
.seg3 { border: 0; margin: 0; padding: 0; }
.seg3 legend { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 0 8px; }
.seg3-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg3-row button { height: 52px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 15px; }
.seg3-row button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.nodate { background: var(--nodate); border: 2px solid var(--accent); border-radius: 20px; padding: 24px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink); }
.nodate svg { color: var(--accent); }
.nodate-big { font-family: var(--display); font-size: 52px; line-height: .95; }
.nodate-sub { font-size: 18px; font-weight: 800; }
.nodate p { margin: 0; font-size: 15px; line-height: 1.45; color: #334155; max-width: 320px; }
.spacer { flex: 1; min-height: 8px; }
.item-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }

/* buttons */
.btn-primary { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 64px; border: 0; border-radius: 18px; background: var(--accent); color: var(--accent-ink); font-family: var(--display); font-size: 28px; letter-spacing: .03em; white-space: nowrap; }
.btn-primary:active { filter: brightness(.92); }
.btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 15px; }
.btn-secondary.big { height: 60px; font-size: 18px; width: 100%; }
.btn-accent { flex-shrink: 0; height: 48px; padding: 0 20px; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 15px; }
.btn-link { min-height: 44px; padding: 0 10px; border: 0; background: transparent; font-weight: 700; font-size: 14px; text-decoration: underline; color: var(--ink); }
.btn-link.danger { color: var(--danger); }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.dashed { border: 1px dashed #A9B6CC; border-radius: 16px; padding: 14px; display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--muted); line-height: 1.4; }

/* groups */
.groupgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 16px; }
.groupcard { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-height: 76px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.groupcard b { font-size: 16px; }
.groupcard span { font-size: 13px; color: var(--muted); }
.groupgrid p { grid-column: 1 / -1; margin: 0 4px; }
.checkrow { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-weight: 700; font-size: 16px; text-align: left; }
.checkrow .box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid #A9B6CC; display: grid; place-items: center; color: #fff; }
.checkrow.on .box { background: var(--accent); border-color: var(--accent); }

/* forms */
.form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
.field input { height: 52px; border: 1px solid #B8C4D6; border-radius: 12px; padding: 0 14px; background: #fff; font-size: 17px; font-weight: 400; }
.error { color: var(--danger); margin: 0; font-weight: 700; }
.file { display: flex; align-items: center; justify-content: center; height: 56px; border: 2px dashed var(--accent); border-radius: 14px; color: var(--accent); font-weight: 800; margin-top: 10px; position: relative; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.progress { height: 10px; background: #E3E9F3; border-radius: 99px; overflow: hidden; margin-top: 12px; }
.progress-bar { height: 100%; background: var(--accent); transition: width .3s; }

/* review */
.h1-input { height: auto !important; font-family: var(--display); font-size: 30px !important; padding: 6px 10px !important; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; }
.tile b { display: block; font-family: var(--display); font-size: 28px; font-weight: 400; line-height: 1; }
.tile span { font-size: 12px; color: var(--muted); }
.tile.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.days-input { display: flex; align-items: center; gap: 8px; height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; color: var(--muted); font-size: 15px; flex: 1; min-width: 120px; }
.days-input input { width: 100%; border: 0; outline: 0; font-size: 17px; background: transparent; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; }
.check.top { align-items: flex-start; }
.check input { width: 24px; height: 24px; accent-color: var(--accent); flex-shrink: 0; }
details.card summary { font-weight: 800; cursor: pointer; min-height: 32px; }
.plain { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.stickybar { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0 4px; border-top: 1px solid var(--line); margin-top: 8px; }

/* bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border-top: 1px solid var(--line); padding: 4px 8px calc(8px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; z-index: 5; }
.nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; min-height: 56px; }
.nav button.on { color: var(--accent); font-weight: 800; }

/* sheet & toast */
#sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-backdrop { position: absolute; inset: 0; background: #0F1B2D66; opacity: 0; transition: opacity .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 86dvh; overflow: auto; transform: translateY(100%); transition: transform .22s ease-out; display: flex; flex-direction: column; gap: 10px; }
#sheet.open .sheet-backdrop { opacity: 1; }
#sheet.open .sheet { transform: none; }
#toast { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translate(-50%, -20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 15px; max-width: min(92vw, 520px); opacity: 0; transition: .2s; z-index: 30; pointer-events: none; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 600px) { #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
