:root {
  color-scheme: light;
  --bg: #f6f6f0;
  --paper: #fffefa;
  --ink: #1d352d;
  --muted: #5c6c64;
  --border: #dedfd5;
  --accent: #166046;
  --accent-dark: #114936;
  --green-soft: #eaf2e9;
  --warm: #f7efdc;
  --radius: 17px;
  --shadow: 0 2px 4px #223d2e05;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #36836a; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg { flex: 0 0 auto; vertical-align: middle; }

.shell, .top-inner { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
.topbar { background: #fbfbf7; border-bottom: 1px solid var(--border); }
.top-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; min-height: 74px; }
.brand { display: inline-flex; align-items: center; gap: 11px; justify-self: start; font-size: 15px; font-weight: 760; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-dark); color: white; }
.brand-icon svg { width: 21px; height: 21px; }
.brand small { display: block; color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .16em; margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 5px; }
.nav a { display: flex; align-items: center; gap: 7px; border-radius: 8px; padding: 10px 13px; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.nav svg { width: 16px; height: 16px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent-dark); background: #e7efe6; }
.settings { justify-self: end; border: 1px solid var(--border) !important; }

.page-head { min-height: 164px; padding-block: 35px 29px; display: flex; align-items: end; justify-content: space-between; gap: 15px; }
.eyebrow { display: flex; gap: 7px; align-items: center; color: var(--accent); font: 700 10px/1.3 system-ui, sans-serif; letter-spacing: .17em; }
.eyebrow i, .footer i { width: 6px; height: 6px; border-radius: 50%; background: #4d8e6c; }
.page-head h1 { font-size: clamp(30px, 4vw, 43px); letter-spacing: -.045em; line-height: 1.25; margin: 9px 0 7px; }
.page-head p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.date-chip { display: flex; gap: 11px; align-items: center; padding: 11px 15px; background: var(--paper); border: 1px solid var(--border); border-radius: 11px; flex-shrink: 0; }
.date-chip svg { color: var(--accent); }
.date-chip strong { display: block; font-size: 13px; }
.date-chip small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); min-width: 0; }
.section-head { display: flex; align-items: center; gap: 12px; padding: 19px 21px 16px; }
.section-head > div:nth-child(2) { min-width: 0; }
.section-icon { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; background: var(--green-soft); color: var(--accent); }
.section-icon svg { width: 19px; height: 19px; }
.section-head h2 { font-size: 18px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.section-head p { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.55; }
.section-actions { display: flex; justify-content: end; align-items: center; flex-wrap: wrap; gap: 5px; margin-left: auto; }
.section-body { padding: 0 21px 19px; }
.checklist { background: linear-gradient(110deg, #fdfef8, #f7faf3 95%); border-color: #d7e2d6; }
.check-content { display: grid; grid-template-columns: 215px minmax(0, 1fr); gap: 23px; margin: 0 21px 19px; padding-top: 16px; border-top: 1px solid #dee8dc; }
.progress { display: flex; align-items: center; gap: 13px; min-height: 63px; align-self: start; }
.progress strong { font-size: 13px; }
.progress small { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.ring { display: grid; place-items: center; width: 61px; height: 61px; flex: 0 0 61px; border-radius: 50%; background: conic-gradient(var(--accent) var(--progress), #deeadc 0); }
.ring span { display: grid; place-content: center; display: flex; align-items: baseline; justify-content: center; width: 51px; height: 51px; border-radius: 50%; background: #fbfdf7; padding-top: 12px; white-space: nowrap; }
.ring strong { font-size: 20px; line-height: 1.2; }
.ring b { color: var(--muted); font-size: 11px; font-weight: 500; margin-left: 3px; }
.check-items { display: grid; gap: 8px; align-content: start; }
.check-item { position: relative; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 13px; background: #fffefa; border: 1px solid #dce3d9; border-radius: 10px; cursor: pointer; }
.check-item:hover { border-color: #9ebaa7; }
.check-item.checked { background: #ecf4ec; }
.check-item:focus-within { outline: 2px solid #36836a; outline-offset: 2px; }
.check-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checkbox, .task-check { display: grid; place-items: center; width: 21px; height: 21px; flex: 0 0 21px; padding: 0; border: 1px solid #aebfb2; border-radius: 6px; background: #fffefa; color: transparent; }
.checkbox svg, .task-check svg { width: 15px; height: 15px; stroke-width: 2; }
.check-item.checked .checkbox, .task-check.is-done { background: var(--accent); color: white; border-color: var(--accent); }
.check-title { font-weight: 650; font-size: 14px; overflow-wrap: anywhere; }
.check-status { color: var(--muted); font-size: 11px; margin-left: auto; white-space: nowrap; }
.checked .check-status { color: var(--accent); }

.dashboard { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.stack { display: grid; align-content: start; gap: 18px; min-width: 0; }
.empty-tasks { display: grid; justify-items: center; align-content: center; min-height: 155px; text-align: center; padding: 22px 14px; border: 1px dashed #dde3d8; border-radius: 12px; background: #fafbf6; }
.empty-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; background: #e8efe4; color: var(--accent); margin-bottom: 9px; }
.empty-icon svg { width: 18px; height: 18px; }
.empty-tasks h3 { font-size: 14px; }
.empty-tasks p, .empty-inline { font-size: 12px; color: var(--muted); line-height: 1.65; }
.empty-tasks p { margin-top: 5px; }
.empty-inline { padding-block: 9px; }
.note-empty { border-top: 1px solid #edece4; padding: 13px 0 2px; }
.count { margin-left: auto; color: #416354; font-size: 27px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.upcoming-empty { min-height: 59px; padding-top: 13px; border-top: 1px solid #edece4; }
.upcoming-row { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; border-top: 1px solid #edece4; background: transparent; color: var(--ink); padding: 11px 2px; text-align: left; }
.upcoming-row:hover { color: var(--accent); }
.upcoming-row > svg { margin-left: auto; width: 15px; height: 15px; color: var(--muted); }
.upcoming-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #b18843; }
.upcoming-row strong, .upcoming-row small { display: block; overflow-wrap: anywhere; }
.upcoming-row strong { font-size: 13px; }
.upcoming-row small { font-size: 11px; color: var(--muted); margin-top: 4px; }
.text-link { display: inline-flex; gap: 5px; align-items: center; padding: 2px 0; border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 700; }
.text-link:hover { text-decoration: underline; }
.text-link svg { width: 15px; height: 15px; }
.upcoming .text-link { margin-top: 5px; }
.flow-tip { border: 1px solid #e6dcc2; border-radius: var(--radius); background: var(--warm); padding: 17px 20px; }
.tip-label { display: inline-flex; align-items: center; gap: 6px; color: #765925; font-size: 11px; font-weight: 700; }
.tip-label svg { width: 16px; height: 16px; }
.flow-tip h2 { margin-top: 7px; color: #453923; font-size: 16px; }
.flow-tip p { color: #645843; font-size: 12px; line-height: 1.65; }
.example { display: flex; align-items: center; gap: 8px; margin: 10px 0; color: #805d25; }
.example span { padding: 4px 8px; border-radius: 5px; border: 1px solid #e9d9b6; background: #fffaed; font-size: 11px; font-weight: 650; }
.example svg { width: 14px; height: 14px; }
.flow-tip .text-link { margin-top: 9px; }

.button, .icon-button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 35px; border: 1px solid transparent; border-radius: 8px; padding: 6px 11px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.button svg, .icon-button svg { width: 16px; height: 16px; }
.button.primary { background: var(--accent); color: white; }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { background: var(--paper); border-color: var(--border); color: var(--ink); }
.button.secondary:hover, .button.quiet:hover, .icon-button:hover { background: var(--green-soft); color: var(--accent-dark); }
.button.quiet, .icon-button { background: transparent; color: var(--muted); }
.icon-button { width: 35px; flex: 0 0 35px; padding: 0; }
.button.danger { margin-right: auto; background: #f8ede8; color: #8c3d30; }
.button.danger:hover { background: #f3ddd4; }
.task-row { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 9px 0; border-top: 1px solid #eeeee5; }
.task-check:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.task-check.is-done:hover { color: white; background: var(--accent-dark); }
.task-check.decision-check { color: #785621; background: #f8eed5; border-color: #dfcda3; }
.task-check:disabled { color: #829188; border-color: #dee5dc; }
.task-check:disabled svg { width: 13px; height: 13px; }
.task-copy { min-width: 0; margin-right: auto; }
.task-copy strong, .task-copy small { display: block; overflow-wrap: anywhere; }
.task-copy strong { font-size: 14px; }
.task-copy small { color: var(--muted); font-size: 11px; line-height: 1.45; margin-top: 4px; }
.badge { flex-shrink: 0; border-radius: 5px; padding: 4px 7px; font-size: 11px; font-weight: 650; }
.badge.good { color: #225b44; background: #e6f1e6; }
.badge.warm { color: #785621; background: #f8eed5; }
.badge.late { color: #863d31; background: #f8e7e0; }
.badge.muted { color: var(--muted); background: #eff0eb; }
.done-list { margin-top: 11px; color: var(--muted); }
.done-list summary { padding: 8px 0; cursor: pointer; font-size: 12px; font-weight: 650; }
.done-list summary span { margin-left: 5px; }
.flow-note { margin-bottom: 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; color: var(--muted); }
.filters { display: flex; gap: 6px; margin-bottom: 15px; }
.filters button { padding: 7px 13px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 13px; }
.filters button[aria-pressed="true"] { background: var(--green-soft); border-color: #d3e2d4; color: var(--accent-dark); font-weight: 700; }
.note { border-top: 1px solid #eeeee5; padding: 8px 0 11px; }
.note-head { display: flex; justify-content: space-between; align-items: center; }
.note time { font-size: 11px; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.note p { font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; padding: 15px 0 25px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.footer span { display: flex; align-items: center; gap: 6px; }

dialog { width: min(525px, calc(100% - 28px)); max-height: calc(100% - 32px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 0 22px 75px #132a2a35; }
dialog::backdrop { background: #182c25a3; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; padding: 18px 21px 14px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { font-size: 20px; }
.dialog-head p { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.55; }
.dialog-body { padding: 17px 21px 20px; }
.dialog-message { margin-bottom: 12px; border-radius: 7px; padding: 8px 10px; color: #863d31; background: #f8e7e0; font-size: 12px; }
.dialog-body form:not(.manage-row):not(.inline-form) { display: grid; gap: 12px; }
.dialog-body label { display: block; font-size: 13px; font-weight: 650; min-width: 0; }
.dialog-body input, .dialog-body textarea, .dialog-body select { display: block; width: 100%; min-height: 36px; margin-top: 5px; padding: 7px 9px; color: var(--ink); border: 1px solid #ced9ce; border-radius: 7px; background: white; font-size: 13px; font-weight: 400; }
.dialog-body textarea { resize: vertical; }
.dialog-body input::placeholder, .dialog-body textarea::placeholder { color: #727f75; }
.optional, .field-hint { color: var(--muted); font-size: 11px; font-weight: 400; }
.field-hint { margin-top: 4px; line-height: 1.5; }
.step-input { display: flex; align-items: end; gap: 5px; padding-left: 10px; border-left: 2px solid #c6dccb; }
.step-input + .step-input { margin-top: 9px; }
.step-input > div { flex: 1; min-width: 0; }
.step-input .option { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--muted); font-size: 11px; font-weight: 500; }
.step-input .option input { width: 14px; height: 14px; min-height: 0; margin: 0; accent-color: var(--accent); }
.decision-detail { padding-bottom: 11px; }
.decision-detail p { margin-top: 6px; color: var(--muted); font-size: 13px; }
.decision-actions { flex-wrap: wrap; }
.decision-actions .quiet { margin-right: auto; }
.form-actions { display: flex; gap: 7px; justify-content: end; margin-top: 3px; padding-top: 12px; border-top: 1px solid var(--border); }
.inline-form, .manage-row { display: flex; align-items: end; gap: 6px; }
.inline-form label, .manage-row input { flex: 1; }
.manage-row input { min-width: 0; margin: 0; }
.manage-list { display: grid; gap: 7px; margin-bottom: 14px; }
.history-list { margin-top: 12px; margin-bottom: 0; }
.history-row { min-height: 39px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px solid #eeeee5; font-size: 13px; overflow-wrap: anywhere; }
.toast { display: none; position: fixed; z-index: 3; right: 20px; bottom: 20px; max-width: calc(100% - 40px); padding: 10px 15px; border-radius: 8px; color: white; background: var(--accent-dark); font-size: 13px; box-shadow: 0 3px 12px #142a2740; }
.toast.visible { display: block; }

@media (max-width: 850px) {
  .shell, .top-inner { width: calc(100% - 40px); }
  .dashboard { grid-template-columns: minmax(0, 1.36fr) minmax(0, 1fr); gap: 12px; }
  .stack { gap: 12px; }
  .section-head { padding-inline: 15px; }
  .section-body { padding-inline: 15px; }
  .check-content { margin-inline: 15px; grid-template-columns: 170px minmax(0, 1fr); gap: 10px; }
}

@media (max-width: 640px) {
  .shell, .top-inner { width: calc(100% - 28px); }
  .top-inner { grid-template-columns: 1fr auto; gap: 8px; padding-top: 10px; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-content: start; padding-bottom: 7px; }
  .nav a { padding: 7px 10px; }
  .settings { grid-row: 1; grid-column: 2; }
  .page-head { min-height: auto; padding-block: 24px 18px; align-items: start; flex-wrap: wrap; }
  .page-head h1 { margin: 6px 0 4px; }
  .date-chip { padding: 8px 10px; }
  .date-chip strong { font-size: 12px; }
  .date-chip small { margin-top: 2px; }
  .dashboard { grid-template-columns: minmax(0, 1fr); margin-top: 12px; }
  .check-content { grid-template-columns: minmax(0, 1fr); }
  .checklist .section-head { flex-wrap: wrap; gap: 8px; }
  .checklist .section-actions { margin-left: 42px; }
  .section-head { padding-top: 14px; padding-bottom: 13px; }
  .section-icon { width: 34px; height: 34px; }
  .section-head h2 { font-size: 16px; }
  .footer { flex-wrap: wrap; }
}
