:root { --bg:#d9d9d9; --surface:#fff; --ink:#191919; --muted:#717171; --line:#dedede; --accent-soft:#f0f0ef; --f-body:"Google Sans","Noto Sans Thai",system-ui,sans-serif; }
:root[data-theme="dark"] { --bg:#191919; --surface:#292929; --ink:#f8f8f8; --muted:#bdbdbd; --line:#555; --accent-soft:#383838; }
html,body { scrollbar-width:none; } html::-webkit-scrollbar,body::-webkit-scrollbar { display:none; }
body { background:var(--bg); color:var(--ink); font-family:var(--f-body); }
.user-shell-header { position:sticky; top:0; z-index:1002; min-height:76px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:24px 16px 8px; background:var(--bg); }
.user-shell-logo { font:26px/1.6 "Homemade Apple",cursive; color:var(--ink); text-decoration:none; }
.user-shell-menu { position:relative; }
.user-shell-actions { display:flex; align-items:center; gap:8px; margin-left:auto; }
.user-shell-trigger { display:grid; place-items:center; width:44px; height:44px; border:0; border-radius:50%; background:var(--surface); color:var(--ink); cursor:pointer; }
.user-shell-trigger svg { width:20px; height:20px; } .user-shell-trigger path { transform-origin:center; transition:opacity .18s,transform .18s; }
.user-shell-trigger .cross { opacity:0; transform:rotate(-45deg) scale(.7); } .user-shell-trigger[aria-expanded="true"] .bars { opacity:0; transform:rotate(45deg) scale(.7); } .user-shell-trigger[aria-expanded="true"] .cross { opacity:1; transform:none; }
.user-shell-panel { position:absolute; right:0; top:52px; z-index:1003; width:min(300px,calc(100vw - 32px)); max-height:calc(100dvh - 88px); overflow:auto; padding:12px; border-radius:24px; background:var(--surface); color:var(--ink); box-shadow:0 14px 42px #0003; }
.user-shell-panel[hidden] { display:none; } .user-shell-panel:not([hidden]) { animation:user-menu-enter .22s cubic-bezier(.2,.8,.2,1); }
.user-shell-panel strong { display:block; padding:8px 12px 10px; } .user-shell-panel a { display:flex; min-height:44px; align-items:center; padding:8px 12px; border-radius:12px; color:inherit; text-decoration:none; box-sizing:border-box; }
.user-shell-panel a:hover,.user-shell-panel a:focus-visible { background:var(--accent-soft); }
.user-shell-setting { display:flex; justify-content:space-between; align-items:center; min-height:48px; gap:12px; padding:6px 12px; border-top:1px solid var(--line); font-size:13px; }
.user-shell-seg { display:flex; padding:3px; border:1px solid #bbb; border-radius:999px; background:var(--surface); }
.user-shell-seg button { display:grid; place-items:center; width:32px; height:32px; padding:0; border:0; border-radius:50%; background:transparent; color:var(--ink); font:700 12px var(--f-body); }
.user-shell-seg button[aria-pressed="true"] { background:var(--ink); color:var(--surface); } .user-shell-seg svg { width:16px; height:16px; }
.user-shell-trigger:focus-visible,.user-shell-panel a:focus-visible,.user-shell-panel button:focus-visible,.user-nav a:focus-visible { outline:3px solid #0080c7; outline-offset:2px; }
.user-nav { position:fixed; z-index:1000; bottom:calc(14px + env(safe-area-inset-bottom,0px)); left:50%; transform:translateX(-50%); }
.user-nav a { position:relative; color:var(--ink); } .user-nav a::after { content:attr(aria-label); position:absolute; bottom:calc(100% + 8px); left:50%; transform:translate(-50%,4px); opacity:0; background:var(--ink); color:var(--surface); border-radius:999px; padding:7px 10px; font:600 12px/1 var(--f-body); white-space:nowrap; pointer-events:none; }
.user-nav a.hot::after,.user-nav a:focus-visible::after { opacity:1; transform:translate(-50%,0); }
.user-nav .sidebar-brand,.user-nav .user-side-toggle { display:none; }
@media(max-width:767px) { .user-shell-panel { position:fixed; left:16px; right:16px; top:calc(72px + env(safe-area-inset-top,0px)); width:auto; } }
@media(min-width:768px) {
 .user-shell-header { margin-left:212px; padding-inline:40px; transition:margin-left .32s; }
 .user-shell-logo { visibility:hidden; } .user-side-mini .user-shell-header { margin-left:80px; }
 .user-nav .sidebar-brand { display:block; position:absolute; left:28px; top:24px; font:22px/1.6 "Homemade Apple",cursive; }
 .user-nav a::after,.user-nav a.hot::after,.user-nav a:focus-visible::after { position:static; opacity:1; transform:none; padding:0; background:none; color:inherit; font:500 15px var(--f-body); }
 .user-nav a svg { width:20px; height:20px; flex:none; } .user-nav::after { content:"CafeNote / 2026"; position:absolute; left:32px; bottom:43px; font-size:11px; }
 .user-side-toggle svg { width:18px; height:18px; transition:transform .32s; } .user-side-mini .sidebar-brand,.user-side-mini .user-nav::after,.user-side-mini .user-nav a::after { display:none; } .user-side-mini .user-side-toggle svg { transform:rotate(180deg); }
 body[data-user-page="profile"] .wrap, body[data-user-page="explore"] main { margin-left:212px; max-width:none; padding-inline:40px; transition:margin-left .32s; }
 body[data-user-page].user-side-mini .wrap,body[data-user-page].user-side-mini main { margin-left:80px; }
}
@media(prefers-reduced-motion:reduce) { .user-shell-trigger path,.user-shell-header,.user-nav { transition:none; } .user-shell-panel:not([hidden]) { animation:none; } }

.user-shell-panel .acct{margin:8px 0 0;gap:12px}.user-shell-panel .acct[hidden],.user-shell-panel .acct div[hidden]{display:none}.user-shell-panel .acct h2{font-size:14px;margin:8px 12px}.user-shell-panel .acct ul{display:grid;grid-template-columns:1fr;gap:2px}.user-shell-panel .acct a,.user-shell-panel .acct button{min-height:44px;padding:8px 12px;font-size:14px}.user-shell-panel .acct button#acctOut{display:flex;align-items:center;gap:10px;width:100%;border:0;border-radius:999px;background:var(--ink);color:var(--surface);font:600 14px var(--f-body);box-shadow:none;cursor:pointer;transition:opacity .18s,transform .18s}.user-shell-panel .acct button#acctOut:hover{opacity:.88}.user-shell-panel .acct button#acctOut:active{transform:scale(.98)}.user-shell-panel .acct button#acctOut svg{width:18px;height:18px;flex:none}

.user-notification-link{display:grid;place-items:center;width:44px;height:44px;flex:none;margin-left:auto;margin-right:8px;border-radius:50%;background:var(--surface);color:var(--ink);text-decoration:none}.user-notification-link svg{width:20px;height:20px}.user-notification-link:focus-visible{outline:3px solid #0080c7;outline-offset:2px}

.user-shell-header::after{content:"";position:absolute;top:100%;left:0;right:0;height:24px;background:linear-gradient(to bottom,var(--bg),transparent);pointer-events:none}

@media(max-width:767px){body[data-user-page="profile"] .wrap{padding-top:0}}

/* Feedback for the shared appearance and language controls. */
.user-shell-seg button{cursor:pointer;transition:background-color .2s,color .2s,transform .16s cubic-bezier(.2,.8,.2,1)}
.user-shell-seg button:active{transform:scale(.88)}
.user-shell-seg button:focus-visible{outline:2px solid #0080c7;outline-offset:2px}
@media(prefers-reduced-motion:reduce){.user-shell-seg button{transition:none}.user-shell-seg button:active{transform:none}}

.user-shell-header .user-notification-link{margin:0}
.user-shell-header .user-store-link{display:grid;place-items:center;width:44px;height:44px;flex:none;border-radius:50%;background:var(--surface);color:var(--ink);text-decoration:none}
.user-shell-header .user-store-link svg{width:20px;height:20px}
.user-shell-header .user-store-link:focus-visible{outline:3px solid #0080c7;outline-offset:2px}

@media(min-width:768px){.user-side-mini .user-shell-logo{visibility:visible}}

/* Shared shell for user tools. */
@media(min-width:768px){body[data-user-page="tool"] .wrap,body[data-user-page="tool"] .doc{max-width:none;margin-left:212px;margin-right:0;padding-left:40px;padding-right:40px;transition:margin-left .32s}body[data-user-page="tool"].user-side-mini .wrap,body[data-user-page="tool"].user-side-mini .doc{margin-left:80px}}
body[data-user-page="tool"] .wrap>.top,body[data-user-page="tool"] .doc>.back{display:none}
@media(max-width:767px){body[data-user-page="tool"] .wrap,body[data-user-page="tool"] .doc{padding-bottom:110px}}

/* Shared navigation and calm reading surfaces on legal pages. */
body[data-user-page="legal"]{background-image:none}body[data-user-page="legal"] .doc{max-width:900px;padding:24px 20px 110px}body[data-user-page="legal"] .doc>.back{display:none}body[data-user-page="legal"] .doc a{color:var(--ink);text-underline-offset:3px}body[data-user-page="legal"] .doc table{border-radius:12px}body[data-user-page="legal"] .qa{margin:12px 0;border-radius:18px;box-shadow:none;background:var(--surface)}
@media(min-width:768px){body[data-user-page="legal"] .doc{max-width:none;margin-left:212px;padding-left:40px;padding-right:40px;transition:margin-left .32s}body[data-user-page="legal"].user-side-mini .doc{margin-left:80px}body[data-user-page="legal"] .doc>div,body[data-user-page="legal"] .doc>#list,body[data-user-page="legal"] .doc>p,body[data-user-page="legal"] .doc>h1{max-width:860px}}
