:root {
  --canvas: #edf0ea;
  --surface: #faf9f4;
  --surface-strong: #ffffff;
  --ink: #17211d;
  --muted: #65716b;
  --faint: #9aa49e;
  --line: #d8ddd5;
  --line-strong: #c7cec5;
  --deep: #143a32;
  --deep-2: #1d4a3f;
  --coral: #e5684b;
  --coral-soft: #f5d8ce;
  --blue: #315fae;
  --blue-soft: #dbe5f6;
  --lime: #b6d772;
  --lime-soft: #e6efcf;
  --shadow: 0 12px 30px rgba(20, 58, 50, .08);
  --radius: 8px;
  --sidebar: 236px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(20, 58, 50, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 58, 50, .025) 1px, transparent 1px),
    var(--canvas);
  background-size: 28px 28px;
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 28px 18px 20px;
  color: #f4f6f0;
  background: var(--deep);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius);
  background: var(--coral);
  color: #fff;
  font-family: Georgia, "Songti SC", serif;
  font-size: 17px;
  font-weight: 700;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-family: Georgia, "Songti SC", serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .1px;
}

.brand-copy small {
  color: rgba(255, 255, 255, .56);
  font-size: 11px;
}

.primary-nav {
  display: grid;
  gap: 6px;
  margin-top: 48px;
}

.nav-item {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 255, 255, .66);
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

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

.nav-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .08);
}

.nav-item.is-active .icon {
  color: var(--lime);
}

.nav-item span {
  display: grid;
}

.nav-item b {
  font-size: 13px;
  font-weight: 600;
}

.nav-item small {
  color: rgba(255, 255, 255, .42);
  font-size: 10px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 20px 10px 2px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.micro-label {
  margin: 0 0 6px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.micro-label.light {
  color: rgba(255, 255, 255, .55);
}

.sidebar-countdown {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.sidebar-countdown strong {
  font-family: Georgia, "Songti SC", serif;
  font-size: 34px;
  line-height: 1;
  font-weight: 500;
}

.sidebar-countdown span {
  color: rgba(255, 255, 255, .55);
  font-size: 12px;
}

.mini-progress {
  height: 3px;
  margin: 14px 0 11px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

.mini-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--coral);
  transition: width .45s ease;
}

.sidebar-foot > p:last-child {
  margin: 0;
  color: rgba(255, 255, 255, .46);
  font-size: 11px;
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding: 30px clamp(24px, 3.3vw, 54px) 54px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(27px, 3vw, 36px);
  line-height: 1.16;
  font-weight: 500;
  letter-spacing: 0;
}

.page-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.date-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sync-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(250, 249, 244, .74);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.sync-badge[data-state="synced"] {
  border-color: rgba(20, 58, 50, .24);
  background: var(--lime-soft);
  color: var(--deep);
}

.sync-badge[data-state="syncing"] {
  border-color: rgba(49, 95, 174, .26);
  background: var(--blue-soft);
  color: var(--blue);
}

.sync-badge[data-state="error"] {
  border-color: rgba(229, 104, 75, .35);
  background: var(--coral-soft);
  color: #a7432d;
}

.icon-button,
.text-button,
.primary-button,
.secondary-button,
.danger-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.icon-button {
  position: relative;
  width: 40px;
  border: 1px solid var(--line);
  background: rgba(250, 249, 244, .8);
}

.icon-button:hover,
.text-button:hover,
.secondary-button:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.icon-button:active,
.text-button:active,
.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%) translateY(3px);
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--deep);
  color: #fff;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}

[data-tip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.date-picker {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(250, 249, 244, .8);
}

.date-picker input {
  width: 126px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
}

.text-button {
  padding: 0 13px;
  border: 1px solid var(--line);
  background: rgba(250, 249, 244, .8);
  font-size: 12px;
}

.view {
  display: none;
  max-width: 1400px;
  margin: 0 auto;
  animation: view-in .24s ease both;
}

.view.is-active {
  display: block;
}

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

.focus-banner {
  min-height: 194px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px auto;
  align-items: center;
  gap: 28px;
  padding: 28px 34px;
  border-radius: var(--radius);
  background: var(--deep);
  color: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.focus-copy h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.13;
  font-weight: 500;
}

.focus-date {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, .58);
  font-size: 12px;
}

.focus-quote {
  margin: 11px 0 0;
  color: var(--lime);
  font-family: Georgia, "Songti SC", serif;
  font-size: 15px;
  font-style: italic;
  line-height: 1.5;
}

.focus-art {
  height: 110px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  color: var(--lime);
}

.focus-index {
  font-family: Georgia, "Songti SC", serif;
  font-size: 54px;
  line-height: 1;
}

.focus-rule {
  height: 1px;
  background: rgba(255, 255, 255, .2);
}

.focus-word {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, .34);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 4px;
}

.countdown-block {
  min-width: 136px;
  padding-left: 28px;
  border-left: 1px solid rgba(255, 255, 255, .16);
}

.countdown-block strong {
  display: block;
  font-family: Georgia, "Songti SC", serif;
  font-size: 52px;
  line-height: 1;
  font-weight: 500;
}

.countdown-block span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, .62);
  font-size: 11px;
}

.countdown-block small {
  display: block;
  margin-top: 18px;
  color: var(--coral);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(250, 249, 244, .72);
  overflow: hidden;
}

.metric {
  min-width: 0;
  padding: 17px 20px 16px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

.metric-head .icon {
  width: 16px;
  height: 16px;
  color: var(--coral);
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 29px;
  line-height: 1;
  font-weight: 500;
}

.metric strong small {
  margin-left: 4px;
  font-family: inherit;
  font-size: 12px;
  color: var(--muted);
}

.metric p {
  min-height: 18px;
  margin: 7px 0 0;
  color: var(--faint);
  font-size: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(330px, .8fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.checkin-panel,
.week-panel,
.wellbeing-panel,
.chart-panel,
.insight-grid .panel,
.settings-grid .panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 19px;
}

.panel-head.compact {
  margin-bottom: 15px;
}

.panel-head h3 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 500;
}

.panel-head h4 {
  margin: 0;
  font-size: 13px;
}

.completion-badge {
  width: 58px;
  height: 58px;
  display: grid;
  place-content: center;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-strong);
}

.completion-badge span {
  font-size: 14px;
  font-weight: 700;
}

.completion-badge small {
  color: var(--faint);
  font-size: 8px;
}

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

.task-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}

.task-item:hover {
  border-color: var(--line-strong);
}

.task-item:has(input:checked) {
  border-color: rgba(20, 58, 50, .28);
  background: var(--lime-soft);
}

.task-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.task-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: transparent;
  background: #fff;
  flex: 0 0 auto;
}

.task-check .icon {
  width: 14px;
  height: 14px;
}

.task-item input:checked + .task-check {
  border-color: var(--deep);
  color: #fff;
  background: var(--deep);
}

.task-icon {
  color: var(--blue);
}

.task-copy {
  min-width: 0;
  display: grid;
}

.task-copy b {
  font-size: 12px;
  font-weight: 600;
}

.task-copy small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title-row h4 {
  margin: 0;
}

.section-title-row > span {
  color: var(--muted);
  font-size: 10px;
}

.time-grid,
.wellbeing-grid,
.settings-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.time-grid label,
.wellbeing-grid label,
.settings-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.time-grid label > span,
.wellbeing-grid label > span,
.settings-row label > span {
  min-height: 41px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 10px;
}

input[type="number"],
input[type="date"],
input[type="search"],
textarea {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
}

.time-grid input,
.wellbeing-grid input,
.settings-row input {
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

input[type="number"]::-webkit-inner-spin-button {
  opacity: .3;
}

.field-block {
  display: grid;
  gap: 7px;
  margin-top: 20px;
}

.reflection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.reflection-grid .field-block {
  margin-top: 0;
}

.success-field {
  padding: 13px;
  border: 1px solid rgba(182, 215, 114, .58);
  border-radius: var(--radius);
  background: rgba(230, 239, 207, .46);
}

.success-field textarea {
  background: rgba(255, 255, 255, .72);
}

.success-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.photo-add-button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid rgba(20, 58, 50, .18);
  border-radius: 5px;
  background: rgba(255, 255, 255, .66);
  color: var(--deep);
  font-size: 9px;
  cursor: pointer;
}

.photo-add-button:hover {
  background: #fff;
}

.photo-add-button:disabled {
  cursor: wait;
  opacity: .55;
}

.photo-add-button .icon {
  width: 13px;
  height: 13px;
}

.success-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.success-photo-grid:empty {
  display: none;
}

.success-photo {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: #e8ebe5;
}

.success-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  cursor: zoom-in;
}

.success-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 30, 28, .72);
  color: #fff;
  cursor: pointer;
}

.success-photo-remove .icon {
  width: 12px;
  height: 12px;
}

.photo-placeholder {
  grid-column: 1 / -1;
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--faint);
  font-size: 9px;
}

.field-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.field-label.with-icon {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-label.with-icon .icon {
  width: 14px;
  height: 14px;
  color: var(--coral);
}

.field-footnote {
  color: var(--faint);
  font-size: 9px;
  line-height: 1.5;
}

.field-block textarea {
  min-height: 96px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.7;
  font-size: 12px;
}

.field-block textarea::placeholder {
  color: var(--faint);
}

.save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.save-status {
  color: var(--faint);
  font-size: 10px;
}

.save-status.is-saved {
  color: var(--deep-2);
}

.primary-button {
  padding: 0 16px;
  border: 1px solid var(--deep);
  background: var(--deep);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

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

.secondary-button {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 11px;
}

.right-stack {
  display: grid;
  gap: 18px;
}

.muted-label {
  color: var(--faint);
  font-size: 9px;
}

.week-list {
  display: grid;
  gap: 1px;
}

.week-day {
  min-height: 42px;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.week-day:last-child {
  border-bottom: 0;
}

.week-day:hover {
  background: rgba(20, 58, 50, .025);
}

.week-day.is-today {
  color: var(--coral);
}

.week-day.is-selected {
  padding-left: 8px;
  border-left: 2px solid var(--coral);
}

.week-day-name {
  font-size: 10px;
  font-weight: 600;
}

.week-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.week-bar span {
  display: block;
  height: 100%;
  background: var(--line-strong);
}

.week-bar span.level-mid {
  background: var(--blue);
}

.week-bar span.level-high {
  background: var(--coral);
}

.week-day-time {
  min-width: 62px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.week-legend {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  color: var(--faint);
  font-size: 9px;
}

.dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 4px;
  border-radius: 50%;
}

.dot.low {
  background: var(--line-strong);
}

.dot.mid {
  background: var(--blue);
}

.dot.high {
  background: var(--coral);
}

.section-icon {
  color: var(--coral);
}

.mood-field {
  display: grid;
  gap: 7px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button:hover {
  background: var(--lime-soft);
}

.segmented button.is-active {
  background: var(--deep);
  color: #fff;
}

.wellbeing-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}

.body-hint {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.hint-index {
  padding: 2px 5px;
  border: 1px solid var(--coral);
  border-radius: 3px;
  color: var(--coral);
  font-size: 8px;
  font-weight: 700;
}

.body-hint p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.journal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.search-box {
  width: min(420px, 100%);
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.journal-list {
  display: grid;
  gap: 10px;
}

.journal-entry {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 140px;
  gap: 22px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease;
}

.journal-entry:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.journal-date strong {
  display: block;
  font-family: Georgia, "Songti SC", serif;
  font-size: 22px;
  font-weight: 500;
}

.journal-date small,
.journal-meta {
  color: var(--faint);
  font-size: 9px;
}

.journal-content h3 {
  margin: 0 0 6px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 17px;
  font-weight: 500;
}

.journal-content p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.journal-score {
  display: grid;
  align-content: center;
  justify-items: end;
  text-align: right;
}

.journal-score strong {
  font-size: 18px;
  font-weight: 600;
}

.journal-score span {
  color: var(--faint);
  font-size: 9px;
}

.empty-state {
  min-height: 280px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state .icon {
  width: 34px;
  height: 34px;
  color: var(--coral);
}

.empty-state h3 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 20px;
  font-weight: 500;
}

.empty-state p {
  max-width: 320px;
  margin: 0;
  font-size: 11px;
}

.insight-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  border-radius: var(--radius);
  background: var(--deep);
  color: #fff;
}

.insight-hero h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.2;
  font-weight: 500;
}

.insight-hero > div > p:last-child {
  margin: 9px 0 0;
  color: rgba(255, 255, 255, .55);
  font-size: 11px;
}

.insight-score {
  text-align: right;
}

.insight-score strong {
  display: block;
  font-family: Georgia, "Songti SC", serif;
  font-size: 44px;
  line-height: 1;
  font-weight: 500;
}

.insight-score span {
  color: rgba(255, 255, 255, .54);
  font-size: 9px;
}

.chart-panel {
  margin-top: 18px;
}

.chart-scale {
  color: var(--faint);
  font-size: 9px;
}

.bar-chart {
  height: 310px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
}

.chart-y-axis,
.chart-plot {
  position: relative;
  min-width: 0;
  height: 100%;
}

.chart-axis-scale,
.chart-grid-scale {
  position: absolute;
  inset: 0 0 30px;
}

.chart-axis-scale span {
  position: absolute;
  right: 7px;
  color: var(--faint);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  transform: translateY(50%);
}

.chart-grid-scale i {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(20, 58, 50, .08);
}

.chart-grid-scale i:last-child {
  background: rgba(20, 58, 50, .2);
}

.chart-gridlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.chart-columns {
  position: absolute;
  z-index: 1;
  inset: 0 0 30px;
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
}

.bar-column {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 30px;
  align-items: end;
  justify-items: center;
}

.bar-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.bar-fill {
  position: absolute;
  left: 14%;
  bottom: 0;
  width: 72%;
  min-height: 0;
  border-radius: 4px 4px 1px 1px;
  background: var(--blue);
  transition: height .35s ease;
}

.bar-value {
  position: absolute;
  z-index: 2;
  left: 50%;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(250, 249, 244, .9);
  color: var(--blue);
  font-size: 8px;
  line-height: 1.2;
  white-space: nowrap;
  transform: translateX(-50%);
}

.bar-column.is-today .bar-fill {
  background: var(--coral);
}

.bar-column small {
  height: 30px;
  display: grid;
  place-content: start center;
  gap: 1px;
  color: var(--faint);
  font-size: 8px;
  line-height: 1.2;
  text-align: center;
}

.bar-column small b {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.bar-column.is-today small b {
  color: var(--coral);
}

.insight-grid,
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.review-flow {
  display: grid;
  gap: 22px;
  max-width: 1120px;
  margin: 24px auto 0;
}

.review-stage {
  padding: 28px 30px;
}

.review-summary-stage .panel-head {
  margin-bottom: 14px;
}

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

.review-summary-bar > div {
  min-width: 0;
}

.review-summary-bar strong {
  display: block;
  margin-bottom: 4px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 16px;
  font-weight: 500;
}

.review-summary-bar .panel-hint {
  max-width: 700px;
  margin: 0;
  line-height: 1.7;
}

.review-details {
  border-bottom: 1px solid var(--line);
}

.review-details summary {
  position: relative;
  padding: 14px 24px 14px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.review-details summary::-webkit-details-marker {
  display: none;
}

.review-details summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--coral);
  font-size: 18px;
  font-weight: 400;
}

.review-details[open] summary::after {
  content: "−";
}

.review-details .field-block {
  margin: 0;
  padding-bottom: 18px;
}

.review-details textarea,
.review-plan-stage textarea {
  width: 100%;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.75;
}

.review-details textarea {
  min-height: 290px;
}

.review-plan-stage textarea {
  min-height: 360px;
}

.review-stage .ai-plan-box {
  margin-top: 0;
  padding: 18px 0 0;
  border-top: 0;
}

.plan-save-row {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.review-panel {
  display: flex;
  flex-direction: column;
}

.panel-hint {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.review-panel .field-block {
  flex: 1;
  margin-top: 14px;
}

.review-panel textarea {
  width: 100%;
  height: 100%;
  min-height: 260px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  line-height: 1.65;
}

.review-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
}

.ai-plan-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.ai-plan-box > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-plan-box .micro-label {
  margin-bottom: 2px;
  color: var(--coral);
}

.ai-plan-box strong {
  font-size: 11px;
  font-weight: 600;
}

.ai-plan-box small {
  color: var(--faint);
  font-size: 9px;
}

.ai-button {
  min-width: 116px;
  color: var(--deep);
  border-color: rgba(20, 58, 50, .25);
  background: var(--lime-soft);
}

.ai-button:hover {
  background: #dcebbd;
}

.ai-button:disabled {
  cursor: not-allowed;
  opacity: .52;
}

.approve-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.approve-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--deep);
}

.plan-history-panel {
  margin-top: 18px;
  padding: 22px;
}

.plan-history {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.plan-version {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  cursor: pointer;
}

.plan-version:hover {
  border-color: var(--line-strong);
}

.plan-version header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-version strong {
  font-family: Georgia, "Songti SC", serif;
  font-size: 15px;
  font-weight: 500;
}

.plan-version small {
  color: var(--faint);
  font-size: 8px;
}

.version-state {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.version-state.approved {
  background: var(--lime-soft);
  color: var(--deep);
}

.plan-version p {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.plan-empty {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--faint);
  font-size: 10px;
  text-align: center;
}

.plan-scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 30px 34px;
  border-radius: var(--radius);
  background: var(--deep);
  color: #fff;
  box-shadow: var(--shadow);
}

.plan-score-copy h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.16;
  font-weight: 500;
  text-wrap: balance;
}

.plan-score-copy > p:last-of-type {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, .58);
  font-size: 12px;
}

.plan-pace {
  display: inline-flex;
  margin-top: 12px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  color: var(--lime);
  font-size: 10px;
}

.plan-ring {
  --progress: 0deg;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--coral) 0 var(--progress), rgba(255, 255, 255, .15) var(--progress) 360deg);
  flex: 0 0 auto;
}

.plan-ring > div {
  width: 108px;
  height: 108px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: var(--deep);
}

.plan-ring strong {
  font-family: Georgia, "Songti SC", serif;
  font-size: 29px;
  line-height: 1;
  font-weight: 500;
}

.plan-ring span {
  margin-top: 6px;
  color: rgba(255, 255, 255, .54);
  font-size: 9px;
}

.plan-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(250, 249, 244, .72);
  overflow: hidden;
}

.plan-summary-grid article {
  min-width: 0;
  padding: 15px 19px;
  border-right: 1px solid var(--line);
}

.plan-summary-grid article:last-child {
  border-right: 0;
}

.plan-summary-grid span,
.plan-summary-grid small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.plan-summary-grid strong {
  display: block;
  margin: 7px 0 3px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
  line-height: 1;
  font-weight: 500;
}

.plan-summary-grid small {
  color: var(--faint);
}

.plan-week2-panel {
  margin-top: 18px;
  padding: 22px;
}

.plan-week2-score {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 9px;
  font-weight: 600;
}

.plan-week2-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
  gap: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.plan-week2-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.plan-week2-heading strong {
  font-size: 12px;
}

.plan-week2-heading span {
  color: var(--faint);
  font-size: 8px;
}

.plan-week2-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.week2-check {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  cursor: default;
}

.week2-check.is-complete {
  border-color: rgba(20, 58, 50, .2);
  background: var(--lime-soft);
}

label.week2-check {
  cursor: pointer;
}

.week2-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.week2-check-icon {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: transparent;
  background: #fff;
}

.week2-check-icon .icon {
  width: 12px;
  height: 12px;
}

.week2-check.is-complete .week2-check-icon,
.week2-check input:checked + .week2-check-icon {
  border-color: var(--deep);
  background: var(--deep);
  color: #fff;
}

.week2-check-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.week2-check-copy strong {
  font-size: 10px;
  font-weight: 600;
}

.week2-check-copy small {
  color: var(--faint);
  font-size: 8px;
}

.plan-week2-stretch {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.plan-week2-stretch ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.8;
}

.plan-week2-stretch p {
  margin: 13px 0 0;
  padding: 9px 10px;
  border-left: 2px solid var(--coral);
  background: rgba(229, 104, 75, .05);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.plan-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr);
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.plan-target-panel,
.plan-week-panel,
.plan-method-panel {
  padding: 22px;
}

.plan-auto-note {
  color: var(--faint);
  font-size: 9px;
}

.plan-item-list {
  display: grid;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.plan-target-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.plan-target-index {
  color: var(--faint);
  font-family: Georgia, "Songti SC", serif;
  font-size: 13px;
}

.plan-target-copy {
  min-width: 0;
}

.plan-target-copy strong {
  font-size: 12px;
  font-weight: 600;
}

.plan-target-copy p {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.plan-target-meter,
.plan-week-meter {
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}

.plan-target-meter span,
.plan-week-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width .3s ease;
}

.plan-target-row.is-complete .plan-target-meter span {
  background: var(--lime);
}

.plan-target-action {
  min-width: 176px;
  display: grid;
  justify-items: end;
  gap: 7px;
}

.plan-target-percent {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.plan-target-row.is-complete .plan-target-percent {
  color: var(--deep);
}

.plan-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.plan-stepper button {
  width: 23px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-strong);
  color: var(--muted);
  cursor: pointer;
}

.plan-stepper button:hover {
  background: var(--blue-soft);
}

.plan-stepper button:disabled {
  cursor: not-allowed;
  opacity: .35;
}

.plan-stepper input {
  width: 50px;
  height: 25px;
  padding: 0 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 10px;
  text-align: center;
}

.plan-stepper span,
.plan-derived span,
.plan-derived small {
  color: var(--faint);
  font-size: 8px;
  white-space: nowrap;
}

.plan-derived {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.plan-derived b {
  color: var(--ink);
  font-size: 14px;
}

.plan-derived small {
  color: var(--muted);
}

.plan-done-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.plan-done-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--deep);
}

.plan-target-row.is-complete .plan-done-toggle {
  border-color: rgba(20, 58, 50, .2);
  background: var(--lime-soft);
  color: var(--deep);
}

.plan-side {
  display: grid;
  gap: 18px;
}

.plan-week-list {
  display: grid;
  gap: 13px;
}

.plan-week-row {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.plan-week-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.plan-week-row header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.plan-week-row header strong {
  color: var(--coral);
  font-family: Georgia, "Songti SC", serif;
  font-size: 17px;
  font-weight: 500;
}

.plan-week-row header span,
.plan-week-row header em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.plan-week-row header em {
  margin-left: auto;
  color: var(--faint);
}

.plan-week-row p {
  margin: 5px 0 8px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.plan-week-row small {
  display: block;
  margin-top: 5px;
  color: var(--faint);
  font-size: 8px;
  text-align: right;
}

.plan-method-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}

.plan-method-panel p + p {
  margin-top: 9px;
  color: var(--faint);
}

.plan-detail-panel {
  margin-top: 18px;
  padding: 22px;
}

.plan-view-toggle {
  width: 154px;
}

.plan-view-toggle button {
  min-height: 32px;
}

.plan-detail-body {
  display: grid;
  gap: 9px;
  margin-top: 6px;
}

.plan-detail-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  overflow: hidden;
}

.plan-detail-item > summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 42px 13px 15px;
  cursor: pointer;
  list-style: none;
}

.plan-detail-item > summary::-webkit-details-marker {
  display: none;
}

.plan-detail-item > summary::after {
  content: "+";
  position: absolute;
  right: 15px;
  top: 50%;
  color: var(--coral);
  font-size: 18px;
  transform: translateY(-50%);
}

.plan-detail-item[open] > summary::after {
  content: "−";
}

.plan-detail-item > summary strong {
  font-family: Georgia, "Songti SC", serif;
  font-size: 16px;
  font-weight: 500;
}

.plan-detail-item > summary span {
  color: var(--muted);
  font-size: 9px;
}

.plan-detail-count {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue) !important;
  font-size: 8px !important;
  white-space: nowrap;
}

.plan-day-list {
  border-top: 1px solid var(--line);
  padding: 0 15px;
}

.plan-day-entry {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.plan-day-entry:last-child {
  border-bottom: 0;
}

.plan-day-entry.is-today {
  padding-left: 8px;
  border-left: 2px solid var(--coral);
}

.plan-day-date {
  display: grid;
  gap: 1px;
}

.plan-day-date strong {
  font-size: 11px;
}

.plan-day-date small {
  color: var(--faint);
  font-size: 8px;
}

.plan-day-focus {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.plan-task-checks {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.plan-task-check {
  position: relative;
  cursor: pointer;
}

.plan-task-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.plan-task-check span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-size: 8px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.plan-task-check input:checked + span {
  border-color: var(--deep);
  background: var(--deep);
  color: #fff;
}

.plan-task-check input:focus-visible + span {
  outline: 2px solid var(--coral);
  outline-offset: 1px;
}

.plan-day-detail {
  padding: 0 15px 15px 97px;
  border-top: 1px solid var(--line);
}

.plan-day-detail > p {
  margin: 13px 0 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.plan-day-detail-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  color: var(--faint);
  font-size: 8px;
}

.signal-list {
  margin: 0;
}

.signal-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.signal-list div:last-child {
  border-bottom: 0;
}

.signal-list dt {
  color: var(--muted);
  font-size: 11px;
}

.signal-list dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.next-action {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 15px;
  align-items: start;
}

.action-number {
  color: var(--coral);
  font-family: Georgia, "Songti SC", serif;
  font-size: 34px;
  line-height: 1;
}

.next-action p {
  margin: 2px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 18px;
  line-height: 1.45;
}

.fine-print {
  margin: 16px 0 0;
  color: var(--faint);
  font-size: 9px;
}

.settings-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .78fr);
}

.settings-form {
  display: grid;
  gap: 18px;
}

.settings-form .panel-head {
  margin-bottom: 0;
}

.settings-form input[type="date"] {
  min-height: 41px;
  padding: 0 10px;
}

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

.goal-editor {
  display: grid;
  gap: 8px;
}

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

.data-copy {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
}

.data-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sync-panel {
  margin-top: 18px;
  padding: 22px;
}

.sync-indicator {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eceee9;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.sync-indicator[data-state="online"] {
  background: var(--lime-soft);
  color: var(--deep);
}

.sync-indicator[data-state="error"] {
  background: var(--coral-soft);
  color: #a7432d;
}

.sync-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 13px 14px;
  border-left: 2px solid var(--blue);
  background: rgba(49, 95, 174, .045);
}

.sync-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

code {
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(20, 58, 50, .08);
  color: var(--deep);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .92em;
}

.sync-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 8px;
}

.sync-form .field-block {
  margin-top: 0;
}

.sync-form input[type="url"],
.sync-form input[type="password"] {
  min-height: 41px;
  padding: 0 10px;
  font-size: 11px;
}

.auto-sync-toggle {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  cursor: pointer;
}

.auto-sync-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--deep);
}

.auto-sync-toggle span {
  display: grid;
}

.auto-sync-toggle b {
  font-size: 10px;
}

.auto-sync-toggle small {
  color: var(--faint);
  font-size: 8px;
}

.sync-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sync-actions > span {
  color: var(--muted);
  font-size: 10px;
}

.sync-actions > div {
  display: flex;
  gap: 8px;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.danger-zone strong {
  font-size: 11px;
}

.danger-zone p {
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 9px;
}

.danger-button {
  min-width: 84px;
  padding: 0 12px;
  border: 1px solid rgba(183, 66, 44, .35);
  background: #fff5f2;
  color: #a53b28;
  font-size: 10px;
}

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

.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 28px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 9px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: min(340px, calc(100vw - 32px));
  padding: 11px 14px;
  border-radius: 6px;
  background: var(--deep);
  color: #fff;
  font-size: 11px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.photo-dialog {
  width: min(92vw, 980px);
  max-height: 90vh;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: #0e1513;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
}

.photo-dialog::backdrop {
  background: rgba(10, 16, 14, .72);
}

.photo-dialog img {
  display: block;
  width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.photo-dialog-close {
  position: fixed;
  z-index: 1;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: rgba(10, 16, 14, .72);
  color: #fff;
  cursor: pointer;
}

@media (max-width: 1120px) {
  :root {
    --sidebar: 84px;
  }

  .sidebar {
    align-items: center;
    padding: 24px 12px 16px;
  }

  .brand {
    padding: 0;
  }

  .brand-copy,
  .nav-item span,
  .sidebar-foot {
    display: none;
  }

  .primary-nav {
    width: 100%;
    margin-top: 38px;
  }

  .nav-item {
    justify-content: center;
    padding: 12px;
  }

  .nav-item .icon {
    width: 20px;
    height: 20px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .right-stack {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --sidebar: 0px;
  }

  body {
    background-size: 22px 22px;
  }

  .sidebar {
    inset: auto 0 0;
    width: 100%;
    height: 68px;
    display: block;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, .12);
  }

  .brand,
  .sidebar-foot {
    display: none;
  }

  .primary-nav {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
    min-width: 0;
  }

  .nav-item {
    min-height: 0;
    min-width: 0;
    height: 100%;
    display: grid;
    place-content: center;
    gap: 3px;
    padding: 4px;
  }

  .nav-item span {
    display: block;
  }

  .nav-item b {
    font-size: 9px;
  }

  .nav-item small {
    display: none;
  }

  .nav-item .icon {
    width: 18px;
    height: 18px;
    justify-self: center;
  }

  .main {
    margin: 0;
    padding: 20px 15px 94px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 18px;
  }

  h1 {
    font-size: 28px;
  }

  .date-tools {
    width: 100%;
  }

  .date-picker {
    flex: 1;
  }

  .date-picker input {
    width: 100%;
  }

  .focus-banner {
    min-height: 220px;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 24px 21px;
  }

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

  .focus-art {
    display: none;
  }

  .focus-copy h2 {
    font-size: 28px;
  }

  .countdown-block {
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: end;
    gap: 4px 10px;
    padding: 14px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .16);
    border-left: 0;
  }

  .countdown-block strong {
    font-size: 34px;
  }

  .countdown-block small {
    grid-column: 2;
    align-self: end;
    justify-self: end;
    margin: 0 0 5px;
  }

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

  .metric {
    border-bottom: 1px solid var(--line);
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(3),
  .metric:nth-child(4) {
    border-bottom: 0;
  }

  .checkin-panel,
  .week-panel,
  .wellbeing-panel,
  .chart-panel,
  .insight-grid .panel,
  .settings-grid .panel {
    padding: 17px;
  }

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

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

  .right-stack,
  .insight-grid,
  .settings-grid,
  .review-grid,
  .plan-content-grid,
  .reflection-grid {
    grid-template-columns: 1fr;
  }

  .review-stage {
    padding: 20px 17px;
  }

  .review-summary-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .review-summary-bar .primary-button {
    width: 100%;
  }

  .ai-plan-box {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-button {
    width: 100%;
  }

  .plan-history {
    grid-template-columns: 1fr;
  }

  .sync-intro,
  .sync-form {
    grid-template-columns: 1fr;
  }

  .sync-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .sync-actions > div {
    width: 100%;
  }

  .sync-actions > div button {
    flex: 1;
  }

  .sync-badge {
    display: none;
  }

  .plan-scoreboard {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    padding: 23px 20px;
  }

  .plan-score-copy h2 {
    font-size: 27px;
  }

  .plan-ring {
    width: 98px;
    height: 98px;
  }

  .plan-ring > div {
    width: 80px;
    height: 80px;
  }

  .plan-ring strong {
    font-size: 23px;
  }

  .plan-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .plan-summary-grid article:nth-child(2) {
    border-right: 0;
  }

  .plan-summary-grid article:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .plan-week2-panel {
    padding: 18px;
  }

  .plan-week2-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .plan-week2-checks {
    grid-template-columns: 1fr;
  }

  .plan-week2-stretch {
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .plan-target-panel,
  .plan-week-panel,
  .plan-method-panel {
    padding: 18px;
  }

  .plan-target-row {
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
  }

  .plan-target-action {
    grid-column: 2;
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .plan-week-row header {
    flex-wrap: wrap;
  }

  .plan-detail-panel {
    padding: 18px;
  }

  .plan-detail-panel .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .plan-view-toggle {
    width: 100%;
  }

  .plan-detail-item > summary {
    flex-wrap: wrap;
    gap: 5px 9px;
  }

  .plan-detail-count {
    order: 3;
    margin-left: 0;
  }

  .plan-day-entry {
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: start;
  }

  .plan-task-checks {
    grid-column: 2;
    justify-content: flex-start;
  }

  .plan-day-detail {
    padding-left: 15px;
  }

  .journal-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .journal-entry {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .journal-date {
    display: flex;
    align-items: baseline;
    gap: 7px;
    grid-column: 1 / -1;
  }

  .journal-date strong {
    font-size: 18px;
  }

  .journal-score {
    grid-column: 2;
    grid-row: 2;
  }

  .insight-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 23px 21px;
  }

  .insight-score {
    text-align: left;
  }

  .bar-chart {
    height: 250px;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 4px;
    padding-top: 14px;
  }

  .chart-columns {
    gap: 2px;
  }

  .chart-axis-scale span,
  .bar-value {
    font-size: 7px;
  }

  .bar-column small {
    font-size: 6px;
  }

  .bar-column small b {
    font-size: 8px;
  }

  .data-actions {
    grid-template-columns: 1fr;
  }

  .toast {
    right: 16px;
    bottom: 84px;
  }
}

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