:root {
  --paper: #f3efe6;
  --paper-raised: #faf8f2;
  --morning-mist: #ddd8ce;
  --pencil-soft: #8c887f;
  --graphite: #282824;
  --graphite-muted: #66635d;
  --tea-line: #b7a995;
  --sunrise-action: #d96532;
  --sunrise-action-dark: #a84620;
  --leaf-ready: #5e765c;
  --warning-wash: #f6e5da;
  --focus-ring: rgba(217, 101, 50, 0.28);
  --hairline: rgba(57, 53, 47, 0.13);
  --radius-sheet: 22px;
  --radius-control: 12px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 34px;
  --space-6: 48px;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--graphite);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(52, 49, 43, 0.035) 1px, transparent 1px) 0 132px / 100% 32px,
    var(--paper);
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: var(--space-3);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  border-bottom: 1px solid var(--hairline);
}

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

.sun-mark {
  position: relative;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--sunrise-action);
  border-radius: 50%;
}

.sun-mark::after {
  position: absolute;
  right: -5px;
  bottom: 3px;
  left: -5px;
  height: 7px;
  content: "";
  background: var(--paper);
  border-top: 1.5px solid var(--sunrise-action);
}

.today {
  color: var(--graphite-muted);
  font-size: 13px;
}

.header-tools {
  display: flex;
  gap: 12px;
  align-items: center;
}

.sync-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 9px;
  color: var(--graphite-muted);
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
}

.sync-pill span {
  width: 7px;
  height: 7px;
  background: var(--pencil-soft);
  border-radius: 50%;
}

.sync-pill.is-connected span {
  background: var(--leaf-ready);
}

.sync-pill.is-error span {
  background: var(--sunrise-action);
}

.progress-region {
  padding: var(--space-4) 0 var(--space-3);
}

.progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  color: var(--graphite-muted);
  font-size: 13px;
}

.progress-copy strong {
  color: var(--graphite);
  font-size: 14px;
  font-weight: 650;
}

.progress-track {
  height: 3px;
  overflow: hidden;
  background: var(--morning-mist);
}

.progress-fill {
  height: 100%;
  background: var(--sunrise-action);
  transition: width 180ms ease-out;
}

.plan-sheet {
  min-height: 570px;
  padding: clamp(24px, 6vw, 52px);
  background: rgba(250, 248, 242, 0.88);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sheet);
}

.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--sunrise-action-dark);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 590px;
  margin: 0;
  font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif;
  font-size: clamp(31px, 7vw, 50px);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1.15;
}

.lead {
  max-width: 560px;
  margin: var(--space-3) 0 var(--space-5);
  color: var(--graphite-muted);
  font-size: 16px;
  line-height: 1.75;
}

.capture-field {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 18px 18px 18px 44px;
  color: var(--graphite);
  line-height: 32px;
  background:
    linear-gradient(90deg, transparent 0 27px, rgba(217, 101, 50, 0.24) 27px 28px, transparent 28px),
    repeating-linear-gradient(transparent 0 31px, rgba(80, 75, 68, 0.1) 31px 32px),
    var(--paper-raised);
  border: 1px solid var(--tea-line);
  border-radius: var(--radius-control);
}

.capture-field::placeholder {
  color: #98938a;
}

.preset-board {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.preset-board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.preset-board-heading .mini-label {
  margin-bottom: 0;
}

.preset-group {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: var(--space-2);
  align-items: start;
}

.preset-group-label {
  padding-top: 10px;
  color: var(--graphite-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

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

.preset-chip {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px 11px;
  text-align: left;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.preset-chip span {
  display: grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--graphite-muted);
  font-size: 13px;
  border: 1px solid var(--tea-line);
  border-radius: 50%;
}

.preset-chip:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--tea-line);
}

.preset-chip:active:not(:disabled) {
  transform: translateY(1px);
}

.preset-chip.is-selected {
  color: var(--sunrise-action-dark);
  font-weight: 700;
  background: var(--warning-wash);
  border-color: rgba(169, 70, 32, 0.45);
}

.preset-chip.is-selected span {
  color: white;
  background: var(--sunrise-action);
  border-color: var(--sunrise-action);
}

.preset-chip:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.custom-task-label {
  margin-top: var(--space-1);
}

.field-meta,
.section-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
  color: var(--graphite-muted);
  font-size: 13px;
}

.text-button {
  padding: 4px 0;
  color: var(--sunrise-action-dark);
  font-weight: 650;
  background: none;
  border: 0;
  cursor: pointer;
}

.task-list {
  display: grid;
  gap: var(--space-2);
}

.task-choice {
  position: relative;
  display: grid;
  grid-template-columns: 27px 1fr;
  gap: var(--space-3);
  align-items: start;
  width: 100%;
  padding: 16px;
  text-align: left;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.task-choice:hover {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(57, 53, 47, 0.28);
}

.task-choice:active {
  transform: translateY(1px);
}

.task-choice.is-selected {
  background: var(--warning-wash);
  border-color: rgba(169, 70, 32, 0.45);
}

.choice-marker {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: var(--graphite-muted);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--tea-line);
  border-radius: 50%;
}

.is-selected .choice-marker {
  color: white;
  background: var(--sunrise-action);
  border-color: var(--sunrise-action);
}

.task-text {
  padding-top: 2px;
  font-size: 16px;
  line-height: 1.5;
}

.task-choice small {
  display: block;
  margin-top: 4px;
  color: var(--graphite-muted);
}

.energy-block {
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--hairline);
}

.mini-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 13px;
  font-weight: 700;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.segment {
  min-height: 48px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  cursor: pointer;
}

.segment:hover {
  border-color: var(--tea-line);
}

.segment.is-selected {
  color: var(--sunrise-action-dark);
  font-weight: 700;
  background: var(--warning-wash);
  border-color: rgba(169, 70, 32, 0.45);
}

.primary-task-callout {
  margin-bottom: var(--space-3);
  padding: 14px 16px;
  background: rgba(94, 118, 92, 0.08);
  border-left: 3px solid var(--leaf-ready);
}

.primary-task-callout span {
  display: block;
  color: var(--leaf-ready);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.primary-task-callout strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.route-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: end;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--hairline);
}

.route-date {
  color: var(--graphite-muted);
  font-size: 13px;
}

.time-field {
  display: grid;
  gap: 4px;
  color: var(--graphite-muted);
  font-size: 11px;
}

.time-field input {
  width: 112px;
  padding: 8px 10px;
  color: var(--graphite);
  background: transparent;
  border: 1px solid var(--tea-line);
  border-radius: 9px;
}

.route {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 62px;
  width: 1px;
  content: "";
  background: var(--tea-line);
}

.route-stop {
  position: relative;
  display: grid;
  grid-template-columns: 46px 16px 1fr;
  gap: 9px;
  align-items: start;
  min-height: 82px;
}

.route-time {
  padding-top: 2px;
  color: var(--graphite-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.route-dot {
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 4px;
  background: var(--paper-raised);
  border: 2px solid var(--pencil-soft);
  border-radius: 50%;
}

.route-stop.is-main .route-dot {
  background: var(--sunrise-action);
  border-color: var(--sunrise-action);
}

.route-stop.is-end .route-dot {
  background: var(--leaf-ready);
  border-color: var(--leaf-ready);
}

.route-content strong {
  display: block;
  line-height: 1.45;
}

.route-content span {
  display: block;
  margin-top: 4px;
  color: var(--graphite-muted);
  font-size: 12px;
}

.commit-note {
  margin: var(--space-3) 0 0;
  padding: 12px 14px;
  color: var(--graphite-muted);
  font-size: 13px;
  line-height: 1.55;
  background: rgba(183, 169, 149, 0.14);
  border-radius: 10px;
}

.connected-panel {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin-top: var(--space-2);
  padding: 13px 14px;
  text-align: left;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  cursor: pointer;
}

.connected-panel:hover {
  background: rgba(255, 255, 255, 0.45);
  border-color: var(--tea-line);
}

.connected-panel strong,
.connected-panel small {
  display: block;
}

.connected-panel small {
  margin-top: 3px;
  color: var(--graphite-muted);
}

.connected-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: white;
  background: var(--leaf-ready);
  border-radius: 50%;
}

.footer-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: flex-end;
  margin-top: var(--space-5);
}

.button {
  min-height: 48px;
  padding: 0 21px;
  font-weight: 700;
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button-primary {
  color: white;
  background: var(--sunrise-action);
  border: 1px solid var(--sunrise-action);
}

.button-primary:hover:not(:disabled) {
  background: var(--sunrise-action-dark);
  border-color: var(--sunrise-action-dark);
}

.button-primary:disabled {
  color: #8a867e;
  background: var(--morning-mist);
  border-color: var(--morning-mist);
  cursor: not-allowed;
}

.button-secondary {
  background: transparent;
  border: 1px solid var(--tea-line);
}

.button-secondary:hover {
  background: rgba(255, 255, 255, 0.45);
}

.finish-sheet {
  display: grid;
  min-height: 570px;
  place-items: center;
  padding: clamp(26px, 6vw, 52px);
  text-align: center;
  background: rgba(250, 248, 242, 0.88);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sheet);
}

.finish-content {
  width: min(100%, 500px);
}

.finish-mark {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto var(--space-4);
  place-items: center;
  color: white;
  font-size: 28px;
  background: var(--leaf-ready);
  border-radius: 50%;
}

.finish-content h1 {
  font-size: clamp(34px, 8vw, 48px);
}

.finish-focus {
  margin: var(--space-4) 0;
  padding: 18px;
  text-align: left;
  background: var(--warning-wash);
  border-left: 3px solid var(--sunrise-action);
}

.finish-focus span {
  display: block;
  color: var(--sunrise-action-dark);
  font-size: 12px;
  font-weight: 750;
}

.finish-focus strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.45;
}

.prototype-state {
  margin: var(--space-3) 0 80px;
  color: var(--graphite-muted);
  font-size: 12px;
}

.prototype-state summary {
  width: fit-content;
  padding: 7px 0;
  cursor: pointer;
}

.prototype-state pre {
  overflow-x: auto;
  padding: 14px;
  color: #e9e4d9;
  line-height: 1.5;
  background: #33312d;
  border-radius: 10px;
}

.prototype-badge {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 7px 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(40, 40, 36, 0.92);
  border-radius: 999px;
}

.empty-support {
  padding: var(--space-4);
  color: var(--graphite-muted);
  line-height: 1.6;
  text-align: center;
  border: 1px dashed var(--tea-line);
  border-radius: var(--radius-control);
}

.preset-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: var(--space-3);
  background: rgba(40, 40, 36, 0.48);
}

.preset-editor {
  width: min(100%, 520px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: clamp(22px, 5vw, 34px);
  background: var(--paper-raised);
  border: 1px solid var(--tea-line);
  border-radius: 18px;
}

.preset-editor h2 {
  margin: 0;
  font-size: clamp(26px, 6vw, 34px);
  letter-spacing: -0.04em;
}

.editor-lead {
  margin: var(--space-2) 0 var(--space-4);
  color: var(--graphite-muted);
  line-height: 1.65;
}

.preset-editor-text {
  width: 100%;
  min-height: 270px;
  resize: vertical;
  padding: 10px 16px 10px 38px;
  color: var(--graphite);
  line-height: 30px;
  background:
    linear-gradient(90deg, transparent 0 23px, rgba(217, 101, 50, 0.22) 23px 24px, transparent 24px),
    repeating-linear-gradient(transparent 0 29px, rgba(80, 75, 68, 0.1) 29px 30px),
    var(--paper-raised);
  border: 1px solid var(--tea-line);
  border-radius: var(--radius-control);
}

.editor-actions {
  margin-top: var(--space-4);
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.copy-row input {
  min-width: 0;
  padding: 0 12px;
  color: var(--graphite);
  background: var(--paper);
  border: 1px solid var(--tea-line);
  border-radius: 10px;
}

.pair-code-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--tea-line);
  border-radius: 10px;
}

.pair-code-box strong {
  color: var(--sunrise-action-dark);
  font-size: 28px;
  letter-spacing: 0.18em;
}

.pair-code-box span {
  color: var(--graphite-muted);
  font-size: 12px;
}

.pair-code-box .button {
  grid-row: 1 / 3;
  grid-column: 2;
}

.compact-button {
  min-height: 42px;
  padding: 0 14px;
}

.notification-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: var(--space-4);
  padding: 16px;
  background: rgba(94, 118, 92, 0.08);
  border-left: 3px solid var(--leaf-ready);
}

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

.notification-card span {
  margin-top: 4px;
  color: var(--graphite-muted);
  font-size: 12px;
  line-height: 1.5;
}

.privacy-note {
  margin: var(--space-3) 0 0;
  color: var(--graphite-muted);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 560px) {
  .app-shell {
    padding: 0 12px 20px;
  }

  .plan-sheet,
  .finish-sheet {
    min-height: calc(100vh - 145px);
    padding: 25px 20px;
    border-radius: 18px;
  }

  .lead {
    margin-bottom: var(--space-4);
  }

  .preset-group {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .preset-group-label {
    padding-top: 0;
  }

  .preset-chip {
    min-height: 44px;
    padding: 8px 9px;
    font-size: 13px;
  }

  .footer-actions {
    align-items: stretch;
  }

  .footer-actions .button-primary {
    flex: 1;
  }

  .route-header {
    align-items: start;
  }

  .prototype-badge {
    display: none;
  }

  .preset-editor-backdrop {
    align-items: end;
    padding: 0;
  }

  .preset-editor {
    width: 100%;
    max-height: 92vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }

  .preset-editor-text {
    min-height: 220px;
  }

  .sync-pill {
    padding: 6px 8px;
  }

  .today {
    display: none;
  }

  .notification-card {
    grid-template-columns: 1fr;
  }

  .notification-card .button {
    width: 100%;
  }

  .pair-code-box {
    grid-template-columns: 1fr;
  }

  .pair-code-box .button {
    grid-row: auto;
    grid-column: auto;
    margin-top: 8px;
  }
}

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