:root{--paper:#faf3e9;--ink:#493026;--gold:#b09259;--line:#d8c6aa;--blue:#d9ddea;--pink:#f6dfd8}*{box-sizing:border-box}body{margin:0;color:var(--ink);background:#eee5d8;font:14px 'Songti SC','Noto Serif CJK SC',Georgia,serif}button,input,textarea,select{font:inherit;color:inherit}button{cursor:pointer;background:none;border:0;min-height:36px}button:focus-visible{outline:2px solid var(--gold)}main{max-width:540px;height:100dvh;margin:auto;background:radial-gradient(ellipse at 0 0,#fffaf3,transparent 65%),var(--paper);padding:env(safe-area-inset-top) 22px env(safe-area-inset-bottom);display:flex;flex-direction:column;overflow:hidden;box-shadow:0 0 80px #6d4e2520}header{text-align:center;padding:21px 0 8px}small{font:9px Georgia;letter-spacing:3px;color:var(--gold)}h1{font-size:26px;font-weight:500;margin:12px 0}h1 button{float:right;font-size:20px;color:var(--gold)}header p{margin:0;font-size:14px}header p:before,header p:after{content:'—';color:var(--gold);margin:0 16px}.heading{display:flex;align-items:center;justify-content:space-between;height:48px}.heading>button:first-child,h2{font-size:18px;font-weight:500;margin:0;padding:0}.heading span{font-size:12px;color:var(--gold)}.heading div{display:flex;gap:5px}#sort,#today{font-size:11px;border:1px solid var(--line);border-radius:20px;padding:0 10px;min-height:27px}#add{font-size:24px}#tasks{height:33%;min-height:155px;flex-shrink:0;display:flex;flex-direction:column}#collection{overflow:auto;flex:1;padding:4px 2px 12px;display:grid;grid-template-columns:repeat(3,1fr);gap:10px;align-content:start;scrollbar-width:thin;scrollbar-color:var(--line) transparent}.card{height:164px;perspective:800px;position:relative;touch-action:pan-y;user-select:none}.inner{position:relative;width:100%;height:100%;transition:transform .5s;transform-style:preserve-3d}.flipped .inner{transform:rotateY(-180deg)}.face{position:absolute;inset:0;backface-visibility:hidden;border:1px solid var(--gold);border-radius:10px;padding:9px 7px;text-align:center;background:#fcf6eb;box-shadow:0 3px 5px #6c4c1810;display:flex;flex-direction:column;align-items:center;justify-content:center}.face:before{content:'';position:absolute;inset:4px;border:1px solid #c8b384;border-radius:7px;pointer-events:none}.face:after{content:'✧';position:absolute;top:5px;left:9px;color:var(--gold);font-size:12px}.face svg{width:60px;height:64px;color:var(--gold);margin-bottom:7px}.face strong{font-size:13px;font-weight:500;line-height:1.5;overflow-wrap:anywhere;max-height:40px;overflow:hidden}.stars{color:#a07b3d;font-size:13px;letter-spacing:2px;margin:7px 0 2px}.back{transform:rotateY(180deg);justify-content:space-evenly}.back p{font-size:10px;margin:4px;max-height:43px;overflow:auto}.back button{position:relative;z-index:2;font-size:11px;min-height:26px}.complete{background:#647591;color:white;border-radius:20px;padding:2px 12px}.list{grid-template-columns:1fr!important;gap:0!important}.row{display:flex;gap:8px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}.row .name{flex:1;text-align:left;font-size:13px}.row .priority{color:var(--gold);font-size:12px}.handle{touch-action:none;font-size:21px;color:var(--gold)}#split{height:23px;flex-shrink:0;display:flex;align-items:center;justify-content:center;gap:10px;color:var(--gold);touch-action:none;cursor:ns-resize}#split span{height:1px;background:var(--line);width:60px}#schedule{flex:1;min-height:180px;display:flex;flex-direction:column}.navigation{display:flex;align-items:center;gap:7px;margin:0 0 8px}.navigation b{font-size:12px;font-weight:400;flex:1}.navigation>button{font-size:23px}#views{display:flex;background:#eee5d6;padding:2px;border-radius:15px}#views button{min-height:26px;width:29px;font-size:12px;border-radius:13px}#views .active{background:#fffaf2;box-shadow:0 1px 4px #67512b18}#calendar{overflow:auto;flex:1;position:relative;scrollbar-width:thin;scrollbar-color:var(--line) transparent}.timeline{position:relative;height:1440px;margin:8px 0 0 43px;border-left:1px solid var(--line)}.hour{height:60px;border-top:1px dashed #dccfbb;position:relative}.hour label{position:absolute;left:-44px;top:-9px;font-size:11px}.event{position:absolute;left:7px;right:8px;background:var(--blue);border:1px solid #b7bdce;border-radius:8px;padding:8px 12px;min-height:20px;touch-action:none;z-index:2;overflow:visible;font-size:12px}.event.pink{background:var(--pink);border-color:#dec0b6}.event.done{opacity:.55}.event small{display:block;color:var(--ink);font-size:10px;letter-spacing:0;margin-top:4px}.resize{position:absolute;left:45%;width:24px;height:16px;bottom:-8px;cursor:ns-resize;touch-action:none}.resize:after{content:'';display:block;width:7px;height:7px;border:1px solid #8b7c6a;background:#fffaf1;border-radius:50%;margin:4px auto}.delete-event{position:absolute;right:0;top:0;font-size:12px;min-height:24px;width:25px}.grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;padding-top:6px}.day-cell{border:1px solid #e3d7c4;border-radius:6px;min-height:57px;text-align:center;font-size:11px;padding:4px 1px}.day-cell.selected{border-color:var(--gold);background:#eee3d0}.day-cell i{display:block;background:var(--blue);font-size:8px;font-style:normal;border-radius:3px;padding:3px 0;margin-top:3px;overflow:hidden}.weekday{text-align:center;color:#9b835d;font-size:10px}.week-cell{min-height:160px}.week-cell i:nth-child(odd){background:var(--pink)}footer{text-align:center;flex-shrink:0;padding:10px 0 12px}footer button{border:1px solid var(--line);border-radius:20px;padding:0 20px;font-size:12px}footer p{font-size:9px;color:#aa9678;margin:8px 0 0;letter-spacing:1px}dialog{width:min(90vw,380px);border:1px solid var(--gold);border-radius:16px;background:var(--paper);padding:25px}dialog::backdrop{background:#34271d55}dialog h2{margin-bottom:20px}label{display:block;margin-bottom:14px;font-size:12px}input,textarea,select{width:100%;display:block;margin-top:7px;padding:10px;border:1px solid var(--line);background:#fffbf5;border-radius:6px}form>div{display:flex;justify-content:flex-end;gap:10px}#save{background:#6b7891;color:white;border-radius:20px;padding:0 20px}#toast{position:fixed;bottom:70px;left:50%;transform:translateX(-50%);background:#493026e8;color:#fff8ec;border-radius:20px;padding:10px 20px;font-size:12px;pointer-events:none;opacity:0;transition:opacity .2s;z-index:100}.ghost{position:fixed;width:95px;padding:15px;background:#fff6e6;border:1px solid var(--gold);border-radius:8px;z-index:200;pointer-events:none;box-shadow:0 6px 30px #49302640}.empty{grid-column:1/-1;color:#9b876d;text-align:center;padding:24px;font-size:12px}@media(min-width:650px){main{border-left:1px solid var(--line);border-right:1px solid var(--line)}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

#stars{border:0;margin:0 0 18px;padding:0;display:flex;gap:6px;min-width:0}#stars legend{font-size:12px;margin-bottom:10px}#stars label{flex:1;margin:0;position:relative;text-align:center;cursor:pointer}#stars input{position:absolute;opacity:0;width:1px;height:1px}#stars span{display:flex;align-items:center;justify-content:center;min-height:44px;border:1px solid var(--line);border-radius:8px;color:#98743d;font-size:17px;background:#fffbf5}#stars input:checked+span{border-color:var(--gold);background:#eee2cc;box-shadow:inset 0 0 0 1px var(--gold)}#stars input:focus-visible+span{outline:2px solid #647591;outline-offset:2px}h1 #settings{font-size:18px;margin-left:4px}

#count{display:inline-block;min-width:1ch;font-variant-numeric:tabular-nums;color:var(--ink)}

html{height:100%;background:var(--paper)}body{height:100%;overflow:hidden;background:var(--paper)}main{height:100vh;height:100dvh;min-height:0;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}header{padding:10px 0 4px}header h1{margin:7px 0;font-size:25px}header small{font-size:8px;letter-spacing:2px}footer{padding:7px 0 5px}footer p{margin:5px 0 0}.event{touch-action:pan-y}.event .resize,.event .delete-event{display:none}.event.selected{touch-action:none;box-shadow:0 0 0 2px var(--gold);z-index:3}.event.selected .resize,.event.selected .delete-event{display:block}.event .resize{height:28px;width:44px;left:calc(50% - 22px);bottom:-14px}.resize:after{width:9px;height:9px;margin:9px auto}.event:focus-visible{outline:2px solid var(--gold)}#calendar,#collection{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}@media(max-height:700px){header{padding-top:5px}header>small{display:none}header h1{margin:4px 0}.heading{height:42px}footer p{display:none}footer{padding:5px 0}.navigation{margin-bottom:4px}}

.event{padding:7px 9px;overflow-wrap:anywhere}.event>b{display:block;font-weight:500;line-height:1.4;max-height:2.8em;overflow:hidden}.event small{white-space:normal;line-height:1.3}.event.selected{padding-right:20px}.timeline{margin-right:2px}#calendar{overflow:auto}

/* V6 · engraved moonlight */
:root{--paper:#fcf6ed;--ink:#493026;--gold:#b09259;--line:#dfcfb4;--blue:#d9ddea;--pink:#f6dfd8}
main{background:radial-gradient(ellipse at 15% 0,#fffcf6 0,transparent 65%),linear-gradient(145deg,#fcf6ed,#f9f3e7)}
body,button,input,textarea,select{font-family:'Songti SC','STSong','Noto Serif CJK SC','SimSun',Georgia,serif;-webkit-font-smoothing:antialiased}
header{position:relative;padding-top:13px;padding-bottom:7px}header>small{color:#b59a69;font-size:8px;letter-spacing:2.3px}header h1{font-size:25px;font-weight:500;letter-spacing:.3px;margin:9px 0}header p{font-size:12px;letter-spacing:1px;color:#71553d}header p:before,header p:after{font-size:11px;margin:0 13px}h1 button{color:#a58c62;filter:grayscale(1);opacity:.85}h1 #settings{font-family:Georgia,serif}
.heading>button:first-child,h2{font-size:17px;letter-spacing:.8px}.heading span{color:#b8a17b}#sort,#today{font-size:10px;background:#fffaf240;border-color:#d8c4a2;padding:0 11px}#add{color:#715138}
#collection{gap:10px;padding:5px 2px 10px}.card{height:157px}.face{border-color:#b49a69;border-radius:9px;background:linear-gradient(145deg,#fffaf2,#faf2e5);padding:15px 8px 12px;box-shadow:0 3px 7px #6d4b2010,inset 0 0 14px #e8d8b520}.face:before{inset:4px;border-color:#d0bb8b;border-radius:6px}.face:after{content:'';inset:8px;border:1px solid #dbcba740;border-radius:3px;pointer-events:none;position:absolute}.face svg{width:69px;height:65px;margin:0 0 8px;flex-shrink:0;color:#ae8b4e}.face strong{font-size:12px;line-height:1.55;letter-spacing:.3px;font-weight:500;position:relative;z-index:1}.stars{font-size:12px;letter-spacing:2.5px;margin-top:7px;color:#a47d3e}.card-corner{position:absolute;font-size:10px;line-height:12px;color:#b7975e;pointer-events:none}.tl{top:7px;left:8px}.tr{top:7px;right:8px}.bl{bottom:7px;left:8px}.br{bottom:7px;right:8px;transform:rotate(180deg)}.back{padding:13px 9px}.back strong{font-size:12px}.back p{font-size:10px;line-height:1.6;color:#7d6550}.back .complete{background:linear-gradient(#7886a0,#63728d);box-shadow:0 2px 3px #3d51601a}.back button{font-size:10px}.back .delete{color:#987c65}
#split{gap:10px;height:25px;font-size:13px}#split span{width:62px;background:linear-gradient(90deg,transparent,#c8b18a)}#split span:last-child{transform:rotate(180deg)}.navigation{gap:5px}.navigation b{color:#755a42;font-size:11px}#views{background:#eee5d7}#views .active{background:#fffcf6}#views button{font-size:11px}
.timeline{border-color:#d5c3a7}.hour{border-color:#ded3c0}.hour label{color:#806850;font-size:10px}.event{background:#d9ddea;border-color:#b9becf;border-radius:8px;box-shadow:inset 0 1px 0 #ffffff66;padding-top:7px}.event.pink{background:#f6dfd8;border-color:#ddbeb4}.event>b{font-size:12px;font-weight:500}.event small{color:#69554b;font-size:10px;margin-top:3px}.event.selected{box-shadow:0 0 0 1.5px #ae8e58,inset 0 1px 0 #ffffff66}.resize:after{border-color:#ac9166;background:#fffaf0}
footer button{font-size:11px;border-color:#d4bd97;background:#fffaf340;letter-spacing:.5px}footer p{font-size:8px;color:#b19b7b;letter-spacing:.8px}.row{border-color:#e4d7c1}.row .name{font-size:12px}.handle{font-size:19px;color:#b39665}dialog{background:#fcf6ed;border-color:#b49a69;box-shadow:0 15px 60px #49302625}input,textarea{font-size:14px;border-color:#dfcfb4}button{ -webkit-tap-highlight-color:transparent}
@media(max-width:360px){main{padding-left:16px;padding-right:16px}#collection{gap:7px}.face{padding-left:6px;padding-right:6px}.face strong{font-size:11px}}
@media(max-height:700px){header{padding-top:5px;padding-bottom:4px}header h1{font-size:23px;margin:5px 0}.card{height:150px}}
/* V7: WebKit card-face compositing and compact back layout. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
.card{-webkit-perspective:800px;isolation:isolate}
.inner{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}
.face{-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:rotateY(0deg) translateZ(1px);transform:rotateY(0deg) translateZ(1px);visibility:visible;pointer-events:auto;transition:visibility 0s .25s}
.face.back{-webkit-transform:rotateY(180deg) translateZ(1px);transform:rotateY(180deg) translateZ(1px);visibility:hidden;pointer-events:none}
.flipped .face:not(.back){visibility:hidden;pointer-events:none}
.flipped .face.back{visibility:visible;pointer-events:auto}
.flipped .inner{-webkit-transform:rotateY(-180deg);transform:rotateY(-180deg)}
.face strong{flex-shrink:0}
.back{display:grid;grid-template-rows:19px minmax(0,1fr) 27px 23px 23px;gap:2px;justify-items:center;align-items:center;padding:11px 8px 9px;overflow:hidden}
.back>strong{max-width:100%;font-size:11px;line-height:17px;max-height:19px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.back>p{min-height:0;max-height:100%;width:100%;margin:0;padding:0 1px;font-size:10px;line-height:1.45;overflow:auto;align-self:stretch}
.back>button{min-height:0;height:23px;padding:0 8px;line-height:23px;margin:0;z-index:auto;font-size:10px}
.back>button.complete{height:26px;line-height:26px;padding:0 12px}
@media(prefers-reduced-motion:reduce){.face{transition:none!important}}
/* V8: compact keyboard-aware editor; 16px fields avoid iOS focus zoom. */
#editor,#settings-dialog{position:fixed;box-sizing:border-box;width:min(340px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(var(--visual-height,100dvh) - 24px);margin:0 auto;top:calc(var(--visual-top,0px) + 12px);bottom:auto;padding:17px 18px;border-radius:14px;overflow:auto;overscroll-behavior:contain}
#editor h2,#settings-dialog h2{font-size:17px;margin:0 0 13px;line-height:1.4}
#editor label,#settings-dialog label{font-size:12px;margin-bottom:10px}
#editor input[type=text],#editor input:not([type]),#editor textarea,#settings-dialog input{font-size:16px;line-height:1.35;padding:8px 10px;margin-top:5px;min-height:38px}
#editor textarea{height:66px;min-height:44px;resize:vertical}
#editor #stars{margin-bottom:10px;gap:5px}
#editor #stars legend{font-size:12px;margin-bottom:6px}
#editor #stars label{margin:0}
#editor #stars span{min-height:36px;font-size:16px}
#editor form>div,#settings-dialog form>div{position:sticky;bottom:-1px;background:var(--paper);padding-top:7px;gap:8px}
#editor form>div button,#settings-dialog form>div button{min-height:36px}
@media(min-width:650px){#editor,#settings-dialog{top:50%;transform:translateY(-50%);max-height:calc(100dvh - 40px)}}
@media(max-height:520px){#editor{padding:12px 16px}#editor h2{margin-bottom:8px}#editor label{margin-bottom:7px}#editor textarea{height:48px}#editor #stars span{min-height:32px}}

/* V9: prevent iOS selection/callout while preserving editable fields. */
body,main,main *,.ghost{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
input,textarea,input *,textarea *{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
.card,.card *{-webkit-user-drag:none}
body.dragging-card #collection{overflow:hidden}
body.dragging-card{cursor:grabbing}
.ghost{background:#fff8e9eF;border-color:#b09259;transform:rotate(-3deg);font-size:12px;box-shadow:0 8px 28px #49302630}

#art-picker{margin:4px 0 10px;font-size:11px;color:#8c714c}#art-picker summary{cursor:pointer;padding:5px 0}.art-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:6px}.art-options label{margin:0!important;position:relative}.art-options input{position:absolute;opacity:0;width:1px;height:1px;min-height:0!important}.art-options span{display:flex;flex-direction:column;align-items:center;border:1px solid var(--line);border-radius:7px;padding:5px;color:var(--gold)}.art-options svg{width:43px;height:40px}.art-options small{font-size:9px;letter-spacing:0;margin-top:3px}.art-options input:checked+span{border-color:var(--gold);background:#eee2cc}.art-options input:focus-visible+span{outline:2px solid #647591}
/* V11 · everyday tools */
.settings-tools{border-top:1px solid var(--line);margin-top:15px;padding-top:6px}.settings-tools h3{font-size:13px;font-weight:500;margin:9px 0}.settings-tools>button{display:block;text-align:left;width:100%;border-bottom:1px solid #dfcfb470;padding:7px 2px;min-height:38px;font-size:12px}.settings-tools button:disabled{opacity:.4;cursor:default}.settings-tools p,.settings-tools li{font-size:10px;line-height:1.75;color:#8c745b}.settings-tools details{margin-top:12px}.settings-tools summary{font-size:12px;cursor:pointer;padding:5px 0}.settings-tools ol{padding-left:20px}.settings-tools input[hidden]{display:none!important}
#undo-bar{position:fixed;z-index:300;bottom:calc(env(safe-area-inset-bottom,0px) + 24px);left:50%;transform:translateX(-50%);width:min(360px,calc(100vw - 30px));display:flex;align-items:center;gap:8px;background:#493026;color:#fff8ec;padding:8px 10px 8px 16px;border-radius:13px;box-shadow:0 5px 20px #49302630;font-size:12px}#undo-bar[hidden]{display:none}#undo-bar span{flex:1}#undo-action{color:#f0d59b;border:1px solid #cbb58b80;border-radius:18px;padding:0 12px}#undo-close{font-size:20px;min-width:30px;color:#d9c7b0}#restore-confirm{max-width:calc(100vw - 32px);width:340px;padding:20px;max-height:calc(100dvh - 40px);overflow:auto}#restore-confirm p{font-size:12px;line-height:1.7;color:#80664b}#restore-confirm>div{display:flex;justify-content:flex-end;gap:10px}#restore-confirm h2{font-size:18px}#settings-dialog{padding-bottom:12px}

/* V12: visible list reordering */
.row[hidden]{display:none!important}.sort-ghost{position:fixed!important;z-index:400;pointer-events:none;background:#fffaef;border:1px solid var(--gold);border-radius:9px;padding:10px 8px;box-shadow:0 8px 24px #49302630;transform:scale(1.025);margin:0!important}.sort-ghost .handle{color:#806032}.sort-placeholder{display:flex;align-items:center;justify-content:center;border:1px dashed #b09259;border-radius:8px;background:#eadeca65;color:#aa8c5a;font-size:10px;letter-spacing:2px;box-sizing:border-box}.sorting-tasks .row{transition:background .15s}.sorting-tasks #collection{overflow-y:auto;scroll-behavior:auto}.handle{min-width:40px;min-height:40px;cursor:grab}.sorting-tasks,.sorting-tasks .handle{cursor:grabbing}

.sound-settings{border-top:1px solid var(--line);padding-top:8px;margin-top:14px}.sound-settings h3{font-size:13px;font-weight:500;margin:8px 0 12px}.sound-toggle{display:flex;align-items:center;justify-content:space-between;gap:10px}.sound-toggle input{width:19px!important;min-height:19px!important;height:19px;margin:0;accent-color:#a58b59}.volume-label{display:flex;justify-content:space-between;margin:12px 0 2px!important}.volume-label output{color:#9d835a;font-variant-numeric:tabular-nums}#sound-volume{padding:0;width:100%;min-height:30px;margin:0 0 6px;accent-color:#ac915d;background:transparent;border:0}#sound-preview{display:flex;gap:5px}#sound-preview button{flex:1;min-height:34px;border:1px solid var(--line);border-radius:16px;font-size:10px;padding:0 5px}#sound-preview button:disabled{opacity:.35;cursor:default}.sound-settings p{font-size:10px;line-height:1.7;color:#a08a6d;margin:10px 0 0}

#sound-preview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}#sound-preview button{font-size:11px;min-height:36px}

/* Complete customizable title; preserve serif styling and keep controls reachable. */
header h1{display:grid;grid-template-columns:minmax(0,1fr) 30px 30px;align-items:center;column-gap:3px}.header-heading{min-width:0;text-align:center;line-height:1.35;overflow-wrap:anywhere;white-space:pre-wrap}header h1>button{float:none;margin:0!important;width:30px;min-width:30px;padding:0}#username{font:inherit;letter-spacing:inherit}
