/* Parth's design direction (light only): warm paper and ink, cobalt and tangerine, Bricolage Grotesque for words and
   Barlow Condensed for numbers, flat opaque cards, glass only on the floating bars. */
:root {
  --bg: #f4f1ea; --surface: #fffdf9; --sunk: #f0ebe1; --ink: #14172b; --ink2: #33384f; --muted: #575b6f;
  --line: rgba(20, 23, 43, .09); --line2: rgba(20, 23, 43, .18);
  --cobalt: #2442e8; --tang: #ff6a2b; --tang-mark: #d9531a; --red: #b8231a; --green: #147a40; --amber: #8a4f00;
  --ui: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --num: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 400 .9rem/1.4 var(--ui);
  background-image: radial-gradient(rgba(20, 23, 43, .035) 1px, transparent 1px); background-size: 3px 3px;
}
button { font: inherit; color: inherit; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: 10px; z-index: 9; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2.5px solid var(--cobalt); outline-offset: 2px; }
h1:focus { outline: none; }

/* top bar: glass, solid once scrolled */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px 16px;
  background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: background .2s, box-shadow .2s;
}
.top.solid { background: var(--bg); box-shadow: 0 .5px 0 var(--line2); }
.logo { font-weight: 800; font-size: .95rem; letter-spacing: -.01em; }
.fresh { border: 0; background: none; color: var(--muted); font-size: 12.5px; min-height: 44px; padding: 0 8px; }
.fresh.late { color: var(--amber); } .fresh.bad { color: var(--red); }
.icon { width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; padding: 0; }
.icon span { width: 28px; height: 28px; border-radius: 50%; background: var(--sunk); display: grid; place-items: center; font: italic 700 14px Georgia, serif; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main { max-width: 560px; margin: 0 auto; padding: 4px 16px calc(100px + env(safe-area-inset-bottom)); }

/* cards: flat, a hairline and a small drop, so they sit on the page */
.card { position: relative; background: var(--surface); border-radius: 16px; border: .5px solid var(--line2); box-shadow: 0 1px 0 rgba(20, 23, 43, .06); padding: 14px 16px; margin-bottom: 10px; }
.label { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 4px; }
h1 { font-size: 1.88rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; margin: 0; }
h2 { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 6px; }
.hero { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.hero .num { font-size: 64px; font-weight: 700; line-height: 1; }
.hero .num small { font-size: 30px; font-weight: 600; margin-right: 4px; }
.hero .side { color: var(--ink2); font-size: .9rem; }
.sticker {
  position: absolute; right: 14px; top: 12px; background: var(--tang); color: var(--ink); font: 700 12.5px var(--ui);
  padding: 4px 10px; border-radius: 999px; transform: rotate(-4deg); box-shadow: 0 0 0 2.5px var(--surface), 0 2px 6px rgba(20, 23, 43, .18);
}
.sticker.calm { background: #dff2e6; }

/* the day as a strip */
.strip { position: relative; height: 46px; border-radius: 10px; background: var(--sunk); margin: 12px 0 4px; overflow: hidden; }
.strip.thin { height: 18px; border-radius: 6px; margin: 0; }
.strip i { position: absolute; top: 0; bottom: 0; border-radius: 2px; min-width: 2px; }
.ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--ink2); margin: 10px 0 0; padding: 0; list-style: none; }
.legend li::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--c); margin-right: 5px; }

/* one-line rows */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li, .rows summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; border-top: .5px solid var(--line); }
.rows li:first-child { border-top: 0; }
.rows li > span:last-child, .rows summary > span:last-child { color: var(--ink2); text-align: right; }
.rows .num { font-size: 1.05rem; }
.chip { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--c); margin-right: 10px; vertical-align: -1px; }
details > summary { list-style: none; cursor: pointer; border-top: .5px solid var(--line); color: var(--muted); display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary span:last-child { transform: rotate(90deg); }

/* week: seven strips */
.week { display: grid; grid-template-columns: 48px 1fr 64px; align-items: center; gap: 8px 10px; margin-top: 10px; }
.week .d { font-size: .78rem; color: var(--ink2); font-weight: 600; }
.week .h { font-size: 1rem; text-align: right; color: var(--ink2); }

/* month: a calendar of hours */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 8px; }
.cal .w { font-size: 12px; color: var(--muted); text-align: center; font-weight: 600; }
.cal .c { aspect-ratio: 1; border-radius: 8px; display: flex !important; flex-direction: column; justify-content: center; line-height: 1.1; background: var(--sunk); display: grid; place-items: center; font-size: 12px; color: var(--ink2); }
.cal .c.on { color: #fff; font-weight: 600; }
.cal .c b { font-weight: 600; }
.cal .c small { font: 600 12px var(--num); opacity: .9; }
.cal .c.pale { color: var(--ink); }
.cal .c.off { background: repeating-linear-gradient(135deg, var(--sunk) 0 4px, #e2dccf 4px 6px); color: var(--muted); }
.card.warn { border-color: rgba(138, 79, 0, .35); background: #fff8ee; }
.card.warn p { margin: 6px 0 0; color: var(--ink2); }
.cal .c.none { background: transparent; }

/* speed bars */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; margin-top: 10px; }
.bars div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.barDays { display: flex; gap: 3px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.barDays span { flex: 1; text-align: center; overflow: visible; white-space: nowrap; }
.bars i { display: block; width: 100%; border-radius: 3px 3px 0 0; background: var(--cobalt); min-height: 2px; }
.bars i.slow { background: var(--tang-mark); }
.bars i.slow::after { content: "!"; display: block; text-align: center; color: #fff; font: 700 10px var(--ui); }
.key { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

.dayNav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 10px; }
.dayNav button { min-width: 44px; min-height: 44px; border-radius: 12px; border: .5px solid var(--line2); background: var(--surface); display: grid; place-items: center; padding: 0; }
.dayNav button:disabled { opacity: .35; }
.dayNav span { color: var(--muted); font-size: .78rem; }

/* floating tab bar with the sliding sticker pill */
.tabs {
  position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); max-width: 536px; margin: 0 auto; z-index: 5;
  height: 60px; border-radius: 22px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 0 4px;
  background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: .5px solid var(--line2); box-shadow: 0 8px 24px rgba(20, 23, 43, .12);
}
.tabs[hidden] { display: none; }
.tabs button { border: 0; background: none; min-height: 44px; font-weight: 600; font-size: .78rem; color: var(--muted); border-radius: 999px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.tabs button[aria-current="page"] { background: var(--cobalt); color: #fff; transform: rotate(-3deg); box-shadow: 0 0 0 2.5px var(--surface); margin: 0 2px; }
.tabs button:active { transform: scale(.94); }

/* sign in, empty, failure, loading */
.signin { margin-top: 18vh; }
.signin input { width: 100%; font: inherit; font-size: 1rem; padding: 12px 14px; min-height: 48px; border-radius: 12px; border: .5px solid var(--line2); background: var(--surface); color: var(--ink); margin: 14px 0 10px; }
.primary { width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: var(--cobalt); color: #fff; font-weight: 700; }
.note { color: var(--muted); font-size: .78rem; margin: 8px 0 0; }
.note.bad { color: var(--red); }
.skeleton { background: var(--sunk); border-radius: 10px; height: 18px; margin: 8px 0; }
dialog { border: 0; border-radius: 20px 20px 0 0; margin: auto 0 0; max-width: 100%; width: 100%; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(20, 23, 43, .35); }
dialog h2 { font-size: 1.18rem; text-transform: none; letter-spacing: -.01em; color: var(--ink); font-weight: 800; }
dialog p { color: var(--ink2); }
/* insights */
.seg { display: flex; background: var(--sunk); border-radius: 12px; padding: 3px; margin: 2px 0 10px; }
.seg button { flex: 1; border: 0; background: none; min-height: 44px; font-size: .78rem; font-weight: 600; color: var(--muted); border-radius: 9px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 23, 43, .12); }
.share { height: 10px; border-radius: 5px; background: var(--sunk); overflow: hidden; display: flex; margin-top: 8px; }
.share i { display: block; height: 100%; }
.heat { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; margin-top: 8px; }
.heat i { aspect-ratio: .55; border-radius: 3px; background: rgba(36, 66, 232, max(.06, var(--a))); }
.wk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 70px; margin-top: 12px; }
.wk i { display: block; border-radius: 4px 4px 0 0; background: var(--cobalt); min-height: 2px; }
.wk i.best { background: var(--tang-mark); }
.wkl { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; font-size: 12px; color: var(--muted); text-align: center; margin-top: 3px; }
.ink { color: var(--ink); }
.up { color: var(--green); } .down { color: var(--red); }
.exampleBar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--tang); color: var(--ink); font-weight: 700; font-size: .78rem; border-radius: 12px; padding: 4px 4px 4px 12px; margin: 0 0 10px; }
.exampleBar button { min-height: 40px; border: 0; border-radius: 9px; background: var(--surface); font-weight: 700; padding: 0 12px; }
.secondary { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; border-radius: 12px; border: .5px solid var(--line2); background: var(--sunk); color: var(--ink); font-weight: 700; text-decoration: none; margin: 8px 0 0; }
dialog h3 { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 18px 0 6px; }
dialog label { display: block; font-size: .78rem; color: var(--ink2); margin: 8px 0 0; }
dialog input { display: block; width: 100%; font: inherit; font-size: 1rem; padding: 10px 12px; min-height: 46px; border-radius: 12px; border: .5px solid var(--line2); background: var(--bg); color: var(--ink); margin-top: 4px; }
dialog { max-height: 88vh; overflow: auto; }
dialog form[method="dialog"] { margin-top: 14px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); max-width: 528px; margin: 0 auto; z-index: 9; background: var(--ink); color: var(--surface); padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.toast[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } .tabs button[aria-current="page"], .sticker { transform: none; } }
