:root{color-scheme:light;--ink:#203a32;--muted:#51665d;--green:#415f31;--dark:#3c532b;--paper:#fbf9f0;--line:#dce3d9;--card:#fff;--rose:#915343;--rose-bg:#fbf0ea;--shadow:0 12px 34px #263e2f0b;font:16px/1.5 system-ui,sans-serif}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:var(--paper);color:var(--ink)}
a{color:var(--green);text-underline-offset:.22em}
button,input,textarea,select{font:inherit}
button,select{cursor:pointer}
button:disabled{cursor:default;opacity:.55}
button,a,input,textarea,select{touch-action:manipulation}
:focus-visible{outline:3px solid #54896f;outline-offset:3px}
.wrap{width:min(1120px,calc(100% - 48px));margin-inline:auto}
.sr-only,.skip:not(:focus){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.skip:focus{position:absolute;z-index:5;background:white;padding:10px}
.header{background:#fff;border-bottom:1px solid var(--line)}
.header-inner{min-height:76px;display:flex;justify-content:space-between;align-items:center;gap:14px}
.brand{color:var(--ink);text-decoration:none;font-weight:720;display:flex;gap:11px;align-items:center}
.brand-bowl{display:block;flex:none}
.mark,.small-mark{display:grid;place-items:center;border-radius:12px;background:var(--dark);color:#f9f8ec;width:36px;height:36px;flex:none;font-size:21px;line-height:1}
nav{display:flex;gap:6px;align-items:center}
nav a{font-size:.9rem;font-weight:650;text-decoration:none;border-radius:8px;padding:8px 13px;color:var(--muted)}
nav [aria-current="page"]{color:var(--dark);background:#e5edcf}
.hero{display:flex;justify-content:space-between;gap:24px;align-items:flex-end;padding:48px 0 26px}
.date{font-size:.8rem;font-weight:700;color:var(--green);letter-spacing:.035em;margin:0 0 8px}
h1,h2{font-family:Georgia,serif;font-weight:500;margin:0;line-height:1.12}
h1{font-size:clamp(2.65rem,7vw,4.25rem);letter-spacing:-.055em}
h2{font-size:1.75rem;letter-spacing:-.035em}
h3{font-size:1rem;margin:0}
p{color:var(--muted);margin:8px 0 0}
.hero-actions{display:flex;gap:10px;padding-bottom:3px;flex-wrap:wrap}
button{border:1px solid transparent;border-radius:9px;padding:9px 14px;min-height:43px;font-size:.9rem;font-weight:680}
.primary{background:var(--dark);color:#fff}
.primary:hover{background:var(--green)}
.secondary{background:white;color:var(--dark);border-color:#b9cbbf}
.secondary:hover,.quiet:hover{background:#edf4eb}
.quiet{background:transparent;color:var(--ink)}
.metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:5px 0 22px}
.metric{background:#e5edcf;border:1px solid #dce8dd;border-radius:13px;padding:15px 18px;color:#325546;display:flex;flex-direction:column;gap:1px}
.metric span{font-size:.84rem;font-weight:650}
.metric strong{font-size:1.95rem;line-height:1.2;font-weight:550;font-variant-numeric:tabular-nums}
.reaction-metric{background:var(--rose-bg);border-color:#f0e0d7;color:#814838}
.total-metric{background:#f2efe6;border-color:#ebe5d6;color:#5a5644}
.diary-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(260px,1fr);gap:22px;align-items:start}
.panel{border:1px solid var(--line);border-radius:16px;background:var(--card);padding:22px;box-shadow:var(--shadow)}
.panel-head,.dialog-head,.backup-item{display:flex;justify-content:space-between;align-items:center;gap:12px}
.checklist{background:#eff3e4}
.check-head{display:flex;align-items:center;gap:10px}
.small-mark{background:#dce9d9;color:var(--green);width:31px;height:31px;font-size:17px;border-radius:8px}
.checklist ul{margin:18px 0;padding-left:18px;color:var(--muted);font-size:.93rem}
.checklist li+li{margin-top:12px}
.checklist strong{color:var(--ink)}
.checklist a{font-size:.89rem;font-weight:700}
input,textarea,select{min-width:0;width:100%;border:1px solid #bfcec4;border-radius:8px;padding:9px 10px;background:white;color:var(--ink);min-height:42px}
textarea{resize:vertical}
.panel-head select{width:auto;font-size:.88rem}
#search{margin:15px 0 4px}
.empty{display:grid;justify-items:center;text-align:center;padding:26px 10px 15px;min-height:150px}
.empty strong{font-size:1.05rem}
.empty p{margin:4px 0 10px}
.day-label{font-size:.8rem;font-weight:700;color:var(--muted);margin:18px 0 5px}
.entry{padding:10px 0;border-top:1px solid var(--line)}
.entry summary{cursor:pointer;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;list-style:none}
.entry summary::-webkit-details-marker{display:none}
.entry summary::after{content:'+';color:var(--green);font-weight:700}
.entry[open] summary::after{content:'−'}
.badge{width:29px;height:29px;display:grid;place-items:center;background:#e5edcf;color:var(--green);border-radius:8px;font-size:14px;font-weight:800}
.badge.reaction{background:var(--rose-bg);color:var(--rose)}
.entry-name{display:block;font-weight:680;overflow-wrap:anywhere}
.entry-meta{display:block;color:var(--muted);font-size:.83rem}
.entry-content{margin:9px 0 0 39px}
.entry-content dl{margin:0;display:grid;grid-template-columns:minmax(100px,.45fr) minmax(0,1fr);gap:5px 12px;font-size:.9rem}
.entry-content dt{color:var(--muted)}
.entry-content dd{margin:0;overflow-wrap:anywhere;white-space:pre-wrap}
.entry-controls{margin-top:8px;display:flex;gap:4px}
.danger{color:#953f31}
.workspace-panel{max-width:790px}
.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.review-fields{margin:16px 0 14px}
.backup-item{padding:16px 0;border-top:1px solid var(--line)}
.backup-item:first-of-type{margin-top:18px}
.backup-item:last-of-type{padding-bottom:0}
.backup-item p{margin:4px 0 0;font-size:.9rem}
.backup-item button{flex:none}
.footer{display:flex;gap:8px 18px;justify-content:space-between;flex-wrap:wrap;color:var(--muted);font-size:.83rem;padding:21px 0 30px}
.footer span span{color:#498161;margin-right:4px}
dialog{width:min(650px,calc(100% - 24px));padding:0;max-height:calc(100dvh - 24px);border:1px solid var(--line);border-radius:16px;color:var(--ink);box-shadow:0 18px 90px #18352854}
dialog::backdrop{background:#10271f87}
#entry-form{display:flex;flex-direction:column;max-height:calc(100dvh - 26px)}
.dialog-head,.dialog-footer{padding:12px 18px;flex:none}
.dialog-head{border-bottom:1px solid var(--line)}
.dialog-body{padding:15px 18px;overflow:auto;min-height:0;display:grid;gap:12px}
.dialog-footer{display:flex;justify-content:flex-end;gap:8px;border-top:1px solid var(--line)}
.close{font-size:1.5rem;padding:0 12px}
fieldset{padding:0;border:0;margin:0;min-width:0;display:grid;gap:12px}
label{display:grid;gap:4px;font-size:.87rem;font-weight:650;align-content:start}
#status,#storage-error,#form-error{padding:10px 14px;border-radius:8px;margin:0 0 12px;background:#edf4eb}
#storage-error,#form-error{color:#793a2e;background:var(--rose-bg)}
@media(max-width:730px){.wrap{width:calc(100% - 32px)}.diary-grid{grid-template-columns:1fr;gap:14px}.hero{align-items:flex-start;flex-direction:column;gap:15px;padding-top:30px}.metrics{gap:8px;margin-bottom:14px}.metric{padding:10px}.metric span{font-size:.75rem}.metric strong{font-size:1.6rem}.panel{padding:16px}}
@media(max-width:510px){.header-inner{min-height:0;align-items:flex-start;flex-direction:column;gap:7px;padding:10px 0 7px}.brand{font-size:.95rem}.mark{width:29px;height:29px}.fields{grid-template-columns:1fr}.backup-item{align-items:flex-start;flex-direction:column}.entry-content{margin-left:0}}
@media print{.header,.hero-actions,.footer,.entry-controls,#status{display:none!important}body{background:white}.panel{box-shadow:none}}

.reminder-panel{margin-top:20px}
#reminder-form{display:flex;flex-wrap:wrap;gap:10px;align-items:end;margin:14px 0}
#reminder-form label{min-width:125px}
.reminder-panel p:last-child{font-size:.88rem}
