:root {
  --bg: #f6f4f1;
  --card: #ffffff;
  --ink: #1c1917;
  --muted: #6b645d;
  --line: #e7e2dc;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fdeee6;
  --ok: #15803d;
  --ok-soft: #e6f4ea;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fde8e8;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141210;
    --card: #1f1c19;
    --ink: #f3efe9;
    --muted: #a8a097;
    --line: #34302b;
    --accent: #f97316;
    --accent-ink: #1c1206;
    --accent-soft: #3a2314;
    --ok: #4ade80;
    --ok-soft: #13301d;
    --warn: #fbbf24;
    --warn-soft: #3a2c0b;
    --bad: #f87171;
    --bad-soft: #3b1515;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
a { color: var(--accent); }
h1 { font-size: 24px; margin: 4px 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 8px; }
h3 { font-size: 17px; margin: 0 0 4px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand span { color: var(--accent); }
.bell { position: relative; color: var(--ink); padding: 6px; }
.bell b, .dot {
  position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  font: 700 11px/18px sans-serif; text-align: center;
}
.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 4px; right: 22%; }

main { max-width: 640px; margin: 0 auto; padding: 14px 16px 24px; }

.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 7px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
}
.tabs svg { width: 24px; height: 24px; fill: currentColor; }
.tabs a.on { color: var(--accent); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px;
}
.card.accent { border-color: var(--accent); background: var(--accent-soft); }
.card.warn { border-color: var(--warn); background: var(--warn-soft); }
a.card { display: block; color: inherit; text-decoration: none; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.list > * { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }
.list button.item, .list a.item {
  all: unset; box-sizing: border-box; display: flex; width: 100%; align-items: center; gap: 10px; cursor: pointer;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.list > button.item:last-child, .list > a.item:last-child { border-bottom: 0; }

.time { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--line); color: var(--ink); white-space: nowrap;
}
.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); }
.pill.accent { background: var(--accent); color: var(--accent-ink); }

.open-shift .who { color: var(--bad); font-weight: 700; }

button, .btn {
  font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 12px 16px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; display: inline-block; text-align: center;
}
button.ghost, .btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button.danger { background: var(--bad); color: #fff; }
button.small { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
button.block { display: block; width: 100%; }
button:disabled { opacity: .5; cursor: default; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; }

label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=tel], input:not([type]), select, textarea {
  width: 100%; font: inherit; font-size: 17px; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
textarea { min-height: 70px; }
.check { display: flex; gap: 12px; align-items: center; font-weight: 500; margin: 0; padding: 12px 14px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { margin: 0; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span {
  display: inline-block; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-weight: 600; font-size: 14px;
}
.chips input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: flex; background: var(--line); border-radius: 11px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; background: transparent; color: var(--ink); padding: 8px; font-size: 14px; border-radius: 9px; }
.seg button.on { background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.weeknav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.weeknav button { padding: 8px 14px; }

.citem { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; }
.citem .box {
  flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line);
  display: grid; place-items: center; font-weight: 900; color: transparent;
}
.citem.done .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.citem .text { flex: 1; }
.citem.done .text { color: var(--muted); }
.citem img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.role { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--accent); }
.progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 8px 0 2px; }
.progress i { display: block; height: 100%; background: var(--ok); }

.sheet {
  position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet > div {
  background: var(--bg); width: 100%; max-width: 640px; max-height: 88vh; overflow: auto;
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 30;
  bottom: calc(84px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600;
}
.toast.error { background: var(--bad); color: #fff; }

.login { max-width: 380px; margin: 8vh auto 0; }
.login .logo { font-size: 30px; font-weight: 900; letter-spacing: -0.03em; margin-bottom: 4px; }
.login .logo span { color: var(--accent); }
.pin { letter-spacing: .4em; text-align: center; font-size: 24px !important; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { font-size: 26px; font-weight: 800; }
img.full { width: 100%; border-radius: 12px; }

/* After .list .item's reset, so the stripe isn't wiped. */
.list .item.me, .list > .me { box-shadow: inset 4px 0 0 var(--accent); }
details.card summary { cursor: pointer; }
.daytools { display: flex; gap: 6px; }
.daytools button { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
h2.withtools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
