:root {
  --bg: #f3f6fc;
  --surface: #ffffff;
  --surface-2: #edf1fa;
  --ink: #0f1b3d;
  --muted: #56617f;
  --line: #d9e1f0;
  --navy: #0f2557;
  --accent: #1d4fb8;
  --accent-hover: #163f94;
  --accent-soft: #e2eafb;
  --yellow: #f5c518;
  --yellow-hover: #e3b30a;
  --yellow-soft: #fff4c4;
  --yellow-ink: #7a5c00;
  --gold: var(--yellow-ink);
  --ok: #2f6b45;
  --danger: #b42318;
  --logo-ink: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 37, 87, .06), 0 4px 16px rgba(15, 37, 87, .06);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--danger); font-size: .9rem; }

/* Brand */
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; line-height: 1.2; color: #fff; min-width: 0; }
.logo { width: 40px; height: 40px; flex-shrink: 0; }
.brand-lg { font-size: 1.55rem; flex-direction: column; gap: .5rem; color: var(--navy); text-wrap: balance; }
.brand-lg .logo { width: 84px; height: 84px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at 50% 0%, #1d3f8f 0%, var(--navy) 60%); }
.login-card { width: 100%; max-width: 380px; border-top: 6px solid var(--yellow); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 2rem; box-shadow: var(--shadow); text-align: center; display: grid; gap: 1.25rem; }
.login-card form { display: grid; gap: 1rem; text-align: left; }

/* Buttons & fields */
.btn { font: inherit; font-weight: 500; border: 1px solid transparent; border-radius: 9px; padding: .55rem 1rem; cursor: pointer; transition: background .15s, border-color .15s, color .15s; display: inline-flex; align-items: center; gap: .35rem; justify-content: center; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: #fde8e6; }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.field { display: grid; gap: .3rem; font-size: .88rem; font-weight: 500; }
.field input, .field textarea, .field select {
  font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: .6rem .75rem; width: 100%;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* Top bar & tabs */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .75rem clamp(1rem, 4vw, 2rem); background: var(--navy); border-bottom: 4px solid var(--yellow); }
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.12); }
.topbar-right { display: flex; align-items: center; gap: .6rem; }
.tag { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: .25rem .6rem; border-radius: 99px; background: var(--yellow); color: var(--navy); }
.tabs { display: flex; gap: .25rem; padding: .5rem clamp(1rem, 4vw, 2rem); background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; position: sticky; top: 0; z-index: 5; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { font: inherit; font-weight: 500; background: none; border: 0; padding: .5rem .85rem; border-radius: 8px; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem; }
.tabs button:hover { color: var(--ink); background: var(--surface-2); }
.tabs button.active { color: var(--navy); background: var(--yellow-soft); box-shadow: inset 0 -3px 0 var(--yellow); }
.badge { background: var(--yellow); color: var(--navy); font-size: .72rem; font-weight: 600; min-width: 1.2rem; height: 1.2rem; padding: 0 .35rem; border-radius: 99px; display: inline-grid; place-items: center; }

/* Main */
.main { max-width: 1040px; margin: 0 auto; padding: 1.75rem clamp(1rem, 4vw, 2rem) 4rem; display: grid; gap: 1.5rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.page-head p { margin-top: .25rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; align-items: start; }
.stack { display: grid; gap: .75rem; align-content: start; }
.empty { color: var(--muted); padding: 1.25rem; text-align: center; border: 1px dashed var(--line); border-radius: 10px; font-size: .92rem; }
.item { padding: .9rem 0; border-top: 1px solid var(--line); display: grid; gap: .3rem; }
.item:first-child { border-top: 0; padding-top: 0; }
.item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.item-actions { display: flex; gap: .25rem; flex-shrink: 0; }
.meta { font-size: .84rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.pre { white-space: pre-wrap; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.stat .label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.stat .value { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Tickets */
.shows { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.show-card { display: grid; gap: .7rem; }
.show-card .big { font-family: var(--font-display); font-size: 2.4rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.bar.full > div { background: var(--yellow); }
.split { display: flex; justify-content: space-between; font-size: .88rem; }
.split b { font-variant-numeric: tabular-nums; }
.sold-out { color: var(--gold); font-weight: 600; font-size: .85rem; }

/* Calendar */
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; gap: .5rem; }
.cal-nav { display: flex; gap: .35rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-size: .75rem; font-weight: 600; color: var(--muted); text-align: center; padding: .25rem 0; text-transform: uppercase; letter-spacing: .04em; }
.cal-day { min-height: 78px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .35rem; font: inherit; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; color: var(--ink); overflow: hidden; }
.cal-day:hover { border-color: var(--accent); }
.cal-day.other { background: transparent; color: #a3adc4; border-color: transparent; }
.cal-day.today .num { background: var(--yellow); color: var(--navy); }
.cal-day.selected { outline: 2px solid var(--accent); outline-offset: -1px; }
.cal-day .num { font-size: .8rem; font-weight: 600; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 99px; }
.cal-chip { font-size: .72rem; background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.date-pill { display: inline-grid; place-items: center; text-align: center; min-width: 52px; padding: .35rem .5rem; border-radius: 9px; background: var(--accent-soft); color: var(--accent); line-height: 1.1; }
.date-pill b { font-family: var(--font-display); font-size: 1.25rem; }
.date-pill small { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.event-row { display: grid; grid-template-columns: auto 1fr; gap: .9rem; align-items: start; }

/* Cast */
.cast-tools { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.cast-tools input[type=search] { flex: 1 1 240px; max-width: 360px; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink, inherit); border-radius: 99px; padding: .32rem .75rem; font: inherit; font-size: .85rem; cursor: pointer; }
.chip.on { background: var(--yellow); border-color: var(--yellow); color: #0f2557; font-weight: 600; }
.check-row { display: flex; gap: 1.25rem; margin: .25rem 0 .75rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; margin-top: .25rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: #1d4fb8; }

/* Signups */
.signups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; align-items: start; }
.names { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.names li { display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); padding: .35rem .6rem; border-radius: 7px; font-size: .9rem; }
.names li .x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; }
.names li .x:hover { color: var(--danger); }
.join { display: flex; gap: .4rem; }
.join input { flex: 1; font: inherit; border: 1px solid var(--line); border-radius: 9px; padding: .45rem .65rem; min-width: 0; }
.closed-label { font-size: .72rem; text-transform: uppercase; font-weight: 600; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); padding: .15rem .5rem; border-radius: 99px; }
.card.inactive { opacity: .7; }

/* Messages */
.msg { border-left: 3px solid transparent; padding-left: .8rem; }
.msg.unread { border-left-color: var(--accent); }
.new-pill { font-size: .7rem; font-weight: 600; color: var(--navy); background: var(--yellow); padding: .1rem .45rem; border-radius: 99px; margin-left: .4rem; vertical-align: middle; }

/* Notice */
.notice { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--navy); color: #fff; border-left: 6px solid var(--yellow); border-radius: var(--radius); padding: .9rem 1.1rem; }
.notice .btn { background: var(--yellow); color: var(--navy); }

/* Modal */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 2rem)); box-shadow: 0 20px 60px rgba(0,0,0,.25); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(15, 37, 87, .5); }
#modalForm { padding: 1.5rem; display: grid; gap: 1rem; }
#modalBody { display: grid; gap: .85rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; }

/* Toast */
.toast { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: .65rem 1.1rem; border-radius: 10px; font-size: .9rem; z-index: 100; box-shadow: var(--shadow); max-width: calc(100vw - 2rem); }
.toast.err { background: var(--danger); }

/* Olio */
.setlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.number { display: grid; gap: 1rem; }
.number-title { display: flex; gap: .85rem; align-items: flex-start; }
.number-idx { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; width: 2.2rem; height: 2.2rem; border-radius: 99px; background: var(--yellow); color: var(--navy); display: grid; place-items: center; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.media-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; border-top: 1px solid var(--line); padding-top: 1rem; }
.media-section-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.media-section-head h3 { font-size: .95rem; }
.media { background: var(--surface-2); border-radius: 10px; padding: .6rem; display: grid; gap: .45rem; }
.media-head { display: flex; align-items: center; gap: .6rem; }
.media-label { font-weight: 600; font-size: .9rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media audio { width: 100%; height: 40px; }
.media video { width: 100%; max-height: 360px; border-radius: 8px; background: #000; }
.media-loading { font-size: .85rem; color: var(--muted); padding: .5rem 0; }
.progress { display: grid; gap: .35rem; }

@media (max-width: 760px) {
  .media-cols { grid-template-columns: 1fr; }
  .number > .item-head { flex-direction: column; }
  .grid-2 { grid-template-columns: 1fr; }
  .cal-day { min-height: 52px; padding: .2rem; }
  .cal-chip { font-size: 0; height: 6px; width: 6px; padding: 0; border-radius: 99px; background: var(--accent); }
  .cal-day .chips { display: flex; gap: 2px; flex-wrap: wrap; }
  .row { grid-template-columns: 1fr; }
  h1 { font-size: 1.45rem; }
  .topbar .brand { font-size: .98rem; }
  .topbar .logo { width: 34px; height: 34px; }
}

/* Masks badge on navy bar */
.topbar .logo { background: #fff; border-radius: 10px; padding: 3px; }
.topbar .btn { white-space: nowrap; }
.storage { display: grid; gap: .5rem; margin-bottom: 1rem; padding: .9rem 1.1rem; }
.storage-head { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; font-size: .92rem; }
.storage .muted { margin: 0; }
.storage-warn { border-left: 4px solid var(--yellow); }
.storage-warn .bar > div { background: var(--yellow); }

/* Cast table */
.cast-tools { justify-content: flex-start; }
.ct-filter { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9rem; }
.ct-filter select { padding: .5rem 2rem .5rem .7rem; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-weight: 500; background: #fff; min-width: 200px; }
.ct { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.ct-row { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(100px, 1fr) minmax(150px, 1.6fr) minmax(130px, 1.4fr) 56px; gap: .75rem; align-items: center; padding: .5rem .9rem; border-top: 1px solid var(--line); font-size: .92rem; }
.ct.is-prod .ct-row { grid-template-columns: minmax(90px, 1fr) minmax(100px, 1fr) minmax(150px, 1.6fr) minmax(130px, 1.4fr) 56px 104px; }
.ct-row:first-child { border-top: 0; }
.ct-row:nth-child(even):not(.ct-head) { background: #fafbfe; }
.ct-head { background: #f3f5fa; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ct-first, .ct-last { font-weight: 600; overflow-wrap: anywhere; }
.ct-role, .ct-team { overflow-wrap: anywhere; }
.ct-team { color: var(--muted); }
.ct-core { text-align: center; }
.ct-y { display: inline-block; min-width: 1.6rem; padding: .05rem .35rem; border-radius: 6px; background: var(--yellow); color: #0f2557; font-weight: 700; font-size: .82rem; }
.ct-actions { display: flex; gap: .7rem; justify-content: flex-end; }
.ct-count { margin: .6rem 0 0; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: .8rem; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--ink); }
.link-btn.danger { color: #b42318; }
@media (max-width: 760px) {
  .ct .ct-row.ct-head { display: none; }
  .ct .ct-row, .ct.is-prod .ct-row { grid-template-columns: auto auto 1fr auto; grid-template-areas: "first last core act" "role role role role" "team team team team"; gap: .1rem .3rem; padding: .55rem .75rem; }
  .ct-row:first-child + .ct-row { border-top: 0; }
  .ct-first { grid-area: first; } .ct-last { grid-area: last; }
  .ct-core { grid-area: core; text-align: left; padding-left: .3rem; }
  .ct-actions { grid-area: act; }
  .ct-role { grid-area: role; font-size: .86rem; }
  .ct-team { grid-area: team; font-size: .84rem; }
  .ct-role:empty, .ct-team:empty { display: none; }
  .ct-filter { flex: 1 1 100%; } .ct-filter select { flex: 1; min-width: 0; }
  .cast-tools input[type=search] { max-width: none; }
}


/* Holidays */
.cal-chip.cal-hol { background: #e7f4ec; color: #1f6b3a; }
.hol-row { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; margin-bottom: .5rem; border-radius: 8px; background: #e7f4ec; color: #1f6b3a; font-weight: 600; font-size: .9rem; }
.hol-dot { width: 8px; height: 8px; border-radius: 50%; background: #2f8f52; flex: none; }

/* Weather */
.wx-card{margin-bottom:1rem}
.wx-body{display:flex;flex-wrap:wrap;gap:1.25rem;align-items:center;justify-content:space-between}
.wx-now{display:flex;align-items:center;gap:.9rem}
.wx-icon{font-size:2.6rem;line-height:1}
.wx-temp{font-size:1.8rem;font-weight:700;line-height:1.1}
.wx-desc{font-weight:600}
.wx-days{display:grid;grid-template-columns:repeat(5,minmax(58px,1fr));gap:.5rem;flex:1;max-width:460px}
.wx-day{text-align:center;padding:.55rem .25rem;border:1px solid var(--line,#e5e7eb);border-radius:10px;background:var(--bg,#f8fafc)}
.wx-dn{font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;opacity:.75}
.wx-di{font-size:1.5rem;margin:.2rem 0}
.wx-dt{font-size:.9rem}.wx-dt span{opacity:.6}
@media (max-width:640px){.wx-body{flex-direction:column;align-items:stretch}.wx-days{max-width:none;gap:.35rem}.wx-day{padding:.45rem .1rem}}

.wx-right{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;justify-content:flex-end}
.wx-refresh{display:inline-flex;align-items:center;gap:.35rem}
.wx-refresh.spin svg{animation:wxspin .8s linear infinite}
@keyframes wxspin{to{transform:rotate(360deg)}}

/* ===== View picker ===== */
.pick-card { max-width: 440px; }
.pick-title { font-family: var(--font-display); font-size: 1.35rem; margin: 0; }
.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.pick-opt { font: inherit; display: grid; justify-items: center; gap: .3rem; padding: 1.2rem .6rem; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--navy); cursor: pointer; transition: border-color .15s, background .15s; }
.pick-opt:hover, .pick-opt.suggest { border-color: var(--accent); background: var(--accent-soft); }
.pick-opt b { font-size: 1.05rem; }
.pick-opt span { font-size: .82rem; color: var(--muted); }
.switch-btn { display: inline-flex; }

/* ===== Mobile view ===== */
.mnav { display: none; }
body.m .tabs { display: none; }
body.m .switch-btn, body.m #logoutBtn { display: none; }
body.m .topbar { position: sticky; top: 0; z-index: 6; padding: calc(.55rem + env(safe-area-inset-top)) 1rem .55rem; }
body.m .topbar .brand span { font-size: 1rem; }
body.m .topbar .logo { width: 32px; height: 32px; }
body.m .main { max-width: 560px; padding: 1rem .85rem calc(84px + env(safe-area-inset-bottom)); gap: 1rem; }
body.m .page-head h1 { font-size: 1.5rem; }
body.m .card { padding: 1rem; border-radius: 16px; }
body.m .btn { min-height: 40px; }
body.m .btn-sm { min-height: 34px; }
body.m .mnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(15,37,87,.08); padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); }
.mnav button { position: relative; font: inherit; background: none; border: 0; display: grid; justify-items: center; gap: .1rem; padding: .35rem 0; color: var(--muted); font-size: .72rem; font-weight: 600; cursor: pointer; border-radius: 10px; }
.mnav svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mnav button.active { color: var(--navy); }
.mnav button.active svg { stroke: var(--accent); fill: var(--accent-soft); }
.mnav button.active span { color: var(--navy); }
.mbadge { position: absolute; top: 2px; left: 55%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .68rem; font-style: normal; line-height: 18px; text-align: center; }

.m-hello h1 { font-family: var(--font-display); font-size: 1.65rem; margin: 0; }
.m-hello p { margin: .1rem 0 0; }
.m-alert { font: inherit; display: flex; justify-content: space-between; align-items: center; gap: .5rem; width: 100%; padding: .85rem 1rem; border: 1px solid #f1d68a; background: var(--yellow-soft); color: var(--yellow-ink); border-radius: 14px; text-align: left; cursor: pointer; }
.m-alert span { font-weight: 700; }
.m-quick { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.m-next { border-top: 4px solid var(--yellow); }
.m-next-body { display: flex; gap: .9rem; align-items: flex-start; }
.m-next-body h3 { font-family: var(--font-display); font-size: 1.2rem; margin: 0 0 .15rem; }
.date-pill.big { min-width: 62px; padding: .5rem .55rem; }
.date-pill.big b { font-size: 1.6rem; }
.m-when { display: inline-block; margin-top: .45rem; padding: .15rem .55rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .78rem; font-weight: 700; }
.m-after { margin-top: .8rem; padding-top: .7rem; border-top: 1px dashed var(--line); display: grid; gap: .35rem; font-size: .9rem; }
.m-after span { display: inline-block; min-width: 4.2rem; color: var(--muted); font-weight: 600; }
.m-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.m-stats .stat { font: inherit; text-align: left; cursor: pointer; padding: .8rem .9rem; border-radius: 14px; }
.m-stats .stat .value { font-size: 1.45rem; }

body.m .wx-body { flex-direction: column; align-items: stretch; gap: .8rem; }
body.m .wx-days { max-width: none; gap: .35rem; }
body.m .wx-day { padding: .45rem .1rem; }
body.m .wx-right .meta { font-size: .75rem; }
body.m .wx-refresh { min-height: 32px; }
body.m .wx-card .card-head { align-items: flex-start; }

.m-cal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; text-align: center; }
.m-cal-head h1 { font-family: var(--font-display); font-size: 1.4rem; margin: 0; }
.m-cal-head .btn { min-width: 44px; font-size: 1.2rem; }
.m-link { font: inherit; background: none; border: 0; color: var(--accent); font-weight: 600; font-size: .85rem; cursor: pointer; padding: .1rem; }
.m-add { margin-top: -.2rem; }
.m-day { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: .8rem .9rem .3rem; box-shadow: var(--shadow); }
.m-day.past { opacity: .6; }
.m-day.is-today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.m-day-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--navy); margin-bottom: .5rem; }
.m-day-head em { font-style: normal; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; background: var(--accent); color: #fff; }
.m-free { padding-bottom: .5rem; }
.m-day .item:last-child { border-bottom: 0; }

.m-list { padding: .3rem 0 !important; }
.m-row { font: inherit; width: 100%; display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; color: var(--ink); }
.m-row:last-child { border-bottom: 0; }
.m-row > span:nth-child(2) { flex: 1; display: grid; }
.m-row small { color: var(--muted); font-size: .82rem; }
.m-row i { font-style: normal; font-size: 1.4rem; color: var(--muted); }
.m-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; }
.m-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.m-tip { background: var(--surface-2); box-shadow: none; }
.m-tip p { margin: .3rem 0 0; }

.m-clamp { margin: .6rem 0 .2rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.m-clamp.open { display: block; -webkit-line-clamp: unset; }
body.m .wx-card { margin-bottom: 0; }

/* Mobile month calendar */
.m-seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.m-seg button { font: inherit; font-weight: 600; border: 0; background: none; padding: .5rem; border-radius: 9px; color: var(--muted); cursor: pointer; }
.m-seg button.on { background: var(--surface); color: var(--navy); box-shadow: var(--shadow); }
.mm-card { padding: .7rem .5rem .6rem !important; }
.mm-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mm-dow { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding: .2rem 0 .35rem; }
.mm-day { font: inherit; background: none; border: 0; border-radius: 10px; aspect-ratio: 1 / 1.05; display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; padding: .15rem 0 .35rem; cursor: pointer; color: var(--ink); }
.mm-day .n { font-weight: 600; font-size: .95rem; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; }
.mm-day.other { color: #aab3c8; }
.mm-day.today .n { background: var(--yellow); color: var(--navy); }
.mm-day.selected { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.mm-day .dots { display: flex; gap: 3px; height: 6px; }
.mm-day .dots i, .mm-key i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }
.mm-day .dots i.h, .mm-key i.h { background: #2e9152; }
.mm-key { display: flex; gap: 1rem; justify-content: center; font-size: .75rem; color: var(--muted); margin-top: .4rem; }
.mm-key span { display: inline-flex; align-items: center; gap: .35rem; }
.m-day-add { margin: .2rem 0 .6rem; }
.mm-day { aspect-ratio: auto; height: 48px; padding: .1rem 0 .3rem; } .mm-grid { gap: 1px; }
