/* MDRoster. Green is reserved for the logo. Buttons use navy. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../assets/fonts/Atkinson-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../assets/fonts/Atkinson-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("../assets/fonts/Outfit-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #fdf3e1;
  --surface: #ffffff;
  --ink: #142033;
  --muted: #4a5562;
  --line: #e4e0ea;
  --navy: #0c3d6e;
  --navy-ink: #ffffff;
  --header: #6b4706;
  --gold: #e8b04a;
  --brown: #6b4428;
  --teal: #0f7c7c;
  --purple: #4b3fd1;
  --rust: #8c2f2f;
  --amber: #8a5a12;
  --amber-bg: #f8efd8;
  --chip: #efeae2;
  --shadow: 0 10px 28px rgba(20, 32, 51, 0.06);
  --radius: 14px;
  --font: "Outfit", "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  --nav-h: calc(68px + env(safe-area-inset-bottom));
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #10151c;
  --surface: #1a222d;
  --ink: #f4f0e8;
  --muted: #c5ced6;
  --line: #2e3a48;
  --navy: #d5e4f5;
  --navy-ink: #0c3d6e;
  --brown: #e7c2a2;
  --teal: #9ee0da;
  --purple: #dcc4f4;
  --rust: #f3c1c1;
  --amber: #f3d7a1;
  --amber-bg: #3a2e18;
  --chip: #243140;
  --shadow: none;
  color-scheme: dark;
}


* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 17px;
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.skip {
  position: absolute; left: 8px; top: -40px; background: var(--navy); color: var(--navy-ink);
  padding: 8px 12px; z-index: 20;
}
.skip:focus { top: 8px; }

.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: var(--header); color: #fff;
  border-bottom: 3px solid var(--gold);
  position: sticky; top: 0; z-index: 5;
}
.topbar .logo-light { display: none; }
.topbar .logo-dark { display: block; height: 28px; }
.topbar .menu-btn, .topbar .role-pill { color: #fff; }
.topbar .role-pill { border-color: rgba(255,255,255,.4); }
.logo { height: 32px; width: auto; }
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 8px; font-weight: 700; background: transparent; border: 0;
}
.grow { flex: 1; }
.icon-btn, .text-btn, .btn, .seg button, .cell, .nav button, .drawer button, .list-btn {
  border: 0; background: transparent;
}
.ico { width: 22px; height: 22px; flex: 0 0 22px; display: block; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
}
.icon-btn .ico { width: 22px; height: 22px; }
.tabbar .ico { width: 22px; height: 22px; }
.banner .ico, .assist .ico, .lock-line .ico { width: 22px; height: 22px; margin-top: 2px; }
.icon-btn:hover, .text-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.role-pill {
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; color: var(--muted);
}

.screen {
  flex: 1; padding: 14px 14px var(--nav-h); overflow: auto;
}
.screen h1 { font-size: 1.35rem; margin: 4px 0 12px; letter-spacing: -0.02em; }
.screen h2 { font-size: 1.05rem; margin: 0 0 8px; }
.lede { color: var(--muted); margin-top: 0; }

.card, .banner, .assist, .sheet, .auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card, .banner, .assist, .sum, .day-card, .nav-card { max-width: 36rem; }
.card, .nav-card {
  padding: 14px; margin: 0 0 12px; background: #fff;
  border: 1px solid #e4e0ea; border-radius: 16px;
  box-shadow: 0 8px 22px rgba(80, 60, 20, .06);
}
.card p { margin: 6px 0; }
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 16px; }
.section-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.kicker-schedule { color: var(--brown); }
.kicker-or { color: var(--teal); }
.kicker-aa { color: var(--purple); }
.mark { width: 9px; height: 9px; display: inline-block; background: currentColor; }
.mark-schedule { border-radius: 2px; }
.mark-or { border-radius: 50%; }
.mark-aa { transform: rotate(45deg); }

.btn {
  min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--chip); font-weight: 700;
}
.btn-primary { background: var(--navy); color: var(--navy-ink); }
.btn-rust { background: transparent; color: var(--rust); border: 1.5px solid var(--rust); }
.btn[disabled] { opacity: .45; }
.btn-tiny { min-height: 36px; padding: 0 10px; font-size: 13px; }

.seg { display: flex; background: #efeaf8; border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { flex: 1; min-height: 36px; border-radius: 999px; font-weight: 700; background: transparent; border: 0; }
.seg button[aria-pressed="true"] { background: #4b3fd1; color: #fff; }
.month-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; }
.month-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.month-nav strong { font-size: 16px; white-space: nowrap; }
.span-seg { display: flex; gap: 2px; background: #ddd4f5; border-radius: 999px; padding: 4px; flex: none; }
.span-seg button {
  width: 36px; height: 36px; flex: 0 0 36px; padding: 0; margin: 0;
  border-radius: 50%; border: 0; background: transparent; box-shadow: none;
  font-weight: 700; color: #3c3658; line-height: 36px; text-align: center;
}
.span-seg button[aria-pressed="true"] {
  background: #ffffff; color: #142033;
  box-shadow: 0 1px 4px rgba(40, 20, 80, .28);
}

.field { display: grid; gap: 4px; font-size: 14px; }
.field input, .field select, .field textarea {
  min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding: 8px 10px;
}
.field textarea { min-height: 80px; }

.banner { padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.banner-late { background: var(--amber-bg); border-color: transparent; }
.assist { padding: 14px; margin-bottom: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 2px 7px; font-size: 12px; font-weight: 700;
  background: var(--chip); white-space: nowrap;
}
.chip-call { color: var(--navy-ink); background: var(--navy); }
[data-theme="dark"] .chip-call { color: var(--navy-ink); }
.chip-or { color: var(--teal); background: color-mix(in srgb, var(--teal) 16%, var(--surface)); }
.chip-off { color: var(--muted); }
.chip-credit, .chip-extra { color: var(--brown); }
.shape { width: 8px; height: 8px; display: inline-block; background: currentColor; flex: none; }
.shape-call { transform: rotate(45deg); border-radius: 1px; }
.shape-or { border-radius: 2px; }
.shape-off { background: transparent; border: 1.5px solid currentColor; border-radius: 50%; }
.shape-credit { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.shape-extra { border-radius: 50%; }
.roc { font-style: normal; font-size: 10px; }

.bal { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 6px; }
.bal-extra { background: #e5f6ee; color: #0f7a4a; }
.bal-short { background: #fde8ef; color: #b42318; }
.bal-even { background: #e7f1fb; color: #1d4e89; }
.bal-none { background: #f3f0ff; color: #5b3fc4; }
.site-badge { display: inline-block; background: #e5f6e8; color: #1b7a32; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 7px; }

.grid-scroll { overflow: auto; max-height: calc(100dvh - 220px); border: 1px solid #e6e6e6; border-radius: 16px; background: #fff; }
.roster { border-collapse: separate; border-spacing: 0; min-width: max-content; }
.roster th, .roster td { border-bottom: 1px solid #eceae6; border-right: 1px solid #eceae6; padding: 4px; font-weight: 500; vertical-align: middle; }
.roster thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; font-size: 12px; }
.roster .sticky { position: sticky; left: 0; background: var(--surface); z-index: 3; min-width: 92px; text-align: left; padding-left: 8px; }
.roster thead .sticky { z-index: 4; }
.cell { min-width: 64px; min-height: 36px; border-radius: 8px; }
.cell:hover { background: var(--chip); }
.note-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brown); display: inline-block; margin-left: 4px; }

.month-grid, .year-grid { display: grid; gap: 6px; }
.month-grid { grid-template-columns: repeat(7, 1fr); }
.year-grid { grid-template-columns: repeat(3, 1fr); }
.day-tile, .year-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  min-height: 64px; padding: 6px; text-align: left;
}
.day-tile strong, .year-tile strong { display: block; font-size: 12px; }
.dow { text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; }

.list-btn, .room {
  width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px; margin-bottom: 8px;
}
.room header { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.room ul { margin: 8px 0 0; padding: 0; list-style: none; }
.room li { font-variant-numeric: tabular-nums; padding: 3px 0; border-top: 1px solid var(--line); font-size: 14px; }
.room-locked { opacity: .72; }
.lock-line { display: flex; gap: 6px; align-items: flex-start; color: var(--muted); font-size: 13px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px; box-sizing: border-box; max-width: 100%;
  background: #fff; border-top: 1px solid #e4e0ea;
  padding: 4px 6px 6px;
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 56px; margin: 0; padding: 4px 1px 3px; border-radius: 14px;
  color: #4a5562; background: transparent; border: 0; overflow: visible;
}
.tabbar .ico { width: 20px; height: 20px; flex: 0 0 20px; }
.tabbar .tab-label {
  display: block; font-size: 11px; font-weight: 700; line-height: 1.15;
  text-align: center; white-space: normal; color: inherit;
}
.tabbar button[aria-current="page"] {
  color: #fff; background: #0f7c7c;
}
.tabbar button[aria-current="page"] .ico,
.tabbar button[aria-current="page"] .tab-label { color: #fff; }
.side button[aria-current="page"] { color: #0f7c7c; }
.side { display: none; }

.drawer-back, .sheet-back {
  position: fixed; inset: 0; background: rgba(16, 21, 28, .46); z-index: 8;
  display: flex;
}
.drawer {
  width: min(320px, 88vw); background: var(--surface); height: 100%; overflow: auto;
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
}
.drawer button, .drawer a {
  display: flex; width: 100%; text-align: left; text-decoration: none; color: inherit;
  min-height: 44px; align-items: center; gap: 8px; border-radius: 10px; padding: 0 8px; background: transparent; border: 0;
}
.sheet-back { align-items: flex-end; justify-content: center; }
.sheet { width: min(560px, 100%); max-height: 88dvh; overflow: auto; border-radius: 18px 18px 0 0; padding: 14px 14px calc(16px + env(safe-area-inset-bottom)); }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 8px); transform: translateX(-50%);
  background: var(--navy); color: var(--navy-ink); padding: 10px 14px; border-radius: 999px; z-index: 9;
  max-width: 90vw;
}

.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
}
.auth-card { width: min(440px, 100%); padding: 22px 18px 18px; }
.auth-card .logo { height: 48px; }
.demo-list { display: grid; gap: 8px; margin-top: 8px; }
.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { border-bottom: 1px solid var(--line); text-align: left; padding: 6px 4px; vertical-align: top; }

.wheel-wrap { display: grid; place-items: center; margin: 8px 0 14px; }
.wheel {
  width: 220px; height: 220px; border-radius: 50%;
  border: 8px solid var(--surface); box-shadow: var(--shadow);
  transition: transform 2.4s cubic-bezier(.15,.8,.2,1);
}
.wheel-cap {
  width: 18px; height: 18px; background: var(--navy); border-radius: 3px; transform: rotate(45deg); margin-top: -8px;
}

.check { display: flex; gap: 8px; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin-top: 2px; }

.notify-grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.notify-grid th, .notify-grid td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: center; }
.notify-grid th:first-child, .notify-grid td:first-child { text-align: left; }

.stub {
  border: 1px dashed var(--line); border-radius: 16px; padding: 18px; background: var(--surface);
}

.greet { font-size: 1.35rem; margin: 0 0 8px; }
.date-step { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.step-sq {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid #e4e0ea; background: #fff;
  font-size: 22px; line-height: 1;
}
.sum { border-radius: 16px; border: 1.5px solid; margin: 0 0 10px; overflow: hidden; }
.sum-main {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 64px;
  padding: 10px 12px; background: transparent; border: 0; text-align: left;
}
.sum-copy { display: grid; flex: 1; }
.sum-label { font-size: 13px; font-weight: 700; }
.sum-main strong { font-size: 18px; }
.chev {
  width: 28px; height: 28px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  font-weight: 700; flex: none;
}
.sum-detail { padding: 0 12px 12px 44px; }
.sum-list { background: #f3f0ff; border-color: #c9bff5; color: #5b3fc4; }
.sum-pick { background: #fff1f1; border-color: #f2b8b8; color: #b42318; }
.sum-call { background: #fff6ec; border-color: #f5c78e; color: #b54708; }
.sum-aa { background: #eef8fc; border-color: #9ed8ea; color: #0e6e8c; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.linkish { background: none; border: 0; color: #4b3fd1; font-weight: 700; min-height: 44px; }
.day-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  border-radius: 16px; border: 1px solid #e4e0ea; padding: 12px; margin: 0 0 10px; background: #fff;
  width: 100%; text-align: left;
}
.date-pair { display: flex; align-items: center; gap: 8px; }
.day-card .num { font-size: 32px; font-weight: 700; line-height: 1; }
.day-card .when { font-size: 13px; line-height: 1.2; }
.date-pair .when { padding-left: 8px; border-left: 1px solid #e4e0ea; }
.day-card .assign { font-weight: 700; }
.pill { border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 700; background: #fff; }
.tint-today { background: #f3f0ff; border-left: 4px solid #c9bff5; }
.tint-tomorrow { background: #fff6ec; border-left: 4px solid #f5c78e; }
.tint-next { background: #e5f6ee; border-left: 4px solid #8ed4b0; }
.cal {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  background: #fff; border: 1px solid #e6e6e6; border-radius: 16px; overflow: hidden;
}
.cal-h, button.cal-c {
  border: 0; border-right: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6;
  box-shadow: none; border-radius: 0; min-width: 0;
}
.cal-h { text-align: center; font-size: 12px; font-weight: 700; padding: 6px 0; background: #fff; }
.cal-h.weekend { background: #fff1f3; color: #9b3a3a; }
button.cal-c { min-height: 78px; padding: 3px; background: #fff; text-align: left; position: relative; color: inherit; font: inherit; }
button.cal-c.weekend { background: #fff1f3; }
button.cal-c.holiday { background: #fde8ec; }
button.cal-c.outside { background: #f7f5f1; color: #b0aaa2; }
button.cal-c.outside .cal-rank, button.cal-c.outside .cal-code { opacity: .45; }
.cal-top { border-bottom: 1px solid #e6e6e6; margin: 0 0 2px; min-height: 18px; }
.cal-num { font-size: 12px; display: inline-block; min-width: 16px; border: 0; }
.cal-num.today {
  background: #0f7c7c; color: #fff; border-radius: 50%; width: 22px; height: 22px;
  display: grid; place-items: center; border-bottom: 0;
}
.cal-rank { color: #0f7c7c; font-weight: 700; font-size: 13px; display: block; }
.cal-code { display: block; font-size: 10px; letter-spacing: .03em; text-transform: uppercase; font-weight: 700; }
.cal-code.post { color: #b42318; }
.cal-hol { color: #b42318; font-size: 9px; font-weight: 700; display: block; line-height: 1.05; white-space: normal; }
.plus-badge {
  position: absolute; top: 2px; right: 2px; background: #fff; border: 1px solid #e4e0ea;
  border-radius: 999px; font-size: 10px; font-weight: 700; padding: 0 3px;
}
.note-pip { width: 6px; height: 6px; border-radius: 50%; background: #5b3fc4; display: inline-block; }
.note-count {
  width: 16px; height: 16px; border-radius: 50%; background: #f5d76e; color: #142033;
  font-size: 10px; font-weight: 700; display: inline-grid; place-items: center;
}
.jump-today {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + 12px); z-index: 7;
  height: 48px; width: auto; border-radius: 999px; border: 0; background: #0c3d6e; color: #fff;
  display: inline-flex; align-items: center; gap: 6px; padding: 0 16px 0 12px;
  font-size: 16px; font-weight: 700;
}
.jump-today .ico { width: 20px; height: 20px; flex: 0 0 20px; color: #fff; }
.room, .list-btn { border: 1px solid #e4e0ea; border-radius: 16px; box-shadow: 0 6px 16px rgba(80, 60, 20, .05); }

@media (min-width: 960px) {
  .app { flex-direction: row; }
  .side {
    display: flex; flex-direction: column; width: 232px; flex: none;
    border-right: 1px solid var(--line); background: var(--surface);
    padding: 16px 10px; position: sticky; top: 0; height: 100dvh; overflow: auto;
  }
  .side .brand { height: 36px; margin: 4px 8px 16px; }
  .topbar { display: none; }
  .tabbar { display: none; }
  .jump-today { bottom: 24px; }
  .screen { padding: 28px 28px 40px; }
  .sheet { border-radius: 18px; margin-bottom: 24px; }
  .toast { bottom: 24px; }
  .auth { padding: 48px; }
}
