:root {
  --ink: #191b1f;
  --ink-soft: #2a2d33;
  --muted: #71767f;
  --muted-2: #9a9ea5;
  --line: #dfe1de;
  --line-dark: #34373f;
  --surface: #ffffff;
  --canvas: #f3f4f1;
  --sidebar: #17181c;
  --sidebar-2: #202228;
  --coral: #ef6b5b;
  --coral-dark: #d95041;
  --blue: #3857d6;
  --blue-soft: #e9edff;
  --green: #168a6b;
  --green-soft: #e1f4ed;
  --amber: #ad7b24;
  --amber-soft: #fbf0d6;
  --violet: #7557b7;
  --danger: #c63c3c;
  --shadow: 0 16px 44px rgba(23, 24, 28, 0.09);
  --font: Inter, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

:focus-visible {
  outline: 3px solid rgba(56, 87, 214, 0.28);
  outline-offset: 2px;
}

.hidden { display: none !important; }
.icon-slot { display: inline-grid; place-items: center; line-height: 0; }
.lucide { width: 18px; height: 18px; flex: 0 0 auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
}

.brand b { color: var(--coral); font-size: 10px; font-weight: 700; }

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  grid-template-rows: repeat(2, 6px);
  width: 21px;
  height: 21px;
  gap: 3px;
  transform: rotate(45deg);
}

.brand-mark i { display: block; background: currentColor; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: var(--coral); }

.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.segment,
.filter-pill,
.text-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 6px;
  color: #fff;
  background: var(--coral);
  font-weight: 650;
  box-shadow: 0 8px 20px rgba(239, 107, 91, 0.18);
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.primary-button:hover { background: var(--coral-dark); box-shadow: 0 10px 24px rgba(239, 107, 91, 0.24); }
.primary-button:active { transform: translateY(1px); }
.primary-button.compact { min-height: 38px; padding: 0 14px; }
.primary-button[disabled] { cursor: wait; opacity: .65; }

.ghost-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 600;
}

.ghost-button:hover { border-color: #b9bdc5; background: #fafafa; }
.ghost-button.small { min-height: 32px; padding: 0 10px; font-size: 12px; }

.danger-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  color: var(--danger);
  background: #fff;
  border: 1px solid #e9b8b8;
  font-weight: 650;
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  color: #d8dbe1;
  background: transparent;
  transition: color .15s ease, background .15s ease;
}

.icon-button:hover { color: #fff; background: rgba(255,255,255,.08); }
.icon-button.light { color: #5e626a; border: 1px solid var(--line); background: #fff; }
.icon-button.light:hover { color: var(--ink); background: #f7f7f6; }
.icon-button.tiny { width: 28px; height: 28px; color: var(--muted); }
.icon-button.tiny .lucide { width: 14px; height: 14px; }

.text-button { padding: 0; color: #fff; background: transparent; text-decoration: underline; text-underline-offset: 3px; }

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: 7px;
  background: #e7e8e5;
}

.segment {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 5px;
  color: #6d7179;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.segment.active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.field { display: grid; gap: 8px; min-width: 0; }
.field > span:first-child { color: #555a63; font-size: 12px; font-weight: 650; }
.field em { color: #979ba3; font-style: normal; font-weight: 400; }
.field input, .field textarea, .field select, .dynamic-fields input, .dynamic-fields select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d6d8d5;
  border-radius: 6px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field textarea { min-height: 84px; padding-top: 11px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .dynamic-fields input:focus, .dynamic-fields select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(56,87,214,.12);
}

.field-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; }

.eyebrow, .mini-label {
  margin: 0 0 12px;
  color: #aeb4c0;
  font-size: 10px;
  line-height: 1;
  font-weight: 750;
  text-transform: uppercase;
}

.eyebrow.dark { color: var(--coral-dark); }
.mini-label { margin-bottom: 8px; color: var(--coral-dark); }

/* Authentication */
.auth-view {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  color: #f7f7f4;
  background: #101217;
}

.auth-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-noise { position: absolute; inset: 0; pointer-events: none; background: rgba(255,255,255,.015); }
.auth-header, .auth-footer, .auth-main { position: relative; z-index: 1; }

.auth-header {
  display: flex;
  width: min(1460px, calc(100% - 96px));
  height: 86px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  border-bottom: 1px solid rgba(255,255,255,.11);
}

.brand-light { color: #fff; }
.auth-status { display: flex; align-items: center; gap: 8px; color: #9da3ae; font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #37c697; box-shadow: 0 0 0 4px rgba(55,198,151,.12); }

.auth-main {
  display: grid;
  width: min(1240px, calc(100% - 96px));
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 96px;
  align-items: center;
  margin: 42px auto;
}

.auth-story { max-width: 700px; }
.auth-story h1 { margin: 0; font-size: 68px; line-height: 1.03; font-weight: 750; }
.auth-lead { margin: 28px 0 36px; color: #c9cdd5; font-size: 22px; line-height: 1.65; }

.auth-signal { display: flex; align-items: center; width: min(580px, 100%); color: #aeb3bd; font-size: 11px; font-weight: 650; }
.auth-signal i { display: block; height: 1px; flex: 1; margin: 0 13px; background: rgba(255,255,255,.22); }
.auth-signal i:nth-of-type(2) { background: var(--coral); }

.review-film { position: relative; width: min(460px, 100%); aspect-ratio: 16 / 9; margin-top: 28px; overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 7px; background: #181b21; box-shadow: 0 20px 46px rgba(0,0,0,.24); }
.review-film video { display: block; width: 100%; height: 100%; object-fit: cover; background: #181b21; }
.review-film-label { position: absolute; left: 14px; top: 13px; padding: 5px 7px; border-radius: 4px; color: #dadddf; background: rgba(16,18,23,.76); font-size: 8px; font-weight: 750; }
.review-film-toggle { position: absolute; right: 12px; bottom: 12px; display: grid; width: 31px; height: 31px; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: #fff; background: rgba(16,18,23,.76); cursor: pointer; }
.review-film-toggle .lucide { width: 13px; height: 13px; }

.auth-proof { display: flex; gap: 48px; margin-top: 27px; }
.auth-proof div { display: grid; gap: 7px; }
.auth-proof strong { font-size: 24px; }
.auth-proof span { color: #868c97; font-size: 11px; }

.auth-panel {
  padding: 28px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(25,27,33,.88);
  box-shadow: 0 32px 90px rgba(0,0,0,.34);
  backdrop-filter: blur(16px);
}

.auth-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.auth-panel h2 { margin: 0; font-size: 21px; line-height: 1.25; }
.secure-badge { display: inline-flex; align-items: center; gap: 5px; color: #757a83; font-size: 10px; white-space: nowrap; }
.auth-panel .secure-badge { color: #9ea4ae; }
.secure-badge .lucide { width: 13px; height: 13px; }

.auth-tabs { width: 100%; margin: 24px 0; background: rgba(255,255,255,.07); }
.auth-tabs .segment { color: #9fa5af; }
.auth-tabs .segment.active { color: #fff; background: #30333a; box-shadow: none; }
.auth-form { display: grid; gap: 16px; }
.auth-form .field > span:first-child { color: #bec2ca; }
.auth-form .field input, .auth-form .field textarea {
  border-color: rgba(255,255,255,.13);
  color: #fff;
  background: rgba(255,255,255,.055);
}
.auth-form .field input::placeholder, .auth-form .field textarea::placeholder { color: #727781; }
.auth-form .field input:focus, .auth-form .field textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(239,107,91,.12); }

.input-wrap { position: relative; }
.input-wrap .icon-slot { position: absolute; z-index: 1; left: 13px; top: 50%; color: #747a84; transform: translateY(-50%); }
.input-wrap .lucide { width: 17px; height: 17px; }
.auth-form .input-wrap input { padding-left: 42px; }
.auth-submit { width: 100%; min-height: 48px; margin-top: 2px; }
.auth-submit .lucide { width: 17px; height: 17px; }
.form-note { margin: -3px 0 0; color: #858b96; font-size: 11px; line-height: 1.5; text-align: center; }

.auth-footer {
  display: flex;
  width: min(1460px, calc(100% - 96px));
  height: 66px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,.1);
  color: #737985;
  font-size: 10px;
}
.auth-footer b { color: #c2c6cd; }

/* App shell */
.app-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 232px minmax(0, 1fr) 294px;
  background: var(--canvas);
}

.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 27px 17px 18px;
  color: #dadddf;
  background: var(--sidebar);
  overflow: auto;
}

.sidebar > .brand { min-height: 38px; padding: 0 10px; color: #fff; }
.brand-name { font-size: 15px; }
.workspace-label { display: flex; align-items: center; justify-content: space-between; margin: 29px 10px 9px; color: #747982; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.workspace-label .status-dot { width: 5px; height: 5px; box-shadow: none; }

.primary-nav { display: grid; gap: 3px; }
.nav-item {
  display: grid;
  width: 100%;
  min-height: 42px;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  color: #9da1aa;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color .15s ease, background .15s ease;
}
.nav-item .lucide { width: 17px; height: 17px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: #292c32; }
.nav-item.active .icon-slot { color: var(--coral); }
.nav-item kbd { color: #656a73; font: 10px var(--font); }

.sidebar-section { display: grid; gap: 2px; margin-top: 26px; padding-top: 21px; border-top: 1px solid #2b2e34; }
.sidebar-caption { margin: 0 11px 9px; color: #666b74; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.category-link { display: grid; min-height: 34px; grid-template-columns: 10px 1fr auto; align-items: center; gap: 9px; padding: 0 11px; border: 0; color: #9297a0; background: transparent; cursor: pointer; text-align: left; }
.category-link:hover { color: #fff; }
.category-link span { font-size: 10px; }

.category-dot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: #888; }
.category-dot.work { background: #5271ef; }
.category-dot.side { background: var(--coral); }
.category-dot.fitness { background: #39b892; }
.category-dot.life { background: #d8a54a; }

.sidebar-bottom { display: grid; gap: 3px; margin-top: auto; padding-top: 20px; }
.profile-button { display: grid; width: 100%; min-width: 0; grid-template-columns: 34px 1fr 18px; gap: 9px; align-items: center; margin-top: 9px; padding: 12px 9px 2px; border: 0; border-top: 1px solid #2b2e34; color: #fff; background: transparent; text-align: left; cursor: pointer; }
.profile-button > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.profile-button strong, .profile-button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-button strong { font-size: 12px; }
.profile-button small { color: #6f747d; font-size: 9px; }
.profile-button > .icon-slot { color: #666b74; }
.avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 6px; color: #fff; background: var(--blue) center / cover no-repeat; font-size: 12px; font-weight: 700; }

.main-shell { min-width: 0; }
.topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(243,244,241,.94);
  backdrop-filter: blur(12px);
}

.mobile-brand { display: none; }
.search-trigger { display: flex; width: min(390px, 45%); min-height: 38px; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid #dddfdc; border-radius: 6px; color: #898d94; background: #fafbf9; cursor: pointer; text-align: left; }
.search-trigger > span:nth-child(2) { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-trigger .lucide { width: 16px; height: 16px; }
.search-trigger kbd { padding: 2px 5px; border: 1px solid #d8dad7; border-radius: 4px; color: #9a9da3; background: #fff; font: 9px var(--font); }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.save-state { display: flex; align-items: center; gap: 7px; margin-right: 5px; color: #82868d; font-size: 10px; white-space: nowrap; }
.save-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.save-state.saving .save-pulse { background: var(--amber); animation: pulse .8s infinite; }
.save-state.error .save-pulse { background: var(--danger); }
.topbar .icon-button { color: #777b83; }
.topbar .icon-button:hover { color: var(--ink); background: #e8e9e6; }
.unread-dot { position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--coral); }

.page-stack { width: min(1180px, 100%); margin: 0 auto; padding: 37px 32px 72px; }
.page-view { display: none; animation: pageIn .28s ease both; }
.page-view.active { display: block; }
.page-heading { display: flex; min-height: 82px; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.page-heading h1 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 720; }
.page-subtitle { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.today-heading h1 { font-size: 32px; }
.date-controls { display: flex; align-items: center; gap: 7px; }

.momentum-stage {
  position: relative;
  display: grid;
  height: 242px;
  grid-template-columns: minmax(0, 1fr) 170px;
  align-items: center;
  margin-bottom: 15px;
  padding: 35px 42px;
  overflow: hidden;
  border-radius: 7px;
  color: #f8f8f5;
  background: #1c1f25;
}
.momentum-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-copy, .completion-orbit, .stage-meta { position: relative; z-index: 1; }
.stage-copy { align-self: center; }
.stage-label { display: inline-flex; align-items: center; gap: 7px; color: #9ea4af; font-size: 10px; font-weight: 700; }
.stage-label i { width: 18px; height: 2px; background: var(--coral); }
.stage-copy > strong { display: block; margin: 17px 0 9px; font-size: 31px; font-weight: 650; }
.stage-copy p { max-width: 420px; margin: 0; color: #aeb3bd; font-size: 12px; line-height: 1.6; }
.completion-orbit { display: grid; width: 144px; height: 144px; place-items: center; justify-self: end; }
.completion-orbit svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.completion-orbit circle { fill: none; stroke-width: 5; }
.orbit-base { stroke: rgba(255,255,255,.12); }
.orbit-value { stroke: var(--coral); stroke-linecap: round; stroke-dasharray: 301.6; stroke-dashoffset: 301.6; transition: stroke-dashoffset .7s ease; }
.completion-orbit div { display: grid; gap: 3px; text-align: center; }
.completion-orbit strong { font-size: 25px; }
.completion-orbit span { color: #8e949f; font-size: 9px; }
.stage-meta { position: absolute; right: 42px; bottom: 23px; display: flex; gap: 18px; color: #959ba6; font-size: 9px; }
.stage-meta span { display: flex; align-items: center; gap: 6px; }
.stage-meta b { color: #fff; font-size: 10px; }

.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 15px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.metric { position: relative; display: grid; min-height: 112px; align-content: center; gap: 5px; padding: 20px 24px; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric > span { color: var(--muted); font-size: 10px; }
.metric > strong { font-size: 25px; line-height: 1.1; }
.metric > strong small { margin-left: 3px; color: #8a8e96; font-size: 11px; font-weight: 500; }
.metric > small { color: #9a9ea5; font-size: 9px; }
.metric > small.positive { color: var(--green); }

.today-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr); gap: 15px; }
.tool-panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.panel-heading { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; border-bottom: 1px solid #e8e9e7; }
.panel-heading > div:first-child { display: flex; min-width: 0; align-items: center; gap: 11px; }
.panel-heading h2 { margin: 0; overflow: hidden; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.panel-index { color: var(--coral-dark); font-size: 9px; font-weight: 750; }
.panel-tools { display: flex; align-items: center; gap: 9px; }
.panel-hint { color: #9a9ea5; font-size: 9px; }

.timeline-list { padding: 7px 20px 14px; }
.timeline-item { position: relative; display: grid; min-height: 63px; grid-template-columns: 58px 11px minmax(0, 1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid #ececea; }
.timeline-item:last-child { border-bottom: 0; }
.timeline-time { display: grid; gap: 2px; color: var(--ink); font-size: 11px; font-weight: 700; }
.timeline-time small { color: #a1a4aa; font-size: 8px; font-weight: 500; }
.timeline-node { position: relative; z-index: 1; width: 8px; height: 8px; border: 2px solid var(--blue); border-radius: 50%; background: #fff; }
.timeline-item:not(:last-child) .timeline-node::after { content: ''; position: absolute; z-index: -1; top: 7px; left: 1px; width: 1px; height: 55px; background: #dfe2e8; }
.timeline-copy { min-width: 0; }
.timeline-copy strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-copy small { display: flex; align-items: center; gap: 5px; margin-top: 5px; color: #90949b; font-size: 9px; }
.timeline-copy .category-dot { width: 5px; height: 5px; }
.item-actions, .focus-actions, .todo-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.row-delete { display: grid; width: 27px; height: 27px; place-items: center; padding: 0; border: 0; border-radius: 5px; color: #9da1a8; background: transparent; cursor: pointer; opacity: 0; transition: color .15s ease, background .15s ease, opacity .15s ease; }
.row-delete .lucide { width: 13px; height: 13px; }
.timeline-item:hover .row-delete, .focus-item:hover .row-delete, .todo-item:hover .row-delete, .row-delete:focus-visible { opacity: 1; }
.row-delete:hover { color: var(--danger); background: #faeaea; }
.status-chip { display: inline-flex; min-height: 23px; align-items: center; padding: 0 8px; border-radius: 4px; color: #5e6470; background: #eff0ee; font-size: 8px; font-weight: 650; }
.status-chip.done { color: var(--green); background: var(--green-soft); }
.status-chip.blocked { color: #a25f16; background: var(--amber-soft); }

.focus-list { padding: 4px 20px 11px; }
.focus-item { padding: 17px 0; border-bottom: 1px solid #ececea; }
.focus-item:last-child { border-bottom: 0; }
.focus-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.focus-title > div { min-width: 0; }
.focus-title strong { display: block; margin-bottom: 6px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.focus-title small { display: block; overflow: hidden; color: #8b8f96; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.focus-actions > span { color: var(--blue); font-size: 11px; font-weight: 750; }
.range-wrap { position: relative; height: 14px; margin-top: 12px; }
.range-wrap input { position: absolute; z-index: 2; inset: -6px 0 0; width: 100%; height: 20px; margin: 0; opacity: 0; cursor: pointer; }
.range-track { position: absolute; top: 5px; left: 0; right: 0; height: 4px; overflow: hidden; border-radius: 2px; background: #eceeeb; }
.range-track i { display: block; height: 100%; background: var(--blue); transition: width .15s ease; }
.range-track b { position: absolute; top: -3px; width: 10px; height: 10px; margin-left: -5px; border: 2px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); transition: left .15s ease; }

.todo-panel { grid-column: 1; }
.thin-progress { height: 3px; background: #eff0ee; }
.thin-progress i { display: block; width: 0; height: 100%; background: var(--green); transition: width .35s ease; }
.mini-progress-label { color: #83878f; font-size: 9px; }
.todo-list { padding: 7px 20px 14px; }
.todo-item { display: grid; min-height: 48px; grid-template-columns: 21px minmax(0, 1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid #eeefed; }
.todo-item:last-child { border-bottom: 0; }
.todo-check { display: grid; width: 18px; height: 18px; place-items: center; padding: 0; border: 1.5px solid #c7cacd; border-radius: 4px; color: #fff; background: #fff; cursor: pointer; }
.todo-check .lucide { width: 12px; height: 12px; opacity: 0; }
.todo-item.done .todo-check { border-color: var(--green); background: var(--green); }
.todo-item.done .todo-check .lucide { opacity: 1; }
.todo-copy { min-width: 0; }
.todo-copy strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.todo-item.done .todo-copy strong { color: #94989f; text-decoration: line-through; }
.todo-copy small { display: flex; gap: 7px; margin-top: 3px; color: #9b9fa5; font-size: 8px; }
.priority-mark { width: 4px; height: 18px; border-radius: 2px; background: #d8dad7; }
.priority-mark.high { background: var(--coral); }
.priority-mark.medium { background: var(--amber); }
.todo-actions { min-width: 38px; }

.journal-panel { grid-column: 2; grid-row: 2; }
.journal-input, .review-input { width: 100%; border: 0; color: #41454c; background: transparent; outline: none; resize: vertical; }
.journal-input { min-height: 174px; padding: 18px 20px; font-size: 12px; line-height: 1.9; }
.journal-footer { display: flex; height: 35px; align-items: center; justify-content: space-between; padding: 0 20px; border-top: 1px solid #eceeeb; color: #a1a4aa; font-size: 8px; }

/* Plans */
.view-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-pill { min-height: 32px; padding: 0 12px; border-radius: 5px; color: #777b82; background: transparent; font-size: 11px; }
.filter-pill:hover { background: #e9eae7; }
.filter-pill.active { color: #fff; background: var(--ink); }

.period-overview { display: grid; grid-template-columns: minmax(220px, 1.7fr) repeat(3, 1fr); min-height: 126px; margin-bottom: 15px; border-radius: 7px; color: #f4f5f2; background: #202229; }
.period-overview > div { display: grid; align-content: center; gap: 7px; padding: 22px 27px; }
.period-overview > div + div { border-left: 1px solid #373a42; }
.period-overview span { color: #8e949f; font-size: 9px; }
.period-overview > div:first-child strong { font-size: 20px; }
.period-overview small { color: #8e949f; font-size: 9px; }
.period-stat { text-align: center; }
.period-stat strong { font-size: 20px; }
.plans-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr); gap: 15px; }
.plan-list { padding: 0 20px; }
.plan-item { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 20px; align-items: center; min-height: 112px; padding: 18px 0; border-bottom: 1px solid #e9ebe8; }
.plan-item:last-child { border-bottom: 0; }
.plan-main { min-width: 0; }
.plan-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: #94989f; font-size: 8px; }
.plan-main h3 { margin: 0 0 7px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.plan-main p { margin: 0; overflow: hidden; color: #777b82; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.plan-progress { display: grid; gap: 9px; }
.plan-progress-head { display: flex; justify-content: space-between; color: #848890; font-size: 9px; }
.plan-progress-head strong { color: var(--blue); font-size: 11px; }
.review-input { min-height: 310px; padding: 21px; font-size: 12px; line-height: 1.9; }
.review-prompts { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px; border-top: 1px solid #e8eae7; }
.review-prompts button { min-height: 28px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; color: #767b82; background: #fafbf9; font-size: 9px; cursor: pointer; }

/* Resources */
.board-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 15px; }
.board-card { position: relative; min-height: 108px; padding: 19px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.board-card:hover { transform: translateY(-2px); }
.board-card.active { border-color: var(--board-color); box-shadow: inset 0 3px 0 var(--board-color); }
.board-card strong { display: block; margin-bottom: 8px; font-size: 13px; }
.board-card p { margin: 0; color: #858991; font-size: 9px; }
.board-card span { position: absolute; right: 17px; bottom: 15px; color: var(--board-color); font-size: 19px; font-weight: 700; }

.resource-workspace { display: grid; min-height: 480px; grid-template-columns: minmax(340px, .88fr) minmax(0, 1.12fr); overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.resource-list-pane { min-width: 0; border-right: 1px solid var(--line); }
.pane-toolbar { display: flex; min-height: 67px; align-items: center; justify-content: space-between; gap: 13px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.pane-toolbar > div:first-child { display: grid; gap: 3px; }
.pane-toolbar strong { font-size: 13px; }
.pane-toolbar span { color: #969aa1; font-size: 8px; }
.compact-segments .segment { min-height: 28px; padding: 0 8px; font-size: 9px; }
.resource-list { padding: 4px 0; }
.resource-item { display: grid; min-height: 77px; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 11px 17px; border-left: 3px solid transparent; cursor: pointer; }
.resource-item:hover { background: #f7f8f6; }
.resource-item.active { border-left-color: var(--blue); background: #f2f4fb; }
.resource-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 6px; color: var(--blue); background: var(--blue-soft); }
.resource-icon .lucide { width: 16px; height: 16px; }
.resource-copy { min-width: 0; }
.resource-copy strong { display: block; overflow: hidden; margin-bottom: 6px; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.resource-copy p { margin: 0; overflow: hidden; color: #858991; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.resource-item select { width: 75px; min-height: 26px; border: 1px solid #dcdedb; border-radius: 4px; color: #686d75; background: #fff; font-size: 8px; }
.resource-preview { min-width: 0; padding: 32px; }
.preview-kicker { display: flex; align-items: center; gap: 8px; color: var(--blue); font-size: 9px; font-weight: 700; }
.resource-preview h2 { margin: 18px 0 11px; font-size: 23px; line-height: 1.3; }
.preview-source { display: flex; align-items: center; gap: 7px; color: #8f939a; font-size: 9px; }
.preview-source .lucide { width: 13px; height: 13px; }
.preview-summary { margin: 28px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #575c64; font-size: 12px; line-height: 1.8; }
.preview-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preview-field { min-height: 95px; padding: 15px; border: 1px solid #e1e3e0; border-radius: 6px; background: #fafbf9; }
.preview-field span { display: block; margin-bottom: 9px; color: #989ca3; font-size: 8px; }
.preview-field p { margin: 0; color: #61666d; font-size: 10px; line-height: 1.6; }

/* Reading */
.reading-overview { display: grid; min-height: 186px; grid-template-columns: minmax(0, 1fr) 270px 110px; gap: 30px; align-items: center; margin-bottom: 15px; padding: 29px 34px; border-radius: 7px; color: #f8f8f5; background: #202229; }
.reading-overview h2 { margin: 15px 0 7px; font-size: 22px; }
.reading-overview p { margin: 0; color: #9fa5af; font-size: 10px; }
.reading-bars { display: flex; height: 92px; align-items: end; justify-content: center; gap: 9px; border-bottom: 1px solid #454852; }
.reading-bars i { width: 18px; min-height: 8px; background: #4d5260; }
.reading-bars i.today { background: var(--coral); }
.reading-total { display: grid; gap: 4px; text-align: center; }
.reading-total strong { font-size: 26px; }
.reading-total strong small { color: #9ba1ab; font-size: 11px; }
.reading-total span { color: #9399a4; font-size: 9px; }
.book-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 15px; }
.book-card { min-width: 0; min-height: 224px; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
.book-card:hover { transform: translateY(-2px); border-color: #c9ccc8; }
.book-card.active { border-color: var(--book-accent); box-shadow: inset 0 3px 0 var(--book-accent); }
.book-cover { display: grid; width: 54px; height: 74px; place-items: center; margin-bottom: 20px; border-radius: 3px 6px 6px 3px; color: #fff; background: var(--book-accent); box-shadow: 5px 6px 12px rgba(0,0,0,.14); }
.book-cover .lucide { width: 21px; height: 21px; }
.book-card h3 { margin: 0 0 6px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.book-card > p { margin: 0 0 17px; color: #868a92; font-size: 9px; }
.book-progress-head { display: flex; justify-content: space-between; margin-bottom: 7px; color: #8c9097; font-size: 8px; }
.book-progress-head b { color: var(--book-accent); }
.book-card .range-track i, .book-card .range-track b { background: var(--book-accent); }
.book-card .range-track b { box-shadow: 0 0 0 1px var(--book-accent); }
.reading-note-panel .review-input { min-height: 155px; }

/* Models */
.model-intro { display: flex; min-height: 156px; align-items: center; justify-content: space-between; gap: 45px; margin-bottom: 15px; padding: 30px 35px; border-radius: 7px; color: #f6f6f3; background: #202229; }
.model-intro > div { max-width: 570px; }
.model-kicker { color: var(--coral); font-size: 9px; font-weight: 750; }
.model-intro h2 { margin: 15px 0 0; font-size: 24px; line-height: 1.35; }
.model-intro p { max-width: 300px; margin: 0; color: #a1a6b0; font-size: 10px; line-height: 1.8; }
.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.model-card { position: relative; min-height: 190px; overflow: hidden; padding: 23px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; transition: transform .16s ease, border-color .16s ease; }
.model-card:hover { transform: translateY(-2px); border-color: var(--model-color); }
.model-number { color: var(--model-color); font-size: 10px; font-weight: 750; }
.model-card h3 { margin: 28px 0 8px; font-size: 16px; }
.model-card p { margin: 0; color: #858990; font-size: 10px; line-height: 1.65; }
.model-card footer { position: absolute; left: 23px; right: 23px; bottom: 18px; display: flex; align-items: center; justify-content: space-between; color: #969aa1; font-size: 8px; }
.model-card footer .lucide { width: 14px; height: 14px; color: var(--model-color); }
.model-history-panel { margin-top: 15px; }

/* Settings */
.settings-layout { border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.settings-section { display: flex; min-height: 105px; align-items: center; justify-content: space-between; gap: 28px; padding: 21px 24px; border-bottom: 1px solid var(--line); }
.settings-section:last-child { border-bottom: 0; }
.settings-section > div { display: flex; align-items: center; gap: 17px; }
.settings-section > div > .icon-slot { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 6px; color: var(--blue); background: var(--blue-soft); }
.settings-section h2 { margin: 0 0 6px; font-size: 13px; }
.settings-section p { margin: 0; color: #858990; font-size: 9px; }
.settings-section select { min-height: 38px; padding: 0 28px 0 11px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.settings-section.danger > div > .icon-slot { color: var(--danger); background: #faeaea; }
.switch { position: relative; display: inline-block; width: 43px; height: 24px; }
.switch input { width: 0; height: 0; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: #cfd2d0; cursor: pointer; transition: background .2s ease; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .2s ease; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(19px); }

/* Context rail */
.context-rail { position: sticky; z-index: 10; top: 0; height: 100vh; padding: 0 21px 24px; border-left: 1px solid var(--line); background: #fafbf9; overflow: auto; }
.rail-header { display: flex; height: 68px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; }
.live-pill { display: flex; align-items: center; gap: 5px; color: #8d9299; font-size: 8px; }
.live-pill i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
.rail-section { padding: 23px 0; border-bottom: 1px solid var(--line); }
.rail-caption { color: #999da4; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.checkpoint-graphic { position: relative; display: grid; width: 58px; height: 58px; place-items: center; margin: 20px 0 15px; border: 1px solid #d9dcd8; border-radius: 50%; color: var(--coral); }
.checkpoint-graphic::before, .checkpoint-graphic::after { content: ''; position: absolute; border: 1px solid #e5e7e4; border-radius: 50%; }
.checkpoint-graphic::before { inset: 5px; }
.checkpoint-graphic::after { inset: 11px; }
.checkpoint-graphic .icon-slot { z-index: 1; }
.checkpoint-graphic .lucide { width: 16px; height: 16px; }
.checkpoint-graphic i { position: absolute; right: -4px; bottom: 7px; width: 8px; height: 8px; border: 2px solid #fafbf9; border-radius: 50%; background: var(--green); }
.rail-pulse-canvas { display: block; width: 100%; height: 86px; margin: 15px 0 3px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rail-pulse-canvas + .checkpoint-graphic { margin-top: 17px; }
.rail-section h3 { margin: 0 0 8px; font-size: 13px; }
.rail-section > p { margin: 0; color: #7e838a; font-size: 9px; line-height: 1.7; }
.rail-progress { display: grid; gap: 8px; margin-top: 19px; }
.rail-progress span { display: flex; justify-content: space-between; color: #8b8f96; font-size: 8px; }
.rail-progress span b { color: var(--ink); }
.rail-progress > i { display: block; height: 4px; overflow: hidden; border-radius: 2px; background: #e4e6e3; }
.rail-progress > i b { display: block; width: 0; height: 100%; background: var(--coral); transition: width .5s ease; }
.rail-title { display: flex; align-items: center; justify-content: space-between; }
.activity-list { display: grid; }
.activity-item { position: relative; display: grid; grid-template-columns: 8px 1fr; gap: 10px; padding-top: 17px; }
.activity-item > i { width: 6px; height: 6px; margin-top: 3px; border-radius: 50%; background: var(--blue); }
.activity-item:nth-child(2) > i { background: var(--coral); }
.activity-item:nth-child(3) > i { background: var(--green); }
.activity-item strong { display: block; overflow: hidden; margin-bottom: 4px; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.activity-item span { color: #a0a4aa; font-size: 8px; }
.rail-quote { margin-top: 20px; padding: 19px; border-radius: 7px; color: #e9eaed; background: #24262c; }
.rail-quote .lucide { width: 14px; height: 14px; color: var(--coral); }
.rail-quote p { margin: 12px 0; font-size: 10px; line-height: 1.7; }
.rail-quote small { color: #777d87; font-size: 8px; }
.mobile-nav { display: none; }

/* Dialogs */
.app-dialog { width: min(570px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); margin: auto; padding: 0; overflow: auto; border: 1px solid #d9dbd8; border-radius: 8px; color: var(--ink); background: #fff; box-shadow: 0 30px 90px rgba(17,19,23,.3); }
.app-dialog::backdrop { background: rgba(15,17,21,.56); backdrop-filter: blur(4px); }
.app-dialog form { padding: 24px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.dialog-header h2 { margin: 0; font-size: 20px; }
.quick-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 20px; }
.quick-type { display: flex; min-height: 62px; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; color: #70747c; background: #fff; cursor: pointer; font-size: 10px; }
.quick-type .lucide { width: 16px; height: 16px; }
.quick-type:hover { background: #fafbf9; }
.quick-type.active { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.dynamic-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 12px; }
.dynamic-fields label { display: grid; gap: 7px; color: #555a63; font-size: 10px; font-weight: 600; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 23px; padding-top: 17px; border-top: 1px solid var(--line); }

.search-dialog { width: min(680px, calc(100vw - 32px)); top: 10vh; margin-top: 0; }
.search-dialog-head { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; height: 64px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.search-dialog-head > .icon-slot { color: #81858c; }
.search-dialog-head input { min-width: 0; border: 0; outline: 0; font-size: 15px; }
.search-dialog-head kbd { color: #999da4; font: 9px var(--font); }
.search-results { max-height: 500px; padding: 9px; overflow: auto; }
.search-result { display: grid; min-height: 61px; grid-template-columns: 33px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 11px; border-radius: 6px; cursor: pointer; }
.search-result:hover { background: #f3f4f1; }
.search-result > .icon-slot { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 5px; color: var(--blue); background: var(--blue-soft); }
.search-result strong { display: block; margin-bottom: 3px; font-size: 11px; }
.search-result p { margin: 0; overflow: hidden; color: #8c9097; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.search-result > span:last-child { color: #a0a4aa; font-size: 8px; }

.model-fields { display: grid; gap: 13px; margin-top: 16px; }
.model-fields textarea { width: 100%; min-height: 70px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; resize: vertical; }
.admin-dialog { width: min(760px, calc(100vw - 32px)); padding: 25px; }
.admin-content { min-height: 250px; margin-top: 14px; }
.admin-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 15px; align-items: center; min-height: 75px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.admin-row strong { display: block; margin-bottom: 5px; font-size: 12px; }
.admin-row p { margin: 0; color: #898d94; font-size: 9px; }
.admin-actions { display: flex; gap: 6px; }
.admin-actions .ghost-button { min-height: 34px; font-size: 10px; }
.admin-actions .icon-slot .lucide { width: 13px; height: 13px; }
.profile-dialog { width: min(650px, calc(100vw - 32px)); padding: 25px; }
.profile-dialog .profile-form, .profile-dialog .password-form { padding: 0; }
.profile-editor { padding-bottom: 24px; }
.avatar-editor { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 20px; align-items: center; margin-bottom: 22px; padding: 19px; border: 1px solid var(--line); border-radius: 7px; background: #fafbf9; }
.avatar-large { width: 82px; height: 82px; border-radius: 7px; font-size: 25px; }
.avatar-editor strong { display: block; margin-bottom: 5px; font-size: 12px; }
.avatar-editor p, .section-title p, .dialog-subtitle { margin: 0; color: #8d9198; font-size: 9px; line-height: 1.6; }
.avatar-upload { position: relative; min-height: 32px; margin-top: 12px; overflow: hidden; font-size: 10px; }
.avatar-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.profile-form { display: grid; gap: 15px; }
.avatar-colors { display: flex; align-items: center; gap: 10px; }
.avatar-color { width: 25px; height: 25px; padding: 0; border: 3px solid #fff; border-radius: 50%; background: var(--avatar-color); box-shadow: 0 0 0 1px #cfd2d0; cursor: pointer; }
.avatar-color.active { box-shadow: 0 0 0 2px var(--ink); }
.profile-form .dialog-actions, .password-form .dialog-actions { margin-top: 4px; }
.password-editor { padding-top: 23px; border-top: 1px solid var(--line); }
.section-title { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.section-title > .icon-slot { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 6px; color: var(--coral); background: #faeae7; }
.section-title h3 { margin: 0 0 5px; font-size: 13px; }
.password-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.password-form .dialog-actions { grid-column: 1 / -1; }
.password-dialog .dialog-subtitle { margin-top: 7px; }
.calendar-dialog { width: min(450px, calc(100vw - 32px)); padding: 24px; overflow: hidden; }
.calendar-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 19px; }
.calendar-header h2 { margin: 0; font-size: 20px; }
.calendar-nav { display: flex; gap: 6px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { margin-bottom: 7px; color: #8e9299; font-size: 9px; text-align: center; }
.calendar-weekdays span { padding: 7px 0; }
.calendar-grid { gap: 4px; }
.calendar-day { position: relative; display: grid; min-width: 0; height: 44px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 6px; color: var(--ink); background: transparent; cursor: pointer; font-size: 11px; font-variant-numeric: tabular-nums; }
.calendar-day:hover { border-color: #d8dad7; background: #f4f5f2; }
.calendar-day.outside { color: #b2b5ba; }
.calendar-day.today { border-color: #cdd1dc; }
.calendar-day.selected { color: #fff; border-color: var(--blue); background: var(--blue); }
.calendar-day i { position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: #5271ef; }
.calendar-day.selected i { background: #fff; }
.calendar-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.calendar-footer > span { display: flex; align-items: center; gap: 7px; color: #8d9198; font-size: 9px; }
.calendar-footer > span i { width: 5px; height: 5px; border-radius: 50%; background: #5271ef; }
.empty-state { display: grid; min-height: 180px; place-items: center; align-content: center; gap: 10px; color: #a1a5ab; text-align: center; }
.empty-state.compact { min-height: 140px; }
.empty-state .lucide { width: 26px; height: 26px; }
.empty-state p { margin: 0; font-size: 10px; }

.toast-region { position: fixed; z-index: 1000; right: 22px; top: 78px; display: grid; gap: 8px; width: min(350px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: center; min-height: 54px; padding: 11px 14px; border: 1px solid #373b43; border-radius: 6px; color: #f6f6f3; background: #202229; box-shadow: var(--shadow); animation: toastIn .25s ease both; }
.toast .icon-slot { color: #4bc69d; }
.toast.error .icon-slot { color: var(--coral); }
.toast strong { display: block; margin-bottom: 3px; font-size: 11px; }
.toast p { margin: 0; color: #a8adb6; font-size: 9px; }

@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .38; } }

/* Night workspace */
body[data-theme="dark"] {
  --ink: #f0f1ed;
  --ink-soft: #d8dbe0;
  --muted: #8f949e;
  --muted-2: #6f747d;
  --line: #2b2e35;
  --surface: #181a1f;
  --canvas: #101216;
  --blue-soft: #202a4d;
  --green-soft: #17382f;
  --amber-soft: #3a2e18;
  color-scheme: dark;
  color: var(--ink);
  background: var(--canvas);
}
body[data-theme="dark"] .app-view,
body[data-theme="dark"] .main-shell { background: var(--canvas); }
body[data-theme="dark"] .sidebar { background: #0c0e11; }
body[data-theme="dark"] .topbar { border-color: var(--line); background: rgba(16,18,22,.94); }
body[data-theme="dark"] .search-trigger,
body[data-theme="dark"] .ghost-button,
body[data-theme="dark"] .icon-button.light,
body[data-theme="dark"] .field input,
body[data-theme="dark"] .field textarea,
body[data-theme="dark"] .field select,
body[data-theme="dark"] .dynamic-fields input,
body[data-theme="dark"] .dynamic-fields select,
body[data-theme="dark"] .resource-item select,
body[data-theme="dark"] .settings-section select {
  color: #e6e8e3;
  border-color: #343841;
  background: #1d2025;
}
body[data-theme="dark"] .search-trigger kbd,
body[data-theme="dark"] .segment.active { color: #f0f1ed; border-color: #3a3e47; background: #292c32; box-shadow: none; }
body[data-theme="dark"] .segmented { background: #23262c; }
body[data-theme="dark"] .filter-pill:hover,
body[data-theme="dark"] .topbar .icon-button:hover { background: #25282e; }
body[data-theme="dark"] .tool-panel,
body[data-theme="dark"] .metric-strip,
body[data-theme="dark"] .board-card,
body[data-theme="dark"] .resource-workspace,
body[data-theme="dark"] .book-card,
body[data-theme="dark"] .model-card,
body[data-theme="dark"] .settings-layout,
body[data-theme="dark"] .app-dialog { color: var(--ink); border-color: var(--line); background: var(--surface); }
body[data-theme="dark"] .panel-heading,
body[data-theme="dark"] .todo-item,
body[data-theme="dark"] .timeline-item,
body[data-theme="dark"] .focus-item,
body[data-theme="dark"] .plan-item,
body[data-theme="dark"] .journal-footer,
body[data-theme="dark"] .pane-toolbar,
body[data-theme="dark"] .review-prompts,
body[data-theme="dark"] .settings-section,
body[data-theme="dark"] .search-dialog-head,
body[data-theme="dark"] .dialog-actions,
body[data-theme="dark"] .password-editor { border-color: var(--line); }
body[data-theme="dark"] .timeline-node { background: var(--surface); }
body[data-theme="dark"] .status-chip { color: #b0b5bd; background: #292c32; }
body[data-theme="dark"] .status-chip.done { color: #6ad9b5; background: #17382f; }
body[data-theme="dark"] .range-track,
body[data-theme="dark"] .thin-progress,
body[data-theme="dark"] .rail-progress > i { background: #30343b; }
body[data-theme="dark"] .resource-item:hover,
body[data-theme="dark"] .search-result:hover { background: #202329; }
body[data-theme="dark"] .resource-item.active { background: #20263a; }
body[data-theme="dark"] .resource-preview { background: #16181d; }
body[data-theme="dark"] .preview-summary,
body[data-theme="dark"] .preview-field { border-color: #30333a; }
body[data-theme="dark"] .preview-field,
body[data-theme="dark"] .avatar-editor { background: #14161a; }
body[data-theme="dark"] .review-prompts button { color: #aeb3bc; border-color: #363a42; background: #202329; }
body[data-theme="dark"] .context-rail { border-color: var(--line); background: #14161a; }
body[data-theme="dark"] .checkpoint-graphic { border-color: #3b3f47; }
body[data-theme="dark"] .checkpoint-graphic::before,
body[data-theme="dark"] .checkpoint-graphic::after { border-color: #30343b; }
body[data-theme="dark"] .checkpoint-graphic i { border-color: #14161a; }
body[data-theme="dark"] .avatar-color { border-color: #181a1f; box-shadow: 0 0 0 1px #4b505a; }
body[data-theme="dark"] .avatar-color.active { box-shadow: 0 0 0 2px #f0f1ed; }
body[data-theme="dark"] .empty-state { color: #6e747d; }
body[data-theme="dark"] .mobile-nav { background: #0c0e11; }
body[data-theme="dark"] .row-delete:hover { background: #382323; }
body[data-theme="dark"] ::selection { color: #fff; background: #855044; }

@media (max-width: 1279px) {
  .app-view { grid-template-columns: 210px minmax(0, 1fr); }
  .context-rail { display: none; }
  .page-stack { width: min(1120px, 100%); }
}

@media (max-width: 959px) {
  .app-view { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .sidebar > .brand { justify-content: center; }
  .brand-name, .workspace-label span:first-child, .nav-item span:nth-child(2), .nav-item kbd, .sidebar-section, .profile-button > span:nth-child(2), .profile-button > .icon-slot { display: none; }
  .workspace-label { justify-content: center; margin-inline: 0; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 0; }
  .profile-button { grid-template-columns: 1fr; justify-items: center; padding-inline: 0; }
  .today-grid, .plans-layout { grid-template-columns: 1fr; }
  .todo-panel, .journal-panel { grid-column: auto; grid-row: auto; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .metric:nth-child(4) { border-top: 1px solid var(--line); }
  .resource-workspace { grid-template-columns: 1fr; }
  .resource-list-pane { border-right: 0; }
  .resource-preview { border-top: 1px solid var(--line); }
  .reading-overview { grid-template-columns: minmax(0, 1fr) 220px; }
  .reading-total { display: none; }
  .book-grid, .model-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  body { font-size: 13px; }
  .auth-view { min-height: 100svh; overflow: auto; }
  .auth-header { width: calc(100% - 36px); height: 66px; }
  .auth-status { font-size: 0; }
  .auth-status .status-dot { display: block; }
  .auth-main { width: calc(100% - 36px); grid-template-columns: 1fr; gap: 28px; margin: 36px auto 26px; }
  .auth-story h1 { font-size: 42px; }
  .auth-lead { margin: 20px 0 24px; font-size: 17px; }
  .auth-signal { font-size: 9px; }
  .auth-proof { gap: 30px; margin-top: 30px; }
  .auth-proof strong { font-size: 19px; }
  .auth-panel { padding: 21px; background: rgba(25,27,33,.94); }
  .auth-panel-head .secure-badge { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .auth-footer { width: calc(100% - 36px); height: 55px; }

  .app-view { display: block; min-height: 100svh; padding-bottom: calc(67px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .topbar { height: 60px; gap: 10px; padding: 0 16px; }
  .mobile-brand { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; }
  .mobile-brand .brand-mark { width: 17px; height: 17px; grid-template-columns: repeat(2, 5px); grid-template-rows: repeat(2, 5px); gap: 2px; }
  .search-trigger { width: 38px; min-height: 38px; justify-content: center; padding: 0; }
  .search-trigger > span:nth-child(2), .search-trigger kbd, .save-state, #notificationButton, .topbar .primary-button span:nth-child(2) { display: none; }
  .topbar-actions { margin-left: auto; }
  .topbar .primary-button.compact { width: 38px; min-height: 38px; padding: 0; }
  .page-stack { padding: 25px 16px 34px; }
  .page-heading { min-height: 0; align-items: flex-end; margin-bottom: 22px; }
  .page-heading h1, .today-heading h1 { font-size: 25px; }
  .page-subtitle { font-size: 11px; }
  .page-heading > .primary-button { width: 38px; min-height: 38px; padding: 0; font-size: 0; }
  .page-heading > .primary-button .lucide { width: 17px; height: 17px; }
  .date-controls .ghost-button { display: none; }
  .momentum-stage { height: 222px; grid-template-columns: minmax(0, 1fr) 112px; padding: 25px 20px; }
  .stage-copy > strong { font-size: 23px; }
  .stage-copy p { max-width: 180px; font-size: 10px; }
  .completion-orbit { width: 105px; height: 105px; }
  .completion-orbit strong { font-size: 20px; }
  .stage-meta { left: 20px; right: auto; bottom: 18px; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric { min-height: 92px; padding: 15px 17px; }
  .metric > strong { font-size: 21px; }
  .today-grid { display: block; }
  .tool-panel { margin-bottom: 12px; }
  .panel-heading { min-height: 57px; padding: 0 16px; }
  .timeline-list, .focus-list, .todo-list { padding-inline: 15px; }
  .timeline-item { grid-template-columns: 50px 10px minmax(0, 1fr) auto; }
  .timeline-item .status-chip { display: none; }
  .row-delete { opacity: 1; }
  .journal-input { min-height: 185px; }
  .view-toolbar { align-items: flex-start; flex-direction: column; }
  .filter-pills { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .filter-pill { flex: 0 0 auto; }
  .period-overview { grid-template-columns: repeat(3, 1fr); min-height: 108px; }
  .period-overview > div { padding: 15px 12px; }
  .period-overview > div:first-child { display: none; }
  .period-overview > div:nth-child(2) { border-left: 0; }
  .plan-item { grid-template-columns: 1fr; gap: 14px; }
  .plan-progress { width: 100%; }
  .board-strip { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .board-card { min-width: 210px; }
  .resource-workspace { min-height: 0; }
  .pane-toolbar { align-items: flex-start; flex-direction: column; padding-block: 14px; }
  .resource-preview { padding: 23px 19px; }
  .resource-preview h2 { font-size: 20px; }
  .preview-fields { grid-template-columns: 1fr; }
  .reading-overview { grid-template-columns: 1fr; min-height: 172px; padding: 25px; }
  .reading-bars { display: none; }
  .book-grid, .model-grid { grid-template-columns: 1fr; }
  .book-card { min-height: 204px; }
  .model-intro { min-height: 174px; align-items: flex-start; flex-direction: column; gap: 14px; padding: 25px; }
  .model-intro h2 { font-size: 20px; }
  .settings-section { align-items: flex-start; }
  .settings-section > div { align-items: flex-start; }
  .settings-section p { max-width: 175px; line-height: 1.5; }
  .mobile-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; height: calc(64px + env(safe-area-inset-bottom)); grid-template-columns: repeat(5, 1fr); padding: 5px 8px env(safe-area-inset-bottom); border-top: 1px solid #30333a; background: #191b20; }
  .mobile-nav button { display: grid; place-items: center; align-content: center; gap: 4px; border: 0; color: #7f858f; background: transparent; font-size: 9px; cursor: pointer; }
  .mobile-nav button.active { color: #fff; }
  .mobile-nav button.active .icon-slot { color: var(--coral); }
  .mobile-nav .lucide { width: 18px; height: 18px; }
  .quick-type-grid { grid-template-columns: repeat(2, 1fr); }
  .dynamic-fields { grid-template-columns: 1fr; }
  .profile-dialog { padding: 20px; }
  .avatar-editor { grid-template-columns: 68px minmax(0, 1fr); gap: 14px; padding: 15px; }
  .avatar-large { width: 64px; height: 64px; }
  .password-form { grid-template-columns: 1fr; }
  .password-form .dialog-actions { grid-column: auto; }
  .toast-region { top: auto; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .auth-story h1 { font-size: 37px; }
  .auth-proof { gap: 20px; }
  .auth-panel { padding: 18px; }
  .auth-tabs .segment { padding-inline: 8px; }
  .momentum-stage { grid-template-columns: 1fr; }
  .completion-orbit { position: absolute; right: 15px; top: 21px; width: 87px; height: 87px; opacity: .72; }
  .stage-copy { padding-right: 52px; }
  .stage-copy p { max-width: 210px; }
  .metric { padding-inline: 13px; }
  .period-stat strong { font-size: 17px; }
}

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

body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}
