/* 4nic.today — Look E. True black base, Blackhawks red accent, Cowboys silver for secondary text and
   borders, Cowboys royal blue for links and secondary buttons, white text, amber for money warnings.
   Type: Lora 500 for headings, DM Sans for text. Flat panels, hairline borders, 3px corners.
   Same layout every day. Nothing readable below 16px. No red for warnings. */
@font-face { font-family: "Lora"; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/lora-500-latin.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/dmsans-latin-variable.woff2) format("woff2"); }

:root {
  --bg: #000000;            /* true black */
  --panel: #0a0a0b;         /* flat panel, barely lifted */
  --panel-2: #121214;       /* inputs, pressed states */
  --line: #869397;          /* Cowboys silver: hairline borders */
  --line-soft: rgba(134, 147, 151, .38);
  --text: #ffffff;
  --muted: #869397;         /* Cowboys silver: secondary text */
  --accent: #CF0A2C;        /* Blackhawks red: main accent */
  --accent-ink: #ffffff;    /* text on red */
  --blue: #003594;          /* Cowboys royal blue: links, secondary buttons */
  --blue-2: #0a49bf;        /* royal blue, pressed / focus */
  --warn: #d9ad62;          /* money warnings: amber, never red */
  --radius: 3px;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; font-size: 100%; }
@media (max-width: 600px) { html { font-size: 125%; } }
body {
  margin: 0; min-height: 100dvh; background: var(--bg);
  color: var(--text); font-family: var(--sans); font-size: 1rem; line-height: 1.5; text-align: left;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover, a:focus-visible { text-decoration-color: var(--blue-2); }
p, li, .muted, .notice p { max-width: 70ch; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; font-style: normal; line-height: 1.25; margin: 0 0 .4em; color: var(--text); }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
em, i { font-style: normal; font-weight: 700; }
strong { font-weight: 700; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 1em; background: var(--panel-2); padding: .1em .35em; border-radius: var(--radius); }
[hidden] { display: none !important; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 4px; max-width: 640px; margin: 0 auto; }
.brand { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.brand .accent, .auth h1 .accent { color: var(--accent); font-style: normal; }
.mark { color: var(--accent); width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.nav a { color: var(--muted); text-decoration: none; margin-left: 14px; padding: 10px 4px; display: inline-block; font-size: 0.95rem; }
.nav a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--accent); }

.wrap { max-width: 640px; margin: 0 auto; padding: 8px 16px calc(100px + env(safe-area-inset-bottom)); }
.greet { font-size: 1.6rem; margin: 10px 0 20px; line-height: 1.25; }
.greet .date { display: block; font-size: 0.95rem; line-height: 1.5; font-family: var(--sans); color: var(--muted); font-weight: 400; margin-top: 2px; }
.layer { margin: 0 0 22px; }
.layer h2 { margin-bottom: 8px; padding-left: 10px; border-left: 3px solid var(--accent); line-height: 1.3; }
.muted { color: var(--muted); }
.small { font-size: 0.95rem; }
.warn { color: var(--warn); }

/* flat panels, hairline borders, 3px corners */
.panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; }
.panel p { margin: .35em 0; }
.panel.placeholder p:first-child { margin-top: 0; }
.panel.placeholder p:last-child { margin-bottom: 0; }
.notice p { margin: .4em 0; }

/* buttons + forms: big, thumb-friendly, flat */
.btn { display: inline-block; min-height: 48px; padding: 11px 18px; border-radius: var(--radius); border: 1px solid var(--line-soft); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 700; text-decoration: none; text-align: center; cursor: pointer; line-height: 1.3; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.secondary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.secondary:hover, .btn.secondary:focus-visible { background: var(--blue-2); border-color: var(--blue-2); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.wide { width: 100%; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 2px; }
.btn:active { transform: translateY(1px); }
.form label { display: block; margin: 0 0 12px; color: var(--muted); font-size: 0.95rem; }
.form input:not([type="checkbox"]), .form select, .form textarea { display: block; width: 100%; margin-top: 4px; min-height: 48px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.row { display: flex; gap: 10px; margin-top: 6px; }
.row .btn { flex: 1; }
.auth { max-width: 440px; margin: 6vh auto 0; }
.auth h1 { text-align: center; margin-bottom: 16px; }
.auth h2 { margin-top: 4px; }
.soft-error { background: var(--panel-2); border-left: 3px solid var(--warn); padding: 10px 12px; border-radius: var(--radius); color: var(--text); margin: 0 0 12px; }
.install.on-login { max-width: 440px; margin: 1rem auto 0; }

/* quick add: fixed in the bottom corner, same place every day */
.fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 60px; height: 60px; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-size: 32px; line-height: 56px; text-align: center; text-decoration: none; font-weight: 400; z-index: 5; }
.fab:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 2px; }
.fab:active { transform: translateY(1px); }

/* ---- calendar (step 2): grouped per calendar, each with its color stripe ---- */
.calm { color: var(--muted); margin: 4px 0 8px; }
.toast { background: var(--panel-2); border-left: 3px solid var(--blue-2); padding: 10px 12px; border-radius: var(--radius); margin: 0 0 14px; }
.cal-group { margin: 0 0 14px; }
.cal-head { font-family: var(--sans); font-weight: 700; font-size: 0.9rem; color: var(--muted); text-transform: none; letter-spacing: .01em; margin: 0 0 6px; padding-left: 10px; border-left: 3px solid var(--stripe, var(--line)); }
.event { display: flex; gap: 14px; align-items: flex-start; color: var(--text); text-decoration: none; border-left: 4px solid var(--stripe, var(--line)); padding-left: 12px; }
a.event:hover, a.event:focus-visible { background: var(--panel-2); }
.event .when { flex: 0 0 64px; display: flex; flex-direction: column; }
.event .time { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; line-height: 1.1; white-space: nowrap; }
.event .time small { font-size: 0.7rem; margin-left: 2px; font-family: var(--sans); color: var(--muted); }
.event .time.anyt { font-size: 1.05rem; }
.event .day { font-size: 0.8rem; color: var(--muted); }
.event .what { flex: 1; min-width: 0; }
.event .what h3 { margin: 0 0 2px; font-size: 1.1rem; line-height: 1.3; overflow-wrap: anywhere; }
.event .what p { margin: 2px 0 0; }
.event .where { color: var(--muted); font-size: 0.95rem; }
.tomorrow-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: .08em; }
.tomorrow-divider::before, .tomorrow-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line-soft); }

/* settings: calendars */
.feed { border-left: 4px solid var(--stripe, var(--line)); padding: 4px 0 4px 12px; margin: 14px 0 18px; }
.feed .form label { margin-bottom: 8px; }
.feed form + form { margin-top: 8px; }
.colors { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.colors legend { color: var(--muted); font-size: 0.95rem; margin-bottom: 6px; }
.swatch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px 6px 8px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel-2); cursor: pointer; font-size: 0.95rem; }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--stripe); border: 1px solid rgba(255,255,255,.25); }
.swatch:has(input:checked) { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.swatch:has(input:focus-visible) { outline: 3px solid var(--blue-2); outline-offset: 2px; }
details summary { cursor: pointer; color: var(--text); font-weight: 700; min-height: 44px; display: flex; align-items: center; }
details .form { margin-top: 10px; }
