:root {
  --ink: #282225;
  --muted: #91898c;
  --line: #eee5e6;
  --paper: #fbf7f7;
  --card: #ffffff;
  --green: #ff5945;
  --green-dark: #ea4233;
  --green-soft: #fff0ed;
  --purple: #b675f0;
  --purple-soft: #ead4ff;
  --lime: #ffd067;
  --amber: #e59035;
  --red: #cc4d4d;
  --shadow: 0 18px 45px rgba(83, 46, 56, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 240px; display: flex; flex-direction: column; padding: 34px 24px 24px; background: #2a2024; color: white; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; margin: 0 8px 42px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg, #ff735e, #ff4538); font-weight: 900; font-family: Georgia, serif; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: .08em; }
.brand small { margin-top: 2px; font-size: 8px; letter-spacing: .16em; color: #91aaa7; }
.nav-list { display: grid; gap: 7px; }
.nav-item { border: 0; background: transparent; color: #9db2af; border-radius: 11px; padding: 13px 16px; text-align: left; cursor: pointer; transition: .18s ease; }
.nav-item span { display: inline-grid; width: 25px; font-size: 18px; vertical-align: -1px; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { background: rgba(255,89,69,.16); color: white; font-weight: 700; }
.sidebar-quote { margin-top: auto; padding: 18px; background: rgba(216,240,107,.08); border: 1px solid rgba(216,240,107,.15); border-radius: 14px; }
.sidebar-quote span { color: var(--lime); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.sidebar-quote p { margin: 8px 0 0; color: #d1dddb; font-size: 13px; line-height: 1.7; }
.connection { display: flex; align-items: center; gap: 8px; padding: 16px 8px 0; font-size: 11px; color: #78918e; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: #d0a437; box-shadow: 0 0 0 3px rgba(208,164,55,.13); }
.connection i.online { background: #6ed89a; box-shadow: 0 0 0 3px rgba(110,216,154,.13); }

.main { margin-left: 240px; min-height: 100vh; }
.view { display: none; max-width: 1180px; margin: auto; padding: 48px 56px 80px; animation: rise .25s ease; }
.view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }
.topbar { min-height: 72px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 10px; letter-spacing: .2em; font-weight: 900; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: Georgia, "STSong", serif; font-size: clamp(28px, 4vw, 42px); font-weight: 600; letter-spacing: -.02em; }
h2 { margin-bottom: 0; font-size: 18px; }
.avatar-button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--ink); color: white; cursor: pointer; }

/* 参考图风格的手机打卡首页 */
.habit-calendar { padding: 25px 26px 22px; border: 1px solid #f1e8e9; border-radius: 22px; background: rgba(255,255,255,.84); box-shadow: 0 12px 35px rgba(86,48,58,.05); }
.habit-month-row { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; max-width: 680px; margin: 0 auto 23px; }
.habit-month-row h2 { text-align: center; font-size: 25px; font-weight: 700; letter-spacing: .04em; }
.habit-month-row button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: #b4aaad; font-size: 26px; cursor: pointer; }
.habit-month-row button:hover { background: #fff1ef; color: var(--green); }
.habit-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); max-width: 820px; margin: auto; }
.habit-day { min-width: 0; display: grid; justify-items: center; gap: 9px; border: 0; background: transparent; color: #9e9698; cursor: pointer; position: relative; }
.habit-day > span { font-size: 13px; }
.habit-day > strong { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; color: #332c2f; font-size: 20px; font-weight: 700; transition: .18s ease; }
.habit-day:hover > strong { background: #fff0ed; }
.habit-day.selected > strong { color: white; background: linear-gradient(145deg, #ff6b54, #ff4839); box-shadow: 0 8px 20px rgba(255,82,63,.28); }
.habit-day > i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.habit-day.full > i { background: var(--green); }
.habit-day.partial > i { background: #e8a04d; }
.habit-day.missed > i { background: #d9ced0; }
.habit-day.today:not(.selected) > strong { outline: 1px solid #ffb9af; color: var(--green); }

.today-overview { display: grid; grid-template-columns: 1.2fr 1fr 1fr; margin-top: 14px; border: 1px solid #f1e8e9; border-radius: 17px; background: white; overflow: hidden; }
.today-overview > div { min-height: 80px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 15px 20px; border-right: 1px solid #f3ebec; }
.today-overview > div:last-child { border-right: 0; }
.overview-progress strong { color: var(--green); font-size: 27px; }
.overview-progress span, .overview-streak span:last-child, .overview-best span { color: var(--muted); font-size: 11px; }
.overview-streak > strong { font-size: 24px; color: var(--green); }
.overview-best { flex-direction: column; gap: 3px !important; }
.overview-best strong { font-size: 14px; }
.habit-heading { margin-top: 31px; }
.habit-heading h2 { font-size: 24px; }
.goal-list { gap: 25px; }
.habit-group { display: grid; gap: 12px; }
.habit-group-title { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.habit-group-title h3 { margin: 0; color: #8f8588; font-size: 15px; font-weight: 600; }
.habit-group-title span { min-width: 23px; height: 23px; display: grid; place-items: center; border-radius: 20px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 800; }
.habit-cards { display: grid; gap: 12px; }
.habit-card { display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; align-items: center; gap: 18px; min-height: 112px; padding: 18px 23px; border: 1px solid #f2e9ea; border-radius: 18px; background: white; box-shadow: 0 10px 28px rgba(80,45,55,.045); transition: .2s ease; }
.habit-card:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(80,45,55,.08); }
.habit-card.complete { background: rgba(255,255,255,.72); }
.habit-icon { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; color: #352441; background: linear-gradient(145deg, #cf96fa, #ad68ec); box-shadow: inset 0 0 0 6px rgba(255,255,255,.16); font-size: 28px; }
.habit-info { min-width: 0; }
.habit-info h3 { margin: 0 0 8px; color: #2d282a; font-size: 20px; font-weight: 600; letter-spacing: .01em; }
.habit-info p { margin: 0; color: #a49b9e; font-size: 12px; line-height: 1.6; }
.habit-info p strong { color: #8e8588; font-weight: 500; }
.habit-minimum { margin-top: 8px; padding: 0; border: 0; background: transparent; color: var(--green); font-size: 11px; cursor: pointer; }
.habit-action { display: flex; align-items: center; gap: 10px; }
.habit-check { width: 64px; height: 64px; display: grid; place-items: center; border: 2px solid #ff7e6c; border-radius: 50%; color: white; background: #fff7f5; cursor: pointer; transition: .18s ease; }
.habit-check span { font-size: 33px; line-height: 1; transform: translateY(-1px); }
.habit-check:hover { transform: scale(1.04); background: #fff0ed; }
.habit-check.checked { border-color: transparent; background: linear-gradient(145deg, #ff765e, #ff4638); box-shadow: 0 8px 20px rgba(255,78,59,.25); }
.habit-check:active { transform: scale(.94); }
.habit-plus { width: 36px; height: 36px; border: 1px solid #f1dedd; border-radius: 50%; color: var(--green); background: white; font-weight: 800; cursor: pointer; }
.future-label { padding: 7px 10px; border-radius: 20px; color: #a59b9e; background: #f7f2f3; font-size: 10px; }
.habit-group-empty { padding: 22px; border: 1px dashed #eadfe1; border-radius: 14px; color: #aaa0a3; background: rgba(255,255,255,.45); text-align: center; font-size: 12px; }
.completed-group .habit-card { opacity: .92; }
.goal-card .goal-icon { color: #352441; background: linear-gradient(145deg, #d4a1f8, #b877ef); }

.hero-card { min-height: 238px; display: flex; align-items: center; gap: 48px; padding: 35px 52px; border-radius: 24px; color: white; background: linear-gradient(118deg, #0f3e39, #0f766e); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero-card::after { content: "行"; position: absolute; right: 4%; top: -55px; font-family: Georgia, serif; font-size: 260px; line-height: 1; color: rgba(255,255,255,.035); }
.progress-ring { --progress: 0; flex: 0 0 auto; width: 152px; height: 152px; padding: 10px; border-radius: 50%; background: conic-gradient(var(--lime) calc(var(--progress) * 1%), rgba(255,255,255,.12) 0); display: grid; place-items: center; }
.progress-ring > div { width: 100%; height: 100%; border-radius: 50%; display: grid; place-content: center; text-align: center; background: #114943; }
.progress-ring strong { display: block; font-family: Georgia, serif; font-size: 38px; }
.progress-ring span { display: block; margin-top: 4px; color: #acd1cc; font-size: 11px; }
.hero-copy { position: relative; z-index: 1; }
.hero-label { color: var(--lime); font-size: 10px; letter-spacing: .18em; font-weight: 900; }
.hero-copy h2 { margin: 10px 0 10px; font-family: Georgia, "STSong", serif; font-size: clamp(24px, 3vw, 34px); font-weight: 500; }
.hero-copy p { color: #b8d4d1; font-size: 14px; }
.streak-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-top: 24px; font-size: 13px; }
.streak-line strong { font-size: 24px; color: var(--lime); font-family: Georgia, serif; }
.streak-line em { margin-left: 14px; color: #91b7b2; font-style: normal; font-size: 11px; }

.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 35px 0 16px; }
.section-heading h2 { font-family: Georgia, "STSong", serif; font-size: 22px; }
.section-heading p, .card-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.text-button { border: 0; background: transparent; color: var(--green); font-weight: 700; cursor: pointer; }
.goal-list { display: grid; gap: 11px; }
.today-goal { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 15px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); transition: .2s ease; }
.today-goal:hover { border-color: #bad4d0; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(19,67,62,.05); }
.today-goal.complete { background: #f4faf8; }
.goal-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--green-soft); color: var(--green); font-size: 20px; }
.goal-info { min-width: 0; }
.goal-info h3 { margin: 0; font-size: 15px; }
.goal-info p { margin: 5px 0 0; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-info .minimum-copy { color: var(--amber); }
.goal-action { display: flex; align-items: center; gap: 8px; }
.check-button { min-width: 98px; border: 0; border-radius: 11px; padding: 10px 14px; color: white; background: var(--green); font-weight: 800; cursor: pointer; }
.check-button.done { color: var(--green); background: var(--green-soft); }
.minimum-button, .increment-button { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: white; color: var(--muted); cursor: pointer; }
.increment-button { font-weight: 900; color: var(--green); }
.empty-state { padding: 55px 24px; text-align: center; border: 1px dashed #bed0cd; border-radius: 18px; color: var(--muted); background: rgba(255,255,255,.4); }
.empty-state b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 8px; }
.empty-state button { margin-top: 16px; }

.primary-button, .secondary-button, .danger-button { border-radius: 10px; padding: 11px 16px; font-weight: 800; cursor: pointer; text-decoration: none; text-align: center; }
.primary-button { border: 1px solid var(--green); background: var(--green); color: white; }
.primary-button:hover { background: var(--green-dark); }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.danger-button { border: 1px solid #f1d0d0; background: #fff7f7; color: var(--red); }
.link-button { display: inline-block; }
.intro-strip { margin: -8px 0 25px; padding: 15px 18px; border-left: 3px solid var(--lime); background: white; font-size: 13px; }
.intro-strip span { color: var(--muted); margin-left: 8px; }
.goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.goal-card { padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: white; cursor: pointer; }
.goal-card:hover { border-color: #b5d1cc; box-shadow: var(--shadow); }
.goal-card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.goal-card h3 { margin: 17px 0 7px; }
.goal-card p { min-height: 34px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.goal-card-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.pill { padding: 5px 8px; border-radius: 20px; background: var(--paper); color: var(--muted); font-size: 10px; }
.pill.remind { color: var(--green); background: var(--green-soft); }

.month-switcher { display: flex; align-items: center; gap: 12px; }
.month-switcher button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
.calendar-card, .day-detail, .chart-card, .settings-card { border: 1px solid var(--line); border-radius: 18px; background: white; }
.calendar-card { padding: 24px; }
.calendar-legend { display: flex; justify-content: flex-end; gap: 15px; margin-bottom: 20px; color: var(--muted); font-size: 10px; }
.calendar-legend span { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.legend-dot.full { background: var(--green); }.legend-dot.partial { background: #dfb25c; }.legend-dot.missed { background: #e2a0a0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.calendar-weekdays { margin-bottom: 7px; color: var(--muted); font-size: 10px; text-align: center; }
.calendar-day { aspect-ratio: 1.3; min-height: 48px; border: 0; border-radius: 10px; background: var(--paper); cursor: pointer; position: relative; }
.calendar-day:hover, .calendar-day.selected { outline: 2px solid var(--green); outline-offset: -2px; }
.calendar-day.outside { opacity: .28; }.calendar-day.future { opacity: .45; }
.calendar-day .day-score { position: absolute; left: 50%; bottom: 6px; width: 20px; height: 3px; transform: translateX(-50%); border-radius: 4px; background: var(--line); }
.calendar-day.full .day-score { background: var(--green); }.calendar-day.partial .day-score { background: #dfb25c; }.calendar-day.missed .day-score { background: #e2a0a0; }
.calendar-day.today::after { content: "今"; position: absolute; right: 5px; top: 4px; color: var(--green); font-size: 8px; font-weight: 900; }
.day-detail { margin-top: 15px; padding: 22px; }
.day-detail h3 { margin: 0 0 14px; font-size: 15px; }
.detail-row { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12px; }
.detail-row span:last-child { color: var(--muted); }

.select-control { border: 1px solid var(--line); border-radius: 9px; background: white; padding: 10px 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 15px; }
.metric-card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.metric-card span { color: var(--muted); font-size: 10px; }
.metric-card strong { display: block; margin-top: 8px; font-family: Georgia, serif; font-size: 27px; }
.metric-card small { color: var(--green); font-size: 10px; }
.chart-card { padding: 24px; margin-top: 15px; }
.card-title { margin-bottom: 24px; }
.bar-chart { height: 180px; display: flex; align-items: end; gap: 8px; padding-top: 15px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; min-width: 0; }
.bar { width: min(32px, 75%); min-height: 3px; border-radius: 6px 6px 2px 2px; background: var(--green); position: relative; }
.bar:hover::after { content: attr(data-value); position: absolute; left: 50%; top: -26px; transform: translateX(-50%); background: var(--ink); color: white; padding: 3px 6px; border-radius: 4px; font-size: 9px; white-space: nowrap; }
.bar-col span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.goal-stats { display: grid; gap: 16px; }
.stat-row { display: grid; grid-template-columns: 140px 1fr 42px; align-items: center; gap: 12px; font-size: 12px; }
.stat-track { height: 7px; border-radius: 9px; background: var(--paper); overflow: hidden; }
.stat-fill { height: 100%; border-radius: inherit; background: var(--green); }
.stat-row b { text-align: right; }

.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.settings-card { padding: 24px; }
.settings-card h2 { margin-bottom: 18px; }
.settings-card > p { color: var(--muted); font-size: 12px; line-height: 1.7; }
.settings-card > label { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 12px; }
.settings-card input, .settings-card select { border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.time-select { display: inline-flex; align-items: center; gap: 6px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.time-select select { min-width: 68px; border: 0 !important; padding: 7px 5px !important; color: var(--ink); background: transparent; text-align: center; outline: none; }
.time-select span { color: var(--muted); font-weight: 900; }
.time-select:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(255,89,69,.09); }
.time-select.disabled { opacity: .45; background: var(--paper); }
.settings-card .secondary-button { margin-top: 12px; }
.helper { margin: 10px 0 0 !important; font-size: 10px !important; }
.address-box { padding: 14px; border-radius: 10px; background: #102d2a; color: var(--lime); font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.future-card { background: linear-gradient(145deg, white, #edf8f5); }
.future-tag { display: inline-block; margin-bottom: 10px; padding: 4px 7px; border-radius: 20px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 900; }

dialog { width: min(600px, calc(100% - 24px)); max-height: 92vh; border: 0; border-radius: 20px; padding: 0; color: var(--ink); box-shadow: 0 35px 100px rgba(9,40,36,.28); }
dialog::backdrop { background: rgba(8,27,25,.58); backdrop-filter: blur(3px); }
#goal-form { padding: 28px; overflow: auto; max-height: 92vh; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.dialog-head h2 { font-family: Georgia, "STSong", serif; font-size: 26px; }
.close-button { border: 0; background: transparent; font-size: 28px; color: var(--muted); cursor: pointer; }
.field { display: grid; gap: 7px; margin-bottom: 16px; font-size: 12px; font-weight: 700; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; outline: none; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15,118,110,.08); }
.field small { color: var(--muted); font-weight: 400; }
.field-row { display: grid; gap: 10px; }.field-row.three { grid-template-columns: 90px 1fr 1fr; }
.segment { display: flex; padding: 3px; border-radius: 10px; background: var(--paper); }
.segment label { flex: 1; cursor: pointer; }.segment input { display: none; }.segment span { display: block; padding: 9px; text-align: center; border-radius: 8px; color: var(--muted); font-weight: 500; }.segment input:checked + span { background: white; color: var(--green); box-shadow: 0 2px 7px rgba(0,0,0,.06); font-weight: 800; }
.weekday-picker { display: none; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: -3px 0 18px; }.weekday-picker.visible { display: grid; }.weekday-picker input { display: none; }.weekday-picker span { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 11px; cursor: pointer; }.weekday-picker input:checked + span { background: var(--green); border-color: var(--green); color: white; }
.reminder-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-block: 1px solid var(--line); }
.switch { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 700; }.switch input { display: none; }.switch span { width: 36px; height: 20px; padding: 3px; border-radius: 20px; background: #c7d1cf; transition: .2s; }.switch span::after { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: white; transition: .2s; }.switch input:checked + span { background: var(--green); }.switch input:checked + span::after { transform: translateX(16px); }
.dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 22px; }.dialog-actions span { flex: 1; }
.hidden { display: none !important; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 100; transform: translate(-50%, 30px); padding: 11px 17px; border-radius: 10px; background: #102d2a; color: white; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transition: .25s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-nav { display: none; }

#login-dialog { width: min(420px, calc(100% - 28px)); text-align: center; }
#login-form { display: grid; padding: 34px; }
.login-mark { width: 58px; height: 58px; display: grid; place-items: center; justify-self: center; margin-bottom: 20px; border-radius: 17px; color: white; background: linear-gradient(145deg, #ff735e, #ff4538); box-shadow: 0 12px 24px rgba(255,82,63,.25); font-family: Georgia, serif; font-size: 25px; font-weight: 900; }
#login-form h2 { margin-bottom: 10px; font-family: Georgia, "STSong", serif; font-size: 27px; }
#login-form > p:not(.eyebrow):not(.login-error) { margin-bottom: 22px; color: var(--muted); font-size: 12px; line-height: 1.7; }
#login-form .field { text-align: left; }
#login-form .primary-button { width: 100%; padding-block: 13px; }
#login-form > small { margin-top: 13px; color: var(--muted); }
.login-error { min-height: 18px; margin: -5px 0 8px; color: var(--red); font-size: 11px; }

@media (max-width: 900px) {
  .sidebar { width: 190px; padding-inline: 15px; }
  .main { margin-left: 190px; }
  .view { padding: 35px 28px 70px; }
  .hero-card { gap: 25px; padding-inline: 30px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .sidebar { display: none; }
  .main { margin: 0; }
  .view { padding: max(22px, env(safe-area-inset-top)) 16px 100px; }
  .topbar { min-height: auto; margin-bottom: 22px; align-items: center; }
  .topbar h1 { font-size: 29px; }
  .topbar .primary-button { padding: 9px 11px; font-size: 12px; }
  .today-topbar { min-height: 42px; margin-bottom: 13px; }
  .today-topbar .eyebrow { display: none; }
  .today-topbar h1 { font-family: inherit; font-size: 18px; font-weight: 700; }
  .today-topbar .avatar-button { width: 36px; height: 36px; background: #362c30; }
  .habit-calendar { margin-inline: -16px; padding: 20px 8px 17px; border-inline: 0; border-radius: 0; box-shadow: none; }
  .habit-month-row { grid-template-columns: 34px 1fr 34px; margin-bottom: 21px; padding-inline: 8px; }
  .habit-month-row h2 { font-size: 22px; }
  .habit-month-row button { width: 32px; height: 32px; }
  .habit-day { gap: 7px; }
  .habit-day > span { font-size: 11px; }
  .habit-day > strong { width: 43px; height: 43px; font-size: 17px; }
  .today-overview { grid-template-columns: 1.25fr 1fr; margin-top: 11px; }
  .today-overview > div { min-height: 69px; padding: 12px 8px; }
  .overview-progress strong { font-size: 23px; }
  .overview-streak > strong { font-size: 21px; }
  .overview-best { display: none !important; }
  .habit-heading { margin-top: 27px; }
  .habit-heading h2 { font-size: 21px; }
  .habit-heading .text-button { font-size: 12px; }
  .goal-list { gap: 24px; }
  .habit-card { grid-template-columns: 50px minmax(0, 1fr) auto; gap: 11px; min-height: 90px; padding: 13px; border-radius: 15px; }
  .habit-icon { width: 48px; height: 48px; font-size: 22px; }
  .habit-info h3 { margin-bottom: 5px; font-size: 17px; }
  .habit-info p { font-size: 10px; }
  .habit-info p span { display: none; }
  .habit-minimum { font-size: 10px; }
  .habit-action { gap: 5px; }
  .habit-check { width: 42px; height: 42px; border-width: 1.5px; }
  .habit-check span { font-size: 23px; }
  .habit-plus { width: 26px; height: 26px; background: #fff8f6; font-size: 11px; }
  .future-label { padding-inline: 7px; }
  .hero-card { min-height: 0; display: block; padding: 24px; border-radius: 19px; }
  .progress-ring { width: 103px; height: 103px; float: right; margin: 0 0 12px 14px; }
  .progress-ring strong { font-size: 25px; }
  .hero-copy h2 { font-size: 23px; margin-top: 8px; }
  .hero-copy p { min-height: 38px; }
  .streak-line { clear: both; margin-top: 17px; }
  .streak-line em { width: 100%; margin: -2px 0 0 27px; }
  .section-heading { margin-top: 27px; }
  .today-goal { grid-template-columns: 40px 1fr; padding: 14px; gap: 11px; }
  .goal-icon { width: 38px; height: 38px; }
  .goal-action { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; }
  .goal-action .check-button { width: 100%; }
  .goal-grid, .settings-grid { grid-template-columns: 1fr; }
  .intro-strip span { display: block; margin: 5px 0 0; }
  .calendar-card { padding: 14px 9px; }
  .calendar-legend { justify-content: center; flex-wrap: wrap; }
  .calendar-grid { gap: 3px; }
  .calendar-day { aspect-ratio: 1; min-height: 40px; }
  .metric-grid { gap: 8px; }
  .metric-card { padding: 15px; }
  .chart-card { padding: 18px 13px; }
  .bar-chart { gap: 3px; overflow: hidden; }
  .stat-row { grid-template-columns: 95px 1fr 35px; gap: 7px; }
  .settings-card { padding: 20px; }
  .time-select { gap: 3px; }
  .time-select select { min-width: 62px; padding-inline: 3px !important; }
  .field-row.three { grid-template-columns: 65px 1fr 1fr; }
  #goal-form { padding: 22px 18px; }
  .dialog-actions { flex-wrap: wrap; }.dialog-actions span { display: none; }.dialog-actions button { flex: 1; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: end; padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }.mobile-nav button span { display: block; margin-bottom: 3px; font-size: 17px; }.mobile-nav button.active { color: var(--green); font-weight: 900; }
  .mobile-nav .mobile-add { width: 49px; height: 49px; align-self: center; justify-self: center; border-radius: 50%; background: var(--green); color: white; font-size: 27px; box-shadow: 0 7px 20px rgba(15,118,110,.28); }.mobile-nav .mobile-add span { display: none; }
}
