/* Silos - visual refinement layer, loaded after style.css: shell, navigation, controls, tables, panels, sign-in.
   Everything is expressed with the tokens of style.css so light and dark stay in step. */

/* ---------- foundations */
body { font-size: 0.875rem; line-height: 1.5; letter-spacing: -0.003em; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--faint) 50%, transparent) transparent; }
h1, h2, h3 { letter-spacing: -0.015em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 0.375rem; }
.page-head h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; }
.muted { color: var(--muted); }

/* ---------- sidebar */
.sidebar { background: var(--surface); }
.brand { padding: 1.125rem 1.125rem 0.875rem; gap: 0.75rem; }
.logo { width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; padding: 0.28rem; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 2px 8px rgba(0, 0, 0, 0.22); }
.brand-text strong { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.025em; }
.brand-text small { color: var(--faint); letter-spacing: 0.02em; }
.proto { border: 0; background: var(--surface-3); color: var(--faint); font-weight: 600; padding: 2px 0.5rem; text-transform: none; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; } /* the version, e.g. v0.5.0 */
.side-label { font-size: 0.6875rem; letter-spacing: 0.09em; color: var(--faint); padding: 1rem 0.625rem 0.4rem; }
.projects { padding: 0 0.75rem 0.75rem; }
.proj-row { border-radius: 0.5rem; transition: background 0.12s; }
.proj-row::before { content: ""; position: absolute; left: 0; top: 0.45rem; bottom: 0.45rem; width: 3px; border-radius: 3px; background: var(--accent); opacity: 0; transform: scaleY(0.4); transition: opacity 0.14s, transform 0.14s; }
.proj-row.active { background: var(--accent-soft); }
.proj-row.active::before { opacity: 1; transform: none; }
.proj-row.active .pn { color: var(--accent-ink); }
.proj-name { font-size: 0.875rem; }
.pn { font-weight: 500; }
.count { background: transparent; padding: 0; min-width: 0; color: var(--faint); font-size: 0.75rem; font-weight: 500; }
.proj-row.active .count { background: transparent; color: var(--accent-ink); }
.proj-row .key { color: var(--faint); letter-spacing: 0.03em; }
.chk { border: 1.5px solid color-mix(in srgb, var(--faint) 65%, transparent); background: var(--surface); border-radius: 0.3125rem; transition: background 0.12s, border-color 0.12s; }
.chk:hover { border-color: var(--accent); }
.proj-pinned { border: 0; background: var(--surface-3); border-radius: 0.75rem; padding: 3px; margin-bottom: 0.625rem; }
.proj-pinned .proj-row { border-radius: 0.5625rem; }
.proj-pinned .proj-row.active { background: var(--surface); box-shadow: var(--shadow-sm); }
.proj-pinned .proj-row.all .proj-name { padding-left: 0.75rem; }
.proj-scroll { padding-right: 2px; }
.add-proj { color: var(--muted); border: 1px dashed var(--line); border-radius: 0.625rem; justify-content: center; height: 2.125rem; margin-top: 0.75rem; }
.add-proj:hover { color: var(--fg); border-color: var(--faint); background: transparent; }
.side-hint { color: var(--faint); }
.side-foot { padding: 0.625rem 0.75rem; border-top: 1px solid var(--line); background: var(--surface); }
.me-btn { border-radius: 0.625rem; }
.side-nav { border-bottom: 1px solid var(--line-soft); padding: 0.25rem 0.75rem 0.625rem; }
.side-nav .tab { border-radius: 0.5rem; padding: 0.5rem 0.625rem; font-size: 0.875rem; }
.side-nav .tab[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- top bar: underline tabs */
.topbar { height: 3.5rem; gap: 1.25rem; padding: 0 1.5rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.title h1 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.02em; }
.keytag { color: var(--faint) !important; font-weight: 600; letter-spacing: 0.04em; }
.tabs { align-self: stretch; gap: 0.125rem; margin-left: 0.25rem; }
.tabs .tab { position: relative; border-radius: 0; padding: 0 0.75rem; color: var(--muted); font-weight: 500; }
.tabs .tab:hover { background: transparent; color: var(--fg); }
.tabs .tab[aria-current="page"] { background: transparent; color: var(--fg); }
.tabs .tab[aria-current="page"]::after { content: ""; position: absolute; left: 0.5rem; right: 0.5rem; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
.tabs .tab svg { transition: color 0.12s; }
.tabs .tab[aria-current="page"] svg { color: var(--accent); }
.search input { height: var(--ctl); background: var(--surface-3); border: 1px solid transparent; border-radius: 0.5625rem; transition: border-color 0.12s, background 0.12s, box-shadow 0.12s; }
.search input:hover { border-color: var(--line); }
.search input:focus { background: var(--surface); border-color: var(--accent); box-shadow: var(--ring); outline: none; }
.icon-btn { border-radius: 0.5rem; transition: background 0.12s, color 0.12s; }

/* ---------- buttons, inputs, chips */
.btn { height: var(--ctl); border-radius: 0.5625rem; border-color: var(--line); box-shadow: var(--shadow-sm); font-weight: 500; transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.06s; }
.btn:hover { background: var(--surface-3); border-color: color-mix(in srgb, var(--line) 60%, var(--faint)); }
.btn:active { transform: translateY(0.5px); }
.btn.primary { background: var(--accent); border-color: color-mix(in srgb, var(--accent) 82%, #000); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.16); }
.btn.primary:hover { background: var(--accent-hover); filter: none; }
.btn.danger { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.btn.ghost { box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn.sm { height: 1.75rem; border-radius: 0.5rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.input, select, .cell-input { border-color: var(--line); border-radius: 0.5rem; transition: border-color 0.12s, box-shadow 0.12s, background 0.12s; }
.input:hover, select:hover { border-color: color-mix(in srgb, var(--line) 55%, var(--faint)); }
.input:focus, select:focus, .cell-input:focus { border-color: var(--accent); box-shadow: var(--ring); outline: none; }
.input.invalid { box-shadow: 0 0 0 3px var(--crit-soft); }
.field-label, .meta-field > span { font-size: 0.75rem; font-weight: 500; color: var(--muted); letter-spacing: 0.005em; }
.seg { border-radius: 0.625rem; background: var(--surface-3); border: 0; padding: 3px; gap: 2px; }
.seg-btn { border: 0 !important; border-radius: 0.4375rem; padding: 0.3125rem 0.75rem; }
.seg-btn:hover { color: var(--fg); }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.seg.sm .seg-btn { padding: 2px 0.625rem; }
.chipf { border-radius: 6.1875rem; transition: background 0.12s, border-color 0.12s; }
.chipf:hover { background: var(--surface-3); }
.chipf[aria-pressed="true"] { background: var(--chip-on); border-color: var(--chip-on); }
.pill { padding: 1px 1.3rem 1px 0.5rem; font-weight: 500; background: color-mix(in srgb, var(--c) 11%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 20%, transparent); }
.keychip { background: var(--surface-3); border-radius: 0.375rem; font-weight: 500; }
.avatar { box-shadow: 0 0 0 2px var(--surface); }
.track { background: var(--surface-3); }

/* ---------- filter bar */
.filterbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 0.625rem 1.5rem; gap: 0.5rem 1rem; }
.sel { border-radius: 0.5rem; background: var(--surface); }

.filterbar .filters, .filterbar .tools { gap: 0.375rem; }
.filterbar .sel { height: 1.75rem; font-size: 0.75rem; padding: 0 0.375rem; }
.filterbar .chipf { height: 1.625rem; font-size: 0.75rem; padding: 0 0.5rem; }
.filterbar .btn.sm { height: 1.75rem; }
.filterbar .check { font-size: 0.75rem; }
.search input { width: clamp(8rem, 15vw, 13.75rem); }
.proj-row::before { left: 3px; }

/* ---------- table */
.tbl-wrap { background: var(--surface); }
.grid th { background: var(--surface-2); border-right: 0; height: 2.125rem; border-bottom: 1px solid var(--line); }
.th-btn { font-size: 0.6875rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 0 0.75rem; }
.th-btn:hover { color: var(--fg); background: var(--hover); }
.grid td { border-right: 0; border-bottom: 1px solid var(--line-soft); }
.row:hover td { background: var(--hover); }
.group-row td { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.group-btn { font-size: 0.8125rem; }
.cell-input { border-color: transparent; background: transparent; }
.cell-input:hover { border-color: var(--line); }

/* ---------- team and settings: editable fields look like text until hovered */
.edit-row .input, .edit-row select { border-color: transparent; background: transparent; }
.edit-row .input:hover, .edit-row select:hover { border-color: var(--line); background: var(--surface); }
.edit-row .input:focus, .edit-row select:focus { border-color: var(--accent); background: var(--surface); }

/* ---------- cards, panels */
.card { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 1.125rem 1.25rem; }
.card-head h2, .block h2 { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; }
.cl-card:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: var(--shadow); }
.empty h3 { font-size: 1.0625rem; font-weight: 600; }

/* ---------- dashboard widgets */
.widget { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 1rem 1.125rem; gap: 0.625rem; }
.wd-head h3 { font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.wd-count strong { font-size: 2.5rem; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.wd-count span { color: var(--faint); font-size: 0.75rem; }
.bar-track { height: 0.5rem; background: var(--surface-3); }
.bar-label { font-size: 0.8125rem; }

/* ---------- side panel, dialogs, menus */
.scrim, dialog.modal::backdrop { background: var(--scrim); }
.scrim { backdrop-filter: blur(2px); }
dialog.modal::backdrop { backdrop-filter: blur(3px); }
.drawer { width: min(38rem, 100vw); border-left: 1px solid var(--line); box-shadow: var(--shadow); }
.drawer-head { background: var(--surface); padding: 0.625rem 1rem; }
.drawer-body { padding: 1.25rem 1.5rem 2.5rem; }
.drawer-title { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; }
.prop-label { font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.dsec-head h3 { font-size: 0.6875rem; letter-spacing: 0.09em; color: var(--faint); font-weight: 600; }
dialog.modal { border-radius: 1rem; border: 1px solid var(--line); box-shadow: var(--shadow); }
.modal-head h2 { font-size: 1.0625rem; font-weight: 600; }
.modal-foot { background: var(--surface-2); border-radius: 0 0 1rem 1rem; margin-top: 0.75rem; }
.menu { border-radius: 0.75rem; box-shadow: var(--shadow); padding: 0.3125rem; }
.menu-item { border-radius: 0.5rem; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); }
#toasts > *, .toast { border-radius: 0.625rem; box-shadow: var(--shadow); }

/* ---------- timeline */
.bar { border-radius: 0.4375rem; background: color-mix(in srgb, var(--c) 24%, var(--surface)); color: var(--fg); box-shadow: var(--shadow-sm); }
.bar-fill { background: color-mix(in srgb, var(--c) 52%, transparent); }
.bar.type-feature { background: var(--c); color: #fff; }
.bar.type-feature .bar-fill { background: rgba(0, 0, 0, 0.26); }
.today-line { opacity: 0.8; }

/* ---------- sign-in: brand panel + form */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; padding: 0; background: var(--bg); place-items: stretch; }
.auth-stage { display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-hero { display: none; }
.auth-card { width: min(25rem, 100%); border: 1px solid var(--line); border-radius: 1.125rem; padding: 2rem 2rem 1.75rem; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; margin-bottom: 0.25rem; }
.auth-card .field { margin-bottom: 0.875rem; }
.auth-card .field:first-of-type { margin-top: 1.125rem; }
.auth-card .input { height: 2.625rem; }
.auth-brand { margin-bottom: 1.5rem; font-size: 1.125rem; }
.auth-brand .logo { width: 2.75rem; height: 2.75rem; border-radius: 0.75rem; }
.wide-btn { height: 2.625rem; margin-top: 0.75rem; font-size: 0.9375rem; }
.auth-links { margin: 0.25rem 0 0.5rem; }
@media (min-width: 62rem) {
  .auth-wrap { grid-template-columns: minmax(24rem, 5fr) minmax(0, 6fr); }
  .auth-hero { display: flex; flex-direction: column; justify-content: space-between; padding: 3rem; color: #f2f4f8; position: relative; overflow: hidden;
    background: radial-gradient(48rem 32rem at 12% 8%, rgba(var(--g1), 0.34), transparent 60%), radial-gradient(40rem 30rem at 100% 100%, rgba(var(--g2), 0.22), transparent 62%), #0b0f15; }
  .auth-hero::before { content: ""; position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px); background-size: 3rem 3rem;
    mask-image: radial-gradient(60% 60% at 30% 25%, #000, transparent 85%); -webkit-mask-image: radial-gradient(60% 60% at 30% 25%, #000, transparent 85%); }
  .auth-hero > * { position: relative; }
  .auth-hero .logo { width: 4rem; height: 4rem; border-radius: 1rem; padding: 0.5rem; background: #05070a; margin-bottom: 1.75rem; }
  .auth-hero h2 { font-size: 3.25rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1; margin-bottom: 0.875rem; }
  .auth-hero { border-right: 1px solid rgba(255, 255, 255, 0.07); }
  .auth-hero small { font-size: 0.8125rem; color: rgba(242, 244, 248, 0.5); letter-spacing: 0.04em; }
  .auth-card .auth-brand { display: none; }
  .auth-card { border: 0; box-shadow: none; background: transparent; padding: 2rem 0.5rem; width: min(24rem, 100%); }
  .auth-card h1 { font-size: 1.75rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .auth-card { animation: auth-in 0.32s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes auth-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ---------- long lists draw only the rows near the viewport (js/vwindow.js): the spacers carry the height */
.vw-spacer td { padding: 0; border: 0; }
tr.vw-spacer { pointer-events: none; }

/* ---------- fold / unfold sub-tasks (table and timeline) */
.twisty { display: inline-flex; align-items: center; gap: 0.25rem; flex: none; height: 1.5rem; min-width: 1.5rem; padding: 0 0.125rem; margin-left: -0.125rem; border: 0; border-radius: 0.375rem; background: transparent; color: var(--muted); }
.twisty.none { pointer-events: none; }
button.twisty:hover { background: var(--surface-3); color: var(--fg); }
.twisty .chev { display: inline-flex; transition: transform 0.14s; }
.twisty .chev.open { transform: rotate(90deg); }
.kids-n { font-size: 0.6875rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent-ink); background: var(--accent-soft); border-radius: 6.1875rem; padding: 0 0.375rem; line-height: 1.3; }
@media (prefers-reduced-motion: reduce) { .twisty .chev { transition: none; } }

/* ---------- one typeface: IDs, keys and counters use the interface font (tabular figures); the monospace face is only for code, SQL and tokens */
:root { --g1: 242, 128, 58; --g2: 80, 110, 190; }
.mono, .key, .keytag, .chip-link { font-family: var(--font-body); font-variant-numeric: tabular-nums; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.01em; }
.keychip { font-size: 0.8125rem; }
.proj-row .key { font-size: 0.75rem; }
input.mono { font-size: 0.875rem; }

/* ---------- sidebar: ≡ hides it, the edge resizes it */
#app { transition: grid-template-columns 0.2s ease; }
html[data-side="hidden"] #app { grid-template-columns: 0 minmax(0, 1fr); }
html[data-side="hidden"] .sidebar { visibility: hidden; }
@media (max-width: 860px) { html[data-side="hidden"] #app { grid-template-columns: minmax(0, 1fr); } html[data-side="hidden"] .sidebar { visibility: visible; } }
@media (min-width: 861px) { .sidebar { position: relative; } } /* (on a phone the sidebar is the off-canvas drawer: style.css makes it fixed) */
.side-resizer { position: absolute; top: 0; right: -3px; bottom: 0; width: 7px; cursor: col-resize; z-index: 70; touch-action: none; }
.side-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 1px; background: transparent; transition: background 0.12s, width 0.12s, left 0.12s; }
.side-resizer:hover::after, .side-resizer:focus-visible::after, body.side-resizing .side-resizer::after { background: var(--accent); width: 3px; left: 2px; }
.side-resizer:focus-visible { outline: none; }
body.side-resizing { cursor: col-resize; user-select: none; }
body.side-resizing #app { transition: none; }
@media (max-width: 860px) { .side-resizer { display: none; } }

/* ---------- the Farm 51 logo as the loading indicator: a ring sweeps around it, the mark breathes */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.logo { position: relative; }
.logo::before { content: ""; position: absolute; inset: -5px; border-radius: 0.95rem; padding: 2px; pointer-events: none; opacity: 0; transition: opacity 0.2s;
  background: conic-gradient(from var(--spin), transparent 0 55%, var(--accent) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; }
html.busy .sidebar .logo::before { opacity: 1; transition: opacity 0.2s 0.3s; animation: logo-spin 1.1s linear infinite; } /* (only if the request lasts longer than a moment) */
html.busy .sidebar .logo img { animation: logo-pulse 1.1s ease-in-out infinite; }
.auth-wrap:has(button[type="submit"]:disabled) .auth-hero .logo::before { opacity: 1; animation: logo-spin 1.1s linear infinite; }
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); opacity: 0; animation: splash-in 0.3s 0.18s ease-out forwards; z-index: 500; }
.splash .logo { width: 4.5rem; height: 4.5rem; border-radius: 1.25rem; padding: 0.7rem; }
.splash .logo::before { inset: -8px; border-radius: 1.75rem; padding: 3px; opacity: 1; animation: logo-spin 1.1s linear infinite; }
.splash .logo img { animation: logo-pulse 1.6s ease-in-out infinite; }
@keyframes logo-spin { to { --spin: 360deg; } }
@keyframes logo-pulse { 50% { transform: scale(1.07); } }
@keyframes splash-in { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .logo::before, .logo img { animation: none !important; } .splash .logo::before { background: var(--accent); } }
/* ---------- error messages: a sentence and, on a second line, the code to quote to IT */
.toast, .form-error { white-space: pre-line; }

.crash { max-width: 34rem; margin: 18vh auto 0; padding: 0 1.25rem; text-align: center; display: grid; gap: 0.875rem; }
.crash h1 { font-size: 1.5rem; font-weight: 600; }
.crash-ref { font-size: 1.25rem; font-weight: 600; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; background: var(--surface-3); border-radius: 0.5rem; padding: 0.5rem 1rem; justify-self: center; user-select: all; }

/* ---------- administrators: event log and server status */
.audit-cats { margin: 0.25rem 0 0.5rem; flex-wrap: wrap; }
.audit-filter { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0.5rem 0; }
.audit-filter .input[type="date"] { width: auto; min-width: 9.5rem; }
.audit-filter .audit-q { flex: 1; min-width: 14rem; }
.audit-table { max-height: 30rem; border: 1px solid var(--line-soft); border-radius: 0.625rem; }
.audit-row { grid-template-columns: 9.5rem minmax(0, 1fr) auto; gap: 0.75rem; padding: 0.5rem 0.75rem; align-items: start; }
.audit-row:last-child { border-bottom: 0; }
.audit-row.warn { background: color-mix(in srgb, var(--crit) 7%, transparent); }
.audit-row.warn strong { color: var(--crit); }
.audit-time { font-variant-numeric: tabular-nums; font-size: 0.75rem; padding-top: 0.125rem; }
.audit-what { display: flex; flex-wrap: wrap; gap: 0.125rem 0.625rem; align-items: baseline; min-width: 0; }
.audit-who { font-weight: 500; }
.audit-text { overflow-wrap: anywhere; }
.audit-meta { display: flex; gap: 0.5rem; align-items: center; justify-content: flex-end; white-space: nowrap; }
.audit-ref { border: 0; background: var(--surface-3); color: var(--fg); border-radius: 0.375rem; padding: 0.0625rem 0.4375rem; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.04em; cursor: pointer; }
.audit-ref:hover { background: var(--accent-soft); color: var(--accent-ink); }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0.625rem 1.25rem; margin-bottom: 0.5rem; }
.kv { display: grid; gap: 0.125rem; font-size: 0.8125rem; } .kv strong { font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 860px) { .audit-row { grid-template-columns: 1fr; gap: 0.125rem; } .audit-meta { justify-content: flex-start; } }
/* ---------- light theme: the logo is black (the dark tile of the dark theme becomes the page colour, the emblem turns black); the sign-in panel and dark theme keep the original */
html[data-theme="light"] :is(.sidebar .brand, .auth-brand, .splash) .logo { background: transparent; box-shadow: none; }
html[data-theme="light"] :is(.sidebar .brand, .auth-brand, .splash) .logo img { filter: invert(1); }
@media (prefers-color-scheme: light) {
  html:not([data-theme]) :is(.sidebar .brand, .auth-brand, .splash) .logo { background: transparent; box-shadow: none; }
  html:not([data-theme]) :is(.sidebar .brand, .auth-brand, .splash) .logo img { filter: invert(1); }
}
/* ---------- copyright footer of the sign-in screens: in the brand panel on wide screens, under the form on narrow ones */
.auth-foot { text-align: center; padding: 0 1rem 1.25rem; font-size: 0.75rem; color: var(--faint); }
@media (min-width: 62rem) { .auth-foot { display: none; } }
/* ---------- timeline: the task column has a draggable edge (js/timeline.js, columnResize) */
.tl-corner, .tl-label { width: var(--tl-label, 22.5rem); }
.tl.tl-edge, .tl.tl-edge :is(.tl-label, .tl-corner) { cursor: col-resize; }
.tl.tl-edge :is(.tl-label, .tl-corner) { box-shadow: inset -3px 0 0 var(--accent); }
/* ---- timeline hierarchy: features with their sub-tasks, then stand-alone tasks and bugs */
.tl-row.section .tl-label, .tl-row.section .tl-lane { background: var(--surface-2); cursor: default; border-top: 1px solid var(--line); }
.tl-row.section .group-btn { gap: 0.5rem; }
.tl-row.section strong { font-size: 0.6875rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--fg); }
.tl-row.section .sec-hint { color: var(--muted); font-size: 0.75rem; font-weight: 400; margin-left: 0.125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-row.sec-parents .tl-label::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.tl-row.sec-solo .tl-label::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--muted); opacity: 0.55; }

.tl-row.is-parent .tl-label { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); } /* (the tint stays in the task column: the timeline part of the row looks like any other, grid and weekends included) */
.tl-row.is-parent .tl-label::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.tl-row.is-parent .tl-title { font-weight: 650; }
.tl-row.is-parent:hover .tl-label { background: color-mix(in srgb, var(--accent) 11%, var(--surface)); }

.tl-row.is-child .tl-label-in { padding-left: 3.75rem; }
.tl-row.is-child .tl-title { font-size: 0.8125rem; }
.tl-row.is-child .keychip { background: transparent; font-size: 0.75rem; padding-inline: 0.25rem; color: var(--muted); }
.tl-row.is-child .tl-label::before { content: ''; position: absolute; left: var(--gx, 3rem); top: 0; bottom: 0; border-left: 1.5px solid var(--line); }
.tl-row.is-child.is-last .tl-label::before { bottom: 50%; }
.tl-row.is-child .tl-label::after { content: ''; position: absolute; left: var(--gx, 3rem); top: 50%; width: 1rem; border-top: 1.5px solid var(--line); }
.tl-row.is-parent.has-kids:not(.is-folded) .tl-label::after { content: ''; position: absolute; left: var(--gx, 3rem); top: 72%; bottom: 0; border-left: 1.5px solid var(--line); }

.tl-row.ty-bug .keychip { background: var(--crit-soft); }
.tl-row.ty-bug .keychip .ti { color: var(--crit) !important; }
.tl-row.ty-feature .keychip .ti { color: var(--accent) !important; }
.tl-row.ty-task .keychip .ti { color: var(--muted) !important; }
.tl-row.is-child.ty-bug .keychip { background: transparent; color: var(--crit); }

.st-dot { width: 0.5625rem; height: 0.5625rem; border-radius: 50%; flex: none; border: 1.5px solid var(--muted); box-sizing: border-box; }
/* (the same colours as the status pills and the status menu: In Review is violet everywhere) */
.st-dot.st-doing { background: var(--st-doing); border-color: var(--st-doing); }
.st-dot.st-review { background: var(--st-review); border-color: var(--st-review); }
.st-dot.st-done { background: var(--st-done); border-color: var(--st-done); }
.st-dot.st-blocked { background: var(--st-blocked); border-color: var(--st-blocked); }

.sub-prog { font-size: 0.6875rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; padding: 1px 0.375rem; border-radius: 99px; background: var(--chip); }
.tl-row.is-parent.has-kids .tl-label { background-image: linear-gradient(to right, var(--ok) var(--p, 0%), transparent var(--p, 0%)); background-size: 100% 3px; background-position: 0 100%; background-repeat: no-repeat; }
.sub-prog .sp-bar { width: 2.25rem; height: 4px; border-radius: 99px; background: var(--chip); overflow: hidden; }
.sub-prog .sp-bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

.bar.parent { top: 0.375rem; height: 1.5rem; }
.bar.parent:not(.type-feature) { background: color-mix(in srgb, var(--c) 34%, var(--surface)); border-width: 1.5px; }
.bar.child { top: 0.5625rem; height: 1.125rem; border-radius: 0.3125rem; }
.bar.child .bar-text { font-size: 0.6875rem; }.tl-row.section .group-btn { min-width: 0; white-space: nowrap; } .tl-row.section strong { white-space: nowrap; }

/* ---- table hierarchy (same language as the timeline) */
tr.group-row.section td { border-top: 1px solid var(--line); }
tr.group-row.section strong { font-size: 0.6875rem; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; }
tr.group-row.section .sec-hint { color: var(--muted); font-size: 0.75rem; font-weight: 400; margin-left: 0.5rem; }
tr.group-row.sec-parents td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.group-row.sec-solo td:first-child { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--muted) 55%, transparent); }
tr.row.is-parent td { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
tr.row.is-parent td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.row.is-parent .cell-input.title { font-weight: 650; }
tr.row.child .cell-input.title { font-size: 0.875rem; }
tr.row.child .keychip { background: transparent; color: var(--muted); }
tr.row.ty-bug .keychip { background: var(--crit-soft); }
tr.row.ty-bug .keychip .ti { color: var(--crit) !important; }
tr.row.child.ty-bug .keychip { background: transparent; color: var(--crit); }
tr.row.ty-feature .keychip .ti { color: var(--accent) !important; }
tr.row.ty-task .keychip .ti { color: var(--muted) !important; }.via-badge { font-size: 0.6875rem; font-weight: 600; padding: 1px 0.4375rem; border-radius: 99px; background: var(--info-soft); color: var(--info); white-space: nowrap; }

/* ---- system status (sign-in screen, sidebar indicator, dialog) */
.status-panel { --st: var(--ok); --st-soft: var(--ok-soft); }
.status-panel.st-degraded, .status-chip.st-degraded { --st: var(--warn); --st-soft: var(--warn-soft); }
.status-panel.st-outage, .status-chip.st-outage { --st: var(--crit); --st-soft: var(--crit-soft); }
.status-panel.st-unknown, .status-chip.st-unknown { --st: var(--muted); --st-soft: var(--chip); }
.status-chip { --st: var(--ok); }
.status-banner { display: flex; align-items: center; gap: 0.625rem; padding: 0.75rem 0.875rem; border-radius: 0.625rem; background: var(--st-soft); border: 1px solid var(--st); font-weight: 600; font-size: 0.875rem; color: var(--fg); }
.st-ico { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--st); color: var(--accent-fg); font-size: 0.75rem; font-weight: 800; line-height: 1; flex: none; }
.status-list { list-style: none; margin: 0.625rem 0 0; padding: 0; border: 1px solid var(--line); border-radius: 0.625rem; overflow: hidden; background: var(--surface); }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.625rem 0.875rem; border-top: 1px solid var(--line-soft); font-size: 0.875rem; }
.status-row:first-child { border-top: 0; }
.status-name { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.status-name small { color: var(--muted); font-size: 0.75rem; font-weight: 400; }
.status-pill { flex: none; font-size: 0.625rem; font-weight: 800; letter-spacing: 0.04em; padding: 0.1875rem 0.625rem; border-radius: 99px; background: var(--ok); color: var(--accent-fg); }
.status-row.st-degraded .status-pill { background: var(--warn); }
.status-row.st-outage .status-pill { background: var(--crit); }
.status-row.st-disabled .status-pill { background: var(--chip); color: var(--muted); }
.status-time { margin: 0.5rem 0 0; font-size: 0.6875rem; color: var(--faint); text-align: right; }
.auth-col { display: flex; flex-direction: column; align-items: stretch; gap: 1rem; width: min(26.25rem, 100%); }
.auth-col .auth-card { width: 100%; }
.status-box { border: 1px solid var(--line); border-radius: 0.875rem; background: var(--surface); padding: 0.75rem 0.875rem 0.875rem; }
.status-box > summary { cursor: pointer; font-size: 0.8125rem; font-weight: 700; color: var(--muted); list-style: none; display: flex; align-items: center; justify-content: space-between; }
.status-box > summary::-webkit-details-marker { display: none; }
.status-box > summary::after { content: '▾'; transition: transform 0.15s; }
.status-box:not([open]) > summary::after { transform: rotate(-90deg); }
.status-box .status-body { margin-top: 0.625rem; }
.side-status { padding: 0.375rem 0.75rem 0; background: var(--surface); }
.status-chip { display: flex; align-items: center; gap: 0.5rem; width: 100%; border: 0; background: transparent; color: var(--muted); font-size: 0.75rem; padding: 0.25rem 0.375rem; border-radius: 0.5rem; cursor: pointer; text-align: left; }
.status-chip:hover { background: var(--hover); color: var(--fg); }
.status-chip .st-dot { width: 0.5rem; height: 0.5rem; border: 0; border-radius: 50%; background: var(--st); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--st) 22%, transparent); }
.modal .status-panel .status-row { align-items: flex-start; }.status-mini { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; font-weight: 600; color: var(--fg); margin-left: auto; margin-right: 0.5rem; }
.status-mini::before { content: ''; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ok); }
.status-mini.st-degraded::before { background: var(--warn); } .status-mini.st-outage::before { background: var(--crit); } .status-mini.st-unknown::before { background: var(--muted); }
.status-box > summary > span:first-child { color: var(--muted); }
/* ---- sign-in 4: a flat form column, a brand stage with the product drawing, the system status as a small pill in the footer row */
.input-ico { position: relative; display: block; }
.input-ico > svg.lead { position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; transition: color 0.15s; z-index: 1; }
.input-ico:focus-within > svg.lead { color: var(--accent); }
.input-ico > .input { padding-left: 2.625rem; }
.input-ico.pw > .input { padding-right: 2.875rem; }
.pw-toggle { position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pw-toggle:hover { color: var(--fg); }
.caps-hint { display: block; margin-top: 0.375rem; font-size: 0.75rem; font-weight: 600; color: var(--warn); }
.caps-hint[hidden] { display: none; }
.auth-card .input { transition: border-color 0.15s, box-shadow 0.15s; }
.auth-card .input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); outline: none; }
.auth-card .wide-btn { display: flex; align-items: center; justify-content: center; gap: 0.5rem; font-weight: 600; background: var(--accent); box-shadow: none; transition: background 0.15s, transform 0.15s; }
.auth-card .wide-btn > span { display: inline !important; } /* (narrow screens hide the text of other buttons that carry an icon) */
.auth-card .wide-btn svg { transition: transform 0.15s; }
.auth-card .wide-btn:hover:not(:disabled) { background: var(--accent-hover); }
.auth-card .wide-btn:hover:not(:disabled) svg { transform: translateX(3px); }
.auth-card .wide-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.auth-card .wide-btn.busy svg { display: none; }
.auth-card .wide-btn.busy::after { content: ''; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: logo-spin 0.7s linear infinite; }
.auth-stage { background: var(--surface); }
.auth-col { width: min(25rem, 100%); display: flex; flex-direction: column; }
.auth-col .auth-card { width: 100%; }
.auth-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: min(25rem, 100%); margin-top: 1.25rem; font-size: 0.75rem; color: var(--faint); }
.auth-ver { font-family: var(--font-mono); }
.status-box { position: relative; border: 0; background: none; padding: 0; border-radius: 0; }
.status-box > summary { display: inline-flex; align-items: center; padding: 0.3125rem 0.75rem; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); cursor: pointer; list-style: none; transition: background 0.15s, color 0.15s; }
.status-box > summary::after { content: none; }
.status-box > summary:hover { background: var(--hover); color: var(--fg); }
.status-box > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.status-box .status-mini { margin: 0; font-size: 0.75rem; font-weight: 600; color: inherit; }
.status-box .status-body { position: absolute; right: 0; bottom: calc(100% + 0.5rem); width: min(24rem, calc(100vw - 2rem)); margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 0.875rem; padding: 0.875rem; box-shadow: var(--shadow); z-index: 6; max-height: min(60vh, 28rem); overflow: auto; }

/* the brand stage (hidden below 40rem; a band on tablets; the full stage with the drawing from 62rem) */
@media (min-width: 40rem) {
  .auth-hero { display: flex; position: relative; overflow: hidden; color: #f2f4f8; background: radial-gradient(52rem 34rem at 0% 0%, rgba(var(--g1), 0.30) 0%, rgba(var(--g1), 0.18) 22%, rgba(var(--g1), 0.09) 44%, rgba(var(--g1), 0.03) 64%, transparent 82%), #090d13; }
  .auth-hero-in { display: flex; align-items: center; flex-wrap: wrap; gap: 0 1.125rem; position: relative; z-index: 1; }
  .auth-hero .logo { position: relative; width: 3.5rem; height: 3.5rem; padding: 0; margin: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
  .auth-hero .logo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 14px rgba(242, 128, 58, 0.5)); }
  .auth-hero h2 { position: relative; margin: 0; padding-right: 0.1em; font-size: 3rem; font-weight: 600; letter-spacing: -0.045em; line-height: 1; color: #f4f6f9; background: none; -webkit-text-fill-color: #f4f6f9; filter: none; }
  .auth-hero-in .season-postcard { flex-basis: 100%; }
  .hero-light { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.35s; background: radial-gradient(24rem circle at var(--mx, 50%) var(--my, 50%), rgba(242, 128, 58, 0.16), transparent 62%); }
  .hero-light.on { opacity: 1; }
}
@media (min-width: 40rem) and (max-width: 61.99rem) {
  .auth-wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-hero { height: 14rem; padding: 1.75rem 2.5rem; }
  .auth-hero > small { display: none; }
  .auth-card .auth-brand { display: none; }
  .auth-stage { padding: 2.5rem 1.5rem 4rem; }
  .auth-card h1 { font-size: 1.625rem; }
}
@media (min-width: 62rem) {
  .auth-wrap { grid-template-columns: minmax(0, 3fr) minmax(27rem, 2fr); }
  .auth-hero { flex-direction: column; justify-content: flex-start; padding: clamp(2.5rem, 7vh, 4.5rem) 3.5rem 3rem; border-right: 0; background: radial-gradient(64rem 44rem at 0% 0%, rgba(var(--g1), 0.30) 0%, rgba(var(--g1), 0.18) 22%, rgba(var(--g1), 0.09) 44%, rgba(var(--g1), 0.03) 64%, transparent 82%), #090d13; }
  .auth-hero::before { background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px); background-size: 3.5rem 3.5rem; opacity: 1;
    mask-image: linear-gradient(180deg, transparent 4%, #000 70%); -webkit-mask-image: linear-gradient(180deg, transparent 4%, #000 70%); }
  .auth-hero-in { gap: 0 1.5rem; }
  .auth-hero .logo { width: 5rem; height: 5rem; }
  .auth-hero h2 { font-size: 4.25rem; }
  .auth-hero > small { position: absolute; left: 3.5rem; bottom: 2rem; z-index: 1; }
  .auth-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 2rem 3rem 5.5rem; border-left: 1px solid var(--line); }
  .auth-stage > .auth-card { width: min(25rem, 100%); }
  .auth-meta { position: absolute; left: 3rem; right: 3rem; bottom: 1.75rem; width: auto; margin: 0; }
  .auth-card { background: transparent; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; padding: 0; }
  .auth-card h1 { font-size: 1.875rem; margin-bottom: 1.5rem; }
  .auth-card .field-label { font-size: 0.8125rem; }
  .auth-card .input { height: 3rem; }
  .auth-card .wide-btn { height: 3rem; }
}
@media (min-width: 62rem) and (max-height: 46rem) {
  .auth-hero .logo { width: 3.75rem; height: 3.75rem; } .auth-hero h2 { font-size: 3.25rem; }
  .auth-card h1 { margin-bottom: 1rem; } .auth-stage { padding-top: 1rem; }
}
/* sign-in errors: a visible block, the card shakes once (not with "reduce motion"), the focus goes back to the password */
.auth-card .form-error { margin: 0.875rem 0 0; padding: 0.625rem 0.75rem; border-radius: 0.5rem; border: 1px solid color-mix(in srgb, var(--crit) 45%, transparent); background: var(--crit-soft); color: var(--crit); font-size: 0.8125rem; font-weight: 500; }
@media (prefers-reduced-motion: no-preference) {
  .auth-card.shake { animation: auth-shake 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
  @keyframes auth-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
}
/* sign-in contrast (WCAG AA 4.5:1): quiet text uses --muted instead of --faint; in the light theme the link and the button are a notch darker */
.auth-meta, .auth-ver { color: var(--muted); }
html[data-theme="light"] .auth-card .wide-btn { background: color-mix(in srgb, var(--accent) 86%, #000); }
html[data-theme="light"] .auth-card .wide-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 74%, #000); }
html[data-theme="light"] .auth-links .link-btn { color: var(--accent-ink); }
@media (prefers-color-scheme: light) {
  html:not([data-theme]) .auth-card .wide-btn { background: color-mix(in srgb, var(--accent) 86%, #000); }
  html:not([data-theme]) .auth-card .wide-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 74%, #000); }
  html:not([data-theme]) .auth-links .link-btn { color: var(--accent-ink); }
}

/* the product drawing (brand stage, from 62rem) */
.hero-art { display: none; }
@media (min-width: 62rem) {
  .hero-art { display: block; position: relative; width: min(100%, clamp(32rem, 42vw, 44rem)); margin: auto 0 clamp(7.5rem, 16vh, 10rem); z-index: 1; }
  html[data-season] .hero-art { display: none; }
  .ha-window { border-radius: 1rem; border: 1px solid rgba(255, 255, 255, 0.1); background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03)); box-shadow: 0 34px 70px -24px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.09); padding: 0.875rem 1rem 1.125rem; }
  .ha-top { display: flex; align-items: center; gap: 0.375rem; margin-bottom: 1rem; }
  .ha-top > i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
  .ha-top > i:nth-child(1) { background: #f27a81; } .ha-top > i:nth-child(2) { background: #e5b653; } .ha-top > i:nth-child(3) { background: #5fc58f; }
  .ha-pill { margin-left: 0.75rem; height: 0.5rem; width: 6rem; border-radius: 99px; background: rgba(255, 255, 255, 0.14); }
  .ha-av { margin-left: auto; display: flex; }
  .ha-av i { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 2px solid #121923; margin-left: -0.4375rem; }
  .ha-av .a1 { background: #f2803a; } .ha-av .a2 { background: #5b8def; } .ha-av .a3 { background: #9a7bff; }
  .ha-body { position: relative; display: grid; gap: 0.5rem; }
  .ha-grid { position: absolute; top: -0.25rem; bottom: -0.25rem; left: 9rem; right: 0; background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px); background-size: 12.5% 100%; pointer-events: none; }
  .ha-today { position: absolute; top: -0.5rem; bottom: -0.5rem; left: calc(9rem + (100% - 9rem) * 0.5); width: 2px; background: #f2803a; box-shadow: 0 0 14px 1px rgba(242, 128, 58, 0.8); z-index: 2; }
  .ha-today::before { content: ''; position: absolute; top: -0.25rem; left: -0.25rem; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: #f2803a; }
  .ha-ms { position: absolute; top: 0.3125rem; left: calc(9rem + (100% - 9rem) * 0.66); width: 0.75rem; height: 0.75rem; background: #e5b653; transform: rotate(45deg); border-radius: 2px; z-index: 3; box-shadow: 0 0 10px rgba(229, 182, 83, 0.6); }
  .ha-row { display: flex; align-items: center; height: 1.75rem; position: relative; }
  .ha-lab { width: 9rem; flex: none; padding-right: 1rem; }
  .ha-lab > i { display: block; height: 0.5rem; border-radius: 99px; background: rgba(255, 255, 255, 0.22); }
  .ha-row.child .ha-lab { padding-left: 1.125rem; }
  .ha-row.child .ha-lab > i { background: rgba(255, 255, 255, 0.12); height: 0.4375rem; }
  .ha-track { position: relative; flex: 1; height: 100%; }
  .ha-bar { position: absolute; top: 0.25rem; bottom: 0.25rem; border-radius: 0.4375rem; overflow: hidden; transform-origin: left center; }
  .ha-row.child .ha-bar { top: 0.3125rem; bottom: 0.3125rem; }
  .ha-bar b { position: absolute; inset: 0 auto 0 0; background: rgba(255, 255, 255, 0.34); }
  .ha-bar.c-orange { background: linear-gradient(90deg, #f2803a, #f6a272); box-shadow: 0 6px 16px -6px rgba(242, 128, 58, 0.7); }
  .ha-bar.c-blue { background: linear-gradient(90deg, #4f83e6, #82aaee); }
  .ha-bar.c-red { background: linear-gradient(90deg, #e5565e, #f27a81); }
  .ha-bar.c-violet { background: linear-gradient(90deg, #8a6df0, #b49cff); }
  .ha-card { position: absolute; display: flex; align-items: center; gap: 0.625rem; padding: 0.625rem 0.75rem; border-radius: 0.75rem; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(18, 25, 35, 0.9); box-shadow: 0 18px 36px -14px rgba(0, 0, 0, 0.7); }
  .ha-card.c1 { left: -1.5rem; bottom: -1.5rem; width: 12.5rem; }
  .ha-card.c2 { right: -1.75rem; top: 4.75rem; width: 11.5rem; }
  .ha-ico { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 0.5rem; flex: none; }
  .ha-ico.ok { background: rgba(95, 197, 143, 0.18); color: #5fc58f; } .ha-ico.bug { background: rgba(242, 122, 129, 0.18); color: #f27a81; }
  .ha-lines { flex: 1; display: grid; gap: 0.3125rem; }
  .ha-lines i { display: block; height: 0.4375rem; border-radius: 99px; background: rgba(255, 255, 255, 0.28); }
  .ha-lines i.s { width: 58%; background: rgba(255, 255, 255, 0.14); }
  .ha-pct { width: 1.5rem; height: 1.5rem; border-radius: 50%; flex: none; background: conic-gradient(#5fc58f 0 100%, rgba(255, 255, 255, 0.1) 0); -webkit-mask: radial-gradient(circle, transparent 0.4rem, #000 0.45rem); mask: radial-gradient(circle, transparent 0.4rem, #000 0.45rem); }
  .ha-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #f27a81; flex: none; box-shadow: 0 0 0 4px rgba(242, 122, 129, 0.2); }
}
@media (min-width: 62rem) and (prefers-reduced-motion: no-preference) {
  .ha-bar { animation: ha-grow 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .ha-bar b { animation: ha-fill 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .ha-today { animation: ha-sweep 2.6s 0.5s cubic-bezier(0.45, 0, 0.2, 1) both; }
  .ha-ms { animation: ha-pop 0.5s 1.2s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
  .ha-card { animation: ha-in 0.7s 1s cubic-bezier(0.2, 0.7, 0.2, 1) both, ha-float 7s 1.7s ease-in-out infinite; }
  .ha-card.c2 { animation-delay: 1.25s, 2.4s; }
  @keyframes ha-grow { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
  @keyframes ha-fill { from { width: 0; } }
  @keyframes ha-sweep { from { left: calc(9rem + (100% - 9rem) * 0.12); } }
  @keyframes ha-pop { from { transform: rotate(45deg) scale(0); } to { transform: rotate(45deg) scale(1); } }
  @keyframes ha-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
  @keyframes ha-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
}
@media (min-width: 62rem) and (max-height: 46rem) { .hero-art { margin-bottom: 5rem; width: min(100%, 28rem); } }
/* easter egg: the bug card in the drawing answers when the pointer is on it */
.ha-pop { display: none; }
@media (min-width: 62rem) {
  .ha-card.c2 { cursor: help; }
  .ha-pop { position: absolute; right: 0; bottom: calc(100% + 0.75rem); display: block; padding: 0.5rem 0.875rem; border-radius: 0.625rem; white-space: nowrap; font-size: 0.8125rem; font-weight: 600; color: #ffe3cf; background: #1d140e; border: 1px solid rgba(242, 128, 58, 0.65); box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.8), 0 0 18px rgba(242, 128, 58, 0.25); opacity: 0; transform: translateY(6px) scale(0.94); transform-origin: bottom right; pointer-events: none; transition: opacity 0.18s, transform 0.18s cubic-bezier(0.3, 1.5, 0.5, 1); z-index: 5; }
  .ha-pop::after { content: ''; position: absolute; right: 1.25rem; top: 100%; width: 0.625rem; height: 0.625rem; background: #1d140e; border-right: 1px solid rgba(242, 128, 58, 0.65); border-bottom: 1px solid rgba(242, 128, 58, 0.65); transform: translateY(-50%) rotate(45deg); }
  .ha-card.c2:hover .ha-pop { opacity: 1; transform: none; }
  .ha-card.c2:hover { border-color: rgba(242, 122, 129, 0.5); }
  .ha-card.c2:hover .ha-dot { animation: ha-blink 0.7s ease-in-out infinite; }
}
@media (prefers-reduced-motion: no-preference) { @keyframes ha-blink { 50% { box-shadow: 0 0 0 7px rgba(242, 122, 129, 0.05); opacity: 0.55; } } }
@media (prefers-reduced-motion: reduce) { .ha-pop { transition: none; } }

/* the lockup as it was before the experiment: the mark of The Farm 51 and the name, a glow behind both, the name in a gradient from white to peach */
@media (min-width: 40rem) {
  .auth-hero h2 { padding: 0.04em 0.16em 0.1em 0; letter-spacing: -0.045em; font-weight: 650; line-height: 1.02;
    background: linear-gradient(100deg, #ffffff 25%, #ffd9bd 70%, #f6a272); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
    filter: none; } /* (no halo hugging the letters: the wide haze behind the lockup and the glow of the mark stay) */
}
@media (min-width: 62rem) {
  .auth-hero .logo { width: 6.25rem; height: 6.25rem; }
  .auth-hero .logo img { filter: drop-shadow(0 0 14px rgba(242, 128, 58, 0.55)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)); }
  .auth-hero h2 { font-size: 5.5rem; }
  .auth-hero-in { gap: 0 1.5rem; }
}

/* 0.5.7: the top bar must never push "+ Zadanie" off screen - below 1300 px the search collapses to an icon and opens on focus */
@media (min-width: 861px) and (max-width: 1300px) {
  .search { width: 2.25rem; height: var(--ctl); }
  .search input { position: absolute; right: 0; top: 0; width: 2.25rem; padding-right: 0; color: transparent; cursor: pointer; z-index: 5; }
  .search input::placeholder { color: transparent; }
  .search input:focus, .search input:not(:placeholder-shown) { width: 12.5rem; padding-right: 0.625rem; color: var(--fg); cursor: text; }
  .search input:focus::placeholder { color: var(--faint); }
}@media (min-width: 861px) and (max-width: 1100px) {
  .tabs .tab span, .topbar .btn.primary span { display: none; }
  .tabs .tab { padding: 0 0.625rem; } .topbar .btn.primary { padding: 0 0.625rem; }
}
.tabs { min-width: 0; overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
@media (max-width: 860px) { .tabs .tab span { display: none; } .tabs .tab { padding: 0 0.625rem; } .title h1 { max-width: 30vw; } }
/* 0.5.7: the sign-in screen shows only the overall state (a plain pill, nothing to open) */
.status-box.static .status-static { display: inline-flex; align-items: center; padding: 0.3125rem 0.75rem; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
/* 0.5.7: PL | EN switch */
.lang-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: 99px; background: var(--surface-3); }
.lang-btn { border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; padding: 0.1875rem 0.5rem; border-radius: 99px; cursor: pointer; }
.lang-btn:hover { color: var(--fg); }
.lang-btn[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); cursor: default; }
.lang-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.side-status { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
/* 0.5.7: toasts live in the top layer (above open modals); error toast and danger button keep their contrast in the dark theme; offline bar */
#toasts { inset: auto; bottom: 1.25rem; left: 50%; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; width: max-content; max-width: 92vw; color: inherit; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .toast.error, html:not([data-theme="light"]) .btn.danger { color: #2a0a0d; } }
html[data-theme="dark"] .toast.error, html[data-theme="dark"] .btn.danger { color: #2a0a0d; }
#offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 150; display: flex; justify-content: center; padding: 0.375rem 1rem; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn); font-size: 0.8125rem; font-weight: 600; text-align: center; }
#offline-bar[hidden] { display: none; }

/* ---------- 0.5.8: fixes from the visual review (AUDYT_0.5.8.md, V-1 … V-19) */
/* V-1 dialog footers wrap on a phone; a destructive action that is not the confirmation itself sits apart on the left */
.modal-foot { flex-wrap: wrap; }
.modal-foot .btn.danger:not(:last-child) { order: -1; margin-right: auto; }
/* V-2 people: one grid shared by all rows, so names keep their width and columns line up */
.rows.people-rows { display: grid; grid-template-columns: auto auto minmax(7rem, 1fr) minmax(7rem, 10rem) auto minmax(6rem, max-content) auto; column-gap: 0.625rem; row-gap: 0.375rem; }
.rows.people-rows > .edit-row.people { grid-column: 1 / -1; grid-template-columns: subgrid; }
.edit-row.people > .acct-btn, .edit-row.people > .acct { min-width: 0; max-width: 100%; overflow: hidden; justify-self: start; }
.acct { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.acct svg { vertical-align: -2px; margin-right: 0.3125rem; }
.acct.none { opacity: 1; color: var(--muted); }
@media (max-width: 860px) {
  .rows.people-rows { display: flex; }
  .rows.people-rows > .edit-row.people { grid-template-columns: auto auto minmax(0, 1fr) auto; }
  .edit-row.people > :last-child { grid-row: 1; grid-column: 4; }
  .edit-row.people > .acct-btn, .edit-row.people > .acct { grid-column: 2 / -1; }
}
/* V-4 milestones: the table scrolls inside its card; the project column goes on narrow screens */
.ms-card { overflow-x: auto; }
@media (max-width: 1100px) { .ms-table th:nth-child(2), .ms-table td:nth-child(2) { display: none; } }
/* V-6 the magnifier stays visible on the collapsed search */
.search svg { z-index: 6; }
/* V-7 / V-8 view tabs: on a phone they live in the drawer (more room for the title); elsewhere a fade shows that more tabs scroll in; the title gives way first */
.mobile-views { display: none; }
.side-nav .tab span { display: inline; } /* (the sidebar always has room for the names of the views; only the top bar shortens them to icons) */
@media (max-width: 860px) { .mobile-views { display: flex; } .topbar .tabs { display: none; } .title h1 { max-width: 60vw; } }
.topbar .title { flex: 0 1 auto; flex-shrink: 4; min-width: 3rem; }
.tabs.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent); }
.tabs.more-left { -webkit-mask-image: linear-gradient(to right, transparent, #000 2rem); mask-image: linear-gradient(to right, transparent, #000 2rem); }
.tabs.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 2rem, #000 calc(100% - 2rem), transparent); mask-image: linear-gradient(to right, transparent, #000 2rem, #000 calc(100% - 2rem), transparent); }
/* V-9 segmented controls in dialogs share the width on a phone (no "B…") */
@media (max-width: 560px) { .modal .seg { display: flex; } .modal .seg-btn { flex: 1 1 0; min-width: 0; justify-content: center; padding-inline: 0.375rem; } }
/* V-10 timeline: text on feature bars picks its ink by the bar colour; done bars fade their colour, not their text; weekday letters at full contrast */
.bar.type-feature, .bar.type-feature .bar-text { color: var(--bar-ink, #fff); }
.bar.st-done { opacity: 1; }
.bar.st-done:not(.type-feature) { background: color-mix(in srgb, var(--c) 10%, var(--surface)); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.bar.st-done.type-feature { background: color-mix(in srgb, var(--c) 55%, var(--surface)); }
.bar.st-done .bar-text { text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.tl-day i { opacity: 1; color: var(--muted); }
.tl-month span { left: calc(var(--tl-label, 22.5rem) + 0.25rem); } /* (sticks right after the task column, whatever its width) */
/* V-11 sidebar footer: the role is cut with an ellipsis like the name */
.me-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* V-12 offline: the layout moves down by the height of the bar instead of hiding the top bar under it */
#offline-bar { height: 2.25rem; align-items: center; padding-block: 0; }
html.offline #app { padding-top: 2.25rem; }
html.offline .main, html.offline .sidebar { height: calc(100vh - 2.25rem); } /* (both columns had their own 100vh)*/
@media (max-width: 860px) { html.offline .sidebar { top: 2.25rem; } }
/* V-13 the chosen language is clearly marked */
.lang-btn[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
.lang-btn:not([aria-pressed="true"]) svg { opacity: 0.6; filter: grayscale(0.5); transition: opacity 0.12s, filter 0.12s; }
.lang-btn:not([aria-pressed="true"]):hover svg { opacity: 1; filter: none; }
.lang-btn svg { width: 1.5rem; height: 1rem; display: block; }
/* V-15 the API token form wraps on a phone */
.token-add { flex-wrap: wrap; } .token-add > * { min-width: 0; } .token-add .input { flex: 1 1 12rem; }
/* V-16 one control height in the task panel */
.drawer .prop > select, .drawer .prop > .input, .drawer .prop > button, .drawer .prop .pill { min-height: var(--ctl); }
.drawer .prop .pill { display: inline-flex; align-items: center; }
/* V-17 contrast: small chips and badges, and the edges of form fields (3:1 for borders) */
.chip-now { color: var(--accent-ink); }
.proto { color: var(--muted); }
.input:not(.cell-input), select:not(.cell-select):not(.sel) { border-color: var(--ctl-line); }
.edit-row .input, .edit-row select { border-color: transparent; } /* (inline-editable rows stay borderless until hovered) */
.sel { border-color: var(--ctl-line); }
/* V-19 the SQL bar: no empty band under the query */
.sqlbar { align-items: center; row-gap: 0.375rem; }
.sqlbar-label { padding-top: 0; }
/* phones: the filters fold behind one button */
.filters-toggle { display: none; }
@media (max-width: 860px) {
  .filters-toggle { display: inline-flex; }
  .filters-toggle svg { transition: transform 0.15s; }
  .filterwrap.open .filters-toggle svg { transform: rotate(90deg); }
  .filters-toggle.active { border-color: var(--accent); color: var(--accent-ink); }
  .filterwrap:not(.open) .filterbar .filters { display: none; }
  .filterwrap:not(.open) .filterbar .tools > :not(.filters-toggle):not(.result-count) { display: none; }
}

/* 0.5.9: timeline task column - the status dot and the avatar are buttons (status menu, people picker) */
.st-dot-btn { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; margin: -0.25rem; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; flex: none; }
.st-dot-btn:hover { background: var(--hover); }
.st-dot-btn:hover .st-dot { transform: scale(1.2); }
.st-dot-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tl-label .who { flex: none; margin-left: auto; }
.tl-label .who:hover .avatar { box-shadow: 0 0 0 2px var(--accent); }
.menu-item .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex: none; }
.menu-item .menu-check { margin-left: auto; color: var(--accent); }
.menu-item.current { font-weight: 600; }

/* ---------- 0.6.0: Administration page, roles, Team search */
.admin-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; margin: 0 0 1rem; border-bottom: 1px solid var(--line); }
.admin-tab { display: inline-flex; align-items: center; gap: 0.4375rem; padding: 0.5rem 0.75rem; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 0.375rem 0.375rem 0 0; }
.admin-tab:hover { color: var(--fg); background: var(--hover); }
.admin-tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.admin-tab[aria-selected="true"] svg { color: var(--accent); }
.admin-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.admin-page .card + .card { margin-top: 1rem; }
.list-tools { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin: 0.25rem 0 0.75rem; }
.list-tools .sel { height: var(--ctl); }
.team-tools { margin-bottom: 1rem; }
.search-in { position: relative; display: flex; align-items: center; flex: 1 1 16rem; min-width: 0; max-width: 28rem; }
.search-in svg { position: absolute; left: 0.625rem; color: var(--muted); pointer-events: none; }
.search-in .input { width: 100%; padding-left: 2rem; }
/* accounts */
.acct-list { display: flex; flex-direction: column; }
.acct-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, auto) auto; gap: 0.75rem; align-items: center; padding: 0.5rem 0.25rem; border-bottom: 1px solid var(--line-soft); }
.acct-row:last-child { border-bottom: 0; }
.acct-row.off { opacity: 0.7; }
.acct-who { display: flex; flex-direction: column; min-width: 0; }
.acct-who strong, .acct-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-chip { font-size: 0.75rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 99px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.role-chip.admin { background: var(--accent-soft); color: var(--accent-ink); }
.acct-state { font-size: 0.75rem; color: var(--warn); white-space: nowrap; }
@media (max-width: 640px) { .acct-row { grid-template-columns: auto minmax(0, 1fr) auto; } .acct-row .role-chip { grid-column: 2; justify-self: start; } .acct-row .acct-state:empty { display: none; } }
/* roles */
.role-list { display: flex; flex-direction: column; }
.role-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 0.75rem; align-items: center; padding: 0.625rem 0.25rem; border-bottom: 1px solid var(--line-soft); }
.role-row:last-child { border-bottom: 0; }
.role-ico { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 0.5rem; background: var(--surface-3); color: var(--muted); }
.role-ico.admin { background: var(--accent-soft); color: var(--accent-ink); }
.role-main { min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.role-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .role-row { grid-template-columns: auto minmax(0, 1fr) auto; } .role-row > .nowrap { display: none; } }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0.75rem 1.25rem; }
.perm-group { border: 1px solid var(--line); border-radius: 0.625rem; padding: 0.5rem 0.75rem 0.625rem; margin: 0; min-width: 0; }
.perm-group legend { font-size: 0.75rem; font-weight: 700; color: var(--muted); padding: 0 0.25rem; text-transform: uppercase; letter-spacing: 0.04em; }
.perm { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.3125rem 0; cursor: pointer; }
.perm input { margin-top: 0.1875rem; }
.perm span { display: flex; flex-direction: column; min-width: 0; }
.perm small { font-size: 0.75rem; line-height: 1.35; }
.perm-head { margin-top: 0.5rem; }
.matrix-wrap { overflow-x: auto; }
.perm-matrix { border-collapse: collapse; width: 100%; font-size: 0.8125rem; }
.perm-matrix th, .perm-matrix td { padding: 0.375rem 0.625rem; border-bottom: 1px solid var(--line-soft); text-align: center; white-space: nowrap; }
.perm-matrix thead th { font-size: 0.75rem; color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--surface); }
.perm-matrix tbody th[scope="row"] { text-align: left; font-weight: 500; }
.perm-matrix tr.grp th { text-align: left; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--surface-2); }
.perm-matrix .yes { color: var(--ok); }
.perm-matrix .no { color: var(--faint); }
.role-summary { display: flex; flex-direction: column; gap: 0.375rem; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.perm-chip { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; padding: 0.125rem 0.5rem; border-radius: 99px; background: var(--surface-3); color: var(--fg); }
.perm-chip svg { color: var(--ok); }

/* 0.6.0 fixes after the first look */
.admin-page .card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.perm-groups { grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); }
.perm-matrix thead th:first-child { text-align: left; }

/* ---------- 0.6.1: Claude proposals, documents, import preview */
.proposals-btn { gap: 0.375rem; border-color: var(--accent); color: var(--accent-ink); }
.proposals-btn svg { color: var(--accent); }
.count-badge { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.3125rem; border-radius: 99px; background: var(--accent); color: var(--accent-fg); font-size: 0.6875rem; font-weight: 700; }
@media (max-width: 1100px) { .proposals-btn > span { display: none; } }
.proposals { display: flex; flex-direction: column; gap: 1rem; }
.prop-card { border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.875rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.prop-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.prop-head h3 { margin: 0; font-size: 1rem; }
.prop-note { margin: 0; padding: 0.5rem 0.75rem; border-radius: 0.5rem; background: var(--surface-2); white-space: pre-wrap; font-size: 0.875rem; }
.prop-items { display: flex; flex-direction: column; }
.prop-item { display: flex; gap: 0.625rem; align-items: flex-start; padding: 0.625rem 0.25rem; border-top: 1px solid var(--line-soft); cursor: pointer; }
.prop-item input { margin-top: 0.25rem; }
.prop-main { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.prop-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.prop-text { margin: 0; font-size: 0.875rem; white-space: pre-wrap; }
.prop-text ul, .prop-diff { margin: 0.125rem 0 0; padding-left: 1.25rem; font-size: 0.875rem; }
.prop-warn { list-style: none; margin: 0.125rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.prop-warn li { display: flex; gap: 0.375rem; align-items: center; color: var(--warn); font-size: 0.8125rem; font-weight: 500; }
.prop-actions { justify-content: flex-end; }
.kind-chip { font-size: 0.6875rem; font-weight: 700; padding: 0.0625rem 0.4375rem; border-radius: 99px; background: var(--surface-3); color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.kind-chip.kind-feature { background: var(--accent-soft); color: var(--accent-ink); }
.kind-chip.kind-bug { background: var(--crit-soft); color: var(--crit); }
.kind-chip.kind-qa { background: var(--ok-soft); color: var(--ok); }
.kind-chip.kind-research { background: var(--info-soft); color: var(--info); }
.doc-list { display: flex; flex-direction: column; }
.doc-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; padding: 0.625rem 0.25rem; border: 0; border-bottom: 1px solid var(--line-soft); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 0.375rem; }
.doc-row:last-child { border-bottom: 0; }
.doc-row:hover { background: var(--hover); }
.doc-row > svg:first-child { color: var(--muted); }
.doc-main { display: flex; flex-direction: column; min-width: 0; }
.doc-main strong, .doc-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-body { white-space: pre-wrap; font-family: inherit; font-size: 0.875rem; line-height: 1.55; max-height: 60vh; overflow: auto; margin: 0; padding: 0.75rem; border-radius: 0.5rem; background: var(--surface-2); }
.doc-edit { min-height: 22rem; font-size: 0.8125rem; line-height: 1.5; }
.import-preview { border: 1px solid var(--line); border-radius: 0.625rem; padding: 0.625rem 0.75rem; max-height: 16rem; overflow: auto; }
.imp-list { list-style: none; margin: 0.375rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.imp-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-size: 0.875rem; }
.imp-row.warn strong { color: var(--warn); }
.imp-warn { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--warn); font-size: 0.75rem; font-weight: 600; }

/* 0.6.1 fix: the approval bar of a proposal stays in view while its items scroll (the footer "Close" used to look like the main action) */
.prop-actions { position: sticky; bottom: -1rem; background: var(--surface); padding: 0.625rem 0 0.25rem; margin-top: 0.25rem; border-top: 1px solid var(--line-soft); z-index: 1; }.doc-google { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.5rem 0.75rem; margin-bottom: 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--surface-2); }
.doc-google a { font-weight: 600; color: var(--accent-ink); }
.doc-body { white-space: normal; }
.doc-body .doc-plain { white-space: pre-wrap; font-family: inherit; margin: 0; }
/* 0.6.3: the handle under the project list (drag up/down) */
.proj-resizer { height: 0.75rem; margin: 0 0.75rem; cursor: row-resize; position: relative; touch-action: none; border-radius: 4px; }
.proj-resizer::after { content: ''; position: absolute; left: 50%; top: 50%; width: 2.5rem; height: 3px; margin: -1.5px 0 0 -1.25rem; border-radius: 3px; background: var(--line); transition: background 0.12s, width 0.12s; }
.proj-resizer:hover::after, .proj-resizer:focus-visible::after, body.proj-resizing .proj-resizer::after { background: var(--accent); width: 4rem; margin-left: -2rem; }
.proj-resizer:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
body.proj-resizing { cursor: row-resize; user-select: none; }
/* 0.6.3: "+" (add a sub-task) in the timeline's task column, as in the table */
.tl-add-sub { flex: none; margin-left: auto; }
.tl-label .tl-add-sub + :is(.who, .avatar) { margin-left: 0; } /* (the + takes the free space; the avatar stays right after it) */
.tl-row:hover .hover-only, .tl-row:focus-within .hover-only { opacity: 1; }
/* 0.6.3: "Claude" buttons (ready-made instructions copied for Claude Desktop) */
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: flex-end; }
.claude-box { display: grid; gap: 0.5rem; padding: 0.625rem 0.75rem; margin-bottom: 0.75rem; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 0.5rem; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.claude-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.claude-title { display: inline-flex; align-items: center; gap: 0.375rem; font-weight: 600; color: var(--accent-ink); }
.claude-actions { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-left: auto; }
.claude-notes { min-height: 2.5rem; resize: vertical; font-size: 0.8125rem; }
.claude-how { margin: 0; }
.claude-prompt-text { width: 100%; font-size: 0.75rem; white-space: pre-wrap; }
@media (max-width: 640px) { .claude-actions { margin-left: 0; } }
/* ---------- 0.6.4: fixes from the functional/UX audit (UX_REPORT U-1 … U-24) */
/* U-1 view tabs that do not fit go into "Więcej" (app.js markTabOverflow): no hidden sideways scrolling; the open view always stays in the bar */
.topbar .tabs { overflow: hidden; flex: 0 1 auto; -webkit-mask-image: none; mask-image: none; }
.tabs .tab.tab-over { display: none; }
.tabs .tab-more { flex: none; border: 0; background: none; font: inherit; cursor: pointer; gap: 0.25rem; }
.tabs .tab-more[hidden] { display: none; }
.tabs .tab-more span { display: inline !important; }
.tabs.tight-current .tab[aria-current="page"] span, .tabs.tight .tab[aria-current="page"] span, .tabs.tight .tab-more span { display: none !important; }
.tabs .tab-more:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* U-4 the page title keeps sensible room (it used to shrink first, to 60 px: "Wsz…"); the tabs give way to "Więcej" instead */
@media (min-width: 861px) { .topbar .title { flex: 0 0 auto; min-width: 0; max-width: clamp(8rem, 22vw, 20rem); } }
/* U-7 while a dialog is open, toasts sit at the top: at the bottom they covered the dialog's buttons */
#toasts.at-top { top: 0.75rem; bottom: auto; }
html.offline #toasts.at-top { top: 2.75rem; }
/* U-8 phone: the search is a magnifier in the top bar; tapped, it opens across the whole bar */
@media (max-width: 860px) {
  .topbar .search { display: flex; flex: none; width: 2.25rem; height: var(--ctl); }
  .topbar .search input { position: absolute; right: 0; top: 0; width: 2.25rem; padding: 0 0 0 2.25rem; color: transparent; cursor: pointer; z-index: 5; }
  .topbar .search input::placeholder { color: transparent; }
  .topbar .search input:not(:placeholder-shown):not(:focus) { box-shadow: inset 0 0 0 2px var(--accent); } /* (an active search stays marked) */
  .topbar .search input:focus { position: fixed; left: 0.75rem; right: 0.75rem; top: 0.75rem; width: auto; padding: 0 0.75rem; color: var(--fg); cursor: text; z-index: 40; }
  html.offline .topbar .search input:focus { top: 3rem; }
  .topbar .search input:focus::placeholder { color: var(--faint); }
  .topbar .search:focus-within svg { display: none; }
}
/* U-9 phone menu: the whole sidebar scrolls; the project list shows every project (the remembered list height is for desktops) */
@media (max-width: 860px) {
  .sidebar { overflow-y: auto; overscroll-behavior: contain; height: 100dvh; }
  .sidebar > * { flex-shrink: 0; }
  .sidebar .projects { flex: none; overflow: visible; }
  .sidebar .proj-scroll { max-height: none; overflow: visible; }
  .sidebar .proj-resizer { display: none; }
  html.offline .sidebar { height: calc(100dvh - 2.25rem); }
}
/* U-24 the sidebar width handle shows the focus ring like every other control */
.side-resizer:focus-visible { right: 0; outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 3px; }
/* U-6 a title the server refused stays in the field until saved again or dropped */
.drawer-title.unsaved { box-shadow: inset 0 0 0 1px var(--warn); border-radius: 0.375rem; }
.title-conflict { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.25rem 0 0.5rem; }
/* U-12 a required field left empty says so under the field */
.field-error { display: block; color: var(--crit); font-size: 0.8125rem; font-weight: 500; margin-top: 0.25rem; }
/* U-11 proposals: items the person may not approve */
.prop-item:has(input:disabled) { cursor: default; }
.prop-warn .prop-noperm { color: var(--muted); }
.prop-noperm-note { margin-right: auto; }
/* proposals dialog: the sticky approve bar no longer covers the end of the last item */
.prop-items { padding-bottom: 0.5rem; }
.prop-card:last-child { margin-bottom: 1rem; }
/* old U-26 read-only pills (guest): no dropdown arrow, no hand cursor */
.pill:has(select:disabled) { padding-right: 0.5625rem; }
.pill:has(select:disabled)::after { display: none; }
.pill select:disabled { cursor: default; opacity: 1; }
/* U-4 (user guide at 1440 px, 125 %): the name in the sidebar footer gets more room (the three small buttons sit closer together) */
.side-foot { gap: 0.125rem; } .side-foot .me-btn { margin-right: 0.25rem; }
/* old U-26: the person picker is read-only too (disabled for people without the edit permission) */
button.who:disabled { cursor: default; opacity: 1; color: inherit; }
button.who:disabled .who-chev { display: none; }
