/* Gutter IQ van livery: deep teal with halftone dots, heavy italic white type, gold accents, a white/gold swoosh. One look for every seat. */
:root {
  --teal: #00555D;
  --teal-deep: #003E45;
  --teal-ink: #062B30;
  --gold: #F0C000;
  --gold-soft: #FFF6D1;
  --white: #FFFFFF;
  --bg: #F3F5F5;
  --fg: #0B2529;
  --muted: #5E6E71;
  --line: #E1E7E8;
  --input: #F6F8F8;
  --ok: #1D7A4E; --ok-soft: #E2F3E9;
  --warn: #8C6400; --warn-soft: #FFF3CC;
  --bad: #B23A30; --bad-soft: #FBE4E1;
  --dots: radial-gradient(rgba(255,255,255,.075) 1.1px, transparent 1.6px);
  --font-head: "Montserrat", "Arial Black", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(6,43,48,.06), 0 6px 18px rgba(6,43,48,.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 16px; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: var(--fg); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.iq { color: var(--gold); }

/* Shared livery surface */
.livery { background-color: var(--teal); background-image: var(--dots), linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%); background-size: 9px 9px, 100% 100%; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background-color: var(--teal); background-image: var(--dots), linear-gradient(160deg, var(--teal), var(--teal-ink)); background-size: 9px 9px, 100% 100%; }
.login-card { width: 100%; max-width: 380px; background: var(--white); border-radius: 22px; padding: 28px 22px 24px; display: grid; gap: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.25); position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--gold); }
.login-logo { width: 84px; height: 84px; border-radius: 20px; }
.login h1 { font-family: var(--font-head); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.5rem; letter-spacing: -.01em; margin: 8px 0 0; color: var(--teal); }
.login form { display: grid; gap: 6px; margin-top: 12px; }
.login label { font-size: .88rem; color: var(--muted); margin-top: 6px; }
.login input { padding: 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--input); }
.btn-primary { margin-top: 14px; padding: 14px; border-radius: 12px; border: 0; background: var(--gold); color: var(--teal-ink); font-family: var(--font-head); font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .03em; }
.error { color: var(--bad); font-size: .92rem; margin: 6px 0 0; }

/* Header */
#app { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 100px); }
.top { position: relative; overflow: hidden; color: var(--white); padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background-color: var(--teal); background-image: var(--dots), linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%); background-size: 9px 9px, 100% 100%; }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--gold) 0 72%, var(--white) 72% 76%, var(--gold) 76%); }
.brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.brand-logo { width: 50px; height: 50px; border-radius: 14px; background: var(--white); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.brand-name { font-family: var(--font-head); font-weight: 900; font-style: italic; font-size: 1.45rem; text-transform: uppercase; letter-spacing: -.01em; line-height: 1; }
.brand-sub { margin-top: 4px; font-family: var(--font-head); font-weight: 800; font-style: italic; font-size: .66rem; text-transform: uppercase; letter-spacing: .18em; color: var(--gold); }
.save-state { position: relative; z-index: 1; font-size: .82rem; color: rgba(255,255,255,.8); text-align: right; max-width: 45%; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.period { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 12px; }
.period-label { text-align: center; }
#period-title { font-family: var(--font-head); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.15rem; letter-spacing: -.005em; color: var(--teal-ink); }
#period-sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); color: var(--teal); font-size: 1.5rem; line-height: 1; box-shadow: var(--shadow); }

/* Seat picker: one consistent style */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.period[hidden] + #main .chips { padding-top: 18px; }
.chip { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px; font-family: var(--font-head); font-weight: 800; font-style: italic; font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; background: var(--white); color: var(--teal); box-shadow: 0 1px 2px rgba(6,43,48,.05); }
.chip.on { background: var(--teal); border-color: var(--teal); color: var(--gold); }

/* Seat banner: same livery for every seat */
.seat { margin-bottom: 28px; }
.banner { position: relative; overflow: hidden; color: var(--white); border-radius: 20px; padding: 16px 18px 16px; margin-bottom: 12px; box-shadow: var(--shadow);
  background-color: var(--teal); background-image: var(--dots), linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%); background-size: 9px 9px, 100% 100%; }
.banner > * { position: relative; z-index: 1; }
.banner-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.eyebrow { font-family: var(--font-head); font-weight: 800; font-style: italic; font-size: .64rem; text-transform: uppercase; letter-spacing: .2em; color: rgba(255,255,255,.7); }
.count { font-family: var(--font-head); font-weight: 800; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.14); color: var(--white); }
.count:empty { display: none; }
.seat-name { font-family: var(--font-head); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.5rem; line-height: 1.05; letter-spacing: -.01em; margin: 6px 0 10px; text-wrap: balance; }
.who { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .9rem; }
.who span { color: rgba(255,255,255,.8); }
.who input { flex: 1; max-width: 62%; padding: 9px 12px; border-radius: 10px; border: 0; background: rgba(255,255,255,.96); color: var(--teal-ink); text-align: right; font-weight: 600; }
.who input:disabled { opacity: .85; }

/* Measure cards */
.card { background: var(--white); border-radius: 16px; padding: 15px; margin-bottom: 10px; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(6,43,48,.04); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card h3 { margin: 0; font-family: var(--font-head); font-size: .98rem; font-weight: 800; color: var(--teal-ink); }
.card .hint { color: var(--muted); font-size: .9rem; margin: 4px 0 0; line-height: 1.35; }
.pill { flex: none; font-family: var(--font-head); font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; padding: 5px 9px; border-radius: 999px; background: var(--input); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; padding-top: 12px; border-top: 1px dashed var(--line); }
.goal { font-size: .88rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.goal b { color: var(--teal-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.num-wrap { display: flex; align-items: center; gap: 6px; }
.unit { color: var(--muted); font-size: .88rem; min-width: 2.2em; }
input.num { width: 6.5em; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--input); text-align: right; font-size: 1.05rem; font-weight: 700; color: var(--teal-ink); font-variant-numeric: tabular-nums; }
input.goal-in { width: 5em; padding: 6px 8px; font-size: .92rem; font-weight: 600; }
input.num:disabled { opacity: .75; }
textarea.note { width: 100%; min-height: 100px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--input); resize: vertical; }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }
.empty.small { padding: 4px 2px 12px; text-align: left; }

.info { background: var(--white); border-radius: 16px; padding: 16px; margin: 18px 0 12px; line-height: 1.5; border: 1px solid var(--line); }
.info h2 { font-family: var(--font-head); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1rem; color: var(--teal); margin: 0 0 6px; }
.btn-ghost { padding: 11px 16px; border-radius: 12px; border: 1px solid var(--teal); background: var(--white); color: var(--teal); font-weight: 700; }

/* Playbook */
.vwrap { margin-top: 12px; }
.vwrap video { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; display: block; }
.btn-play { width: 100%; padding: 13px; border: 0; border-radius: 12px; background: var(--teal); color: var(--white); font-family: var(--font-head); font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .04em; font-size: .82rem; }
.steps { margin: 12px 0 0; padding-left: 1.3em; line-height: 1.45; }
.steps li { margin-bottom: 4px; }
.steps li::marker { color: var(--teal); font-weight: 700; }
.btn-del { margin-top: 10px; border: 0; background: none; color: var(--bad); font-weight: 700; font-size: .85rem; padding: 4px 0; }
.btn-add { width: 100%; padding: 13px; border: 1.5px dashed var(--teal); border-radius: 14px; background: transparent; color: var(--teal); font-family: var(--font-head); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: .78rem; letter-spacing: .03em; }
.add-form { display: grid; gap: 10px; }
.fld { display: grid; gap: 4px; font-size: .88rem; color: var(--muted); }
.fld input, .fld textarea { padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--input); color: var(--fg); }
.form-row { display: flex; gap: 10px; }
.form-row .btn-primary { margin-top: 0; flex: 1; }
.form-msg { margin: 0; font-size: .9rem; color: var(--teal); font-weight: 600; }

/* Bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: 8px 8px calc(env(safe-area-inset-bottom, 0px) + 8px); background: var(--teal-ink); box-shadow: 0 -6px 20px rgba(6,43,48,.18); }
.tabs button { position: relative; border: 0; background: none; display: grid; justify-items: center; gap: 3px; padding: 8px 0 6px; font-family: var(--font-head); font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.tabs .ti { font-size: 1.1rem; line-height: 1; }
.tabs button.active { color: var(--gold); }
.tabs button.active::before { content: ""; position: absolute; top: -8px; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Month in review */
.summary { padding-bottom: 6px; }
.sum-head h3 { font-family: var(--font-head); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: .9rem; color: var(--teal); }
.sum-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px dashed var(--line); }
.sum-row:first-of-type { margin-top: 10px; }
.sum-label { min-width: 0; display: grid; gap: 2px; }
.sum-label b { font-weight: 700; color: var(--teal-ink); font-size: .95rem; }
.sum-label span { color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.sum-hits { font-family: var(--font-head); font-weight: 800; font-size: .72rem; color: var(--teal); white-space: nowrap; }

.glance { margin-bottom: 22px; }
.glance-row { width: 100%; background: none; border: 0; border-top: 1px dashed var(--line); grid-template-columns: minmax(0, 1fr) auto; text-align: left; color: inherit; }
.dots { display: flex; gap: 5px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.dot.ok { background: var(--ok); } .dot.warn { background: #E0A800; } .dot.bad { background: var(--bad); }

.pb-img { width: 100%; max-height: 60vh; object-fit: cover; border-radius: 12px; display: block; background: var(--input); }
.btn-link { display: block; text-align: center; margin-top: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--teal); color: var(--teal); text-decoration: none; font-family: var(--font-head); font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: .03em; font-size: .78rem; }
.pb-notes { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--input); color: var(--fg); line-height: 1.45; white-space: pre-wrap; }

.pb-actions { display: flex; gap: 18px; align-items: center; margin-top: 10px; }
.pb-actions .btn-del { margin-top: 0; }
.btn-edit { border: 0; background: none; color: var(--teal); font-weight: 700; font-size: .85rem; padding: 4px 0; }
.fld select { padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--input); color: var(--fg); font: inherit; }
.chk { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--fg); }

.role-purpose { margin: 10px 0 0; font-size: 1.02rem; line-height: 1.45; color: var(--teal-ink); font-weight: 600; }
.role-label { margin: 16px 0 6px; font-family: var(--font-head); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: .7rem; letter-spacing: .1em; color: var(--teal); }
.role-list { margin: 0; padding-left: 1.2em; line-height: 1.5; }
.role-list li { margin-bottom: 4px; }
.role-list li::marker { color: var(--teal); }
.role-measures { margin: 0; color: var(--fg); line-height: 1.5; }
.tabs button { font-size: .54rem; letter-spacing: .05em; }

.who input.carried { color: var(--muted); font-style: italic; }
.info .btn-primary { width: 100%; }
.info .form-msg { margin-top: 8px; }
