/* ExpMeds - soft, modern UI with view transitions. Light + dark. */
:root {
  --bg: #f4f5fb;
  --bg-2: #eceefa;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --glass: rgba(255, 255, 255, .72);
  --line: #e4e6f0;
  --text: #141627;
  --muted: #6b7088;
  --brand: #6366f1;
  --brand-2: #8b5cf6;
  --brand-soft: #eef0ff;
  --ok: #10b981;
  --ok-soft: #e7f8f1;
  --warn: #f59e0b;
  --warn-soft: #fff5e0;
  --bad: #ef4444;
  --bad-soft: #fdecec;
  --info: #0ea5e9;
  --info-soft: #e6f6fd;
  --red-sticker: #ef4444;
  --green-sticker: #22c55e;
  --shadow: 0 1px 2px rgba(20, 22, 39, .04), 0 8px 24px -8px rgba(20, 22, 39, .10);
  --shadow-lg: 0 24px 60px -12px rgba(20, 22, 39, .25);
  --radius: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg:#0d0f1a; --bg-2:#121527; --surface:#161a2e; --surface-2:#1b2036; --glass:rgba(22,26,46,.72);
    --line:#262b45; --text:#eceefb; --muted:#9097b4; --brand-soft:#23264a; --ok-soft:#0f2b24; --warn-soft:#2e2412; --bad-soft:#331a1d;
    --info-soft:#0f2633; --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px -8px rgba(0,0,0,.5); color-scheme: dark; }
}
:root[data-theme="dark"] { --bg:#0d0f1a; --bg-2:#121527; --surface:#161a2e; --surface-2:#1b2036; --glass:rgba(22,26,46,.72);
  --line:#262b45; --text:#eceefb; --muted:#9097b4; --brand-soft:#23264a; --ok-soft:#0f2b24; --warn-soft:#2e2412; --bad-soft:#331a1d;
  --info-soft:#0f2633; --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px -8px rgba(0,0,0,.5); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 60%),
              radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--brand-2) 8%, transparent), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 26px; height: 26px; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px;
  background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 20px; }
.logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--brand) 60%, transparent); }
.brand b { display: block; font-size: 17px; letter-spacing: -.01em; }
.brand span { font-size: 12px; color: var(--muted); }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 550;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease); position: relative; }
.nav a:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
.nav a.on { background: var(--brand-soft); color: var(--brand); }
.nav a.on::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); view-transition-name: navmark; }
.nav .count { margin-left: auto; font-size: 12px; background: var(--bad); color: #fff; border-radius: 99px; padding: 0 7px; font-weight: 700; }
.side .spacer { flex: 1; }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.me-chip .who { min-width: 0; flex: 1; }
.me-chip .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-chip .who span { font-size: 12px; color: var(--muted); }

.main { min-width: 0; padding: 22px clamp(16px, 3vw, 40px) 60px; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.top h1 { font-size: 26px; letter-spacing: -.02em; margin: 0; }
.top .sub { color: var(--muted); font-size: 14px; }
.top .grow { flex: 1; min-width: 0; }
.btn.menu-btn { display: none; }

/* ---------- controls */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 9px 14px;
  border-radius: 12px; cursor: pointer; font-weight: 600; font-size: 14px; transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn.ok { background: var(--ok); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.btn.icon { padding: 9px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.iconbtn { position: relative; }
.iconbtn .dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; border-radius: 99px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); animation: pop .4s var(--ease); }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--brand-soft); color: var(--brand); }
.monthnav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 3px; }
.monthnav b { min-width: 140px; text-align: center; font-size: 14px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=time], select, textarea, input:not([type]) {
  width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); background: var(--surface); }
textarea { min-height: 80px; resize: vertical; }
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 550; font-size: 14px; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .25s var(--ease); margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s var(--ease); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }

/* ---------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.section-h { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; }
.section-h h2 { font-size: 16px; margin: 0; letter-spacing: -.01em; }
.section-h .pill { font-size: 12px; }
.enter { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }

.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.check-banner { position: relative; overflow: hidden; color: #fff; border: 0;
  background: linear-gradient(135deg, #4f46e5, #7c3aed 55%, #a855f7); }
.check-banner::after { content: ""; position: absolute; width: 260px; height: 260px; right: -60px; top: -90px; border-radius: 50%; background: rgba(255,255,255,.10); }
.check-banner .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.check-banner h3 { margin: 6px 0 8px; font-size: 22px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.check-banner p { margin: 0; opacity: .92; max-width: 60ch; }
.sticker { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 99px; }
.sticker i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.sticker i.r { background: var(--red-sticker); } .sticker i.g { background: var(--green-sticker); } .sticker i.a { background: #fff; }

.stat { display: flex; align-items: center; gap: 18px; }
.ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--line) 0); transition: --p 1s var(--ease); position: relative; }
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.ring b { position: relative; font-size: 22px; letter-spacing: -.02em; }
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
.stat-list { display: grid; gap: 6px; font-size: 14px; flex: 1; }
.stat-list div { display: flex; align-items: center; gap: 8px; }
.stat-list b { margin-left: auto; }
.bullet { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* task card */
.task { display: flex; flex-direction: column; gap: 12px; position: relative; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.task:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.task .head { display: flex; gap: 12px; align-items: flex-start; }
.tile { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; color: var(--brand); background: var(--brand-soft); }
.task .t-name { font-weight: 650; line-height: 1.3; }
.task .t-zone { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.task .foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.task .foot .grow { flex: 1; }
.task.done { background: linear-gradient(0deg, var(--ok-soft), var(--ok-soft)), var(--surface); border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }
.task.done .tile { background: var(--ok); color: #fff; }
.task.overdue { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.task.overdue .tile { background: var(--bad-soft); color: var(--bad); }
.task.due_soon .tile { background: var(--warn-soft); color: var(--warn); }
.task.just-done { animation: celebrate .7s var(--ease); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: #b77400; border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

.av { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11.5px; font-weight: 750; flex: none;
  background: var(--c, var(--brand)); box-shadow: 0 0 0 2px var(--surface); letter-spacing: .02em; }
.av.lg { width: 44px; height: 44px; font-size: 15px; }
.av.xs { width: 22px; height: 22px; font-size: 9.5px; }
.av.empty { background: var(--surface-2); color: var(--muted); border: 1.5px dashed var(--line); box-shadow: none; }
.who-line { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; min-width: 0; }
.who-line span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* zone board */
.zone { padding: 0; overflow: hidden; }
.zone .zh { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.zone .zh b { font-size: 15px; }
.zone .zr { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); transition: background .2s; }
.zone .zr:last-child { border-bottom: 0; }
.zone .zr:hover { background: var(--surface-2); }
.zone .zr .tname { flex: 1; min-width: 0; font-weight: 550; }
.zone .zr .tname small { display: block; color: var(--muted); font-weight: 500; }
.zones { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.check-btn { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer;
  color: transparent; transition: all .25s var(--ease); flex: none; }
.check-btn:hover { border-color: var(--ok); color: var(--ok); transform: scale(1.06); }
.check-btn.on { background: var(--ok); border-color: var(--ok); color: #fff; animation: pop .45s var(--ease); }

/* year grid */
.ygrid-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
table.ygrid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; font-size: 13px; }
.ygrid th, .ygrid td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.ygrid thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; font-weight: 700; font-size: 12px; color: var(--muted); }
.ygrid th.task-col, .ygrid td.task-col { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 2; min-width: 240px; max-width: 280px; padding-left: 14px; }
.ygrid thead th.task-col { z-index: 3; background: var(--surface-2); }
.ygrid td.task-col div { display: flex; gap: 8px; align-items: center; font-weight: 550; }
.ygrid td.task-col span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ygrid tr.zone-row td { background: var(--surface-2); text-align: left; font-weight: 700; font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; padding: 6px 14px; }
.ygrid .cell { display: inline-grid; place-items: center; min-width: 40px; height: 28px; border-radius: 8px; font-weight: 700; font-size: 11.5px; padding: 0 6px; cursor: default; }
.ygrid .cell.done { background: var(--ok-soft); color: var(--ok); }
.ygrid .cell.pending { border: 1.5px dashed var(--line); color: var(--muted); }
.ygrid .cell.overdue { background: var(--bad-soft); color: var(--bad); }
.ygrid .cell.skipped { color: var(--muted); text-decoration: line-through; }
.ygrid th.now { color: var(--brand); }
.ygrid td.now { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.dots { display: inline-flex; gap: 3px; margin-top: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; }

/* waiting for access */
.shell.no-side { grid-template-columns: 1fr; }
.shell.no-side .side { display: none; }
.waiting-box { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }

/* roles matrix */
.roles-grid { min-width: 720px; }
.roles-grid th { vertical-align: top; padding: 12px 8px; }
.roles-grid .role-h { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text); font-size: 13px; }
.roles-grid th.perm-col, .roles-grid td.perm-col { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 2; min-width: 250px; padding-left: 14px; }
.roles-grid thead th.perm-col { background: var(--surface-2); z-index: 3; }
.roles-grid td.perm-col div { display: flex; gap: 10px; align-items: center; font-weight: 550; }
.roles-grid input:disabled { opacity: .55; cursor: not-allowed; }

/* lists */
.list { display: grid; gap: 0; }
.li { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .grow b { display: block; }
.li .grow span { color: var(--muted); font-size: 13px; }
.timeline .li { padding-left: 0; }
.tl-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.tl-ico.ok { background: var(--ok-soft); color: var(--ok); }
.tl-ico.brand { background: var(--brand-soft); color: var(--brand); }

.planner .prow { display: grid; grid-template-columns: minmax(220px, 1.1fr) minmax(200px, 1fr); gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.planner .prow:last-child { border-bottom: 0; }
.planner .prow.task-row { padding-left: 46px; background: transparent; }
.planner .prow.task-row .tn { color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.planner select { padding: 8px 10px; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .big { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty-state b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }

.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 8px; }
.icon-pick button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: all .2s var(--ease); }
.icon-pick button.on { background: var(--brand); color: #fff; border-color: var(--brand); transform: scale(1.06); }

/* ---------- dialog + drawer + toast */
dialog { border: 0; padding: 0; background: transparent; max-width: min(560px, calc(100vw - 24px)); width: 100%; color: var(--text); }
dialog::backdrop { background: rgba(13, 15, 26, .45); backdrop-filter: blur(4px); animation: fade .25s var(--ease); }
dialog[open] .sheet { animation: sheet .38s var(--ease); }
.sheet { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 22px; border: 1px solid var(--line); max-height: calc(100vh - 40px); overflow: auto; }
.sheet .sh { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.sheet .sh h3 { margin: 0; font-size: 18px; flex: 1; }
.sheet .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.drawer { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(400px, calc(100vw - 24px)); z-index: 50; background: var(--surface);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transform: translateX(110%); transition: transform .4s var(--ease); }
.drawer.open { transform: none; }
.drawer .dh { display: flex; align-items: center; gap: 10px; padding: 18px 18px 10px; }
.drawer .dh h3 { margin: 0; flex: 1; font-size: 17px; }
.drawer .db { overflow: auto; padding: 0 18px 18px; }
.notif { padding: 12px; border-radius: 14px; margin-bottom: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.notif.unread { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--brand-soft); }
.notif b { display: block; font-size: 14px; }
.notif p { margin: 4px 0; font-size: 13.5px; }
.notif small { color: var(--muted); font-size: 12px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: #141627; color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg);
  font-weight: 550; font-size: 14px; animation: toast .4s var(--ease); pointer-events: auto; }
.toast.bad { background: var(--bad); }
.toast.out { animation: toastout .3s var(--ease) forwards; }
.scrim { position: fixed; inset: 0; background: rgba(13,15,26,.35); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border: 1px solid var(--line); }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--info-soft); color: var(--text); font-size: 14px; }
.callout svg { color: var(--info); }
.callout.warn { background: var(--warn-soft); } .callout.warn svg { color: var(--warn); }
code, pre { font-family: ui-monospace, "Cascadia Code", Menlo, monospace; font-size: 12.5px; }
pre { background: var(--surface-2); border: 1px solid var(--line); padding: 12px; border-radius: 12px; overflow: auto; white-space: pre-wrap; }

/* ---------- animations */
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheet { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes celebrate { 0% { transform: scale(1); } 35% { transform: scale(1.03); box-shadow: 0 0 0 8px color-mix(in srgb, var(--ok) 25%, transparent); } 100% { transform: scale(1); } }
@keyframes toast { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toastout { to { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes shimmer { to { background-position: -200% 0; } }
::view-transition-old(main) { animation: vt-out .18s var(--ease) both; }
::view-transition-new(main) { animation: vt-in .32s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
.main { view-transition-name: main; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); text-align: center; padding: 36px 30px; animation: sheet .6s var(--ease); }
.login-card .logo { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 18px; }
.login-card h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; }
.login-card .btn { width: 100%; justify-content: center; padding: 13px; margin-top: 22px; font-size: 15px; }
.login-card .err { margin-top: 16px; color: var(--bad); font-size: 14px; }
.floaters { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.floaters span { position: absolute; color: color-mix(in srgb, var(--brand) 25%, transparent); animation: float 14s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-30px) rotate(12deg); } }
.dev-login { display: grid; place-items: center; min-height: 100vh; }
.dev-login form { display: grid; gap: 8px; width: 360px; }
.dev-login button { padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; text-align: left; }

/* ---------- print (inspection report) */
@media print {
  .side, .top .actions, .menu-btn, .no-print { display: none !important; }
  .shell { display: block; } body { background: #fff; } .card, .ygrid-wrap { box-shadow: none; }
}

/* ---------- responsive */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .zones { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 45; left: 0; width: 280px; transform: translateX(-105%); transition: transform .35s var(--ease); }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .btn.menu-btn { display: inline-flex; }
  .top { flex-wrap: wrap; }
  .top h1 { font-size: 22px; }
  .grid2 { grid-template-columns: 1fr; }
  .planner .prow { grid-template-columns: 1fr; }
  .planner .prow.task-row { padding-left: 18px; }
  .cards { grid-template-columns: 1fr; }
}
