:root {
  color-scheme: light;
  --bg: #f7f2e9;
  --card: #fffdf8;
  --ink: #223234;
  --muted: #667574;
  --line: #ddd8cb;
  --primary: #177c73;
  --primary-dark: #0e625b;
  --soft: #e5f1ed;
  --danger: #b84d43;
  --shadow: 0 12px 32px rgba(36, 48, 43, .08);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) { :root { color-scheme: dark; --bg:#182322; --card:#21302e; --ink:#f2f5ee; --muted:#b0c0bb; --line:#3b4d49; --primary:#67c7b6; --primary-dark:#9be2d3; --soft:#294844; --danger:#f08d82; --shadow:0 12px 32px rgba(0,0,0,.22); } }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; --bg:#182322; --card:#21302e; --ink:#f2f5ee; --muted:#b0c0bb; --line:#3b4d49; --primary:#67c7b6; --primary-dark:#9be2d3; --soft:#294844; --danger:#f08d82; --shadow:0 12px 32px rgba(0,0,0,.22); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); line-height: 1.45; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 2px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.45rem, 5vw, 2.1rem); letter-spacing: -.04em; }
h2 { font-size: 1.15rem; letter-spacing: -.02em; }
.app-shell { min-height: 100vh; }
.topbar, .content, .footer { width: min(100% - 32px, 760px); margin-inline: auto; }
.topbar { padding: 28px 0 18px; display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.top-actions, .form-actions, .backup-actions, .modal-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.eyebrow { color: var(--primary); font-size: .72rem; text-transform: uppercase; letter-spacing: .13em; font-weight: 800; margin-bottom: 5px; }
.muted { color: var(--muted); font-size: .9rem; }
.microcopy, .optional, .legend-help { color: var(--muted); font-size: .75rem; font-weight: 400; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.quick-card { padding: 20px; }
.section-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:20px; }
.section-heading.compact { margin-bottom:14px; }
.status-badge { background: var(--soft); color: var(--primary-dark); border-radius: 999px; font-size: .72rem; font-weight: 800; padding: 5px 9px; }
.button, .icon-button, .choice { border: 1px solid transparent; border-radius: 12px; min-height: 44px; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button { padding: 10px 15px; font-weight: 750; }
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: var(--soft); color: var(--primary-dark); }
.button.quiet { background: transparent; border-color: var(--line); color: var(--ink); }
.button.danger-outline { background: transparent; border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); color: var(--danger); }
.button.full { width:100%; }
.icon-button { width:44px; padding:0; background: var(--card); border-color: var(--line); color: var(--ink); font-size:1.25rem; }
.button:hover, .icon-button:hover, .choice:hover { transform: translateY(-1px); }
.day-toolbar { display:grid; grid-template-columns: 44px 1fr 44px auto; align-items:end; gap:8px; margin-bottom:16px; }
.date-picker-wrap { display:flex; flex-direction:column; gap:4px; }
.date-picker-wrap label, .field label, legend { font-size:.78rem; font-weight:800; }
input[type="date"], input[type="time"], input[type="text"], input[type="password"], textarea { width:100%; background:var(--card); color:var(--ink); border:1px solid var(--line); border-radius:11px; padding:11px 12px; min-height:44px; }
textarea { resize:vertical; min-height:72px; }
.form-grid { display:grid; gap:12px; }
.two-col { grid-template-columns:1fr 1fr; }
.field { display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.scale-fieldset { border:0; padding:0; margin: 18px 0; }
legend { padding:0; margin-bottom:8px; width:100%; }
.legend-help { margin-left:5px; }
.choice-row { display:grid; grid-template-columns:repeat(5, 1fr); gap:7px; }
.choice { position:relative; background:transparent; border-color:var(--line); color:var(--ink); font-weight:800; min-height:52px; padding: 8px 4px; }
.choice span { display:block; font-size:.6rem; color:var(--muted); font-weight:500; line-height:1.1; margin-top:3px; }
.choice.selected { background:var(--primary); border-color:var(--primary); color:#fff; }
.choice.selected span { color:#e7fff7; }
.choice.energy-negative.selected { background:#b86b5c; border-color:#b86b5c; }
.direction-row { grid-template-columns:repeat(3, 1fr); }
.direction-row .choice { min-height:46px; }
.form-actions { justify-content:flex-end; margin-top:6px; }
.form-message { color:var(--primary-dark); font-size:.84rem; margin-top:10px; }
.form-error { color:var(--danger); font-size:.84rem; margin-top:9px; }
.summary-card { padding:18px 20px; margin-top:14px; }
.summary-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; }
.summary-item { background:color-mix(in srgb, var(--bg) 62%, var(--card)); border-radius:12px; padding:11px 10px; min-height:72px; }
.summary-item strong { display:block; font-size:1.2rem; letter-spacing:-.03em; }
.summary-item span { color:var(--muted); font-size:.72rem; }
.entries-section { margin-top:30px; }
.entries-list { display:grid; gap:10px; }
.empty-state { text-align:center; padding:34px 20px; border:1px dashed var(--line); border-radius:var(--radius); color:var(--muted); background:color-mix(in srgb, var(--card) 50%, transparent); }
.entry-card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px; }
.entry-main { display:grid; grid-template-columns:90px 1fr auto; gap:12px; align-items:start; }
.entry-time { color:var(--primary-dark); font-size:.78rem; font-weight:800; }
.entry-activity { font-weight:760; overflow-wrap:anywhere; }
.entry-notes { color:var(--muted); font-size:.82rem; margin-top:6px; white-space:pre-wrap; }
.entry-meta { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; color:var(--muted); font-size:.76rem; }
.entry-direction.more { color:var(--primary-dark); }.entry-direction.less { color:var(--danger); }
.entry-actions { display:flex; gap:5px; }
.mini-button { border:1px solid var(--line); background:transparent; color:var(--muted); border-radius:9px; min-width:34px; min-height:34px; }
.mini-button:hover { color:var(--ink); background:var(--soft); }
.backup-card { padding:20px; margin-top:30px; }
.backup-actions { margin-top:15px; }
.footer { color:var(--muted); font-size:.75rem; text-align:center; padding:28px 0 36px; }
.lock-screen { min-height:100vh; display:grid; place-items:center; padding:20px; background:var(--bg); }
.lock-card { width:min(100%, 390px); background:var(--card); border:1px solid var(--line); border-radius:24px; padding:30px 24px; box-shadow:var(--shadow); text-align:center; }
.brand-mark { width:54px; height:54px; display:grid; place-items:center; border-radius:16px; margin:0 auto 18px; background:var(--primary); color:white; font-weight:900; letter-spacing:-.08em; }
.lock-card h1 { margin-bottom:6px; }.pin-form { text-align:left; margin-top:22px; }.pin-form label { display:block; font-size:.8rem; font-weight:800; margin-bottom:6px; }.pin-input-wrap { position:relative; }.pin-input-wrap input { padding-right:78px; }.pin-toggle { position:absolute; right:6px; top:6px; min-height:32px; padding:4px 8px; border:0; border-radius:8px; background:var(--soft); color:var(--primary-dark); font-size:.74rem; font-weight:800; }.pin-form .button { margin-top:12px; }.pin-status { color:var(--primary-dark); font-size:.8rem; margin-top:8px; }.lock-card .microcopy { margin-top:18px; line-height:1.4; }
.modal { border:0; padding:0; background:transparent; max-width:min(calc(100% - 28px), 520px); width:100%; }
.modal::backdrop { background:rgba(10,25,23,.52); }
.modal-card { position:relative; background:var(--card); color:var(--ink); border:1px solid var(--line); border-radius:20px; padding:24px; box-shadow:var(--shadow); }
.modal-card h2 { font-size:1.45rem; margin-bottom:6px; }.modal-close { position:absolute; top:12px; right:12px; border:0; background:transparent; color:var(--muted); font-size:1.7rem; line-height:1; }.export-options { display:grid; gap:8px; margin:18px 0; }.radio-card { display:flex; gap:10px; align-items:flex-start; border:1px solid var(--line); border-radius:12px; padding:11px; cursor:pointer; }.radio-card:has(input:checked) { border-color:var(--primary); background:var(--soft); }.radio-card input { margin-top:3px; accent-color:var(--primary); }.radio-card strong, .radio-card small { display:block; }.radio-card small { color:var(--muted); font-size:.78rem; margin-top:2px; }.range-fields { margin-bottom:18px; }.modal-actions { justify-content:flex-end; margin-top:18px; }.drop-zone { border:1px dashed var(--line); border-radius:13px; padding:18px; margin-top:18px; display:grid; gap:8px; text-align:center; }.drop-zone input { max-width:100%; }.drop-zone label { color:var(--primary-dark); font-weight:800; }.drop-zone span { color:var(--muted); font-size:.8rem; overflow-wrap:anywhere; }.toast { position:fixed; left:50%; bottom:22px; transform:translateX(-50%); background:var(--ink); color:var(--card); border-radius:999px; padding:11px 16px; font-size:.84rem; box-shadow:var(--shadow); z-index:5; }.no-script { padding:20px; background:#fff0ef; color:#8e2b24; }
@media (max-width:520px) { .topbar, .content, .footer { width:min(100% - 24px, 760px); }.topbar { padding-top:20px; }.quick-card, .backup-card, .summary-card { padding:16px; }.day-toolbar { grid-template-columns:40px 1fr 40px; }.day-toolbar .button { grid-column:1/-1; width:100%; }.icon-button { width:40px; }.choice { min-height:50px; font-size:.92rem; }.choice span { font-size:.55rem; }.entry-main { grid-template-columns:70px 1fr; }.entry-actions { grid-column:2; }.entry-time { font-size:.72rem; }.backup-actions .button { flex:1 1 140px; }.summary-grid { gap:6px; }.summary-item { padding:9px 7px; }.summary-item strong { font-size:1.05rem; } }
@media (min-width:700px) { .content { padding-bottom:18px; } }
