/* Layout: a kitchen rota. Enamel blue on white, rubber-glove yellow for anything ticked, a tea-towel stripe across the top. */
:root {
  --bg: #F2F5FA; --surface: #FFFFFF; --ink: #14213D; --muted: #56627A; --line: #D8DFEB;
  --rim: #1F3A7A; --on-rim: #FFFFFF; --glove: #FFC21A; --on-glove: #2A1E00;
  --late: #B3261E; --late-bg: #FBE9E7; --ok: #17785A; --tint: #E4EAF6;
  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", Verdana, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0E1728; --surface: #172338; --ink: #EAF0FA; --muted: #A5B1C7; --line: #2B3B57;
  --rim: #9DB9FF; --on-rim: #0E1728; --glove: #FFC83D; --on-glove: #2A1E00;
  --late: #FF9B90; --late-bg: #3A1F24; --ok: #63D6AC; --tint: #22314D; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0E1728; --surface: #172338; --ink: #EAF0FA; --muted: #A5B1C7; --line: #2B3B57;
  --rim: #9DB9FF; --on-rim: #0E1728; --glove: #FFC83D; --on-glove: #2A1E00;
  --late: #FF9B90; --late-bg: #3A1F24; --ok: #63D6AC; --tint: #22314D; color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 var(--body); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--rim); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; }
.stripe { height: 14px; background: repeating-linear-gradient(90deg, var(--rim) 0 34px, transparent 34px 42px, var(--glove) 42px 50px, transparent 50px 58px); }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
header .wrap { display: flex; align-items: center; gap: 24px; padding-block: 14px; }
.brand { font: 800 22px/1 var(--display); color: var(--rim); letter-spacing: -.01em; margin-right: auto; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 8px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 700; }
.tabs a:hover { background: var(--tint); }
.tabs a[aria-current="page"] { background: var(--rim); color: var(--on-rim); }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 14px; font-weight: 700; cursor: pointer; }
.btn:hover { border-color: var(--rim); }
.btn.primary { background: var(--rim); border-color: var(--rim); color: var(--on-rim); }
.btn.danger { color: var(--late); }
.btn.small { padding: 4px 10px; font-size: 14px; }
.btn[disabled] { opacity: .6; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--rim); text-decoration: underline; cursor: pointer; font-weight: 700; }
main.wrap { padding-block: 12px 56px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 32px; align-items: start; }
.hero h1 { font-size: clamp(32px, 6vw, 52px); font-weight: 800; line-height: 1.02; letter-spacing: -.02em; }
.hero p { margin: 8px 0 0; color: var(--muted); font-size: 18px; }
.towel { height: 18px; border-radius: 4px; margin-top: 14px; background: var(--tint); overflow: hidden; }
.towel span { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--glove) 0 22px, color-mix(in srgb, var(--glove) 78%, var(--on-glove)) 22px 26px); transition: width .3s; }
.filters { display: flex; flex-wrap: wrap; gap: 16px 24px; margin: 18px 0 8px; }
.filter-label { display: block; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 13px; cursor: pointer; font-size: 15px; }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
section.group { margin-top: 24px; }
.group > h2 { font-size: 20px; font-weight: 700; display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.group > h2 small { font: 400 15px var(--body); color: var(--muted); }
.group.late > h2 { color: var(--late); }
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tick { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--rim); background: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; }
.tick svg { width: 18px; height: 18px; stroke: var(--rim); opacity: 0; }
.tick:hover svg { opacity: .55; }
.tick.done { background: var(--glove); border-color: var(--glove); }
.tick.done svg { opacity: 1; stroke: var(--on-glove); }
.row-main { flex: 1; min-width: 0; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.row-title { font-weight: 700; display: block; overflow-wrap: anywhere; }
.row-meta { color: var(--muted); font-size: 14px; display: block; }
.row.is-done .row-title { text-decoration: line-through; font-weight: 400; color: var(--muted); }
.flag { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 4px; background: var(--tint); color: var(--rim); margin-left: 6px; white-space: nowrap; }
.when-late { color: var(--late); font-weight: 700; }
.later { flex: none; }
.empty { padding: 22px 0; color: var(--muted); }
.notice { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; background: var(--tint); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
aside { display: grid; gap: 24px; padding-top: 8px; }
.stat b { display: block; font: 800 44px/1 var(--display); color: var(--rim); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
aside h3 { font-size: 16px; margin-bottom: 8px; }
.mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.mini li { display: flex; justify-content: space-between; gap: 12px; }
.mini li span:last-child { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; margin-bottom: 16px; }
.page-head h1 { font-size: clamp(28px, 5vw, 40px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 3px solid var(--rim); }
.day { padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 220px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.day:first-child { border-left: 1px solid var(--line); }
.day.today { background: var(--surface); box-shadow: inset 0 3px 0 var(--glove); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.day-head b { font: 700 16px var(--display); }
.day-head span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 5px 7px; font-size: 13.5px; line-height: 1.25; cursor: pointer; overflow-wrap: anywhere; }
.chip:hover { border-color: var(--rim); }
.chip small { display: block; color: var(--muted); font-size: 12px; }
.chip.late { border-color: var(--late); background: var(--late-bg); }
.chip.done { background: transparent; color: var(--muted); text-decoration: line-through; }
.day-add { margin-top: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; text-align: left; padding: 4px 0; }
.day-add:hover { color: var(--rim); }
.room-grid { columns: 310px auto; column-gap: 24px; }
.room { break-inside: avoid; margin-bottom: 28px; }
.room-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.room h2 { font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }
.condition { height: 8px; border-radius: 4px; background: var(--late-bg); margin: 8px 0 4px; overflow: hidden; }
.condition span { display: block; height: 100%; background: var(--ok); }
.room-sub { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.compact { list-style: none; margin: 0 0 8px; padding: 0; border-top: 1px solid var(--line); }
.compact button { display: flex; justify-content: space-between; gap: 12px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 7px 0; cursor: pointer; text-align: left; font-size: 15px; }
.compact button:hover { color: var(--rim); }
.compact span:first-child { min-width: 0; overflow-wrap: anywhere; }
.compact span:last-child { color: var(--muted); white-space: nowrap; font-size: 14px; font-variant-numeric: tabular-nums; }
.compact .when-late { color: var(--late); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 62px; gap: 10px; align-items: center; margin-bottom: 8px; }
.bar-row > span:first-child { overflow-wrap: anywhere; }
.bar-row > span:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 18px; background: var(--tint); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--rim); }
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--muted); font-size: 14px; }
.badge b { display: block; color: var(--muted); font-size: 15px; }
.badge.won { background: var(--glove); border-color: var(--glove); color: var(--on-glove); }
.badge.won b { color: var(--on-glove); }
.member { display: flex; gap: 8px; margin-bottom: 8px; }
.member input { flex: 1; min-width: 0; }
input[type=text], input[type=date], input[type=number], select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; min-width: 0; }
h2.sec { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.setup { max-width: 640px; }
.setup h1 { font-size: clamp(32px, 6vw, 48px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.setup > p { color: var(--muted); font-size: 18px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
legend, .lab { font-weight: 700; padding: 0; margin-bottom: 6px; display: block; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { position: relative; }
.check input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.check span { display: block; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 14px; }
.check input:checked + span { background: var(--glove); border-color: var(--glove); color: var(--on-glove); font-weight: 700; }
.check input:focus-visible + span { outline: 3px solid var(--rim); outline-offset: 2px; }
dialog { border: 0; border-radius: 12px; padding: 20px; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(10, 18, 36, .55); }
dialog h2 { font-size: 24px; font-weight: 800; margin-bottom: 14px; }
.field { margin-bottom: 14px; min-width: 0; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.inline-check { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 15px; }
.hint { color: var(--muted); font-size: 14px; margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; justify-content: flex-end; }
.actions .left { margin-right: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { flex: 1; position: relative; text-align: center; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.seg span { display: block; padding: 7px 8px; }
.seg input:checked + span { background: var(--rim); color: var(--on-rim); font-weight: 700; }
.seg input:focus-visible + span { outline: 3px solid var(--glove); outline-offset: -3px; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; display: flex; gap: 14px; align-items: center; z-index: 20; max-width: calc(100vw - 32px); }
#toast button { background: none; border: 0; color: var(--glove); font-weight: 700; cursor: pointer; padding: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #toast button { color: #7A5A00; } }
:root[data-theme="dark"] #toast button { color: #7A5A00; }
@media (max-width: 820px) {
  .layout, .cols { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .week { grid-template-columns: minmax(0, 1fr); }
  .day { min-height: 0; border-left: 1px solid var(--line); }
  .day-add { margin-top: 0; }
}
@media (max-width: 640px) {
  header nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line);
    padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .tabs { justify-content: space-between; }
  .tabs a { flex: 1; text-align: center; padding: 9px 2px; font-size: 15px; }
  main.wrap { padding-bottom: 96px; }
  #toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); width: max-content; }
  dialog { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 12px 12px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); max-height: 92dvh; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.person { margin-bottom: 14px; }
.person .member { margin-bottom: 4px; }
.person-sub { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 14px; color: var(--muted); }
.signin { max-width: 380px; margin: 8vh auto 0; }
.signin .actions { margin-top: 0; }
.form-error { color: var(--late); font-weight: 700; margin: 0; }
input[type=password] { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; min-width: 0; }
[hidden] { display: none !important; }

/* Chores: only admins can add or change them */
.not-admin [data-a="new"], .not-admin [data-a="room-new"], .not-admin [data-a="templates"], .not-admin [data-a="room-edit"] { display: none !important; }
/* Clock in */
.clock-gate { max-width: 460px; margin: 8vh auto; text-align: center; }
.clock-gate h1 { font-size: clamp(32px, 6vw, 48px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.clock-gate p { color: var(--muted); font-size: 18px; }
.clock-big { font-size: 20px; padding: 14px 40px; min-width: 220px; }
.notice.clocked { background: var(--glove); color: var(--on-glove); }
.times { margin-bottom: 32px; }
.clock-other { max-width: 380px; margin: 12px 0; align-items: center; }
.clock-other select { flex: 1; }
.clock-other .btn { white-space: nowrap; }
.shifts { margin-top: 8px; }
.shift { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.shift > div { min-width: 0; overflow-wrap: anywhere; }
.flag.warn { background: var(--late-bg); color: var(--late); white-space: normal; }
.flag.live { background: var(--glove); color: var(--on-glove); }
/* School */
.sched-list li.is-today { font-weight: 700; }
.sched-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 104px) minmax(0, 104px); gap: 8px; align-items: center; margin-bottom: 8px; }
.sched-row .inline-check { margin-top: 0; }
.chip.school { background: var(--tint); border-color: var(--tint); cursor: default; }
.chip.holiday { background: var(--glove); border-color: var(--glove); color: var(--on-glove); font-weight: 700; cursor: default; }
.chip.work { background: transparent; border-style: dashed; cursor: default; }
.chip.holiday small { color: var(--on-glove); font-weight: 400; }
.roles { margin-bottom: 8px; }
.roles .inline-check { align-items: flex-start; }
input[type=time], input[type=datetime-local], input[type=file], input[type=email] { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; min-width: 0; }
.tabs a { white-space: nowrap; }
header .wrap { flex-wrap: wrap; row-gap: 8px; }
.tab-badge { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 99px; background: var(--late); color: #fff; font-size: 12px; line-height: 18px; text-align: center; }
.notice.remind { background: var(--late-bg); }
.notice.update-bar { background: var(--tint); border: 2px solid var(--rim); }
.notice a.btn { color: inherit; text-decoration: none; }
.chip.away { background: var(--late-bg); border-color: var(--late-bg); cursor: default; }
.cal { max-width: 560px; margin-bottom: 20px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-name { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; }
.cal-day { min-height: 56px; padding: 4px 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; overflow: hidden; }
.cal-day:hover { border-color: var(--rim); }
.cal-day b { font-weight: 700; font-size: 14px; }
.cal-day small { font-size: 12px; color: var(--rim); font-weight: 700; }
.cal-day i { font-style: normal; font-size: 11px; color: var(--late); font-weight: 700; }
.cal-day.other { opacity: .45; }
.cal-day.today { box-shadow: inset 0 3px 0 var(--glove); }
.cal-day.has { background: var(--tint); }
.log-time { flex: none; color: var(--muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.logs-who { width: auto; min-width: 160px; }
.talk-btn { display: block; width: 100%; max-width: 420px; margin: 0 auto 14px; padding: 34px 16px; border: 0; border-radius: 16px; background: var(--rim); color: var(--on-rim); font: 800 24px var(--display); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.talk-btn.recording { background: var(--late); color: #fff; font-size: 19px; }
.talk-btn[disabled] { opacity: .6; cursor: default; }
.talk-auto { justify-content: center; }
@media (max-width: 640px) {
  .tabs { gap: 2px; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: 1 0 auto; font-size: 14px; padding: 9px 10px; }
  .log-time { font-size: 13px; }
  .sched-row { grid-template-columns: minmax(0, 1fr) minmax(0, 92px) minmax(0, 92px); gap: 4px; }
}
