/* J's Calendar — 溫柔、不焦慮的老師行事曆
   色彩：奶油米 + 伊布棕 + 鼠尾草綠；深色模式為「月亮伊布」夜色 */

:root {
  --bg: #FBF7F0;
  --bg-2: #F4EDE2;
  --card: #FFFFFF;
  --ink: #4B4038;
  --ink-2: #7D7166;
  --ink-3: #ADA192;
  --line: #EEE5D8;
  --brand: #B8865C;
  --brand-ink: #FFFFFF;
  --brand-soft: #F4E8DA;
  --sage: #74A986;
  --sage-soft: #E3F0E6;
  --now: #E9A86A;
  --danger: #C7766B;
  --shadow-sm: 0 1px 2px rgba(110, 80, 50, .06);
  --shadow: 0 1px 2px rgba(110, 80, 50, .05), 0 8px 24px rgba(110, 80, 50, .08);
  --radius: 18px;
  --radius-sm: 12px;
  --f-head: "LXGW WenKai TC", "Noto Sans TC", system-ui, sans-serif;
  --f-body: "Noto Sans TC", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1F27; --bg-2: #262833; --card: #2C2E3B; --ink: #EEE8DC; --ink-2: #B8B1A2; --ink-3: #7F7A70;
    --line: #393B4A; --brand: #E7C36B; --brand-ink: #2A2418; --brand-soft: #3B3729; --sage: #8CC39D; --sage-soft: #2A3A30;
    --now: #E7B36B; --danger: #E08F84;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 1px 2px rgba(0,0,0,.25), 0 10px 28px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1E1F27; --bg-2: #262833; --card: #2C2E3B; --ink: #EEE8DC; --ink-2: #B8B1A2; --ink-3: #7F7A70;
  --line: #393B4A; --brand: #E7C36B; --brand-ink: #2A2418; --brand-soft: #3B3729; --sage: #8CC39D; --sage-soft: #2A3A30;
  --now: #E7B36B; --danger: #E08F84;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 1px 2px rgba(0,0,0,.25), 0 10px 28px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.app {
  max-width: 980px;
  margin: 0 auto;
  min-height: 100%;
  padding: calc(var(--safe-t) + 10px) 16px calc(96px + var(--safe-b));
}

/* ---------- top / greeting ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 4px 0 10px; }
.topbar .buddy-wrap { width: 58px; height: 58px; border-radius: 20px; background: var(--brand-soft); display: grid; place-items: center; flex: none; overflow: hidden; }
.topbar .buddy-wrap .buddy { transform: translateY(4px); }
.greet { flex: 1; min-width: 0; }
.greet h1 { font-family: var(--f-head); font-weight: 700; font-size: 22px; margin: 0; letter-spacing: .02em; }
.greet p { margin: 0; color: var(--ink-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: var(--ink-2); background: var(--card); box-shadow: var(--shadow-sm); }
.icon-btn:active { transform: scale(.96); }

/* ---------- now card ---------- */
.nowcard {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; display: flex; gap: 12px; align-items: center; margin-bottom: 12px;
  position: relative; overflow: hidden;
}
.nowcard .tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--sage-soft); color: var(--sage); flex: none; }
.nowcard .tag.next { background: var(--brand-soft); color: var(--brand); }
.nowcard .txt { flex: 1; min-width: 0; }
.nowcard .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowcard .t2 { font-size: 12.5px; color: var(--ink-2); }
.nowcard .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--sage); border-radius: 0 3px 3px 0; opacity: .7; }
.quote { font-family: var(--f-head); color: var(--ink-3); font-size: 13.5px; text-align: center; margin: 18px 0 4px; }

/* ---------- calendar chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  --c: var(--brand);
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 36px; padding: 0 12px 0 4px; border-radius: 99px;
  background: color-mix(in srgb, var(--c) 16%, var(--card));
  border: 1.5px solid color-mix(in srgb, var(--c) 45%, transparent);
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  transition: all .18s ease; user-select: none; -webkit-user-select: none;
}
.chip .av { width: 28px; height: 28px; border-radius: 50%; background: var(--card); display: grid; place-items: center; overflow: hidden; }
.chip .av .buddy { transform: translateY(2px); }
.chip.off { background: transparent; border-color: var(--line); color: var(--ink-3); }
.chip.off .av { filter: grayscale(1); opacity: .45; }
.chip .chk { width: 16px; height: 16px; border-radius: 50%; background: var(--c); display: grid; place-items: center; }
.chip .chk svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 3; }
.chip.off .chk { background: transparent; border: 1.5px solid var(--line); }
.chip.off .chk svg { display: none; }
.chip.ghost { padding: 0 12px; background: var(--card); border: 1.5px dashed var(--line); color: var(--ink-2); }
.chip:active { transform: scale(.97); }

/* ---------- date bar ---------- */
.datebar { display: flex; align-items: center; gap: 6px; margin: 2px 0 10px; }
.datebar h2 { font-family: var(--f-head); font-size: 19px; font-weight: 700; margin: 0; flex: 1; text-align: center; }
.datebar h2 small { display: block; font-family: var(--f-body); font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.nav-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); }
.nav-btn:active { background: var(--bg-2); }
.today-btn { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); }

/* ---------- week grid ---------- */
.week { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.wgrid { display: grid; grid-template-columns: 46px repeat(var(--days), minmax(0, 1fr)); }
.wgrid > * { border-bottom: 1px solid var(--line); }
.wgrid .wh { padding: 8px 2px 6px; text-align: center; font-size: 12px; color: var(--ink-2); position: sticky; top: 0; background: var(--card); z-index: 2; }
.wgrid .wh b { display: block; font-size: 17px; font-family: var(--f-head); color: var(--ink); line-height: 1.2; }
.wgrid .wh.today b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); }
.wgrid .wh.today { color: var(--brand); font-weight: 700; }
.wgrid .pl { padding: 6px 2px; text-align: center; font-size: 10.5px; color: var(--ink-3); line-height: 1.25; display: flex; flex-direction: column; justify-content: center; }
.wgrid .pl b { font-size: 12.5px; color: var(--ink-2); font-weight: 700; display: block; }
.wgrid .pl.now b { color: var(--sage); }
.wgrid .cell { min-height: 58px; padding: 3px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; cursor: pointer; position: relative; }
.wgrid .cell.todaycol { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.wgrid .cell.nowcell { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--sage) 60%, transparent); border-radius: 8px; }
.wgrid .cell:active { background: var(--bg-2); }
.wgrid .brk { min-height: 26px; background: var(--bg-2); }
.wgrid .pl.brk { font-size: 10.5px; }
.wgrid .cell.brk { min-height: 26px; }
.wgrid.editing .cell:not(.brk) { outline: 1.5px dashed color-mix(in srgb, var(--brand) 50%, transparent); outline-offset: -4px; border-radius: 10px; }

.cls {
  --c: var(--brand);
  border-radius: 9px; padding: 4px 3px 4px 5px; letter-spacing: -.02em;
  background: color-mix(in srgb, var(--c) 18%, var(--card));
  border-left: 3px solid var(--c);
  font-size: 11.5px; line-height: 1.25;
}
.cls b { display: block; font-weight: 700; font-size: 12px; color: var(--ink); word-break: break-all; }
.cls span { color: var(--ink-2); font-size: 10.5px; }
.evc {
  --c: var(--brand);
  font-size: 11px; line-height: 1.25; padding: 3px 5px; border-radius: 7px;
  background: color-mix(in srgb, var(--c) 30%, var(--card)); color: var(--ink);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-all;
  max-height: calc(2.5em + 6px);
}
.evc.done { opacity: .5; text-decoration: line-through; }
.evc .bell { width: 10px; height: 10px; vertical-align: -1px; margin-right: 1px; stroke-width: 2.4; }

/* ---------- day list ---------- */
.day { display: flex; flex-direction: column; gap: 8px; }
.drow { display: grid; grid-template-columns: 54px 1fr; gap: 10px; align-items: stretch; }
.drow .tl { text-align: right; font-size: 11.5px; color: var(--ink-3); padding-top: 10px; line-height: 1.3; }
.drow .tl b { display: block; font-size: 13px; color: var(--ink-2); font-weight: 700; }
.drow .box { background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 48px; cursor: pointer; position: relative; }
.drow.now .box { box-shadow: 0 0 0 2px color-mix(in srgb, var(--sage) 70%, transparent), var(--shadow); }
.drow.now .tl b { color: var(--sage); }
.drow.past { opacity: .62; }
.drow.empty .box { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); justify-content: center; color: var(--ink-3); font-size: 13px; padding-left: 12px; }
.drow.brk .box { background: var(--bg-2); box-shadow: none; }
.drow .box .cls { font-size: 13px; padding: 6px 10px; }
.drow .box .cls b { font-size: 14.5px; display: inline; margin-right: 8px; }
.drow .box .cls span { font-size: 12.5px; }
.nowpill { position: absolute; right: 8px; top: 8px; font-size: 11px; font-weight: 700; color: var(--sage); background: var(--sage-soft); padding: 1px 8px; border-radius: 99px; }

.ev {
  --c: var(--brand);
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 12px;
  background: color-mix(in srgb, var(--c) 13%, var(--card));
}
.ev .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--c); flex: none; display: grid; place-items: center; margin-top: 1px; background: var(--card); }
.ev .dot svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 3; opacity: 0; }
.ev.done .dot { background: var(--c); }
.ev.done .dot svg { opacity: 1; }
.ev.done .et { text-decoration: line-through; color: var(--ink-3); }
.ev .eb { flex: 1; min-width: 0; }
.ev .et { font-weight: 600; word-break: break-word; }
.ev .em { font-size: 12px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ev .em svg { width: 12px; height: 12px; vertical-align: -1px; }
.ev .en { font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.allday { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.section-label { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .08em; margin: 6px 2px 2px; }

/* ---------- month ---------- */
.month { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.mgrid .mh { text-align: center; font-size: 12px; color: var(--ink-3); padding: 4px 0 6px; font-weight: 600; }
.mgrid .md { min-height: 64px; border-radius: 12px; padding: 4px 3px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mgrid .md:active { background: var(--bg-2); }
.mgrid .md .n { font-size: 14px; font-weight: 600; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-family: var(--f-head); }
.mgrid .md.other { opacity: .35; }
.mgrid .md.today .n { background: var(--brand); color: var(--brand-ink); }
.mgrid .md.sel { background: var(--bg-2); }
.mgrid .md .bars { width: 100%; display: flex; flex-direction: column; gap: 2px; }
.mgrid .md .mb { --c: var(--brand); font-size: 10px; line-height: 1.3; padding: 0 3px; border-radius: 4px; background: color-mix(in srgb, var(--c) 28%, var(--card)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgrid .md .more { font-size: 10px; color: var(--ink-3); }
.mgrid .md .cdots { display: flex; gap: 2px; }
.mgrid .md .cdots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); opacity: .5; }
.month-list { margin-top: 14px; }

/* ---------- bottom bar ---------- */
.bottombar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b));
  display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 22px;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow); z-index: 20;
}
.seg { display: flex; gap: 2px; }
.seg button { height: 44px; min-width: 56px; padding: 0 12px; border-radius: 16px; font-weight: 600; color: var(--ink-2); font-size: 14.5px; }
.seg button.on { background: var(--brand-soft); color: var(--brand); }
.fab { width: 52px; height: 52px; border-radius: 18px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 40%, transparent); margin-left: 4px; }
.fab svg { width: 26px; height: 26px; stroke-width: 2.2; }
.fab:active { transform: scale(.95); }

/* ---------- sheet ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(40, 30, 20, .32); z-index: 40; opacity: 0; transition: opacity .22s; }
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%); width: min(620px, 100%);
  max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 26px 26px 0 0; z-index: 41;
  padding: 8px 18px calc(22px + var(--safe-b)); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .12);
}
.sheet.show { transform: translate(-50%, 0); }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 4px auto 10px; }
.sheet h3 { font-family: var(--f-head); font-size: 21px; margin: 4px 0 12px; display: flex; align-items: center; gap: 10px; }
.sheet h3 .sp { flex: 1; }
.sheet h4 { font-size: 13px; color: var(--ink-2); margin: 18px 2px 8px; letter-spacing: .05em; }
.sheet .hint { font-size: 12.5px; color: var(--ink-2); margin: 6px 2px; line-height: 1.6; }
.sheet .hint b { color: var(--ink); }

.field { background: var(--card); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 2px 14px; margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--ink-3); padding-top: 8px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; border: 0; background: transparent; outline: none; padding: 4px 0 10px; font-size: 16px; }
.field textarea { resize: vertical; min-height: 64px; }
.field.title input { font-size: 19px; font-weight: 600; font-family: var(--f-head); padding: 12px 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { height: 36px; padding: 0 14px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow-sm); font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid transparent; }
.pill.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.pill .sw { width: 12px; height: 12px; border-radius: 50%; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.pgrid .pc { background: var(--card); border-radius: 12px; padding: 7px 8px; text-align: left; box-shadow: var(--shadow-sm); border: 1.5px solid transparent; line-height: 1.3; }
.pgrid .pc b { display: block; font-size: 13.5px; }
.pgrid .pc small { font-size: 11px; color: var(--ink-3); display: block; }
.pgrid .pc i { font-style: normal; font-size: 11px; color: var(--ink-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pgrid .pc.on { border-color: var(--brand); background: var(--brand-soft); }

.switch-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 12px 14px; margin-bottom: 10px; }
.switch-row .lbl { flex: 1; min-width: 0; }
.switch-row .lbl b { display: block; font-weight: 600; }
.switch-row .lbl small { color: var(--ink-2); font-size: 12.5px; }
.toggle { position: relative; width: 50px; height: 30px; flex: none; }
.toggle input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; z-index: 1; cursor: pointer; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: .2s; }
.toggle span::after { content: ""; position: absolute; width: 24px; height: 24px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--sage); }
.toggle input:checked + span::after { transform: translateX(20px); }

.remind-box { background: var(--card); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 12px 14px; margin-bottom: 10px; }
.remind-box .pills .pill { box-shadow: none; background: var(--bg-2); height: 32px; font-size: 13px; }
.remind-box .pills .pill.on { background: var(--brand-soft); }
.remind-box .when { font-size: 12.5px; color: var(--sage); margin-top: 8px; font-weight: 600; }

.btn { height: 50px; border-radius: 16px; font-weight: 700; font-size: 16px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.soft { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.sm { height: 38px; font-size: 14px; border-radius: 12px; padding: 0 14px; }
.btn:active { transform: scale(.98); }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.actions .btn.primary { flex: 1; }

.list { background: var(--card); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .av { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; overflow: hidden; flex: none; }
.li .av .buddy { transform: translateY(3px); }
.li .tx { flex: 1; min-width: 0; }
.li .tx b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .tx small { color: var(--ink-3); font-size: 12px; }
.li button.mini { color: var(--ink-2); padding: 8px; border-radius: 10px; }
.li button.mini:active { background: var(--bg-2); }

.buddy-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.buddy-pick button { background: var(--card); border-radius: 16px; padding: 8px 4px 6px; box-shadow: var(--shadow-sm); border: 2px solid transparent; font-size: 12px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; }
.buddy-pick button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--card)); color: var(--ink); font-weight: 700; }

details.help { background: var(--card); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow-sm); margin-bottom: 10px; }
details.help summary { font-weight: 600; cursor: pointer; font-size: 14px; }
details.help ol { padding-left: 20px; margin: 8px 0 2px; font-size: 13px; color: var(--ink-2); line-height: 1.7; }

.ptimes .li input { width: 84px; border: 0; background: var(--bg-2); border-radius: 8px; padding: 6px; font-size: 14px; }
.ptimes .li input.nm { width: 80px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: 14px; z-index: 60; transition: .25s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty-day { text-align: center; padding: 26px 10px 8px; color: var(--ink-2); }
.empty-day p { margin: 6px 0 0; font-family: var(--f-head); font-size: 16px; }

.fade-in { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.buddy-bob { animation: bob 3.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(4px); } 50% { transform: translateY(1px); } }
@media (prefers-reduced-motion: reduce) { .buddy-bob, .fade-in { animation: none; } .sheet { transition: none; } }

@media (min-width: 720px) {
  .app { padding-left: 24px; padding-right: 24px; }
  .wgrid { grid-template-columns: 64px repeat(var(--days), minmax(0, 1fr)); }
  .wgrid .cell { min-height: 66px; padding: 4px; }
  .cls { font-size: 12.5px; } .cls b { font-size: 13.5px; } .cls span { font-size: 12px; }
  .evc { font-size: 12px; }
  .mgrid .md { min-height: 92px; align-items: stretch; }
  .mgrid .md .n { align-self: center; }
}
@media (max-width: 380px) {
  .wgrid { grid-template-columns: 38px repeat(var(--days), minmax(0, 1fr)); }
  .cls b { font-size: 11px; } .cls span { font-size: 9.5px; }
  .seg button { min-width: 48px; padding: 0 8px; }
}
