#account-dialog.account-bubble{position:fixed;inset:auto;left:var(--account-left,12px);top:var(--account-top,72px);margin:0;width:390px;max-width:calc(100vw - 24px);max-height:none;padding:0;border:1px solid #dce5d6;border-radius:14px;background:#fafbf7;box-shadow:0 12px 40px #173e3026;overflow:visible;z-index:1000;animation:account-bubble-in .14s ease-out}
#account-dialog.account-bubble::before{content:'';position:absolute;top:-6px;left:calc(var(--account-arrow,350px) - 6px);width:10px;height:10px;background:white;border-left:1px solid #dce5d6;border-top:1px solid #dce5d6;transform:rotate(45deg)}
#account-dialog.account-bubble .account-head{padding:14px 18px;border-radius:14px 14px 0 0;font-size:14px}
#account-dialog.account-bubble .account-head button{padding:4px 7px;font-size:18px;line-height:1}
#account-dialog.account-bubble .account-body{padding:18px;max-height:calc(var(--account-height,70vh) - 57px);overflow:auto;overscroll-behavior:contain;border-radius:0 0 14px 14px}
#account-dialog.account-bubble .account-balance{gap:6px;font-size:12px}
#account-dialog.account-bubble .account-balance strong{font-size:38px}
#account-dialog.account-bubble .account-body>p{font-size:12px;line-height:1.7}
#account-dialog.account-bubble .account-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#account-dialog.account-bubble .account-actions button{padding:9px 10px;font-size:12px}
#account-dialog.account-bubble .account-rules{margin-top:16px}
#account-dialog.account-bubble .account-plan-grid{grid-template-columns:1fr}
@keyframes account-bubble-in{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){#account-dialog.account-bubble{animation:none}}

/* The account bubble is a short navigation menu; forms and history use modals. */
#account-dialog.account-bubble{width:320px;box-sizing:border-box}
#account-dialog.account-bubble .account-body{padding:14px;box-sizing:border-box}
#account-dialog.account-bubble .account-head{padding:12px 16px}
.account-identity{display:flex;align-items:center;gap:11px;padding:2px 3px 14px;min-width:0}
.account-avatar{display:grid;place-items:center;width:38px;height:38px;flex:none;border-radius:12px;background:#e2eddf;color:#205c4f;font-size:17px;font-weight:600}
.account-identity>div{min-width:0}.account-identity b{display:block;font-size:14px}.account-identity small{display:block;font-size:11px;color:#7c8978;margin-top:4px;overflow-wrap:anywhere}
.account-credit-card{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#edf3e8;border:1px solid #e0e9d8;border-radius:10px;padding:12px 14px;margin-bottom:10px;font-size:11px;color:#71846b}
.account-credit-card strong{display:block;font-size:25px;font-weight:600;color:#205c4f;margin-top:3px;line-height:1.2}
.account-plan-tag{font-size:10px;background:white;border-radius:20px;padding:5px 9px;color:#426645;white-space:nowrap}
.account-menu{display:flex;flex-direction:column;gap:3px}
#account-dialog .account-menu-item{display:flex;align-items:center;gap:11px;width:100%;min-height:56px;box-sizing:border-box;border:0;background:transparent;padding:9px 10px;text-align:left;transform:none;box-shadow:none;border-radius:8px;line-height:1.4;white-space:normal}
#account-dialog .account-menu-item:hover{background:#eaf1e6;transform:none}
.account-menu-icon{width:24px;flex:none;text-align:center;font-size:19px;color:#648265}
.account-menu-item>span:nth-child(2){flex:1;min-width:0}.account-menu-item b{display:block;font-size:12px;font-weight:500}.account-menu-item small{display:block;font-size:10px;color:#85907e;margin-top:3px}.account-menu-item>span:last-child{font-size:18px;color:#9ba797}
.account-verified{font-size:10px;color:#6e8963;padding:2px 11px;margin:8px 0}
#account-dialog .account-menu-logout{width:100%;margin-top:8px;padding:10px;border:0;border-top:1px solid #e1e8dc;border-radius:0;background:transparent;text-align:left;font-size:11px;color:#8b6156;transform:none}
#account-dialog.account-bubble #account-message:empty{display:none}
#account-dialog.account-sheet{position:fixed;inset:0;margin:auto;width:480px;max-width:calc(100vw - 32px);height:fit-content;max-height:calc(100dvh - 40px);padding:0;border:1px solid #dce5d6;border-radius:16px;overflow:hidden;background:#fafbf7;box-shadow:0 22px 80px #173e3033;box-sizing:border-box}
#account-dialog.account-sheet-wide{width:780px}
#account-dialog.account-sheet .account-head{padding:18px 24px;gap:20px;font-size:16px;min-height:62px;box-sizing:border-box}
#account-dialog.account-sheet .account-head button{padding:4px 8px;line-height:1;font-size:20px;flex:none;transform:none}
#account-dialog.account-sheet .account-body{padding:22px 24px;max-height:calc(100dvh - 104px);overflow:auto;box-sizing:border-box;overscroll-behavior:contain}
#account-dialog.account-sheet .account-body>button,#account-dialog.account-sheet form>button{margin-top:12px;margin-bottom:6px;position:static;transform:none}
#account-dialog.account-sheet form{display:flex;flex-direction:column;gap:8px}
#account-dialog.account-sheet form label{margin:8px 0;line-height:1.6}
#account-dialog.account-sheet input{box-sizing:border-box;min-width:0;font-size:14px}
#account-dialog.account-sheet .account-plan-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
#account-dialog.account-sheet .account-plan-grid button{white-space:normal;min-width:0;transform:none;gap:14px;line-height:1.6;padding:18px 14px;border-radius:10px}
.account-table-scroll{overflow-x:auto;border:1px solid #e0e7d9;border-radius:10px;margin-top:12px}
#account-dialog .account-table-scroll table{font-size:12px;width:100%;min-width:540px;border-collapse:collapse}
#account-dialog .account-table-scroll th{background:#edf3e9;padding:12px 14px;text-align:left;font-weight:500;color:#71836b;white-space:nowrap}
#account-dialog .account-table-scroll td{padding:14px;border-bottom:1px solid #e6ebdf;line-height:1.6;vertical-align:middle;word-break:normal}
#account-dialog .account-table-scroll td:first-child{font-size:11px;white-space:nowrap;color:#7f8e78}
.account-amount{font-variant-numeric:tabular-nums;white-space:nowrap}
.account-current-summary{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:#edf4e8;border:1px solid #d4e3ca;border-radius:10px;padding:14px 16px;color:#205c4f;font-size:12px}
.account-current-summary b{font-size:16px}.account-current-summary small{margin-left:auto;color:#77896c;font-size:11px}
#account-dialog .account-plan-grid .account-active-plan{opacity:1;cursor:default;border:2px solid #5b8866;background:#f1f7ec;box-shadow:none}
.account-plan-action{display:block;align-self:stretch;text-align:center;border-radius:7px;background:#edf3e8;color:#41694a;padding:9px;font-size:12px;margin-top:auto}
.account-active-plan .account-plan-action{background:#205c4f;color:white}
header .account-button.is-signed-in{display:inline-flex;align-items:center;gap:9px;max-width:280px;padding:5px 9px 5px 5px;min-height:40px;border:1px solid #dce7d6;border-radius:24px;background:#ffffffb3;color:#365a45;box-shadow:0 2px 5px #284d3810;overflow:visible;line-height:1;transition:background .18s,border-color .18s,box-shadow .18s;transform:none}
header .account-button.is-signed-in:hover,header .account-button.is-signed-in[aria-expanded=true]{background:white;border-color:#a7c29c;box-shadow:0 3px 12px #284d3818;transform:none}
.account-trigger-avatar{display:grid;place-items:center;width:29px;height:29px;flex:none;border-radius:50%;background:linear-gradient(135deg,#285f4d,#598268);color:#f3f8eb;font-size:12px;font-weight:600;box-shadow:inset 0 0 0 1px #ffffff26}
.account-trigger-name{max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500}
.account-trigger-credits{display:inline-flex;align-items:center;gap:4px;padding:6px 8px;border-radius:12px;background:#eaf1e3;color:#5e794e;font-size:10px;font-variant-numeric:tabular-nums;white-space:nowrap}
.account-trigger-credits>span{color:#91a16b;font-size:10px}.account-trigger-chevron{font-size:13px;color:#8c9c82;transition:transform .18s}.account-button[aria-expanded=true] .account-trigger-chevron{transform:rotate(180deg)}
#account-dialog:not(.account-bubble){top:max(12px,6dvh);bottom:auto;margin-top:0;max-height:88dvh}
#account-dialog.account-sheet .account-body{max-height:calc(88dvh - 64px)}
#account-dialog[data-view=ledger] #account-table,#account-dialog[data-view=orders] #account-table{min-height:min(520px,55dvh)}
#topup-packs{min-height:190px}
@media(max-width:600px){header .account-button.is-signed-in{gap:6px;padding-right:7px;min-height:36px;max-width:210px}.account-trigger-avatar{width:26px;height:26px}.account-trigger-name{max-width:64px;font-size:11px}.account-trigger-credits{padding:5px 6px;font-size:9px}}
.account-pagination{display:flex;justify-content:flex-end;align-items:center;gap:14px;margin-top:16px;font-size:12px}
.account-pagination button{padding:8px 14px;font-size:12px;transform:none}.account-pagination button:disabled{opacity:.4;cursor:default}
.account-history-note,.account-empty{font-size:12px;color:#809078;line-height:1.7}.account-empty{padding:45px 10px;text-align:center}
header .navright{gap:12px;flex-shrink:0}header nav{min-width:0}header .account-button{flex:none}
@media(max-width:1100px){header{padding-left:22px;padding-right:22px;gap:20px}header nav{gap:16px}header .navright{gap:8px}header .navright>.plain{display:none}}
@media(max-width:600px){#account-dialog.account-sheet{max-width:calc(100vw - 20px);max-height:calc(100dvh - 24px)}#account-dialog.account-sheet .account-body{padding:18px;max-height:calc(100dvh - 90px)}#account-dialog.account-sheet .account-plan-grid{grid-template-columns:1fr}.account-pagination{justify-content:space-between;gap:8px}}

/* Final account appearance shared by public pages and the editors. */
#site-header .account-button.is-signed-in{background:#ffffffb3!important;border:1px solid #dce7d6!important;color:#365a45!important;min-height:40px!important;padding:5px 9px 5px 5px!important;gap:9px!important;line-height:1!important;border-radius:24px!important}
#account-dialog{color:var(--ink)!important;font-family:Inter,system-ui,sans-serif!important}
#account-dialog.account-bubble{background:#fafbf7!important;border-color:#dce5d6!important}
#account-dialog.account-bubble .account-head{background:#fff!important;color:#182a2a!important;border-bottom:1px solid #e1e8da!important}
#account-dialog.account-bubble .account-head button{display:inline-flex;align-items:center;justify-content:center;border:0!important;background:transparent!important;color:inherit!important;padding:4px 7px!important;border-radius:7px!important;font-size:18px!important}
#account-dialog .account-menu-item{background:transparent!important;border:0!important;padding:9px 10px!important;color:var(--ink)!important;box-shadow:none!important;text-align:left!important}
#account-dialog .account-menu-item:hover{background:#eaf1e6!important}
#account-dialog .account-menu-logout{background:transparent!important;border:0!important;border-top:1px solid var(--line)!important;border-radius:0!important;padding:10px!important;color:#a87868!important;font-size:11px!important;text-align:left!important}
#account-dialog .account-credit-card{background:#edf3e8!important;border:1px solid #e0e9d8!important;color:#71846b!important}
#account-dialog .account-credit-card strong{color:#205c4f!important}
#account-dialog .account-plan-tag{background:#fff!important;color:#426645!important}
html[data-theme=dark] #site-header .account-button.is-signed-in{background:var(--ui-subtle)!important;border-color:var(--ui-border)!important;color:var(--ui-text)!important}
html[data-theme=dark] #site-header .account-trigger-avatar{background:var(--ui-selected)!important;color:var(--ui-accent)!important}
html[data-theme=dark] #site-header .account-trigger-credits{background:var(--ui-selected)!important;color:var(--ui-accent)!important}
html[data-theme=dark] #account-dialog,html[data-theme=dark] #account-dialog.account-bubble,html[data-theme=dark] #account-dialog .account-body{background:var(--ui-workspace)!important;border-color:var(--ui-border)!important;color:var(--ui-text)!important}
html[data-theme=dark] #account-dialog.account-bubble::before{background:var(--ui-workspace)!important;border-color:var(--ui-border)!important}
html[data-theme=dark] #account-dialog .account-head{background:var(--ui-workspace)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
html[data-theme=dark] #account-dialog .account-head button{background:var(--ui-subtle)!important;color:var(--ui-text)!important}
html[data-theme=dark] #account-dialog .account-menu-item:hover{background:#29372d!important}
html[data-theme=dark] #account-dialog .account-identity b{color:var(--ui-text)!important}
html[data-theme=dark] #account-dialog .account-menu-item b{color:var(--ui-text)!important}
html[data-theme=dark] #account-dialog :is(.account-identity small,.account-menu-item small){color:#a4afa7!important}
#account-dialog{font-size:14px!important}#account-dialog .account-menu-item{font-family:Inter,system-ui,sans-serif!important;font-size:12px!important}

/* Reserve the account slot from the first server-rendered frame. */
#site-header .account-button.account-loading{display:inline-flex!important;align-items:center;justify-content:flex-start;gap:9px!important;box-sizing:border-box;width:164px;min-height:40px!important;padding:5px 9px 5px 5px!important;border:1px solid var(--ui-border,var(--line))!important;border-radius:24px!important;background:var(--ui-workspace,var(--bg))!important;opacity:1;cursor:default;transition:none!important}
.account-placeholder-avatar{width:29px;height:29px;flex:none;border-radius:50%;background:var(--ui-selected,var(--soft))}.account-placeholder-line{width:85px;height:10px;border-radius:6px;background:var(--ui-subtle,var(--soft))}
@media(max-width:600px){#site-header .account-button.account-loading{width:130px}}

.auth-google{display:flex;justify-content:center;margin:0 0 20px}.auth-google>button{width:100%;min-height:44px;display:flex;align-items:center;justify-content:center;gap:10px}.auth-google>button::before{content:"G";font-size:20px;font-weight:600}.auth-google>div{max-width:100%}

.auth-google-note{font-size:12px;color:var(--muted);line-height:1.6;margin:-10px 0 18px;text-align:center}.auth-google>button:disabled{cursor:wait}

/* All account flows use one viewport-centered modal geometry. */
html[data-theme] body #account-dialog{position:fixed!important;inset:0!important;margin:auto!important;transform:none!important;box-sizing:border-box;width:min(500px,calc(100vw - 32px));height:fit-content;max-width:calc(100vw - 32px)!important;max-height:calc(100dvh - 40px)!important;padding:0;border:1px solid var(--ui-border)!important;border-radius:16px;background:var(--ui-workspace)!important;color:var(--ui-text)!important;overflow:hidden;animation:none!important}
html[data-theme] body #account-dialog.account-sheet-wide{width:860px}
html[data-theme] body #account-dialog[data-view=profile]{width:480px}
html[data-theme] body #account-dialog.auth-layout{width:840px;overflow:auto}
html[data-theme] body #account-dialog.auth-layout[open]{grid-template-columns:36% minmax(0,1fr);align-items:stretch}
html[data-theme] body #account-dialog::before{display:none!important}
html[data-theme] body #account-dialog::backdrop{background:color-mix(in srgb,var(--ui-text) 42%,transparent);backdrop-filter:blur(4px)}
html[data-theme] body #account-dialog .account-head{min-height:64px;box-sizing:border-box;padding:16px 24px;gap:16px;border-bottom:1px solid var(--ui-border)!important;background:var(--ui-workspace)!important;color:var(--ui-text)!important}
html[data-theme] body #account-dialog .account-head button,html[data-theme] body #account-dialog .auth-topline #account-close{display:grid;place-items:center;width:34px;height:34px;min-height:34px;padding:0!important;border:0!important;border-radius:8px;background:var(--ui-subtle)!important;color:var(--ui-text)!important;flex:none}
html[data-theme] body #account-dialog.account-sheet .account-body{padding:24px;max-height:calc(100dvh - 104px);overflow:auto;overscroll-behavior:contain;background:var(--ui-workspace)!important;color:var(--ui-text)!important}
html[data-theme] body #account-dialog.account-sheet form{gap:14px}
html[data-theme] body #account-dialog.account-sheet form label{margin:0;line-height:1.6}
html[data-theme] body #account-dialog.account-sheet input{min-height:44px;padding:11px 13px;font-size:14px;border-radius:8px;background:var(--ui-field)!important;color:var(--ui-text)!important;border-color:var(--ui-field-border)!important}
html[data-theme] body #account-dialog[data-view=ledger] #account-table,html[data-theme] body #account-dialog[data-view=orders] #account-table{min-height:0;max-height:48dvh;overflow:auto}
html[data-theme] body #account-dialog .account-menu-item{min-height:58px;padding:12px;border-radius:9px;font-size:14px!important}
html[data-theme] body #account-dialog .account-menu-item:hover{background:var(--ui-subtle)!important}
html[data-theme] body #account-dialog .auth-brand-panel{padding:28px 24px;min-height:0}
html[data-theme] body #account-dialog .auth-brand-copy{padding:28px 0}
html[data-theme] body #account-dialog .auth-brand-copy h2{font-size:28px;line-height:1.5}
html[data-theme] body #account-dialog .auth-art{height:72px;margin:18px 0}
html[data-theme] body #account-dialog .auth-form-panel{padding:24px 32px;max-height:none;background:var(--ui-workspace)!important;color:var(--ui-text)!important}
html[data-theme] body #account-dialog .auth-form-title{margin:22px 0 16px}
html[data-theme] body #account-dialog .auth-form-title h2{font-size:26px;line-height:1.3;color:var(--ui-text)!important}
html[data-theme] body #account-dialog .auth-form-title p{font-size:13px;line-height:1.7;color:var(--ui-secondary)!important}
html[data-theme] body #account-dialog .auth-field{font-size:13px;margin:14px 0 0;color:var(--ui-text)!important}
html[data-theme] body #account-dialog .auth-field input{box-sizing:border-box;min-height:46px;padding:12px 14px;font-size:14px;background:var(--ui-field)!important;color:var(--ui-text)!important;border-color:var(--ui-field-border)!important}
html[data-theme] body #account-dialog .auth-password input{padding-right:64px}
html[data-theme] body #account-dialog .auth-submit{margin-top:20px;min-height:46px}
html[data-theme] body #account-dialog .auth-form-panel>#account-form+button{margin:12px 0 0;min-height:38px;border:0;background:transparent!important;color:var(--ui-secondary)!important;font-size:12px}
html[data-theme] body #account-dialog .auth-switch{margin-top:18px;font-size:13px}
html[data-theme] body #account-dialog .auth-test-note{margin-top:16px;font-size:11px;line-height:1.6}
html[data-theme] body #account-dialog .auth-google{margin:0 0 14px;width:100%;min-width:0}
html[data-theme] body #account-dialog #account-message{font-size:12px;line-height:1.7;margin:12px 0 0}
@media(max-width:700px){html[data-theme] body #account-dialog.auth-layout[open]{grid-template-columns:minmax(0,1fr)}html[data-theme] body #account-dialog .auth-brand-panel{display:none}html[data-theme] body #account-dialog.auth-layout{width:460px}html[data-theme] body #account-dialog .auth-form-panel{padding:20px 24px}html[data-theme] body #account-dialog.account-sheet .account-plan-grid{grid-template-columns:1fr}}
@media(max-width:480px){html[data-theme] body #account-dialog{max-width:calc(100vw - 20px)!important;max-height:calc(100dvh - 24px)!important;border-radius:12px}html[data-theme] body #account-dialog.account-sheet .account-body{padding:20px;max-height:calc(100dvh - 88px)}html[data-theme] body #account-dialog .account-head{padding:14px 20px}html[data-theme] body #account-dialog input{font-size:16px!important}}

/* Signed-out account entry uses the same shared controls on every page. */
html[data-theme] #site-header .account-button:not(.is-signed-in):not(.account-loading){display:inline-flex;align-items:center;justify-content:center;min-height:36px!important;padding:8px 16px;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-subtle);color:var(--ui-text);font-family:inherit;line-height:1.4;cursor:pointer}
html[data-theme] #site-header .account-button:not(.is-signed-in):hover{border-color:var(--ui-accent)}

html[data-theme] #site-header .account-button.is-signed-in:hover,html[data-theme] #site-header .account-button.is-signed-in[aria-expanded=true]{background:var(--ui-selected)!important;border-color:var(--ui-accent)!important}
html[data-theme] #site-header :is(.account-trigger-credits>span,.account-trigger-chevron){color:var(--ui-accent)}

html[data-theme] #account-dialog .auth-google{min-height:44px}html[data-theme] #account-dialog .auth-google-note{min-height:34px;box-sizing:border-box}
.auth-password [data-password-toggle]{display:grid;place-items:center;min-width:36px;min-height:36px;padding:8px!important;line-height:1}
.auth-password [data-password-toggle] svg{display:block;pointer-events:none}

html[data-theme] body #account-dialog .auth-password{position:relative}
html[data-theme] body #account-dialog .auth-password [data-password-toggle]{position:absolute;top:50%!important;right:10px!important;bottom:auto!important;transform:translateY(-50%)!important;width:36px;height:36px;min-height:36px;margin:0!important;padding:7px!important;border:0!important;border-radius:6px;background:transparent!important;color:var(--ui-text-muted,var(--muted));box-shadow:none!important;display:grid;place-items:center}
html[data-theme] body #account-dialog .auth-password [data-password-toggle]:hover{color:var(--ui-accent)}
html[data-theme] body #account-dialog .account-menu-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 24px;color:var(--ui-accent);line-height:1}html[data-theme] body #account-dialog .account-menu-icon svg{display:block;width:20px;height:20px;flex:none;color:inherit}
/* Account surfaces follow the shared palette in every theme. */
html[data-theme] body #account-dialog{background:var(--ui-workspace)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
html[data-theme] body #account-dialog :is(.account-test,.account-current-plan,.account-credit-card){background:var(--ui-subtle)!important;border:1px solid var(--ui-border)!important;color:var(--ui-secondary)!important}
html[data-theme] body #account-dialog :is(.account-credit-card strong,.account-current-plan b,.account-current-plan strong){color:var(--ui-accent)!important}
html[data-theme] body #account-dialog :is(.account-plan-grid>button,.account-pack-grid>button){background:var(--ui-surface)!important;border:1px solid var(--ui-border)!important;color:var(--ui-text)!important;box-shadow:none!important}
html[data-theme] body #account-dialog .account-plan-grid>.account-active-plan{background:var(--ui-surface)!important;border:2px solid var(--ui-accent)!important;opacity:1!important}
html[data-theme] body #account-dialog :is(.account-plan-grid,.account-pack-grid) :is(b,strong){color:var(--ui-text)!important}
html[data-theme] body #account-dialog :is(.account-plan-grid,.account-pack-grid) :is(small,span):not(.account-plan-action){color:var(--ui-secondary)!important}
html[data-theme] body #account-dialog .account-plan-action{background:var(--ui-action-surface)!important;color:var(--ui-action-text)!important}
html[data-theme] body #account-dialog .account-active-plan .account-plan-action{background:var(--ui-selected)!important;color:var(--ui-accent)!important}
html[data-theme] body #account-dialog :is(.account-plan-grid,.account-pack-grid)>button:disabled:not(.account-active-plan){opacity:.6;cursor:not-allowed}
html[data-theme] body #account-dialog :is(.account-plan-tag,.account-verified){background:transparent!important;color:var(--ui-accent)!important}
html[data-theme] body #account-dialog :is(.account-plan-features,.account-rules,.small){color:var(--ui-secondary)!important}
html[data-theme] body #account-dialog :is(.account-head,.account-rules){border-color:var(--ui-border)!important}
html[data-theme] body #account-dialog .account-current-summary{background:var(--ui-subtle)!important;border:1px solid var(--ui-border)!important;color:var(--ui-accent)!important}html[data-theme] body #account-dialog .account-current-summary small{color:var(--ui-secondary)!important}

/* Action labels must override muted card metadata in both themes. */
html[data-theme] body #account-dialog :is(.account-plan-grid,.account-pack-grid) .account-plan-action{background:var(--ui-action-surface)!important;color:var(--ui-action-text)!important}
html[data-theme] body #account-dialog .account-plan-grid .account-active-plan .account-plan-action{background:var(--ui-selected)!important;color:var(--ui-accent)!important}

/* Shared account tables and scroll surfaces follow the active theme. */
html[data-theme] body #account-dialog .account-table-scroll{border-color:var(--ui-border);background:var(--ui-surface)}
html[data-theme] body #account-dialog .account-table-scroll th{background:var(--ui-subtle);color:var(--ui-secondary);border-bottom:1px solid var(--ui-border)}
html[data-theme] body #account-dialog .account-table-scroll td{background:var(--ui-surface);color:var(--ui-text);border-bottom:1px solid var(--ui-border)}
html[data-theme] body #account-dialog .account-table-scroll td:first-child{color:var(--ui-secondary)}
html[data-theme] body #account-dialog .account-table-scroll tr:last-child td{border-bottom:0}
html[data-theme] body #account-dialog .account-table-scroll tbody tr:hover td{background:var(--ui-subtle)}
html[data-theme] body #account-dialog,html[data-theme] body #account-dialog *{scrollbar-width:thin;scrollbar-color:var(--ui-border) var(--ui-workspace)}
html[data-theme] body #account-dialog ::-webkit-scrollbar{width:8px;height:8px}
html[data-theme] body #account-dialog ::-webkit-scrollbar-track{background:var(--ui-workspace)}
html[data-theme] body #account-dialog ::-webkit-scrollbar-thumb{background:var(--ui-border);border:2px solid var(--ui-workspace);border-radius:8px}
html[data-theme] body #account-dialog ::-webkit-scrollbar-thumb:hover{background:var(--ui-accent)}
html[data-theme] body #account-dialog ::-webkit-scrollbar-button{display:none;width:0;height:0}
html[data-theme] body #account-dialog ::-webkit-scrollbar-corner{background:var(--ui-workspace)}
/* History uses pagination rather than a nested vertical scroll area. */
html[data-theme] body #account-dialog:is([data-view=ledger],[data-view=orders]) .account-head{min-height:54px;padding:10px 20px}
html[data-theme] body #account-dialog:is([data-view=ledger],[data-view=orders]) .account-body{padding:16px 20px}
html[data-theme] body #account-dialog:is([data-view=ledger],[data-view=orders]) .account-body>h3{margin:0 0 10px;font-size:18px}
html[data-theme] body #account-dialog:is([data-view=ledger],[data-view=orders]) #account-table{max-height:none;overflow:visible}
html[data-theme] body #account-dialog .account-history-note{margin:6px 0 10px;font-size:12px}
html[data-theme] body #account-dialog .account-table-scroll th{padding:9px 12px}
html[data-theme] body #account-dialog .account-table-scroll td{padding:8px 12px;line-height:1.5}
html[data-theme] body #account-dialog .account-pagination{margin-top:12px;gap:12px}
html[data-theme] body #account-dialog .account-pagination button{min-height:34px;padding:6px 12px}
html[data-theme] body #account-dialog .legal-accept{display:flex;align-items:flex-start;gap:10px;font-size:13px;line-height:1.7;margin:16px 0}
html[data-theme] body #account-dialog .legal-accept input{flex:0 0 18px;width:18px;height:18px;min-height:0;padding:0;margin:4px 0 0}
.resource-footer>nav{padding:18px 24px;line-height:2;font-size:13px}
.policy-page{overflow-wrap:anywhere}
.policy-page>nav{display:flex;flex-wrap:wrap;gap:8px 14px;font-size:14px;line-height:1.8}
.policy-page section:last-of-type p:has(button){display:inline-flex;margin:6px 8px 6px 0;max-width:100%}
.policy-page [data-legal-support]{appearance:none;display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 18px;font:inherit;font-size:14px;font-weight:600;line-height:1.5;white-space:normal;border:1px solid var(--ui-border);border-radius:var(--ui-radius);background:var(--ui-subtle);color:var(--ui-text);cursor:pointer}
.policy-page [data-legal-support]:hover{background:var(--ui-selected);border-color:var(--ui-accent)}
.policy-page [data-legal-support]:focus-visible{outline:2px solid var(--ui-accent);outline-offset:3px}

/* Authentication page: reuse the modal's form without an overlay or fixed sizing. */
html[data-auth-page] #site-home,
html[data-auth-page] #studio,
html[data-auth-page] .feature-page { display: none !important; }
html[data-auth-page] body { min-height: 100dvh; display: flex; flex-direction: column; }
html[data-auth-page] #site-header { position: relative; }
html[data-auth-page] #account-dialog[open] {
 position: relative; inset: auto; transform: none; animation: none;
 margin: 40px auto; width: min(840px, calc(100% - 32px));
 max-height: none; height: auto; min-height: 0; flex: 0 0 auto;
}
html[data-auth-page] #site-footer { margin-top: auto; order: 10; }
@media(max-width: 640px) {
 html[data-auth-page] #account-dialog[open] { margin: 20px auto; width: calc(100% - 24px); }
}

html[data-auth-page] #account-dialog:not(.auth-layout)[open] { width: min(520px, calc(100% - 24px)); }


/* Consent hit area overlays the official Google button without adding UI. */
html[data-theme] body #account-dialog .auth-google{position:relative!important}
html[data-theme] body #account-dialog .auth-google>button.auth-google-consent-guard{position:absolute!important;inset:0!important;z-index:3!important;display:block!important;width:100%!important;height:100%!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;transform:none!important;color:transparent!important}
html[data-theme] body #account-dialog .auth-google>button.auth-google-consent-guard::before,html[data-theme] body #account-dialog .auth-google>button.auth-google-consent-guard::after{content:none!important;display:none!important}
html[data-theme] body #account-dialog .auth-google>button.auth-google-consent-guard[hidden]{display:none!important}

/* Standalone auth keeps the shared card in document flow, outside modal positioning. */
html[data-auth-page] body #account-dialog[open]{position:relative!important;inset:auto!important;top:auto!important;left:auto!important;transform:none!important;margin:40px auto!important;width:min(840px,calc(100% - 32px))!important;height:auto!important;min-height:0!important;max-height:none!important;flex:0 0 auto!important;overflow:visible!important;animation:none!important;z-index:1!important}
html[data-auth-page] body #account-dialog .account-body{height:auto!important;max-height:none!important;overflow:visible!important}
html[data-auth-page] body #site-header{position:relative!important;flex-shrink:0}
html[data-auth-page] body #site-footer{position:relative!important;flex-shrink:0}
@media(max-width:640px){html[data-auth-page] body #account-dialog[open]{margin:24px auto!important;width:calc(100% - 24px)!important}}

#account-dialog .account-profile-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:18px;padding-top:14px;border-top:1px solid var(--ui-border)}
html[data-theme] body #account-dialog .account-profile-footer>#account-logout,html[data-theme] body #account-dialog .account-profile-footer>.account-delete-entry>a{display:inline-flex;align-items:center;justify-content:center;width:auto;min-height:38px;margin:0!important;padding:8px 10px!important;border:0!important;border-radius:8px!important;background:transparent!important;color:var(--ui-secondary)!important;font:inherit!important;font-size:13px!important;text-decoration:none;transform:none}
#account-dialog .account-profile-footer>.account-delete-entry{margin:0;padding:0}
html[data-theme] body #account-dialog .account-profile-footer>.account-delete-entry>a{color:var(--ui-danger)!important}
html[data-theme] body #account-dialog .account-profile-footer>:is(button,p)>a:hover,html[data-theme] body #account-dialog .account-profile-footer>#account-logout:hover{background:var(--ui-subtle)!important}

.account-avatar img,.account-trigger-avatar img{width:100%;height:100%;object-fit:cover;border-radius:inherit}#profile-settings{display:grid;gap:16px}#profile-settings label{display:grid;gap:8px}#profile-settings input{width:100%;box-sizing:border-box}#profile-settings .profile-avatar{width:64px;height:64px;overflow:hidden}#profile-settings input[type=file]{font-size:12px}#profile-message{color:var(--ui-secondary);margin:0}

#profile-settings{gap:22px}#profile-settings .profile-settings-title{display:flex;align-items:center;gap:10px;margin:0 0 2px;font-size:19px}#profile-settings .profile-settings-title svg{color:var(--ui-accent);flex:none}#profile-settings .profile-avatar-row{display:flex;align-items:center;gap:18px}#profile-settings .profile-avatar{width:76px;height:76px;flex:none;border-radius:18px}#profile-settings .profile-avatar-tools{display:grid;gap:8px}#profile-settings .profile-avatar-tools>div{display:flex;flex-wrap:wrap;gap:8px}#profile-settings .profile-avatar-tools button{width:auto;min-height:32px;margin:0;padding:5px 10px;font-size:12px}#profile-settings .profile-avatar-tools small{font-size:11px;color:var(--ui-muted)}#profile-settings input[hidden]{display:none!important}#profile-settings .profile-presets>span{display:block;font-size:12px;color:var(--ui-secondary);margin-bottom:10px}#profile-settings .profile-preset-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:8px}#profile-settings .profile-preset-grid button{width:100%;min-width:0;min-height:0;aspect-ratio:1;padding:3px;margin:0;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-field)}#profile-settings .profile-preset-grid button[aria-pressed=true]{border-color:var(--ui-accent);outline:2px solid var(--ui-accent);outline-offset:1px}#profile-settings .profile-preset-grid img{display:block;width:100%;height:100%;border-radius:8px;object-fit:cover}#profile-settings .profile-save-row{display:flex;align-items:center;justify-content:flex-end;gap:16px;padding-top:16px;border-top:1px solid var(--ui-border)}#profile-settings .profile-save-row button{width:auto;min-width:120px;margin:0}#profile-settings label{font-size:13px}@media(max-width:480px){#profile-settings .profile-preset-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
