/* =====================================================================
   Traguardo web app — design system (beta.traguardo.app)

   Art direction: OmniFocus-calm. Neutral surfaces carry the UI; the brand
   green is punctuation (primary actions, active nav, focus, key accents),
   never wallpaper. System-sans typography, a 4/8 spacing rhythm, soft
   depth, a capped reading column. First-class light + dark parity.

   NOTE on tokens: `--green-tint` is deliberately a NEUTRAL hover surface
   (not a green) — it's referenced by dozens of :hover rules, so defining it
   neutral de-greens every incidental hover in one place. `--green-soft`
   stays a soft ACCENT tint, used only for active/badge states. `--accent`
   is the solid button green (kept dark enough in BOTH themes to carry white
   text). `--green-deep`/`--green` are accent TEXT + focus colors.
   ===================================================================== */
:root{
  --paper:#F5F6F4;--card:#FFFFFF;--ink:#18211C;--muted:#5B665F;--faint:#8B958E;
  --rule:#E6E9E5;--rule-strong:#D3D8D2;
  --green-deep:#005E36;--green:#008E51;--accent:#00663A;--accent-hover:#00794A;
  --green-soft:#E3EFE8;--green-tint:#EEF0ED;
  --warn:#8A5300;--warn-soft:#F5EAD7;--danger:#C0392B;
  --shadow-sm:0 1px 2px rgba(20,32,26,.05);
  --shadow:0 1px 2px rgba(20,32,26,.05),0 6px 20px rgba(20,32,26,.06);
  --shadow-lg:0 4px 12px rgba(20,32,26,.08),0 18px 40px rgba(20,32,26,.10);
  --content-w:760px;
  --r-xs:6px;--r-sm:8px;--r-md:10px;--r-lg:12px;--r-xl:16px;
  --serif:"Charter","Iowan Old Style","Palatino Linotype",Palatino,Georgia,"Times New Roman",serif;
  --sans:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI","Helvetica Neue",Arial,system-ui,sans-serif;
  --mono:ui-monospace,"SF Mono","SFMono-Regular",Menlo,Consolas,"Liberation Mono",monospace;
}
@media (prefers-color-scheme:dark){
  :root{
    --paper:#0E1512;--card:#151E19;--ink:#E8EEE9;--muted:#9BAAA1;--faint:#77877D;
    --rule:#233029;--rule-strong:#324139;
    --green-deep:#4FC98C;--green:#4FC98C;--accent:#0C7A47;--accent-hover:#0F8A50;
    --green-soft:#14291F;--green-tint:#1B241F;
    --warn:#E0A85E;--warn-soft:#2A2113;--danger:#E06055;
    --shadow-sm:0 1px 2px rgba(0,0,0,.35);
    --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 26px rgba(0,0,0,.4);
    --shadow-lg:0 6px 18px rgba(0,0,0,.45),0 20px 44px rgba(0,0,0,.5);
  }
}

/* ---------------------------------------------------------------------
   Manual theme override (the `.theme-toggle` button, see WebLayout.swift).
   `data-theme` on <html> pins a choice; absence falls back to the media
   query above. The attribute selector (0,1,1,0) beats a bare `:root`.
   --------------------------------------------------------------------- */
:root[data-theme="light"]{
  --paper:#F5F6F4;--card:#FFFFFF;--ink:#18211C;--muted:#5B665F;--faint:#8B958E;
  --rule:#E6E9E5;--rule-strong:#D3D8D2;
  --green-deep:#005E36;--green:#008E51;--accent:#00663A;--accent-hover:#00794A;
  --green-soft:#E3EFE8;--green-tint:#EEF0ED;
  --warn:#8A5300;--warn-soft:#F5EAD7;--danger:#C0392B;
  --shadow-sm:0 1px 2px rgba(20,32,26,.05);
  --shadow:0 1px 2px rgba(20,32,26,.05),0 6px 20px rgba(20,32,26,.06);
  --shadow-lg:0 4px 12px rgba(20,32,26,.08),0 18px 40px rgba(20,32,26,.10);
}
:root[data-theme="dark"]{
  --paper:#0E1512;--card:#151E19;--ink:#E8EEE9;--muted:#9BAAA1;--faint:#77877D;
  --rule:#233029;--rule-strong:#324139;
  --green-deep:#4FC98C;--green:#4FC98C;--accent:#0C7A47;--accent-hover:#0F8A50;
  --green-soft:#14291F;--green-tint:#1B241F;
  --warn:#E0A85E;--warn-soft:#2A2113;--danger:#E06055;
  --shadow-sm:0 1px 2px rgba(0,0,0,.35);
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 26px rgba(0,0,0,.4);
  --shadow-lg:0 6px 18px rgba(0,0,0,.45),0 20px 44px rgba(0,0,0,.5);
}

*{box-sizing:border-box}
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--sans);
  font-size:15px;
  line-height:1.5;
  letter-spacing:-.005em;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
::selection{ background:var(--green-soft); color:var(--green-deep); }

/* ---------------------------------------------------------------------
   Web app shell — responsive nav. Desktop (>900px): fixed left sidebar.
   Phone/tablet (<=900px): sticky top bar + slide-in drawer (CSS-only via a
   hidden checkbox).
   --------------------------------------------------------------------- */
.web-shell{
  display:flex;
  min-height:100vh;
  align-items:stretch;
}

.web-nav-toggle-input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.web-topbar{
  display:none;
  align-items:center;
  gap:8px;
  height:56px;
  padding:0 12px;
  background:var(--card);
  border-bottom:1px solid var(--rule);
  position:sticky;
  top:0;
  z-index:20;
}

.web-nav-toggle{
  display:flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  min-width:40px;
  border-radius:var(--r-md);
  cursor:pointer;
  font-size:1.15rem;
  color:var(--ink);
}
.web-nav-toggle:hover{background:var(--green-tint)}

.web-brand{
  font-family:var(--sans);
  font-size:1.1rem;
  font-weight:700;
  letter-spacing:-.02em;
  color:var(--ink);
  text-decoration:none;
}
.web-brand:hover{ color:var(--green-deep); }

/* Closed-beta pill next to the wordmark. */
.web-beta-badge{
  display:inline-flex;
  align-items:center;
  height:19px;
  padding:0 7px;
  border-radius:999px;
  background:var(--green-soft);
  color:var(--green-deep);
  font-family:var(--sans);
  font-size:.62rem;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.web-topbar .web-beta-badge{ margin-left:-2px; }

/* Light/dark/system toggle (`.theme-toggle`) — `margin-left:auto` places it
   at the end of whichever flex row it's in (topbar, sidebar, auth topbar). */
.theme-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  min-width:34px;
  margin-left:auto;
  border:none;
  border-radius:var(--r-md);
  background:transparent;
  color:var(--muted);
  font-size:.95rem;
  line-height:1;
  cursor:pointer;
}
.theme-toggle:hover{ background:var(--green-tint); color:var(--ink); }

.web-sidebar{
  display:flex;
  flex-direction:column;
  flex:0 0 248px;
  width:248px;
  padding:20px 12px 16px;
  background:var(--card);
  border-right:1px solid var(--rule);
  gap:2px;
}
.web-sidebar-brand-row{
  display:flex;
  align-items:center;
  gap:8px;
  padding:2px 10px 18px;
}
.web-sidebar-brand-row .web-brand{
  font-size:1.2rem;
}

.web-nav-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:1px;
}
.web-nav-list a{
  display:flex;
  align-items:center;
  min-height:38px;
  padding:0 12px;
  border-radius:var(--r-md);
  color:var(--ink);
  text-decoration:none;
  font-size:.9rem;
  font-weight:500;
}
.web-nav-list a:hover{background:var(--green-tint)}
.web-nav-list a.active{
  background:var(--green-soft);
  color:var(--green-deep);
  font-weight:600;
}

.web-nav-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(20,32,26,.4);
  backdrop-filter:blur(1px);
  z-index:15;
}

.web-content{
  flex:1;
  min-width:0;
  padding:36px 40px 56px;
}

@media (max-width:900px){
  .web-shell{ flex-direction:column; }
  .web-topbar{ display:flex; }
  .web-sidebar{
    position:fixed;
    top:0;
    left:0;
    bottom:0;
    flex:0 0 auto;
    width:min(288px,82vw);
    transform:translateX(-100%);
    transition:transform .22s cubic-bezier(.4,0,.2,1);
    z-index:20;
    box-shadow:var(--shadow-lg);
  }
  .web-nav-toggle-input:checked ~ .web-sidebar{ transform:translateX(0); }
  .web-nav-toggle-input:checked ~ .web-nav-overlay{ display:block; }
  .web-content{ padding:20px 16px 44px; }
}

/* ---------------------------------------------------------------------
   Feedback disclosure (nav) — native <details>/<summary>, pinned to the
   bottom of the sidebar/drawer.
   --------------------------------------------------------------------- */
.web-notify-toggle{
  display:flex;
  align-items:center;
  min-height:38px;
  width:100%;
  margin-top:6px;
  padding:0 12px;
  border:none;
  border-radius:var(--r-md);
  background:transparent;
  color:var(--muted);
  font-family:var(--sans);
  font-size:.88rem;
  text-align:left;
  cursor:pointer;
}
.web-notify-toggle:hover{ background:var(--green-tint); color:var(--ink); }

.web-feedback{
  margin-top:auto;
  padding-top:10px;
  border-top:1px solid var(--rule);
}

.web-feedback summary{
  display:flex;
  align-items:center;
  min-height:38px;
  padding:0 12px;
  border-radius:var(--r-md);
  color:var(--muted);
  font-size:.88rem;
  cursor:pointer;
  list-style:none;
}
.web-feedback summary::-webkit-details-marker{ display:none; }
.web-feedback summary:hover{ background:var(--green-tint); color:var(--ink); }
.web-feedback[open] summary{ color:var(--ink); font-weight:600; }

.web-feedback-form{
  display:grid;
  gap:8px;
  padding:10px 12px 4px;
}

.web-feedback-form label{
  font-size:.78rem;
  font-weight:600;
  color:var(--muted);
}

.web-feedback-form textarea{
  width:100%;
  min-height:80px;
  resize:vertical;
  font-family:var(--sans);
  font-size:.9rem;
  color:var(--ink);
  background:var(--paper);
  border:1px solid var(--rule-strong);
  border-radius:var(--r-md);
  padding:10px 12px;
}
.web-feedback-form textarea:focus{
  outline:none;
  border-color:var(--green);
  box-shadow:0 0 0 3px var(--green-soft);
}

.web-feedback-form button{
  justify-self:start;
  min-height:38px;
  font-family:var(--sans);
  font-weight:600;
  font-size:.9rem;
  color:#fff;
  cursor:pointer;
  background:var(--accent);
  border:none;
  border-radius:var(--r-md);
  padding:0 18px;
}
.web-feedback-form button:hover{ background:var(--accent-hover); }

.web-feedback-sent{
  margin:0;
  padding:10px 12px 4px;
  font-size:.88rem;
  color:var(--muted);
}

/* ---------------------------------------------------------------------
   Standalone auth shell (login / 2FA / waitlist) — full-screen, no nav.
   --------------------------------------------------------------------- */
.web-auth-shell{
  display:flex;
  flex-direction:column;
  min-height:100vh;
  background:var(--paper);
}

.web-auth-shell-topbar{
  display:flex;
  align-items:center;
  padding:16px 16px 0;
}

.web-auth-shell-main{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}

/* ---------------------------------------------------------------------
   Auth (login + 2FA). `#auth-panel` inside the card is the HTMX swap
   target between the login form and the email-OTP form.
   --------------------------------------------------------------------- */
.auth-page{
  display:flex;
  justify-content:center;
  width:100%;
  padding:20px 0;
}

.auth-card{
  width:100%;
  max-width:400px;
  background:var(--card);
  border:1px solid var(--rule);
  border-radius:var(--r-xl);
  padding:34px 30px;
  box-shadow:var(--shadow);
}

.auth-brand{
  font-family:var(--sans);
  font-size:1.2rem;
  font-weight:700;
  letter-spacing:-.02em;
  color:var(--ink);
  margin:0 0 22px;
}

.auth-title{
  font-family:var(--sans);
  font-weight:650;
  font-size:1.4rem;
  letter-spacing:-.02em;
  margin:0 0 6px;
}

.auth-hint{
  color:var(--muted);
  font-size:.9rem;
  margin:0 0 18px;
}

.auth-panel form{
  display:grid;
  gap:14px;
  margin-top:14px;
}

.auth-panel .field{
  display:grid;
  gap:6px;
}

.auth-panel label{
  font-size:.82rem;
  font-weight:600;
  color:var(--muted);
}

.auth-panel input{
  width:100%;
  min-height:44px;
  font-family:var(--sans);
  font-size:1rem;
  color:var(--ink);
  background:var(--paper);
  border:1px solid var(--rule-strong);
  border-radius:var(--r-md);
  padding:10px 14px;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.auth-panel input:focus{
  outline:none;
  border-color:var(--green);
  box-shadow:0 0 0 3px var(--green-soft);
}

.auth-panel button{
  min-height:44px;
  font-family:var(--sans);
  font-weight:600;
  font-size:1rem;
  color:#fff;
  cursor:pointer;
  background:var(--accent);
  border:none;
  border-radius:var(--r-md);
  padding:0 22px;
}
.auth-panel button:hover{ background:var(--accent-hover); }
.auth-panel button:disabled{ opacity:.55; cursor:default; }

.auth-error{
  background:var(--warn-soft);
  border:1px solid transparent;
  border-left:3px solid var(--danger);
  border-radius:var(--r-sm);
  padding:10px 14px;
  font-size:.88rem;
  color:var(--ink);
  margin:0 0 14px;
}

/* Login/signup mode toggle — CSS-only. */
.auth-mode-toggle-input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.auth-mode-signup{ display:none; }
.auth-mode-toggle-input:checked ~ #auth-panel .auth-mode-login{ display:none; }
.auth-mode-toggle-input:checked ~ #auth-panel .auth-mode-signup{ display:block; }

.auth-switch{
  margin:16px 0 0;
  font-size:.88rem;
  color:var(--muted);
  text-align:center;
}

.auth-switch-link{
  color:var(--green-deep);
  font-weight:600;
  cursor:pointer;
  text-decoration:none;
}
.auth-switch-link:hover{ text-decoration:underline; }

@media (max-width:480px){
  .auth-card{ padding:26px 22px; border-radius:var(--r-lg); }
}

/* Sign in with Apple — Apple HIG colors (black on light, white on dark),
   deliberately not the brand green. */
.auth-divider{
  display:flex;
  align-items:center;
  gap:12px;
  margin:22px 0 16px;
  color:var(--faint);
  font-size:.8rem;
}
.auth-divider::before,
.auth-divider::after{
  content:"";
  flex:1;
  height:1px;
  background:var(--rule);
}

.auth-apple-button{
  width:100%;
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-family:var(--sans);
  font-weight:600;
  font-size:1rem;
  cursor:pointer;
  background:#000;
  color:#fff;
  border:1px solid #000;
  border-radius:var(--r-md);
  padding:0 22px;
}
.auth-apple-button:hover{ filter:brightness(1.15); }
.auth-apple-logo{ width:16px; height:16px; flex-shrink:0; }

@media (prefers-color-scheme:dark){
  .auth-apple-button{ background:#fff; color:#000; border-color:#fff; }
}
:root[data-theme="dark"] .auth-apple-button{ background:#fff; color:#000; border-color:#fff; }
:root[data-theme="light"] .auth-apple-button{ background:#000; color:#fff; border-color:#000; }

/* ---------------------------------------------------------------------
   Paywall — centered card, two plan columns on desktop, one on phone.
   --------------------------------------------------------------------- */
.paywall-page{
  display:flex;
  justify-content:center;
  padding:40px 0 60px;
}

.paywall-card{
  width:100%;
  max-width:640px;
  background:var(--card);
  border:1px solid var(--rule);
  border-radius:var(--r-xl);
  padding:34px 30px;
  box-shadow:var(--shadow);
}

.paywall-plans{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:14px;
  margin-top:22px;
}

.paywall-plan{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:20px 18px;
  background:var(--paper);
  border:1px solid var(--rule-strong);
  border-radius:var(--r-lg);
}

.paywall-plan-featured{
  background:var(--green-soft);
  border-color:var(--green);
}

.paywall-plan-badge{
  align-self:flex-start;
  display:inline-flex;
  align-items:center;
  height:20px;
  padding:0 8px;
  border-radius:999px;
  background:var(--accent);
  color:#fff;
  font-family:var(--sans);
  font-size:.66rem;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.paywall-plan-name{
  font-family:var(--sans);
  font-weight:600;
  font-size:.95rem;
  color:var(--ink);
}

.paywall-plan-price{
  display:flex;
  align-items:baseline;
  gap:4px;
}

.paywall-plan-price-amount{
  font-family:var(--sans);
  font-weight:700;
  font-size:1.7rem;
  letter-spacing:-.02em;
  color:var(--green-deep);
}

.paywall-plan-price-period{
  color:var(--muted);
  font-size:.85rem;
}

.paywall-plan button{
  margin-top:8px;
  min-height:44px;
  font-family:var(--sans);
  font-weight:600;
  font-size:.92rem;
  color:#fff;
  cursor:pointer;
  background:var(--accent);
  border:none;
  border-radius:var(--r-md);
  padding:0 18px;
}
.paywall-plan button:hover{ background:var(--accent-hover); }
.paywall-plan button:disabled{ opacity:.55; cursor:default; }

.paywall-footnote{
  margin:22px 0 0;
  color:var(--faint);
  font-size:.82rem;
  text-align:center;
}

@media (max-width:560px){
  .paywall-card{ padding:26px 22px; border-radius:var(--r-lg); }
  .paywall-plans{ grid-template-columns:1fr; }
}

/* ---------------------------------------------------------------------
   Sidebar sections (Projects/Tags) + quick-create + footer.
   --------------------------------------------------------------------- */
.web-sidebar-section{
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--rule);
}

.web-sidebar-section-title{
  padding:0 12px 6px;
  font-size:.68rem;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--faint);
}

.web-sidebar-item{
  display:flex;
  align-items:center;
  gap:2px;
}
.web-sidebar-item a{ flex:1; min-width:0; }

/* Folder groups under Projects (Fragments/Sidebar.swift) — folder-owned
   projects grouped by their folder, indented under the folder's name.
   Folder titles are user content, so no uppercase transform (unlike the
   section titles above); archived folders stay listed but dimmed. */
.web-sidebar-folder{ margin-top:10px; }
.web-sidebar-folder-title{
  padding:0 12px 4px;
  font-size:.72rem;
  font-weight:600;
  letter-spacing:.02em;
  color:var(--faint);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
/* Bez odsazení projektů — titulek složky stačí jako oddělovač (feedback #457). */
.web-sidebar-folder-archived{ opacity:.5; }

.sidebar-item-delete{
  flex:0 0 auto;
  min-width:30px;
  min-height:30px;
  font-family:var(--sans);
  font-size:1rem;
  line-height:1;
  color:var(--faint);
  cursor:pointer;
  background:none;
  border:none;
  border-radius:var(--r-sm);
  opacity:0;
  transition:opacity .15s ease, color .15s ease, background .15s ease;
}
.web-sidebar-item:hover .sidebar-item-delete{ opacity:1; }
.sidebar-item-delete:hover{ color:var(--danger); background:var(--green-tint); }

.sidebar-add-form{
  display:flex;
  gap:6px;
  margin-top:6px;
  padding:0 10px;
}

.sidebar-add-input{
  flex:1;
  min-width:0;
  min-height:34px;
  font-family:var(--sans);
  font-size:.84rem;
  color:var(--ink);
  background:var(--paper);
  border:1px solid var(--rule-strong);
  border-radius:var(--r-sm);
  padding:6px 10px;
}
.sidebar-add-input:focus{
  outline:none;
  border-color:var(--green);
  box-shadow:0 0 0 3px var(--green-soft);
}

.sidebar-add-submit{
  flex:0 0 auto;
  min-width:34px;
  min-height:34px;
  font-family:var(--sans);
  font-weight:600;
  font-size:1rem;
  color:var(--green-deep);
  cursor:pointer;
  background:var(--green-tint);
  border:none;
  border-radius:var(--r-sm);
}
.sidebar-add-submit:hover{ background:var(--green-soft); }

/* Sidebar footer — signed-in email + Sign out. */
.web-sidebar-footer{
  margin-top:16px;
  padding:14px 12px 4px;
  border-top:1px solid var(--rule);
  display:flex;
  flex-direction:column;
  gap:8px;
}
.web-sidebar-footer-email{
  color:var(--muted);
  font-size:.76rem;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.web-sidebar-signout{
  align-self:flex-start;
  min-height:30px;
  padding:5px 14px;
  border:1px solid var(--rule-strong);
  background:var(--card);
  color:var(--ink);
  border-radius:var(--r-sm);
  font:inherit;
  font-size:.8rem;
  font-weight:600;
  cursor:pointer;
}
.web-sidebar-signout:hover{ background:var(--green-tint); border-color:var(--rule-strong); }

/* ---------------------------------------------------------------------
   Task list + task row — shared building block for every list screen.
   Rows read as a calm, hairline-separated native list; board cards +
   mind-map panel rows re-add a card surface below.
   --------------------------------------------------------------------- */
.task-list{
  display:flex;
  flex-direction:column;
  gap:0;
  max-width:var(--content-w);
}

.add-task-form{
  display:flex;
  gap:8px;
  margin-bottom:10px;
}

.add-task-wrap{ position:relative; }

.ai-toggle-input{
  position:absolute;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}

.add-task-form-ai{ display:none; }
.ai-toggle-input:checked ~ .add-task-forms .add-task-form-plain{ display:none; }
.ai-toggle-input:checked ~ .add-task-forms .add-task-form-ai{ display:flex; }

.ai-toggle-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:0 12px;
  font-family:var(--sans);
  font-weight:600;
  font-size:.82rem;
  white-space:nowrap;
  color:var(--green-deep);
  background:var(--green-tint);
  border-radius:var(--r-md);
  cursor:pointer;
}
.ai-toggle-btn:hover{ background:var(--green-soft); }

.add-task-input{
  flex:1;
  min-width:0;
  min-height:42px;
  font-family:var(--sans);
  font-size:.95rem;
  color:var(--ink);
  background:var(--card);
  border:1px solid var(--rule-strong);
  border-radius:var(--r-md);
  padding:10px 14px;
}
.add-task-input:focus{
  outline:none;
  border-color:var(--green);
}

.add-task-submit{
  min-height:42px;
  min-width:42px;
  font-family:var(--sans);
  font-weight:600;
  font-size:.92rem;
  color:#fff;
  cursor:pointer;
  background:var(--accent);
  border:none;
  border-radius:var(--r-md);
  padding:0 18px;
}
.add-task-submit:hover{ background:var(--accent-hover); }

.task-list-empty{
  margin:0;
  padding:40px 4px;
  color:var(--muted);
  font-size:.92rem;
  text-align:center;
}

.task-row{
  display:flex;
  align-items:flex-start;
  gap:12px;
  min-height:44px;
  padding:11px 12px;
  background:transparent;
  border:1px solid transparent;
  border-bottom:1px solid var(--rule);
  border-radius:var(--r-md);
}
.task-row:last-child{ border-bottom-color:transparent; }

.task-row-done .task-title{
  color:var(--faint);
  text-decoration:line-through;
}

.task-checkbox{
  appearance:none;
  -webkit-appearance:none;
  position:relative;
  width:20px;
  height:20px;
  min-width:20px;
  margin:2px 2px 2px 0;
  border:1.5px solid var(--rule-strong);
  border-radius:var(--r-xs);
  background:var(--card);
  cursor:pointer;
  transition:border-color .15s ease, background .15s ease;
}
.task-checkbox:hover{ border-color:var(--green); }
.task-checkbox:checked{ background:var(--green); border-color:var(--green); }
.task-checkbox:checked::after{
  content:"";
  position:absolute;
  left:6px; top:2px;
  width:4px; height:9px;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:rotate(45deg);
}

.task-row-main{
  display:flex;
  flex-direction:column;
  gap:5px;
  min-width:0;
  flex:1;
}

.task-title{
  color:var(--ink);
  text-decoration:none;
  font-size:.94rem;
  line-height:1.4;
  word-break:break-word;
}
.task-title:hover{ color:var(--green-deep); }

.task-chips{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
}

/* Base chip — quiet neutral pill; only flag/due specialize below. */
.task-chip{
  display:inline-flex;
  align-items:center;
  height:20px;
  padding:0 8px;
  border-radius:999px;
  background:var(--green-tint);
  color:var(--muted);
  font-size:.72rem;
  font-weight:600;
  white-space:nowrap;
}

/* Due date reads as plain muted meta text, not a colored badge. */
.task-chip-due{
  background:transparent;
  padding:0;
  color:var(--faint);
  font-weight:600;
}
.task-chip-due::before{
  content:"";
  display:inline-block;
  width:5px; height:5px;
  margin-right:6px;
  border-radius:999px;
  background:var(--faint);
  vertical-align:middle;
}

/* Flag = attention → sparing amber, not green. */
.task-chip-flag{
  background:var(--warn-soft);
  color:var(--warn);
}

.task-chip-project{
  background:var(--green-tint);
  color:var(--muted);
}

@media (max-width:480px){
  .task-row{ padding:10px; gap:10px; }
}

/* Manual reorder (project page) — the wrapper moves during drag, not the
   row itself, so an HTMX swap of `#task-{id}` never disturbs it. */
.task-row-draggable{
  display:flex;
  align-items:center;
  gap:2px;
}
.task-row-draggable .task-row{ flex:1; min-width:0; }

.task-drag-handle{
  flex:none;
  display:flex;
  align-items:center;
  justify-content:center;
  width:22px;
  min-height:44px;
  color:var(--faint);
  font-size:1rem;
  line-height:1;
  cursor:grab;
  user-select:none;
  touch-action:none;
  opacity:0;
  transition:opacity .15s ease, color .15s ease;
}
.task-row-draggable:hover .task-drag-handle{ opacity:1; }
.task-drag-handle:hover{ color:var(--green-deep); }
.task-drag-handle:active{ cursor:grabbing; }

.task-row-dragging{ opacity:.4; }

@media (prefers-reduced-motion:no-preference){
  .task-row-draggable{ transition:opacity .12s ease; }
}

/* ---------------------------------------------------------------------
   List / page header (Today/Inbox/Forecast/Browse/etc).
   --------------------------------------------------------------------- */
.web-page-header{
  margin:0 0 22px;
  max-width:var(--content-w);
}

.web-page-title{
  font-family:var(--sans);
  font-weight:700;
  font-size:1.5rem;
  letter-spacing:-.025em;
  color:var(--ink);
  margin:0 0 4px;
}

.web-page-hint{
  margin:0;
  color:var(--muted);
  font-size:.9rem;
}

/* ---------------------------------------------------------------------
   Project page — inline-editable title + delete.
   --------------------------------------------------------------------- */
.project-page-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.project-title-field{ flex:1; min-width:200px; }

.project-title-input{
  width:100%;
  min-height:44px;
  font-family:var(--sans);
  font-weight:700;
  font-size:1.5rem;
  letter-spacing:-.025em;
  color:var(--ink);
  background:transparent;
  border:1px solid transparent;
  border-radius:var(--r-sm);
  padding:2px 8px;
  margin-left:-8px;
}
.project-title-input:hover{ border-color:var(--rule); }
.project-title-input:focus{
  outline:none;
  background:var(--card);
  border-color:var(--green);
  box-shadow:0 0 0 3px var(--green-soft);
}

.project-delete-button{
  flex:0 0 auto;
  min-height:36px;
  font-family:var(--sans);
  font-weight:600;
  font-size:.84rem;
  color:var(--muted);
  cursor:pointer;
  background:none;
  border:1px solid var(--rule-strong);
  border-radius:var(--r-sm);
  padding:0 14px;
}
.project-delete-button:hover{ color:var(--danger); border-color:var(--danger); background:var(--warn-soft); }

/* ---------------------------------------------------------------------
   Task detail — each field is its own HTMX island.
   --------------------------------------------------------------------- */
.task-detail{
  display:flex;
  flex-direction:column;
  gap:20px;
  max-width:720px;
}

.task-detail-back{
  color:var(--muted);
  text-decoration:none;
  font-size:.88rem;
  font-weight:600;
}
.task-detail-back:hover{ color:var(--green-deep); }

/* The detail header row reuses `.task-row`; give it a proper card here so
   it reads as the page subject, not another list item. */
.task-detail > .task-row{
  background:var(--card);
  border:1px solid var(--rule);
  border-radius:var(--r-lg);
  padding:16px;
  box-shadow:var(--shadow-sm);
}
.task-detail > .task-row .task-title{ font-size:1.05rem; font-weight:600; }

.task-detail-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
  gap:14px;
}

.task-detail-field{
  display:grid;
  gap:6px;
}

.task-detail-field-wide{
  grid-column:1 / -1;
}

.task-detail-field label,
.task-detail-field-label{
  font-size:.78rem;
  font-weight:600;
  color:var(--muted);
}

.task-detail-field-form{
  display:block;
}

.task-detail-input,
.task-detail-textarea{
  width:100%;
  min-height:44px;
  font-family:var(--sans);
  font-size:.95rem;
  color:var(--ink);
  background:var(--card);
  border:1px solid var(--rule-strong);
  border-radius:var(--r-md);
  padding:10px 14px;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.task-detail-input:focus,
.task-detail-textarea:focus{
  outline:none;
  border-color:var(--green);
  box-shadow:0 0 0 3px var(--green-soft);
}

.task-detail-textarea{
  min-height:96px;
  resize:vertical;
}

.task-detail-hint{
  margin:0;
  color:var(--muted);
  font-size:.9rem;
}

.task-detail-tag-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.task-detail-tag-toggle{
  min-height:34px;
  font-family:var(--sans);
  font-size:.84rem;
  font-weight:600;
  color:var(--muted);
  cursor:pointer;
  background:var(--card);
  border:1px solid var(--rule-strong);
  border-radius:999px;
  padding:0 14px;
}
.task-detail-tag-toggle:hover{ border-color:var(--green); color:var(--ink); }

.task-detail-tag-toggle-active{
  color:#fff;
  background:var(--accent);
  border-color:transparent;
}
.task-detail-tag-toggle-active:hover{ color:#fff; background:var(--accent-hover); }

.task-detail-subtask-list{
  margin-bottom:10px;
}

/* Task links — one anchor per row, remove button on the trailing edge. */
.task-detail-link-list{
  list-style:none;
  margin:0 0 10px;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.task-detail-link-row{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:34px;
}

.task-detail-link{
  flex:1;
  min-width:0;
  color:var(--accent);
  font-size:.9rem;
  text-decoration:none;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.task-detail-link:hover{ text-decoration:underline; }

.task-detail-link-remove-form{ display:flex; }

.task-detail-link-remove{
  border:0;
  background:none;
  cursor:pointer;
  color:var(--muted);
  font-size:1.1rem;
  line-height:1;
  padding:4px 6px;
  border-radius:6px;
}
.task-detail-link-remove:hover{ color:var(--ink); background:var(--rule); }

@media (max-width:480px){
  .task-detail-grid{ grid-template-columns:1fr 1fr; }
}

/* ---------------------------------------------------------------------
   Settings.
   --------------------------------------------------------------------- */
.settings-form{
  max-width:480px;
}

.settings-form + .settings-form,
.settings-form + form,
form + .settings-form{ margin-top:24px; }

.settings-form-fields{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.settings-field{
  display:grid;
  gap:6px;
}

.settings-field label{
  font-size:.78rem;
  font-weight:600;
  color:var(--muted);
}

.settings-input{
  width:100%;
  min-height:44px;
  font-family:var(--sans);
  font-size:.95rem;
  color:var(--ink);
  background:var(--card);
  border:1px solid var(--rule-strong);
  border-radius:var(--r-md);
  padding:10px 14px;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.settings-input:focus{
  outline:none;
  border-color:var(--green);
  box-shadow:0 0 0 3px var(--green-soft);
}

.settings-checkbox-label{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  font-family:var(--sans);
  font-size:.95rem;
  color:var(--ink);
}

.settings-checkbox-label input[type="checkbox"]{
  width:20px;
  height:20px;
  accent-color:var(--green);
}

/* Account card — grouped surface at the top of Settings. */
.settings-account{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:24px;
  padding:18px 20px;
  background:var(--card);
  border:1px solid var(--rule);
  border-radius:var(--r-lg);
  box-shadow:var(--shadow-sm);
}
.settings-account-name{ font-weight:600;color:var(--ink);font-size:1.05rem }
.settings-account-email{ color:var(--muted);font-size:.9rem }
.settings-account-plan{ margin-top:8px }
.plan-badge{ display:inline-block;padding:3px 11px;border-radius:999px;font-size:.72rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase }
.plan-premium{ background:var(--green-soft);color:var(--green-deep) }
.plan-free{ background:var(--green-tint);color:var(--muted) }
.settings-signout{ margin-top:12px;align-self:flex-start;padding:8px 16px;border:1px solid var(--rule-strong);background:var(--paper);color:var(--ink);border-radius:var(--r-md);font:inherit;font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease }
.settings-signout:hover{ background:var(--green-tint) }
.web-feedback-close{ margin-top:8px;padding:6px 12px;border:1px solid var(--rule);background:transparent;color:var(--muted);border-radius:var(--r-sm);font:inherit;font-size:.84rem;cursor:pointer }
.web-feedback-close:hover{ color:var(--ink);border-color:var(--rule-strong) }

/* API keys — credentials for the MCP endpoint (POST /mcp). */
.settings-section-title{ font-size:.68rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin-bottom:8px }
.settings-section-hint{ color:var(--muted);font-size:.85rem;line-height:1.5;margin:0 0 14px }
.settings-section-hint code{ font-family:var(--mono);font-size:.82rem;color:var(--ink) }

/* One-time reveal of a freshly created key — it is never shown again. */
.apikey-reveal{ margin-bottom:16px;padding:14px 16px;border:1px solid var(--green);border-radius:var(--r-lg);background:var(--green-soft) }
.apikey-reveal-title{ font-size:.8rem;font-weight:600;color:var(--green-deep);margin-bottom:8px }
.apikey-reveal-row{ display:flex;align-items:center;gap:10px;flex-wrap:wrap }
.apikey-value{ flex:1 1 260px;min-width:0;overflow-wrap:anywhere;font-family:var(--mono);font-size:.82rem;color:var(--ink);background:var(--paper);border:1px solid var(--rule);border-radius:var(--r-sm);padding:8px 10px }
.apikey-copy{ padding:8px 16px;border:1px solid var(--green);background:var(--green);color:#fff;border-radius:var(--r-md);font:inherit;font-weight:600;cursor:pointer }
.apikey-copy:hover{ filter:brightness(1.05) }

.apikey-create-form{ display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px }
.apikey-create-form .settings-input{ flex:1 1 220px;width:auto }
.apikey-create-button{ padding:8px 16px;border:1px solid var(--rule-strong);background:var(--paper);color:var(--ink);border-radius:var(--r-md);font:inherit;font-weight:600;cursor:pointer }
.apikey-create-button:hover{ background:var(--green-tint) }

.apikey-list{ list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px }
.apikey-row{ display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 14px;border:1px solid var(--rule);border-radius:var(--r-lg);background:var(--card) }
.apikey-row-revoked{ opacity:.6 }
.apikey-row-main{ display:flex;align-items:baseline;gap:8px;flex:1 1 180px;min-width:0 }
.apikey-row-name{ font-weight:600;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap }
.apikey-row-prefix{ font-family:var(--mono);font-size:.78rem;color:var(--muted) }
.apikey-row-meta{ font-size:.78rem;color:var(--muted) }
.apikey-revoked-badge{ font-size:.72rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--muted) }
.apikey-revoke{ padding:6px 12px;border:1px solid var(--danger);background:transparent;color:var(--danger);border-radius:var(--r-md);font:inherit;font-size:.84rem;font-weight:600;cursor:pointer }
.apikey-revoke:hover{ background:var(--danger);color:#fff }

/* Danger zone — red-tinted, clearly separated + irreversible. */
.settings-danger-zone{ margin-top:28px;padding:18px 20px;border:1px solid var(--rule);border-radius:var(--r-lg);background:var(--card) }
.settings-danger-zone-title{ font-size:.68rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--danger);margin-bottom:10px }
.settings-delete-account{ padding:8px 16px;border:1px solid var(--danger);background:transparent;color:var(--danger);border-radius:var(--r-md);font:inherit;font-weight:600;cursor:pointer }
.settings-delete-account:hover{ background:var(--danger);color:#fff }

/* =====================================================================
   MOTION & POLISH — appended layer, overrides above. All motion gated
   behind prefers-reduced-motion: no-preference.
   ===================================================================== */

.task-row, .task-checkbox, .add-task-submit, .ai-toggle-btn,
.web-nav-list a, .settings-signout, .sidebar-item-delete, .task-detail-back,
.paywall-plan button, .auth-panel button, .theme-toggle, .web-notify-toggle,
.web-sidebar-signout, .settings-delete-account, .web-brand,
.task-detail-tag-toggle, .project-delete-button{
  transition:background .16s ease, color .16s ease, border-color .16s ease,
             box-shadow .18s ease, opacity .16s ease;
}

/* List rows: calm neutral hover, no lift (native list feel). */
.task-row:hover{ background:var(--green-tint); border-bottom-color:transparent; }

.task-title{ transition:color .15s ease; }

/* Quick-add composer — sticky capture bar that reads as a real toolbar. */
.add-task-wrap{
  position:sticky; top:-4px; z-index:6;
  margin-bottom:14px;
  padding:6px 0 12px;
  background:linear-gradient(var(--paper) 76%, rgba(0,0,0,0));
}
.add-task-form{
  gap:8px; margin-bottom:0;
  padding:6px 6px 6px 8px;
  background:var(--card);
  border:1px solid var(--rule-strong);
  border-radius:var(--r-lg);
  box-shadow:var(--shadow-sm);
  transition:border-color .16s ease, box-shadow .18s ease;
}
.add-task-form:focus-within{
  border-color:var(--green);
  box-shadow:0 0 0 3px var(--green-soft), var(--shadow-sm);
}
.add-task-input{
  border:none; background:transparent; border-radius:var(--r-md);
  font-size:1rem;
}
.add-task-input:focus{ border:none; }
.add-task-submit{
  border-radius:var(--r-md); letter-spacing:.01em;
}
.add-task-submit:active{ transform:translateY(1px); }
.ai-toggle-btn{ border-radius:var(--r-md); }

@media (prefers-reduced-motion:no-preference){
  .task-row{ animation:taskRowIn .28s cubic-bezier(.22,.61,.36,1) both; }
  @keyframes taskRowIn{ from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:none;} }
  .task-row:nth-child(2){ animation-delay:.02s; }
  .task-row:nth-child(3){ animation-delay:.04s; }
  .task-row:nth-child(4){ animation-delay:.06s; }
  .task-row:nth-child(5){ animation-delay:.08s; }
  .task-row:nth-child(6){ animation-delay:.10s; }
  .task-row:nth-child(n+7){ animation-delay:.12s; }

  .web-content > *{ animation:contentIn .3s ease both; }
  @keyframes contentIn{ from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:none;} }

  .task-row-done .task-checkbox{ animation:checkPop .32s cubic-bezier(.34,1.56,.64,1); }
  @keyframes checkPop{ 0%{transform:scale(1);} 45%{transform:scale(1.22);} 100%{transform:scale(1);} }
}

/* Keyboard focus rings. */
.add-task-input:focus-visible, .settings-input:focus-visible,
.task-detail-input:focus-visible, .auth-panel input:focus-visible,
.web-nav-list a:focus-visible, .task-title:focus-visible,
.task-detail-tag-toggle:focus-visible, .mm-toolbar-btn:focus-visible{
  outline:2px solid var(--green); outline-offset:2px;
}

/* Quiet, on-brand scrollbars. */
.web-content, .board-column-list, .mm-item-panel{ scrollbar-width:thin; scrollbar-color:var(--rule-strong) transparent; }
.web-content::-webkit-scrollbar, .board-columns::-webkit-scrollbar,
.board-column-list::-webkit-scrollbar, .mm-item-panel::-webkit-scrollbar{ width:10px; height:10px; }
.web-content::-webkit-scrollbar-thumb, .board-columns::-webkit-scrollbar-thumb,
.board-column-list::-webkit-scrollbar-thumb, .mm-item-panel::-webkit-scrollbar-thumb{
  background:var(--rule-strong); border-radius:99px; border:3px solid transparent; background-clip:padding-box;
}
.web-content::-webkit-scrollbar-thumb:hover{ background:var(--faint); background-clip:padding-box; }

/* ---------------------------------------------------------------------
   Mind map. `#mm-viewport` clips a fixed 4000×4000 `#mm-canvas`; every
   node is absolutely positioned with a `translate(-50%,-50%)` transform
   the drag code depends on — restyle the LOOK, never the positioning.
   --------------------------------------------------------------------- */
.project-mindmap-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:38px;
  padding:0 14px;
  border:1px solid var(--rule-strong);
  border-radius:var(--r-md);
  background:var(--card);
  color:var(--ink);
  text-decoration:none;
  font-size:.9rem;
  font-weight:600;
  white-space:nowrap;
}
.project-mindmap-link:hover{ background:var(--green-tint); border-color:var(--rule-strong); }

.mm-toolbar{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 16px;
}
.mm-toolbar-btn{
  min-height:38px;
  padding:0 14px;
  border:1px solid var(--rule-strong);
  border-radius:var(--r-md);
  background:var(--card);
  color:var(--ink);
  font:inherit;
  font-size:.86rem;
  font-weight:600;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease;
}
.mm-toolbar-btn:hover{ background:var(--green-tint); border-color:var(--rule-strong); }
.mm-toolbar-btn-primary{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
}
.mm-toolbar-btn-primary:hover{ background:var(--accent-hover); border-color:var(--accent-hover); }
.mm-toolbar-zoom{
  display:flex;
  gap:4px;
  margin-left:auto;
}
.mm-toolbar-zoom-btn{
  width:38px;
  padding:0;
  text-align:center;
}

.mm-viewport{
  position:relative;
  overflow:hidden;
  height:calc(100vh - 240px);
  min-height:420px;
  border:1px solid var(--rule);
  border-radius:var(--r-xl);
  background:var(--paper);
  background-image:radial-gradient(var(--rule) 1px, transparent 1px);
  background-size:22px 22px;
  box-shadow:inset 0 1px 2px rgba(20,32,26,.03);
}

.mm-canvas{
  position:relative;
  width:4000px;
  height:4000px;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  transform-origin:0 0;
}

.mm-connectors{
  position:absolute;
  top:0;
  left:0;
  width:4000px;
  height:4000px;
  pointer-events:none;
  z-index:0;
}

.mm-node{
  position:absolute;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  min-width:120px;
  max-width:220px;
  padding:10px 14px;
  border:1px solid var(--rule);
  border-left:4px solid var(--node-color, var(--green));
  border-radius:var(--r-lg);
  background:var(--card);
  box-shadow:var(--shadow);
  color:var(--ink);
  font-size:.9rem;
  cursor:grab;
  transform:translate(-50%,-50%);
  user-select:none;
}
.mm-node:hover{ border-color:var(--rule-strong); border-left-color:var(--node-color, var(--green)); box-shadow:var(--shadow-lg); }
.mm-node:active{ cursor:grabbing; }
.mm-node-selected{
  border-color:var(--node-color, var(--green));
  box-shadow:0 0 0 2px var(--node-color, var(--green)), var(--shadow);
}

.mm-node-name{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:600;
}

.mm-node-badge{
  flex:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border:none;
  border-radius:999px;
  background:var(--green-soft);
  color:var(--green-deep);
  font:inherit;
  font-size:.72rem;
  font-weight:700;
  cursor:pointer;
}
.mm-node-badge:hover{ filter:brightness(1.03); }
.mm-node-badge-empty{
  background:var(--green-tint);
  color:var(--muted);
}

/* Injected client-side by mindmap.js — clustered edit/add-child/delete. */
.mm-node-controls{
  flex:none;
  display:flex;
  align-items:center;
  gap:4px;
}
.mm-node-delete{
  flex:none;
  display:none;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  padding:0;
  border:none;
  border-radius:999px;
  background:var(--rule-strong);
  color:var(--card);
  font-size:.85rem;
  line-height:1;
  cursor:pointer;
}
.mm-node:hover .mm-node-delete{ display:inline-flex; }
.mm-node-delete:hover{ background:var(--danger); }

.mm-node-edit{
  flex:none;
  display:none;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  padding:0;
  border:none;
  border-radius:999px;
  background:var(--rule-strong);
  color:var(--card);
  font-size:.78rem;
  line-height:1;
  cursor:pointer;
}
.mm-node:hover .mm-node-edit{ display:inline-flex; }
.mm-node-edit:hover{ background:var(--green); }

.mm-node-add-child{
  flex:none;
  display:none;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  padding:0;
  border:none;
  border-radius:999px;
  background:var(--rule-strong);
  color:var(--card);
  font-size:.78rem;
  line-height:1;
  cursor:pointer;
}
.mm-node:hover .mm-node-add-child{ display:inline-flex; }
.mm-node-add-child:hover{ background:var(--green); }

/* Node editor popover — appended to <body>, position:fixed from the node's
   live rect (mindmap.js), so canvas pan/zoom doesn't affect it. */
.mm-node-editor{
  position:fixed;
  z-index:40;
  width:240px;
  padding:14px;
  border:1px solid var(--rule-strong);
  border-radius:var(--r-lg);
  background:var(--card);
  box-shadow:var(--shadow-lg);
  display:flex;
  flex-direction:column;
  gap:10px;
}
.mm-node-editor-input{
  min-height:36px;
  padding:0 10px;
  border:1px solid var(--rule-strong);
  border-radius:var(--r-sm);
  background:var(--paper);
  color:var(--ink);
  font:inherit;
  font-size:.88rem;
}
.mm-node-editor-input:focus{ outline:none; border-color:var(--green); box-shadow:0 0 0 3px var(--green-soft); }
.mm-node-editor-swatches{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.mm-node-swatch{
  width:22px;
  height:22px;
  flex:none;
  border-radius:999px;
  border:2px solid transparent;
  background:var(--swatch-color, var(--rule));
  padding:0;
  cursor:pointer;
}
.mm-node-swatch-default{
  position:relative;
  background:var(--card);
  border:2px dashed var(--rule-strong);
}
.mm-node-swatch-default::after{
  content:'';
  position:absolute;
  left:50%;
  top:50%;
  width:140%;
  height:1px;
  background:var(--rule-strong);
  transform:translate(-50%,-50%) rotate(45deg);
}
.mm-node-swatch-selected{
  border-color:var(--ink);
  box-shadow:0 0 0 2px var(--card), 0 0 0 3px var(--ink);
}
.mm-node-editor-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
}
.mm-node-editor-cancel,
.mm-node-editor-save{
  min-height:32px;
  padding:0 12px;
  border-radius:var(--r-sm);
  font:inherit;
  font-size:.82rem;
  font-weight:600;
  cursor:pointer;
}
.mm-node-editor-cancel{
  border:1px solid var(--rule-strong);
  background:var(--card);
  color:var(--ink);
}
.mm-node-editor-cancel:hover{ background:var(--green-tint); }
.mm-node-editor-save{
  border:1px solid var(--accent);
  background:var(--accent);
  color:#fff;
}
.mm-node-editor-save:hover{ background:var(--accent-hover); border-color:var(--accent-hover); }
.mm-node-editor-save:disabled{ opacity:.55; cursor:default; }

.mm-empty-hint{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  margin:0;
  color:var(--muted);
  font-size:.92rem;
  white-space:nowrap;
}

@media (max-width:900px){
  .mm-viewport{ height:calc(100vh - 320px); min-height:360px; border-radius:var(--r-lg); }
}

/* ---------------------------------------------------------------------
   Mind map item panel — fixed side drawer, revealed by
   `.mm-item-panel-open` (toggled by mindmap.js after an HTMX swap).
   --------------------------------------------------------------------- */
.mm-item-panel{
  display:none;
  position:fixed;
  top:96px;
  right:24px;
  width:340px;
  max-width:calc(100vw - 32px);
  max-height:calc(100vh - 128px);
  overflow-y:auto;
  padding:18px;
  border:1px solid var(--rule-strong);
  border-radius:var(--r-xl);
  background:var(--card);
  box-shadow:var(--shadow-lg);
  z-index:30;
}
.mm-item-panel.mm-item-panel-open{ display:block; }

.mm-item-panel-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin:0 0 14px;
}
.mm-item-panel-title{
  font-weight:700;
  font-size:1rem;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.mm-item-panel-close{
  flex:none;
  width:26px;
  height:26px;
  border:none;
  border-radius:999px;
  background:var(--green-tint);
  color:var(--ink);
  font-size:1rem;
  line-height:1;
  cursor:pointer;
}
.mm-item-panel-close:hover{ background:var(--rule-strong); }

.mm-item-add-form{
  display:flex;
  gap:8px;
  margin:0 0 14px;
}
.mm-item-add-input{
  flex:1;
  min-width:0;
  min-height:38px;
  padding:0 12px;
  border:1px solid var(--rule-strong);
  border-radius:var(--r-md);
  background:var(--paper);
  color:var(--ink);
  font:inherit;
  font-size:.88rem;
}
.mm-item-add-input:focus{ outline:none; border-color:var(--green); box-shadow:0 0 0 3px var(--green-soft); }
.mm-item-add-submit{
  flex:none;
  min-height:38px;
  padding:0 14px;
  border:1px solid var(--accent);
  border-radius:var(--r-md);
  background:var(--accent);
  color:#fff;
  font:inherit;
  font-size:.88rem;
  font-weight:600;
  cursor:pointer;
}
.mm-item-add-submit:hover{ background:var(--accent-hover); border-color:var(--accent-hover); }

.mm-item-panel-list{ display:flex; flex-direction:column; gap:8px; }
.mm-item-panel-empty{
  margin:0;
  padding:8px 0;
  color:var(--muted);
  font-size:.88rem;
}

.mm-item-row{
  display:flex;
  align-items:center;
  gap:6px;
}
.mm-item-row .task-row{ flex:1; min-width:0; }
.mm-item-unlink-btn{
  flex:none;
  min-height:28px;
  padding:0 10px;
  border:1px solid var(--rule-strong);
  border-radius:var(--r-sm);
  background:var(--card);
  color:var(--muted);
  font:inherit;
  font-size:.76rem;
  font-weight:600;
  cursor:pointer;
}
.mm-item-unlink-btn:hover{ border-color:var(--danger); color:var(--danger); }

@media (max-width:640px){
  .mm-item-panel{ top:auto; bottom:16px; right:16px; left:16px; width:auto; max-width:none; }
}

/* ---------------------------------------------------------------------
   Board perspectives — horizontal columns; native HTML5 drag-drop moves
   cards. Column min-width keeps things readable on phone.
   --------------------------------------------------------------------- */
.board-columns{
  display:flex;
  gap:16px;
  align-items:flex-start;
  overflow-x:auto;
  padding-bottom:10px;
}

.board-column{
  flex:none;
  width:300px;
  min-width:300px;
  display:flex;
  flex-direction:column;
  border:1px solid var(--rule);
  border-radius:var(--r-xl);
  background:var(--card);
  box-shadow:var(--shadow-sm);
  transition:border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.board-column-dragover{
  border-color:var(--green);
  box-shadow:0 0 0 3px var(--green-soft);
}

.board-column-header{
  display:flex;
  align-items:center;
  gap:8px;
  padding:14px 16px;
  border-bottom:1px solid var(--rule);
}
.board-column-dot{
  flex:none;
  width:9px;
  height:9px;
  border-radius:999px;
}
.board-column-title{
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:700;
  font-size:.92rem;
  color:var(--ink);
}
.board-column-count{
  flex:none;
  min-width:22px;
  padding:0 6px;
  border-radius:999px;
  background:var(--green-tint);
  color:var(--muted);
  font-size:.74rem;
  font-weight:700;
  text-align:center;
  line-height:20px;
}

.board-column-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:10px;
  min-height:80px;
  max-height:calc(100vh - 320px);
  overflow-y:auto;
}
.board-column-empty{
  margin:0;
  padding:16px 4px;
  color:var(--faint);
  font-size:.84rem;
  text-align:center;
}

.board-card{
  cursor:grab;
}
.board-card:active{ cursor:grabbing; }
/* Board cards re-add a card surface (the base .task-row is flat). */
.board-card .task-row{
  margin:0;
  background:var(--paper);
  border:1px solid var(--rule);
  border-bottom:1px solid var(--rule);
  border-radius:var(--r-md);
  animation:none;
  transition:box-shadow .15s ease, border-color .15s ease;
}
.board-card .task-row:hover{ background:var(--paper); border-color:var(--rule-strong); box-shadow:var(--shadow-sm); }
.board-card-dragging{ opacity:.4; }

@media (prefers-reduced-motion:no-preference){
  .board-column{ transition:border-color .15s ease, background .15s ease, box-shadow .15s ease; }
}
@media (prefers-reduced-motion:reduce){
  .board-column{ transition:none; }
}

@media (max-width:900px){
  .board-column{ width:80vw; min-width:240px; }
  .board-column-list{ max-height:calc(100vh - 400px); }
}

/* ---------------------------------------------------------------------
   Timeline — vertical day time-blocks. `.timeline-block` height is set
   inline per-block (do NOT set height here); the left accent reads the
   `--block-color` custom property the page sets inline.
   --------------------------------------------------------------------- */
.timeline-date-switcher{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  margin:0 auto 20px;
  max-width:var(--content-w);
}

.timeline-nav-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border:1px solid var(--rule-strong);
  border-radius:var(--r-md);
  background:var(--card);
  color:var(--ink);
  text-decoration:none;
  font-size:1.05rem;
  line-height:1;
}
.timeline-nav-btn:hover{ background:var(--green-tint); border-color:var(--rule-strong); }

.timeline-date-label{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:200px;
  justify-content:center;
  font-family:var(--sans);
  font-weight:600;
  font-size:1.05rem;
  letter-spacing:-.01em;
  color:var(--ink);
}

.timeline-today-btn{
  min-height:28px;
  padding:0 10px;
  display:inline-flex;
  align-items:center;
  border:1px solid var(--rule-strong);
  border-radius:var(--r-sm);
  background:var(--card);
  color:var(--muted);
  text-decoration:none;
  font-size:.78rem;
  font-weight:600;
}
.timeline-today-btn:hover{ background:var(--green-tint); color:var(--ink); }

.timeline-toolbar{
  display:flex;
  justify-content:center;
  margin:0 auto 16px;
  max-width:var(--content-w);
}

.timeline{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-width:var(--content-w);
  margin:0 auto;
}

.timeline-empty-hint{
  margin:24px auto;
  max-width:var(--content-w);
  padding:28px 20px;
  border:1px dashed var(--rule-strong);
  border-radius:var(--r-lg);
  text-align:center;
  color:var(--muted);
  font-size:.92rem;
}

.timeline-block{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:2px;
  min-height:40px;
  padding:10px 34px 16px 16px;
  border:1px solid var(--rule);
  border-left:4px solid var(--block-color, var(--green));
  border-radius:var(--r-md);
  background:var(--card);
  box-shadow:var(--shadow-sm);
  overflow:visible;
  cursor:grab;
  touch-action:none;
  user-select:none;
}
.timeline-block:hover{ box-shadow:var(--shadow); border-color:var(--rule-strong); }
.timeline-block:active{ cursor:grabbing; }

.timeline-block-dragging{
  position:relative;
  z-index:5;
  box-shadow:var(--shadow-lg);
  cursor:grabbing;
}

.timeline-block-time{
  color:var(--muted);
  font-size:.76rem;
  font-weight:600;
  letter-spacing:.01em;
}

.timeline-block-title{
  color:var(--ink);
  font-size:.94rem;
  font-weight:600;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.timeline-block-project{
  color:var(--faint);
  font-size:.76rem;
}

.timeline-block-delete{
  position:absolute;
  top:6px;
  right:6px;
  display:flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  padding:0;
  border:none;
  border-radius:999px;
  background:var(--rule-strong);
  color:var(--card);
  font-size:.85rem;
  line-height:1;
  cursor:pointer;
  opacity:0;
  transition:opacity .15s ease, background .15s ease;
}
.timeline-block:hover .timeline-block-delete,
.timeline-block:focus-within .timeline-block-delete{ opacity:1; }
.timeline-block-delete:hover{ background:var(--danger); }

.timeline-block-resize{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:8px;
  cursor:ns-resize;
  touch-action:none;
}
.timeline-block-resize::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:2px;
  width:32px;
  height:3px;
  border-radius:999px;
  background:var(--rule-strong);
  transform:translateX(-50%);
  opacity:0;
  transition:opacity .15s ease;
}
.timeline-block:hover .timeline-block-resize::after{ opacity:1; }

@media (prefers-reduced-motion:no-preference){
  .timeline-block{ transition:box-shadow .15s ease, border-color .15s ease; }
}
@media (prefers-reduced-motion:reduce){
  .timeline-block{ transition:none; }
}

@media (max-width:900px){
  .timeline-date-label{ min-width:0; }
}

/* ---------------------------------------------------------------------
   Plan my day (Task AT3) — fixed preview drawer, same "empty ⇒ hidden"
   trick as `.mm-item-panel`'s open/close but simpler: no state class to
   toggle, the panel is just empty (no display) until `timeline.js` fills
   it with `WebPlanController.previewPlan`'s fragment, and empty again
   after Cancel/Confirm.
   --------------------------------------------------------------------- */
.plan-panel:empty{ display:none; }
.plan-panel{
  position:fixed;
  top:96px;
  right:24px;
  width:360px;
  max-width:calc(100vw - 32px);
  max-height:calc(100vh - 128px);
  overflow-y:auto;
  z-index:30;
}

.plan-preview{
  padding:18px;
  border:1px solid var(--rule-strong);
  border-radius:var(--r-xl);
  background:var(--card);
  box-shadow:var(--shadow-lg);
}

.plan-preview-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin:0 0 14px;
}
.plan-preview-title{ font-weight:700; font-size:1rem; color:var(--ink); }
.plan-preview-close{
  flex:none;
  width:26px;
  height:26px;
  border:none;
  border-radius:999px;
  background:var(--green-tint);
  color:var(--ink);
  font-size:1rem;
  line-height:1;
  cursor:pointer;
}
.plan-preview-close:hover{ background:var(--rule-strong); }

.plan-preview-empty{
  margin:0;
  padding:8px 0;
  color:var(--muted);
  font-size:.88rem;
  line-height:1.5;
}

.plan-preview-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin:0 0 14px;
  max-height:50vh;
  overflow-y:auto;
}
.plan-preview-row{
  display:flex;
  align-items:baseline;
  gap:10px;
  padding:8px 10px;
  border:1px solid var(--rule);
  border-radius:var(--r-md);
  background:var(--paper);
}
.plan-preview-row-time{
  flex:none;
  color:var(--muted);
  font-size:.76rem;
  font-weight:600;
  white-space:nowrap;
}
.plan-preview-row-title{
  color:var(--ink);
  font-size:.88rem;
  font-weight:600;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Pauza vložená schedulerem (buffer/focus break, issue #35) — decentní,
   nemá se s task rows plést: žádný čas, žádný přepínatelný stav, jen tenká
   oddělovací mezera s tlumeným popiskem. */
.plan-preview-break{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:2px 0;
  color:var(--muted);
  font-size:.7rem;
  font-style:italic;
  opacity:.7;
}

.plan-preview-unscheduled{
  margin:0 0 14px;
  padding:8px 10px;
  border-radius:var(--r-md);
  background:var(--paper);
  color:var(--muted);
  font-size:.8rem;
  line-height:1.4;
}

.plan-preview-actions{ display:flex; gap:8px; }
.plan-preview-actions .mm-toolbar-btn{ flex:1; text-align:center; }

@media (max-width:640px){
  .plan-panel{ top:auto; bottom:16px; right:16px; left:16px; width:auto; max-width:none; }
}

/* Respect reduced-motion globally for the entrance animations. */
@media (prefers-reduced-motion:reduce){
  .task-row, .web-content > *, .task-row-done .task-checkbox{ animation:none !important; }
}
