:root {
  --bg: #f6f6f3; --card: #ffffff; --text: #1b1b1a; --muted: #6b6a66; --line: #e4e2dc; --accent: #c98a00;
  --hive: #f2b705; --btn: #1b1b1a; --btn-text: #fff; --error: #b42318;
  --next: #2563eb; --doing: #15803d; --waiting: #c2410c; --blocked: #b42318; --parked: #6b7280; --done: #6b6a66;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211; --card: #1c1c1a; --text: #ecebe6; --muted: #9b9a94; --line: #2c2b28; --accent: #f2b705;
    --btn: #ecebe6; --btn-text: #121211; --error: #f97066;
    --next: #60a5fa; --doing: #4ade80; --waiting: #fb923c; --blocked: #f87171; --parked: #9ca3af; --done: #9b9a94;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }

header { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.logo { color: var(--hive); font-size: 22px; line-height: 1; }
nav { display: flex; gap: 4px; overflow-x: auto; flex: 1 1 auto; }
nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); white-space: nowrap; }
nav a.on { background: var(--bg); color: var(--text); font-weight: 600; }
.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
body.out header nav, body.out header .tools { display: none; }

main { max-width: 920px; margin: 0 auto; padding: 16px; }
footer { text-align: center; padding: 24px 16px 40px; }
h1 { font-size: 26px; margin: 8px 0 16px; overflow-wrap: anywhere; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 22px 0 8px; }
.count { font-weight: 400; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.error { color: var(--error); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }

.list { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row { display: block; padding: 10px 14px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row:hover { background: var(--bg); }
.row .title { overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.chip { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor; }
.s-next { color: var(--next); } .s-doing { color: var(--doing); } .s-waiting { color: var(--waiting); }
.s-blocked { color: var(--blocked); } .s-parked { color: var(--parked); } .s-done { color: var(--done); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.tile .n { font-size: 24px; font-weight: 700; }
.bar { height: 6px; background: var(--line); border-radius: 3px; margin: 6px 0 2px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
details { margin-top: 18px; } summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }

.fields { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.field { display: contents; } dt { color: var(--muted); } dd { margin: 0; overflow-wrap: anywhere; }
.notes { margin: 0; padding: 12px 14px 12px 34px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.notes li { margin: 4px 0; overflow-wrap: anywhere; }
.back { background: none; border: 0; color: var(--muted); padding: 0; font: inherit; cursor: pointer; }

.btn { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer;
  background: var(--btn); color: var(--btn-text); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; }
.btn svg { width: 16px; height: 16px; }
.search { width: 100%; font: inherit; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); margin-bottom: 12px; }

.signin { max-width: 380px; margin: 10vh auto 0; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.signin .logo { font-size: 56px; }
.signin h1 { margin: 0; }
.signin .btn { width: 100%; height: 46px; }

@media (max-width: 600px) {
  header { padding: 8px 12px; }
  .tools #stamp { display: none; }
  .tiles { gap: 8px; } .tile .n { font-size: 20px; }
  h1 { font-size: 22px; }
}

/* "Show shared items", Week view, Now / Next (10-24-2026, same views as the iPhone app) */
.switch { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 12px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.picker { display: flex; flex-wrap: wrap; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.picker a { flex: 1 1 auto; text-align: center; padding: 6px 10px; border-radius: 8px; color: var(--muted); }
.picker a.on { background: var(--bg); color: var(--text); font-weight: 600; }
details.day { margin: 0 0 8px; }
details.day > summary { display: flex; align-items: center; gap: 8px; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px; margin: 0; list-style: none; }
details.day > summary::-webkit-details-marker { display: none; }
details.day > summary::before { content: "›"; color: var(--muted); transition: transform .15s; }
details.day[open] > summary::before { transform: rotate(90deg); }
details.day[open] > summary { border-radius: 12px 12px 0 0; }
details.day[open] > .list { border-top: 0; border-radius: 0 0 12px 12px; }
.dname { font-weight: 600; } .date { margin-left: auto; font-size: 13px; }
.badge { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 0 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }
.badge.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.protected { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; color: #db2777;
  background: color-mix(in srgb, #db2777 15%, transparent); }
.row.block { display: flex; gap: 10px; }
.stripe { flex: 0 0 4px; border-radius: 2px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; flex: 0 0 8px; }
.c-family { background: #ec4899; } .c-work { background: #3b82f6; } .c-personal { background: #22c55e; }
.c-home { background: #f97316; } .c-rest { background: #9ca3af; } .c-other { background: #a855f7; }
.line { display: flex; align-items: baseline; gap: 6px; margin-top: 3px; }
.line .act { flex: 1 1 auto; overflow-wrap: anywhere; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 14px; }
.warn { color: var(--waiting); margin: -4px 14px 8px; }
.pad { padding: 10px 14px; margin: 0; }
section + .tiles { margin-top: 14px; }
