/* ==========================================================================
   PrepTrack Design System v2
   Ink + Indigo with a teal signal colour. Dark & light themes, mobile-first.
   ========================================================================== */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0b12;
  --surface: #0e1019;
  --card: #131622;
  --card-2: #191d2d;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #eceef8;
  --muted: #8b92ad;
  --primary: #7b6dff;
  --primary-2: #9a5cff;
  --primary-soft: rgba(123, 109, 255, 0.15);
  --primary-ink: #b8b1ff;
  --accent: #34d3c1;
  --accent-soft: rgba(52, 211, 193, 0.14);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --glass: rgba(14, 16, 25, 0.84);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 20px 50px rgba(0, 0, 0, 0.55);
  --ring-glow: 0 0 0 4px rgba(123, 109, 255, 0.25);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4fa;
  --surface: #ffffff;
  --card: #ffffff;
  --card-2: #f6f7fc;
  --line: #e7e9f2;
  --line-strong: #d5d9e8;
  --text: #14172b;
  --muted: #5d647f;
  --primary: #5a49f2;
  --primary-2: #7a3df0;
  --primary-soft: rgba(90, 73, 242, 0.09);
  --primary-ink: #4a3ad6;
  --accent: #0e9f8e;
  --accent-soft: rgba(14, 159, 142, 0.11);
  --success: #0f9f6e;
  --success-soft: rgba(15, 159, 110, 0.11);
  --warning: #b45309;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.09);
  --glass: rgba(255, 255, 255, 0.88);
  --shadow: 0 1px 2px rgba(20, 23, 43, 0.04), 0 10px 28px rgba(20, 23, 43, 0.06);
  --shadow-pop: 0 20px 50px rgba(20, 23, 43, 0.16);
  --ring-glow: 0 0 0 4px rgba(90, 73, 242, 0.18);
}

/* Legacy aliases so any inline styles keep working */
:root {
  --bg-main: var(--bg);
  --bg-subtle: var(--card-2);
  --bg-card: var(--card);
  --bg-card-hover: var(--card-2);
  --bg-glass: var(--glass);
  --text-main: var(--text);
  --text-muted: var(--muted);
  --border-color: var(--line);
  --primary-glow: var(--primary-soft);
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; }
code { font-size: 0.85em; background: var(--card-2); border: 1px solid var(--line); padding: 0.1em 0.4em; border-radius: 6px; }
.hidden { display: none !important; }
.text-center { text-align: center; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
.narrow-container { max-width: 760px; }

/* Icons */
.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
[data-theme="dark"] .icon-moon, [data-theme="light"] .icon-sun { display: none; }
.icon-btn .i { width: 18px; height: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 42px; padding: 0.6rem 1.1rem;
  font-weight: 600; font-size: 0.9rem; line-height: 1;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform 0.18s var(--ease), background-color 0.18s, border-color 0.18s, box-shadow 0.18s, color 0.18s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-lg { min-height: 52px; padding: 0.85rem 1.6rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-sm { min-height: 36px; padding: 0.45rem 0.85rem; font-size: 0.8rem; border-radius: 10px; }
.btn .i { width: 1.1em; height: 1.1em; }

.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 6px 18px -4px var(--primary); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -6px var(--primary); }
.btn-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn-accent:hover { background: var(--accent); color: #04211d; }
.btn-outline { background: var(--card); border-color: var(--line-strong); color: var(--text); }
.btn-outline:hover { background: var(--card-2); border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--card-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.full-width { width: 100%; }

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  transition: all 0.18s var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--card-2); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.danger-hover:hover { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
#appThemeToggleBtn:hover .i, #themeToggleBtn:hover .i { transform: rotate(18deg); }
.icon-btn .i { transition: transform 0.3s var(--ease); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 0.95rem; }
.form-group label, label.field-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 0.4rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 46px; padding: 0.65rem 0.9rem;
  font-family: inherit; font-size: 16px;
  color: var(--text); background: var(--card-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color 0.18s, box-shadow 0.18s, background-color 0.18s;
  appearance: none; -webkit-appearance: none;
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b92ad' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.85rem center; padding-right: 2.4rem;
}
select:disabled { opacity: 0.5; cursor: not-allowed; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring-glow); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.7; }
input[type="file"] { font-size: 0.85rem; color: var(--muted); width: 100%; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 18px; height: 18px; }
.code-textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; min-height: 140px; }
.form-error { color: var(--danger); font-size: 0.85rem; margin-bottom: 0.85rem; padding: 0.6rem 0.8rem; background: var(--danger-soft); border-radius: var(--radius-xs); }

/* ---------- Layout primitives ---------- */
.grid-2, .grid-3, .grid-4, .pricing-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .pricing-grid { grid-template-columns: repeat(5, 1fr); }
}
.form-row { display: grid; grid-template-columns: 1fr; gap: 0 0.85rem; }
@media (min-width: 440px) { .form-row { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 1.1rem; box-shadow: var(--shadow); min-width: 0;
}
@media (min-width: 768px) { .card { padding: 1.4rem; } }
.card h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.card p { color: var(--muted); font-size: 0.9rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.card-head .sub { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }
.eyebrow { display: block; font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-bottom: 0.25rem; }

.pill-badge, .weight-pill, .subcount-pill, .rev-pill, .sync-badge, .badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem; font-weight: 700; padding: 0.22rem 0.6rem; border-radius: 99px;
  background: var(--card-2); color: var(--muted); white-space: nowrap; line-height: 1.2;
}
.pill-badge { background: var(--primary-soft); color: var(--primary-ink); }
.pill-badge .i, .sync-badge .i, .rev-pill .i { width: 12px; height: 12px; }
.sync-badge.revise, .rev-pill.has-rev { background: var(--accent-soft); color: var(--accent); }
.sync-badge.complete { background: var(--primary-soft); color: var(--primary-ink); }
.sync-badge.custom { background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }

/* ---------- Brand ---------- */
.brand-logo { display: inline-flex; align-items: center; gap: 0.65rem; font-weight: 800; font-size: 1.18rem; letter-spacing: -0.02em; }
.brand-mark, .mobile-brand-mark {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-2) 60%, var(--accent));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -6px var(--primary);
}
.brand-mark:has(.brand-logo-img),
.mobile-brand-mark:has(.brand-logo-img) {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-mark .i, .mobile-brand-mark .i { width: 19px; height: 19px; stroke-width: 2.3; }

/* ==========================================================================
   Landing page
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--glass); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--line); }
.header-inner { height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.header-nav { display: none; gap: 0.25rem; font-size: 0.92rem; font-weight: 600; color: var(--muted); }
.header-nav a { padding: 0.45rem 0.8rem; border-radius: 10px; transition: all 0.18s; }
.header-nav a:hover { color: var(--text); background: var(--card-2); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.header-actions .btn-ghost, .header-actions .btn-primary .long { display: none; }
@media (min-width: 640px) { .header-actions .btn-ghost { display: inline-flex; } .header-actions .btn-primary .long { display: inline; } .header-actions .btn-primary .short { display: none; } }
@media (min-width: 900px) { .header-nav { display: flex; } }

.hero-section { position: relative; padding: 3.5rem 0 3.5rem; overflow: hidden; isolation: isolate; }
.hero-section::before {
  content: ''; position: absolute; inset: -20% -10% auto; height: 80%; z-index: -1;
  background:
    radial-gradient(40% 50% at 20% 20%, var(--primary-soft), transparent 70%),
    radial-gradient(35% 45% at 85% 10%, var(--accent-soft), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 2.75rem; align-items: center; }
@media (min-width: 960px) { .hero-section { padding: 5.5rem 0 5rem; } .hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: 3.5rem; } }
.hero-copy .pill-badge { margin-bottom: 1.2rem; padding: 0.35rem 0.85rem; font-size: 0.78rem; }
.hero-copy h1 { font-size: clamp(2.15rem, 6vw, 3.7rem); line-height: 1.07; font-weight: 800; letter-spacing: -0.035em; margin-bottom: 1.15rem; }
.text-gradient { background: linear-gradient(120deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.hero-sub { font-size: 1.05rem; color: var(--muted); margin-bottom: 1.8rem; max-width: 560px; }
.hero-cta-group { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
.hero-cta-group .btn { width: 100%; }
@media (min-width: 480px) { .hero-cta-group .btn { width: auto; } }
.hero-note { font-size: 0.84rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.4rem; }
.hero-note .i { color: var(--success); width: 15px; height: 15px; }

.preview-dashboard { position: relative; padding: 1.25rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); }
.preview-dashboard::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(140deg, var(--primary), transparent 40%, var(--accent)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.55; pointer-events: none; }
.glass-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.4rem; }
.preview-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 1.2rem; }
.preview-header h4 { font-size: 1.02rem; margin-top: 0.25rem; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.live-pill { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.78rem; font-weight: 700; padding: 0.3rem 0.7rem; border-radius: 99px; background: var(--success-soft); color: var(--success); white-space: nowrap; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; position: relative; }
.pulse-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { to { transform: scale(3.2); opacity: 0; } }
.preview-rings { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.2rem; }
@media (max-width: 420px) { .preview-rings { grid-template-columns: 1fr; } }
.preview-bars .bar-row { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; margin: 0.8rem 0 0.4rem; color: var(--muted); }
.preview-bars .bar-row strong { color: var(--text); }

/* Rings & progress */
.mini-ring-card { display: flex; align-items: center; gap: 0.9rem; padding: 0.95rem; background: var(--card-2); border-radius: var(--radius-md); }
.card.mini-ring-card { background: var(--card); padding: 1.1rem; }
.circular-chart { width: 58px; height: 58px; flex-shrink: 0; }
.circle-bg { fill: none; stroke: var(--line-strong); stroke-width: 3.4; }
.circle { fill: none; stroke: var(--primary); stroke-width: 3.4; stroke-linecap: round; transition: stroke-dasharray 0.6s var(--ease); }
.accent-teal .circle { stroke: var(--accent); }
.ring-meta strong { display: block; font-size: 1.35rem; line-height: 1.1; letter-spacing: -0.02em; }
.ring-meta span { font-size: 0.78rem; color: var(--muted); display: block; margin-top: 0.15rem; }
.progress-track, .mini-progress-bar { height: 7px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.progress-fill, .mini-progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.5s var(--ease); }

/* Sections */
/* [PERFORMANCE FIX P1 - web.dev Rendering Performance & MDN content-visibility]
   Skip layout & paint for below-the-fold landing sections until scrolled into view. */
.section {
  padding: 3.75rem 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 520px;
}
@media (min-width: 768px) { .section { padding: 5.5rem 0; } }
.bg-subtle { background: var(--surface); border-block: 1px solid var(--line); }
.section-header { text-align: center; max-width: 660px; margin: 0 auto 2.5rem; }
.section-header h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -0.03em; margin-bottom: 0.7rem; }
.section-header p { color: var(--muted); }

.feature-icon, .stat-icon {
  width: 44px; height: 44px; border-radius: 13px; margin-bottom: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary-ink);
}
.feature-icon .i { width: 22px; height: 22px; }
.feature-icon.t-accent { background: var(--accent-soft); color: var(--accent); }
.feature-icon.t-warn { background: var(--warning-soft); color: var(--warning); }
.feature-icon.t-ok { background: var(--success-soft); color: var(--success); }
.feature-card, .problem-card { transition: transform 0.25s var(--ease), border-color 0.25s; }
.feature-card:hover, .problem-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.feature-card h3 { font-size: 1.12rem; }

.step-badge { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; font-size: 0.85rem; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; margin-bottom: 0.9rem; }

.percentile-explainer { padding: 1.5rem; }
@media (min-width: 768px) { .percentile-explainer { padding: 2.5rem; } }
.explainer-copy h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin-bottom: 0.7rem; }
.weight-bars { display: grid; gap: 0.9rem; margin: 1.5rem 0; }
.weight-row { display: grid; grid-template-columns: 3.1rem 1fr; gap: 0.2rem 0.9rem; align-items: center; }
.weight-row strong { font-size: 1.3rem; color: var(--primary-ink); grid-row: span 2; letter-spacing: -0.02em; }
.weight-row b { font-size: 0.95rem; }
.weight-row span { font-size: 0.85rem; color: var(--muted); grid-column: 2; }
.honesty-box { display: flex; gap: 0.75rem; padding: 1rem; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text); font-size: 0.88rem; }
.honesty-box .i { color: var(--accent); margin-top: 0.1rem; }
.honesty-box p { color: var(--text); font-size: 0.88rem; }

.price-card { display: flex; flex-direction: column; justify-content: space-between; position: relative; text-align: center; transition: transform 0.25s var(--ease); }
.price-card:hover { transform: translateY(-3px); }
.price-card.popular { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow-pop); }
@media (min-width: 1080px) { .price-card.popular { transform: translateY(-8px); } .price-card.popular:hover { transform: translateY(-11px); } }
.popular-ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 0.25rem 0.8rem; border-radius: 99px; white-space: nowrap; }
.price-tag { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; margin: 0.7rem 0 0.2rem; }
.price-tag span { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.price-sub { margin-bottom: 1.3rem; font-size: 0.82rem; }
.coupon-callout { display: flex; gap: 0.75rem; align-items: center; justify-content: center; margin-top: 2rem; padding: 1rem 1.25rem; border-radius: var(--radius-md); background: var(--card); border: 1px dashed var(--accent); font-size: 0.92rem; text-align: left; }
.coupon-callout .i { color: var(--accent); width: 22px; height: 22px; }

.quote-card p { font-size: 0.95rem; color: var(--text); line-height: 1.65; }
.quote-author { margin-top: 1.1rem; font-size: 0.85rem; color: var(--muted); display: flex; align-items: center; gap: 0.7rem; }
.quote-author .avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.8rem; flex-shrink: 0; }
.quote-author strong { color: var(--text); display: block; }

.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item { padding: 0; }
.faq-item summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; font-weight: 700; font-size: 0.95rem; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .i { color: var(--muted); transition: transform 0.25s var(--ease); }
.faq-item[open] summary .i { transform: rotate(180deg); }
.faq-item p { padding: 0 1.25rem 1.2rem; }

.cta-banner .cta-box { padding: 2.5rem 1.5rem; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: var(--shadow-pop); }
.cta-banner h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin-bottom: 0.7rem; }
.cta-banner p { color: rgba(255, 255, 255, 0.82); margin-bottom: 1.5rem; }
.cta-banner .btn-primary { background: #fff; color: #3b2fc9; box-shadow: none; }

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; font-size: 0.88rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.footer-brand { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.footer-brand strong { color: var(--text); }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a:hover { color: var(--text); }

/* ---------- Modal / auth ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(5, 6, 12, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn 0.2s ease; }
@media (min-width: 560px) { .modal-backdrop { align-items: center; padding: 1rem; } }
.modal-card { width: 100%; max-width: 440px; max-height: 94dvh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 1.35rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow-pop); animation: sheetUp 0.35s var(--ease); }
@media (min-width: 560px) { .modal-card { border-radius: var(--radius-lg); padding: 1.6rem; animation-name: popIn; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.modal-header h3 { font-size: 1.15rem; }
.auth-tabs, .segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.25rem; background: var(--card-2); padding: 0.25rem; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.auth-tabs { margin-bottom: 1.2rem; }
.auth-tab, .seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 38px; padding: 0.4rem 0.8rem; border: none; background: transparent; color: var(--muted); font-weight: 600; font-size: 0.85rem; border-radius: 9px; cursor: pointer; transition: all 0.2s var(--ease); white-space: nowrap; }
.auth-tab.active, .seg-btn.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.seg-btn.active .i { color: var(--primary); }
.divider { display: flex; align-items: center; gap: 0.8rem; margin: 1.1rem 0; font-size: 0.8rem; color: var(--muted); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.dev-auth-box { margin-top: 1.1rem; padding: 0.9rem; border-radius: var(--radius-sm); background: var(--warning-soft); font-size: 0.8rem; }
.dev-auth-title { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--warning); margin-bottom: 0.25rem; }
.dev-auth-box p { margin-bottom: 0.65rem; color: var(--muted); font-size: 0.8rem; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; width: 100%; }
.app-sidebar { width: 264px; background: var(--surface); border-right: 1px solid var(--line); display: none; flex-direction: column; justify-content: space-between; padding: 1.25rem 0.9rem; position: sticky; top: 0; height: 100vh; height: 100dvh; flex-shrink: 0; }
@media (min-width: 900px) { .app-sidebar { display: flex; } }
.sidebar-top { padding: 0 0.4rem; }
.exam-pill { margin-top: 1rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); background: var(--card-2); border: 1px solid var(--line); font-size: 0.8rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.5rem; }
.exam-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); flex-shrink: 0; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.2rem; margin: 1.4rem 0 auto; }
.nav-item { position: relative; display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0.85rem; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; font-size: 0.91rem; transition: color 0.18s, background-color 0.18s; }
.nav-item .nav-icon .i { width: 19px; height: 19px; }
.nav-item:hover { color: var(--text); background: var(--card-2); }
.nav-item.active { color: var(--text); background: var(--primary-soft); }
.nav-item.active .nav-icon { color: var(--primary); }
.nav-item.active::before { content: ''; position: absolute; left: -0.9rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(var(--primary), var(--accent)); }

.trial-status-card { padding: 0.85rem; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft)); border: 1px solid var(--line); margin-bottom: 0.9rem; }
.trial-title { font-size: 0.82rem; font-weight: 700; }
.trial-sub { font-size: 0.76rem; color: var(--muted); }
.user-row { display: flex; align-items: center; gap: 0.65rem; padding: 0.9rem 0.4rem 0; border-top: 1px solid var(--line); }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9rem; flex-shrink: 0; }
.user-info { flex: 1; overflow: hidden; }
.user-info strong, .user-info span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info strong { font-size: 0.85rem; }
.user-info span { font-size: 0.74rem; color: var(--muted); }

.app-main { flex: 1; min-width: 0; width: 100%; display: flex; flex-direction: column; padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) { .app-main { padding-bottom: 2.5rem; } }

.app-topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 0.65rem; min-height: 60px; padding: calc(0.45rem + env(safe-area-inset-top, 0px)) 0.95rem 0.45rem; background: var(--glass); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .app-topbar { min-height: 68px; padding: 0 1.75rem; } }
.topbar-left { display: flex; align-items: center; gap: 0.65rem; min-width: 0; flex: 1; }
.topbar-title-group { min-width: 0; flex: 1; }
.page-title { font-size: 1.05rem; font-weight: 800; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-exam-sub { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 900px) { .mobile-brand-mark, .mobile-exam-sub, .mobile-logout-btn { display: none !important; } .page-title { font-size: 1.3rem; } }
.topbar-right { display: flex; align-items: center; gap: 0.45rem; flex-shrink: 0; }
.target-badge { font-size: 0.75rem; font-weight: 700; padding: 0.34rem 0.7rem; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); white-space: nowrap; }
@media (max-width: 520px) { .target-badge { display: none; } }

.announcement-banner { display: flex; align-items: center; justify-content: center; gap: 0.5rem; background: var(--primary-soft); color: var(--primary-ink); border-bottom: 1px solid var(--line); padding: 0.6rem 1rem; font-size: 0.84rem; font-weight: 600; text-align: center; }
.announcement-banner.hidden { display: none; }

.route-container { padding: 0.9rem; max-width: 1180px; width: 100%; margin: 0 auto; }
@media (min-width: 768px) { .route-container { padding: 1.75rem; } }
/* Animate inner content with `backwards` instead of `both` on .route-stage so no transform lingers to trap position:fixed FABs & modals */
.route-container.enter > .route-stage { animation: fadeIn 0.22s ease backwards; }
.route-container.enter > .route-stage > :not(.fab):not(.task-modal-backdrop):not(.todo-composer):not(.today-composer-backdrop):not(.today-focus-shield):not(.pt-modal-backdrop):not(.modal-backdrop) {
  animation: riseIn 0.4s var(--ease) backwards;
}
.route-container.enter > .route-stage > :nth-child(2):not(.fab):not(.task-modal-backdrop):not(.todo-composer):not(.today-composer-backdrop):not(.today-focus-shield) { animation-delay: 0.04s; }
.route-container.enter > .route-stage > :nth-child(3):not(.fab):not(.task-modal-backdrop):not(.todo-composer):not(.today-composer-backdrop):not(.today-focus-shield) { animation-delay: 0.08s; }

/* Mobile bottom nav */
.mobile-bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(6, 1fr); padding: 0.35rem 0.2rem calc(0.35rem + env(safe-area-inset-bottom, 0px)); background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid var(--line); }
@media (min-width: 900px) { .mobile-bottom-nav { display: none; } }
.mob-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; min-height: 50px; color: var(--muted); font-size: 0.64rem; font-weight: 700; letter-spacing: 0; transition: color 0.2s; user-select: none; }
.mob-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 28px; border-radius: 99px; transition: background-color 0.25s var(--ease), transform 0.25s var(--ease); }
.mob-icon .i { width: 20px; height: 20px; }
.mob-nav-item.active { color: var(--text); }
.mob-nav-item.active .mob-icon { background: var(--primary-soft); color: var(--primary); transform: translateY(-1px); }
.mob-nav-item:active .mob-icon { transform: scale(0.9); }

/* Toasts */
.toast-container { position: fixed; z-index: 220; left: 1rem; right: 1rem; bottom: calc(148px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 0.5rem; pointer-events: none; }
@media (min-width: 900px) { .toast-container { left: auto; right: 1.5rem; bottom: 1.5rem; align-items: flex-end; } }
.toast { display: flex; align-items: center; gap: 0.6rem; max-width: 380px; background: var(--card-2); border: 1px solid var(--line-strong); color: var(--text); padding: 0.75rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); font-size: 0.86rem; font-weight: 600; pointer-events: auto; animation: toastIn 0.35s var(--ease); }
.toast .i { width: 18px; height: 18px; }
.toast.success .i { color: var(--success); }
.toast.error .i { color: var(--danger); }
.toast.info .i { color: var(--primary); }
.toast.leaving { animation: toastOut 0.25s ease forwards; }

/* Skeleton */
.skeleton-loader { display: grid; gap: 1rem; }
.skel { border-radius: var(--radius-md); background: linear-gradient(100deg, var(--card) 30%, var(--card-2) 50%, var(--card) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border: 1px solid var(--line); }
.skel-row { height: 78px; }
.skel-block { height: 220px; }

/* Empty states */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.4rem; padding: 1.6rem 0.9rem; color: var(--muted); }
.empty-state .empty-icon { width: 50px; height: 50px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; background: var(--card-2); color: var(--muted); margin-bottom: 0.35rem; }
.empty-state .empty-icon .i { width: 23px; height: 23px; }
.empty-state.ok .empty-icon { background: var(--success-soft); color: var(--success); }
.empty-state strong { color: var(--text); font-size: 0.96rem; }
.empty-state p { max-width: 360px; font-size: 0.85rem; }

/* ==========================================================================
   Onboarding
   ========================================================================== */
.onboarding-wrapper { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 1.1rem; background: radial-gradient(50% 40% at 50% 0%, var(--primary-soft), transparent 70%), var(--bg); }
.onboarding-card { width: 100%; max-width: 520px; padding: 1.4rem; animation: riseIn 0.5s var(--ease); }
@media (min-width: 560px) { .onboarding-card { padding: 2rem; } }
.onboarding-card h2 { font-size: 1.5rem; margin: 0.9rem 0 0.4rem; }
.exam-selector-grid { display: grid; gap: 0.6rem; }
.exam-radio-card { display: flex; align-items: center; gap: 0.85rem; padding: 0.95rem 1rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--card-2); cursor: pointer; transition: all 0.2s var(--ease); }
.exam-radio-card:hover { border-color: var(--line-strong); }
.exam-radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.exam-radio-card strong { font-size: 0.95rem; }
.exam-radio-card small { display: block; color: var(--muted); font-size: 0.78rem; }

/* ==========================================================================
   Daily Action Center (Today Page) & Task Card Styling
   ========================================================================== */
.todo-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (min-width: 1000px) {
  .todo-page { grid-template-columns: minmax(0, 1.58fr) minmax(0, 1fr); gap: 1.25rem; }
  .todo-page .span-all { grid-column: 1 / -1; }
  .todo-composer { position: sticky; top: 88px; }
}
#todoListsTopWrapper { display: contents; }

.day-hero { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.15rem; border-radius: var(--radius-lg); border: 1px solid var(--line); background: radial-gradient(60% 120% at 100% 0%, var(--primary-soft), transparent 60%), radial-gradient(40% 100% at 0% 100%, var(--accent-soft), transparent 70%), var(--card); box-shadow: var(--shadow); }
@media (min-width: 640px) { .day-hero { flex-direction: row; align-items: center; justify-content: space-between; padding: 1.45rem 1.7rem; } }
.day-hero h2 { font-size: clamp(1.3rem, 3.5vw, 1.75rem); letter-spacing: -0.03em; }
.day-hero p { color: var(--muted); font-size: 0.88rem; margin-top: 0.2rem; }
.day-progress { width: 100%; max-width: 340px; }
.day-progress-top { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 700; margin-bottom: 0.45rem; color: var(--muted); }
.day-progress-top strong { color: var(--text); }
.day-progress .progress-track { height: 9px; background: var(--line); }

.quick-Command-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
@media (min-width: 768px) { .quick-Command-strip { grid-template-columns: repeat(4, 1fr); gap: 1rem; } }
.stat-pill-card { position: relative; display: flex; flex-direction: column; gap: 0.6rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0.9rem; box-shadow: var(--shadow); transition: transform 0.22s var(--ease), border-color 0.22s; min-width: 0; }
a.stat-pill-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
a.stat-pill-card:active { transform: scale(0.98); }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; margin: 0; }
.stat-icon .i { width: 18px; height: 18px; }
.stat-icon.t-accent { background: var(--accent-soft); color: var(--accent); }
.stat-icon.t-warn { background: var(--warning-soft); color: var(--warning); }
.stat-icon.t-ok { background: var(--success-soft); color: var(--success); }
.stat-pill-meta span { display: block; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.stat-pill-meta strong { display: block; font-size: 1.32rem; font-weight: 800; letter-spacing: -0.03em; margin-top: 0.1rem; line-height: 1.2; }
.stat-pill-meta small { font-size: 0.72rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.stat-link-arrow { position: absolute; top: 0.85rem; right: 0.85rem; color: var(--muted); opacity: 0; transform: translateX(-4px); transition: all 0.2s var(--ease); }
.stat-link-arrow .i { width: 16px; height: 16px; }
a.stat-pill-card:hover .stat-link-arrow { opacity: 1; transform: none; }

.todo-lists { display: grid; gap: 1rem; min-width: 0; }
.todo-list, .due-list { display: flex; flex-direction: column; gap: 0.55rem; }
.todo-subsection-divider { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 1.15rem 0 0.6rem; padding-top: 0.95rem; border-top: 1px solid var(--line); font-size: 0.78rem; font-weight: 700; color: var(--muted); }

/* Crisp, natural task card */
.todo-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.82rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid transparent;
  position: relative;
  touch-action: pan-y;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.25s ease, transform 0.22s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.22s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.todo-row:hover { border-color: var(--line-strong); }
.todo-row.todo-done { opacity: 0.6; }
.todo-row.is-armed { transform: scale(0.985); background: var(--card); }

.todo-row.is-lifted {
  z-index: 50 !important;
  opacity: 0.96;
  background: var(--card) !important;
  border-color: var(--line-strong) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35) !important;
  transform: translate3d(0, var(--lift-y, 0px), 0);
  transition: none !important;
  touch-action: none;
}

.todo-row.is-settling {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
  transform: translate3d(0, var(--lift-y, 0px), 0) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  border-color: var(--line) !important;
  z-index: 40 !important;
}

.todo-main { flex: 1; min-width: 0; }
.todo-title-line { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 0.25rem; }
.todo-title-line strong { font-size: 0.92rem; line-height: 1.38; word-break: break-word; font-weight: 600; }
.todo-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.75rem; font-size: 0.77rem; color: var(--muted); }
.todo-meta .due-late { color: var(--warning); font-weight: 700; }
.prio { display: inline-flex; align-items: center; gap: 0.35rem; }
.prio::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.prio-1::before { background: var(--danger); }
.prio-2::before { background: var(--warning); }
.prio-3::before { background: var(--success); }
.todo-delete-btn { width: 34px; height: 34px; border-radius: 9px; border: none; background: transparent; opacity: 0.65; flex-shrink: 0; }
.todo-delete-btn .i { width: 16px; height: 16px; }
.todo-row:hover .todo-delete-btn { opacity: 1; }
@media (hover: none) { .todo-delete-btn { opacity: 0.88; } }

/* Checkbox shared by todos + syllabus tree */
.tree-checkbox { position: relative; width: 24px; height: 24px; flex-shrink: 0; border-radius: 8px; border: 2px solid var(--line-strong); background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color 0.2s, border-color 0.2s, transform 0.15s; padding: 0; }
.tree-checkbox::before { content: ''; position: absolute; inset: -9px; }
.tree-checkbox:hover { border-color: var(--primary); }
.tree-checkbox .i { width: 14px; height: 14px; stroke-width: 3; }
.tree-checkbox.done { background: var(--success); border-color: var(--success); }
.tree-checkbox.partial { background: var(--primary); border-color: var(--primary); }
.tree-checkbox.pop { animation: pop 0.28s var(--ease); }
.todo-row .tree-checkbox { margin-top: 0.1rem; }
.done-text { text-decoration: line-through; text-decoration-color: var(--muted); color: var(--muted); }

.task-tabs { margin-bottom: 1.05rem; }
.composer-pane.hidden { display: none; }
.composer-pane { animation: fadeIn 0.25s ease; }
.composer-pane .composer-hint { margin-bottom: 0.95rem; font-size: 0.83rem; }

/* Desktop vs Mobile Add-Task Composer Behaviour */
.composer-close-btn { display: none; }
.task-modal-backdrop { display: none; }

@media (max-width: 999px) {
  .todo-composer {
    display: none;
  }
  .todo-composer.mobile-open {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    max-height: 90dvh;
    overflow-y: auto;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.25rem 1.15rem calc(1.35rem + env(safe-area-inset-bottom, 0px));
    box-shadow: var(--shadow-pop);
    animation: sheetUp 0.3s var(--ease);
    margin: 0;
  }
  .composer-close-btn {
    display: inline-flex;
  }
  .task-modal-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(5, 6, 12, 0.72);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease;
  }
}

/* ==========================================================================
   Syllabus tree & revisions
   ========================================================================= */
.syllabus-toolbar { display: flex; flex-direction: column; gap: 0.7rem; padding: 0.75rem; margin-bottom: 1rem; }
@media (min-width: 720px) { .syllabus-toolbar { flex-direction: row; align-items: center; justify-content: space-between; padding: 0.75rem 0.9rem; } }
.search-wrap { position: relative; flex: 1; max-width: 100%; }
@media (min-width: 720px) { .search-wrap { max-width: 320px; } }
.search-wrap .i { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; pointer-events: none; }
.search-input { padding-left: 2.6rem !important; }
.subtab-group { min-width: 0; }

.tree-container { display: flex; flex-direction: column; gap: 0.75rem; }
.tree-node.level-1 { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0.5rem 0.75rem; box-shadow: var(--shadow); }
@media (min-width: 640px) { .tree-node.level-1 { padding: 0.55rem 0.9rem; } }
.tree-node.level-1 > .tree-node-row .tree-title { font-weight: 800; font-size: 0.95rem; }
.tree-children { margin: 0.2rem 0 0.45rem 0.55rem; padding-left: 0.55rem; border-left: 1.5px solid var(--line); display: flex; flex-direction: column; gap: 0.12rem; }
@media (min-width: 640px) { .tree-children { margin-left: 1.1rem; padding-left: 1rem; } }
.tree-node-row { display: grid; grid-template-columns: 26px 24px minmax(0, 1fr) auto; align-items: center; column-gap: 0.5rem; row-gap: 0.4rem; padding: 0.45rem 0.2rem; border-radius: 10px; transition: background-color 0.15s; }
.tree-node-row:hover { background: var(--card-2); }
.tree-expand-btn { width: 26px; height: 26px; border: none; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; position: relative; }
.tree-expand-btn::before { content: ''; position: absolute; inset: -8px; }
.tree-expand-btn .i { width: 17px; height: 17px; transition: transform 0.25s var(--ease); }
.tree-expand-btn.open .i { transform: rotate(90deg); }
.tree-leaf-spacer { width: 26px; display: block; }
.tree-title-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.45rem; min-width: 0; }
.tree-title { font-weight: 600; font-size: 0.89rem; line-height: 1.38; word-break: break-word; }
.tree-actions { display: flex; align-items: center; gap: 0.45rem; }
.mini-progress-bar { width: 96px; }
@media (max-width: 639px) {
  .tree-node-row { grid-template-columns: 24px 24px minmax(0, 1fr); }
  .tree-actions { grid-column: 3; justify-content: flex-start; gap: 0.5rem; margin-top: 0.1rem; }
  .tree-node-row .mini-progress-bar { flex: 1; width: auto; max-width: 180px; }
}

.heatmap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.65rem; }
.heatmap-cell { padding: 0.85rem; border-radius: var(--radius-sm); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.22rem; transition: transform 0.2s var(--ease); }
.heatmap-cell:hover { transform: translateY(-2px); }
.heatmap-cell strong { font-size: 0.88rem; }
.heatmap-cell span { font-size: 0.76rem; color: var(--muted); }
.heatmap-cell.heat-0 { background: var(--card-2); }
.heatmap-cell.heat-1 { background: var(--primary-soft); }
.heatmap-cell.heat-2 { background: var(--accent-soft); }
.heatmap-cell.heat-3 { background: var(--success-soft); border-color: var(--success); }
.heatmap-cell.heat-4 { background: var(--success-soft); border-color: var(--success); box-shadow: inset 0 0 0 1px var(--success); }

.due-item-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.82rem 0.9rem; border-radius: var(--radius-sm); background: var(--card-2); border: 1px solid transparent; transition: border-color 0.2s; }
.due-item-row:hover { border-color: var(--line-strong); }
.due-item-row strong { font-size: 0.91rem; font-weight: 600; display: block; word-break: break-word; }
.due-item-row .meta { font-size: 0.77rem; color: var(--muted); margin-top: 0.18rem; }
.due-item-row .meta .late { color: var(--warning); font-weight: 700; }
@media (max-width: 540px) {
  .due-item-row { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .due-item-row .btn { width: 100%; justify-content: center; }
}

.stat-card-lg { display: flex; flex-direction: column; justify-content: center; gap: 0.35rem; }
.stat-card-lg strong { font-size: 1.5rem; letter-spacing: -0.03em; }

/* Placeholder / account */
.profile-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.profile-head .user-avatar { width: 54px; height: 54px; font-size: 1.3rem; }
.kv-grid { display: grid; gap: 0.6rem; margin-bottom: 1.25rem; }
@media (min-width: 560px) { .kv-grid { grid-template-columns: repeat(3, 1fr); } }
.kv { padding: 0.8rem 0.9rem; background: var(--card-2); border-radius: var(--radius-sm); }
.kv span { display: block; font-size: 0.74rem; color: var(--muted); font-weight: 600; }
.kv strong { font-size: 0.92rem; word-break: break-word; }
.btn-signout { border-color: transparent; color: var(--danger); background: var(--danger-soft); }
.btn-signout:hover { background: var(--danger); color: #fff; border-color: transparent; }

/* ==========================================================================
   Motion
   ========================================================================== */
@keyframes fadeIn { from { opacity: 0; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(0.96); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pop { 0% { transform: scale(0.8); } 55% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes ringIn { from { stroke-dasharray: 0 100; } }
@keyframes barIn { from { width: 0; } }
.route-container.enter .circle, .hero-preview .circle { animation: ringIn 1.1s var(--ease) 0.15s both; }
.route-container.enter .progress-fill, .route-container.enter .mini-progress-fill, .hero-preview .progress-fill { animation: barIn 0.9s var(--ease) 0.2s both; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Floating Action Button & Mobile refinements ---------- */
.fab {
  position: fixed;
  z-index: 65;
  right: 1.1rem;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 28px -4px var(--primary);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  animation: popIn 0.35s var(--ease) both;
}
.fab:active { transform: scale(0.92); }
.fab .i { width: 25px; height: 25px; stroke-width: 2.4; }
@media (min-width: 1000px) { .fab { display: none; } }

@media (max-width: 719px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 0.65rem; }
  .stat-grid > :last-child { grid-column: 1 / -1; flex-direction: column; }
  .stat-grid .card.mini-ring-card { flex-direction: column; align-items: flex-start; gap: 0.55rem; padding: 0.9rem; }
  .stat-grid .circular-chart { width: 46px; height: 46px; }
  .stat-grid .ring-meta strong { font-size: 1.2rem; }
  .stat-grid .ring-meta span { font-size: 0.73rem; }
  .section-header { margin-bottom: 2rem; }
  .day-hero { padding: 1.05rem; }
  .card-head { margin-bottom: 0.85rem; }
}
@media (max-width: 360px) {
  .route-container { padding: 0.7rem; }
  .btn-lg { padding-inline: 1.1rem; }
}

/* ==========================================================================
   Custom Confirmation & Edit Modals
   ========================================================================== */
.pt-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 12, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 1.25rem;
  animation: fadeIn 0.2s ease;
}

.pt-modal-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-pop);
  animation: popIn 0.3s var(--ease);
}

.pt-modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.pt-modal-text {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
  line-height: 1.5;
  word-break: break-word;
}

.pt-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ==========================================================================
   v2.1 — Mobile polish (Today stats, Syllabus header + tree)
   ========================================================================== */
.quick-Command-strip.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid { margin-bottom: 1rem; }
.stat-card-lg { text-decoration: none; }
.stat-card-label { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.stat-card-hint { font-size: 0.78rem; color: var(--muted); }
.stat-card-lg .tone-warn { color: var(--warning); }
.stat-card-lg .tone-ok { color: var(--success); }

@media (max-width: 719px) {
  .quick-Command-strip.cols-3 { gap: 0.5rem; }
  .quick-Command-strip.cols-3 .stat-pill-card { padding: 0.8rem 0.7rem 0.85rem; gap: 0.6rem; border-radius: 16px; align-items: flex-start; }
  .quick-Command-strip.cols-3 .stat-icon { width: 30px; height: 30px; border-radius: 9px; }
  .quick-Command-strip.cols-3 .stat-icon .i { width: 16px; height: 16px; }
  .quick-Command-strip.cols-3 .stat-pill-meta { width: 100%; min-width: 0; }
  .quick-Command-strip.cols-3 .stat-pill-meta span { font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .quick-Command-strip.cols-3 .stat-pill-meta strong { font-size: 1.45rem; margin-top: 0.15rem; line-height: 1.1; }
  .quick-Command-strip.cols-3 .stat-pill-meta small { display: block; margin-top: 0.2rem; font-size: 0.68rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .quick-Command-strip.cols-3 .stat-link-arrow { display: none; }

  .stat-grid { grid-template-columns: 1fr; gap: 0.6rem; margin-bottom: 0.75rem; }
  .stat-grid > :last-child { grid-column: auto; flex-direction: column; }
  .stat-grid .card.mini-ring-card { flex-direction: row; align-items: center; gap: 1rem; padding: 0.9rem 1.05rem; }
  .stat-grid .circular-chart { width: 54px; height: 54px; }
  .stat-grid .ring-meta strong { font-size: 1.5rem; }
  .stat-grid .ring-meta span { font-size: 0.78rem; margin-top: 0.2rem; }
  .stat-card-lg { padding: 0.9rem 1.05rem; gap: 0.2rem; }
  .stat-card-lg strong { font-size: 1.3rem; }

  .syllabus-toolbar { padding: 0.6rem; gap: 0.6rem; margin-bottom: 0.75rem; }
  .syllabus-toolbar .seg-btn { font-size: 0.8rem; padding: 0.4rem 0.4rem; gap: 0.35rem; }
  .search-input { min-height: 42px; }

  .route-container { padding-bottom: 4.5rem; }
}

@media (max-width: 639px) {
  .tree-container { gap: 0.6rem; }
  .tree-node.level-1 { padding: 0.2rem 0.65rem; border-radius: 18px; }
  .tree-node-row { grid-template-columns: 22px 22px minmax(0, 1fr); column-gap: 0.55rem; row-gap: 0.4rem; padding: 0.65rem 0; align-items: start; border-radius: 0; }
  .tree-node-row:hover { background: transparent; }
  .tree-expand-btn, .tree-leaf-spacer { width: 22px; height: 22px; margin-top: 1px; }
  .tree-expand-btn .i { width: 16px; height: 16px; }
  .tree-checkbox { width: 22px; height: 22px; border-radius: 7px; border-width: 1.75px; }
  .tree-checkbox .i { width: 13px; height: 13px; }
  .tree-title-wrap { padding-top: 1px; gap: 0.2rem 0.5rem; }
  .tree-title { font-size: 0.9rem; line-height: 1.35; }
  .tree-node.level-1 > .tree-node-row .tree-title { font-size: 0.97rem; }
  .tree-title-wrap .subcount-pill { font-size: 0.66rem; padding: 0.12rem 0.5rem; background: var(--primary-soft); color: var(--primary-ink); }
  .tree-actions { grid-column: 3; width: 100%; margin-top: 0; gap: 0.6rem; justify-content: flex-start; }
  .tree-node-row .mini-progress-bar { flex: 1; width: auto; max-width: none; height: 5px; }
  .tree-actions .btn-sm { min-height: 32px; padding: 0.3rem 0.75rem; font-size: 0.75rem; margin-left: auto; }
  .tree-children { margin: 0 0 0.4rem 0.55rem; padding-left: 0.65rem; border-left: 1px solid var(--line); gap: 0; }
  .tree-children .tree-node + .tree-node { border-top: 1px solid var(--line); }
  .tree-children .tree-node-row { padding: 0.6rem 0; }
}

/* ==========================================================================
   Landing header: always show "Log in"
   ========================================================================== */
.header-actions .btn-ghost.btn-login { display: inline-flex; }
.header-actions .btn-login { min-height: 38px; padding: 0.45rem 0.9rem; font-size: 0.85rem; border: 1px solid var(--line-strong); color: var(--text); background: transparent; }
.header-actions .btn-login:hover { background: var(--card-2); border-color: var(--primary); }
.header-actions .btn-primary { min-height: 38px; padding: 0.45rem 0.95rem; font-size: 0.85rem; }
@media (max-width: 639px) {
  .header-inner { gap: 0.5rem; }
  .header-actions { gap: 0.4rem; }
  .header-actions .icon-btn { width: 38px; height: 38px; }
  .brand-logo { font-size: 1.05rem; gap: 0.5rem; }
}
@media (max-width: 359px) { .brand-text { display: none; } }
@media (min-width: 640px) {
  .header-actions .btn-login { border-color: transparent; font-size: 0.9rem; padding: 0.6rem 1.1rem; min-height: 42px; color: var(--muted); }
  .header-actions .btn-primary { min-height: 42px; padding: 0.6rem 1.1rem; font-size: 0.9rem; }
}

.hero-login-link { font-size: 0.85rem; color: var(--muted); margin-top: 0.15rem; }
.hero-login-link button { background: none; border: none; padding: 0; font: inherit; font-weight: 700; color: var(--primary-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 640px) { .hero-login-link { display: none; } }

/* ==========================================================================
   Phase 3 — Mock Test Analytics (#/mocks) & Composite Rank (#/rank)
   ========================================================================== */

/* Mock Trajectory SVG Chart */
.mock-chart-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 0.25rem;
}
.mock-chart-svg {
  width: 100%;
  min-width: 460px;
  height: auto;
  display: block;
}
.chart-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}
.chart-cutoff-line {
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-dasharray: 5 4;
}
.chart-cutoff-label {
  fill: var(--accent);
  font-size: 11px;
  font-weight: 700;
}
.chart-axis-text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.chart-trend-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-dot {
  stroke: var(--card);
  stroke-width: 2.2;
  transition: transform 0.2s var(--ease);
}
.chart-dot.above {
  fill: var(--success);
}
.chart-dot.below {
  fill: var(--primary);
}
.chart-val-label {
  fill: var(--text);
  font-size: 11px;
  font-weight: 800;
}

/* Mock Logbook Rows */
.mock-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid transparent;
  transition: border-color 0.2s, background-color 0.2s;
}
.mock-row:hover {
  border-color: var(--line-strong);
}
.mock-score-pill {
  min-width: 68px;
  padding: 0.45rem 0.6rem;
  border-radius: 12px;
  text-align: center;
  background: var(--primary-soft);
  color: var(--primary-ink);
  flex-shrink: 0;
  line-height: 1.1;
}
.mock-score-pill.pass {
  background: var(--success-soft);
  color: var(--success);
}
.mock-score-pill strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.mock-score-pill small {
  font-size: 0.68rem;
  opacity: 0.85;
  font-weight: 700;
}

/* Rank & Percentile Page */
.rank-page {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.rank-hero {
  align-items: stretch;
  gap: 1.25rem;
}
.rank-hero-copy {
  flex: 1;
  min-width: 0;
}
.rank-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}
.rank-hero-rings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  flex-shrink: 0;
}
@media (max-width: 639px) {
  .rank-hero-rings {
    width: 100%;
  }
}

.pillar-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.pillar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.pillar-top h3 {
  font-size: 0.98rem;
  margin: 0;
}
.pillar-top .sub {
  font-size: 0.78rem;
  color: var(--muted);
  display: block;
  margin-top: 0.15rem;
}
.pillar-score {
  text-align: right;
  flex-shrink: 0;
}
.pillar-score strong {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

/* Cohort Distribution Histogram */
.histogram-bars {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.45rem;
  height: 170px;
  align-items: end;
  padding-top: 1.25rem;
}
.hist-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 0.35rem;
  min-width: 0;
}
.hist-count {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.hist-bar-track {
  width: 100%;
  max-width: 42px;
  flex: 1;
  background: var(--card-2);
  border-radius: 8px 8px 4px 4px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border: 1px solid var(--line);
}
.hist-bar-fill {
  width: 100%;
  background: var(--primary-soft);
  border-top: 2px solid var(--primary);
  border-radius: 6px 6px 0 0;
  transition: height 0.5s var(--ease);
}
.hist-col.is-user .hist-bar-fill {
  background: linear-gradient(180deg, var(--accent), var(--primary));
  border-top-color: var(--accent);
}
.hist-col.is-user .hist-count,
.hist-col.is-user .hist-label {
  color: var(--accent);
  font-weight: 800;
}
.hist-label {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 560px) {
  .histogram-bars {
    gap: 0.25rem;
    height: 145px;
  }
  .hist-label {
    font-size: 0.56rem;
  }
  .hist-count {
    font-size: 0.58rem;
  }
}

/* ==========================================================================
   Phase 4 — Account, Billing, Creator Coupons & Checkout Modals
   ========================================================================== */
.billing-page {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.coupon-bar-card {
  border: 1px dashed var(--accent);
  background: radial-gradient(50% 120% at 100% 0%, var(--accent-soft), transparent 70%), var(--card);
}

.coupon-bar-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

@media (min-width: 760px) {
  .coupon-bar-grid {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.coupon-bar-grid h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.coupon-bar-grid h3 .i {
  color: var(--accent);
}

.coupon-input-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 400px;
}

.coupon-active-banner {
  margin-top: 0.9rem;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  border: 1px solid var(--success);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.coupon-active-banner strong {
  display: block;
  color: var(--success);
}

.sandbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.95rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.price-badge-lg {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
}

.sandbox-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 0.95rem;
  background: var(--card-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin-bottom: 1rem;
  font-size: 0.86rem;
}

.sandbox-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.sandbox-row span {
  color: var(--muted);
}

/* Collapsible Upcoming Tasks in Daily Action Center */
.todo-collapsible-wrapper {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.todo-collapsible-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.2rem;
  color: var(--text);
  font-size: 0.86rem;
}

.collapsible-icon {
  display: inline-flex;
  transition: transform 0.2s var(--ease);
  color: var(--muted);
}

.collapsible-icon.open {
  transform: rotate(90deg);
}

.upcoming-list.collapsed {
  display: none !important;
}

.upcoming-list.expanded {
  display: flex !important;
  margin-top: 0.65rem;
}

/* Polished Rank Hero & Rings */
.rank-hero-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.35rem 1.25rem;
  background: radial-gradient(80% 120% at 100% 0%, var(--primary-soft), transparent 60%),
              radial-gradient(70% 100% at 0% 100%, var(--accent-soft), transparent 70%),
              var(--card);
}

.rank-title {
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0.3rem 0 0.25rem;
}

.rank-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.rank-hero-rings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

.ring-card-clean {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ring-card-clean .circular-chart {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.ring-card-clean .ring-meta strong {
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.ring-card-clean .ring-meta span {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 420px) {
  .rank-hero-rings-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}


/* ==========================================================================
   Route Transition Spinner & Top Progress Bar (global — shown on every tab)
   Appears instantly (no fade-in delay) and fades out when the route stage is ready.
   ========================================================================== */
.route-stage { min-width: 0; }

.route-spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  position: relative;
  width: 100%;
  animation: ptRouteSpinnerIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.route-spinner-container.fade-out {
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
}

/* Slim gradient bar fixed to the top of the viewport */
.route-top-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-2) 50%, var(--accent) 100%);
  z-index: 9999;
  box-shadow: 0 0 10px var(--primary-soft);
  transform-origin: left;
  animation: ptTopProgressPulse 1.2s infinite ease-in-out;
  pointer-events: none;
}

.route-spinner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.75rem 2.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.route-spinner-dual-ring {
  position: relative;
  width: 48px;
  height: 48px;
}

.route-spinner-dual-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3.5px solid var(--line-strong);
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  animation: ptSpin 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  filter: drop-shadow(0 0 8px var(--primary-soft));
  will-change: transform;
}

.route-spinner-inner-ring {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-bottom-color: var(--primary-2);
  border-left-color: var(--accent);
  animation: ptSpinReverse 0.6s linear infinite;
  will-change: transform;
}

.route-spinner-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

@keyframes ptSpin { to { transform: rotate(360deg); } }
@keyframes ptSpinReverse { to { transform: rotate(-360deg); } }
@keyframes ptRouteSpinnerIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ptTopProgressPulse {
  0% { transform: scaleX(0.05); transform-origin: left; }
  50% { transform: scaleX(0.75); transform-origin: left; }
  100% { transform: scaleX(1); transform-origin: right; opacity: 0.8; }
}

@media (prefers-reduced-motion: reduce) {
  .route-spinner-container { animation: none; }
  .route-top-progress-bar { animation: none; transform: scaleX(0.6); }
  .route-spinner-dual-ring::before { animation-duration: 1.6s; filter: none; }
  .route-spinner-inner-ring { animation-duration: 1.2s; }
}

/* ==========================================================================
   Course Link Modal (external coaching-portal URL)
   Reuses .modal-backdrop / .modal-card / .modal-header from the shared modal styles.
   ========================================================================== */
.modal-card.course-link-modal { max-width: 460px; }

.course-link-modal .modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.course-link-modal .modal-title-wrap .icon-wrap {
  display: inline-flex;
  color: var(--primary);
}

.course-link-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.25rem 0 1.1rem;
}

.course-link-modal .modal-lead {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

.course-link-modal .modal-lead strong { color: var(--text); }

.course-link-modal .course-link-error {
  margin: 0.4rem 0 0;
  min-height: 1.1em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--danger);
}

.course-link-modal .modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.course-link-modal .modal-footer .modal-remove { margin-right: auto; }

/* ==========================================================================
   Daily Action Center v3 — Minimalist Today Workspace
   ========================================================================== */
.today-workspace,
#todoListsTopWrapper.today-workspace {
  --today-shadow: 0 1px 2px rgba(20, 23, 43, 0.03);
  --today-gap: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: var(--today-gap);
}
[data-theme="dark"] .today-workspace {
  --today-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 4px 12px rgba(0, 0, 0, 0.22);
}
@media (min-width: 960px) {
  .today-workspace {
    --today-gap: 1.75rem;
  }
}

/* Minimalist Hero Header */
.today-hero {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 1.3rem 1.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: radial-gradient(65% 130% at 100% 0%, var(--primary-soft), transparent 62%), var(--card);
  box-shadow: var(--today-shadow);
}
@media (min-width: 760px) {
  .today-hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem;
  }
}

.today-date-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.today-hero-copy h2 {
  font-size: clamp(1.38rem, 3vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.today-hero-copy p {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 0.28rem;
}

.today-hero-right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.35rem;
}

.today-progress-cluster {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.today-ring-box {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}
.today-ring-svg {
  width: 52px;
  height: 52px;
}
.today-ring-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.today-metric-lines {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.today-metric-main {
  font-size: 0.94rem;
  line-height: 1.1;
}
.today-metric-main strong {
  font-weight: 800;
  color: var(--text);
}
.today-metric-main span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.today-syllabus-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary-ink);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.today-syllabus-link .i {
  width: 12px;
  height: 12px;
  transition: transform 0.18s var(--ease);
}
.today-syllabus-link:hover .i {
  transform: translateX(2px);
}

.today-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Editable Focus Sprint Pill & Popover */
.today-focus-anchor {
  position: relative;
}
.today-focus-split {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  overflow: hidden;
  transition: border-color 0.18s;
}
.today-focus-split:hover {
  border-color: var(--primary);
}
.today-focus-split .today-focus-btn {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0.4rem 0.65rem 0.4rem 0.85rem;
}
.today-focus-dur-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 36px;
  padding: 0.4rem 0.72rem 0.4rem 0.52rem;
  border: none;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s;
}
.today-focus-dur-btn:hover {
  background: var(--card);
}
.today-focus-dur-btn .i {
  width: 13px;
  height: 13px;
  color: var(--muted);
}

.today-focus-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 220px;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-pop);
  animation: popIn 0.18s var(--ease);
}
.today-focus-pop-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.55rem;
}
.today-focus-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}
.today-focus-preset {
  padding: 0.38rem 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.today-focus-preset:hover {
  border-color: var(--primary);
}
.today-focus-preset.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.today-focus-custom-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}
.today-focus-custom-row input {
  width: 68px;
  min-height: 32px !important;
  padding: 0.3rem 0.5rem !important;
  font-size: 0.82rem !important;
  text-align: center;
}
.today-focus-custom-row span {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
}
.today-focus-set-btn {
  margin-left: auto;
  height: 32px;
  padding: 0 0.7rem;
  border-radius: 8px;
  border: none;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.today-focus-set-btn:hover {
  background: var(--primary);
  color: #fff;
}

.today-focus-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 36px;
  padding: 0.4rem 0.8rem;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background-color 0.18s;
}
.today-focus-btn:hover {
  color: var(--primary-ink);
}
.today-focus-btn .i {
  width: 13px;
  height: 13px;
  color: var(--primary-ink);
}
.today-focus-active {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  border: 1px solid var(--primary);
  background: var(--primary-soft);
  padding-right: 0.25rem;
}
.today-focus-active .today-focus-btn {
  border: none;
  background: transparent;
  color: var(--text);
  padding-right: 0.45rem;
}
.today-focus-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.today-focus-active.is-running .today-focus-dot {
  animation: pulse 1.6s ease-out infinite;
}
.today-focus-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 0.82rem;
}
.today-focus-state {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}
.today-focus-reset {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.today-focus-reset:hover {
  color: var(--text);
  background: var(--card);
}
.today-focus-reset .i {
  width: 13px;
  height: 13px;
}

/* Full-Width Workspace Grid */
.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--today-gap);
  align-items: stretch;
}

.today-panel {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  box-shadow: var(--today-shadow);
}
@media (min-width: 768px) {
  .today-panel {
    padding: 1.45rem 1.65rem;
  }
}

/* Quick-Add Omnibar */
.today-quick-add {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.42rem 0.38rem 0.8rem;
  margin-bottom: 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.today-quick-add:focus-within {
  border-color: var(--primary);
  background: var(--card);
  box-shadow: var(--ring-glow);
}
.today-quick-icon {
  display: inline-flex;
  color: var(--muted);
  flex-shrink: 0;
}
.today-quick-icon .i {
  width: 17px;
  height: 17px;
}
.today-quick-input {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.4rem 0 !important;
  min-height: 34px !important;
  font-size: 0.88rem !important;
  color: var(--text);
}
.today-quick-input::placeholder {
  color: var(--muted);
}
.today-quick-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.today-quick-prio-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  height: 30px;
  padding: 0 0.5rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.today-quick-prio-btn:hover {
  background: var(--card);
  border-color: var(--line);
  color: var(--text);
}
@media (max-width: 440px) {
  .today-quick-prio-label { display: none; }
  .today-quick-prio-btn { padding: 0 0.45rem; }
}
.today-quick-submit {
  height: 32px;
  padding: 0 0.85rem;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.today-quick-submit:hover {
  opacity: 0.92;
}
.today-quick-submit:active {
  transform: scale(0.96);
}

/* Panel Headers */
.today-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}
.today-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.today-panel-title-wrap h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.today-panel-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.18rem;
}
.today-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.today-text-btn {
  background: transparent;
  border: none;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.today-text-btn:hover {
  background: var(--danger-soft);
}
.today-syllabus-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.68rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s, background-color 0.16s;
}
.today-syllabus-add-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.today-syllabus-add-btn .i {
  width: 13px;
  height: 13px;
}

.today-badge-warn {
  background: var(--warning-soft);
  color: var(--warning);
}
.today-badge-ok {
  background: var(--success-soft);
  color: var(--success);
}

/* Minimalist Task Rows */
.today-task-list {
  gap: 0.25rem;
}
.today-task-row {
  align-items: flex-start;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
}
.today-task-row:hover {
  background: var(--card-2);
  border-color: var(--line);
}
.today-task-row .tree-checkbox {
  margin-top: 2px;
  width: 21px;
  height: 21px;
  border-radius: 7px;
}
.today-task-row .todo-title-line {
  margin-bottom: 0;
}
.today-task-row .todo-title-line strong {
  font-size: 0.91rem;
  font-weight: 600;
}
.today-task-row .todo-meta {
  margin-top: 0.18rem;
}
.today-task-date {
  font-size: 0.74rem;
}
.today-prio-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.74rem;
  font-weight: 600;
}
.today-prio-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.today-prio-dot.prio-1 { background: var(--danger); }
.today-prio-dot.prio-2 { background: var(--warning); }
.today-prio-dot.prio-3 { background: var(--success); }

@media (hover: hover) {
  .today-task-row .todo-delete-btn {
    opacity: 0;
  }
  .today-task-row:hover .todo-delete-btn,
  .today-task-row:focus-within .todo-delete-btn {
    opacity: 0.85;
  }
}

/* Clean Companion Panel (No green gradient) */
.today-revisions-panel {
  position: relative;
  overflow: hidden;
  background: var(--card);
}
.today-rev-head-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.today-rev-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.today-rev-icon-badge .i {
  width: 18px;
  height: 18px;
}

.today-rev-list {
  gap: 0.65rem;
}
.today-rev-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.85rem 0.95rem 0.85rem 1.05rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
  transition: transform 0.18s var(--ease), border-color 0.18s ease, box-shadow 0.18s ease;
}
.today-rev-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.today-rev-card.is-overdue::before {
  background: var(--warning);
}
.today-rev-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.today-rev-info {
  min-width: 0;
  flex: 1;
}
.today-rev-info strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
  color: var(--text);
}
.today-rev-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  margin-top: 0.35rem;
  font-size: 0.73rem;
}
.today-rev-round-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.48rem;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: 0.69rem;
}
.today-rev-last {
  color: var(--muted);
  font-weight: 500;
}
.today-rev-status {
  font-weight: 700;
  padding: 0.14rem 0.48rem;
  border-radius: 6px;
  font-size: 0.69rem;
}
.today-rev-status.is-late {
  background: var(--warning-soft);
  color: var(--warning);
}
.today-rev-status.is-now {
  background: var(--accent-soft);
  color: var(--accent);
}
.today-rev-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.42rem 0.85rem;
  border-radius: 99px;
  border: 1px solid transparent;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.today-rev-btn .i {
  width: 14px;
  height: 14px;
}
.today-rev-btn:hover {
  background: var(--accent);
  color: #04211d;
}
.today-rev-btn:active {
  transform: scale(0.95);
}

/* Unified Modal (Desktop) & Bottom Sheet (Mobile) for Task Composer */
.today-composer-backdrop {
  display: none;
}
.today-composer-backdrop.open {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(5, 6, 12, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.18s ease;
}
.today-composer-modal {
  width: 100%;
  max-height: 88dvh;
  overflow-y: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1.35rem 1.2rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-pop);
  animation: sheetUp 0.25s var(--ease);
}
@media (min-width: 640px) {
  .today-composer-backdrop.open {
    align-items: center;
    padding: 1.25rem;
  }
  .today-composer-modal {
    max-width: 460px;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    animation: popIn 0.22s var(--ease);
  }
}

/* Focus Alarm Modal */
.focus-alarm-card {
  text-align: center;
  max-width: 360px;
}
.focus-alarm-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: pulse 1.5s ease-out infinite;
}
.focus-alarm-icon .i {
  width: 26px;
  height: 26px;
}

/* Link-to-Syllabus Pill & Searchable Picker Modal */
.today-row-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.today-link-pill,
.today-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.today-link-pill {
  padding: 0.28rem 0.62rem;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  color: var(--primary-ink);
  white-space: nowrap;
}
.today-link-pill .i {
  width: 12px;
  height: 12px;
}
.today-link-pill:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
@media (max-width: 480px) {
  .today-link-pill span {
    display: none;
  }
  .today-link-pill {
    padding: 0.34rem 0.45rem;
  }
}
.today-link-btn {
  border: none;
  max-width: 220px;
}
.today-link-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-syllabus-modal {
  max-width: 500px;
}
.link-syllabus-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-xs);
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 0.8rem;
}
.link-syllabus-results {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 52dvh;
  overflow-y: auto;
  padding-right: 0.15rem;
}
.link-syllabus-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.78rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.link-syllabus-item:hover {
  border-color: var(--primary);
  background: var(--card);
}
.link-syllabus-item.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.link-syllabus-item-main {
  min-width: 0;
  flex: 1;
}
.link-syllabus-item-main strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}
.link-syllabus-item-main span {
  display: block;
  font-size: 0.73rem;
  color: var(--muted);
  margin-top: 0.14rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-syllabus-item-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
  background: var(--card);
  color: var(--primary-ink);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.link-syllabus-item-tag.is-done {
  background: var(--success-soft);
  color: var(--success);
  border-color: transparent;
}
.link-syllabus-empty {
  text-align: center;
  padding: 1.8rem 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}


/* ==========================================================================
   Today Productivity Upgrade v4 — Research-Backed Workspace (Theme-Safe)
   Strictly uses existing PrepDeck CSS tokens (--bg, --card, --primary, --accent, etc.)
   ========================================================================== */

.today-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.today-focus-wrap-row {
  display: inline-flex;
  align-items: center;
}
.today-hero-pill-btn,
.today-hero-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.38rem 0.78rem;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s, background-color 0.16s, color 0.16s;
}
.today-hero-icon-btn {
  width: 36px;
  padding: 0;
}
.today-hero-pill-btn:hover,
.today-hero-icon-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.today-hero-pill-btn .i,
.today-hero-icon-btn .i {
  width: 14px;
  height: 14px;
  color: var(--primary-ink);
}

/* Workspace View Tabs & Filter Strip */
.today-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
@media (min-width: 860px) {
  .today-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.today-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--line);
  overflow-x: auto;
  max-width: 100%;
}
.today-view-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 34px;
  padding: 0.32rem 0.75rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s, color 0.16s;
}
.today-view-tab:hover {
  color: var(--text);
}
.today-view-tab.active {
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.today-tab-count {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.08rem 0.42rem;
  border-radius: 99px;
  background: var(--card-2);
  color: var(--muted);
}
.today-view-tab.active .today-tab-count,
.today-comp-tab.active .today-tab-count {
  background: var(--primary);
  color: #fff;
}

.today-filter-strip {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-wrap: wrap;
}
.today-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 30px;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.today-filter-chip .i {
  width: 12px;
  height: 12px;
}
.today-filter-chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}
.today-filter-chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.today-saved-filter-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
}
.today-saved-filter-pill.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.today-saved-filter-pill button {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.24rem 0.55rem;
  cursor: pointer;
}
.today-sf-del {
  padding-left: 0.25rem !important;
  color: var(--muted) !important;
}
.today-plain-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--line);
}
.today-plain-filter-bar input {
  min-height: 36px;
  font-size: 0.84rem;
}

/* Capture Omnibar + NLP Preview + Voice + Cue Drawer */
.today-capture-block {
  margin-bottom: 0.85rem;
}
.today-capture-block .today-quick-add {
  margin-bottom: 0.45rem;
}
.today-insert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.7rem;
  margin-bottom: 0.45rem;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 0.75rem;
  font-weight: 700;
}
.today-quick-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.today-quick-icon-btn:hover,
.today-quick-icon-btn.active {
  color: var(--primary-ink);
  background: var(--primary-soft);
  border-color: var(--primary);
}
.today-quick-icon-btn.is-listening {
  color: var(--primary-ink);
  background: var(--primary-soft);
  border-color: transparent;
}
.today-voice-bars {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 14px;
}
.today-voice-bars i {
  display: block;
  width: 2px;
  height: 12px;
  border-radius: 99px;
  background: currentColor;
  transform-origin: center;
  animation: ptVoiceBar 0.95s ease-in-out infinite;
}
.today-voice-bars i:nth-child(1) { animation-delay: 0s; height: 7px; }
.today-voice-bars i:nth-child(2) { animation-delay: 0.16s; height: 13px; }
.today-voice-bars i:nth-child(3) { animation-delay: 0.32s; height: 10px; }
.today-voice-bars i:nth-child(4) { animation-delay: 0.48s; height: 8px; }
@keyframes ptVoiceBar {
  0%, 100% { transform: scaleY(0.45); opacity: 0.72; }
  50% { transform: scaleY(1); opacity: 1; }
}
.today-help-popover {
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  animation: fadeIn 0.16s ease;
}
.today-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.8rem;
}
.today-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.4rem 0.75rem;
  font-size: 0.74rem;
  margin-bottom: 0.6rem;
}
.today-help-grid > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem;
}
.today-help-grid span {
  color: var(--muted);
  margin-left: auto;
}
.today-help-examples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}
.today-quick-icon-btn .i {
  width: 15px;
  height: 15px;
}
.today-nlp-preview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.25rem 0.2rem 0.45rem;
}
.today-nlp-label {
  font-size: 0.71rem;
  font-weight: 700;
  color: var(--muted);
}
.today-nlp-chip {
  font-size: 0.71rem;
  font-weight: 700;
  padding: 0.14rem 0.5rem;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.today-cue-drawer {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: fadeIn 0.16s ease;
}
.today-cue-drawer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.today-cue-drawer-row input,
.today-cue-drawer-row select {
  min-height: 36px;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}
.today-cue-drawer-row input:first-child {
  flex: 1 1 200px;
}
.today-cue-drawer-row select {
  width: auto;
  min-width: 120px;
}
.today-cue-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.today-cue-chip {
  padding: 0.22rem 0.55rem;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.today-cue-chip:hover {
  border-color: var(--primary);
  color: var(--primary-ink);
}

/* Smart Suggestions Box (Microsoft To Do lightbulb) */
.today-suggestions-box {
  margin-bottom: 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
  overflow: hidden;
}
.today-suggestions-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.today-sug-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.82rem;
}
.today-sug-icon {
  display: inline-flex;
  color: var(--accent);
}
.today-sug-icon .i {
  width: 16px;
  height: 16px;
}
.today-sug-sub {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 500;
}
.today-suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0 0.8rem 0.75rem;
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}
.today-sug-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
}
.today-sug-info {
  min-width: 0;
}
.today-sug-info strong {
  display: block;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-sug-info span {
  font-size: 0.72rem;
  color: var(--muted);
}

/* Gentle Carry-Over Card (No Guilt) & Attention Cap Banner */
.today-carry-card {
  margin-bottom: 0.95rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: radial-gradient(90% 120% at 0% 0%, var(--warning-soft), transparent 65%), var(--card-2);
}
.today-carry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.today-carry-head strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
}
.today-carry-head span {
  font-size: 0.74rem;
  color: var(--muted);
}
.today-carry-actions {
  display: flex;
  gap: 0.35rem;
}
.today-focus-cap-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 0.77rem;
  font-weight: 600;
}
.today-focus-cap-banner .i {
  width: 14px;
  height: 14px;
  margin-right: 0.25rem;
  vertical-align: -2px;
}

/* Enhanced Task Card Badges, Subtasks, Quick-Insert & Row Actions */
.today-task-row.is-focusing {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.today-cue-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  padding: 0.14rem 0.5rem;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
}
.today-cue-pill .i {
  width: 11px;
  height: 11px;
}
.today-meta-chip,
.today-deadline-chip,
.today-carry-chip,
.today-tag-chip,
.today-sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--muted);
}
.today-meta-chip .i,
.today-deadline-chip .i,
.today-sub-pill .i {
  width: 11px;
  height: 11px;
}
.today-meta-chip.is-focus {
  color: var(--accent);
}
.today-deadline-chip.is-soon {
  color: var(--warning);
  font-weight: 700;
}
.today-carry-chip {
  color: var(--warning);
}
.today-tag-chip {
  color: var(--primary-ink);
}
.today-sub-pill {
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.today-sub-pill:hover {
  border-color: var(--primary);
}
.today-row-act-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.today-row-act-btn .i {
  width: 13px;
  height: 13px;
}
.today-row-act-btn:hover {
  color: var(--primary-ink);
  background: var(--card);
  border-color: var(--line-strong);
}
@media (hover: hover) {
  .today-task-row .today-row-act-btn {
    opacity: 0;
  }
  .today-task-row:hover .today-row-act-btn,
  .today-task-row:focus-within .today-row-act-btn {
    opacity: 1;
  }
}
.today-pill-act-btn {
  padding: 0.24rem 0.58rem;
  border-radius: 99px;
  border: 1px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

/* Quick Insert between rows */
.today-quick-insert-slot {
  height: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: height 0.15s;
}
.today-quick-insert-btn {
  opacity: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.6rem;
  border-radius: 99px;
  border: 1px solid var(--primary);
  background: var(--card);
  color: var(--primary-ink);
  font-size: 0.69rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  z-index: 2;
}
.today-quick-insert-btn .i {
  width: 11px;
  height: 11px;
}
.today-quick-insert-slot:hover {
  height: 22px;
}
.today-quick-insert-slot:hover .today-quick-insert-btn,
.today-quick-insert-btn:focus-visible {
  opacity: 1;
}

/* Subtasks Inline Drawer */
.today-inline-subtasks {
  margin-top: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.today-inline-sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
}
.today-accent-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: var(--accent) !important;
}
.today-accent-btn:hover {
  background: var(--accent-soft) !important;
}
.today-accent-btn .i {
  width: 12px;
  height: 12px;
}
.today-subtask-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.22rem 0;
}
.tree-checkbox.sm {
  width: 18px;
  height: 18px;
  border-radius: 6px;
}
.tree-checkbox.sm .i {
  width: 11px;
  height: 11px;
}
.icon-btn.sm {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}
.icon-btn.sm .i {
  width: 12px;
  height: 12px;
}
.today-subtask-title {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text);
}
.today-subtask-empty {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.35rem 0;
}
.today-subtask-add-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.25rem;
}
.today-subtask-add-row input {
  min-height: 34px;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

/* Subsections (This Evening, Tomorrow Quick-Pick) */
.today-subsection {
  margin-top: 1.05rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.today-subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.today-evening-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
}
.today-evening-title .i {
  width: 15px;
  height: 15px;
  color: var(--primary-ink);
}
.today-evening-title small {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}
.today-quickpick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.today-quickpick-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.65rem;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}
.today-quickpick-chip .i {
  width: 12px;
  height: 12px;
  color: var(--primary-ink);
}
.today-quickpick-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* Eisenhower Matrix & Realistic Day Schedule */
.today-panel {
  min-width: 0;
}
.today-matrix-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .today-matrix-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.today-matrix-quad {
  min-width: 0;
  overflow: hidden;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
}
.today-matrix-quad.is-q1 {
  border-color: var(--primary);
  background: radial-gradient(80% 100% at 0% 0%, var(--primary-soft), transparent 70%), var(--card-2);
}
.today-matrix-quad.is-q2 {
  border-color: var(--accent);
  background: radial-gradient(80% 100% at 0% 0%, var(--accent-soft), transparent 70%), var(--card-2);
}
.today-matrix-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-bottom: 0.55rem;
}
.today-matrix-head strong {
  font-size: 0.88rem;
}
.today-matrix-head span {
  font-size: 0.71rem;
  color: var(--muted);
}
.today-matrix-items {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  min-width: 0;
}
.today-matrix-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
  font-size: 0.82rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--line);
}
.today-matrix-item span {
  cursor: pointer;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.today-capacity-bar-wrap {
  margin-bottom: 0.9rem;
}
.today-capacity-bar-wrap small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.today-schedule-blocks {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.today-schedule-col {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
}

/* Right Companion Panel Tabs, Forgiving Habits & Goals/Wins */
.today-companion-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
  margin-bottom: 1rem;
}
.today-comp-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.25rem 0.45rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.16s, color 0.16s;
}
.today-comp-tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.today-inline-create-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line-strong);
}
.today-inline-create-card input {
  min-height: 38px;
  font-size: 0.84rem;
}

.today-habits-list,
.today-goals-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.today-habit-card,
.today-goal-card {
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
}
.today-habit-card.is-done {
  border-color: var(--success);
}
.today-habit-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.today-habit-info {
  flex: 1;
  min-width: 0;
}
.today-habit-info strong {
  display: block;
  font-size: 0.88rem;
}
.today-habit-cue {
  display: block;
  font-size: 0.73rem;
  color: var(--muted);
}
.today-habit-streak {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.today-streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.48rem;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
}
.today-streak-pill .i {
  width: 12px;
  height: 12px;
}
.today-grace-note {
  margin-top: 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--warning);
}
.today-habit-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.6rem;
}
.today-habit-dots {
  display: flex;
  gap: 0.25rem;
}
.today-habit-dot {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.today-habit-dot.on {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}
.today-habit-auto {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}
.today-habit-auto .mini-progress-bar {
  width: 68px;
}

/* Weekly Small Wins Chart */
.today-wins-card {
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
}
.today-wins-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
  margin-bottom: 0.75rem;
}
.today-wins-summary strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
}
.today-wins-summary span {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
}
.today-wins-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  height: 82px;
  align-items: end;
}
.today-win-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 0.2rem;
}
.today-win-num {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--muted);
  min-height: 12px;
}
.today-win-track {
  width: 100%;
  max-width: 24px;
  flex: 1;
  background: var(--card);
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.today-win-fill {
  width: 100%;
  background: var(--primary-soft);
  border-top: 2px solid var(--primary);
  border-radius: 4px 4px 0 0;
}
.today-win-col.is-today .today-win-fill {
  background: var(--accent-soft);
  border-top-color: var(--accent);
}
.today-win-lbl {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
}
.today-goal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}
.today-goal-top strong {
  display: block;
  font-size: 0.87rem;
}
.today-goal-top span {
  font-size: 0.74rem;
  color: var(--muted);
}
.today-goal-btns {
  display: flex;
  gap: 0.25rem;
}

/* Modals: Rich Inspector, Daily Check-In, Quick Find & Focus Shield */
.today-inspector-modal {
  max-width: 540px !important;
}
.today-ifthen-box {
  padding: 0.75rem;
  margin-bottom: 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
}
.today-ifthen-box label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.79rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}
.today-science-pill {
  font-size: 0.67rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
}
.today-ifthen-box input {
  margin-bottom: 0.45rem;
  min-height: 38px;
  font-size: 0.85rem;
}
.today-muted-hint {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.74rem;
}
.today-check-inline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.today-insp-subtasks {
  margin-top: 0.85rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
}
.today-insp-sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

/* Guided Daily Check-In Modal */
.today-ritual-modal {
  max-width: 480px !important;
}
.today-ritual-progress {
  height: 5px;
  border-radius: 99px;
  background: var(--card-2);
  overflow: hidden;
  margin-bottom: 1rem;
}
.today-ritual-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.25s var(--ease);
}
.today-ritual-card {
  padding: 1.15rem;
  border-radius: var(--radius-md);
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  margin-bottom: 1rem;
}
.today-ritual-card h4 {
  font-size: 1.08rem;
  margin-bottom: 0.45rem;
}
.today-ritual-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--muted);
}
.today-ritual-cue-prompt {
  margin-top: 0.65rem;
  font-size: 0.75rem;
  color: var(--primary-ink);
}
.today-ritual-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.today-ritual-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 0.85rem;
}
.today-ritual-tomorrow-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}
.today-ritual-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 9px;
  background: var(--card-2);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}
.today-ritual-mini-row small {
  color: var(--accent);
  font-weight: 700;
}

/* Single-Task Focus Shield Overlay */
.today-focus-shield {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
}
.today-shield-inner {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.today-shield-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.today-shield-card {
  padding: 1.75rem;
  text-align: center;
}
.today-shield-cue {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.45rem;
}
.today-shield-title {
  font-size: clamp(1.25rem, 3.2vw, 1.65rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
}
.today-shield-clock-wrap {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--card-2);
  border: 1px solid var(--line);
  margin-bottom: 1.15rem;
}
.today-shield-clock {
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}
.today-shield-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.4rem;
}
.today-shield-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.today-shield-subtasks,
.today-parking-lot {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  text-align: left;
}
.today-parking-lot label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

/* Quick Find & Command Palette */
.today-quickfind-modal {
  max-width: 520px !important;
  padding: 0.9rem !important;
}
.today-quickfind-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.65rem;
}
.today-quickfind-input-wrap .i {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.today-quickfind-input-wrap input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  min-height: 34px;
  padding: 0;
  font-size: 0.92rem;
}
.today-quickfind-results {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 50dvh;
  overflow-y: auto;
}
.today-qf-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--card-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.today-qf-item:hover:not(.is-static) {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.today-qf-item strong {
  flex: 1;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-qf-item small {
  font-size: 0.72rem;
  color: var(--muted);
}
.today-qf-tag {
  font-size: 0.66rem;
  font-weight: 800;
  padding: 0.14rem 0.45rem;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.today-qf-tag.accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.today-task-list.collapsed {
  display: none !important;
}
.today-task-list.expanded {
  display: flex !important;
  margin-top: 0.65rem;
}

/* ==========================================================================
   Today UI Refinements: Single Filter Popover, Shortcuts Modal, Move Modal, Clean Subtasks
   ========================================================================== */
.today-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.today-filter-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.today-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 36px;
  padding: 0.35rem 0.78rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.today-toolbar-btn .i {
  width: 14px;
  height: 14px;
}
.today-toolbar-btn:hover,
.today-toolbar-btn.active {
  color: var(--primary-ink);
  border-color: var(--primary);
  background: var(--primary-soft);
}
.today-toolbar-clear {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}
.today-toolbar-clear:hover {
  color: var(--danger);
  border-color: var(--danger);
}
.today-filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: min(320px, 88vw);
  padding: 0.9rem;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  animation: popIn 0.18s var(--ease);
}
.today-filter-pop-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.today-filter-pop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.today-filter-pop-input-row {
  display: flex;
  gap: 0.4rem;
}
.today-filter-pop-input-row input {
  min-height: 36px;
  font-size: 0.8rem;
  padding: 0.3rem 0.65rem;
}

/* Shortcuts Help Modal */
.today-shortcuts-modal {
  max-width: 620px !important;
}
.today-shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
@media (min-width: 580px) {
  .today-shortcuts-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.today-shortcut-group {
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
}
.today-shortcut-group h4 {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary-ink);
  margin-bottom: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.today-shortcut-rows {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}
.today-shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.77rem;
}
.today-shortcut-row span {
  color: var(--muted);
  text-align: right;
}
.today-shortcut-examples {
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.today-shortcut-ex-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.today-shortcut-ex-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.today-shortcut-ex-btn .i {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}
.today-shortcut-ex-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* Move Task Modal */
.today-move-modal {
  max-width: 400px !important;
}
.today-move-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.today-move-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}
.today-move-option:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}
.today-move-option.is-current {
  border-color: var(--accent);
}
.today-move-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--primary-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.today-move-icon .i {
  width: 16px;
  height: 16px;
}
.today-move-text {
  flex: 1;
  min-width: 0;
}
.today-move-text strong {
  display: block;
  font-size: 0.88rem;
}
.today-move-text small {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
}
.today-move-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.14rem 0.48rem;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Cleaner Minimalist Hierarchical Subtasks */
.today-inline-subtasks {
  margin-top: 0.4rem;
  padding: 0.15rem 0 0.15rem 0.85rem;
  border-left: 2px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}
.today-subtask-items {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}
.today-subtask-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.14rem 0.3rem;
  border-radius: 6px;
  transition: background-color 0.12s;
}
.today-subtask-row:hover {
  background: var(--card-2);
}
.today-sub-del-btn {
  opacity: 0;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
}
.today-sub-del-btn .i {
  width: 12px;
  height: 12px;
}
.today-subtask-row:hover .today-sub-del-btn {
  opacity: 1;
}
.today-sub-del-btn:hover {
  color: var(--danger);
  background: var(--danger-soft);
}
.today-subtask-add-row {
  display: flex;
  align-items: center;
  margin-top: 0.05rem;
}
.today-inline-sub-input {
  flex: 1;
  min-height: 28px !important;
  padding: 0.18rem 0.4rem !important;
  font-size: 0.8rem !important;
  border: 1px solid transparent !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
.today-inline-sub-input::placeholder {
  color: var(--muted);
}
.today-inline-sub-input:focus {
  background: var(--card) !important;
  border-color: var(--line-strong) !important;
}

/* Suggestions Icon + Badge + Popover inside Today's Focus */
.today-panel-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.today-sug-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.today-sug-icon-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s, transform 0.15s;
}
.today-sug-icon-btn .i {
  width: 15px;
  height: 15px;
}
.today-sug-icon-btn:hover,
.today-sug-icon-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.today-sug-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  border: 1.5px solid var(--card);
}
.today-sug-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, 88vw);
  max-height: 400px;
  overflow-y: auto;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-pop);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.today-sug-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text);
}
.today-sug-attention {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text);
}
.today-sug-att-icon {
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 2px;
}
.today-sug-att-icon .i {
  width: 15px;
  height: 15px;
}
.today-sug-attention div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.today-sug-attention span {
  color: var(--muted);
}
.today-sug-empty {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

/* Shortcuts Modal Tabs & Custom Shortcuts CRUD */
.today-shortcuts-tabs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
}
.today-shortcuts-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.48rem 0.75rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.today-shortcuts-tab .i {
  width: 14px;
  height: 14px;
}
.today-shortcuts-tab.active {
  background: var(--card);
  color: var(--primary-ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.today-custom-sc-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.today-custom-shortcut-form {
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
}
.today-custom-sc-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  font-size: 0.85rem;
}
.today-custom-sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.6rem;
}
.today-custom-sc-grid .form-group {
  margin-bottom: 0;
}
.today-custom-sc-grid label {
  font-size: 0.74rem;
  margin-bottom: 0.22rem;
}
.today-custom-sc-grid input,
.today-custom-sc-grid select {
  min-height: 34px;
  padding: 0.32rem 0.55rem;
  font-size: 0.82rem;
}
.today-custom-sc-submit-cell {
  display: flex;
  align-items: flex-end;
}
.today-custom-sc-submit-cell .btn {
  width: 100%;
  min-height: 34px;
}
.today-custom-shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 240px;
  overflow-y: auto;
}
.today-custom-shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
}
.today-custom-shortcut-row.is-editing {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.today-custom-sc-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
}
.today-custom-sc-code {
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 700;
}
.today-custom-sc-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.today-custom-sc-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.today-custom-sc-empty {
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}
.today-custom-sc-empty code {
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.today-def-sc-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 0.2rem;
}
.today-def-sc-group {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}
.today-def-sc-cat {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.today-def-sc-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.today-def-sc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.48rem 0.68rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
}
.today-def-sc-row.is-customized {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.today-def-sc-label {
  font-size: 0.8rem;
  color: var(--text);
}
.today-sc-preset-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.today-symbol-edit-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.today-symbol-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
.today-symbol-preview code {
  color: var(--primary-ink);
  font-weight: 700;
}

/* Full-page In-Place Task Plan Editor */
.today-task-plan-page {
  width: 100%;
  padding: 1.45rem 1.75rem;
}
.today-task-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}
.today-task-plan-head-left {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}
.today-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.today-companion-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.today-companion-topbar .today-companion-tabs {
  margin-bottom: 0;
}
.today-habit-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.today-habit-chart-card {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--card-2);
}
.today-habit-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.today-habit-chart-tabs {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  gap: 0.2rem;
}
.today-habit-chart-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 7px;
  cursor: pointer;
}
.today-habit-chart-tab.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.today-habit-month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}
.today-habit-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}
.today-habit-month-cell {
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.today-habit-month-cell.is-pad {
  border-color: transparent;
  background: transparent;
}
.today-habit-month-cell.is-done {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.today-habit-month-cell.is-today:not(.is-done) {
  border-color: var(--primary);
  color: var(--primary-ink);
}
.today-habit-month-cell.is-future {
  opacity: 0.45;
}
.today-habit-year-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.4rem;
  align-items: end;
  margin-bottom: 0.9rem;
}
.today-habit-ybar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.today-habit-ybar-num {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  min-height: 14px;
}
.today-habit-ybar-track {
  width: 100%;
  max-width: 24px;
  height: 64px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.today-habit-ybar-fill {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}
.today-habit-ybar-lbl {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
}
.today-habit-heatmap {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 0.35rem 0;
}
.today-habit-heat-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.today-heat-cell {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--card);
  border: 1px solid var(--line);
}
.today-heat-cell.on {
  background: var(--accent);
  border-color: var(--accent);
}
.today-heat-cell.dim {
  opacity: 0.3;
}
.today-filter-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}
.today-time-cue-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.today-time-input-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.7rem;
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted);
  transition: border-color 0.15s, background-color 0.15s;
}
.today-time-input-box:focus-within {
  border-color: var(--primary);
  background: var(--card);
  color: var(--primary-ink);
}
.today-time-input-box .i {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.today-modern-time-input {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  min-height: 36px !important;
  box-shadow: none !important;
  color: var(--text) !important;
  font-weight: 600;
}
.today-goals-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.today-goal-stat-tile {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
}
.today-goal-stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.today-goal-stat-icon .i {
  width: 16px;
  height: 16px;
}
.today-goal-stat-tile strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.15;
  color: var(--text);
}
.today-goal-stat-tile span {
  font-size: 0.74rem;
  color: var(--muted);
}
.today-goal-card-modern {
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
}
.today-goal-card-modern.is-achieved {
  border-color: var(--accent);
}
.today-goal-title-block {
  min-width: 0;
}
.today-goal-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.15rem;
}
.today-goal-pct-pill {
  padding: 0.12rem 0.48rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 0.7rem;
  font-weight: 700;
}
.today-goal-card-modern.is-achieved .today-goal-pct-pill {
  background: var(--accent-soft);
  color: var(--accent);
}
.today-goal-sub {
  font-size: 0.77rem;
  color: var(--muted);
}

/* Google Calendar-style Day Time-Blocking Schedule */
.today-cal-block-bar {
  margin-bottom: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--primary);
  background: var(--card-2);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.today-cal-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
}
.today-cal-block-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.today-cal-block-form input {
  flex: 1;
  min-width: 190px;
}
.today-cal-block-form select {
  width: 90px;
}
.today-cal-assign-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.today-cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (min-width: 860px) {
  .today-cal-layout:has(.today-cal-unscheduled) {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
}
.today-cal-grid {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  overflow: hidden;
}
.today-cal-hours {
  border-right: 1px solid var(--line);
  background: var(--card-2);
}
.today-cal-hour-lbl {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.25rem 0.5rem 0 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}
.today-cal-tracks {
  position: relative;
}
.today-cal-slot-row {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 0.75rem;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s;
}
.today-cal-slot-row:last-of-type {
  border-bottom: none;
}
.today-cal-slot-row:hover,
.today-cal-slot-row.is-selected {
  background: var(--primary-soft);
}
.today-cal-slot-hint {
  opacity: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-ink);
  transition: opacity 0.12s;
}
.today-cal-slot-row:hover .today-cal-slot-hint,
.today-cal-slot-row.is-selected .today-cal-slot-hint {
  opacity: 1;
}
.today-cal-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--danger);
  z-index: 4;
  pointer-events: none;
}
.today-cal-now-dot {
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
.today-cal-event {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--primary);
  background: var(--card);
  background: color-mix(in srgb, var(--primary) 16%, var(--card));
  color: var(--text);
  cursor: grab;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.today-cal-event.prio-1 {
  border-left-color: var(--danger);
  background: var(--card);
  background: color-mix(in srgb, var(--danger) 15%, var(--card));
}
.today-cal-event.prio-3 {
  border-left-color: var(--accent);
  background: var(--card);
  background: color-mix(in srgb, var(--accent) 15%, var(--card));
}
.today-cal-event-title {
  font-size: 0.81rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.today-cal-drop-guide {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  z-index: 6;
  pointer-events: none;
}
.today-cal-drop-guide span {
  position: absolute;
  left: 6px;
  top: -10px;
  padding: 0.08rem 0.42rem;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}
.today-cal-event-unsched {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.today-cal-event-unsched .i {
  width: 12px;
  height: 12px;
}
.today-cal-event-unsched:hover {
  color: var(--danger);
  background: var(--card);
}
.today-cal-unscheduled {
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--card-2);
}
.today-cal-unsched-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-size: 0.84rem;
}
.today-cal-unsched-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.today-cal-unsched-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
}
.today-cal-unsched-title {
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Goals Cards Grid & Goal Notes Detail Screen */
.today-goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}
.today-goal-card-modern {
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.today-goal-card-modern:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.today-goal-card-foot {
  margin-top: 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--primary-ink);
}
.today-goal-notes-card {
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--card-2);
}
.today-goal-notes-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.65rem;
}
.today-task-plan-close {
  flex-shrink: 0;
  margin-left: auto;
}
.today-task-plan-form {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.today-task-plan-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.15rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

/* Organized 3-Line Clamped Note inside Task Card */
.today-task-note-box {
  margin-top: 0.42rem;
  padding: 0.38rem 0.62rem;
  border-left: 2.5px solid var(--primary);
  border-radius: 0 8px 8px 0;
  background: var(--card-2);
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.42;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Quick Add Notes Input */
.today-quick-notes-input {
  width: 100%;
  resize: vertical;
  min-height: 54px;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.45;
  margin-bottom: 0.45rem;
}
.today-quick-notes-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Polished Shortcuts Modal Header & Action Pills */
.today-shortcuts-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.today-sc-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.today-sc-act-btn .i {
  width: 12px;
  height: 12px;
}
.today-sc-act-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.today-sc-act-btn.is-reset:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

/* Today Task Completion & Goal Progress Micro-Animations */
.today-task-row {
  transition: background-color 0.22s ease, border-color 0.22s ease, opacity 0.24s cubic-bezier(0.4, 0, 0.2, 1), transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}
.tree-checkbox.is-bursting::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 10px;
  border: 2px solid var(--success);
  opacity: 0;
  pointer-events: none;
  animation: todayCheckBurst 0.44s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.today-task-row.is-completing {
  background: color-mix(in srgb, var(--success) 9%, transparent);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
  pointer-events: none;
}
.today-task-row.is-completing .todo-title-line strong {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--success) 65%, var(--muted));
  transition: color 0.2s ease;
}
.today-task-row.is-completing-exit {
  opacity: 0;
  transform: translateY(6px) scale(0.985);
}
.today-task-row.is-just-completed {
  animation: todayRowEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.today-badge-ok.is-pulsing {
  animation: todayPillBump 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.today-ring-pct.is-pct-bump,
.today-goal-pct-pill.is-pct-bump {
  animation: todayPillBump 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
.today-goal-card-modern {
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.today-goal-card-modern.is-goal-updating {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}
.today-goal-card-modern.is-achieved.is-goal-updating {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent);
}
.today-goal-btns {
  position: relative;
}
.today-goal-delta-pop {
  position: absolute;
  top: -10px;
  right: 26px;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
  pointer-events: none;
  z-index: 4;
  animation: todayDeltaFloat 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.today-goal-delta-pop.is-positive {
  background: var(--primary-soft);
  color: var(--primary-ink);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
}
.today-goal-delta-pop.is-negative {
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--line-strong);
}

@keyframes todayCheckBurst {
  0% { opacity: 0.85; transform: scale(0.85); }
  100% { opacity: 0; transform: scale(1.55); }
}
@keyframes todayRowEnter {
  0% { opacity: 0; transform: translateY(-5px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes todayPillBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes todayDeltaFloat {
  0% { opacity: 0; transform: translateY(4px) scale(0.85); }
  22% { opacity: 1; transform: translateY(-2px) scale(1); }
  100% { opacity: 0; transform: translateY(-13px) scale(0.96); }
}

@media (prefers-reduced-motion: reduce) {
  .tree-checkbox.is-bursting::after,
  .today-task-row.is-just-completed,
  .today-badge-ok.is-pulsing,
  .today-ring-pct.is-pct-bump,
  .today-goal-pct-pill.is-pct-bump,
  .today-goal-delta-pop {
    animation: none !important;
  }
}

/* Account Section Clean Layout */
.account-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.15rem 1.25rem;
}
.account-header-user {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
}
.account-header-meta h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.account-header-email {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.account-header-pills {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.45rem;
}
.account-tabs {
  max-width: 540px;
}
.account-section-card {
  max-width: 680px;
}
.account-control-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.account-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
}
.account-control-row.is-danger {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
}
.account-control-copy strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
}
.account-control-copy span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* Expired Trial Lockout Screen */
body.is-trial-locked .sidebar-nav,
body.is-trial-locked .mobile-bottom-nav {
  display: none !important;
}
.lockout-shell {
  max-width: 920px;
  margin: 1rem auto 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.lockout-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 1.5rem 1.6rem;
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}
.lockout-hero-main {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex: 1;
  min-width: 240px;
}
.lockout-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--danger-soft);
  color: var(--danger);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lockout-icon-badge .i {
  width: 22px;
  height: 22px;
}
.lockout-hero-main h2 {
  margin: 0.35rem 0 0.35rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.lockout-hero-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  max-width: 56ch;
}

/* ==========================================================================
   Mobile & Narrow-Viewport Polish (Strictly scoped; Desktop/Laptop untouched)
   ========================================================================== */
@media (max-width: 899px) {
  .mobile-bottom-nav {
    background: color-mix(in srgb, var(--surface) 94%, transparent);
  }
  .mob-nav-item small {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .route-container {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
  }
  .toast-container {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 759px) {
  .today-hero {
    padding: 1rem 1.05rem;
    gap: 0.85rem;
  }
  .today-hero-right {
    gap: 0.65rem 1rem;
  }
  .today-focus-popover {
    max-width: calc(100vw - 2.5rem);
  }
}

@media (max-width: 719px) {
  .pricing-grid {
    gap: 1.25rem;
  }
  .price-card.popular {
    margin-top: 0.45rem;
  }
  #syllabusSummaryHeader .stat-grid .card.mini-ring-card {
    padding: 0.78rem 0.95rem;
    gap: 0.8rem;
  }
  #syllabusSummaryHeader .stat-grid .circular-chart {
    width: 46px;
    height: 46px;
  }
  #syllabusSummaryHeader .stat-card-lg {
    padding: 0.78rem 0.95rem;
  }
}

@media (max-width: 639px) {
  /* Prevent multi-tab segmented controls from overflowing or blowing out viewport width */
  .segmented,
  .auth-tabs {
    grid-auto-columns: minmax(0, 1fr);
    max-width: 100%;
    width: 100%;
  }
  .seg-btn,
  .auth-tab {
    min-width: 0;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
    padding: 0.44rem 0.4rem;
    font-size: 0.76rem;
    gap: 0.28rem;
  }
  .seg-btn .i,
  .auth-tab .i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }

  /* Keep modal & drawer headers aligned with close button on top-right */
  .pt-modal-card .card-head,
  .modal-card .card-head,
  .todo-composer .card-head,
  .today-composer-modal .card-head,
  .today-shortcuts-head {
    flex-wrap: nowrap;
    align-items: flex-start;
  }
  .pt-modal-card .card-head > div:first-child,
  .modal-card .card-head > div:first-child,
  .todo-composer .card-head > div:first-child,
  .today-composer-modal .card-head > div:first-child,
  .today-shortcuts-head > div:first-child {
    flex: 1;
    min-width: 0;
  }
  .pt-modal-card .card-head .icon-btn,
  .modal-card .card-head .icon-btn,
  .todo-composer .card-head .icon-btn,
  .today-composer-modal .card-head .icon-btn,
  .today-shortcuts-head .icon-btn {
    flex-shrink: 0;
  }

  /* Today Workspace Mobile Polish */
  .today-panel {
    padding: 0.95rem;
  }
  .today-toolbar {
    gap: 0.5rem;
  }
  .today-view-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.2rem;
    overflow: visible;
  }
  .today-view-tab {
    justify-content: center;
    padding: 0.34rem 0.2rem;
    font-size: 0.74rem;
    gap: 0.2rem;
    min-width: 0;
  }
  .today-toolbar-right {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }
  .today-toolbar-btn {
    justify-content: center;
    padding: 0.36rem 0.35rem;
    font-size: 0.75rem;
    min-width: 0;
  }
  .today-cue-drawer-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }
  .today-cue-drawer-row > input,
  .today-cue-drawer-row > select {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 38px;
  }

  /* Give task titles full width and place row action buttons on a clean bottom strip */
  .today-task-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    column-gap: 0.65rem;
    row-gap: 0.45rem;
    padding: 0.75rem 0.7rem;
  }
  .today-task-row .tree-checkbox {
    grid-column: 1;
    grid-row: 1;
  }
  .today-task-row .todo-main {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }
  .today-task-row .today-row-actions {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--line);
  }
  .today-task-row .today-row-actions .todo-delete-btn {
    margin-left: auto;
  }
  .today-task-row .today-link-pill span {
    display: inline;
  }
  .today-task-row .today-link-pill {
    padding: 0.26rem 0.58rem;
  }

  .today-rev-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }
  .today-rev-btn {
    justify-content: center;
  }
  .today-filter-popover,
  .today-sug-popover {
    width: min(340px, calc(100vw - 2.4rem));
    right: 0;
  }
  .today-task-plan-page {
    padding: 1rem;
  }
  .today-task-plan-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  .today-cal-grid {
    grid-template-columns: 46px minmax(0, 1fr);
  }
  .today-cal-hour-lbl {
    font-size: 0.64rem;
    padding-right: 0.35rem;
  }
  .today-cal-block-form input,
  #calAskTimeInput {
    min-width: 0 !important;
    max-width: none !important;
  }
  .today-companion-topbar {
    gap: 0.5rem;
  }
  .today-habit-bottom {
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  .today-def-sc-row,
  .today-custom-shortcut-row {
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  /* Syllabus Mobile Polish */
  .tree-expand-btn::before,
  .tree-checkbox::before {
    inset: -5px;
  }
  .heatmap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  /* Account & Billing Mobile Polish */
  .account-header-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }
  #headerSignOutBtn,
  #billingSignOutBtn {
    width: 100%;
    justify-content: center;
  }
  .account-control-row {
    gap: 0.65rem;
    padding: 0.85rem;
  }

  /* Mocks & Rank Mobile Polish */
  .mock-row {
    gap: 0.65rem;
    padding: 0.75rem;
  }
  .mock-score-pill {
    min-width: 58px;
    padding: 0.4rem 0.45rem;
  }
  .rank-hero-card {
    padding: 1.05rem;
  }
  .rank-hero-rings-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }
  .ring-card-clean {
    padding: 0.65rem 0.7rem;
    gap: 0.55rem;
  }
  .ring-card-clean .circular-chart {
    width: 42px;
    height: 42px;
  }
  .ring-card-clean .ring-meta strong {
    font-size: 1.12rem;
  }
  .ring-card-clean .ring-meta span {
    font-size: 0.68rem;
    white-space: normal;
    line-height: 1.2;
  }
}

@media (max-width: 559px) {
  .pt-modal-backdrop {
    padding: 0.75rem;
  }
  .pt-modal-card {
    max-height: 88dvh;
    overflow-y: auto;
    padding: 1.15rem;
  }
}

@media (max-width: 479px) {
  /* Quick-add omnibar: 2 clean rows so placeholder & typing never truncate */
  .today-quick-add {
    flex-wrap: wrap;
    padding: 0.45rem 0.55rem;
    gap: 0.35rem;
  }
  .today-quick-input {
    flex: 1 1 calc(100% - 26px);
  }
  .today-quick-controls {
    width: 100%;
    justify-content: flex-end;
    padding-top: 0.32rem;
    border-top: 1px solid var(--line);
  }
  .today-quick-prio-btn {
    margin-right: auto;
    padding: 0 0.45rem;
  }
  .today-quick-prio-label {
    display: inline;
  }
  .today-carry-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }
  .today-habit-year-bars {
    gap: 0.18rem;
  }
  .today-habit-ybar-lbl {
    font-size: 0.58rem;
  }
  .today-habit-month-cell {
    height: 28px;
    font-size: 0.72rem;
  }
  .quick-Command-strip .stat-pill-meta strong small {
    display: block;
    margin-top: 0.15rem;
  }
  .coupon-input-row {
    flex-wrap: wrap;
  }
  .coupon-input-row input {
    flex: 1 1 160px;
    min-width: 0;
  }
  .coupon-callout {
    flex-direction: column;
    text-align: center;
  }
  .hist-count {
    font-size: 0.52rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 349px) {
  .rank-hero-rings-row {
    grid-template-columns: 1fr;
  }
}
