:root {
  --bg: #f2f3ee;
  --surface: #ffffff;
  --surface-soft: #f7f8f4;
  --ink: #1f2925;
  --ink-soft: #53615b;
  --ink-faint: #7b8882;
  --line: #dde2dc;
  --line-strong: #cbd3cc;
  --forest: #203b35;
  --forest-2: #2c554b;
  --green: #2f7b68;
  --green-soft: #e5f0eb;
  --blue: #3e6ca5;
  --blue-soft: #e8eff8;
  --amber: #b8742e;
  --amber-soft: #f7ecdc;
  --coral: #b7564c;
  --coral-soft: #f8e8e5;
  --violet: #79628a;
  --violet-soft: #eeeaf4;
  --rest: #718078;
  --rest-soft: #e9eeeb;
  --shadow: 0 16px 40px rgba(35, 51, 44, 0.08);
  --radius: 8px;
  --sidebar-width: 248px;
  --font-ui: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --font-display: "STSong", "Songti SC", "Noto Serif CJK SC", serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px 18px;
  color: #eef4f0;
  background: var(--forest);
}

.brand,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--forest);
  background: #f2d8b9;
  border-radius: 7px;
}

.brand-mark.small {
  width: 32px;
  height: 32px;
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: rgba(241, 246, 243, 0.58);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.side-nav {
  display: grid;
  gap: 5px;
  margin-top: 34px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: rgba(241, 246, 243, 0.68);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
  color: var(--forest);
  background: #f0e3cf;
}

.nav-item span {
  font-size: 13px;
  font-weight: 700;
}

.sidebar-focus {
  margin-top: auto;
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
}

.focus-ring {
  display: grid;
  width: 112px;
  height: 112px;
  margin: 0 auto 13px;
  place-items: center;
  background: conic-gradient(#e6b97e calc(var(--progress) * 1%), rgba(255, 255, 255, 0.1) 0);
  border-radius: 50%;
}

.focus-ring::before {
  position: absolute;
  width: 86px;
  height: 86px;
  content: "";
  background: var(--forest);
  border-radius: 50%;
}

.focus-ring > div {
  position: relative;
  z-index: 1;
  text-align: center;
}

.focus-ring strong {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.focus-ring span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 9px;
}

.sidebar-focus p {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  text-align: center;
}

.goal-band {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #f3d8b4;
  font-size: 10px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 9px;
}

.main-content {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 36px;
  background: rgba(242, 243, 238, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.mobile-brand {
  display: none;
  padding: 0;
  background: transparent;
  border: 0;
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink-soft);
  font-size: 11px;
}

.topbar-context strong {
  color: var(--forest);
  font-weight: 700;
}

.server-clock {
  min-width: 38px;
  color: var(--forest);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.separator-dot {
  width: 3px;
  height: 3px;
  background: var(--ink-faint);
  border-radius: 50%;
}

.topbar-actions,
.calendar-tools,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--forest);
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.view {
  display: none;
  max-width: 1440px;
  min-height: calc(100vh - 68px);
  padding: 34px 38px 64px;
  margin: 0 auto;
}

.view.active {
  display: block;
  animation: view-in 220ms ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.eyebrow,
.section-label {
  display: block;
  margin: 0 0 7px;
  color: var(--amber);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.page-heading h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0;
}

.page-subtitle {
  max-width: 720px;
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: var(--forest);
  border: 1px solid var(--forest);
}

.primary-button:hover {
  background: var(--forest-2);
}

.secondary-button {
  color: var(--forest);
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.secondary-button:hover {
  border-color: var(--green);
}

.danger-button {
  color: var(--coral);
  background: var(--coral-soft);
  border: 1px solid #edcbc5;
}

.danger-button:hover {
  background: #f3d7d3;
}

.full-width {
  width: 100%;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 10px;
}

.text-button:hover {
  color: var(--green);
}

.text-button svg {
  width: 14px;
  height: 14px;
}

.sidebar .text-button {
  color: rgba(255, 255, 255, 0.55);
}

.next-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 21px 24px;
  margin-bottom: 14px;
  color: #f7faf8;
  background: var(--forest);
  border-left: 5px solid #e7bb7f;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.next-action h2 {
  margin: 2px 0 4px;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
}

.next-action p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10.5px;
}

.next-action .section-label {
  color: #efc58c;
}

.next-action .secondary-button {
  flex: 0 0 auto;
  color: var(--forest);
  background: #f0e2cc;
  border-color: #f0e2cc;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 76px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
}

.metric-icon.study {
  color: var(--green);
  background: var(--green-soft);
}

.metric-icon.class {
  color: var(--blue);
  background: var(--blue-soft);
}

.metric-icon.rest {
  color: var(--rest);
  background: var(--rest-soft);
}

.metric-card strong,
.metric-card span {
  display: block;
}

.metric-card strong {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.1;
  text-overflow: ellipsis;
}

.metric-card span {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9.5px;
}

.today-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 28px;
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.section-heading.compact {
  align-items: center;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.panel-icon {
  color: var(--green);
}

.agenda-list {
  border-top: 1px solid var(--line-strong);
}

.agenda-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 68px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
}

.agenda-time {
  color: var(--ink-soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.agenda-copy {
  min-width: 0;
}

.agenda-copy strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-copy span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 52px;
  padding: 5px 7px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border-radius: 99px;
  font-size: 8.5px;
}

.type-pill::before {
  width: 6px;
  height: 6px;
  content: "";
  background: var(--rest);
  border-radius: 50%;
}

.type-pill.study::before { background: var(--green); }
.type-pill.class::before { background: var(--blue); }
.type-pill.rehearsal::before { background: var(--amber); }
.type-pill.exam::before { background: var(--coral); }
.type-pill.personal::before { background: var(--violet); }
.type-pill.reminder::before { background: #c6922e; }

.agenda-item.past {
  opacity: 0.48;
}

.agenda-item.current {
  margin: 0 -9px;
  padding-right: 13px;
  padding-left: 13px;
  background: #fff9ef;
  border-left: 3px solid var(--amber);
}

.empty-state {
  padding: 28px 8px;
  color: var(--ink-faint);
  font-size: 11px;
  text-align: center;
}

.today-side {
  display: grid;
  gap: 13px;
}

.insight-panel,
.week-load-panel,
.progress-section,
.decision-section {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.insight-panel p {
  margin: 5px 0 17px;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.65;
}

.minimum-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.minimum-line span {
  color: var(--ink-faint);
  font-size: 9px;
}

.minimum-line strong {
  color: var(--green);
  font-size: 10.5px;
}

.week-load-panel .section-heading strong {
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 20px;
}

.load-track {
  overflow: hidden;
  height: 7px;
  background: #e9ece7;
  border-radius: 99px;
}

.load-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
  transition: width 350ms ease;
}

.load-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 8.5px;
}

.impact-note {
  padding: 10px 11px;
  margin-top: 14px;
  color: #6c5636;
  background: #fbf4e8;
  border-left: 2px solid #d6a25f;
  border-radius: 0 5px 5px 0;
  font-size: 9px;
  line-height: 1.55;
}

.calendar-heading {
  align-items: center;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: #e8ebe5;
  border-radius: 7px;
}

.segmented button {
  min-width: 36px;
  height: 29px;
  color: var(--ink-faint);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
}

.segmented button.active {
  color: var(--forest);
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(35, 51, 44, 0.08);
}

.calendar-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.calendar-summary strong {
  font-size: 11px;
}

.calendar-summary span {
  color: var(--ink-faint);
  font-size: 9px;
}

.calendar-shell {
  overflow: auto;
  padding: 12px 0 20px;
}

.calendar-scroll {
  min-width: 820px;
}

.calendar-header {
  display: grid;
  grid-template-columns: 54px repeat(7, minmax(0, 1fr));
  gap: 5px;
  padding-bottom: 8px;
}

.calendar-day-header {
  min-width: 0;
  padding: 7px 5px;
  text-align: center;
}

.calendar-day-header span,
.calendar-day-header strong {
  display: block;
}

.calendar-day-header span {
  color: var(--ink-faint);
  font-size: 8.5px;
}

.calendar-day-header strong {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 17px;
}

.calendar-day-header.today strong {
  color: var(--green);
}

.calendar-body {
  display: grid;
  grid-template-columns: 54px repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.time-axis {
  position: relative;
  height: calc(16 * var(--hour-height, 55px));
}

.time-label {
  position: absolute;
  right: 6px;
  color: var(--ink-faint);
  font-size: 8px;
  transform: translateY(-50%);
}

.day-track {
  position: relative;
  height: calc(16 * var(--hour-height, 55px));
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.day-track.today {
  background: #fbfcf9;
  border-color: #b9cfc5;
}

.hour-line {
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  background: #edf0eb;
}

.calendar-event {
  position: absolute;
  right: 4px;
  left: 4px;
  overflow: hidden;
  min-height: 21px;
  padding: 4px 5px;
  color: var(--ink);
  background: var(--rest-soft);
  border-left: 3px solid var(--rest);
  border-radius: 3px;
  cursor: pointer;
  font-size: 8px;
  line-height: 1.25;
}

.calendar-event:hover {
  filter: brightness(0.97);
  box-shadow: 0 3px 10px rgba(35, 51, 44, 0.1);
}

.calendar-event strong,
.calendar-event span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event strong {
  font-size: 8.5px;
}

.calendar-event span {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 7.5px;
}

.calendar-event.study {
  color: #205548;
  background: var(--green-soft);
  border-color: var(--green);
}

.calendar-event.class {
  color: #2b507c;
  background: var(--blue-soft);
  border-color: var(--blue);
}

.calendar-event.rehearsal {
  color: #7b4f20;
  background: var(--amber-soft);
  border-color: var(--amber);
}

.calendar-event.exam {
  color: #833b34;
  background: var(--coral-soft);
  border-color: var(--coral);
}

.calendar-event.personal {
  color: #5c4b69;
  background: var(--violet-soft);
  border-color: var(--violet);
}

.calendar-event.reminder {
  color: #654710;
  background: #fff1bf;
  border: 1px solid #d6a83e;
  border-left: 4px solid #b77916;
  box-shadow: 0 2px 8px rgba(120, 83, 20, 0.18);
}

.calendar-event.reminder strong {
  font-size: 8.5px;
}

.calendar-event.conflict {
  outline: 2px dashed #c14f45;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 1px rgba(193, 79, 69, 0.12);
}

.now-line {
  position: absolute;
  z-index: 3;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--coral);
}

.now-line::before {
  position: absolute;
  top: -2px;
  left: -3px;
  width: 5px;
  height: 5px;
  content: "";
  background: var(--coral);
  border-radius: 50%;
}

.day-calendar {
  max-width: 760px;
  margin: 0 auto;
}

.day-calendar .calendar-body {
  grid-template-columns: 60px minmax(0, 1fr);
}

.day-calendar .calendar-header {
  grid-template-columns: 60px minmax(0, 1fr);
}

.day-calendar .calendar-day-header {
  text-align: left;
}

.day-calendar .calendar-event {
  right: 8px;
  left: 8px;
  padding: 7px 9px;
}

.day-calendar .calendar-event strong {
  font-size: 10px;
}

.day-calendar .calendar-event span {
  font-size: 8.5px;
}

.chat-heading {
  align-items: center;
}

.agent-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 99px;
  font-size: 9px;
  font-weight: 700;
}

.agent-status i {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(47, 123, 104, 0.12);
}

.chat-shell {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto auto auto;
  max-width: 940px;
  min-height: calc(100vh - 230px);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.chat-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}

.chat-context-bar strong,
.chat-context-bar span {
  display: block;
}

.chat-context-bar strong {
  font-size: 9px;
  color: var(--ink-faint);
}

.chat-context-bar span {
  margin-top: 3px;
  font-size: 11px;
}

.chat-messages {
  overflow-y: auto;
  padding: 20px;
  background:
    linear-gradient(#f8f9f5 1px, transparent 1px) 0 0 / 100% 28px;
}

.message-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.message-row.user {
  justify-content: flex-end;
}

.message-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--forest);
  background: #f0e1cb;
  border-radius: 6px;
}

.message-avatar svg {
  width: 15px;
  height: 15px;
}

.message-bubble {
  max-width: min(78%, 640px);
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px 8px 8px 8px;
}

.message-row.user .message-bubble {
  color: #fff;
  background: var(--forest);
  border-color: var(--forest);
  border-radius: 8px 3px 8px 8px;
}

.message-bubble p {
  margin: 0;
  font-size: 11px;
  line-height: 1.68;
  white-space: pre-wrap;
}

.message-meta {
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 8px;
}

.message-row.user .message-meta {
  color: rgba(255, 255, 255, 0.5);
  text-align: right;
}

.message-impact {
  display: grid;
  gap: 7px;
  padding: 10px 11px;
  margin-top: 11px;
  color: #6b5536;
  background: #fbf3e6;
  border-left: 2px solid #d5a15f;
  border-radius: 0 5px 5px 0;
  font-size: 9.5px;
  line-height: 1.5;
}

.proposal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.proposal-actions button {
  min-height: 31px;
  padding: 0 10px;
  font-size: 9px;
}

.quick-prompts {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 10px 18px 5px;
  scrollbar-width: none;
}

.quick-prompts::-webkit-scrollbar {
  display: none;
}

.quick-prompts button {
  flex: 0 0 auto;
  min-height: 29px;
  padding: 0 10px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 99px;
  cursor: pointer;
  font-size: 9px;
}

.quick-prompts button:hover {
  color: var(--forest);
  border-color: var(--green);
}

.chat-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}

.chat-composer textarea {
  width: 100%;
  max-height: 130px;
  min-height: 40px;
  padding: 11px 12px;
  resize: none;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11px;
  line-height: 1.45;
}

.send-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: var(--forest);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.voice-hint {
  min-height: 18px;
  padding: 0 18px 9px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 8px;
}

.goal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 25px;
}

.goal-card {
  min-height: 176px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.goal-card.floor {
  background: #f7f3e9;
  border-color: #e5d4b7;
}

.goal-card.stretch {
  background: var(--green-soft);
  border-color: #bfd7cc;
}

.goal-card.reality {
  background: var(--blue-soft);
  border-color: #c8d6e9;
}

.goal-card span {
  color: var(--ink-faint);
  font-size: 9px;
}

.goal-card strong {
  display: block;
  margin: 16px 0 10px;
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 1;
}

.goal-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.progress-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.75fr);
  gap: 14px;
}

.memory-section {
  padding: 18px;
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.section-note {
  margin: -4px 0 13px;
  color: var(--ink-faint);
  font-size: 9px;
}

.memory-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.memory-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 11px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.memory-item strong,
.memory-item span {
  display: block;
}

.memory-item strong {
  color: var(--forest);
  font-size: 9px;
}

.memory-item span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9.5px;
  line-height: 1.5;
}

.memory-item button {
  width: 26px;
  height: 26px;
}

.memory-item button svg {
  width: 13px;
  height: 13px;
}

.capacity-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
  align-items: end;
  height: 220px;
  padding: 18px 6px 0;
  border-bottom: 1px solid var(--line-strong);
}

.capacity-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.capacity-bar {
  width: min(32px, 70%);
  min-height: 3px;
  background: var(--green);
  border-radius: 4px 4px 0 0;
}

.capacity-day span {
  margin: 7px 0 -18px;
  color: var(--ink-faint);
  font-size: 8px;
}

.capacity-day strong {
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 8px;
}

.score-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.score-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.score-item strong {
  display: block;
  font-size: 11px;
}

.score-item span {
  display: block;
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 8.5px;
}

.score-item > strong {
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 22px;
}

.decision-section {
  margin-top: 14px;
}

.decision-rules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.decision-rules div {
  padding-top: 9px;
  border-top: 2px solid var(--line-strong);
}

.decision-rules strong {
  color: var(--amber);
  font-family: var(--font-display);
  font-size: 18px;
}

.decision-rules p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 9.5px;
  line-height: 1.65;
}

.mobile-nav {
  display: none;
}

.app-dialog {
  width: min(470px, calc(100vw - 28px));
  max-width: none;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.app-dialog::backdrop {
  background: rgba(18, 30, 26, 0.48);
  backdrop-filter: blur(3px);
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(20, 35, 29, 0.24);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dialog-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
}

.dialog-card label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 9.5px;
}

.dialog-card input,
.dialog-card select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
}

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

.dialog-meta {
  color: var(--ink-soft);
  font-size: 11px;
}

.dialog-actions.split {
  justify-content: space-between;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 11px 14px;
  color: #fff;
  background: var(--forest);
  border-radius: 7px;
  box-shadow: var(--shadow);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 215px;
  }

  .view {
    padding-right: 28px;
    padding-left: 28px;
  }

  .topbar {
    padding-right: 28px;
    padding-left: 28px;
  }

  .today-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(250px, 0.75fr);
    gap: 20px;
  }

  .decision-rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .memory-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    min-height: 60px;
    padding: 0 18px;
  }

  .mobile-brand {
    display: flex;
  }

  .mobile-brand strong {
    font-family: var(--font-display);
    font-size: 17px;
  }

  .topbar-context {
    display: flex;
    margin-left: auto;
    margin-right: 6px;
  }

  .topbar-context > :not(#serverClock) {
    display: none;
  }

  .server-clock {
    padding: 5px 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 10px;
  }

  .view {
    min-height: calc(100vh - 60px);
    padding: 24px 18px 100px;
  }

  .page-heading {
    align-items: flex-start;
    margin-bottom: 20px;
  }

  .page-heading h1 {
    font-size: 30px;
  }

  .page-heading .primary-button {
    flex: 0 0 auto;
  }

  .today-layout,
  .progress-layout {
    grid-template-columns: 1fr;
  }

  .today-side {
    grid-template-columns: 1fr 1fr;
  }

  .calendar-heading {
    flex-direction: column;
  }

  .calendar-tools {
    width: 100%;
    justify-content: flex-end;
  }

  .goal-grid {
    grid-template-columns: 1fr 1fr;
  }

  .goal-card.reality {
    grid-column: span 2;
    min-height: 140px;
  }

  .chat-shell {
    min-height: 0;
  }

  .mobile-nav {
    position: fixed;
    z-index: 50;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 12px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 62px;
    padding: 5px;
    background: rgba(32, 59, 53, 0.97);
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(20, 35, 29, 0.24);
    backdrop-filter: blur(18px);
  }

  #view-chat.active {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 60px);
    min-height: 0;
    padding-bottom: 82px;
  }

  #view-chat .page-heading {
    flex: 0 0 auto;
    margin-bottom: 14px;
  }

  #view-chat .chat-shell {
    flex: 1;
    height: auto;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255, 255, 255, 0.55);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 8px;
  }

  .mobile-nav-item svg {
    width: 18px;
    height: 18px;
  }

  .mobile-nav-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
  }
}

@media (max-width: 640px) {
  .view {
    padding: 20px 14px 100px;
  }

  .topbar {
    padding: 0 14px;
  }

  .page-heading {
    display: block;
  }

  .page-heading .primary-button {
    margin-top: 14px;
  }

  .page-heading h1 {
    font-size: 27px;
  }

  .next-action {
    display: block;
    padding: 18px;
  }

  .next-action .secondary-button {
    margin-top: 14px;
  }

  .metric-row {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card:last-child {
    grid-column: span 2;
  }

  .today-side {
    grid-template-columns: 1fr;
  }

  .agenda-item {
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 10px;
  }

  .agenda-item .type-pill {
    display: none;
  }

  .calendar-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .calendar-shell {
    margin: 0 -14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .calendar-scroll {
    min-width: 760px;
  }

  .day-calendar {
    min-width: 0;
  }

  .chat-shell {
    min-height: 0;
    margin: 0 -4px;
  }

  #view-chat.active {
    padding-bottom: 82px;
  }

  .chat-messages {
    padding: 15px 12px;
  }

  .message-bubble {
    max-width: 86%;
  }

  .chat-context-bar {
    padding-right: 12px;
    padding-left: 12px;
  }

  .quick-prompts {
    padding-right: 12px;
    padding-left: 12px;
  }

  .chat-composer {
    padding: 8px;
  }

  .goal-grid {
    grid-template-columns: 1fr;
  }

  .goal-card.reality {
    grid-column: auto;
  }

  .goal-card {
    min-height: 145px;
  }

  .decision-rules {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .dialog-actions.split {
    flex-direction: column;
  }

  .dialog-actions.split > * {
    width: 100%;
  }
}

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