/* Compagnon d'agenda - interface */

:root {
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #161927;
  --muted: #666c80;
  --line: #e6e3db;
  --accent: #5b4bdb;
  --accent-soft: #ece9fd;
  --accent-ink: #ffffff;
  --teal: #17a69f;
  --coral: #f2704d;
  --ok: #128a5e;
  --ok-soft: #e1f5ec;
  --warn: #b7660b;
  --warn-soft: #fdf0d9;
  --danger: #c2382f;
  --shadow: 0 1px 2px rgba(22, 25, 39, .05), 0 8px 28px -12px rgba(22, 25, 39, .14);
  --shadow-lift: 0 2px 4px rgba(22, 25, 39, .06), 0 20px 44px -16px rgba(22, 25, 39, .24);
  --radius: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f16;
    --surface: #161925;
    --surface-2: #1b1f2d;
    --ink: #eef0f7;
    --muted: #979db3;
    --line: #272b3c;
    --accent: #8f82ff;
    --accent-soft: #24214a;
    --accent-ink: #0d0f16;
    --teal: #3fd0c8;
    --coral: #ff8f70;
    --ok: #4fd39c;
    --ok-soft: #12322a;
    --warn: #f0b354;
    --warn-soft: #382a10;
    --danger: #ff7b72;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -16px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Fond : deux halos qui dérivent lentement */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop::before, .backdrop::after {
  content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(90px); opacity: .17; animation: drift 28s var(--ease) infinite alternate;
}
.backdrop::before { background: var(--accent); top: -28vmax; right: -18vmax; }
.backdrop::after { background: var(--teal); bottom: -34vmax; left: -22vmax; animation-delay: -14s; opacity: .12; }
@keyframes drift { to { transform: translate3d(-6vmax, 5vmax, 0) scale(1.12); } }

/* L'orbe d'Ava */
.orb {
  --size: 44px; position: relative; width: var(--size); height: var(--size); flex: none; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--teal), var(--coral), var(--accent));
  animation: spin 9s linear infinite; box-shadow: 0 6px 22px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
.orb::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .75), transparent 46%);
  animation: spin 9s linear infinite reverse;
}
.orb::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--accent);
  opacity: 0; animation: ring 3.6s ease-out infinite;
}
.orb.big { --size: 92px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ring { 0% { transform: scale(.9); opacity: .5; } 100% { transform: scale(1.35); opacity: 0; } }

/* Structure */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; padding: 26px 18px; display: flex; flex-direction: column; gap: 28px;
  border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand b { display: block; font: 600 17px/1.15 var(--serif); letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 12px; }
.nav { display: grid; gap: 4px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--muted); font-weight: 500; text-decoration: none; transition: color .2s, background .2s;
}
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nav a.on { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.nav a.on svg { color: var(--accent); }
.nav .count {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; text-align: center;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600;
  animation: pop .4s var(--ease);
}
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; flex: none; }
.me > div:not(.avatar) { min-width: 0; flex: 1; }
.me b, .me small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me b { font-size: 13.5px; } .me small { color: var(--muted); font-size: 12px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.main { padding: 44px clamp(18px, 4vw, 56px) 90px; max-width: 1180px; width: 100%; margin: 0 auto; view-transition-name: page; }
::view-transition-old(page) { animation: fade-out .16s ease both; }
::view-transition-new(page) { animation: rise .42s var(--ease) both; }
@keyframes fade-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.rise { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.head h1 { font: 500 clamp(28px, 4vw, 40px)/1.1 var(--serif); letter-spacing: -.02em; }
.head h1 em { font-style: italic; color: var(--accent); }
.head p { color: var(--muted); margin-top: 8px; max-width: 60ch; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 36px 0 14px; font: 600 12px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 22px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { padding: 18px 20px; position: relative; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 96px; height: 96px; border-radius: 50%; background: var(--tone, var(--accent)); opacity: .1; transition: transform .5s var(--ease); }
.stat:hover::after { transform: scale(1.5); }
.stat b { display: block; font: 500 34px/1 var(--serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 550; cursor: pointer; text-decoration: none; color: var(--ink);
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 8px 20px -10px var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); box-shadow: none; }
.btn.danger:hover { color: var(--danger); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

/* Brouillons à valider */
.draft { overflow: hidden; margin-bottom: 14px; transition: opacity .35s, transform .35s var(--ease), max-height .45s var(--ease), margin .45s; max-height: 1400px; }
.draft.leaving { opacity: 0; transform: translateX(28px) scale(.98); max-height: 0; margin: 0; border-width: 0; }
.draft header { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
.draft header > div:not(.orb) { min-width: 0; flex: 1; }
.draft header b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft header small { color: var(--muted); }
.draft textarea { display: block; width: 100%; min-height: 250px; padding: 20px 22px; border: 0; resize: vertical; background: transparent; line-height: 1.65; outline: none; }
.draft footer { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.draft footer span { margin-right: auto; color: var(--muted); font-size: 13px; }

/* Dossiers */
.neg { margin-bottom: 12px; transition: box-shadow .3s, transform .3s var(--ease); }
.neg:hover { box-shadow: var(--shadow-lift); }
.neg > button { all: unset; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) auto; gap: 22px; align-items: center; width: 100%; padding: 18px 22px; cursor: pointer; }
.neg h3 { font-size: 15.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neg .who { color: var(--muted); font-size: 13px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--accent-soft); color: var(--accent); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live::before { animation: pulse 1.8s ease-in-out infinite; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.off { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--muted); }
@keyframes pulse { 50% { transform: scale(1.9); opacity: .35; } }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.steps::before, .steps i { content: ""; position: absolute; left: 12.5%; top: 6px; height: 2px; border-radius: 2px; }
.steps::before { right: 12.5%; background: var(--line); }
.steps i { width: calc(75% * var(--p, 0)); background: linear-gradient(90deg, var(--accent), var(--teal)); transition: width 1s var(--ease); }
.steps span { position: relative; display: grid; justify-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.steps span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); transition: all .4s var(--ease); z-index: 1; }
.steps span.done { color: var(--ink); }
.steps span.done::before { background: var(--accent); border-color: var(--accent); }
.steps span.now::before { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 9px transparent; } }

.neg .more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.neg.open .more { grid-template-rows: 1fr; }
.neg .more > div { overflow: hidden; }
.neg .inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding: 6px 22px 22px; border-top: 1px solid var(--line); margin-top: 0; padding-top: 20px; }
.inner h4 { margin: 0 0 12px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }
.chip.fixed { background: var(--ok-soft); border-color: transparent; color: var(--ok); font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 14px 24px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }
.timeline li.reservation::before { border-color: var(--ok); background: var(--ok); }
.timeline li.proposition::before, .timeline li.relance::before { border-color: var(--accent); }
.timeline li.attention::before, .timeline li.erreur::before { border-color: var(--warn); background: var(--warn); }
.timeline time { display: block; color: var(--muted); font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.empty { text-align: center; padding: 54px 24px; }
.empty .orb { margin: 0 auto 22px; }
.empty h3 { font: 500 22px var(--serif); }
.empty p { color: var(--muted); max-width: 48ch; margin: 10px auto 0; }
.empty code, .kbd { padding: 2px 8px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font: 600 13.5px var(--sans); }

/* Consignes et réglages */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.stack { display: grid; gap: 18px; }
.card h2 { font: 500 20px var(--serif); letter-spacing: -.01em; }
.card h2 + p { color: var(--muted); font-size: 13.5px; margin: 4px 0 18px; }
.consignes { width: 100%; min-height: 150px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); resize: vertical; line-height: 1.6; outline: none; transition: border-color .2s, box-shadow .2s; }
.consignes:focus, .field input:focus, .hours input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ideas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ideas button { all: unset; cursor: pointer; padding: 6px 12px; border-radius: 99px; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; transition: all .2s; }
.ideas button:hover { border-style: solid; border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { all: unset; cursor: pointer; text-align: center; padding: 9px 12px; border-radius: 10px; font-weight: 550; color: var(--muted); transition: all .25s var(--ease); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; min-height: 2.6em; }

.rows { display: grid; gap: 20px; }
.range label, .switch-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.range label span { font-weight: 550; }
.range label b { font: 500 17px var(--serif); color: var(--accent); font-variant-numeric: tabular-nums; }
.range small, .switch-row small { display: block; color: var(--muted); font-size: 12.5px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 12px 0 4px; border-radius: 6px; cursor: pointer; background: linear-gradient(90deg, var(--accent) var(--fill, 50%), var(--line) var(--fill, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow); transition: transform .15s var(--ease); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.25); }
.switch-row { align-items: center; }
.switch-row > div { min-width: 0; }
.switch-row span { font-weight: 550; }
.switch { position: relative; width: 44px; height: 26px; flex: none; border-radius: 99px; border: 0; cursor: pointer; background: var(--line); transition: background .25s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .3s var(--ease); }
.switch[aria-checked=true] { background: var(--accent); }
.switch[aria-checked=true]::after { transform: translateX(18px); }

.hours { display: grid; gap: 8px; }
.hours .day { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hours .day:last-child { border-bottom: 0; }
.hours .day > b { font-weight: 550; }
.hours .day.closed > b { color: var(--muted); }
.hours .ranges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hours .r { display: inline-flex; align-items: center; gap: 6px; animation: pop .3s var(--ease); }
.hours input { padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); outline: none; font-variant-numeric: tabular-nums; }
.hours .x, .hours .add { all: unset; cursor: pointer; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.hours .x:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.hours .add:hover { color: var(--accent); background: var(--accent-soft); }
.hours .none { color: var(--muted); font-size: 13.5px; }
.field input, .field textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); outline: none; resize: vertical; }

.preview { position: sticky; top: 28px; }
.preview .head2 { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.preview .orb { --size: 34px; }
.preview ol { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.preview li { padding: 11px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; animation: rise .45s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
.preview li b { display: block; font-weight: 600; }
.preview li b::first-letter { text-transform: uppercase; }
.preview li span { color: var(--muted); font-size: 13px; }
.saved { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-size: 13px; font-weight: 550; opacity: 0; transition: opacity .3s; }
.saved.on { opacity: 1; }
.skeleton { height: 46px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Journal et administration */
.log { list-style: none; margin: 0; padding: 6px 22px; }
.log li { display: grid; grid-template-columns: 130px 130px minmax(0, 1fr); gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: baseline; }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.log small { display: block; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters button { all: unset; cursor: pointer; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 550; color: var(--muted); transition: all .2s; }
.filters button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.status b { display: block; margin: 10px 0 4px; font-size: 16px; overflow-wrap: anywhere; }
.status p { color: var(--muted); font-size: 13.5px; }
.status .btn { margin-top: 14px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
th, td { padding: 13px 22px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); }

/* Connexion */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login .card { width: min(440px, 100%); padding: 44px 38px; text-align: center; animation: rise .7s var(--ease) both; }
.login .orb { margin: 0 auto 26px; }
.login h1 { font: 500 32px/1.1 var(--serif); letter-spacing: -.02em; }
.login p { color: var(--muted); margin: 12px 0 28px; }
.login .btn { width: 100%; padding: 13px; font-size: 15.5px; }
.login .err { margin-top: 18px; color: var(--danger); font-size: 14px; }
.login small { display: block; margin-top: 22px; color: var(--muted); font-size: 12.5px; }

/* Messages furtifs */
#toasts { position: fixed; right: 22px; bottom: 22px; display: grid; gap: 10px; z-index: 50; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 550; box-shadow: var(--shadow-lift); animation: toast-in .45s var(--ease) both; }
.toast.bad { background: var(--danger); color: #fff; }
.toast.out { animation: toast-out .3s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin-bottom: 22px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; font-weight: 550; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: auto 0 0 0; height: auto; z-index: 20; flex-direction: row; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); }
  .brand, .side .me { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .nav a { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 10.5px; white-space: nowrap; }
  .nav .count { position: absolute; top: 2px; right: 22%; margin: 0; }
  .main { padding-top: 28px; padding-bottom: 110px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .neg .inner, .grid3 { grid-template-columns: 1fr; }
  .preview { position: static; }
  .neg > button { grid-template-columns: 1fr; gap: 14px; }
  .neg > button > .badge { justify-self: start; }
  .log li { grid-template-columns: 1fr; gap: 2px; }
  #toasts { left: 16px; right: 16px; bottom: 84px; }
  th:nth-child(3), td:nth-child(3) { display: none; }
  th, td { padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
