:root{font-family:'Roboto','Sarabun',system-ui,sans-serif;color:#34322f;background:#f7f5f1;font-size:15px;--ink:#34322f;--muted:#99958e;--line:#e9e5de;--paper:#fffefa;--accent:#e17f62;--shadow:0 12px 35px #554b3910}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh}.app-shell{min-height:100vh;display:flex}.sidebar{width:254px;flex:0 0 254px;border-right:1px solid var(--line);padding:30px 18px 17px;display:flex;flex-direction:column;background:#f9f7f3}.brand{display:flex;align-items:center;gap:10px;margin:0 9px 35px;color:var(--ink);text-decoration:none;font-size:19px;font-weight:600;letter-spacing:-.6px}.brand-mark{width:29px;height:29px;border-radius:10px;background:#df8063;color:white;display:grid;place-items:center;font-size:19px}.new-note{border:0;border-radius:12px;background:var(--ink);color:white;height:44px;text-align:left;padding:0 15px;font:inherit;font-size:14px;cursor:pointer}.new-note span{font-size:20px;vertical-align:-1px;margin-right:9px}.side-label{margin:31px 10px 11px;font-size:11px;color:#aaa49a;letter-spacing:.09em}.nav-item,.add-collection{width:100%;border:0;background:none;text-align:left;border-radius:10px;padding:10px 11px;color:#65615a;font:inherit;font-size:13px;cursor:pointer}.nav-item span:first-child{margin-right:10px;color:#989187}.nav-item.active{background:#eeebe5;color:#35322d;font-weight:500}.nav-item.active .count{color:inherit;opacity:.78}.count{float:right;color:#999}.collections-label{margin-top:28px}.collection-list{display:grid;gap:2px}.collection-item{display:flex;align-items:center;gap:10px;width:100%;border:0;background:transparent;text-align:left;padding:9px 11px;border-radius:9px;color:#69655e;font:inherit;font-size:13px;cursor:pointer}.collection-item:hover,.nav-item:hover{background:#f0ede7}.collection-dot{width:8px;height:8px;border-radius:50%;background:#d89576}.add-collection{margin-top:4px;color:#99958e;font-size:12px}.sidebar-bottom{margin-top:auto;border-top:1px solid var(--line);padding:17px 2px 0;display:flex;align-items:center;gap:10px}.avatar{width:32px;height:32px;border-radius:50%;background:#ead2c5;color:#7d4c3b;display:grid;place-items:center;font-weight:600}.sidebar-bottom strong,.sidebar-bottom small{display:block;font-size:11px}.sidebar-bottom small{color:var(--muted);margin-top:2px}.settings-trigger{margin-left:auto;border:0;background:none;color:#888;font-size:18px;cursor:pointer}.main-panel{min-width:0;flex:1}.topbar{height:76px;padding:0 clamp(20px,5vw,74px);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}.breadcrumb{display:flex;align-items:center;gap:11px;color:#a09b92;font-size:12px}.breadcrumb b{font-weight:400;color:#d0cbc2}.breadcrumb strong{font-weight:500;color:#514d46}.top-actions{display:flex;gap:12px;align-items:center}.icon-button{border:0;background:transparent;font:inherit;font-size:22px;color:#77726a;cursor:pointer}.share-button{border:1px solid #e7e1d8;border-radius:99px;background:#fffdf9;padding:8px 13px;color:#716d65;font:inherit;font-size:12px;cursor:pointer}.content-area{max-width:1100px;margin:0 auto;padding:56px clamp(20px,5vw,74px) 80px}.welcome-row{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:32px}.eyebrow{text-transform:uppercase;letter-spacing:.1em;color:#b18b75;font-size:10px;margin:0 0 7px}.welcome-row h1{font-weight:500;font-size:34px;letter-spacing:-1px;margin:0}.subhead{margin:6px 0 0;color:#99948b;font-size:13px}.primary-button{border:0;border-radius:11px;background:var(--accent);color:white;font:inherit;font-size:13px;padding:11px 16px;box-shadow:0 5px 13px #d87b5e26;cursor:pointer}.primary-button:hover{background:#d67357}.note-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.note-card{background:var(--paper);border:1px solid #efebe4;border-radius:15px;padding:19px 19px 16px;min-height:176px;display:flex;flex-direction:column;cursor:pointer;transition:.18s;box-shadow:0 3px 12px #554b3907}.note-card:hover{transform:translateY(-2px);box-shadow:var(--shadow)}.note-card:nth-child(4n+2){background:#fbf7f0}.note-card:nth-child(4n+3){background:#f4f7f2}.card-date{font-family:'DM Sans',sans-serif;color:#aaa49b;font-size:10px;letter-spacing:.04em}.card-title{font-size:17px;font-weight:500;margin:11px 0 7px;line-height:1.5}.card-preview{font-size:12px;color:#8a857c;line-height:1.8;white-space:pre-wrap;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.card-image{margin-top:11px;width:100%;height:104px;object-fit:cover;border-radius:9px}.card-footer{margin-top:auto;padding-top:13px;display:flex;justify-content:space-between;color:#aca69d;font-size:10px}.empty-state{display:none;text-align:center;padding:63px 10px 40px}.empty-state.visible{display:block}.empty-art{width:78px;height:78px;margin:0 auto 20px;border-radius:27px;background:#f0ebe1;display:grid;place-items:center;position:relative;color:#cd9075;font-size:32px;transform:rotate(-4deg)}.empty-art i{position:absolute;right:-10px;top:-8px;font-size:17px;color:#d8b073;font-style:normal}.empty-state h2{font-size:19px;font-weight:500;margin:0 0 7px}.empty-state p{max-width:350px;margin:0 auto 18px;color:#99948b;font-size:12px;line-height:1.8}.mobile-menu{display:none;border:0;background:none;font-size:19px}.editor-dialog,.small-dialog{border:0;padding:0;color:var(--ink);box-shadow:0 25px 90px #27221c30}.editor-dialog{width:min(820px,calc(100vw - 28px));height:min(760px,calc(100dvh - 28px));border-radius:18px}.editor-dialog::backdrop,.small-dialog::backdrop{background:#28252070;backdrop-filter:blur(3px)}.editor-form{height:100%;display:flex;flex-direction:column}.editor-toolbar{height:66px;flex:none;border-bottom:1px solid var(--line);padding:0 23px;display:flex;align-items:center;justify-content:space-between}.text-button{border:0;background:none;color:#777;font:inherit;font-size:13px;cursor:pointer}.editor-actions{display:flex;align-items:center;gap:15px}.save-status{font-size:10px;color:#a7a198}.done-button{border:0;border-radius:8px;background:var(--ink);color:white;padding:8px 16px;font:inherit;font-size:12px;cursor:pointer}.editor-body{max-width:650px;width:100%;margin:auto;padding:36px 25px;overflow:auto;flex:1}.editor-meta{display:flex;gap:12px;margin-bottom:22px}.editor-meta input,.editor-meta select{border:1px solid var(--line);border-radius:7px;background:#fffefa;color:#888;font:inherit;font-size:11px;padding:7px 9px}.title-input,.body-input{width:100%;border:0;outline:0;background:transparent;color:var(--ink);font:inherit}.title-input{font-size:30px;font-weight:500;margin-bottom:13px}.body-input{min-height:270px;resize:vertical;font-size:var(--note-font-size,17px);line-height:1.9}.title-input::placeholder,.body-input::placeholder{color:#cbc6bd}.image-list{display:grid;gap:12px;margin-top:18px}.image-item{position:relative}.image-preview{position:relative}.image-item img{display:block;width:100%;height:auto;max-height:520px;object-fit:cover;border-radius:10px}.image-item input[type=range]{width:100%;accent-color:var(--accent)}.image-item button{position:absolute;right:8px;top:8px;border:0;border-radius:50%;background:#282520b8;color:white;width:28px;height:28px;cursor:pointer}.small-dialog{width:min(390px,calc(100vw - 30px));border-radius:16px;padding:24px}.small-dialog form{display:flex;flex-direction:column}.dialog-heading{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:17px}.dialog-heading h2{font-size:21px;font-weight:500;margin:0}.field-label{font-size:12px;color:#777;margin:15px 0 7px}.select-field{border:1px solid var(--line);border-radius:8px;background:white;padding:10px;font:inherit;font-size:12px;color:#555}.small-dialog input[type=range]{width:100%;accent-color:var(--accent)}.field-label span{float:right;color:#a29b91}.preview-text{background:#f8f5ef;border-radius:10px;padding:15px;color:#69645d;line-height:1.7;font-size:var(--note-font-size,17px)}#message-body{font-size:13px;line-height:1.8;color:#777}.message-action{margin-top:12px}.search-row{margin:-12px 0 22px}.search-row input{width:100%;border:1px solid var(--line);border-radius:9px;padding:11px 13px;background:#fffefa;font:inherit;font-size:13px}.hidden{display:none!important}.toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,15px);opacity:0;pointer-events:none;background:#34322f;color:white;padding:10px 15px;border-radius:9px;font-size:12px;transition:.2s}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:900px){.sidebar{width:220px;flex-basis:220px}.note-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.content-area{padding-top:42px}}@media(max-width:640px){.sidebar{position:fixed;z-index:5;inset:0 auto 0 0;width:270px;transform:translateX(-105%);transition:transform .22s;box-shadow:15px 0 40px #28252012}.sidebar.open{transform:translateX(0)}.mobile-menu{display:block}.topbar{height:62px;padding:0 17px;gap:13px}.breadcrumb{margin-right:auto;gap:7px;font-size:11px}.share-button{padding:8px 10px}.share-button span{display:none}.content-area{padding:35px 17px 55px}.welcome-row h1{font-size:27px}.subhead{font-size:11px}.welcome-row{align-items:center;margin-bottom:25px}.primary-button{padding:10px 12px}.primary-button span{display:none}.note-grid{grid-template-columns:1fr;gap:11px}.note-card{min-height:148px;padding:16px}.editor-dialog{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.editor-toolbar{padding:0 17px}.editor-body{padding:27px 20px}.title-input{font-size:25px}.body-input{min-height:45dvh}.save-status{display:none}}
.auth-dialog{z-index:10}.auth-dialog[open]{display:block}.auth-copy{font-size:12px;line-height:1.8;color:#888}.auth-name{display:none}.auth-dialog.register .auth-name{display:block}.auth-error{color:#bb5947;font-size:11px;line-height:1.6;min-height:16px}.auth-switch{border:0;background:transparent;margin:12px auto 0;color:#817b71;font:inherit;font-size:12px;cursor:pointer}.sidebar-bottom{min-width:0}.sidebar-bottom>div{min-width:0;overflow:hidden}.sidebar-bottom strong,.sidebar-bottom small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
:root{--glass-t:.5;--glass-a:calc(.55 + .4 * var(--glass-t));--surface:#f9f7f3;--paper-rgb:255,254,250;--text-secondary:#8a857c;--accent-soft:#f2e8df;--accent-ink:#fff}body{background:#f7f5f1;color:var(--ink)}body[data-theme="dark"]{color-scheme:dark;--ink:#f2eee8;--muted:#aaa49b;--line:#393a3e;--surface:#191a1e;--paper-rgb:32,33,38;--text-secondary:#c1bbb2;--accent:#eee9bf;--accent-soft:rgba(238,233,191,.14);--accent-ink:#17181b;background:#0e0f12}body[data-tint="pearl"]{--surface:#fbf7ef;--paper-rgb:255,250,239;--accent:#b98254;--accent-soft:rgba(185,130,84,.15)}body[data-theme="dark"][data-tint="pearl"]{--surface:#211e1a;--paper-rgb:42,37,32;--accent:#f0d3a5;--accent-soft:rgba(240,211,165,.14)}body[data-tint="graphite"]{--surface:#f0f2f5;--paper-rgb:244,246,249;--accent:#63758d;--accent-soft:rgba(99,117,141,.15)}body[data-theme="dark"][data-tint="graphite"]{--surface:#15171c;--paper-rgb:24,26,31;--accent:#c5cfdb;--accent-soft:rgba(197,207,219,.14)}
body .sidebar{background:var(--surface);border-color:var(--line)}body .topbar{border-color:var(--line)}body .note-card{background:rgba(var(--paper-rgb),var(--glass-a));border-color:var(--line);backdrop-filter:blur(calc(4px + 16px * var(--glass-t)))}body .note-card:nth-child(4n+2),body .note-card:nth-child(4n+3){background:rgba(var(--paper-rgb),var(--glass-a))}body .editor-dialog,body .small-dialog{background:var(--surface);color:var(--ink)}body .editor-meta input,body .editor-meta select,body .search-row input,body .select-field{background:rgba(var(--paper-rgb),var(--glass-a));color:var(--ink);border-color:var(--line)}body .card-preview,body .subhead,body .collection-item,body .sidebar-bottom small{color:var(--text-secondary)}body .nav-item.active{background:var(--accent-soft);color:var(--ink)}body .primary-button{background:var(--accent);color:var(--accent-ink)}body .preview-text{background:var(--accent-soft);color:var(--ink)}body .share-button{background:var(--surface);color:var(--ink);border-color:var(--line)}body[data-nav="pill"] .nav-item.active,body[data-nav="pill"] .collection-item.active{background:var(--accent);color:var(--accent-ink);border-radius:99px}body[data-nav="pill"] .collection-item.active .collection-dot{background:currentColor!important}body .collection-item.active{background:var(--accent-soft);color:var(--ink)}
.theme-options{display:flex;gap:7px}.theme-options button{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--line);border-radius:9px;background:rgba(var(--paper-rgb),var(--glass-a));padding:8px 5px;color:var(--ink);font:inherit;font-size:10px;cursor:pointer}.theme-options button.selected{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}.tint-swatch{display:inline-block;width:12px;height:12px;border:1px solid #8885;border-radius:50%}.crystal-swatch{background:linear-gradient(135deg,#fff,#dfe6ed)}.pearl-swatch{background:linear-gradient(135deg,#fff5e2,#dab88e)}.graphite-swatch{background:linear-gradient(135deg,#e8edf4,#788599)}.small-dialog input[type=range]{accent-color:var(--accent)}.reset-appearance{align-self:flex-start;border:0;background:transparent;color:var(--text-secondary);font:inherit;font-size:11px;margin-top:15px;cursor:pointer}body[data-theme="dark"] .new-note{background:var(--accent);color:var(--accent-ink)}body[data-theme="dark"] .side-label,body[data-theme="dark"] .eyebrow,body[data-theme="dark"] .card-date{color:var(--muted)}body[data-theme="dark"] .card-title,body[data-theme="dark"] .welcome-row h1,body[data-theme="dark"] .breadcrumb strong{color:var(--ink)}body[data-theme="dark"] .empty-art{background:var(--surface)}body[data-theme="dark"] .title-input,body[data-theme="dark"] .body-input{color:var(--ink)}
.small-dialog{max-height:90dvh;overflow:auto}

/* Inline note formatting and clearly visible actions */
.body-input{min-height:270px;outline:0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:17px;line-height:1.9;padding:5px 0}.body-input:empty:before{content:attr(data-placeholder);color:#cbc6bd;pointer-events:none}.format-toolbar{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:5px;overflow-x:auto;padding:8px 0;margin:0 0 7px;background:var(--surface);border-bottom:1px solid var(--line);scrollbar-width:none}.format-toolbar::-webkit-scrollbar{display:none}.format-toolbar button{flex:0 0 36px;width:36px;height:34px;border:1px solid var(--line);border-radius:8px;background:rgba(var(--paper-rgb),var(--glass-a));color:var(--ink);font:inherit;font-size:14px;cursor:pointer}.format-toolbar button:hover{border-color:var(--accent)}.format-toolbar select{flex:0 0 auto;max-width:138px;height:34px;border:1px solid var(--line);border-radius:8px;background:rgba(var(--paper-rgb),var(--glass-a));color:var(--ink);font:inherit;font-size:11px;padding:0 7px}.format-toolbar #inline-size{max-width:80px}.toolbar-divider{height:24px;border-left:1px solid var(--line);margin:0 3px}.text-color-control{position:relative;flex:0 0 36px;width:36px;height:34px;display:grid;place-items:center;border:1px solid var(--line);border-radius:8px;color:var(--ink);font-weight:700;cursor:pointer}.text-color-control input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.delete-note-button{display:flex;align-items:center;gap:6px;border:1px solid #d77d6a55;border-radius:8px;background:transparent;color:#cb624f;padding:8px 10px;font:inherit;font-size:12px;cursor:pointer}.delete-note-button:hover{background:#cb624f13}.editor-actions{gap:10px}.body-input b,.body-input strong{font-weight:700}.body-input s,.body-input strike,.body-input del{text-decoration:line-through}
@media(max-width:640px){.editor-actions{gap:7px}.delete-note-button{padding:7px 8px;font-size:11px}.editor-body{padding-top:18px}.format-toolbar{margin-left:-2px;margin-right:-2px}.body-input{min-height:45dvh}}

/* Notes editor: continuous page with a pinned formatting palette */
.editor-dialog{width:min(1180px,calc(100vw - 32px));height:min(900px,calc(100dvh - 32px));border-radius:22px}.editor-body{max-width:none;width:100%;margin:0;padding:22px clamp(24px,4vw,58px);display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:clamp(26px,5vw,70px);align-items:start;overflow:auto}.editor-main{min-width:0;max-width:760px;width:100%;margin:0 auto}.format-sidebar{position:sticky;top:8px;align-self:start;max-height:calc(100dvh - 135px);overflow:auto;border-left:1px solid var(--line);padding:4px 0 12px 18px}.format-toolbar{display:flex;flex-wrap:wrap;overflow:visible;gap:7px;padding:0;margin:0;background:transparent;border:0}.format-toolbar button{flex:0 0 40px;width:40px;height:40px}.format-toolbar select{flex:1 1 100%;width:100%;max-width:none;height:40px;font-size:13px}.format-toolbar #inline-size{max-width:none}.toolbar-divider{display:none}.text-color-control{flex:0 0 44px;width:44px;height:40px}.body-input{min-height:360px;padding:8px 0 20px;font-size:17px;line-height:1.85}.body-input h1{margin:14px 0 15px;font:500 34px/1.35 'Prompt','IBM Plex Sans Thai Looped',system-ui,sans-serif;color:var(--ink);outline:0;overflow-wrap:anywhere}.body-input h1:empty:before{content:'ตั้งชื่อโน้ต';color:#b6b0a7;pointer-events:none}.body-input p{margin:0 0 10px}.image-resize-control{display:flex;align-items:center;gap:15px;margin:12px 0 8px;padding:10px 12px;border:1px solid var(--line);border-radius:11px;background:rgba(var(--paper-rgb),var(--glass-a));color:var(--text-secondary);font-size:12px}.image-resize-control label{flex:0 0 auto;min-width:82px}.image-resize-control input{flex:1;min-width:60px;accent-color:var(--accent);touch-action:pan-x;height:32px}.image-resize-control output{color:var(--ink);font-variant-numeric:tabular-nums}.image-preview{position:relative}.image-item img{display:block;max-width:100%;height:auto;max-height:none;object-fit:contain;margin:0 auto;border-radius:12px}.image-item button{z-index:1}.calendar-view{margin-top:12px}.calendar-heading{display:flex;align-items:center;justify-content:center;gap:20px;margin:0 0 18px}.calendar-heading h2{min-width:180px;text-align:center;font-size:20px;font-weight:500;margin:0}.calendar-step{width:38px;height:38px;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--ink);font-size:24px;cursor:pointer}.calendar-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:20px;align-items:start}.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;padding:14px;border:1px solid var(--line);border-radius:16px;background:rgba(var(--paper-rgb),var(--glass-a))}.calendar-weekday{text-align:center;color:var(--text-secondary);font-size:11px;padding:6px}.calendar-blank{min-height:72px}.calendar-cell{position:relative;min-height:72px;border:1px solid transparent;border-radius:11px;background:transparent;color:var(--ink);font:inherit;text-align:left;padding:9px;cursor:pointer}.calendar-cell:hover{background:var(--accent-soft)}.calendar-cell.selected{border-color:var(--accent);background:var(--accent-soft)}.calendar-cell.has-notes:after{content:'';position:absolute;bottom:8px;left:10px;width:6px;height:6px;border-radius:50%;background:var(--accent)}.calendar-cell i{position:absolute;right:7px;bottom:5px;color:var(--text-secondary);font-style:normal;font-size:10px}.calendar-day{position:sticky;top:8px;padding:18px;border:1px solid var(--line);border-radius:16px;background:rgba(var(--paper-rgb),var(--glass-a))}.calendar-day h3{margin:0 0 13px;font-size:15px;font-weight:500}.calendar-note{display:flex;flex-direction:column;gap:5px;width:100%;padding:11px 0;border:0;border-top:1px solid var(--line);background:transparent;color:var(--ink);text-align:left;font:inherit;cursor:pointer}.calendar-note strong{font-size:13px;font-weight:500}.calendar-note span,.calendar-empty{font-size:11px;color:var(--text-secondary);line-height:1.6}.calendar-day .primary-button{width:100%;margin-top:12px;font-size:12px}
@media(max-width:760px){.editor-dialog{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.editor-body{display:flex;flex-direction:column;gap:14px;padding:0 20px 24px}.format-sidebar{order:0;top:0;z-index:4;width:100%;max-height:none;overflow:visible;border-left:0;border-bottom:1px solid var(--line);padding:7px 0;background:var(--surface)}.format-toolbar{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}.format-toolbar select{flex:0 0 auto;width:auto;max-width:138px;height:38px}.format-toolbar #inline-size{max-width:80px}.format-toolbar button{flex:0 0 38px;width:38px;height:38px}.toolbar-divider{display:block}.editor-main{order:1;max-width:none}.body-input h1{font-size:29px}.body-input{min-height:50dvh}.calendar-layout{grid-template-columns:1fr}.calendar-grid{gap:3px;padding:8px}.calendar-cell,.calendar-blank{min-height:48px}.calendar-cell{padding:5px;font-size:12px}.calendar-cell.has-notes:after{bottom:4px;left:6px}.calendar-cell i{right:5px;bottom:2px}.calendar-day{position:static}.calendar-heading{margin-top:10px}}

/* Mobile-first navigation: replace the cramped drawer with a top menu */
.mobile-brand{display:none;align-items:center;gap:8px;color:var(--ink);text-decoration:none;white-space:nowrap;font-size:14px}.mobile-brand .brand-mark{width:30px;height:30px}.mobile-brand strong{font-weight:600}.mobile-nav{display:none}.top-mobile-action{display:none}.attach-top-button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:0 11px;border:1px solid var(--line);border-radius:9px;background:transparent;color:var(--text-secondary);font:inherit;font-size:12px;cursor:pointer;white-space:nowrap}.attach-top-button:hover{border-color:var(--accent);color:var(--ink)}
@media(max-width:760px){.sidebar{display:none!important}.mobile-menu{display:none!important}.mobile-brand{display:flex}.topbar{position:sticky;top:0;z-index:7;height:56px;padding:0 8px;gap:6px;background:var(--surface);border-bottom:1px solid var(--line)}.breadcrumb{display:none}.top-actions{gap:1px;flex:none}.top-actions .icon-button,.top-actions .share-button{display:grid;place-items:center;width:38px;min-width:38px;height:40px;padding:0;border:0;border-radius:10px;background:transparent;color:var(--ink);font-size:20px}.top-actions .share-button span{display:none}.top-mobile-action{display:grid!important}.mobile-nav{position:sticky;top:56px;z-index:6;display:flex;align-items:center;gap:5px;min-height:48px;padding:5px 10px;overflow-x:auto;overscroll-behavior-x:contain;background:var(--surface);border-bottom:1px solid var(--line);scrollbar-width:none;-webkit-overflow-scrolling:touch}.mobile-nav::-webkit-scrollbar,.mobile-collections::-webkit-scrollbar{display:none}.mobile-nav-item{flex:none;min-height:36px;padding:7px 11px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--text-secondary);font:inherit;font-size:12px;white-space:nowrap;cursor:pointer}.mobile-nav-item.active{background:var(--accent-soft);border-color:color-mix(in srgb,var(--accent) 45%,transparent);color:var(--ink)}.mobile-new-note{background:var(--accent);color:var(--accent-ink)}.mobile-collections{display:flex;flex:none;align-items:center;gap:5px;overflow:visible}.mobile-collection-item{background:rgba(var(--paper-rgb),.55);border-color:var(--line)}.content-area{padding:24px 15px 55px}.welcome-row{align-items:center;margin-bottom:21px}.welcome-row h1{font-size:26px}.subhead{max-width:245px;line-height:1.6}.editor-dialog{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.editor-toolbar{height:60px;padding:0 9px;gap:5px}.editor-actions{gap:5px}.save-status{display:none}.attach-top-button{min-width:38px;min-height:40px;padding:0 8px;font-size:11px}.delete-note-button{min-height:40px;padding:0 8px;font-size:11px}.done-button{min-height:40px;padding:0 12px}.editor-body{padding:0 15px 24px}.format-sidebar{top:60px}.editor-main{padding-top:7px}.editor-meta{margin-bottom:13px}.image-resize-control{position:sticky;top:104px;z-index:2;background:var(--surface)}search-row{padding:0 15px}.calendar-layout{grid-template-columns:1fr}.calendar-cell,.calendar-blank{min-height:46px}}
@media(max-width:380px){.mobile-brand{gap:5px;font-size:12px}.mobile-brand .brand-mark{width:27px;height:27px}.topbar{padding:0 5px}.top-actions .icon-button,.top-actions .share-button{width:35px;min-width:35px}.editor-toolbar{padding:0 6px}.attach-top-button span{display:none}.delete-note-button{gap:3px}.delete-note-button span{display:inline}.editor-actions{gap:3px}}

/* Keep the writing controls at the top of the note on phones. */
@media(max-width:760px){.editor-dialog{position:fixed;inset:0;margin:0;width:100vw;max-width:none;height:100dvh;max-height:none;border-radius:0}.editor-body{margin:0 auto;gap:0}.format-sidebar{position:sticky;top:0;flex:none;margin:0;padding:7px 0}.editor-main{padding-top:0}.body-input{min-height:calc(100dvh - 245px)}}
body[data-theme="dark"] .done-button{background:var(--accent);color:var(--accent-ink)}
@media(max-width:760px){.note-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.note-card{min-width:0;min-height:132px;padding:13px 12px 11px;border-radius:14px}.card-title{font-size:14px;margin:8px 0 4px;line-height:1.35}.card-preview{font-size:11px;line-height:1.55;-webkit-line-clamp:2}.card-footer{padding-top:9px;font-size:9px;gap:5px}.card-footer span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.card-image{height:76px;margin-top:8px}}

/* Liquid glass appearance panel: translucent surface, compact footprint. */
:root{--glass-a:calc(.22 + .38 * var(--glass-t))}
body .small-dialog{background:rgba(var(--paper-rgb),var(--glass-a));backdrop-filter:blur(calc(18px + 14px * var(--glass-t))) saturate(1.65);-webkit-backdrop-filter:blur(calc(18px + 14px * var(--glass-t))) saturate(1.65);border:1px solid rgba(255,255,255,.32);border-radius:22px;box-shadow:0 24px 70px rgba(16,18,25,.2)}
.small-dialog .field-label{margin:10px 0 5px}.small-dialog .theme-options{gap:6px}.small-dialog .theme-options button{min-height:36px;padding:6px 4px}.small-dialog .appearance-preview{margin-top:12px;padding:13px;border-radius:16px}.small-dialog .appearance-preview strong{font-size:18px}.small-dialog .appearance-preview .preview-text{padding:9px 0 0;background:transparent;font-size:14px;line-height:1.55}.small-dialog .reset-appearance{margin-top:8px}
#settings-dialog .dialog-heading .icon-button{width:34px;height:34px;border:1px solid var(--line);border-radius:50%;background:rgba(var(--paper-rgb),.35);font-size:19px}#settings-dialog .dialog-heading .icon-button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(max-width:760px){.small-dialog{width:min(350px,calc(100vw - 40px));max-height:76dvh;padding:18px;overflow:auto;border-radius:22px}.small-dialog .dialog-heading{margin-bottom:10px}.small-dialog .dialog-heading h2{font-size:19px}.small-dialog .appearance-preview{margin-top:10px}}
/* Theme contrast: dark text on light accent fills, theme-aware secondary copy. */
body[data-theme="light"]{--accent-ink:#271710}body[data-theme="light"][data-tint="pearl"]{--accent-ink:#24180f}body[data-theme="light"][data-tint="graphite"]{--accent-ink:#101a27}
body .small-dialog{background:rgba(var(--paper-rgb),clamp(.68,var(--glass-a),.88))}
.field-label,#message-body,.auth-copy{color:var(--text-secondary)}body .field-label span{color:var(--text-secondary)}
@media(max-width:760px){.format-sidebar{padding:8px 0 10px}.format-toolbar{display:grid;grid-template-columns:repeat(4,minmax(34px,1fr)) minmax(70px,1.3fr) 40px;gap:6px;overflow:visible}.format-toolbar button{width:auto;min-width:0;height:38px;flex:none}.format-toolbar .toolbar-divider{display:none}.format-toolbar select{width:auto;max-width:none;min-width:0;height:38px;padding:0 7px;font-size:12px}.format-toolbar select:nth-of-type(1){grid-column:1/5}.format-toolbar #inline-size{grid-column:5}.format-toolbar .text-color-control{grid-column:6;width:40px;height:38px;justify-self:stretch}}
.text-button,.attach-top-button{min-height:40px}.text-button{display:inline-flex;align-items:center;gap:8px;padding:0 10px;border-radius:10px}.text-button svg,.attach-top-button svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.text-button:hover,.attach-top-button:hover{background:var(--accent-soft);color:var(--ink)}.text-button:focus-visible,.attach-top-button:focus-within{outline:2px solid var(--accent);outline-offset:2px}.editor-toolbar{gap:12px}.editor-actions{gap:10px}.attach-top-button{min-width:42px}.nav-item.active .count{color:inherit;opacity:.78}body[data-theme="dark"] .nav-item.active .count{color:var(--accent-ink);opacity:.85}

/* A shared, soft liquid-glass language for navigation, actions and editor tools. */
:root{--glass-control:rgba(var(--paper-rgb),.62);--glass-edge:rgba(255,255,255,.58);--glass-shadow:0 5px 16px rgba(35,31,27,.08),inset 0 1px 0 rgba(255,255,255,.52)}
.brand-icon{display:block;flex:none;width:34px;height:34px;border-radius:11px;object-fit:cover;box-shadow:0 3px 10px rgba(67,47,31,.15)}.mobile-brand .brand-icon{width:30px;height:30px;border-radius:10px}
body[data-theme="dark"]{--glass-control:rgba(var(--paper-rgb),.58);--glass-edge:rgba(255,255,255,.14);--glass-shadow:0 6px 18px rgba(0,0,0,.2),inset 0 1px 0 rgba(255,255,255,.09)}
.icon-button,.settings-trigger,.mobile-menu,.calendar-step,.text-button,.attach-top-button,.delete-note-button,.done-button,.share-button,.primary-button,.new-note,.format-toolbar button,.format-toolbar select,.text-color-control,.mobile-nav-item,.theme-options button,.password-toggle{border:1px solid var(--glass-edge);border-radius:14px;background:linear-gradient(155deg,rgba(255,255,255,.34),transparent 62%),var(--glass-control);color:var(--ink);box-shadow:var(--glass-shadow);backdrop-filter:blur(calc(10px + 14px * var(--glass-t))) saturate(1.55);-webkit-backdrop-filter:blur(calc(10px + 14px * var(--glass-t))) saturate(1.55);transition:background .18s ease,border-color .18s ease,box-shadow .18s ease,transform .18s ease,color .18s ease}
.icon-button,.settings-trigger,.mobile-menu,.calendar-step{display:inline-grid;place-items:center;width:40px;height:40px;padding:0;border-radius:50%;font-size:18px;color:var(--ink)}
.icon-button svg,.settings-trigger svg,.mobile-menu svg,.calendar-step svg,.share-button svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.share-button{display:inline-flex;align-items:center;justify-content:center;gap:7px}.share-button svg{width:15px;height:15px}
.mobile-menu{border:1px solid var(--glass-edge);background:var(--glass-control);box-shadow:var(--glass-shadow)}
.nav-item{display:flex;align-items:center;gap:10px}.nav-item svg,.mobile-nav-item svg{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.nav-item .count{margin-left:auto}.delete-note-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:0 11px;font:inherit;font-size:12px}.delete-note-button svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.mobile-nav-item{display:inline-flex;align-items:center;justify-content:center;gap:6px}
.icon-button:hover,.settings-trigger:hover,.mobile-menu:hover,.calendar-step:hover,.text-button:hover,.attach-top-button:hover,.delete-note-button:hover,.format-toolbar button:hover,.format-toolbar select:hover,.text-color-control:hover,.mobile-nav-item:hover,.theme-options button:hover,.password-toggle:hover{border-color:color-mix(in srgb,var(--accent) 55%,var(--glass-edge));background:linear-gradient(145deg,rgba(255,255,255,.52),transparent 65%),var(--accent-soft);color:var(--ink);transform:translateY(-1px)}
.icon-button:active,.settings-trigger:active,.mobile-menu:active,.calendar-step:active,.text-button:active,.attach-top-button:active,.delete-note-button:active,.done-button:active,.share-button:active,.primary-button:active,.new-note:active,.format-toolbar button:active,.mobile-nav-item:active{transform:scale(.97)}
.icon-button:focus-visible,.settings-trigger:focus-visible,.mobile-menu:focus-visible,.calendar-step:focus-visible,.text-button:focus-visible,.attach-top-button:focus-within,.delete-note-button:focus-visible,.done-button:focus-visible,.share-button:focus-visible,.primary-button:focus-visible,.new-note:focus-visible,.format-toolbar button:focus-visible,.format-toolbar select:focus-visible,.text-color-control:focus-within,.mobile-nav-item:focus-visible,.theme-options button:focus-visible,.password-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.share-button{border-color:var(--glass-edge);background:var(--glass-control);box-shadow:var(--glass-shadow)}
.new-note{background:linear-gradient(150deg,rgba(255,255,255,.13),transparent 55%),var(--ink);color:var(--paper);border-color:var(--glass-edge);border-radius:16px}
body[data-theme="dark"] .new-note{background:linear-gradient(150deg,rgba(255,255,255,.2),transparent 55%),var(--accent);color:var(--accent-ink)}
.primary-button,.mobile-new-note{border:1px solid color-mix(in srgb,var(--accent) 40%,var(--glass-edge));background:linear-gradient(145deg,rgba(255,255,255,.27),transparent 58%),var(--accent);color:var(--accent-ink);box-shadow:0 7px 20px color-mix(in srgb,var(--accent) 20%,transparent),inset 0 1px 0 rgba(255,255,255,.38)}
.done-button{min-height:40px;padding:0 17px;border-color:color-mix(in srgb,var(--accent) 40%,var(--glass-edge));border-radius:14px;background:linear-gradient(145deg,rgba(255,255,255,.27),transparent 58%),var(--accent);color:var(--accent-ink);font:inherit;font-size:12px;font-weight:600}
.delete-note-button{border-radius:14px;background:var(--glass-control);color:var(--accent);border-color:color-mix(in srgb,var(--accent) 30%,var(--glass-edge))}
.format-toolbar button,.format-toolbar select,.text-color-control{border-radius:12px;background:var(--glass-control);color:var(--ink)}
.text-color-control{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--glass-edge);box-shadow:var(--glass-shadow)}
.nav-item.active,.collection-item.active,.mobile-nav-item.active{box-shadow:inset 0 1px 0 rgba(255,255,255,.38),0 4px 12px rgba(35,31,27,.06);backdrop-filter:blur(18px) saturate(1.5);-webkit-backdrop-filter:blur(18px) saturate(1.5)}
.mobile-nav,.topbar,.editor-toolbar,.format-sidebar{background:rgba(var(--paper-rgb),clamp(.58,var(--glass-a),.82));backdrop-filter:blur(calc(14px + 14px * var(--glass-t))) saturate(1.55);-webkit-backdrop-filter:blur(calc(14px + 14px * var(--glass-t))) saturate(1.55)}
.mobile-nav-item{border-color:var(--glass-edge);background:var(--glass-control)}
.mobile-nav-item.active{background:var(--accent-soft);border-color:color-mix(in srgb,var(--accent) 42%,var(--glass-edge));color:var(--ink)}
.mobile-new-note{color:var(--accent-ink)}
.theme-options button.selected{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent),inset 0 1px 0 rgba(255,255,255,.5)}
.password-toggle{border-radius:50%}
@media(max-width:760px){.top-actions .icon-button,.top-actions .share-button{border:1px solid var(--glass-edge);background:var(--glass-control);box-shadow:var(--glass-shadow);border-radius:50%}.top-actions .share-button{border-radius:14px}.mobile-nav{background:rgba(var(--paper-rgb),.78);border-color:var(--glass-edge)}.format-sidebar{background:rgba(var(--paper-rgb),.82)}}
@media(prefers-reduced-motion:reduce){.icon-button,.settings-trigger,.mobile-menu,.calendar-step,.text-button,.attach-top-button,.delete-note-button,.done-button,.share-button,.primary-button,.new-note,.format-toolbar button,.format-toolbar select,.text-color-control,.mobile-nav-item,.theme-options button,.password-toggle{transition:none}}

/* Note selection and a reversible 30-day trash. */
.note-management{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-15px 0 18px;padding:9px 11px;border:1px solid var(--line);border-radius:16px;background:rgba(var(--paper-rgb),.55);backdrop-filter:blur(14px) saturate(1.35);-webkit-backdrop-filter:blur(14px) saturate(1.35)}.note-management>div{display:flex;align-items:center;gap:7px}.management-hint{font-size:11px;color:var(--text-secondary)}.management-button{min-height:36px;padding:7px 12px;border:1px solid var(--glass-edge);border-radius:12px;background:var(--glass-control);color:var(--ink);font:inherit;font-size:12px;cursor:pointer}.management-button:hover{background:var(--accent-soft);border-color:var(--accent)}.management-button.danger-action{color:#a5483d;border-color:rgba(201,93,74,.28);background:rgba(201,93,74,.1)}body[data-theme="dark"] .management-button.danger-action{color:#ffc0b4}.note-card{position:relative}.card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.card-tools{display:flex;align-items:center;gap:5px;margin:-7px -7px 0 0}.card-tool{display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid var(--glass-edge);border-radius:12px;background:var(--glass-control);color:var(--text-secondary);box-shadow:var(--glass-shadow);cursor:pointer;touch-action:manipulation}.card-tool svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.card-tool:hover{border-color:var(--accent);background:var(--accent-soft);color:var(--ink)}.card-tool.permanent-delete,.card-tool.card-delete{color:#b65345}.card-tool.card-select{display:none}.selection-mode .card-tool.card-select{display:grid}.selection-mode .card-tool:not(.card-select){display:none}.note-card.selected{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 45%,transparent),var(--shadow)}.note-card.selected .card-select{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}.trash-mode .note-card{border-style:dashed}.trash-empty #empty-create{display:none}
@media(max-width:760px){.note-management{margin:-8px 0 13px;padding:8px;border-radius:14px}.note-management>div{gap:5px}.management-hint{font-size:10px}.management-button{min-height:36px;padding:6px 9px;font-size:11px}.card-tool{width:38px;height:38px}.card-tools{margin:-6px -5px 0 0}}

/* Inline images inside the note body */
.editor-main{position:relative}
.body-input img{display:inline-block;max-width:100%;height:auto;margin:4px 0;vertical-align:bottom;border-radius:10px;cursor:pointer;-webkit-user-drag:none}
.body-input img.uploading{opacity:.5;filter:saturate(.4)}
.image-tools{position:absolute;z-index:3;box-sizing:border-box;border:2px solid var(--accent,#e17f62);border-radius:10px;pointer-events:none}
.image-tools[hidden]{display:none}
.image-tools-bar{position:absolute;left:0;top:8px;display:flex;align-items:center;gap:3px;padding:4px;border-radius:999px;background:#282520e0;color:#fff;font-size:12px;white-space:nowrap;pointer-events:auto;box-shadow:0 6px 18px #0003}
.image-tools.compact .image-tools-bar{top:auto;bottom:calc(100% + 8px)}
.image-tools-bar span{min-width:40px;padding:0 6px;text-align:center;font-variant-numeric:tabular-nums}
.image-tools-bar button{min-width:34px;height:30px;padding:0 8px;border:0;border-radius:999px;background:#ffffff1f;color:#fff;font:inherit;cursor:pointer}
.image-tools-bar button:hover{background:#ffffff3d}
.image-tools-bar .image-remove{min-width:30px;padding:0;background:#d9534f;font-size:16px;line-height:1}
.image-handle{position:absolute;bottom:-13px;width:26px;height:26px;border:3px solid #fff;border-radius:50%;background:var(--accent,#e17f62);box-shadow:0 2px 8px #0004;pointer-events:auto;touch-action:none;cursor:ew-resize}
.image-handle:before{content:'';position:absolute;inset:-12px}
.image-handle.left{left:-13px}
.image-handle.right{right:-13px}
.image-tools.resizing .image-tools-bar{opacity:.85}
