:root {
  --bg: #f6f1e8;
  --paper: #fffdf8;
  --ink: #26322d;
  --muted: #68736d;
  --line: #ded8cc;
  --accent: #547464;
  --accent-soft: #dfe9e2;
  --warm: #c98261;
  --shadow: 0 14px 34px rgba(55, 61, 57, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(920px, 100%); margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 18px max(52px, env(safe-area-inset-bottom)); }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(28px, 5vw, 42px); margin-bottom: 8px; letter-spacing: -.04em; }
h2 { font-size: 21px; margin-bottom: 8px; }
.subtitle, .muted { color: var(--muted); }
.eyebrow { color: var(--warm); font-weight: 800; letter-spacing: .12em; font-size: 12px; text-transform: uppercase; margin-bottom: 7px; }
.icon-button { border: 0; background: rgba(255,255,255,.65); width: 42px; height: 42px; border-radius: 50%; font-size: 23px; color: var(--ink); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.hero-card, .focus-panel, .action-panel, .gentle-note, .now-card { background: var(--paper); border: 1px solid rgba(222,216,204,.8); border-radius: 22px; box-shadow: var(--shadow); }
.hero-card { padding: 22px; margin-bottom: 28px; }
.progress-wrap { display: grid; grid-template-columns: 108px 1fr; align-items: center; gap: 18px; }
.progress-ring { --progress: 0deg; width: 100px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) var(--progress), var(--accent-soft) 0); position: relative; }
.progress-ring::after { content: ""; position: absolute; inset: 10px; background: var(--paper); border-radius: 50%; }
.progress-ring span { position: relative; z-index: 1; font-size: 22px; font-weight: 850; }
.sleep-strip { display: flex; flex-wrap: wrap; gap: 8px 16px; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; font-size: 14px; }
.sleep-strip strong { margin-left: auto; color: var(--accent); }
section { margin-bottom: 28px; }
.section-title-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 14px; }
.soft-badge { font-size: 12px; color: var(--accent); background: var(--accent-soft); padding: 7px 10px; border-radius: 999px; text-align: center; }
.day-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.day-card { min-height: 132px; text-align: left; border: 1px solid var(--line); background: rgba(255,253,248,.72); border-radius: 18px; padding: 15px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); transition: .18s ease; }
.day-card:hover, .day-card.selected { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 22px rgba(64,88,74,.12); }
.day-card.selected { background: var(--accent-soft); }
.day-card strong { font-size: 16px; }
.day-card small { color: var(--muted); line-height: 1.45; }
.day-icon { font-size: 27px; }
.focus-panel { display: grid; grid-template-columns: auto 1fr auto 1.5fr auto; gap: 10px; padding: 16px; align-items: center; }
input, select { width: 100%; border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 12px; padding: 11px 12px; outline: none; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(84,116,100,.12); }
.primary-button, .secondary-button, .text-button { border-radius: 12px; padding: 11px 14px; font-weight: 750; }
.primary-button { border: 1px solid var(--accent); background: var(--accent); color: white; }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.text-button { border: 0; background: transparent; color: var(--accent); padding-inline: 4px; }
.task-list { display: grid; gap: 10px; }
.task-card { background: var(--paper); border: 1px solid var(--line); border-radius: 17px; padding: 14px; display: grid; grid-template-columns: 28px 68px 1fr auto; align-items: center; gap: 10px; transition: .16s ease; }
.task-card.active { border-color: var(--warm); box-shadow: 0 8px 20px rgba(201,130,97,.12); }
.task-card.done { opacity: .6; }
.task-card.done .task-title { text-decoration: line-through; }
.task-check { width: 23px; height: 23px; accent-color: var(--accent); }
.task-time { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.task-title { font-weight: 800; margin-bottom: 4px; }
.task-note { color: var(--muted); font-size: 13px; line-height: 1.45; }
.task-actions { display: flex; gap: 5px; }
.task-actions button { border: 0; background: transparent; font-size: 16px; opacity: .65; }
.task-actions button:hover { opacity: 1; }
.empty-state { border: 1px dashed var(--line); border-radius: 18px; padding: 32px; text-align: center; color: var(--muted); }
.empty-state div { font-size: 35px; margin-bottom: 8px; }
.action-panel { padding: 14px; display: flex; flex-wrap: wrap; gap: 9px; }
.gentle-note { padding: 17px 20px; background: #fff7ee; }
.gentle-note p { margin: 7px 0 0; color: var(--muted); line-height: 1.6; }
.now-card { padding: 18px; border-left: 6px solid var(--warm); }
.timer-row { display: flex; align-items: center; gap: 16px; }
#focusTimer { font-size: 24px; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
dialog { border: 0; padding: 0; background: transparent; width: min(640px, calc(100% - 28px)); }
dialog::backdrop { background: rgba(20,30,25,.42); backdrop-filter: blur(4px); }
.dialog-card { background: var(--paper); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); }
.dialog-card > label { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: grid; gap: 6px; font-weight: 700; }
.dialog-actions { margin-top: 20px; display: flex; justify-content: flex-end; align-items: center; gap: 14px; flex-wrap: wrap; }
.file-label { cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translate(-50%, 18px); background: #26322d; color: white; border-radius: 999px; padding: 11px 17px; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 20; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) {
  .day-grid { grid-template-columns: 1fr 1fr; }
  .focus-panel { grid-template-columns: 1fr; align-items: stretch; }
  .focus-panel label { margin-top: 4px; }
  .task-card { grid-template-columns: 28px 55px 1fr; }
  .task-actions { grid-column: 3; justify-self: end; }
  .progress-wrap { grid-template-columns: 82px 1fr; }
  .progress-ring { width: 78px; }
  .sleep-strip strong { margin-left: 0; width: 100%; }
}
@media (max-width: 430px) {
  .app-shell { padding-inline: 13px; }
  .day-card { min-height: 122px; padding: 13px; }
  .form-grid { grid-template-columns: 1fr; }
  .action-panel { display: grid; }
}
