:root {
  color-scheme: light;
  --red: #861722;
  --accent: #b62a32;
  --ink: #17191b;
  --paper: #f7f6f4;
  --card: #ffffff;
  --copper: #8a5a32;
  --ok: #1f6b3a;
  --warn: #8a5a00;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 22px; }

body {
  margin: 0 auto;
  max-width: 720px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 22px;
  line-height: 1.4;
  padding: 0 12px 180px;
}

h1 { font-size: 36px; line-height: 1.15; margin: 8px 0; }
h2 { font-size: 32px; line-height: 1.2; margin: 20px 0 8px; }
h3 { font-size: 28px; line-height: 1.25; margin: 16px 0 8px; }
p, li, label, a, button, input, select, textarea { font-size: 22px; }
p { margin: 8px 0; }

a { color: var(--red); font-weight: 700; }
a:hover { color: var(--accent); }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  z-index: 80;
}
.skip:focus { left: 8px; }

.top {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--paper);
  border-bottom: 4px solid var(--red);
  padding: 8px 0 10px;
}
.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 32px;
  font-weight: 800;
}
.save-chip { margin: 4px 0; }
.top-actions { display: flex; flex-direction: column; gap: 4px; }
.top button { margin: 0; min-height: 56px; }

button, .btn, .capture-hero {
  display: block;
  width: 100%;
  min-height: 64px;
  margin: 8px 0;
  padding: 12px 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}
.btn.primary, button.primary { background: var(--red); color: #fff; border-color: var(--red); }
.capture-hero {
  min-height: 104px;
  font-size: 36px;
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
button:disabled { opacity: 0.45; }

input, select, textarea {
  display: block;
  width: 100%;
  min-height: 64px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
textarea { min-height: 140px; }
label { display: block; font-weight: 700; margin-top: 12px; }

.card, .entry, .panel, .warn-box, .paper {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 12px;
  margin: 12px 0;
}
.link-card { display: block; color: var(--ink); text-decoration: none; }
.entry.ai, .tag.demo { border-color: var(--copper); }
.kicker { font-weight: 800; color: var(--red); margin-bottom: 0; }
.muted { color: var(--ink); }
.warn, .warn-box { background: #fff6e8; }
.live {
  margin: 8px 0;
  padding: 8px 0;
  font-weight: 800;
}
.live.bad { color: var(--red); }
.live.warn { color: var(--warn); }
.live.ok { color: var(--ok); }

.tag {
  display: inline-block;
  margin: 4px 6px 4px 0;
  padding: 4px 8px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
}
.tag.demo { background: var(--copper); color: #fff; }
.tag.ok { background: var(--ok); color: #fff; }
.who { font-weight: 800; margin-bottom: 4px; }

.media img, .media video, .preview img, .preview video, video, img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}
.line { border-top: 3px solid var(--ink); margin-top: 12px; padding-top: 8px; }

.fab {
  position: fixed;
  right: 12px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 25;
  width: auto;
  min-width: 148px;
  min-height: 72px;
  margin: 0;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 6px 0 var(--ink);
  font-size: 28px;
  font-weight: 800;
}
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  background: var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1 1 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  text-decoration: none;
  font-weight: 800;
}
.tabbar a[aria-current="page"] { background: var(--red); }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: auto;
  background: var(--paper);
  padding: 12px 12px 32px;
}
.sheet[hidden] { display: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

:focus-visible { outline: 4px solid var(--copper); outline-offset: 3px; }

body.preview { padding-bottom: 24px; }
body.preview .top,
body.preview .tabbar,
body.preview .fab { display: none; }

@media print {
  .noprint, .top, .tabbar, .fab, #live, #sheet { display: none !important; }
  body { max-width: none; padding: 0; background: #fff; }
  a { color: #000; }
}
