/* Fitnesstracker – dunkles Design, zuerst fürs Handy gebaut (ab 900px Breite mit Seitenleiste). */
:root {
  color-scheme: dark;
  --page: #0b0d11; --surface: #15181e; --surface-2: #1e222b; --surface-3: #282d38;
  --ink: #f3f4f6; --ink-2: #b6bac4; --muted: #7f8591;
  --grid: #262a33; --axis: #363b47; --border: rgba(255,255,255,.07);
  --accent: #c8f03c; --accent-ink: #d6f76e; --accent-on: #10130a; --accent-wash: rgba(200,240,60,.12);
  /* Diagrammfarben: feste Reihenfolge, gegen --surface geprüft */
  --s-run: #3987e5; --s-ride: #d95926; --s-strength: #199e70; --s-other: #c98500; --s-cardio: #d55181;
  --s-walk: #008300; --s-swim: #9085e9;
  --s-5: #d55181; --s-7: #9085e9;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --good-text: #4cd04c; --danger-text: #f08080;
  --radius: 20px; --radius-s: 12px;
  --nav-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { background: var(--page); }
body { background: var(--page); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
h1 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; margin: 0; line-height: 1.15; }
h2 { font-size: 16px; font-weight: 650; margin: 0 0 10px; letter-spacing: -.005em; }
h3 { font-size: 13px; font-weight: 650; margin: 0 0 6px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
p { margin: 0 0 10px; } a { color: var(--accent-ink); text-underline-offset: 3px; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.only-d, .hide-m { display: none !important; }

/* ---------- Grundgerüst ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(11,13,17,.82); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.topbar a.round { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); border: 1px solid var(--border); }
.topbar a.round.active { color: var(--accent); }
.topbar a.round svg { width: 20px; height: 20px; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: space-around; gap: 2px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(17,20,25,.9); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--border); }
.nav .brand, .nav .spacer, .nav .nav-extra { display: none; }
.nav a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 5px; border-radius: 14px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
.nav a svg { width: 23px; height: 23px; flex: none; }
.nav a.active { color: var(--accent); }
.nav a.active svg { filter: drop-shadow(0 0 8px rgba(200,240,60,.45)); }
.main { padding: 6px 16px calc(var(--nav-h) + 34px + env(safe-area-inset-bottom)); width: 100%; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Karten und Raster ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; }
.grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.tile .label { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.tile .value { font-size: 28px; font-weight: 750; line-height: 1.15; margin-top: 4px; letter-spacing: -.02em; }
.tile .value small { font-size: 14px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.tile .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.hero .value { font-size: 52px; }
.hero { background: radial-gradient(120% 90% at 100% 0%, rgba(57,135,229,.16), transparent 60%), var(--surface); }
.delta-up { color: var(--good-text); } .delta-down { color: var(--danger-text); }
#briefing { background: radial-gradient(130% 100% at 0% 0%, rgba(200,240,60,.13), transparent 62%), var(--surface); border-color: rgba(200,240,60,.22); }

/* Statusanzeige: immer Form + Text, nie nur Farbe */
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; font-size: 13px; padding: 5px 11px; border-radius: 99px; background: var(--surface-2); }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.status.good::before { background: var(--good); } .status.warning::before { background: var(--warning); border-radius: 2px; }
.status.serious::before { background: var(--serious); border-radius: 2px; transform: rotate(45deg); }
.status.critical::before { background: var(--critical); border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }

/* ---------- Bedienelemente ---------- */
button, .btn { font: inherit; font-weight: 600; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); min-height: 44px; padding: 9px 16px; border-radius: var(--radius-s); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: transform .08s, background .15s; }
button:hover { background: var(--surface-3); }
button:active { transform: scale(.97); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-on); font-weight: 700; }
button.primary:hover { background: #d6f76e; }
button.danger { color: var(--danger-text); }
button.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: .5; cursor: default; transform: none; }
button.icon { padding: 0; width: 44px; flex: none; }
/* Große Auswahlkachel mit Liniensymbol (z. B. Foto aufnehmen / aus Galerie) */
button.pick { flex-direction: column; gap: 8px; min-height: 92px; border-radius: 16px; font-size: 14px; color: var(--ink); padding: 10px 6px; }
#qm-state:empty, #adapt-state:empty, #photo-state:empty { display: none; }
button.pick svg { width: 28px; height: 28px; color: var(--accent); }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-s); padding: 10px 12px; width: 100%; min-width: 0; min-height: 46px; }
input[type=checkbox] { min-height: 0; width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
/* Schalter (ein/aus) */
input.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--surface-3); border: 0; padding: 0; position: relative; cursor: pointer; transition: background .15s; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink-2); transition: transform .15s, background .15s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(18px); background: var(--accent-on); }
input.switch:focus { box-shadow: 0 0 0 3px var(--accent-wash); }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 76px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: grid; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 550; }
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.form-actions button { flex: 1 1 auto; }
.hint { font-size: 13px; color: var(--muted); }
.notice { border-radius: 14px; padding: 12px 14px; background: var(--surface-2); color: var(--ink); font-size: 14px; border-left: 3px solid var(--accent); }
.notice.warn { border-left-color: var(--warning); }
.notice.err { border-left-color: var(--critical); }
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding: 2px; margin: -2px; flex-wrap: nowrap !important; }
.seg::-webkit-scrollbar { display: none; }
.seg button { min-height: 38px; padding: 6px 14px; border-radius: 99px; font-weight: 600; font-size: 14px; color: var(--ink-2); background: var(--surface-2); white-space: nowrap; flex: none; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-on); }

/* ---------- Listen und Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list { display: grid; grid-template-columns: minmax(0, 1fr); }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--grid); min-height: 56px; }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .right { white-space: nowrap; flex: none; font-weight: 600; }
.item .right .small { font-weight: 400; }
.item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item button { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.item button.icon { width: 38px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); box-shadow: 0 0 0 4px rgba(255,255,255,.04); }
.dot.run { background: var(--s-run); } .dot.ride, .dot.cross { background: var(--s-ride); }
.dot.strength { background: var(--s-strength); } .dot.cardio { background: var(--s-cardio); }
.dot.walk { background: var(--s-walk); } .dot.swim { background: var(--s-swim); }
/* Wandern, Mobilität und eigene Sportarten haben die Farbe von "Sonstiges" – so wie im Verlaufsdiagramm */
.dot.other, .dot.mobility, .dot.hike, .dot[class*=" c_"] { background: var(--s-other); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip .dot { box-shadow: none; width: 8px; height: 8px; }
.empty { text-align: center; color: var(--muted); padding: 30px 14px; }
.empty h2 { color: var(--ink); font-size: 18px; }

/* ---------- Aufklappbare Bereiche ---------- */
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 650; font-size: 16px; min-height: 30px; user-select: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary > span:first-child { flex: 1; min-width: 0; }
details.fold > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); flex: none; margin: -4px 4px 0 2px; transition: transform .15s; }
details.fold[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
details.fold[open] > summary { margin-bottom: 12px; }
.fold-sub { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
details.fold.inner { border-top: 1px solid var(--grid); margin-top: 14px; padding-top: 12px; }
details.fold.inner > summary { font-size: 15px; font-weight: 600; color: var(--ink-2); min-height: 26px; }
a.item, a.wo { color: inherit; text-decoration: none; }

/* ---------- Trainingsplan ---------- */
.week-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.days { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.day { display: flex; align-items: flex-start; gap: 10px; }
.day.rest { display: none; }
.day .dname { width: 44px; flex: none; display: flex; flex-direction: column; align-items: center; padding: 8px 0; border-radius: 12px; background: var(--surface-2); font-size: 12px; color: var(--ink-2); font-weight: 600; line-height: 1.3; }
.day .dname span:last-child { font-size: 11px; color: var(--muted); font-weight: 500; }
.day.today .dname { background: var(--accent); color: var(--accent-on); }
.day.today .dname span:last-child { color: var(--accent-on); }
.day .wos { flex: 1; display: grid; gap: 6px; min-width: 0; }
.wo { background: var(--surface-2); border: 0; border-left: 4px solid var(--muted); border-radius: 12px; padding: 10px 12px; font-size: 14px; cursor: pointer; text-align: left; display: block; width: 100%; font-weight: 400; min-height: 52px; }
.wo.run { border-left-color: var(--s-run); } .wo.cross { border-left-color: var(--s-ride); }
.wo.strength { border-left-color: var(--s-strength); } .wo.mobility { border-left-color: var(--s-other); }
.wo b { display: block; font-weight: 650; overflow-wrap: anywhere; }
.wo.done { opacity: .6; } .wo.skipped { opacity: .45; text-decoration: line-through; }
.wo .meta { color: var(--muted); font-size: 12.5px; }
.plan-summary { order: 1; } .plan-late { order: 2; } /* Handy: erst die Wochen, dann Einordnung und Struktur */
.outline { display: grid; gap: 4px; }
.outline .o-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 4px 10px; font-size: 13px; padding: 9px 10px; border-radius: 12px; }
.outline .o-row .o-focus { grid-column: 1 / -1; color: var(--ink-2); }
.outline .o-row.cur { background: var(--accent-wash); }
.steps { margin: 6px 0 0; padding-left: 20px; }
.steps li { margin-bottom: 5px; }
.steps li::marker { color: var(--accent); }

/* ---------- Ernährung ---------- */
.meter { height: 10px; border-radius: 99px; background: var(--accent-wash); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.meter.over { background: rgba(236,131,90,.18); } .meter.over > i { background: var(--serious); }
.macro { display: grid; gap: 5px; font-size: 13px; }
.macro .top { display: flex; justify-content: space-between; color: var(--ink-2); }
.macro .meter { height: 6px; }
.meal-photo { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex: none; background: var(--surface-2); }
.photo-big { width: 100%; max-height: 240px; object-fit: cover; border-radius: 16px; }
.items-edit { display: grid; gap: 6px; }
.items-edit .ie-row { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) 40px; gap: 6px; align-items: center; }
.items-edit .opt { display: none; }
.items-edit .ie-head { font-size: 12px; color: var(--muted); }
.items-edit input { padding: 8px; min-height: 42px; }
.items-edit button.icon { width: 40px; min-height: 42px; }
.drop { border: 1.5px dashed var(--axis); border-radius: 18px; padding: 20px 14px; text-align: center; display: grid; gap: 12px; justify-items: stretch; }
.drop .form-actions { flex-direction: column; }

/* ---------- Coach-Chat ---------- */
.topbar a.round { text-decoration: none; }
.msgs { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-on); border-bottom-right-radius: 6px; font-weight: 500; }
.msg.coach { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.msg.wait { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.chat-ideas { display: grid; gap: 8px; }
.chat-ideas button { justify-content: flex-start; text-align: left; font-weight: 500; }
.chat-input { position: sticky; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: flex-end; padding: 8px; margin: 0 -4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.chat-input textarea { background: none; border: 0; box-shadow: none !important; min-height: 44px; max-height: 140px; resize: none; padding: 10px 8px; }
.chat-input button.icon { border-radius: 50%; }
.chat-input button svg { width: 20px; height: 20px; }
.chat { display: flex; flex-direction: column; min-height: calc(100dvh - 170px - var(--nav-h)); }
.chat .msgs { flex: 1; }

/* ---------- Diagramme ---------- */
.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .hover-band { fill: var(--ink); opacity: 0; }
.chart .hover-band.on { opacity: .06; }
.chart .cross { stroke: var(--axis); stroke-width: 1; }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.legend i.line { height: 2px; width: 14px; border-radius: 1px; }
.tip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.5); border-radius: 12px; padding: 9px 11px; font-size: 12px; z-index: 5; min-width: 130px; display: none; }
.tip b { display: block; margin-bottom: 4px; }
.tip div { display: flex; justify-content: space-between; gap: 14px; }
.tip div span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.zones { display: flex; height: 28px; gap: 2px; }
.zones span { border-radius: 4px; min-width: 0; font-size: 12px; font-weight: 650; padding: 5px 6px; overflow: hidden; white-space: nowrap; }

/* ---------- Dialoge (auf dem Handy als Blatt von unten) ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.62); display: grid; align-items: end; z-index: 50; animation: fade .15s; }
.modal { background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: 24px 24px 0 0; width: 100%; max-height: 92dvh; overflow: auto; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); animation: rise .22s cubic-bezier(.2,.8,.2,1); overscroll-behavior: contain; }
.modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--axis); margin: -6px auto 12px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.modal-head h2 { font-size: 19px; margin: 6px 0 0; }
.modal-head button.icon { border-radius: 50%; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; margin-bottom: 14px; }
.kv div { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.kv span { display: block; font-size: 12px; color: var(--ink-2); } .kv b { font-size: 17px; letter-spacing: -.01em; }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(8px); background: var(--ink); color: var(--page); padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--axis); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex: none; }
button.primary .spinner { border-color: rgba(0,0,0,.25); border-top-color: var(--accent-on); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px 16px; background: radial-gradient(90% 60% at 50% 0%, rgba(200,240,60,.10), transparent 70%); }
.auth .card { width: min(420px, 100%); padding: 22px; }
.auth .brand { padding: 0 0 16px; font-size: 19px; }
.auth button.primary { min-height: 50px; }

/* ---------- Ab Tablet/Desktop: Seitenleiste, mehrspaltig ---------- */
@media (min-width: 900px) {
  .only-d, .hide-m { display: revert !important; } .only-m { display: none !important; }
  .nav a.only-d { display: flex !important; }
  .shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
  .topbar { display: none; }
  .nav { position: sticky; top: 0; height: 100vh; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 20px 12px; border-top: 0; border-right: 1px solid var(--border); background: var(--surface); backdrop-filter: none; }
  .nav .brand { display: flex; padding: 4px 10px 18px; } .nav .spacer { display: block; flex: 1; } .nav .nav-extra { display: block; }
  .nav a { flex: none; flex-direction: row; gap: 11px; font-size: 15px; padding: 10px 12px; border-radius: 12px; }
  .nav a svg { width: 20px; height: 20px; }
  .nav a:hover { background: var(--surface-2); color: var(--ink); }
  .nav a.active { background: var(--accent-wash); }
  .main { padding: 26px 30px 60px; max-width: 1200px; }
  .card { padding: 18px; }
  .grid, .stack { gap: 14px; }
  .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .form-actions button { flex: none; }
  .drop .form-actions { flex-direction: row; justify-content: center; }
  .plan-summary, .plan-late { order: 0; }
  .days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .day { flex-direction: column; background: var(--surface-2); border-radius: 14px; padding: 8px; min-height: 96px; gap: 6px; }
  .day.rest { display: flex; }
  .day .dname { width: auto; flex-direction: row; justify-content: space-between; align-self: stretch; padding: 2px 6px; background: none; }
  .day.today { outline: 2px solid var(--accent); }
  .day.today .dname { background: none; color: var(--accent); } .day.today .dname span:last-child { color: var(--accent); }
  .wo { background: var(--surface); font-size: 13px; min-height: 0; padding: 7px 9px; }
  .outline .o-row { grid-template-columns: 74px 110px 1fr auto; } .outline .o-row .o-focus { grid-column: auto; }
  .items-edit .ie-row { grid-template-columns: minmax(0, 2.2fr) repeat(5, minmax(0, 1fr)) 40px; } .items-edit .opt { display: block; }
  .modal-back { align-items: center; justify-items: center; padding: 16px; }
  .modal { width: min(640px, 100%); border-radius: 24px; border-bottom: 1px solid var(--border); max-height: calc(100vh - 32px); padding: 22px; animation: fade .15s; }
  .modal::before { display: none; }
  #toast { bottom: 28px; }
  .chat { max-width: 760px; min-height: calc(100vh - 110px); } .chat-input { bottom: 20px; }
}
