:root{
 --text:#3c342e;--outside:#efdbcc;--surface:#fff7ec;--border:#d7c3af;
 --muted:#756354;--accent-text:#38574a;--soft:#eadfcf;--accent:#476951;
 --inverse:#fffaf0;--danger:#a13b36;--toast:#403d32;--focus:#9e671c;
 --rule:#d8d4c9;--margin:#d4a69a;--metal:#b8b5af;--ring-shadow:#968f83;
 --s8:8px;--s13:13px;--s21:21px;--s34:34px;--s55:55px;color-scheme:light;
 font-family:system-ui,-apple-system,'Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif;
 color:var(--text);background:var(--outside);
}
:root[data-theme=dark]{
 --text:#f0e4d7;--outside:#211b18;--surface:#302822;--border:#6e5c4c;
 --muted:#c2b29f;--accent-text:#b7d3bd;--soft:#42392e;--accent:#4d7056;
 --inverse:#fffaf0;--danger:#ffb4a9;--toast:#514636;--focus:#e4bb73;
 --rule:#534b40;--margin:#8c6257;--metal:#ada59a;--ring-shadow:#14110e;color-scheme:dark;
}
*{box-sizing:border-box}body{margin:0 auto;max-width:640px;min-height:100dvh;background:var(--surface);padding-bottom:calc(89px + env(safe-area-inset-bottom));box-shadow:0 0 34px #40281c18}
header{display:flex;align-items:center;min-height:76px;padding:21px 34px;border-bottom:1px solid var(--border)}h1{font-size:21px;font-weight:600;letter-spacing:.08em;margin:0}h2{font-size:21px;line-height:1.5;margin:8px 0 21px;font-weight:600}h3{font-size:13px;color:var(--muted);font-weight:500;margin:34px 0 8px}main{padding:21px 34px;position:relative;min-height:calc(100dvh - 165px)}
button,input,textarea,select{font:inherit}button{cursor:pointer;touch-action:manipulation}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,640px);display:flex;justify-content:space-around;gap:8px;background:var(--surface);border-top:1px solid var(--border);padding:13px 13px max(13px,env(safe-area-inset-bottom));z-index:3}
nav button{flex:1;min-height:44px;padding:8px 4px;border:0;background:none;color:var(--muted);font-size:13px;font-weight:600;white-space:nowrap;border-radius:8px}nav button.active{color:var(--accent-text);background:var(--soft);box-shadow:inset 0 -2px 0 var(--accent)}
.card,.choice{display:block;width:100%;text-align:left;border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:8px;padding:13px;margin:8px 0;white-space:pre-wrap;overflow-wrap:anywhere}.card:hover,.choice:hover{background:var(--soft)}.body-preview{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-wrap;font-size:18px;line-height:1.7}.meta{font-size:13px;line-height:1.6;color:var(--muted);margin-top:8px}.card .meta{display:block}.status{font-size:13px;color:var(--muted)}.status::before{content:'○';margin-right:5px}.status.incomplete::before{content:'◐'}.status.done::before{content:'✓'}.status.done{color:var(--accent-text)}.empty{color:var(--muted);padding:34px 8px;text-align:center;font-size:15px;line-height:1.8}
.toolbar{display:flex;justify-content:space-between;align-items:center;gap:8px}.toolbar button,.action,.secondary{border:0;border-radius:8px;background:var(--accent);color:var(--inverse);padding:13px 21px;margin:8px 8px 8px 0;min-height:44px}.secondary{background:var(--soft);color:var(--accent-text)}.danger{color:var(--danger)}
input,textarea,select{background:var(--surface);color:var(--text);accent-color:var(--accent);border:1px solid var(--border);border-radius:8px;padding:13px;max-width:100%}textarea{width:100%;min-height:233px;resize:vertical;line-height:1.8;font-size:18px}label{display:block;margin:21px 0 8px}input[type=datetime-local],input[type=time]{width:100%;max-width:377px}input[type=file]{width:100%;min-width:0;font-size:13px}input[type=checkbox],input[type=radio]{padding:0}input:disabled{opacity:.55}.detail{white-space:pre-wrap;overflow-wrap:anywhere;font-size:18px;line-height:1.9}.hint{font-size:13px;color:var(--muted);line-height:1.8}
#toast{position:fixed;bottom:calc(89px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);background:var(--toast);color:var(--inverse);border-radius:8px;padding:13px 21px;min-width:190px;max-width:calc(100vw - 26px);text-align:center;z-index:4;line-height:1.6}#toast button{color:var(--inverse);background:transparent;border:1px solid var(--inverse);border-radius:5px;margin-left:13px;padding:8px;min-height:40px}
.calendar-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px}.calendar-toolbar h2{margin:0}.calendar-toolbar button{margin-right:0;padding:8px 13px}.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;margin-top:13px}.weekday{text-align:center;font-size:13px;color:var(--muted);padding:8px 0}.calendar-day{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:55px;padding:5px 0;border:1px solid transparent;border-radius:8px;background:var(--surface);color:var(--text)}.day-count{font-size:11px;margin-top:5px;color:var(--muted)}.calendar-day.is-today{border:1px solid var(--accent)}.calendar-day.selected{background:var(--accent);color:var(--inverse)}.calendar-day.selected .day-count{color:var(--inverse)}.calendar-day:hover:not(.selected){background:var(--soft)}.selected-date{font-size:18px;font-weight:600;color:var(--text);margin-top:34px}
.settings-section{border:1px solid var(--border);border-radius:8px;padding:21px;margin:21px 0;background:var(--surface)}.settings-section h3{margin:0 0 13px;font-size:18px;font-weight:600;color:var(--text)}.settings-section select{width:100%}.toggle-row{display:flex;align-items:center;justify-content:space-between;gap:13px;min-height:44px}.toggle-row input{width:21px;height:21px;flex-shrink:0}.notification-note{padding:13px;background:var(--soft);border-radius:8px;color:var(--text);font-size:13px;line-height:1.8}fieldset.settings-section{min-width:0}fieldset legend{padding:0 8px}
/* Ring notebook. The decoration never intercepts pointer events. */
.notebook-page{padding-left:55px;padding-top:34px;isolation:isolate}.notebook-page::before{content:'';position:absolute;left:42px;top:0;bottom:0;width:1px;background:var(--margin);opacity:.65;pointer-events:none;z-index:-1}.notebook-rings{position:absolute;left:8px;top:34px;bottom:13px;width:26px;overflow:hidden;display:flex;flex-direction:column;gap:72px;pointer-events:none}.notebook-rings span{display:block;position:relative;flex-shrink:0;width:26px;height:17px;margin-top:4px;border:3px solid var(--metal);border-radius:13px;box-shadow:0 2px 2px var(--ring-shadow),inset 0 1px 0 #ffffff70;background:transparent}.notebook-rings span::after{content:'';position:absolute;right:-5px;top:1px;width:7px;height:7px;border-radius:50%;background:var(--ring-shadow);z-index:-1}.notebook-date{font-size:13px;color:var(--muted);margin:0 0 8px;letter-spacing:.04em}.notebook-page h2{margin-bottom:21px}.notebook-sheet{background:repeating-linear-gradient(to bottom,transparent 0,transparent 33px,var(--rule) 33px,var(--rule) 34px);min-height:408px}
.new-memo-card{display:flex;align-items:center;gap:13px;width:100%;min-height:102px;border:0;border-radius:0;background:transparent;color:var(--accent-text);text-align:left;padding:0 13px;margin:0}.new-memo-card:hover{background:color-mix(in srgb,var(--soft) 65%,transparent)}.new-memo-plus{font-size:34px;line-height:34px}.write-label{display:block;font-size:18px;line-height:34px}.write-prompt{display:block;font-size:13px;line-height:34px;color:var(--muted)}
.notebook-sheet .card{border:0;border-radius:0;background:transparent;margin:0;padding:0 13px;min-height:68px}.notebook-sheet .card:hover{background:color-mix(in srgb,var(--soft) 65%,transparent)}.notebook-sheet .body-preview{font-size:21px;line-height:34px;padding-top:0}.notebook-sheet .meta{font-size:13px;line-height:34px;margin-top:0;white-space:normal}.notebook-sheet .empty{padding:34px 13px;margin:0;line-height:34px;text-align:left}
@media(min-width:700px){body{margin-top:21px;border-radius:8px 8px 0 0;min-height:calc(100dvh - 21px)}.notebook-sheet{min-height:510px}}
@media(max-width:400px){header{padding-inline:21px}main{padding-inline:21px}.notebook-page{padding-left:55px;padding-right:13px}.notebook-sheet .body-preview{font-size:18px}.toolbar h2{font-size:18px}.toolbar button{padding-inline:13px}.settings-section{padding:13px}.calendar-grid{gap:3px}}

/* Keep the framed entry above the unframed scrollable list of all memos. */
.notebook-page{height:calc(100dvh - 165px - env(safe-area-inset-bottom));min-height:400px;display:flex;flex-direction:column;padding-bottom:13px}
.notebook-date,.notebook-page h2{flex-shrink:0}
.notebook-sheet{display:flex;flex-direction:column;flex:1;min-height:0;background:none;gap:21px}
.notebook-top{flex-shrink:0;border:1px solid var(--accent);border-radius:8px;overflow:hidden;background:repeating-linear-gradient(to bottom,transparent 0,transparent 33px,var(--rule) 33px,var(--rule) 34px)}
.notebook-top .new-memo-card{min-height:68px}
.notebook-history{flex:1;min-height:102px;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--border) transparent;background:repeating-linear-gradient(to bottom,transparent 0,transparent 33px,var(--rule) 33px,var(--rule) 34px);overscroll-behavior-y:contain;scroll-padding-block:13px}
.notebook-history:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
@media(min-width:700px){.notebook-page{height:calc(100dvh - 186px - env(safe-area-inset-bottom));min-height:400px}.notebook-sheet{min-height:0}}

.history-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0}.history-toolbar .hint{margin:0}.history-toolbar .secondary{font-size:13px;padding:8px 13px;margin:0;min-height:40px}.notebook-sheet{gap:13px}

/* Leather cover and rings that bridge the outer paper edge. No external assets. */
:root{--leather:#c6a58b;--leather-edge:#967359;--grain-light:#ffffff12;--grain-dark:#51331e14;--cover-texture:radial-gradient(ellipse at 25% 35%,var(--grain-light) 0 1px,transparent 1.5px),radial-gradient(ellipse at 70% 65%,var(--grain-dark) 0 1px,transparent 1.7px),repeating-linear-gradient(108deg,transparent 0 5px,#5a342a07 6px,transparent 8px)}
:root[data-theme=dark]{--leather:#33251f;--leather-edge:#1c1310;--grain-light:#d2aa8510;--grain-dark:#00000024}
html{background-color:var(--leather);background-image:var(--cover-texture);background-size:7px 9px,11px 13px,auto}
body{width:min(640px,calc(100% - 26px));border:13px solid transparent;border-radius:13px 13px 0 0;background:linear-gradient(var(--surface),var(--surface)) padding-box,var(--cover-texture),linear-gradient(135deg,var(--leather),var(--leather-edge)) border-box;background-size:auto,7px 9px,11px 13px,auto,auto;box-shadow:0 8px 21px #24170e40,inset 0 0 0 1px #ffffff20;overflow:visible}
nav{width:min(614px,calc(100% - 52px))}
.notebook-page{padding-left:34px;height:calc(100dvh - 191px - env(safe-area-inset-bottom))}
.notebook-page::before{left:21px}
.notebook-rings{left:-26px;width:47px;overflow:hidden;z-index:2}
.notebook-rings span{width:47px;height:21px;border:4px solid var(--metal);border-top-color:#eee9e0;border-bottom-color:#827e77;border-left-color:#c6c2ba;border-right-color:#a4a096;border-radius:50%;box-shadow:0 3px 3px var(--ring-shadow),inset 0 1px 1px #ffffff90}
.notebook-rings span::after{right:-5px;top:3px;width:9px;height:9px;box-shadow:0 0 0 2px var(--border)}
.notebook-sheet .notebook-memo{padding-bottom:0}
.memo-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;height:34px;line-height:34px;white-space:normal}
.memo-time{font-size:11px;color:var(--muted);text-align:left;letter-spacing:.03em}.memo-heading .status{font-size:11px}
@media(min-width:700px){.notebook-page{height:calc(100dvh - 212px - env(safe-area-inset-bottom))}}
@media(max-width:400px){.notebook-page{padding-left:34px;padding-right:13px}}
/* Warm saddle leather and oxblood tones from the supplied reference. */
:root{--leather:#b85d38;--leather-edge:#743126;--leather-mid:#9f442c;--leather-highlight:#cf8351;--accent:#864432;--accent-text:#773c2b;--soft:#f0dfcb;--focus:#a26421}
:root[data-theme=dark]{--leather:#542b22;--leather-edge:#291611;--leather-mid:#3d211a;--leather-highlight:#79432c;--accent:#94523c;--accent-text:#e8bda0;--soft:#493125;--focus:#e5b67d}
html{background-image:var(--cover-texture),linear-gradient(115deg,var(--leather-highlight),var(--leather) 32%,var(--leather-mid) 68%,var(--leather-edge));background-size:7px 9px,11px 13px,auto,auto;background-attachment:fixed}
body{background:linear-gradient(var(--surface),var(--surface)) padding-box,var(--cover-texture),linear-gradient(135deg,var(--leather-highlight),var(--leather) 28%,var(--leather-edge)) border-box;background-size:auto,7px 9px,11px 13px,auto,auto}
.notebook-sheet .notebook-memo{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;min-height:34px;font-size:21px;line-height:34px}
.notebook-memo .memo-heading{display:inline-flex;justify-content:flex-start;align-items:baseline;gap:5px;height:auto;line-height:normal;white-space:nowrap;vertical-align:baseline;margin-right:13px}
.notebook-memo .body-preview{display:inline;font-size:inherit;line-height:inherit;white-space:pre-wrap}
.notebook-memo .memo-time,.notebook-memo .status{font-size:11px;line-height:normal}
@media(max-width:400px){.notebook-sheet .notebook-memo{font-size:18px}.notebook-memo .memo-heading{margin-right:8px}}
/* Small time and state sit at the upper left within the same ruled row. */
.notebook-memo .memo-heading{vertical-align:top;align-items:center;line-height:13px;padding-top:4px}
.notebook-memo .memo-time,.notebook-memo .status{line-height:13px}
/* Time above state, with the memo text to the right in the same ruled row. */
.notebook-memo .memo-heading{display:inline-flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:0;height:34px;line-height:13px;padding-top:0;vertical-align:top;min-width:65px}
.notebook-memo .memo-time,.notebook-memo .status{display:block;line-height:13px}
/* A shared closed leather frame: only the paper content scrolls. */
html{height:100%;overflow:hidden}
body{display:flex;flex-direction:column;height:calc(100dvh - 26px);min-height:0;margin:13px auto;padding-bottom:0;border-radius:13px}
header{flex-shrink:0}
main{flex:1;min-height:0;height:auto;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;scrollbar-width:thin;scrollbar-color:var(--border) transparent}
nav{position:static;left:auto;bottom:auto;transform:none;width:100%;flex-shrink:0}
.notebook-page{height:auto;min-height:0;overflow:visible;padding-top:21px}
.notebook-history{min-height:0}
.notebook-rings{top:21px}
.calendar-page{overflow:hidden;padding-top:13px;padding-bottom:13px}
.calendar-layout{height:100%;display:grid;grid-template-rows:minmax(0,1fr) minmax(0,1fr);gap:13px}
.calendar-month-pane{min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--border) transparent;padding-inline:2px}
.calendar-list-pane{min-height:0;display:flex;flex-direction:column;border-top:1px solid var(--border);padding-top:13px}
.calendar-list-pane .selected-date{margin:0 0 5px;font-size:16px;flex-shrink:0}
.calendar-list-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0}
.calendar-list-toolbar .selected-date{margin:0;min-width:0}
.calendar-list-toolbar .secondary{flex-shrink:0;font-size:13px;padding:8px 13px;margin:0;min-height:40px}
.calendar-list-pane>.hint{margin:0 0 8px;flex-shrink:0}
.calendar-memo-list{flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--border) transparent;padding:2px}
.calendar-memo-list:focus-visible{outline:2px solid var(--focus);outline-offset:-2px}
.calendar-memo-list{background:repeating-linear-gradient(to bottom,transparent 0,transparent 33px,var(--rule) 33px,var(--rule) 34px);padding:0}
.notebook-history,.calendar-memo-list{background-attachment:local}
.calendar-memo-list .notebook-memo,.status-memo-list .notebook-memo{border:0;border-radius:0;background:transparent;margin:0;padding:0 13px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;min-height:34px;font-size:21px;line-height:34px}
.calendar-memo-list .notebook-memo:hover,.status-memo-list .notebook-memo:hover{background:color-mix(in srgb,var(--soft) 65%,transparent)}
.notebook-memo .status.done{color:#315c40;background:#e3eddf;border-radius:4px;padding:0 4px;font-weight:700}
:root[data-theme=dark] .notebook-memo .status.done{color:#c1e0b9;background:#2c4430}
@media(max-width:400px){.calendar-memo-list .notebook-memo,.status-memo-list .notebook-memo{font-size:18px}}
.calendar-month-pane .calendar-toolbar button{margin:0;min-height:40px}
.calendar-month-pane [data-calendar-today]{font-size:13px;min-height:36px;padding:8px 13px;margin:8px 0 0}
.calendar-month-pane .calendar-grid{gap:3px;margin-top:8px}
.calendar-month-pane .calendar-day{min-height:44px}
.calendar-month-pane .weekday{padding:5px 0}
@media(min-width:700px){body{margin:13px auto;height:calc(100dvh - 26px);min-height:0;border-radius:13px}.notebook-page{height:auto;min-height:0}}
@media(max-height:600px){header{min-height:55px;padding-block:13px}.notebook-page{padding-top:8px}.notebook-date{margin-bottom:0}.notebook-page h2{margin:0 0 8px}.notebook-sheet{gap:8px}.notebook-top .new-memo-card{min-height:55px}nav{padding-block:8px}.calendar-list-pane>.hint{font-size:11px;line-height:1.3}}
/* Rings belong to the cover, shared by every screen. */
body{position:relative}
body>.notebook-rings{top:97px;bottom:76px;z-index:4}
@media(max-height:600px){body>.notebook-rings{top:76px}}
/* Fit every week into the upper half without scrolling the month. */
.calendar-month-pane{display:flex;flex-direction:column;overflow:hidden;container-type:size;container-name:month}
.calendar-month-pane .calendar-toolbar{flex-shrink:0}
.calendar-month-pane [data-calendar-today]{align-self:flex-start;flex-shrink:0;min-height:28px;padding:4px 13px;margin:4px 0 0}
.calendar-month-pane .calendar-grid{flex:1;min-height:0;grid-template-rows:21px repeat(var(--calendar-weeks,6),minmax(0,1fr));gap:3px;margin-top:5px}
.calendar-month-pane .calendar-day{min-height:0;padding:1px 0;font-size:13px;line-height:1.2}
.calendar-month-pane .weekday{padding:0;align-self:center;font-size:12px}
.calendar-month-pane .day-count{font-size:10px;margin-top:2px;line-height:1.1}
@container month (max-height:240px){.calendar-toolbar h2{font-size:16px}.calendar-toolbar button.secondary{min-height:28px;padding:4px 10px}.calendar-month-pane [data-calendar-today]{min-height:24px;font-size:11px;padding:2px 10px}.calendar-month-pane .calendar-grid{grid-template-rows:16px repeat(var(--calendar-weeks,6),minmax(0,1fr));gap:2px;margin-top:3px}.calendar-day .day-count{display:none}}
/* The front arc passes through a punched hole; its rear half is under the paper. */
.notebook-rings span{border:0;box-shadow:none;isolation:isolate}
.notebook-rings span::before{content:'';position:absolute;inset:auto;left:0;top:0;width:47px;height:28px;border:0;border-radius:0;clip-path:none;box-shadow:none;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='47' height='28' viewBox='0 0 47 28'%3E%3Cdefs%3E%3ClinearGradient id='metal' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop stop-color='%23d4b35d'/%3E%3Cstop offset='.5' stop-color='%23c4a047'/%3E%3Cstop offset='1' stop-color='%23aa8634'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M41 14 A18 10 0 1 0 10.5 21.2' fill='none' stroke='url(%23metal)' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;z-index:2}
.notebook-rings span::after{right:0;top:8px;width:12px;height:12px;border:1px solid var(--border);background:radial-gradient(circle at 50% 50%,var(--leather-edge) 0 43%,#291b14 68%,var(--leather) 100%);box-shadow:inset 1px 2px 3px #0008,0 1px 0 #ffffff60;z-index:1}
/* Paper index tabs on the right edge. */
body{width:min(640px,calc(100% - 96px))}
nav{position:absolute;top:92px;right:-44px;left:auto;bottom:auto;transform:none;width:44px;display:flex;flex-direction:column;justify-content:flex-start;gap:8px;padding:0;background:none;border:0;z-index:5}
nav button{flex:none;width:44px;min-height:76px;margin:0;padding:13px 8px;border:1px solid var(--border);border-left:0;border-radius:0 8px 8px 0;background:var(--soft);writing-mode:vertical-rl;display:flex;align-items:center;justify-content:center;gap:8px;letter-spacing:.12em;box-shadow:2px 2px 4px #40281c18}
nav button.active{background:var(--surface);color:var(--accent-text);box-shadow:inset -3px 0 0 var(--accent),2px 2px 4px #40281c18}
#pendingCount{writing-mode:horizontal-tb;letter-spacing:0;font-size:11px}
body>.notebook-rings{bottom:21px}
#toast{bottom:34px}
.history-toolbar{flex-wrap:wrap}
.list-tabs{display:flex;gap:8px;flex-wrap:wrap}
.list-tabs button{border:0;border-bottom:2px solid transparent;border-radius:5px 5px 0 0;padding:8px 5px;background:transparent;color:var(--muted);font-size:13px;min-height:40px;cursor:pointer}
.list-tabs button[aria-pressed=true]{border-color:var(--accent);color:var(--accent-text);background:var(--soft)}
.todo-form{padding:8px 13px 0;background:var(--surface)}
.todo-form label{font-size:13px;margin:0 0 5px}
.todo-input-row{display:flex;gap:8px;align-items:center}
.todo-input-row input{min-width:0;flex:1;width:100%;padding:8px;font-size:15px}
.todo-input-row .secondary{margin:0;padding:8px 13px;flex-shrink:0}
.todo-hint{margin:8px 13px;font-size:11px}
.todo-row{display:flex;align-items:center;gap:8px;min-height:34px;padding:0 8px 0 13px;background:var(--surface);border-bottom:1px solid var(--rule)}
.todo-row input{width:18px;height:18px;flex-shrink:0}
.todo-text{flex:1;min-width:0;text-align:left;border:0;background:none;color:var(--text);font-size:18px;line-height:1.6;padding:4px 0;overflow-wrap:anywhere;white-space:pre-wrap}
.todo-row.is-done .todo-text{text-decoration:line-through;color:var(--muted)}
.todo-delete{border:0;background:none;color:var(--muted);font-size:21px;min-width:34px;min-height:34px;padding:0;flex-shrink:0}
@media(max-width:480px){header{padding-inline:21px}.calendar-page{padding-inline:13px}.calendar-toolbar h2{font-size:16px}.calendar-list-toolbar{flex-wrap:wrap}.calendar-list-pane .selected-date{font-size:13px}.calendar-list-toolbar .secondary{font-size:11px;min-height:32px;padding:5px 8px}.history-toolbar .secondary{padding:5px 8px;font-size:11px;min-height:32px}.list-tabs{gap:4px}.list-tabs button{font-size:11px;padding:5px 3px;min-height:32px}.notebook-sheet{gap:8px}.todo-form{padding-inline:5px}.todo-input-row{gap:4px}.todo-input-row .secondary{padding:8px}.todo-text{font-size:15px}.todo-row{padding-inline:5px}.todo-hint{margin-inline:5px}}
@media(max-height:600px){nav{top:71px;gap:5px}nav button{min-height:55px;padding-block:8px}}
/* Index tabs sit within the leather frame; both lists stay visible. */
body{width:min(800px,calc(100% - 52px));max-width:800px}
header{padding-right:73px}
main,.calendar-page,.notebook-page{padding-right:73px}
nav{right:0;width:44px}
nav button{border-left:1px solid var(--border);border-right:0;border-radius:8px 0 0 8px}
.today-columns{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:21px;flex:1;min-height:0}
.today-memo-pane,.today-todo-pane{display:flex;flex-direction:column;min-width:0;min-height:0;gap:8px}
.today-todo-pane{border-left:1px solid var(--border);padding-left:13px}
.today-columns .history-toolbar{min-height:40px;flex-shrink:0;gap:5px}
.today-columns .history-toolbar h3{margin:0;font-size:13px;font-weight:600;color:var(--text)}
.today-columns .history-toolbar .secondary{font-size:11px;min-height:32px;padding:5px 8px}
.today-columns .notebook-memo{font-size:18px}
.todo-content{flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--border) transparent;overscroll-behavior-y:contain}
.todo-content:focus-visible{outline:2px solid var(--focus);outline-offset:-2px}
@media(max-width:700px){.today-columns{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(0,1fr);gap:13px}.today-todo-pane{border-left:0;border-top:1px solid var(--border);padding-left:0;padding-top:8px}.today-columns .history-toolbar{min-height:32px}}
@media(max-width:480px){header{padding-right:49px}main,.calendar-page,.notebook-page{padding-right:49px}nav,nav button{width:36px}nav button{font-size:12px;padding-inline:5px}.today-columns .notebook-memo{font-size:16px}}
/* Small pastel page markers, like a paper notebook's index. */
nav{right:6px;width:30px;gap:13px}
nav button{width:30px;min-height:64px;padding:10px 5px;font-size:11px;letter-spacing:.08em;border:1px solid var(--border);border-radius:4px 7px 7px 4px;box-shadow:1px 1px 2px #40281c14;background:color-mix(in srgb,var(--surface) 50%,var(--tab-color) 50%)}
#todayButton{--tab-color:#e7b8b0}
#calendarButton{--tab-color:#e6cb86}
#pendingButton{--tab-color:#bdd0a9}
#settingsButton{--tab-color:#b6d0df}
nav button.active{background:color-mix(in srgb,var(--surface) 30%,var(--tab-color) 70%);box-shadow:inset 2px 0 0 var(--accent);font-weight:700}
header{padding-right:60px}
main,.calendar-page,.notebook-page{padding-right:60px}
.today-columns{grid-template-columns:minmax(0,3fr) minmax(0,2fr)}
.today-todo-pane .todo-text{font-size:16px}
.today-todo-pane .todo-hint{margin-top:0}
@media(max-width:700px){.today-columns{grid-template-columns:minmax(0,1fr)}}
@media(max-width:480px){header{padding-right:48px}main,.calendar-page,.notebook-page{padding-right:48px}nav{right:3px}}
@media(max-height:600px){nav{gap:5px}nav button{min-height:55px;padding-block:8px}}
/* A narrower portrait notebook and ruled ToDo paper. */
body{width:min(680px,calc(100% - 52px));max-width:680px}
.save-destination{display:flex;flex-wrap:wrap;gap:4px 13px;width:fit-content;max-width:100%;margin:13px 0;border:1px solid var(--border);border-radius:8px;padding:4px 10px 8px;min-width:0}
.save-destination legend{font-size:13px;color:var(--muted);padding:0 5px}
.save-option{display:flex;align-items:center;justify-content:flex-start;gap:5px;margin:0;min-height:32px;font-size:14px}
.save-option input{flex-shrink:0;width:14px;height:14px;margin:0}
.todo-content{background:repeating-linear-gradient(to bottom,transparent 0,transparent 33px,var(--rule) 33px,var(--rule) 34px);background-attachment:local}
.todo-row{background:transparent;border-bottom:0;min-height:34px}
.todo-text{line-height:34px;padding:0}
.todo-items .empty{margin:0;padding:0 13px;font-size:13px;line-height:34px;text-align:left}
/* Fixed heading above ruled paper, shared by both pending memo lists. */
.status-list-page{display:flex;flex-direction:column;gap:13px;overflow:hidden}
.status-list-page>.toolbar{flex-shrink:0;flex-wrap:wrap}
.status-list-page>.toolbar h2{margin:0}
.status-list-page>.toolbar .secondary{margin:0;font-size:13px;padding:8px 13px;min-height:40px}
.status-memo-list .memo-day{margin:0;padding:0 13px;font-size:13px;line-height:34px;min-height:34px}
.status-memo-list .empty{margin:0;padding:0 13px;line-height:34px;text-align:left}
/* Premium notebook controls and per-book cover choices. */
header small{font-size:11px;color:var(--muted);font-weight:400;letter-spacing:0}
.book-bar{display:flex;align-items:stretch;gap:5px;overflow-x:auto;overscroll-behavior-x:contain;padding:5px 0 0;border-bottom:1px solid var(--border);scrollbar-width:thin}
.book-index{flex:0 0 auto;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:38px;padding:8px 12px;margin:0;border:1px solid var(--border);border-bottom:0;border-radius:8px 8px 0 0;background:color-mix(in srgb,var(--surface) 50%,var(--book-color,#e6cb86) 50%);color:var(--muted);font-size:12px;box-shadow:inset 0 -3px 4px #40281c0c}
.book-index:nth-child(3n+1){--book-color:#e7b8b0}.book-index:nth-child(3n+2){--book-color:#bdd0a9}.book-index:nth-child(3n){--book-color:#e6cb86}
.book-index.selected{background:var(--surface);color:var(--accent-text);font-weight:700;box-shadow:inset 0 3px 0 var(--accent)}
.book-index.book-manage{--book-color:#b6d0df}
.book-index:focus-visible{outline:2px solid var(--accent);outline-offset:-3px}
#bookControls{flex-shrink:0;min-width:0;padding:0 48px 0 34px}
#foldersButton{--tab-color:#d5c1df}
.folder-results{min-height:136px;max-height:340px;overflow:auto;margin-top:8px;background-attachment:local}
.folder-results .notebook-memo{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;border:0;border-radius:0;background:transparent;margin:0;padding:0 8px;font-size:18px;line-height:34px;min-height:34px}
.folder-results .memo-day,.folder-results .empty{margin:0;padding:0 8px;line-height:34px;text-align:left}
.folder-manage-row{display:flex;flex-wrap:wrap;gap:5px;align-items:center;border-top:1px solid var(--border);padding:8px 0}
.folder-manage-row span{flex:1;min-width:120px;font-size:13px;overflow-wrap:anywhere}
.folder-manage-row .secondary{font-size:12px;min-height:32px;margin:0;padding:5px 8px}
#memoFolder{width:100%;font-size:14px;padding:8px}
:root[data-cover=sage]{--leather:#729179;--leather-edge:#36523e;--leather-mid:#557960;--leather-highlight:#a0b895;--accent:#4d7056;--accent-text:#36523e;--soft:#e0e8d7}
:root[data-cover=navy]{--leather:#4c647c;--leather-edge:#263849;--leather-mid:#354b60;--leather-highlight:#8195ac;--accent:#405d78;--accent-text:#304c65;--soft:#dfe6ee}
:root[data-theme=dark][data-cover=sage]{--leather:#354938;--leather-edge:#1b281d;--leather-mid:#293b2c;--leather-highlight:#537057;--accent:#4d7056;--accent-text:#bfd8bd;--soft:#304437}
:root[data-theme=dark][data-cover=navy]{--leather:#2e4055;--leather-edge:#16212e;--leather-mid:#213144;--leather-highlight:#4b6481;--accent:#496b91;--accent-text:#c0d5ed;--soft:#2d4057}
@media(max-width:480px){#bookControls{padding-left:21px;padding-right:43px}.book-index{font-size:11px;padding-inline:9px;max-width:130px}.folder-results .notebook-memo{font-size:16px}}

.folder-index{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:68px;padding:16px 18px;margin:0;border:1px solid var(--border);border-radius:9px;background:var(--surface);color:var(--text);font-size:17px;text-align:left;overflow-wrap:anywhere}
.folder-index span{flex-shrink:0;color:var(--muted);font-size:24px}
.folder-management{background:var(--soft);font-weight:600;margin-bottom:22px}
.folder-index-list{display:flex;flex-direction:column;gap:14px}
.folder-index:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

.book-index{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:grab}
.book-index.dragging{touch-action:none;cursor:grabbing;opacity:.75;outline:2px solid var(--accent);outline-offset:-2px}
.overview-counts{font-size:13px;color:var(--muted);padding:10px 0;border-block:1px solid var(--border)}
.overview-records{background-attachment:local}
.overview-record{padding:12px 8px;border-bottom:1px solid var(--border)}
.overview-origin{font-size:12px;color:var(--accent-text);overflow-wrap:anywhere}
.overview-line small{font-size:11px;color:var(--muted)}
.overview-line p{margin:0;line-height:34px;white-space:pre-wrap;overflow-wrap:anywhere}
.overview-record .secondary{margin:4px 0;font-size:11px;min-height:30px;padding:5px 8px}
.overview-book{border-bottom:1px solid var(--border);padding-bottom:12px}
.overview-folder{line-height:34px;border-bottom:1px solid var(--border);font-size:14px;overflow-wrap:anywhere}

.book-index{touch-action:none}
.book-index.dragging{opacity:.65;outline:2px solid var(--accent);outline-offset:-2px}
.book-badge{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border:1px solid var(--accent);border-radius:50%;font-size:11px;line-height:1;vertical-align:middle;margin-right:6px;color:var(--accent-text);flex-shrink:0}
.overview-folder-book h3{font-size:16px;margin:18px 0 8px;color:var(--text)}
.overview-folder-tree{margin:6px 0}
.overview-folder-tree summary{cursor:pointer;min-height:40px;line-height:40px;padding:0 10px;border-bottom:1px solid var(--border)}
.overview-folder-children{padding-left:18px;border-left:1px solid var(--border);margin-left:10px}
.overview-folder-link{display:block;width:100%;min-height:40px;padding:8px 10px;margin:4px 0;background:transparent;border:0;border-bottom:1px solid var(--border);border-radius:0;text-align:left;font-size:15px;color:var(--text);overflow-wrap:anywhere}

/* 手帳ごとの小さな付箋。インデックスと同じ色を使用。 */
.book-label{display:inline-block;max-width:7em;margin-right:7px;padding:1px 6px;border:0;border-radius:1px 2px 2px 1px;background:color-mix(in srgb,var(--surface) 32%,var(--label-color) 68%);color:var(--text);font-family:inherit;font-size:10px;font-weight:500;line-height:18px;vertical-align:middle;white-space:nowrap;box-shadow:1px 1px 2px #40281c12}
.book-label-settings{margin:14px 0;padding:12px 0;border-block:1px solid var(--border)}
.book-label-settings input{max-width:220px}
.book-index.book-manage{font-size:12px}
.book-manage span{margin-left:3px}
:root[data-theme=dark] .book-label{background:color-mix(in srgb,var(--surface) 65%,var(--label-color) 35%)}

/* ToDoは罫線1本につき1項目。付箋は固定、本文だけ自動縮小。 */
.todo-row{height:34px;min-height:34px;max-height:34px;box-sizing:border-box;margin:0;padding-block:0;gap:6px;align-items:center}
.todo-row input[type=checkbox]{width:16px;height:16px;margin:0;align-self:center}
.todo-text,.today-todo-pane .todo-text{display:flex;align-items:center;gap:6px;height:34px;min-height:0;padding:0;line-height:34px;white-space:nowrap;overflow:hidden;font-size:16px;box-sizing:border-box}
.todo-text .book-label{flex-shrink:0;margin:0;align-self:center}
.todo-title{display:block;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:34px;font-size:16px}
.todo-delete{height:34px;min-height:34px;min-width:24px;width:24px;margin:0;padding:0;line-height:34px}
#managedBookSelect{margin-bottom:16px}

/* Smartphone prototype: compact headings, ruled records, and fixed editor actions. */
.today-heading{flex-shrink:0}
.notebook-sheet .notebook-memo,.calendar-memo-list .notebook-memo,.status-memo-list .notebook-memo,.folder-results .notebook-memo{display:flex;align-items:flex-start;gap:8px;padding:0 4px;margin:0;min-height:34px;-webkit-line-clamp:unset;line-height:34px;white-space:normal}
.notebook-memo .memo-heading{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;flex:0 0 50px;min-width:50px;height:34px;margin:0;padding:0;gap:0;line-height:13px}
.notebook-memo .memo-time,.notebook-memo .status{font-size:10px;line-height:13px;white-space:nowrap}
.notebook-memo .body-preview{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;flex:1;min-width:0;padding:0;font-size:16px;line-height:34px;white-space:pre-wrap;overflow-wrap:anywhere;overflow:hidden}
.form-actions{display:flex;gap:8px;flex-shrink:0}
.form-actions button{flex:1;margin:0;padding-inline:8px}
@media(max-width:480px){
 body{width:calc(100% - 32px)}
 header{min-height:34px;padding:7px 40px 7px 18px}
 header h1{font-size:14px;letter-spacing:.04em}
 header small{display:none}
 #bookControls{padding:0 38px 0 14px}
 .book-bar{padding-top:2px}
 .book-index{min-height:32px;font-size:11px;padding:6px 8px;max-width:125px}
 main,.calendar-page,.notebook-page{padding:10px 40px 10px 18px;min-height:0}
 h2{font-size:17px;margin:0 0 10px}
 .today-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:3px 8px;margin-bottom:6px}
 .today-heading h2{font-size:16px;margin:0;order:-1}
 .today-heading .notebook-date{font-size:11px;margin:0;line-height:1.5}
 .notebook-top{flex-shrink:0;min-height:0}
 .notebook-top .new-memo-card{min-height:44px;padding:6px 10px;gap:8px}
 .new-memo-plus{font-size:22px}
 .write-label{font-size:15px}
 .write-prompt{display:none}
 .notebook-sheet{gap:8px}
 .today-columns{gap:8px}
 .today-columns .history-toolbar{min-height:32px}
 .today-columns .history-toolbar h3{font-size:12px}
 .today-memo-pane,.today-todo-pane{gap:4px}
 .calendar-layout{gap:8px}
 .calendar-list-pane{padding-top:8px}
 .calendar-list-pane .hint{font-size:11px;line-height:1.5;margin:3px 0}
 .calendar-grid{margin-top:5px}
 .calendar-month-pane .calendar-toolbar button{min-height:32px;margin:0;padding:5px 8px}
 .status-list-page>h2{margin-bottom:5px}
 .list-tabs{margin:0 0 6px}
 body[data-screen=edit] main,body[data-screen=todoEdit] main{display:block;overflow-y:auto;overflow-x:hidden;scroll-padding:12px}
 body[data-screen=edit] main>h2,body[data-screen=todoEdit] main>h2{flex-shrink:0;margin-bottom:6px}
 #memoForm,#todoForm{display:flex;flex-direction:column;min-height:0;gap:12px}
 .editor-writing{display:flex;flex-direction:column;flex:0 0 auto;min-height:0;gap:6px}
 .editor-writing label{margin:0;font-size:12px}
 .editor-writing textarea{flex:0 0 auto;min-height:160px;height:clamp(160px,32dvh,280px);resize:none;padding:8px;font-size:16px;line-height:1.6;overflow:auto}
 .editor-fields{flex:0 0 auto;min-height:0;overflow:visible}
 .editor-fields>label{margin:4px 0;font-size:12px}
 .editor-fields>input,.editor-fields>select,#memoFolder{font-size:16px;min-height:34px;padding:5px 8px;margin:0}
 .editor-fields .hint{font-size:10px;line-height:1.5;margin:4px 0 0}
 .save-destination{width:100%;margin:5px 0;padding:3px 6px 5px;gap:0 8px}
 .save-destination legend{font-size:11px}
 .save-option{font-size:11px;min-height:28px;gap:4px}
 .save-option input{width:14px;height:14px}
 .form-actions{padding-top:2px;padding-bottom:env(safe-area-inset-bottom)}
 .form-actions button{min-height:44px;font-size:14px;padding-block:8px}
}
@media(max-width:480px) and (max-height:550px){
 body[data-screen=edit] header,body[data-screen=todoEdit] header,
 body[data-screen=edit] #bookControls,body[data-screen=todoEdit] #bookControls{display:none}
 body[data-screen=edit] nav,body[data-screen=todoEdit] nav{display:none}
 body[data-screen=edit] main,body[data-screen=todoEdit] main{padding-right:18px}
 .editor-fields{max-height:none}
}

/* 2026-10-08: mobile controls and clear settings/folder spacing. */
input[type=time],input[type=datetime-local],input[type=month]{display:block;box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-inline-size:0;overflow:hidden;font-size:16px}
input::-webkit-date-and-time-value{min-width:0;text-align:left}
body:is([data-screen=settings],[data-screen=restore],[data-screen=folders],[data-screen=folderManage],[data-screen=folderContents],[data-screen=books]) main{padding-left:34px;padding-right:48px}
body:is([data-screen=folders],[data-screen=folderManage],[data-screen=folderContents]) h2{overflow-wrap:anywhere;margin:12px 0 16px}
.folder-filter,#folderName,#folderParent{width:100%;min-width:0;font-size:16px}
.folder-management{margin-bottom:16px;min-height:52px}
.folder-index-list{gap:10px}
.folder-index{min-height:54px;padding:12px 14px;font-size:16px}
.folder-manage-row{gap:8px;padding:12px 0}
.folder-manage-row span{flex-basis:100%;min-width:0;font-size:14px;line-height:1.6}
.folder-manage-row button{flex:1}
.settings-section{min-width:0;margin:14px 0;padding:16px}
.settings-section h3,.settings-section summary{font-size:16px;font-weight:600;margin:0 0 10px;color:var(--text)}
.settings-section label{margin:14px 0 6px;font-size:14px}
.settings-section .hint{font-size:12px;line-height:1.7;margin:8px 0}
.settings-section .toggle-row{margin:12px 0 6px}
.settings-section summary{cursor:pointer;min-height:32px;margin:0;line-height:32px}
.settings-section .notification-note{font-size:12px;padding:12px}
.monthly-backup{margin:14px 0;padding:12px 0;border-block:1px solid var(--border)}
.backup-wide{width:100%;margin-right:0;font-size:14px;padding-inline:8px}
.backup-scope{padding:8px 12px;background:var(--soft);border-radius:6px}
#toast{width:max-content;min-width:0;max-width:calc(100vw - 48px);padding:12px 18px;font-size:14px;overflow-wrap:anywhere;text-wrap:pretty}
#toast button{display:block;margin:8px auto 0}
.editor-fields summary{font-size:12px;color:var(--muted);cursor:pointer;line-height:28px;min-height:28px}
@media(max-width:480px){
 body:is([data-screen=settings],[data-screen=restore],[data-screen=folders],[data-screen=folderManage],[data-screen=folderContents],[data-screen=books]) main{padding-left:26px;padding-right:40px}
 .settings-section{padding:12px;margin:12px 0}
 .folder-results{max-height:none}
 .editor-fields{max-height:none}
 body.keyboard-open{position:fixed;top:calc(var(--editor-top,0px) + 4px);left:16px;right:16px;width:auto;max-width:none;height:calc(var(--editor-viewport,100dvh) - 8px);margin:0;min-height:0}
 body.keyboard-open header,body.keyboard-open #bookControls,body.keyboard-open nav{display:none}
 body.keyboard-open main{padding:10px 18px 12px 26px;min-height:0;overflow-y:auto;overflow-x:hidden}
 body.keyboard-open main>h2{font-size:14px;margin-bottom:2px}
 body.keyboard-open .editor-writing{min-height:0}
 body.keyboard-open .editor-writing textarea{height:clamp(160px,calc(var(--editor-viewport,400px) * .45),240px);min-height:160px}
 body.keyboard-open .editor-fields{flex:0 0 auto;max-height:none;overflow:visible}
 body.keyboard-open .form-actions{padding-bottom:0}
 body.keyboard-open .form-actions button{min-height:40px;padding:6px}
}

/* Native iOS date/time controls have intrinsic widths: use bounded selects. */
.time-selects{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto;align-items:center;gap:8px;min-width:0}
.date-selects{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) minmax(0,1fr);gap:6px;margin-bottom:8px;min-width:0}
.time-selects select,.date-selects select,#backupMonth{box-sizing:border-box;width:100%;min-width:0;max-width:100%;font-size:16px;padding:8px;min-height:40px;margin:0}
.editor-fields{display:flex;flex-direction:column;gap:4px}
.editor-notification{min-width:0;margin:2px 0}
.editor-notification summary{font-size:12px;line-height:28px;color:var(--muted);cursor:pointer}
.editor-notification .save-option{margin:4px 0}
#notifyControls[hidden]{display:none}
.editor-fields .save-destination{flex-shrink:0}
@media(max-width:480px){
 .editor-fields>label{margin:0}
 .editor-fields .time-selects select,.editor-fields .date-selects select{min-height:34px;padding:5px}
 body.keyboard-open .editor-fields{flex-shrink:0;max-height:none}
 body.keyboard-open .save-destination{margin:2px 0}
}
