/* Career Life · VisionOS-inspired bento interface. © 2026 庞潇. */
:root {
  color-scheme: light;
  --brand-500: #1a647b;
  --brand-600: #174958;
  --brand-soft: #e7eff2;
  --accent-cyan: #116f7d;
  --bg-page: #f7f6f3;
  --bg-surface: #ffffff;
  --bg-glass: rgba(255, 255, 255, .88);
  --bg-sidebar: rgba(255, 255, 255, .92);
  --text-primary: #252d31;
  --text-secondary: #596066;
  --text-muted: #697177;
  --success: #218369;
  --success-soft: #e7f5ee;
  --warning: #795b3c;
  --warning-soft: #fff5d9;
  --danger: #b42335;
  --danger-soft: #fff0f1;
  --border: #dcdad4;
  --border-soft: #e8ebef;
  --control-border: #899398;
  --focus-ring: #1a647b;
  --shadow-low: 0 2px 8px rgba(25, 41, 50, .05);
  --shadow-medium: 0 12px 32px rgba(25, 41, 50, .10);
  --shadow-high: 0 24px 64px rgba(25, 41, 50, .16);
  --font-sans: Inter, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --paper: var(--bg-page);
  --surface: var(--bg-surface);
  --line: var(--border);
  --sidebar: var(--text-primary);
  --sidebar-muted: var(--text-secondary);
  --accent: var(--brand-500);
  --accent-strong: var(--brand-600);
  --work: #795b3c;
  --work-soft: #f4eee5;
  --software: var(--accent-cyan);
  --software-soft: #e9f5f6;
  --english: #735738;
  --english-soft: #f4eee5;
  --shadow: var(--shadow-high);
  --color-ink: var(--text-primary);
  --color-muted: var(--text-secondary);
  --color-surface: var(--bg-surface);
  --color-surface-soft: var(--bg-page);
  --color-line: var(--border);
  --color-primary-700: var(--brand-600);
  --color-primary-600: var(--brand-500);
  --color-primary-500: var(--brand-500);
  --color-primary-100: var(--brand-soft);
  --color-primary-50: var(--bg-page);
  --color-action: var(--brand-500);
  --color-action-dark: var(--brand-500);
  --color-action-deep: var(--brand-600);
  font-family: var(--font-sans);
  font-size: 16px;
}

html { scroll-padding-block: 24px 104px; }
body {
  min-width: 320px;
  background: linear-gradient(135deg, #fbfaf8 0%, var(--bg-page) 68%, #f1f5f5 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font: 400 15px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { transition: background-color 180ms ease-out, color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out, transform 160ms var(--ease-out); }
button:active:not(:disabled) { transform: translateY(0) scale(.97); transition-duration: 90ms; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; opacity: .55; }
svg { width: 20px; height: 20px; stroke-width: 1.8; }
h1 { font: 700 32px/1.25 var(--font-sans); letter-spacing: -.5px; }
h2 { font: 650 22px/1.35 var(--font-sans); }
h3 { font: 600 16px/1.4 var(--font-sans); }
p { line-height: 1.65; }
strong, time, .day-minutes { font-variant-numeric: tabular-nums; }
.skip-link {
  position: fixed;
  inset: 12px auto auto 24px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--brand-600);
  color: white;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* Floating navigation keeps the workspace visible and reachable. */
.app-shell { display: block; min-height: 100dvh; padding-left: 284px; background: transparent; }
.sidebar {
  position: fixed;
  inset: 16px auto 16px 16px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 248px;
  height: calc(100dvh - 32px);
  padding: 24px 16px 20px;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 24px;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  box-shadow: var(--shadow-low), 0 16px 48px rgba(25, 41, 50, .045);
  color: var(--text-primary);
  overflow-y: auto;
  scrollbar-width: thin;
}
.brand { justify-content: flex-start; gap: 12px; padding: 4px; min-height: 48px; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--brand-500), var(--brand-600));
  color: white;
  box-shadow: 0 6px 12px rgba(26, 100, 123, .18);
}
.brand-mark svg { width: 23px; height: 23px; }
.brand strong { color: var(--text-primary); font-size: 18px; font-weight: 700; }
.brand small { color: var(--text-secondary); margin-top: 3px; font-size: 12px; }
.nav-caption { margin: 40px 12px 12px; color: var(--text-muted); font-size: 12px; font-weight: 500; }
.main-nav { display: grid; grid-template-columns: 1fr; gap: 8px; }
.nav-item {
  position: relative;
  justify-content: flex-start;
  flex-direction: row;
  min-height: 48px;
  padding: 0 14px;
  gap: 12px;
  border: 0;
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  transition: background-color 180ms ease-out, color 180ms ease-out, transform 160ms var(--ease-out);
}
.nav-item svg { display: block; width: 20px; height: 20px; transition: transform 180ms ease-out; }
.nav-item:hover { background: #f1f5f5; color: var(--text-primary); }
.nav-item:hover > svg:first-child { transform: translateX(2px); }
.nav-item.is-active, .ai-nav[aria-expanded="true"] { color: var(--brand-600); background: var(--brand-soft); box-shadow: none; font-weight: 600; }
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(50% - 11px);
  width: 3px;
  height: 22px;
  border-radius: 3px;
  background: var(--brand-500);
  animation: indicator-in 260ms var(--ease-out);
}
.nav-count { display: grid; min-width: 24px; width: auto; height: 24px; padding: 0 5px; border-radius: 8px; background: white; color: var(--brand-600); font-size: 12px; }
.nav-item .nav-end { width: 15px; height: 15px; }
.ai-nav { margin-top: 16px; }
.sidebar-bottom { margin-top: auto; padding-top: 40px; }
.workspace-label { gap: 10px; padding: 18px 4px 10px; border-top: 1px solid var(--border); }
.profile-mark { width: 36px; height: 36px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-600); font-size: 12px; }
.workspace-label strong { color: var(--text-primary); font-size: 12px; }
.workspace-label small { color: var(--text-secondary); font-size: 12px; margin-top: 1px; }
.workspace-label > svg { color: var(--text-secondary); width: 16px; height: 16px; }
.sidebar-status { display: flex; gap: 8px; padding-left: 50px; color: var(--text-muted); font-size: 12px; }
.status-dot { width: 6px; height: 6px; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }

/* Dashboard layout and shared controls. */
.main-content { width: min(1240px, 100%); min-width: 0; margin: 0 auto; padding: 0 32px 80px; background: transparent; }
.main-content:focus { outline: none; }
.workspace-bar { min-height: 72px; height: auto; padding: 20px 0; border-bottom: 1px solid var(--border); color: var(--text-secondary); font-size: 13px; }
.workspace-bar strong { color: var(--text-primary); font-weight: 500; }
.breadcrumb-divider { color: var(--text-muted); padding: 0 10px; }
.workspace-date { gap: 8px; font-size: 13px; }
.workspace-date svg { width: 16px; height: 16px; }
.topbar { align-items: flex-end; gap: 24px; padding: 36px 0 32px; margin: 0; }
.eyebrow { margin-bottom: 10px; color: var(--brand-600); font-size: 12px; font-weight: 600; letter-spacing: 1.4px; }
.view-subtitle { margin: 10px 0 0; color: var(--text-secondary); font-size: 15px; }
.section-kicker { margin: 0 0 8px; color: var(--text-muted); font-size: 12px; font-weight: 500; }
.primary-button, .secondary-button, .icon-button {
  min-height: 44px;
  gap: 8px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
}
.primary-button, .topbar .primary-button, .send-button {
  min-width: 44px;
  padding: 0 18px;
  border: 1px solid var(--brand-500);
  background: var(--brand-500);
  color: white;
  box-shadow: 0 6px 16px rgba(26, 100, 123, .18);
}
.topbar .primary-button { flex: 0 0 auto; width: auto; }
.topbar .primary-button span { display: inline; }
.primary-button:hover:not(:disabled), .topbar .primary-button:hover:not(:disabled), .send-button:hover:not(:disabled) {
  background: var(--brand-600);
  border-color: var(--brand-600);
  box-shadow: 0 8px 20px rgba(26, 100, 123, .24);
  transform: translateY(-2px);
}
.primary-button:active:not(:disabled), .topbar .primary-button:active:not(:disabled) { transform: scale(.97); box-shadow: inset 0 2px 4px rgba(23, 26, 43, .14); }
.secondary-button { padding: 0 18px; border: 1px solid var(--control-border); background: white; color: var(--text-secondary); }
.secondary-button:hover { background: var(--brand-soft); color: var(--brand-600); }
.icon-button, .task-actions .icon-button, .ai-toolbar-actions .icon-button, .message-copy {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--text-secondary);
}
.icon-button:hover { background: var(--brand-soft); color: var(--brand-600); }
.delete-button:hover, .task-actions .delete-button:hover, .record-delete:hover { background: var(--danger-soft); color: var(--danger); }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.summary-item, .summary-item:first-child, .summary-item + .summary-item {
  display: block;
  padding: 24px;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  background: var(--bg-glass);
  box-shadow: var(--shadow-low);
}
.summary-item > span { gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.summary-item .metric-icon { width: 20px; height: 20px; }
.blue { color: var(--brand-500); }
.green { color: var(--success); }
.orange { color: var(--warning); }
.summary-item > strong { margin-top: 16px; font-size: 36px; line-height: 1.15; font-weight: 650; letter-spacing: -.5px; color: var(--text-primary); }
.summary-item strong em { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--text-secondary); }
.summary-item small { margin-top: 10px; font-size: 12px; line-height: 1.6; color: var(--text-muted); }
.progress-overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; margin-top: 20px; }
.progress-ring-card, .progress-section {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  background: var(--bg-glass);
  box-shadow: var(--shadow-low);
}
.progress-ring-card { display: flex; align-items: center; gap: 20px; }
.progress-ring { position: relative; flex: 0 0 120px; width: 120px; height: 120px; }
.progress-ring svg { display: block; width: 120px; height: 120px; transform: rotate(-90deg); overflow: visible; }
.ring-track, .ring-value { fill: none; stroke-width: 10px; }
.ring-track { stroke: #e8e9f1; }
.ring-value { stroke-linecap: round; transition: stroke-dashoffset 650ms var(--ease-out); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label strong { color: var(--text-primary); font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.4px; }
.ring-label span { margin-top: 4px; font-size: 12px; color: var(--text-secondary); }
.ring-caption { min-width: 0; }
.ring-caption .section-kicker { display: block; line-height: 1.65; }
.ring-caption h2 { font-size: 18px; line-height: 1.5; }
.progress-section { display: flex; flex-direction: column; justify-content: center; }
.progress-section h2 { color: var(--text-primary); font-size: 16px; font-weight: 600; }
.progress-value { font-size: 18px; color: var(--brand-600); font-weight: 650; }
.progress-track { height: 10px; margin-top: 16px; border-radius: 999px; background: #e8e9f1; }
.progress-track span { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-500), var(--accent-cyan)); transition: width 550ms var(--ease-out); }
.progress-caption { margin: 12px 0 0; color: var(--text-muted); font-size: 13px; }
.dashboard-columns { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 24px; align-items: start; }
.task-section, .insights { min-width: 0; padding: 24px; margin: 0; border: 1px solid var(--border-soft); border-radius: 20px; background: var(--bg-glass); box-shadow: var(--shadow-low); }
.task-heading { align-items: center; flex-direction: row; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.task-heading h2 { font-size: 20px; }
.segmented-control { display: flex; gap: 4px; padding: 4px; border: 0; border-radius: 14px; background: #f1f1f8; }
.segmented-control button { min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 10px; color: var(--text-secondary); font-size: 13px; }
.segmented-control button:hover { color: var(--brand-600); background: #e7eff2; }
.segmented-control button.is-selected { color: var(--brand-600); background: white; box-shadow: 0 2px 6px rgba(23, 26, 43, .07); }
.task-list { gap: 12px; margin: 0; border: 0; }
.task-item {
  position: relative;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  column-gap: 12px;
  row-gap: 8px;
  align-items: start;
  min-height: 112px;
  padding: 16px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: white;
  box-shadow: 0 2px 6px rgba(23, 26, 43, .025);
  transition: background-color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out;
}
.task-item::before { content: ""; position: absolute; inset: 16px auto 16px 0; width: 4px; border-radius: 4px; background: var(--brand-500); }
.task-item[data-category="software"]::before { background: var(--accent-cyan); }
.task-item[data-category="english"]::before { background: var(--english); }
.task-item:hover { background: #fff; border-color: #b7c9ce; box-shadow: var(--shadow-low); }
.task-copy { padding-top: 7px; }
.task-copy strong { font-size: 15px; line-height: 1.6; font-weight: 600; color: var(--text-primary); transition: color 180ms ease-out; text-decoration-thickness: 1px; text-decoration-color: transparent; }
.task-copy p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.65; }
.task-item.is-completed .task-copy strong, .plan-item.is-completed strong, .week-task.is-completed strong { color: var(--text-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.task-meta { grid-column: 2; grid-row: 2; flex-wrap: wrap; white-space: normal; gap: 10px; color: var(--text-secondary); font-size: 12px; }
.category-tag { min-height: 26px; padding: 3px 8px; border-radius: 8px; font-size: 12px; font-weight: 500; line-height: 1.5; }
.category-tag.work { color: var(--work); background: var(--work-soft); }
.category-tag.software { color: var(--software); background: var(--software-soft); }
.category-tag.english { color: var(--english); background: var(--english-soft); }
.task-actions { grid-column: 3; grid-row: 1 / span 2; align-self: center; flex-direction: row; gap: 8px; }
.task-actions svg { width: 18px; height: 18px; }
.task-checkbox { position: relative; display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; margin: 0; gap: 0; cursor: pointer; }
.task-checkbox .task-check {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
.check-visual { display: block; position: relative; width: 22px; height: 22px; border: 2px solid var(--control-border); border-radius: 7px; background: white; transition: border-color 180ms ease-out, background-color 180ms ease-out, transform 220ms var(--ease-out); }
.check-visual::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform 180ms var(--ease-out) 60ms; }
.task-checkbox:hover .check-visual { border-color: var(--brand-500); background: var(--brand-soft); }
.task-check:checked + .check-visual { border-color: var(--brand-500); background: var(--brand-500); animation: check-in 220ms var(--ease-out); }
.task-check:checked + .check-visual::after { transform: rotate(45deg) scale(1); }
.task-check:focus-visible + .check-visual { outline: 3px solid var(--focus-ring); outline-offset: 4px; }
.add-task-inline { min-height: 48px; padding: 0 14px; margin-top: 16px; gap: 8px; border: 1px dashed #9bb8c1; border-radius: 12px; color: var(--brand-600); background: #fbfaf8; font-size: 13px; }
.add-task-inline:hover { color: var(--brand-600); background: var(--brand-soft); }
.empty-state { padding: 42px 20px; border: 1px dashed var(--border); border-radius: 16px; background: #fbfaf8; color: var(--text-secondary); }
.empty-state svg { width: 32px; height: 32px; color: var(--brand-500); margin-bottom: 10px; }
.empty-state p { font-size: 14px; line-height: 1.75; }

/* Seven 44px day controls remain reachable on every screen. */
.insights { display: block; }
.insights h2 { font-size: 20px; }
.insights .section-heading > svg { width: 20px; height: 20px; color: var(--brand-500); }
.week-total { gap: 8px; margin: 20px 0; }
.week-total strong { font-size: 32px; font-weight: 650; line-height: 1.2; }
.week-total span { font-size: 13px; color: var(--text-secondary); }
.week-chart { display: grid; grid-template-columns: repeat(7, minmax(44px, 1fr)); height: auto; gap: 8px; padding: 4px; margin: -4px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #bdbde0 transparent; }
.chart-day { display: flex; flex-direction: column; justify-content: space-between; align-items: center; min-width: 44px; min-height: 126px; gap: 10px; padding: 10px 4px; border: 1px solid #85899e; border-radius: 12px; background: white; color: var(--text-secondary); }
.chart-day:hover { background: #f8fbfb; border-color: var(--brand-500); transform: translateY(-2px); }
.chart-day.is-selected, .chart-day[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand-500); box-shadow: 0 0 0 2px rgba(26, 100, 123, .18); transform: scale(1.03); color: var(--brand-600); }
.chart-day .day-label { position: relative; font-size: 12px; font-weight: 500; line-height: 1.5; }
.chart-day.is-today .day-label::after { content: ""; position: absolute; top: -5px; left: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: var(--brand-500); }
.chart-day .bar-track { display: flex; align-items: end; width: 8px; height: 48px; border-radius: 999px; background: #e8e9f1; overflow: hidden; }
.chart-day .bar-fill, .chart-day.is-today .bar-fill { width: 100%; min-height: 0; border-radius: inherit; background: linear-gradient(0deg, var(--brand-500), var(--accent-cyan)); transition: height 550ms var(--ease-out); }
.chart-day .day-minutes, .chart-day span:last-child, .chart-day.is-today span:last-child { color: var(--text-secondary); font-size: 12px; font-weight: 600; line-height: 1.5; }
.chart-day[aria-pressed="true"] .day-minutes { color: var(--brand-600); }
.week-detail { padding-top: 24px; }
.week-detail-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.week-detail-heading h3 { font-size: 14px; line-height: 1.5; }
.week-detail-heading > span { flex: 0 0 auto; font-size: 12px; color: var(--text-secondary); }
.week-day-list { max-height: 240px; margin-top: 12px; overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; }
.week-day-list.is-changing { animation: week-list-in 280ms var(--ease-out); }
.week-task { display: grid; grid-template-columns: 20px minmax(0, 1fr) 44px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.week-task:last-child { border-bottom: 0; }
.week-task-status { display: flex; align-items: center; color: var(--text-secondary); }
.week-task-status svg { width: 17px; height: 17px; }
.week-task.is-completed .week-task-status { color: var(--success); }
.week-task strong { display: block; font-size: 13px; line-height: 1.65; font-weight: 500; }
.week-task div > span { display: block; margin-top: 3px; font-size: 12px; color: var(--text-secondary); }
.week-empty { margin: 0; padding: 14px; border-radius: 12px; background: #f3f5f4; color: var(--text-secondary); font-size: 13px; }
.next-step { grid-column: auto; grid-row: auto; margin-top: 24px; padding: 20px 0 0; border: 0; border-top: 1px solid var(--border); }
.next-step h3 { font-size: 15px; font-weight: 600; }
.next-step > p:not(.section-kicker) { margin-top: 8px; font-size: 13px; color: var(--text-secondary); }
.text-button { min-height: 44px; gap: 8px; border-radius: 8px; color: var(--brand-600); font-size: 13px; }
.text-button svg { width: 16px; height: 16px; }
.text-button:hover { color: var(--brand-600); text-decoration: underline; text-underline-offset: 4px; }

/* Learning plans, notes, and dialogs share the same surface hierarchy. */
.view.is-active { animation: bento-view-in 260ms var(--ease-out); }
.learning-intro { padding: 24px; gap: 24px; border: 1px solid var(--border-soft); border-radius: 20px; background: var(--bg-glass); box-shadow: var(--shadow-low); }
.page-intro h2 { font-size: 22px; }
.page-intro p:not(.section-kicker) { font-size: 14px; color: var(--text-secondary); }
.learning-intro img { width: 220px; height: 144px; max-width: 30%; object-fit: cover; border-radius: 16px; }
.plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 24px; gap: 24px; border: 0; }
.plan-lane { padding: 24px; border: 1px solid var(--border-soft); border-radius: 20px; background: var(--bg-glass); box-shadow: var(--shadow-low); }
.lane-heading { gap: 12px; margin-bottom: 20px; }
.lane-heading h3 { font-size: 18px; }
.lane-heading p { font-size: 12px; color: var(--text-secondary); }
.lane-icon { width: 44px; height: 44px; border-radius: 12px; }
.software-lane .lane-icon { color: var(--software); background: var(--software-soft); }
.english-lane .lane-icon { color: var(--english); background: var(--english-soft); }
.plan-item { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--border-soft); }
.plan-item time { font-size: 12px; color: var(--text-secondary); }
.plan-item strong { font-size: 14px; font-weight: 600; line-height: 1.65; }
.plan-item p { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.plan-list .empty-state { padding: 32px 12px; }
.records-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
.record-editor, .record-history { min-width: 0; padding: 24px; border: 1px solid var(--border-soft); border-radius: 20px; background: var(--bg-glass); box-shadow: var(--shadow-low); }
.record-editor form, .task-dialog form { gap: 20px; }
label { gap: 8px; color: var(--text-secondary); font-size: 13px; font-weight: 500; }
input, select, textarea { min-width: 0; border: 1px solid var(--control-border); border-radius: 12px; background: white; color: var(--text-primary); font-size: 15px; }
input, select { min-height: 46px; padding-inline: 12px; }
textarea { padding: 12px; line-height: 1.65; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(26, 100, 123, .12); }
.record-count { font-size: 13px; color: var(--text-secondary); }
.record-list { gap: 16px; margin-top: 24px; }
.record-item { padding: 20px 52px 20px 20px; border: 1px solid var(--border-soft); border-radius: 16px; background: white; }
.record-item::before { display: none; }
.record-item time { font-size: 12px; color: var(--text-secondary); }
.record-item h3 { margin-top: 8px; font-size: 16px; }
.record-item p { font-size: 14px; line-height: 1.8; color: var(--text-secondary); }
.record-delete { top: 10px; right: 6px; }
.task-dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px); border: 1px solid white; border-radius: 24px; background: #fff; box-shadow: var(--shadow-high); }
.task-dialog form { padding: 28px; }
.task-dialog::backdrop { background: rgba(23, 26, 43, .4); backdrop-filter: blur(5px); }
.dialog-actions { margin-top: 4px; gap: 12px; }
.form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.toast { bottom: 28px; padding: 14px 20px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--text-primary); color: white; font-size: 14px; box-shadow: var(--shadow-medium); }

/* Quiet attribution with a full-size legal link. */
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 48px; padding: 24px 4px 4px; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
.footer-brand strong { display: block; color: var(--text-primary); font-size: 15px; font-weight: 650; }
.footer-brand p { margin: 4px 0 0; font-size: 13px; }
.footer-legal { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
.footer-legal span { font-size: 13px; }
.footer-legal a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--brand-600); text-decoration: none; border-radius: 6px; }
.footer-legal a:hover { color: var(--brand-600); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.footer-legal a svg { width: 15px; height: 15px; }

/* AI stays accessible without covering the entire desktop workspace. */
.chat-launcher { right: 24px; bottom: 24px; width: 56px; height: 56px; border: 1px solid rgba(255, 255, 255, .65); border-radius: 50%; background: linear-gradient(145deg, var(--brand-500), var(--brand-600)); color: white; box-shadow: 0 12px 32px rgba(26, 100, 123, .26); }
.chat-launcher:hover { background: var(--brand-600); border-color: rgba(255, 255, 255, .7); transform: translateY(-2px); box-shadow: 0 16px 36px rgba(26, 100, 123, .3); }
.chat-launcher:active:not(:disabled) { transform: scale(.97); }
.chat-launcher[aria-expanded="true"] { background: white; color: var(--brand-600); border-color: var(--border); box-shadow: var(--shadow-medium); }
.unread-dot { background: var(--warning); }
.ai-window { right: 24px; bottom: 92px; width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 120px)); border: 1px solid rgba(255,255,255,.92); border-radius: 24px; background: var(--bg-glass); backdrop-filter: blur(20px) saturate(135%); -webkit-backdrop-filter: blur(20px) saturate(135%); box-shadow: var(--shadow-high), 0 0 0 1px rgba(26, 100, 123, .08); animation: bento-chat-in 280ms var(--ease-out); }
.ai-window.is-expanded { width: min(760px, calc(100vw - 64px)); height: min(820px, calc(100dvh - 120px)); }
.ai-toolbar { padding: 16px; gap: 8px; flex: 0 0 auto; border-bottom: 1px solid var(--border-soft); background: linear-gradient(125deg, #f1f0ff, rgba(255,255,255,.8)); }
.ai-identity { gap: 10px; }
.assistant-mark { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 12px; background: white; color: var(--brand-600); box-shadow: var(--shadow-low); }
.ai-identity h2 { font-size: 17px; font-weight: 650; color: var(--text-primary); white-space: nowrap; }
.ai-identity p { font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
.ai-toolbar-actions { gap: 0; }
.ai-toolbar-actions svg { width: 18px; height: 18px; }
.model-row { padding: 10px 16px; gap: 10px; flex: 0 0 auto; background: #f7f6f3; border-bottom: 1px solid var(--border-soft); }
.model-row select { width: 108px; min-height: 44px; padding: 0 8px; border-color: var(--control-border); border-radius: 10px; font-size: 13px; flex: 0 0 auto; }
.model-note { color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.chat-panel { flex: 1 1 0%; min-height: 0; height: auto; background: white; }
.chat-messages { padding: 20px; scrollbar-color: #bdbde0 transparent; scroll-padding-block: 16px; }
.chat-welcome { padding: 12px 0; }
.chat-welcome > .welcome-symbol { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 20px; border-radius: 16px; background: var(--brand-soft); color: var(--brand-600); }
.welcome-symbol svg { width: 26px; height: 26px; }
.chat-welcome h3 { font-size: 22px; font-weight: 650; }
.chat-welcome > p { font-size: 14px; color: var(--text-secondary); margin: 10px 0 24px; }
.chat-prompts { gap: 10px; }
.prompt-button { min-height: 48px; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: white; color: var(--text-secondary); font-size: 13px; }
.prompt-button:hover { background: var(--brand-soft); border-color: #a5a3d8; color: var(--brand-600); }
.prompt-button svg, .prompt-button svg:last-child { width: 18px; height: 18px; color: var(--brand-600); }
.chat-message { margin-bottom: 24px; }
.chat-message.user { max-width: 88%; padding: 12px 16px; border-radius: 16px 16px 4px 16px; background: var(--brand-soft); color: var(--text-primary); }
.chat-message.error { padding: 14px; border-color: #e5b1b9; border-radius: 14px; background: var(--danger-soft); color: var(--danger); }
.message-label { display: flex; align-items: center; min-height: 44px; margin: 0 44px 4px 0; color: var(--text-secondary); font-size: 12px; }
.message-content { color: inherit; font-size: 14px; line-height: 1.85; }
.message-copy { top: 0; right: 0; }
.message-copy svg { width: 16px; height: 16px; }
.markdown h1, .markdown h2, .markdown h3 { font-size: 16px; line-height: 1.5; }
.markdown a { color: var(--brand-600); text-underline-offset: 3px; }
.markdown pre { border-radius: 12px; background: #f2f2fa; color: var(--text-primary); }
.markdown code { font-size: 13px; background: #f2f2fa; }
.markdown blockquote { border-color: var(--brand-500); color: var(--text-secondary); }
.typing-indicator span { width: 6px; height: 6px; background: var(--brand-500); }
.chat-composer { flex: 0 0 auto; padding: 12px 16px 16px; border-top: 1px solid var(--border); background: #f7f6f3; }
.chat-composer textarea { min-height: 64px; max-height: 124px; padding: 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text-primary); font-size: 15px; }
.chat-composer textarea:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 0; }
.chat-composer textarea:focus { box-shadow: none; }
.chat-composer:focus-within { box-shadow: none; }
.composer-footer { gap: 10px; margin-top: 8px; }
.composer-footer > span { display: block; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.composer-actions { gap: 8px; flex: 0 0 auto; }
.send-button { width: 44px; min-width: 44px; min-height: 44px; padding: 0; border-radius: 12px; }

@keyframes indicator-in { from { transform: scaleY(.35); opacity: .3; } to { transform: scaleY(1); opacity: 1; } }
@keyframes check-in { from { transform: scale(.82); } to { transform: scale(1); } }
@keyframes bento-view-in { from { opacity: .35; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes bento-chat-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes week-list-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

@media (min-width: 1280px) {
  .dashboard-columns { grid-template-columns: minmax(0, 1fr) 404px; }
  .insights { padding: 23px; }
  .records-layout { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .main-content { padding-inline: 28px; }
  .progress-ring-card { gap: 12px; padding: 20px; }
  .ring-caption h2 { font-size: 16px; }
  .ring-caption .section-kicker { font-size: 12px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .app-shell { padding-left: 112px; }
  .sidebar { width: 80px; padding: 20px 10px; border-radius: 20px; }
  .brand { padding: 0; justify-content: center; }
  .brand > span:last-child, .nav-caption, .sidebar-bottom, .nav-count, .nav-item .nav-end { display: none; }
  .main-nav { margin-top: 32px; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item > span { position: absolute; left: 66px; top: 4px; z-index: 31; display: none; width: max-content; padding: 8px 12px; border-radius: 8px; background: var(--text-primary); color: white; font-size: 13px; box-shadow: var(--shadow-medium); }
  .sidebar { overflow: visible; }
  .nav-item:hover > span:not(.nav-count), .nav-item:focus-visible > span:not(.nav-count) { display: block; }
  .main-content { padding-inline: 24px; }
  .summary-item, .summary-item:first-child, .summary-item + .summary-item { padding: 20px; }
  .progress-ring-card, .progress-section { padding: 20px; }
  .progress-ring-card { gap: 12px; }
  .ring-caption h2 { font-size: 16px; }
  .plan-lane { padding: 20px; }
  .plan-grid { gap: 16px; }
  .ai-window { width: 380px; }
}
@media (max-width: 767px) {
  html { scroll-padding-block: 16px 120px; }
  .app-shell { padding-left: 0; }
  .sidebar {
    inset: auto 0 0;
    z-index: 40;
    display: block;
    width: 100%;
    height: auto;
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    background: rgba(252, 252, 255, .95);
    box-shadow: 0 -4px 24px rgba(23, 26, 43, .05);
    overflow: visible;
  }
  .sidebar .brand, .nav-caption, .sidebar-bottom, .nav-count, .nav-item .nav-end { display: none; }
  .main-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .nav-item { justify-content: center; flex-direction: column; gap: 3px; min-height: 56px; padding: 6px 2px; border-radius: 12px; font-size: 12px; }
  .nav-item svg { display: block; width: 20px; height: 20px; }
  .nav-item.is-active { box-shadow: none; background: var(--brand-soft); }
  .nav-item.is-active::before { top: 0; left: calc(50% - 10px); width: 20px; height: 3px; }
  .ai-nav { margin-top: 0; }
  .main-content { padding: 0 16px calc(112px + env(safe-area-inset-bottom)); }
  .workspace-bar { gap: 8px; min-height: 60px; padding: 16px 0; font-size: 12px; }
  .workspace-date { gap: 5px; font-size: 12px; }
  .workspace-date svg { width: 15px; height: 15px; }
  .breadcrumb-divider { padding: 0 6px; }
  .topbar { flex-direction: column; align-items: stretch; gap: 20px; padding: 28px 0 24px; }
  h1 { font-size: 28px; line-height: 1.35; }
  .view-subtitle { margin-top: 8px; font-size: 14px; }
  .topbar > .primary-button, .topbar .primary-button { width: 100%; min-width: 44px; min-height: 48px; padding: 0 18px; }
  .topbar > .primary-button span, .topbar .primary-button span { display: inline; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .summary-item, .summary-item:first-child, .summary-item + .summary-item { padding: 20px 16px; }
  .summary-item > span { gap: 8px; font-size: 13px; }
  .summary-item > strong { font-size: 32px; margin-top: 14px; }
  .summary-item small { margin-top: 8px; font-size: 12px; }
  .summary-item:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
  .summary-item:last-child > strong { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
  .summary-item:last-child > small { margin: 0; }
  .summary-item strong em { font-size: 13px; }
  .progress-overview { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; }
  .progress-ring-card { gap: 24px; padding: 20px; }
  .progress-section { padding: 24px 20px; }
  .ring-caption h2 { font-size: 18px; }
  .dashboard-columns { padding-top: 20px; gap: 20px; }
  .task-section, .insights { padding: 20px 16px; border-radius: 20px; }
  .task-heading { align-items: stretch; flex-direction: column; gap: 16px; }
  .task-heading h2 { font-size: 20px; }
  .segmented-control { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .segmented-control button { min-height: 44px; min-width: 44px; padding: 0 6px; }
  .task-item { grid-template-columns: 44px minmax(0, 1fr); column-gap: 8px; row-gap: 8px; padding: 12px; }
  .task-copy strong { font-size: 15px; }
  .task-copy p { font-size: 13px; }
  .task-meta { grid-column: 2; grid-row: 2; }
  .task-actions { grid-column: 2; grid-row: 3; justify-self: end; flex-direction: row; gap: 8px; }
  .task-actions .icon-button { min-height: 44px; width: 44px; }
  .insights { display: block; }
  .week-chart { padding: 4px; margin: -4px; }
  .week-total { margin: 20px 0; }
  .next-step { margin-top: 24px; padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--border); }
  .learning-intro { padding: 20px; gap: 16px; }
  .learning-intro img { display: none; }
  .page-intro h2 { font-size: 20px; }
  .plan-grid { grid-template-columns: minmax(0, 1fr); padding-top: 20px; gap: 20px; }
  .plan-lane, .record-editor, .record-history { padding: 20px 16px; }
  .record-editor form { margin-top: 20px; }
  input, select, textarea { font-size: 16px; }
  .record-item { padding: 16px 52px 16px 16px; }
  .record-item h3 { font-size: 15px; }
  .task-dialog form { padding: 24px 20px; gap: 18px; }
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .site-footer { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 36px; padding: 24px 0 12px; }
  .footer-legal { align-items: flex-start; padding-right: 64px; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .chat-launcher { right: 16px; bottom: calc(88px + env(safe-area-inset-bottom)); width: 56px; height: 56px; }
  .ai-window, .ai-window.is-expanded { inset: 0; z-index: 60; width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; background: white; }
  .ai-toolbar { padding: calc(12px + env(safe-area-inset-top)) 12px 12px; }
  .ai-toolbar-actions { gap: 0; }
  .ai-identity { gap: 8px; }
  .ai-identity h2 { font-size: 17px; }
  .ai-identity p { max-width: 160px; font-size: 12px; }
  .model-row { padding: 8px 16px; }
  .model-row select { font-size: 16px; width: 118px; }
  .chat-panel { height: auto; min-height: 0; }
  .chat-messages { padding: 16px; }
  .ai-window .chat-composer, .ai-window.is-expanded .chat-composer { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
  .chat-composer textarea { min-height: 56px; max-height: 96px; font-size: 16px; }
  .composer-footer > span { display: block; font-size: 12px; }
}
@media (max-width: 380px) {
  .workspace-bar > span:first-child { font-size: 12px; }
  .workspace-date svg { display: none; }
  .progress-ring-card { gap: 16px; }
  .ring-caption h2 { font-size: 16px; }
  .ai-identity .assistant-mark { display: none; }
  .ai-identity p { max-width: 150px; }
  .ai-toolbar { padding-inline: 12px; }
}
@media (max-height: 600px) and (min-width: 768px) {
  .sidebar { padding-block: 16px; }
  .nav-caption { margin-top: 20px; }
  .sidebar-bottom { padding-top: 20px; }
  .ai-window, .ai-window.is-expanded { bottom: 88px; height: calc(100dvh - 104px); }
  .ai-toolbar { padding-block: 8px; }
  .model-row { padding-block: 6px; }
  .chat-composer { padding-block: 8px; }
  .chat-composer textarea { min-height: 44px; max-height: 72px; }
}
@supports not (backdrop-filter: blur(20px)) {
  .sidebar, .ai-window { background: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .check-visual { forced-color-adjust: none; border-color: ButtonText; background: Canvas; }
  .task-check:checked + .check-visual { background: Highlight; border-color: Highlight; }
  .check-visual::after { border-color: HighlightText; }
  .task-check:focus-visible + .check-visual { outline-color: Highlight; }
  .ring-track { stroke: GrayText; }
  .ring-value { stroke: Highlight; }
  .progress-track { border: 1px solid CanvasText; }
  .progress-track span, .chart-day .bar-fill { background: Highlight; forced-color-adjust: none; }
  .nav-item.is-active, .chart-day[aria-pressed="true"], .segmented-control button.is-selected { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* JPMorgan-inspired business palette: preserve the bento geometry while
   keeping the visual language white, ink blue, and warm stone. */
.brand-mark { box-shadow: 0 6px 12px rgba(26,100,123,.18); }
.nav-item:hover { background: #f1f5f5; }
.primary-button, .topbar .primary-button, .send-button { box-shadow: 0 6px 16px rgba(26,100,123,.18); }
.primary-button:hover:not(:disabled), .topbar .primary-button:hover:not(:disabled), .send-button:hover:not(:disabled) { box-shadow: 0 8px 20px rgba(26,100,123,.24); }
.segmented-control, .model-row, .chat-composer { background: #f7f6f3; }
.segmented-control button:hover, .prompt-button:hover { background: #e7eff2; border-color: #9bb8c1; }
.segmented-control button.is-selected { box-shadow: 0 2px 6px rgba(25,41,50,.08); }
.task-item:hover { background: #fff; border-color: #b7c9ce; }
.add-task-inline, .empty-state { background: #fbfaf8; border-color: #9bb8c1; }
.chart-day:hover { background: #f8fbfb; }
.chart-day.is-selected, .chart-day[aria-pressed="true"] { box-shadow: 0 0 0 2px rgba(26,100,123,.18); }
.chart-day .bar-track, .ring-track, .progress-track { background-color: #e9eceb; }
.chat-launcher { background: linear-gradient(145deg, var(--brand-500), var(--brand-600)); box-shadow: 0 12px 32px rgba(26,100,123,.26); }
.chat-launcher:hover { box-shadow: 0 16px 36px rgba(26,100,123,.30); }
.ai-window { box-shadow: var(--shadow-high), 0 0 0 1px rgba(26,100,123,.08); }
.ai-toolbar { background: linear-gradient(125deg, #e7eff2, rgba(255,255,255,.88)); }
.markdown pre, .markdown code { background: #eef2f2; }
