@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&family=Noto+Sans+Thai:wght@400;500;600;700&display=swap');
:root{--forest:#34483D;--sage:#637B68;--cream:#F6F5EF;--stone:#343331;--line:#E5E9DF;--wood:#79583C}
*{box-sizing:border-box}html{font-size:16px}body{margin:0;background:var(--cream);color:var(--stone);font-family:'Noto Sans Thai','Noto Sans',sans-serif;line-height:1.65}.shell{max-width:850px;margin:auto;padding:28px 18px 36px}.brand{text-align:center;margin:0 auto 25px}.brand-symbol{font-size:34px;margin-bottom:6px}.eyebrow{font-size:10px;letter-spacing:.16em;color:var(--sage);font-weight:700}.brand h1{font-family:'Noto Sans',sans-serif;font-size:clamp(32px,7vw,49px);letter-spacing:.08em;color:var(--forest);margin:6px 0 3px;line-height:1.25}.brand p{font-size:12px;color:var(--wood);margin:7px 0}.brand .brand-thai{color:var(--sage);font-size:13px}h2{font-size:22px;margin:0 0 8px}.muted{color:#6D756F}.panel{background:#fff;border:1px solid var(--line);border-radius:22px;padding:26px;margin:16px 0;box-shadow:0 12px 35px #34483d0a}.auth-panel{max-width:430px;margin:0 auto;text-align:center;padding:25px 25px 30px}.welcome-icon{font-size:26px;margin-bottom:6px}.auth-panel h2{font-size:22px}.auth-panel .muted{font-size:13px;margin:5px 0 17px}label{display:block;margin:16px 0 8px;font-weight:600;text-align:left}input,textarea{display:block;width:100%;font:inherit;border:1px solid #C8C5C0;border-radius:12px;padding:12px;margin-top:7px;background:#fff;color:var(--stone)}input:focus,textarea:focus{outline:2px solid var(--sage)}button{font:inherit;background:var(--forest);color:#fff;border:0;border-radius:12px;padding:12px 20px;cursor:pointer;min-height:48px}button:focus-visible{outline:3px solid var(--wood);outline-offset:3px}button:disabled{opacity:.45;cursor:not-allowed}button.secondary{background:var(--line);color:var(--forest)}.pin-hidden{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.pin-dots{display:flex;justify-content:center;gap:12px;margin:22px 0 24px}.pin-dots span{width:15px;height:15px;border-radius:50%;background:var(--line);border:1px solid #C5D0C4}.pin-dots span.filled{background:var(--forest);border-color:var(--forest)}.keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;max-width:290px;margin:auto}.key{background:#F2F4EF;color:var(--forest);font-family:'Noto Sans',sans-serif;font-size:24px;font-weight:500;border:1px solid var(--line);border-radius:15px;min-height:59px;padding:8px}.key:active{background:#DDE5DA}.login-submit{width:100%;max-width:290px;margin:23px auto 0}.notice{background:#F5EFE6;border:1px solid #E9DDC8;border-radius:12px;padding:12px;text-align:left}.notice p{font-size:13px;margin:5px 0}.top{display:flex;justify-content:space-between;gap:16px;align-items:start;flex-wrap:wrap}.error{max-width:430px;margin:10px auto;padding:13px;background:#FFF1EB;border:1px solid #E8B2A3;border-radius:12px}.success{color:var(--forest);font-weight:600}.small,footer{font-size:12px}footer{color:#77766e;text-align:center;margin-top:32px}@media(max-width:520px){.shell{padding:18px 14px 24px}.panel{padding:20px 18px}.auth-panel{border-radius:20px}.key{min-height:62px}}

/* Foundation V1.2 — Capture History */
.history-head{display:flex;justify-content:space-between;align-items:center}.history-search{display:flex;align-items:end;flex-wrap:wrap;gap:10px;margin:12px 0 24px}.history-search label{flex:1;min-width:200px;margin:0}.history-search button{min-height:49px}.history-clear{font-size:13px;color:var(--wood)}.history-list{display:grid;gap:12px}.history-item{border:1px solid var(--line);background:#FCFCF9;border-radius:15px;padding:16px}.history-item-top{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:12px;color:#6D756F}.history-type{color:var(--forest);font-weight:700}.history-item h3,.capture-detail h3{font-size:16px;margin:10px 0 5px;overflow-wrap:anywhere}.history-item p{margin:0 0 8px;color:#5B5A58;font-size:14px;overflow-wrap:anywhere}.history-item a,.capture-detail a,.history-pages a{color:var(--forest);font-weight:600;text-decoration:underline;text-underline-offset:3px}.history-pages{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:20px;font-size:13px}.history-empty{padding:24px 0;text-align:center;color:#6D756F}.capture-detail{border:1px solid #A6B5A0;background:#F6F9F3;border-radius:15px;padding:18px;margin:15px 0 24px}.capture-full{white-space:normal;overflow-wrap:anywhere;margin:14px 0 18px;line-height:1.8}.capture-detail .muted{margin:4px 0}

/* V1.2.1 mobile PIN keypad: prevent double-tap zoom on controls */
.keypad,.key,.login-submit{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.key{user-select:none;-webkit-user-select:none}
@media(max-width:520px){.key{font-size:24px}}


/* V1.2.2 Mobile-first dashboard & history (additive; preserve Forest Sage) */
html{scroll-behavior:smooth;scroll-padding-top:14px}
body{overflow-x:hidden}
.panel{min-width:0}
.dashboard-panel .top h2{font-size:clamp(21px,4.5vw,26px);line-height:1.4}
.dashboard-panel .top .muted{margin:5px 0 0}
.capture-panel textarea{min-height:116px;resize:vertical;font-size:16px}
.history-panel{scroll-margin-top:12px}
.history-panel h2{font-size:clamp(20px,4.8vw,25px);margin:3px 0}
.history-panel .history-head .muted{margin:3px 0 0}
.history-search{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px;margin:18px 0 18px}
.history-search label{min-width:0;margin:0;font-size:14px}
.history-search input{font-size:16px;min-height:48px;margin-top:5px}
.history-search button{min-width:84px;min-height:48px}
.history-search .history-clear{grid-column:1/-1;justify-self:start;min-height:36px;display:inline-flex;align-items:center}
.history-list{gap:10px}
.history-item{padding:16px;border-radius:16px;background:#fff}
.history-item h3{font-size:16px;line-height:1.55;margin:7px 0 4px}
.history-item p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin:0 0 10px;line-height:1.6}
.history-item-top time{font-variant-numeric:tabular-nums}
.history-open{display:inline-flex;align-items:center;gap:7px;min-height:40px}
.capture-detail{margin:18px 0 0;scroll-margin-top:18px;padding:18px}
.capture-detail h3{font-size:17px;line-height:1.55}
.capture-full{font-size:15px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8}
.capture-full br{display:none}
.history-pages{flex-wrap:wrap;gap:12px}
.history-pages a{display:inline-flex;min-height:42px;align-items:center}
@media(max-width:600px){
 .shell{padding:12px 12px 28px}
 .brand{margin-bottom:15px}
 .brand-symbol{font-size:28px;margin-bottom:1px}
 .brand h1{font-size:30px;margin:4px 0 2px}
 .brand .eyebrow{font-size:9px}
 .brand p{margin:3px 0}
 .brand .brand-thai{font-size:12px}
 .panel{padding:18px 16px;border-radius:19px;margin:12px 0;box-shadow:none}
 .dashboard-panel .top{align-items:center;flex-wrap:nowrap;gap:8px}
 .dashboard-panel .top>div{min-width:0}
 .dashboard-panel .top h2{font-size:21px;overflow-wrap:anywhere}
 .dashboard-panel .top form{flex-shrink:0}
 .dashboard-panel .top button{font-size:13px;min-height:42px;padding:8px 11px}
 .capture-panel h2{font-size:20px}
 .capture-panel>p.muted{font-size:13px;margin:3px 0 12px}
 .capture-panel label{font-size:14px}
 .capture-panel textarea{min-height:104px}
 .capture-panel form>button{width:100%}
 .history-search{gap:8px}
 .history-search button{padding:10px 13px;min-width:74px}
 .history-item{padding:14px}
 .history-item-top{gap:6px;font-size:11px}
 .history-item h3{font-size:15px}
 .history-item p{font-size:13px}
 .capture-detail{padding:15px}
}
@media(max-width:360px){.history-search{grid-template-columns:1fr}.history-search button{width:100%}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* Foundation V1.3 Phase 1: settings, mobile-first */
.settings-link,.settings-back{display:inline-flex;align-items:center;min-height:44px;color:var(--forest);font-weight:600;text-decoration:underline;text-underline-offset:3px}
.dashboard-panel .top{align-items:center}.dashboard-panel .top>.settings-link{margin-left:auto}
.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.settings-card{min-width:0;border:1px solid var(--line);border-radius:16px;padding:17px;background:#FCFCF9}
.settings-card h3{font-size:16px;margin:0}.settings-card label{font-size:14px}.settings-card input{font-size:16px;min-height:48px}
.settings-card button{width:100%;margin-top:12px}.settings-pin{grid-column:1/-1}.settings-pin input{max-width:420px}
.settings-panel .notice{margin:15px 0}.settings-panel .notice p{overflow-wrap:anywhere}
@media(max-width:600px){.settings-grid{grid-template-columns:1fr}.settings-pin{grid-column:auto}.settings-card{padding:14px}.dashboard-panel .top{flex-wrap:wrap}.dashboard-panel .top>.settings-link{margin-left:0}}

/* V1.3.1: prevent iOS focus zoom on PIN fields while preserving user zoom accessibility */
.numeric-pin-input{font-size:16px!important;letter-spacing:.16em;font-variant-numeric:tabular-nums;touch-action:manipulation}

/* V1.3 Phase 2 */
.recovery-card{margin:16px 0}.recovery-card p{overflow-wrap:anywhere}.settings-card input[type=email]{font-size:16px}.settings-card button{max-width:100%}@media(max-width:600px){.recovery-card button{width:100%}}


/* ZEN LIFE OS V1.4.4 — Universal Capture / Natural Harmony */
:root{--zen-soft:#F8F9F5;--zen-border:#DDE5DB;--zen-shadow:0 16px 40px rgba(52,72,61,.065)}
body{background:radial-gradient(circle at 50% -150px,#E9EEE5 0%,#F6F5EF 48%,#F6F5EF 100%)}
.shell{max-width:960px}.brand-symbol{line-height:1.2}.panel{box-shadow:var(--zen-shadow)}
.zen-icon{width:20px;height:20px;display:inline-block;flex:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;fill:none;vertical-align:middle}
.zen-settings-button{display:inline-flex;align-items:center;justify-content:center;gap:9px;white-space:nowrap;border:1px solid #CAD8C9;border-radius:12px;padding:10px 15px;text-decoration:none;font-weight:600;color:var(--forest);background:#F6F8F4;min-height:46px;transition:background .2s,border-color .2s,transform .2s}
.zen-settings-button:hover{background:#E5E9DF;border-color:var(--sage);transform:translateY(-1px)}.zen-settings-button:focus-visible{outline:3px solid var(--sage);outline-offset:3px}
.zen-capture{border:1px solid var(--zen-border);border-radius:24px;padding:clamp(20px,3.4vw,32px);background:linear-gradient(145deg,#FFFFFF 0%,#FEFEFC 100%)}
.zen-capture-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:24px}.zen-capture-heading h2{font-size:clamp(23px,3.2vw,29px);line-height:1.4;letter-spacing:-.02em;color:var(--forest);margin:6px 0 8px}.zen-capture-heading .muted{font-size:14px;line-height:1.8;max-width:60ch;margin:0}
.zen-capture-mark{width:54px;height:54px;flex:none;display:grid;place-items:center;background:#EDF2EA;color:var(--forest);border:1px solid #E0E9DD;border-radius:17px}.zen-capture-mark svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.zen-compose-box{border:1.5px solid #B7C7B4;background:#FFF;border-radius:18px;overflow:hidden;transition:border-color .2s,box-shadow .2s}.zen-compose-box:focus-within{border-color:#637B68;box-shadow:0 0 0 4px rgba(99,123,104,.13)}
.zen-universal-form .zen-compose-box textarea{display:block;width:100%;box-sizing:border-box;min-height:180px;padding:21px 22px 12px;margin:0;border:0;outline:0;box-shadow:none;border-radius:0;resize:vertical;background:transparent;color:#343331;font-size:16px;line-height:1.9}.zen-universal-form .zen-compose-box textarea::placeholder{color:#939B94}.zen-universal-form .zen-compose-box textarea:focus{outline:none}
.zen-compose-bottom{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:0 18px 15px;font-size:12px;color:#838D84}.zen-compose-bottom output{font-variant-numeric:tabular-nums;white-space:nowrap}
.zen-capture-toolbar{display:flex;justify-content:space-between;align-items:stretch;gap:12px;margin-top:18px}.zen-capture-media{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;flex:1;max-width:510px}
.zen-media-button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:58px;padding:9px 10px;background:#F4F6F1;border:1px solid #E0E7DD;border-radius:14px;color:#435749;font-size:14px;font-weight:600;cursor:pointer;transition:background .2s,transform .2s,border-color .2s;position:relative}
.zen-media-button:hover{background:#EAF0E7;border-color:#B7C7B4;transform:translateY(-1px)}.zen-media-button:focus-visible,.zen-example:focus-visible{outline:3px solid #637B68;outline-offset:2px}.zen-media-button .zen-icon{width:20px;height:20px}.zen-soon{font-size:10px;font-weight:600;color:#647586;background:#E7EDF0;padding:2px 7px;border-radius:999px;white-space:nowrap}
.zen-capture .zen-capture-submit{display:inline-flex;justify-content:center;align-items:center;gap:10px;min-height:58px;min-width:185px;border-radius:14px;padding:11px 19px;margin:0;background:var(--forest);color:#FFF;font-weight:700;transition:background .2s,transform .2s}.zen-capture .zen-capture-submit:not(:disabled):hover{background:#4B6653;transform:translateY(-1px)}.zen-capture .zen-capture-submit:disabled{opacity:.55}.zen-capture-submit .zen-icon{width:18px;height:18px}
.zen-capture-note{display:flex;align-items:flex-start;gap:9px;font-size:12px;line-height:1.7;color:#6A776C;margin:14px 0 0}.zen-capture-note .zen-icon{width:17px;height:17px;margin-top:2px}
.zen-capture-examples{border-top:1px solid #EBEEE8;margin-top:27px;padding-top:21px}.zen-examples-title{display:flex;justify-content:space-between;gap:10px;align-items:center;font-size:15px;font-weight:700;color:#34483D;margin-bottom:13px}.zen-examples-title span{font-size:12px;color:#7C887D;font-weight:400}.zen-example-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.zen-example{display:flex;align-items:center;gap:10px;text-align:left;min-width:0;min-height:76px;padding:13px;background:#FAFBF8;color:var(--forest);border:1px solid #E4EAE0;border-radius:14px;cursor:pointer;transition:background .2s,border-color .2s}.zen-example:hover{background:#F0F5EE;border-color:#B9CDB7}.zen-example-icon{width:39px;height:39px;display:grid;place-items:center;flex:none;border-radius:12px;background:#E6EEE3;color:#486C52}.zen-example-icon .zen-icon{width:20px;height:20px}.zen-example strong,.zen-example small{display:block;line-height:1.5}.zen-example strong{font-size:13px}.zen-example small{font-size:11px;color:#768277;font-weight:400}.zen-example-arrow{width:15px;height:15px;margin-left:auto;color:#9AA99B}
.zen-save-success{padding:11px 14px;background:#EAF2E8;border:1px solid #C8DBC3;border-radius:12px;font-size:14px}
.zen-media-dialog{width:min(410px,calc(100% - 32px));border:1px solid #DDE5DB;border-radius:20px;background:#fff;color:var(--stone);padding:24px;box-shadow:0 24px 80px rgba(27,44,34,.2)}.zen-media-dialog::backdrop{background:rgba(33,46,38,.42);backdrop-filter:blur(3px)}.zen-dialog-head{display:flex;align-items:center;justify-content:space-between}.zen-dialog-icon{display:grid;place-items:center;background:#EDF2EA;color:#34483D;border-radius:12px;width:44px;height:44px;font-size:22px}.zen-dialog-close{min-height:38px;width:38px;padding:0;background:#F3F5F1;color:#526556;font-size:26px;border-radius:10px}.zen-media-dialog h3{font-size:20px;color:var(--forest);margin:16px 0 8px}.zen-media-dialog p{font-size:14px;line-height:1.8;color:#59675C}.zen-media-dialog .zen-dialog-foot{font-size:12px;color:#7D887E}.zen-dialog-ok{width:100%;margin-top:12px}
@media(max-width:760px){.zen-capture-toolbar{flex-direction:column}.zen-capture-media{max-width:none}.zen-capture .zen-capture-submit{width:100%}.zen-example-grid{grid-template-columns:1fr}.zen-example{min-height:66px}}
@media(max-width:520px){.zen-capture{padding:19px 16px}.zen-capture-heading{margin-bottom:18px}.zen-capture-mark{width:44px;height:44px;border-radius:13px}.zen-capture-heading h2{font-size:21px}.zen-capture-heading .muted{font-size:13px}.zen-universal-form .zen-compose-box textarea{min-height:170px;padding:15px 15px 8px}.zen-compose-bottom{padding:0 13px 12px}.zen-compose-hint{font-size:11px}.zen-media-button{min-height:70px;flex-direction:column;gap:3px;padding:9px 3px;font-size:12px}.zen-soon{font-size:9px}.zen-capture-toolbar{gap:11px}.zen-examples-title{align-items:flex-start;flex-direction:column;gap:2px}}
@media(prefers-reduced-motion:reduce){.zen-media-button,.zen-example,.zen-settings-button,.zen-capture .zen-capture-submit{transition:none;transform:none!important}}
