:root {
  --paper: #F4F1EA;
  --paper-2: #EAE5D9;
  --card: #FFFFFF;
  --ink: #1C1B18;
  --ink-2: #5A554B;
  --line: #D8D2C4;
  --orange: #E5561F;
  --orange-dk: #C4431180;
  --steel: #37505C;
  --ok: #2E7D48;
  --warn: #B7791F;
  --bad: #B03A2E;
  --display: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, sans-serif;
  --shadow: 0 1px 0 var(--line), 0 6px 20px rgba(28,27,24,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body);
  color: var(--ink);
  background:
    linear-gradient(var(--paper), var(--paper)),
    repeating-linear-gradient(90deg, transparent, transparent 39px, #00000008 39px, #00000008 40px);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font-family: var(--body); cursor: pointer; }
input, textarea, select { font-family: var(--body); }

/* ---------- Layout shells ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 96px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--paper);
  padding: 12px 16px; border-bottom: 3px solid var(--orange);
}
.topbar .brand { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .04em; text-transform: uppercase; }
.topbar .brand b { color: var(--orange); }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: #C9C3B4; text-align: right; line-height: 1.2; }
.topbar .who b { color: var(--paper); display: block; font-weight: 600; }
.linkbtn { background: none; border: 1px solid #ffffff33; color: var(--paper); border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.linkbtn:hover { border-color: var(--orange); }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .01em; margin: 0; }
.eyebrow { font-family: var(--display); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--orange); font-weight: 600; }
.muted { color: var(--ink-2); }
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.section-title h2 { font-size: 20px; text-transform: uppercase; letter-spacing: .05em; }
.section-title::after { content: ""; flex: 1; height: 2px; background: var(--line); }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pad { padding: 16px; }
.stack { display: grid; gap: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  font-size: 16px; border: none; border-radius: 8px; padding: 14px 18px; min-height: 52px;
  background: var(--ink); color: var(--paper); width: 100%;
  transition: transform .06s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--orange); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn.steel { background: var(--steel); color: #fff; }
.btn.sm { min-height: 40px; padding: 8px 12px; font-size: 13px; width: auto; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { width: auto; flex: 1; min-width: 130px; }

/* big capture buttons */
.capture-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.capture-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 128px; border: 2px solid var(--ink); border-radius: 10px; background: var(--card);
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 17px;
}
.capture-btn .ic { font-size: 40px; line-height: 1; }
.capture-btn.rec { border-color: var(--orange); color: var(--orange); }
.capture-btn:active { transform: translateY(1px); }
.capture-btn.full { grid-column: 1 / -1; min-height: 64px; flex-direction: row; }
.capture-btn.recording { background: var(--orange); color: #fff; border-color: var(--orange); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.15); } }
@media (prefers-reduced-motion: reduce) { .capture-btn.recording { animation: none; } }

/* ---------- Inputs ---------- */
.field { display: grid; gap: 6px; }
.field label { font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.input, textarea, select {
  border: 2px solid var(--line); border-radius: 8px; padding: 13px 14px; font-size: 16px; background: #fff; color: var(--ink); width: 100%;
}
.input:focus, textarea:focus, select:focus { outline: none; border-color: var(--orange); }
textarea { resize: vertical; min-height: 84px; }

/* ---------- Pills / status ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; padding: 3px 9px; border-radius: 999px; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ready { color: var(--ok); background: #2E7D4815; }
.pill.processing { color: var(--warn); background: #B7791F15; }
.pill.failed { color: var(--bad); background: #B03A2E15; }
.pill.synced { color: var(--steel); background: #37505C15; }
.pill.draft { color: var(--warn); background: #B7791F15; }
.pill.released { color: var(--ok); background: #2E7D4815; }
.badge-blur { color: var(--steel); font-size: 11px; font-weight: 600; }

/* ---------- Entry / list items ---------- */
.entry { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: none; }
.entry .thumb { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; background: var(--paper-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 24px; color: var(--ink-2); }
.entry .body { min-width: 0; }
.entry .body .k { font-family: var(--display); font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; color: var(--ink-2); }
.entry .body .t { font-size: 14.5px; line-height: 1.35; }
.entry .time { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.site-item { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); background: none; border-left: none; border-right: none; border-top: none; width: 100%; text-align: left; }
.site-item:last-child { border-bottom: none; }
.site-item:hover { background: var(--paper-2); }
.site-item .marker { width: 10px; height: 34px; background: var(--orange); border-radius: 2px; flex: none; }
.site-item .name { font-family: var(--display); font-weight: 600; font-size: 17px; }
.site-item .addr { font-size: 13px; color: var(--ink-2); }
.site-item .chev { margin-left: auto; color: var(--ink-2); font-size: 20px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .box { width: 100%; max-width: 380px; }
.login .logo { font-family: var(--display); font-weight: 700; font-size: 44px; text-transform: uppercase; letter-spacing: .03em; text-align: center; }
.login .logo b { color: var(--orange); }
.login .tag { text-align: center; color: var(--ink-2); margin: 4px 0 26px; }
.quick { display: flex; gap: 8px; margin-top: 12px; }
.quick button { flex: 1; }
.demo-note { margin-top: 16px; font-size: 12px; color: var(--ink-2); text-align: center; border-top: 1px dashed var(--line); padding-top: 12px; }
.code-shown { font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: .3em; color: var(--orange); text-align: center; }

/* ---------- Report ---------- */
.report h2 { font-size: 24px; }
.report .no { font-family: var(--display); color: var(--orange); font-weight: 700; }
.report .weather { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.report .sec { margin-top: 14px; }
.report .sec h3 { font-size: 16px; text-transform: uppercase; letter-spacing: .04em; }
.report .sec p { margin: 4px 0 0; line-height: 1.5; }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--ink-2); padding: 36px 16px; }
.empty .ic { font-size: 34px; }
.spinner { width: 18px; height: 18px; border: 3px solid #ffffff55; border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { display: grid; place-items: center; padding: 40px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; transition: all .2s ease; background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 8px; font-weight: 500; z-index: 100; max-width: 90vw; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--bad); }
#toast.ok { background: var(--ok); }

.hint { font-size: 12.5px; color: var(--ink-2); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
