:root {
  --bg: #f4f5f9;
  --bg-elevated: #eef0f6;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #f0f2f8;
  --text: #17192b;
  --text-soft: #44485f;
  --muted: #777c92;
  --border: #e2e5ef;
  --border-strong: #d4d8e6;
  --primary: #6758f3;
  --primary-strong: #5142dd;
  --primary-soft: #eeecff;
  --accent: #12a28a;
  --accent-soft: #e6f8f4;
  --danger: #cc425a;
  --danger-soft: #fdebef;
  --warning: #b86b12;
  --warning-soft: #fff1dd;
  --success: #17835f;
  --success-soft: #e7f6ef;
  --navy: #15172b;
  --navy-2: #202440;
  --shadow-1: 0 6px 22px rgba(24, 29, 61, .055);
  --shadow-2: 0 18px 50px rgba(24, 29, 61, .11);
  --shadow-3: 0 28px 80px rgba(16, 19, 42, .2);
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --sidebar: 264px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #10121f;
  --bg-elevated: #171a2b;
  --surface: #191c2e;
  --surface-2: #202337;
  --surface-3: #25293e;
  --text: #f5f5fb;
  --text-soft: #c6c9d9;
  --muted: #9297ad;
  --border: #2c3046;
  --border-strong: #3a3f59;
  --primary: #887bff;
  --primary-strong: #a79eff;
  --primary-soft: #2b2851;
  --accent: #3bc5ae;
  --accent-soft: #183c38;
  --danger: #ff758a;
  --danger-soft: #4b2630;
  --warning: #f0a54d;
  --warning-soft: #49341f;
  --success: #4fd3a1;
  --success-soft: #1e4136;
  --navy: #0c0e18;
  --navy-2: #171a2c;
  --shadow-1: 0 8px 24px rgba(0, 0, 0, .2);
  --shadow-2: 0 22px 54px rgba(0, 0, 0, .3);
  --shadow-3: 0 32px 90px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 88% -12%, rgba(103, 88, 243, .08), transparent 32%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { max-width: 100%; }
::selection { background: rgba(103, 88, 243, .22); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.icon { width: 20px; height: 20px; display: inline-grid; place-items: center; flex: 0 0 auto; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon.xs { width: 14px; height: 14px; }
.icon.sm { width: 17px; height: 17px; }
.icon.lg { width: 24px; height: 24px; }

.app-shell { min-height: 100dvh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  z-index: 50;
  padding: calc(24px + var(--safe-top)) 18px calc(18px + var(--safe-bottom));
  color: white;
  background:
    radial-gradient(circle at 20% 8%, rgba(119, 103, 255, .3), transparent 31%),
    linear-gradient(165deg, var(--navy-2), var(--navy) 56%);
  border-right: 1px solid rgba(255,255,255,.05);
  display: flex;
  flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #897dff, #5d4ae9);
  box-shadow: 0 12px 28px rgba(83, 66, 224, .34), inset 0 1px rgba(255,255,255,.24);
  font-weight: 900;
  letter-spacing: -.05em;
}
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 16px; letter-spacing: -.02em; }
.brand-copy span { display: block; margin-top: 2px; color: rgba(255,255,255,.48); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand { padding: 0 9px 24px; }

.sidebar-capture {
  width: 100%;
  border: 1px solid rgba(255,255,255,.11);
  background: rgba(255,255,255,.09);
  color: white;
  min-height: 48px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 780;
  margin-bottom: 22px;
  transition: background .16s, transform .16s;
}
.sidebar-capture:hover { background: rgba(255,255,255,.14); }
.sidebar-capture:active { transform: scale(.985); }

.nav-group { display: grid; gap: 5px; }
.nav-caption { padding: 0 12px 7px; color: rgba(255,255,255,.33); text-transform: uppercase; letter-spacing: .13em; font-size: 9px; font-weight: 850; }
.nav-item {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 13px;
  padding: 10px 12px;
  background: transparent;
  color: rgba(255,255,255,.64);
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  font-weight: 680;
  transition: color .15s, background .15s;
}
.nav-item:hover { color: white; background: rgba(255,255,255,.065); }
.nav-item.active { color: white; background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.nav-count { margin-left: auto; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; background: rgba(255,255,255,.09); font-size: 10px; }
.sidebar-foot { margin-top: auto; }
.local-data-card {
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.055);
  border-radius: 16px;
  padding: 13px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
}
.local-data-card > .icon-wrap { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(87, 220, 181, .13); color: #71e0bd; }
.local-data-card strong { display: block; font-size: 11px; }
.local-data-card span { display: block; margin-top: 2px; color: rgba(255,255,255,.42); font-size: 9px; line-height: 1.35; }
.profile-mini { display: flex; align-items: center; gap: 10px; padding: 17px 8px 0; }
.avatar { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(145deg, #8175ff, #5947e0); color: white; font-weight: 850; box-shadow: inset 0 1px rgba(255,255,255,.2); }
.profile-mini strong, .profile-mini span { display: block; }
.profile-mini strong { font-size: 12px; }
.profile-mini span { margin-top: 2px; color: rgba(255,255,255,.4); font-size: 9px; }

.main { min-height: 100dvh; margin-left: var(--sidebar); }
.topbar {
  height: 74px;
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 0 clamp(24px, 4vw, 50px);
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  gap: 14px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.mobile-logo { display: none; }
.search-box { position: relative; width: min(540px, 48vw); }
.search-box > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-input {
  width: 100%;
  height: 43px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 0 42px 0 42px;
  outline: 0;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-input:focus { border-color: color-mix(in srgb, var(--primary) 52%, var(--border)); box-shadow: 0 0 0 4px rgba(103,88,243,.1); background: var(--surface); }
.clear-search { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.save-chip {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.save-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 14%, transparent); }

.page { padding: clamp(24px, 4vw, 50px); padding-bottom: calc(110px + var(--safe-bottom)); }
.page-narrow { max-width: 1040px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.eyebrow { color: var(--primary); font-size: 10px; font-weight: 880; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 8px; }
.page-title { margin: 0; font-size: clamp(31px, 4vw, 46px); line-height: 1.04; letter-spacing: -.055em; }
.page-subtitle { max-width: 720px; margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.btn {
  border: 0;
  border-radius: 13px;
  min-height: 42px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 760;
  line-height: 1;
  text-decoration: none;
  transition: transform .14s, background .14s, border-color .14s, box-shadow .14s, opacity .14s;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { color: white; background: linear-gradient(145deg, #7568fa, var(--primary-strong)); box-shadow: 0 10px 25px rgba(81,66,221,.2); }
.btn-primary:hover { box-shadow: 0 13px 28px rgba(81,66,221,.28); }
.btn-secondary { color: var(--primary-strong); background: var(--primary-soft); }
.btn-accent { color: white; background: linear-gradient(145deg, #1bb79d, #108a77); box-shadow: 0 10px 22px rgba(16,138,119,.18); }
.btn-outline { color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.btn-ghost { color: var(--muted); background: transparent; }
.btn-danger { color: var(--danger); background: var(--danger-soft); }
.btn-sm { min-height: 34px; padding: 7px 10px; border-radius: 10px; font-size: 11px; }
.btn-lg { min-height: 50px; padding: 12px 19px; border-radius: 15px; }
.btn-icon { width: 42px; height: 42px; padding: 0; flex: 0 0 auto; }
.btn-icon.sm { width: 34px; height: 34px; border-radius: 10px; }
.btn-block { width: 100%; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 16px; margin-bottom: 18px; }
.welcome-card {
  min-height: 250px;
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 38px);
  position: relative;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 85% 10%, rgba(255,255,255,.16), transparent 25%),
    radial-gradient(circle at 10% 105%, rgba(43, 209, 171, .18), transparent 38%),
    linear-gradient(145deg, #202443, #15172b 65%);
  box-shadow: var(--shadow-2);
}
.welcome-card::after { content: ""; position: absolute; width: 220px; height: 220px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; right: -72px; bottom: -116px; box-shadow: 0 0 0 38px rgba(255,255,255,.025), 0 0 0 76px rgba(255,255,255,.018); }
.welcome-card > * { position: relative; z-index: 2; }
.welcome-kicker { display: inline-flex; align-items: center; gap: 7px; color: rgba(255,255,255,.62); font-size: 11px; font-weight: 700; }
.welcome-card h1 { max-width: 620px; margin: 17px 0 10px; font-size: clamp(32px, 5vw, 53px); line-height: 1.02; letter-spacing: -.057em; }
.welcome-card p { max-width: 610px; margin: 0; color: rgba(255,255,255,.64); line-height: 1.6; font-size: 14px; }
.welcome-actions { display: flex; gap: 9px; margin-top: 24px; flex-wrap: wrap; }
.welcome-actions .btn-outline { color: white; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.11); }

.quick-capture-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 21px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; }
.quick-capture-head { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.quick-capture-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.quick-capture-head strong { display: block; font-size: 15px; }
.quick-capture-head span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.quick-capture-form { display: grid; gap: 10px; margin-top: auto; }
.quick-capture-input { min-height: 92px !important; resize: none !important; }



/* Nexo 7 — captura por voz e revisão estruturada */
button, a, input, select, textarea { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 36%, transparent);
  outline-offset: 2px;
}
.quick-capture-head { position: relative; }
.local-ai-badge {
  margin-left: auto;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex !important;
  align-items: center;
  color: var(--success) !important;
  background: var(--success-soft);
  font-size: 8px !important;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.quick-capture-actions { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; }
.capture-privacy { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.capture-privacy .icon { color: var(--success); }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field-label-row > label { color: var(--text-soft); font-size: 10px; font-weight: 780; }
.inline-dictation {
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 9px;
  font-weight: 800;
}
.inline-dictation.recording { color: white; background: var(--danger); border-color: var(--danger); animation: voice-pulse 1.2s ease-in-out infinite; }
.character-count { color: var(--muted); font-size: 8px; }
.voice-capture-shell {
  min-height: 176px;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 20px;
  padding: 22px;
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 22px;
  align-items: center;
  background:
    radial-gradient(circle at 12% 20%, color-mix(in srgb, var(--primary) 13%, transparent), transparent 37%),
    linear-gradient(145deg, color-mix(in srgb, var(--primary) 4%, var(--surface)), var(--surface));
  overflow: hidden;
}
.voice-visual { position: relative; width: 112px; height: 112px; display: grid; place-items: center; }
.voice-rings, .voice-rings::before, .voice-rings::after {
  position: absolute;
  inset: 0;
  content: "";
  border: 1px solid color-mix(in srgb, var(--primary) 24%, transparent);
  border-radius: 50%;
}
.voice-rings::before { inset: 13px; }
.voice-rings::after { inset: 27px; }
.voice-orb {
  position: relative;
  z-index: 2;
  width: 56px;
  height: 56px;
  border-radius: 19px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #8174ff, #5040d7);
  box-shadow: 0 15px 30px rgba(80,64,215,.28), inset 0 1px rgba(255,255,255,.25);
}
.voice-visual.recording .voice-orb { background: linear-gradient(145deg, #e95d73, #b9324b); animation: voice-pulse .95s ease-in-out infinite; }
.voice-visual.recording .voice-rings { animation: voice-ring 1.5s ease-out infinite; }
.voice-copy strong { display: block; font-size: 17px; letter-spacing: -.025em; }
.voice-copy span { display: block; margin-top: 7px; max-width: 520px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.voice-text-field { margin-top: 16px; }
.voice-text-field textarea { min-height: 170px; font-size: 15px; line-height: 1.6; }
.voice-help-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin-top: 12px; }
.voice-help-item { padding: 11px; border: 1px solid var(--border); border-radius: 13px; display: grid; grid-template-columns: 30px 1fr; gap: 9px; align-items: center; background: var(--surface-2); color: var(--primary); }
.voice-help-item > span { color: var(--muted); font-size: 8px; line-height: 1.4; }
.voice-help-item strong { display: block; margin-bottom: 2px; color: var(--text); font-size: 9px; }
#voice-listen.recording { color: white; background: var(--danger); border-color: var(--danger); }
.local-structure-banner { margin-bottom: 16px; padding: 13px; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); border-radius: 15px; display: grid; grid-template-columns: 39px 1fr; gap: 11px; align-items: start; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.local-structure-icon { width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #24b89f, #118876); }
.local-structure-banner strong { display: block; font-size: 11px; }
.local-structure-banner p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.structured-task-list { display: grid; gap: 8px; }
.structured-task-row { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center; padding: 7px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.structured-task-row > input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); }
.structured-task-row .input { min-height: 39px; padding: 8px 10px; background: var(--surface); }
@keyframes voice-pulse { 0%,100% { transform: scale(1); box-shadow: 0 12px 26px rgba(185,50,75,.22); } 50% { transform: scale(1.045); box-shadow: 0 16px 34px rgba(185,50,75,.34); } }
@keyframes voice-ring { 0% { transform: scale(.83); opacity: .9; } 100% { transform: scale(1.16); opacity: 0; } }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 17px; box-shadow: var(--shadow-1); }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 780; }
.metric-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.metric-value { margin-top: 13px; font-size: 28px; line-height: 1; letter-spacing: -.045em; font-weight: 880; }
.metric-note { margin-top: 6px; color: var(--muted); font-size: 10px; }

.section { margin-top: 26px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.section-head h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.section-actions { display: flex; align-items: center; gap: 7px; }

.toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); background: var(--surface); border-radius: 13px; overflow: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { min-height: 34px; padding: 7px 11px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; white-space: nowrap; font-size: 10px; font-weight: 800; }
.segmented button.active { color: var(--primary-strong); background: var(--primary-soft); }
.select { min-height: 42px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 0 36px 0 12px; outline: none; }
.toolbar-spacer { flex: 1; }
.view-toggle { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.view-toggle .btn-icon { width: 34px; height: 34px; border-radius: 9px; color: var(--muted); }
.view-toggle .btn-icon.active { color: var(--primary); background: var(--primary-soft); }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.project-grid.list { grid-template-columns: 1fr; }
.project-card {
  --project-color: var(--primary);
  min-height: 270px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.project-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--project-color), color-mix(in srgb, var(--project-color) 55%, white)); }
.project-card::after { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; right: -80px; top: -86px; background: color-mix(in srgb, var(--project-color) 5%, transparent); pointer-events: none; }
.project-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--project-color) 22%, var(--border)); box-shadow: var(--shadow-2); }
.project-card:active { transform: scale(.995); }
.card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; position: relative; z-index: 1; }
.status-badge, .priority-badge { min-height: 26px; padding: 0 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font-size: 9px; font-weight: 850; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.idea { color: #6655ef; background: #eeebff; }
.status-badge.study { color: #2672bd; background: #e6f2ff; }
.status-badge.planning { color: #9a5b12; background: #fff0da; }
.status-badge.production { color: #8748a9; background: #f5e9fb; }
.status-badge.testing { color: #157f78; background: #e7f7f5; }
.status-badge.waiting { color: #6d7184; background: #eef0f4; }
.status-badge.completed { color: #147957; background: #e4f5ed; }
.status-badge.archived { color: #6c7080; background: #e9ebef; }
[data-theme="dark"] .status-badge { filter: saturate(.8) brightness(.84); }
.priority-badge { margin-left: auto; color: var(--muted); background: var(--surface-3); }
.priority-badge.urgent { color: var(--danger); background: var(--danger-soft); }
.priority-badge.high { color: var(--warning); background: var(--warning-soft); }
.card-menu { width: 31px !important; height: 31px !important; }
.project-title { margin: 0; font-size: 18px; line-height: 1.25; letter-spacing: -.028em; position: relative; z-index: 1; }
.project-desc { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.52; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; position: relative; z-index: 1; }
.project-objective { margin: 10px 0 0; padding: 9px 10px; border-radius: 11px; background: var(--surface-2); color: var(--text-soft); font-size: 10px; line-height: 1.45; }
.card-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 13px; }
.tag { min-height: 23px; padding: 0 7px; border-radius: 7px; display: inline-flex; align-items: center; background: var(--surface-3); color: var(--muted); font-size: 8px; font-weight: 780; }
.card-bottom { margin-top: auto; padding-top: 18px; }
.card-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; margin-bottom: 7px; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.progress-fill { height: 100%; border-radius: inherit; background: var(--project-color); transition: width .25s ease; }
.card-meta { display: flex; align-items: center; gap: 11px; margin-top: 13px; color: var(--muted); font-size: 9px; }
.card-meta span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.card-meta .updated { margin-left: auto; }
.project-grid.list .project-card { min-height: 0; display: grid; grid-template-columns: minmax(230px, 1.1fr) minmax(180px, .8fr) minmax(210px, .8fr); align-items: center; gap: 18px; }
.project-grid.list .card-top { margin: 0 0 9px; }
.project-grid.list .project-desc { -webkit-line-clamp: 2; }
.project-grid.list .card-tags { margin-top: 9px; }
.project-grid.list .card-bottom { margin: 0; padding: 0; }

.empty-state { grid-column: 1 / -1; padding: 58px 22px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); }
.empty-icon { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 19px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.empty-state h3 { margin: 0; font-size: 18px; }
.empty-state p { max-width: 470px; margin: 8px auto 18px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.detail-topbar { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.detail-hero {
  --project-color: var(--primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(21px, 4vw, 33px);
  background:
    radial-gradient(circle at 96% 3%, color-mix(in srgb, var(--project-color) 10%, transparent), transparent 27%),
    var(--surface);
  box-shadow: var(--shadow-1);
  margin-bottom: 15px;
}
.detail-hero-top { display: flex; align-items: flex-start; gap: 14px; }
.detail-color { width: 10px; min-height: 52px; border-radius: 999px; background: var(--project-color); flex: 0 0 auto; }
.detail-heading { min-width: 0; flex: 1; }
.detail-heading h1 { margin: 0; font-size: clamp(28px, 4vw, 43px); line-height: 1.06; letter-spacing: -.052em; overflow-wrap: anywhere; }
.detail-heading p { max-width: 850px; margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.detail-actions { margin-left: auto; display: flex; gap: 7px; }
.detail-chips { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 17px; }
.detail-chip { min-height: 30px; padding: 0 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-soft); display: inline-flex; align-items: center; gap: 6px; font-size: 9px; font-weight: 760; }
.objective-card { margin-top: 18px; padding: 14px 15px; border: 1px solid color-mix(in srgb, var(--project-color) 17%, var(--border)); border-radius: 14px; background: color-mix(in srgb, var(--project-color) 5%, var(--surface)); }
.objective-card strong { display: block; color: var(--project-color); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.objective-card p { margin: 7px 0 0; font-size: 12px; line-height: 1.55; }

.pipeline-wrap { margin: 15px 0; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); padding: 14px; box-shadow: var(--shadow-1); }
.pipeline { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 1px; }
.pipeline::-webkit-scrollbar { display: none; }
.pipeline-step { min-width: 112px; min-height: 56px; border: 1px solid var(--border); border-radius: 12px; padding: 9px; background: var(--surface-2); color: var(--muted); display: grid; gap: 4px; text-align: left; }
.pipeline-step strong { font-size: 9px; }
.pipeline-step span { font-size: 8px; opacity: .8; }
.pipeline-step.done { color: var(--success); border-color: color-mix(in srgb, var(--success) 20%, var(--border)); background: var(--success-soft); }
.pipeline-step.active { color: var(--primary-strong); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 10%, transparent); }

.focus-card { margin-bottom: 15px; border-radius: var(--radius-md); padding: 17px; color: white; background: linear-gradient(135deg, #6558ed, #4c3ed0); box-shadow: 0 16px 36px rgba(81,66,221,.18); display: grid; grid-template-columns: 42px 1fr auto; gap: 13px; align-items: center; }
.focus-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.13); }
.focus-card strong { display: block; font-size: 12px; }
.focus-card p { margin: 4px 0 0; color: rgba(255,255,255,.72); font-size: 10px; line-height: 1.4; }
.focus-card .btn { color: white; background: rgba(255,255,255,.12); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .72fr); gap: 15px; align-items: start; }
.detail-column { display: grid; gap: 15px; }
.panel { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden; }
.panel-head { min-height: 59px; padding: 14px 17px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.panel-title .panel-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.panel-title h2, .panel-title h3 { margin: 0; font-size: 14px; letter-spacing: -.015em; }
.panel-title span { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.panel-body { padding: 17px; }
.panel-body.flush { padding: 0; }
.panel-actions { display: flex; align-items: center; gap: 5px; }

.task-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 13px; }
.task-summary-item { padding: 10px; border-radius: 12px; background: var(--surface-2); text-align: center; }
.task-summary-item strong { display: block; font-size: 18px; letter-spacing: -.04em; }
.task-summary-item span { color: var(--muted); font-size: 8px; }
.task-list { display: grid; gap: 8px; }
.task-item { min-height: 58px; border: 1px solid var(--border); border-radius: 13px; padding: 10px; display: flex; align-items: flex-start; gap: 10px; background: var(--surface); }
.task-item.doing { border-color: color-mix(in srgb, var(--primary) 22%, var(--border)); background: color-mix(in srgb, var(--primary) 3%, var(--surface)); }
.task-item.done { opacity: .72; }
.task-check { width: 25px; height: 25px; border-radius: 8px; border: 1.5px solid var(--border-strong); background: var(--surface); color: white; padding: 0; display: grid; place-items: center; flex: 0 0 auto; }
.task-item.doing .task-check { border-color: var(--primary); box-shadow: inset 0 0 0 5px var(--primary-soft); }
.task-item.done .task-check { border-color: var(--success); background: var(--success); }
.task-main { min-width: 0; flex: 1; }
.task-title { font-size: 12px; line-height: 1.45; font-weight: 730; overflow-wrap: anywhere; }
.task-item.done .task-title { color: var(--muted); text-decoration: line-through; }
.task-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; color: var(--muted); font-size: 8px; }
.task-actions { display: flex; align-items: center; gap: 2px; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.inline-form .input { min-width: 0; }

.reference-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.reference-card { min-width: 0; border: 1px solid var(--border); border-radius: 14px; padding: 11px; background: var(--surface); display: grid; grid-template-columns: 39px 1fr auto; gap: 10px; align-items: center; }
.reference-icon { width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.reference-main { min-width: 0; }
.reference-main strong, .reference-main span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.reference-main strong { font-size: 10px; }
.reference-main span { margin-top: 3px; color: var(--muted); font-size: 8px; }
.reference-note { margin-top: 6px !important; color: var(--text-soft) !important; white-space: normal !important; display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.reference-actions { display: flex; flex-direction: column; gap: 3px; }

.timeline { display: grid; }
.timeline-item { position: relative; padding: 0 0 17px 27px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: 8px; top: 17px; bottom: 0; width: 1px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: absolute; left: 3px; top: 3px; width: 11px; height: 11px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline-card { padding: 11px 12px; border-radius: 13px; background: var(--surface-2); }
.timeline-card p { margin: 0; white-space: pre-wrap; font-size: 10px; line-height: 1.55; }
.timeline-card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; color: var(--muted); font-size: 8px; }

.info-list { display: grid; gap: 11px; }
.info-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 11px; }
.info-row span { color: var(--muted); }
.info-row strong { text-align: right; }
.progress-editor { display: grid; gap: 8px; }
.progress-editor input[type="range"] { width: 100%; accent-color: var(--primary); }
.progress-head { display: flex; align-items: center; justify-content: space-between; font-size: 10px; }

.ai-card { border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border)); background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 5%, var(--surface)), var(--surface)); }
.ai-card .panel-icon { color: white; background: linear-gradient(145deg, #786bfa, #5444df); box-shadow: 0 8px 20px rgba(84,68,223,.2); }
.ai-actions { display: grid; gap: 8px; }
.ai-action { width: 100%; min-height: 58px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); display: grid; grid-template-columns: 35px 1fr auto; gap: 10px; align-items: center; text-align: left; }
.ai-action:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.ai-action-icon { width: 35px; height: 35px; border-radius: 11px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.ai-action strong { display: block; font-size: 11px; }
.ai-action span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.presentation-box { max-height: 300px; overflow: auto; white-space: pre-wrap; padding: 13px; border-radius: 13px; background: var(--surface-2); color: var(--text-soft); font-size: 10px; line-height: 1.6; }

.review-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.review-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); padding: 18px; box-shadow: var(--shadow-1); }
.review-card .review-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.review-card h3 { margin: 14px 0 6px; font-size: 15px; }
.review-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.review-list { display: grid; gap: 8px; margin-top: 14px; }
.review-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--surface-2); }
.review-item strong { display: block; font-size: 10px; }
.review-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.setting-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); padding: 18px; box-shadow: var(--shadow-1); }
.setting-card h3 { margin: 0; font-size: 15px; }
.setting-card > p { margin: 7px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.setting-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.appearance-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.appearance-option { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--surface-2); text-align: center; color: var(--muted); font-size: 9px; font-weight: 760; }
.appearance-option.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.storage-meter { margin-top: 12px; }
.storage-meter-head { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 8px; margin-bottom: 6px; }

.form-grid { display: grid; gap: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.three { grid-template-columns: repeat(3,1fr); }
.field { display: grid; gap: 6px; }
.field > label { color: var(--text-soft); font-size: 11px; font-weight: 780; }
.field-hint { color: var(--muted); font-size: 9px; line-height: 1.45; }
.input, .field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  padding: 11px 12px;
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.field input, .field select { min-height: 43px; }
.field textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); box-shadow: 0 0 0 4px rgba(103,88,243,.1); }
.color-options { display: flex; gap: 8px; flex-wrap: wrap; }
.color-option { width: 30px; height: 30px; border-radius: 10px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); padding: 0; background: var(--color); }
.color-option.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--color); }
.range-field { display: grid; gap: 7px; }
.range-field input { width: 100%; accent-color: var(--primary); }
.range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 20px; display: grid; place-items: center; background: rgba(10, 12, 27, .58); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade-in .15s ease-out; }
.modal { width: min(100%, 650px); max-height: min(90dvh, 860px); border: 1px solid color-mix(in srgb, var(--border) 72%, transparent); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-3); overflow: hidden; display: flex; flex-direction: column; animation: modal-in .18s ease-out; }
.modal.wide { width: min(100%, 900px); }
.modal-head { min-height: 65px; padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.modal-title > .icon-wrap { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.modal-title h2 { margin: 0; font-size: 16px; }
.modal-title span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.modal-body { padding: 18px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot { min-height: 64px; padding: 11px 18px calc(11px + var(--safe-bottom)); border-top: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.modal-foot .spacer { flex: 1; }
.confirm-box { text-align: center; padding: 8px 0; }
.confirm-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center; color: var(--danger); background: var(--danger-soft); }
.confirm-box h3 { margin: 0; font-size: 19px; }
.confirm-box p { max-width: 470px; margin: 9px auto 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.ai-flow { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.ai-flow-step { padding: 11px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }
.ai-flow-step > span { width: 27px; height: 27px; border-radius: 9px; display: grid; place-items: center; color: white; background: var(--primary); font-size: 10px; font-weight: 850; }
.ai-flow-step strong { display: block; margin-top: 8px; font-size: 9px; }
.ai-flow-step p { margin: 4px 0 0; color: var(--muted); font-size: 8px; line-height: 1.4; }
.help-card { padding: 13px; border: 1px solid color-mix(in srgb, var(--primary) 17%, var(--border)); border-radius: 13px; background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.help-card strong { display: block; font-size: 10px; }
.help-card p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.code-area { min-height: 300px !important; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; white-space: pre; overflow-wrap: normal; }
.change-list { display: grid; gap: 7px; }
.change-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.change-row span { color: var(--muted); font-size: 8px; }
.change-row strong { font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.preview-section { margin-top: 17px; }
.preview-section:first-child { margin-top: 0; }
.preview-section h3 { margin: 0 0 8px; font-size: 11px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.check-row:last-child { border-bottom: 0; }
.check-row input { margin-top: 2px; accent-color: var(--primary); }
.check-row strong { display: block; font-size: 9px; }
.check-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.45; }

.toast-root { position: fixed; z-index: 130; right: 18px; bottom: 18px; width: min(370px, calc(100% - 36px)); display: grid; gap: 8px; pointer-events: none; }
.toast { border-radius: 14px; padding: 12px 13px; color: white; background: #1b1e34; box-shadow: var(--shadow-3); display: flex; align-items: flex-start; gap: 9px; animation: toast-in .2s ease-out; pointer-events: auto; }
.toast.success { background: #17684f; }
.toast.error { background: #9d3044; }
.toast.warning { background: #89510f; }
.toast div { font-size: 10px; line-height: 1.45; }

.loading-screen { min-height: 100dvh; display: grid; place-items: center; }
.loader { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin .7s linear infinite; }
.spinner { width: 17px; height: 17px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: currentColor; animation: spin .7s linear infinite; }

.mobile-nav { display: none; }
.mobile-fab { display: none; }
.install-banner { margin-bottom: 15px; padding: 13px; border-radius: 15px; color: white; background: linear-gradient(145deg, #202440, #15172b); display: flex; align-items: center; gap: 11px; }
.install-banner > .icon-wrap { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #b1a9ff; background: rgba(255,255,255,.08); }
.install-banner strong { display: block; font-size: 10px; }
.install-banner span { display: block; margin-top: 3px; color: rgba(255,255,255,.54); font-size: 8px; line-height: 1.4; }
.install-banner .btn { margin-left: auto; color: white; background: rgba(255,255,255,.09); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { transform: translateY(10px) scale(.985); opacity: .5; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1180px) {
  :root { --sidebar: 224px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .reference-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .quick-capture-card { min-height: 220px; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .review-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .project-grid.list .project-card { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --radius-lg: 22px; }
  body { background: var(--bg); }
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar {
    height: calc(62px + var(--safe-top));
    padding: var(--safe-top) 13px 0;
    gap: 8px;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
  }
  .mobile-logo { display: flex; width: 35px; height: 35px; border-radius: 12px; place-items: center; align-items: center; justify-content: center; color: white; background: linear-gradient(145deg,#8276ff,#5a48e1); font-weight: 900; }
  .search-box { width: auto; flex: 1; }
  .search-input { height: 39px; padding-left: 38px; font-size: 12px; }
  .save-chip { display: none; }
  .top-actions .btn-outline { display: none; }
  .top-actions .btn-primary { width: 39px; height: 39px; padding: 0; border-radius: 12px; }
  .top-actions .btn-primary .label { display: none; }

  .page { padding: 17px 13px; padding-bottom: calc(106px + var(--safe-bottom)); }
  .page-header { margin-bottom: 18px; align-items: center; }
  .page-title { font-size: 29px; }
  .page-subtitle { font-size: 11px; margin-top: 7px; }
  .page-actions .btn .label.optional { display: none; }
  .hero-grid { gap: 11px; }
  .welcome-card { min-height: 230px; padding: 23px 20px; border-radius: 21px; }
  .welcome-card h1 { font-size: 33px; margin-top: 14px; }
  .welcome-card p { font-size: 11px; }
  .welcome-actions { margin-top: 20px; }
  .welcome-actions .btn { min-height: 39px; font-size: 10px; }
  .quick-capture-card { min-height: 0; padding: 16px; border-radius: 19px; }
  .quick-capture-input { min-height: 77px !important; }
  .metrics { gap: 8px; }
  .metric-card { padding: 13px; border-radius: 15px; }
  .metric-value { font-size: 23px; }
  .metric-note { display: none; }
  .section { margin-top: 21px; }
  .section-head h2 { font-size: 18px; }
  .section-head p { display: none; }
  .toolbar { align-items: stretch; }
  .segmented { width: 100%; }
  .select { flex: 1; min-width: 0; font-size: 10px; }
  .toolbar-spacer { display: none; }
  .view-toggle { display: none; }
  .project-grid, .project-grid.list { grid-template-columns: 1fr; gap: 11px; }
  .project-card, .project-grid.list .project-card { min-height: 235px; display: flex; padding: 16px; border-radius: 17px; }
  .project-title { font-size: 17px; }
  .project-desc { font-size: 11px; }

  .detail-topbar { margin-bottom: 12px; }
  .detail-hero { padding: 18px 15px; border-radius: 20px; }
  .detail-color { min-height: 45px; }
  .detail-heading h1 { font-size: 28px; }
  .detail-heading p { font-size: 11px; }
  .detail-actions { flex-direction: column; }
  .detail-actions .btn { width: 37px; height: 37px; padding: 0; }
  .detail-actions .btn .label { display: none; }
  .objective-card { padding: 12px; }
  .pipeline-wrap { margin: 11px 0; padding: 10px; }
  .pipeline-step { min-width: 99px; }
  .focus-card { grid-template-columns: 38px 1fr; padding: 13px; }
  .focus-icon { width: 38px; height: 38px; }
  .focus-card > .btn { display: none; }
  .detail-grid, .detail-column { gap: 11px; }
  .panel { border-radius: 17px; }
  .panel-head { padding: 12px 13px; min-height: 55px; }
  .panel-body { padding: 13px; }
  .reference-grid { grid-template-columns: 1fr; }
  .reference-card { padding: 10px; }
  .task-summary { gap: 6px; }
  .task-summary-item { padding: 8px; }

  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal.wide { width: 100%; max-height: 92dvh; border-radius: 23px 23px 0 0; animation: sheet-in .2s ease-out; }
  .modal-head { padding: 12px 14px; }
  .modal-body { padding: 14px; }
  .modal-foot { padding: 10px 14px calc(10px + var(--safe-bottom)); }
  .modal-foot .btn { min-height: 40px; }
  .ai-flow { grid-template-columns: 1fr; }
  .code-area { min-height: 330px !important; font-size: 8px; }
  .change-row { grid-template-columns: 1fr; gap: 3px; }
  .appearance-options { gap: 6px; }

  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    z-index: 60;
    inset: auto 0 0;
    min-height: calc(67px + var(--safe-bottom));
    padding: 7px 7px var(--safe-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-top: 1px solid var(--border);
  }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 3px; padding: 4px; font-size: 8px; font-weight: 760; }
  .mobile-nav button.active { color: var(--primary); }
  .mobile-nav .icon { width: 20px; height: 20px; }
  .mobile-fab {
    display: grid;
    position: fixed;
    z-index: 70;
    right: calc(16px + var(--safe-right));
    bottom: calc(77px + var(--safe-bottom));
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 17px;
    place-items: center;
    color: white;
    background: linear-gradient(145deg,#7669f8,#4f40d8);
    box-shadow: 0 15px 34px rgba(79,64,216,.34);
  }

  .quick-capture-actions { grid-template-columns: 1fr 1fr; }
  .quick-capture-actions .quick-voice-btn { grid-column: 1 / -1; }
  .local-ai-badge { display: none !important; }
  .voice-capture-shell { min-height: 0; padding: 18px 14px; grid-template-columns: 1fr; gap: 12px; text-align: center; }
  .voice-visual { width: 98px; height: 98px; margin: 0 auto; }
  .voice-copy span { font-size: 10px; }
  .voice-text-field textarea { min-height: 190px; font-size: 16px; }
  .voice-help-grid { grid-template-columns: 1fr; }
  .voice-modal-foot { flex-wrap: wrap; }
  .voice-modal-foot .spacer { display: none; }
  .voice-modal-foot .btn { flex: 1 1 46%; }
  .voice-modal-foot #voice-structure { flex-basis: 100%; order: -1; }
  .structured-task-row { grid-template-columns: 24px 1fr; padding: 8px; }

  .toast-root { right: 11px; bottom: calc(76px + var(--safe-bottom)); width: calc(100% - 22px); }
  .install-banner { padding: 11px; }
}

@keyframes sheet-in { from { transform: translateY(28px); opacity: .6; } }

@media (max-width: 390px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .welcome-actions .btn-outline { display: none; }
  .page-actions .btn-outline { display: none; }
  .detail-chip.optional { display: none; }
}

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