:root {
  color-scheme: light;
  --paper: #f5f2e9;
  --paper-bright: #fbf9f4;
  --paper-deep: #ede9df;
  --ink: #28251f;
  --ink-soft: #59564f;
  --muted: #706b62;
  --line: #d8d3c8;
  --line-soft: #e4dfd5;
  --vermillion: #be412d;
  --vermillion-deep: #a53224;
  --vermillion-pale: #f4e2db;
  --gold: #bf9b4b;
  --sage: #697b63;
  --serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  --sans: 'DM Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'DM Mono', 'SFMono-Regular', Consolas, monospace;
  --shadow: 0 24px 80px rgba(39, 34, 24, .14);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(190, 65, 45, .42); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(210px, 17.1%) minmax(490px, 1fr) minmax(340px, 37.6%); }
.sidebar { min-height: 100vh; padding: 42px 26px 28px; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: rgba(251, 249, 244, .3); }
.brand { display: inline-flex; width: fit-content; flex-direction: column; gap: 8px; margin-left: 20px; }
.brand-name { font-family: var(--serif); font-size: 54px; font-weight: 600; letter-spacing: .15em; line-height: 1.1; }
.brand-caption { display: flex; gap: 8px; align-items: center; color: var(--ink-soft); font-family: var(--serif); font-size: 12px; letter-spacing: .05em; white-space: nowrap; }
.seal { display: inline-grid; width: 20px; height: 20px; place-items: center; color: var(--vermillion); border: 1px solid currentColor; font-family: var(--serif); font-size: 11px; line-height: 1; }
.primary-nav { display: grid; gap: 9px; margin-top: 60px; }
.nav-item { position: relative; min-height: 52px; padding: 0 14px 0 22px; display: flex; align-items: center; gap: 15px; color: #716e67; background: transparent; border: 0; text-align: left; cursor: pointer; transition: color .18s ease, background .18s ease; }
.nav-item::before { position: absolute; left: -27px; top: 9px; bottom: 9px; width: 3px; background: transparent; content: ''; }
.nav-item span { font-family: var(--serif); font-size: 16px; letter-spacing: .05em; }
.nav-item:hover { color: var(--vermillion); }
.nav-item.is-active { color: var(--vermillion); }
.nav-item.is-active::before { background: var(--vermillion); }
.nav-item svg { width: 21px; height: 21px; }
.sidebar-note { position: relative; margin: auto 0 32px 17px; padding-left: 15px; color: var(--ink-soft); font-family: var(--serif); }
.note-rule { position: absolute; top: 2px; bottom: 0; left: 0; width: 1px; background: var(--vermillion); }
.sidebar-note p { margin: 0 0 14px; font-size: 13px; line-height: 1.95; letter-spacing: .09em; }
.sidebar-note span { color: var(--muted); font-size: 11px; }
.sidebar-footer { display: flex; min-height: 92px; align-items: end; justify-content: space-between; }
.seal-mark { width: 52px; height: 52px; display: grid; place-content: center; color: var(--vermillion); border: 2px double currentColor; outline: 1px solid currentColor; outline-offset: -6px; font-family: var(--serif); font-size: 12px; line-height: 1.2; text-align: center; transform: rotate(-2deg); }
.user-chip { min-width: 0; display: flex; align-items: center; gap: 9px; padding-bottom: 2px; }
.avatar { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; color: var(--vermillion); border: 1px solid #d9a092; border-radius: 50%; font-family: var(--serif); font-size: 13px; }
.user-email { overflow: hidden; max-width: 112px; color: var(--ink-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { width: 36px; height: 36px; display: inline-grid; flex: 0 0 auto; place-items: center; color: var(--ink-soft); background: transparent; border: 0; border-radius: 50%; cursor: pointer; transition: color .2s, background .2s; }
.icon-button:hover { color: var(--vermillion); background: rgba(190, 65, 45, .08); }
.icon-button svg { width: 18px; height: 18px; }
.logout-button { margin-left: auto; }

.main-panel { min-width: 0; padding: 72px clamp(38px, 5.2vw, 84px) 76px; }
.mobile-topbar { display: none; }
.view-root { max-width: 760px; margin: 0 auto; animation: arrive .35s ease both; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.eyebrow { display: block; color: var(--vermillion); font-family: var(--mono); font-size: 10px; letter-spacing: .17em; text-transform: uppercase; }
.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 53px; }
.view-heading h1 { margin: 0; font-family: var(--serif); font-size: clamp(31px, 3.2vw, 43px); font-weight: 500; letter-spacing: .1em; line-height: 1.35; }
.view-heading p { margin: 12px 0 0; color: var(--muted); font-family: var(--serif); font-size: 14px; letter-spacing: .07em; }
.heading-date { padding-bottom: 5px; color: var(--muted); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.heading-date strong { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 14px; font-weight: 500; text-align: right; }
.section-kicker { color: var(--ink); font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: .08em; }
.section-kicker small { padding-left: 8px; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .04em; }
.today-progress { display: flex; align-items: center; gap: 15px; margin: 30px 0 13px; font-family: var(--serif); font-size: 15px; letter-spacing: .04em; }
.today-progress strong { color: var(--vermillion); font-family: var(--mono); font-size: 19px; font-weight: 500; }
.today-progress .progress-label { color: var(--muted); font-size: 12px; }
.progress-track { height: 3px; flex: 1; background: var(--line-soft); }
.progress-fill { width: 0; height: 100%; background: var(--vermillion); transition: width .35s ease; }
.task-list { margin: 0; padding: 0; list-style: none; }
.task-row { min-height: 85px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 15px; border-top: 1px solid var(--line); transition: opacity .2s; }
.task-row:last-child { border-bottom: 1px solid var(--line); }
.task-row.is-complete .task-title { color: #8a857a; text-decoration: line-through; text-decoration-color: #c7a79e; }
.task-row.is-complete .task-subtitle { color: #aaa49a; }
.check-button { width: 30px; height: 30px; display: grid; place-items: center; color: var(--paper-bright); background: transparent; border: 1.5px solid #918c82; border-radius: 3px; cursor: pointer; transition: all .2s ease; }
.check-button svg { width: 18px; height: 18px; stroke-width: 2.4; opacity: 0; transform: scale(.6); transition: all .18s ease; }
.check-button:hover { color: var(--vermillion); border-color: var(--vermillion); transform: translateY(-1px); }
.is-complete .check-button { color: white; background: var(--vermillion); border-color: var(--vermillion); }
.is-complete .check-button svg { opacity: 1; transform: scale(1); }
.task-copy { min-width: 0; padding: 14px 0; }
.task-title { overflow-wrap: anywhere; font-family: var(--serif); font-size: 16px; letter-spacing: .025em; line-height: 1.5; transition: color .2s; }
.task-subtitle { overflow: hidden; margin-top: 6px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.task-subtitle .task-link { color: var(--vermillion); }
.task-actions { display: flex; align-items: center; gap: 10px; }
.task-time { color: var(--muted); font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.task-state { min-width: 57px; color: var(--muted); font-family: var(--serif); font-size: 11px; text-align: right; white-space: nowrap; }
.task-row.is-complete .task-state { color: var(--vermillion); }
.task-delete { opacity: 0; width: 28px; height: 28px; color: #968f82; border-radius: 50%; }
.task-row:hover .task-delete, .task-delete:focus-visible { opacity: 1; }
.task-delete span { font-size: 19px; line-height: 1; }
.add-task-row { display: flex; justify-content: center; padding: 18px 0 8px; }
.text-button { padding: 7px 0; color: var(--vermillion); background: transparent; border: 0; font-family: var(--serif); font-size: 13px; letter-spacing: .04em; cursor: pointer; }
.text-button:hover { color: var(--vermillion-deep); text-decoration: underline; text-underline-offset: 4px; }
.add-task-button { display: inline-flex; align-items: center; gap: 8px; }
.plus { display: inline-grid; width: 21px; height: 21px; place-items: center; border: 1px solid #d8a197; border-radius: 50%; font-family: var(--sans); font-size: 15px; line-height: 1; }
.today-quote { display: flex; align-items: center; gap: 11px; margin: 53px 0 0; color: var(--ink-soft); font-family: var(--serif); font-size: 12px; letter-spacing: .06em; }
.quote-star { color: var(--gold); font-size: 22px; }
.today-quote em { color: var(--muted); font-style: normal; }
.empty-day { display: grid; justify-items: center; padding: 57px 20px 48px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.empty-illustration { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 18px; color: var(--vermillion); border: 1px solid #dfb0a5; border-radius: 50%; }
.empty-illustration svg { width: 29px; height: 29px; }
.empty-day h2 { margin: 0; font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: .08em; }
.empty-day p { max-width: 330px; margin: 9px 0 20px; color: var(--muted); font-family: var(--serif); font-size: 12px; line-height: 1.8; }
.empty-day .button { margin-top: 2px; }

.right-panel { min-width: 0; min-height: 100vh; border-left: 1px solid var(--line); background: rgba(251, 249, 244, .3); }
.aside-section { padding: 46px clamp(24px, 3vw, 45px) 35px; border-bottom: 1px solid var(--line); }
.aside-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.aside-header h2 { margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 500; letter-spacing: .1em; }
.aside-header a { color: var(--muted); font-family: var(--serif); font-size: 11px; }
.aside-header a:hover { color: var(--vermillion); }
.goal-preview-list { display: grid; }
.goal-preview { padding: 23px 0 22px; border-top: 1px solid var(--line-soft); }
.goal-preview:first-child { border-top: 1px solid var(--line); }
.goal-preview-top { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.goal-index { width: 27px; height: 27px; display: grid; place-items: center; color: white; background: var(--vermillion); border-radius: 50%; font-family: var(--mono); font-size: 12px; }
.goal-preview-name { overflow: hidden; font-family: var(--serif); font-size: 15px; letter-spacing: .035em; text-overflow: ellipsis; white-space: nowrap; }
.goal-percent { color: var(--vermillion); font-family: var(--serif); font-size: 23px; line-height: 1; }
.goal-deadline { margin: 6px 0 0 44px; color: var(--muted); font-family: var(--serif); font-size: 10px; }
.milestone-track { position: relative; display: grid; grid-template-columns: repeat(var(--count), 1fr); align-items: start; margin: 23px 12px 7px; }
.milestone-track::before { position: absolute; top: 6px; left: 6px; right: 6px; height: 1px; background: var(--line); content: ''; }
.milestone-track::after { position: absolute; top: 6px; left: 6px; width: var(--progress-width); max-width: calc(100% - 12px); height: 2px; background: var(--vermillion); content: ''; }
.mini-node { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; color: var(--muted); text-align: center; }
.mini-dot { width: 13px; height: 13px; border: 1.5px solid #9a958b; background: var(--paper-bright); border-radius: 50%; }
.mini-node.is-done .mini-dot { background: var(--vermillion); border-color: var(--vermillion); }
.mini-node.is-next .mini-dot { border: 1.5px solid var(--vermillion); }
.mini-title { overflow: hidden; width: 100%; font-family: var(--serif); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mini-status { font-family: var(--serif); font-size: 10px; white-space: nowrap; }
.mini-node.is-done .mini-status, .mini-node.is-next .mini-status { color: var(--vermillion); }
.goal-meta { display: flex; gap: 10px; margin: 19px 0 0 2px; color: var(--muted); font-family: var(--serif); font-size: 11px; }
.goal-meta b { color: var(--vermillion); font-weight: 500; }
.goal-meta .meta-dot { color: #c7c1b6; }
.right-empty { padding: 25px 0 14px; color: var(--muted); font-family: var(--serif); font-size: 12px; line-height: 1.8; }
.right-empty button { margin-top: 8px; }

.week-section { padding-top: 25px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 23px; }
.week-day { display: grid; justify-items: center; gap: 9px; color: var(--muted); font-family: var(--serif); font-size: 10px; }
.week-name { color: var(--ink-soft); }
.week-check { width: 30px; height: 30px; display: grid; place-items: center; color: #aaa49a; border: 1px solid #aaa49a; border-radius: 50%; font-size: 13px; }
.week-day.has-progress .week-check { color: white; background: var(--vermillion); border-color: var(--vermillion); }
.week-day.is-partial .week-check { color: var(--vermillion); background: var(--vermillion-pale); border-color: #d9a49a; font-size: 20px; line-height: 1; }
.week-day.is-today .week-name { color: var(--vermillion); }
.week-day.is-today .week-check { box-shadow: 0 0 0 3px var(--paper-bright), 0 0 0 4px #dcb6a9; }
.week-date { color: var(--muted); font-family: var(--mono); font-size: 9px; }
.week-summary { margin: 22px 0 0; color: var(--ink-soft); font-family: var(--serif); font-size: 12px; }
.week-summary strong { color: var(--vermillion); font-family: var(--mono); font-size: 15px; font-weight: 500; }
.week-summary .muted { color: var(--muted); }
.notification-nudge { display: flex; align-items: center; gap: 12px; margin: 25px 0 0; padding: 14px; color: var(--ink-soft); border: 1px solid var(--line-soft); font-family: var(--serif); font-size: 11px; line-height: 1.55; }
.notification-nudge svg { width: 19px; height: 19px; flex: 0 0 auto; color: var(--vermillion); }
.notification-nudge a { color: var(--vermillion); text-decoration: underline; text-underline-offset: 2px; }

.button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 1px solid transparent; border-radius: 2px; font-family: var(--serif); font-size: 13px; letter-spacing: .05em; cursor: pointer; transition: all .18s ease; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button-primary { color: #fffaf3; background: var(--vermillion); }
.button-primary:hover:not(:disabled) { background: var(--vermillion-deep); box-shadow: 0 4px 12px rgba(161, 50, 36, .18); transform: translateY(-1px); }
.button-quiet { color: var(--ink-soft); background: transparent; border-color: var(--line); }
.button-quiet:hover { border-color: #aaa398; background: rgba(255,255,255,.35); }
.button-danger { color: white; background: var(--vermillion); }
.button-danger:hover { background: var(--vermillion-deep); }
.button-wide { width: 100%; }
.button-small { min-height: 34px; padding: 0 12px; font-size: 11px; }
.button-outline { color: var(--vermillion); background: transparent; border-color: #d9a69c; }
.button-outline:hover { background: var(--vermillion-pale); }
.heading-action { flex: 0 0 auto; }
.view-content { border-top: 1px solid var(--line); }
.goal-card { padding: 25px 0 28px; border-bottom: 1px solid var(--line); }
.goal-card-header { display: flex; align-items: start; gap: 14px; }
.goal-card-index { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: var(--vermillion); border-radius: 50%; font-family: var(--mono); font-size: 12px; }
.goal-card-copy { min-width: 0; flex: 1; }
.goal-card-title { margin: 1px 0 4px; font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: .05em; line-height: 1.5; }
.goal-card-description { margin: 8px 0 0; color: var(--muted); font-family: var(--serif); font-size: 12px; line-height: 1.75; }
.goal-card-actions { display: flex; gap: 3px; }
.goal-card-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 0; color: var(--muted); font-family: var(--serif); font-size: 11px; }
.goal-card-meta strong { color: var(--vermillion); font-family: var(--mono); font-weight: 500; }
.goal-progress-line { height: 3px; margin: 19px 0 20px; background: var(--line-soft); }
.goal-progress-line span { height: 100%; display: block; background: var(--vermillion); transition: width .35s; }
.milestone-list { display: grid; gap: 10px; padding: 0; margin: 0 0 15px; list-style: none; }
.milestone-item { display: flex; align-items: start; gap: 12px; }
.milestone-toggle { width: 19px; height: 19px; flex: 0 0 19px; display: grid; place-items: center; margin-top: 1px; padding: 0; color: transparent; background: transparent; border: 1px solid #aaa398; border-radius: 50%; cursor: pointer; }
.milestone-toggle svg { width: 12px; height: 12px; opacity: 0; }
.milestone-item.is-done .milestone-toggle { color: white; background: var(--vermillion); border-color: var(--vermillion); }
.milestone-item.is-done .milestone-toggle svg { opacity: 1; }
.milestone-item.is-done .milestone-name { color: #999388; text-decoration: line-through; text-decoration-color: #cfaba3; }
.milestone-name { flex: 1; font-family: var(--serif); font-size: 12px; line-height: 1.6; }
.milestone-link { color: var(--muted); font-size: 10px; }
.milestone-remove { width: 24px; height: 24px; flex: 0 0 auto; margin-top: -3px; opacity: 0; }
.milestone-item:hover .milestone-remove, .milestone-remove:focus-visible { opacity: 1; }
.goal-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-left: 30px; }
.goal-card-footer .text-button { font-size: 11px; }
.goal-progress-caption { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.goals-empty { display: grid; justify-items: center; padding: 65px 24px; border-bottom: 1px solid var(--line); text-align: center; }
.goals-empty h2 { margin: 13px 0 6px; font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: .08em; }
.goals-empty p { max-width: 360px; color: var(--muted); font-family: var(--serif); font-size: 12px; line-height: 1.8; }
.milestone-task { color: var(--vermillion); }

.history-toolbar { display: flex; align-items: center; justify-content: space-between; margin: -19px 0 18px; }
.month-label { font-family: var(--serif); font-size: 17px; letter-spacing: .06em; }
.month-controls { display: flex; gap: 4px; }
.month-controls button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-soft); background: transparent; border: 1px solid var(--line); cursor: pointer; }
.month-controls button:hover { color: var(--vermillion); border-color: #d4a49a; }
.month-controls svg { width: 15px; height: 15px; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-cell { min-height: 74px; padding: 9px 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar-label { min-height: 34px; display: grid; place-items: center; color: var(--muted); font-family: var(--serif); font-size: 10px; }
.calendar-day { display: grid; gap: 5px; color: var(--ink-soft); background: transparent; font-family: var(--mono); font-size: 10px; text-align: left; cursor: pointer; }
.calendar-day:hover { background: rgba(255,255,255,.4); }
.calendar-day.is-selected:not(.is-today) .calendar-number { color: var(--vermillion); box-shadow: inset 0 0 0 1px #d9a49a; }
.calendar-day.is-outside { color: #c5bfb4; background: rgba(255,255,255,.16); }
.calendar-day.is-today .calendar-number { color: white; background: var(--vermillion); }
.calendar-number { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; }
.calendar-bar { height: 3px; background: var(--line-soft); }
.calendar-bar span { height: 100%; display: block; background: var(--vermillion); }
.calendar-count { color: var(--muted); font-size: 9px; }
.history-summary { display: flex; align-items: baseline; gap: 8px; margin-top: 22px; color: var(--ink-soft); font-family: var(--serif); font-size: 12px; }
.history-summary strong { color: var(--vermillion); font-family: var(--mono); font-size: 20px; font-weight: 500; }
.history-list { margin-top: 36px; }
.history-list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.history-list-header h2 { margin: 0; font-family: var(--serif); font-size: 16px; font-weight: 500; letter-spacing: .06em; }
.history-list-header span { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.history-day-group { margin-bottom: 20px; }
.history-date-title { display: flex; align-items: baseline; gap: 8px; margin: 0 0 5px; color: var(--ink-soft); font-family: var(--serif); font-size: 12px; }
.history-date-title small { color: var(--muted); font-family: var(--mono); font-size: 9px; }
.history-row { display: flex; align-items: center; gap: 10px; min-height: 36px; border-bottom: 1px solid var(--line-soft); }
.history-row .history-check { width: 16px; height: 16px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: var(--vermillion); border-radius: 50%; }
.history-row .history-check svg { width: 10px; height: 10px; stroke-width: 2.2; }
.history-row-title { flex: 1; font-family: var(--serif); font-size: 11px; }
.history-row-context { color: var(--muted); font-size: 10px; }
.history-row-time { color: var(--muted); font-family: var(--mono); font-size: 9px; }
.history-empty { padding: 28px 0; color: var(--muted); font-family: var(--serif); font-size: 12px; line-height: 1.8; }

.settings-group { padding: 23px 0; border-bottom: 1px solid var(--line); }
.settings-group h2 { margin: 0 0 7px; font-family: var(--serif); font-size: 16px; font-weight: 500; letter-spacing: .06em; }
.settings-group > p { margin: 0 0 18px; color: var(--muted); font-family: var(--serif); font-size: 11px; line-height: 1.75; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.settings-row-copy { min-width: 0; }
.settings-row-copy strong { display: block; font-family: var(--serif); font-size: 12px; font-weight: 500; }
.settings-row-copy span { display: block; margin-top: 4px; color: var(--muted); font-family: var(--serif); font-size: 10px; line-height: 1.6; }
.status-pill { flex: 0 0 auto; padding: 5px 9px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-family: var(--mono); font-size: 9px; }
.status-pill.is-on { color: var(--sage); border-color: #b8c4b1; background: #eef2e9; }
.status-pill.is-warn { color: var(--vermillion); border-color: #ddb3aa; background: #faf0ec; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.field-label { display: flex; align-items: baseline; justify-content: space-between; margin: 15px 0 7px; color: var(--ink-soft); font-family: var(--serif); font-size: 11px; }
.field-hint { color: var(--muted); font-family: var(--sans); font-size: 9px; }
input, select, textarea { width: 100%; padding: 11px 12px; color: var(--ink); background: rgba(255,255,255,.35); border: 1px solid var(--line); border-radius: 2px; font-size: 12px; transition: border-color .18s, background .18s; }
input:hover, select:hover, textarea:hover { border-color: #b8b1a5; }
input::placeholder, textarea::placeholder { color: #aaa398; }
textarea { resize: vertical; line-height: 1.65; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23716e67' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.timezone-label { margin: 15px 0 7px; }
.timezone-select { max-width: 310px; }
.settings-hint { margin: 10px 0 0 !important; color: var(--muted); font-family: var(--sans) !important; font-size: 10px !important; }
.account-card { display: flex; align-items: center; gap: 12px; }
.account-card .avatar { width: 40px; height: 40px; flex-basis: 40px; }
.account-card strong { font-family: var(--sans); font-size: 12px; font-weight: 500; }
.account-card span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.notice { padding: 12px 14px; color: var(--ink-soft); background: rgba(255,255,255,.3); border-left: 2px solid var(--gold); font-family: var(--serif); font-size: 10px; line-height: 1.75; }
.notice.is-error { border-color: var(--vermillion); }
.signed-out-note { margin-top: 20px; color: var(--muted); font-family: var(--serif); font-size: 10px; line-height: 1.7; }
.app-shell.is-signed-out { grid-template-columns: minmax(210px, 17.1%) minmax(0, 1fr); }
.app-shell.is-signed-out .primary-nav, .app-shell.is-signed-out .sidebar-note { display: none; }
.welcome-view { position: relative; min-height: calc(100vh - 148px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 20px clamp(10px, 7vw, 110px); overflow: hidden; }
.welcome-view::after { position: absolute; right: 7%; bottom: 2%; width: clamp(190px, 29vw, 430px); height: clamp(190px, 29vw, 430px); border: 1px solid rgba(190,65,45,.14); border-radius: 50%; box-shadow: 0 0 0 30px rgba(190,65,45,.025), 0 0 0 72px rgba(190,65,45,.02); content: ''; pointer-events: none; }
.welcome-seal { width: 55px; height: 55px; display: grid; place-content: center; margin: 37px 0 17px; color: var(--vermillion); border: 1px solid currentColor; outline: 1px solid currentColor; outline-offset: -5px; font-family: var(--serif); font-size: 17px; line-height: 1.1; text-align: center; transform: rotate(-2deg); }
.welcome-view h1 { z-index: 1; margin: 0; font-family: var(--serif); font-size: clamp(38px, 4.4vw, 64px); font-weight: 500; letter-spacing: .07em; line-height: 1.5; }
.welcome-view h1 em { color: var(--vermillion); font-style: normal; }
.welcome-view > p { z-index: 1; max-width: 430px; margin: 16px 0 0; color: var(--muted); font-family: var(--serif); font-size: 14px; letter-spacing: .055em; line-height: 2; }
.welcome-actions { z-index: 1; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.welcome-actions .button { min-width: 144px; }
.welcome-footnote { z-index: 1; display: flex; flex-wrap: wrap; gap: 17px; margin-top: 72px; color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .04em; }

.modal { width: min(470px, calc(100% - 28px)); max-width: none; max-height: min(88vh, 780px); padding: 0; overflow: visible; color: var(--ink); background: transparent; border: 0; }
.modal::backdrop { background: rgba(34, 31, 25, .48); backdrop-filter: blur(4px); }
.modal[open] { animation: modal-in .22s ease both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-card { position: relative; max-height: min(88vh, 780px); padding: 35px 38px 34px; overflow-y: auto; background: var(--paper-bright); border: 1px solid rgba(255,255,255,.65); box-shadow: var(--shadow); }
.modal-card h1, .modal-card h2 { margin: 9px 0 5px; font-family: var(--serif); font-size: 25px; font-weight: 500; letter-spacing: .1em; }
.modal-lead { margin: 0 0 22px; color: var(--muted); font-family: var(--serif); font-size: 11px; line-height: 1.8; }
.modal-close { position: absolute; top: 13px; right: 13px; font-size: 25px; font-weight: 300; }
.auth-card { padding-top: 42px; }
.auth-card .field-label:first-of-type { margin-top: 28px; }
.auth-card .button { margin-top: 10px; }
.auth-switch { display: block; margin: 8px auto 0; font-size: 11px; }
.privacy-note { margin: 21px 0 0; color: var(--muted); font-family: var(--serif); font-size: 9px; line-height: 1.65; text-align: center; }
.form-error { min-height: 15px; margin: 9px 0 3px; color: var(--vermillion); font-family: var(--serif); font-size: 10px; line-height: 1.55; }
.confirm-card { width: min(390px, calc(100vw - 28px)); padding: 32px; }
.confirm-actions { display: flex; gap: 10px; margin-top: 24px; }
.confirm-actions .button { flex: 1; }
.toast-region { position: fixed; z-index: 50; right: 25px; bottom: 24px; display: grid; gap: 9px; pointer-events: none; }
.toast { max-width: min(380px, calc(100vw - 36px)); display: flex; align-items: start; gap: 10px; padding: 13px 16px; color: var(--paper-bright); background: #302c25; border: 1px solid rgba(255,255,255,.13); box-shadow: 0 10px 34px rgba(30,25,18,.22); font-family: var(--serif); font-size: 11px; line-height: 1.55; animation: toast-in .2s ease both; }
.toast::before { width: 6px; height: 6px; flex: 0 0 6px; margin-top: 5px; background: #d9856e; border-radius: 50%; content: ''; }
.toast.is-good::before { background: #a7bd9d; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.mobile-nav { display: none; }

@media (min-width: 1600px) {
  .app-shell { grid-template-columns: minmax(230px, 16%) minmax(620px, 1fr) minmax(430px, 35%); }
  .main-panel { padding-top: 88px; }
  .aside-section { padding-right: 52px; padding-left: 52px; }
}
@media (max-width: 1190px) {
  .app-shell { grid-template-columns: 190px minmax(420px, 1fr) 330px; }
  .sidebar { padding-right: 20px; padding-left: 20px; }
  .brand { margin-left: 9px; }
  .main-panel { padding-right: 38px; padding-left: 38px; }
  .aside-section { padding-right: 24px; padding-left: 24px; }
  .task-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; }
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 185px minmax(0, 1fr); }
  .sidebar { grid-row: span 2; }
  .main-panel { padding: 57px 45px 60px; }
  .right-panel { grid-column: 2; min-height: 0; border-top: 1px solid var(--line); border-left: 0; }
  .aside-section { padding: 30px 45px; }
  .goal-preview-list { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 25px; }
  .week-section { padding-top: 24px; }
  .week-grid { max-width: 560px; }
}
@media (max-width: 690px) {
  .app-shell { display: block; min-height: 100vh; padding-bottom: calc(71px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .app-shell.is-signed-out { display: block; padding-bottom: 0; }
  .app-shell.is-signed-out .main-panel { min-height: 100vh; padding: 28px 25px; }
  .app-shell.is-signed-out .mobile-topbar { display: none; }
  .app-shell.is-signed-out .welcome-view { min-height: calc(100vh - 56px); padding: 20px 8px; }
  .app-shell.is-signed-out .welcome-view h1 { font-size: clamp(29px, 8.5vw, 42px); }
  .app-shell.is-signed-out .welcome-view::after { right: -80px; bottom: 3%; }
  .app-shell.is-signed-out .welcome-footnote { gap: 10px; margin-top: 50px; font-size: 8px; }
  .main-panel { min-height: 66vh; padding: 0 22px 43px; }
  .mobile-topbar { position: sticky; z-index: 5; top: 0; height: 57px; display: flex; align-items: center; justify-content: space-between; margin: 0 -22px 29px; padding: 0 22px; background: rgba(245, 242, 233, .94); border-bottom: 1px solid var(--line-soft); backdrop-filter: blur(12px); }
  .mobile-brand { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: .13em; }
  .mobile-brand .seal { width: 18px; height: 18px; font-size: 10px; }
  .view-heading { margin-bottom: 35px; }
  .view-heading h1 { font-size: 29px; letter-spacing: .06em; }
  .view-heading p { max-width: 230px; font-size: 12px; line-height: 1.7; }
  .heading-date { font-size: 9px; }
  .heading-date strong { font-size: 12px; }
  .today-progress { gap: 9px; margin-top: 27px; font-size: 13px; }
  .today-progress strong { font-size: 17px; }
  .today-progress .progress-label { font-size: 10px; }
  .task-row { min-height: 78px; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; }
  .task-title { font-size: 14px; }
  .task-subtitle { font-size: 9px; }
  .task-actions { gap: 5px; }
  .task-state { min-width: 46px; font-size: 10px; }
  .task-time { display: none; }
  .task-delete { opacity: .7; }
  .today-quote { margin-top: 33px; font-size: 10px; }
  .right-panel { min-height: 0; }
  .aside-section { padding: 26px 22px; }
  .goal-preview-list { display: block; }
  .goal-preview { padding: 18px 0; }
  .goal-preview-name { font-size: 14px; }
  .goal-percent { font-size: 20px; }
  .week-grid { margin-top: 18px; }
  .week-check { width: 27px; height: 27px; }
  .notification-nudge { margin-top: 19px; }
  .mobile-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; height: calc(67px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 12px calc(5px + env(safe-area-inset-bottom)); background: rgba(251, 249, 244, .96); border-top: 1px solid var(--line); backdrop-filter: blur(14px); }
  .mobile-nav-item { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--muted); background: transparent; border: 0; font-family: var(--serif); font-size: 9px; cursor: pointer; }
  .mobile-nav-item svg { width: 20px; height: 20px; }
  .mobile-nav-item.is-active { color: var(--vermillion); }
  .mobile-nav-item.is-active::before { position: absolute; top: -7px; width: 22px; height: 2px; background: var(--vermillion); content: ''; }
  .view-heading .button { min-height: 35px; padding: 0 10px; font-size: 10px; }
  .goal-card { padding: 20px 0 22px; }
  .goal-card-title { font-size: 16px; }
  .goal-card-actions .icon-button { width: 31px; height: 31px; }
  .goal-card-footer { padding-left: 0; }
  .goal-card-footer .text-button { font-size: 10px; }
  .calendar-cell { min-height: 58px; padding: 5px 3px; }
  .calendar-day { gap: 3px; font-size: 9px; }
  .calendar-number { width: 20px; height: 20px; }
  .calendar-count { font-size: 8px; }
  .calendar-label { min-height: 29px; }
  .history-toolbar { margin-top: -9px; }
  .history-day-group { margin-bottom: 15px; }
  .settings-group { padding: 20px 0; }
  .timezone-select { max-width: none; }
  .settings-actions .button { flex: 1; }
  .toast-region { right: 12px; bottom: calc(77px + env(safe-area-inset-bottom)); left: 12px; }
  .toast { max-width: none; }
  .modal-card { padding: 32px 24px 26px; }
  .auth-card { padding-top: 38px; }
  .modal-card h1, .modal-card h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
