:root{font-family:Inter,"Segoe UI",Arial,sans-serif;color:#292b31;background:#fff;font-synthesis:none;--red:#e74335;--orange:#ff9841;--muted:#73757e;--line:#eae9e7;--soft:#f8f9fb;--gradient:linear-gradient(115deg,#ff4b4b,#ff9841 72%,#ffc93c)}
/* Phase 3B: PDF library. */
.doc-actions{display:flex;gap:8px;flex-wrap:wrap}.doc-filters{display:flex;gap:12px;align-items:center;margin-bottom:24px}.doc-filters input,.doc-filters select{margin:0}.doc-filters input{flex:2;min-width:0}.doc-filters select{flex:1;min-width:130px}.doc-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.doc-card{border:1px solid var(--line);border-radius:18px;padding:24px;display:flex;flex-direction:column;min-width:0;background:linear-gradient(155deg,#fff8f3,#fff 40%)}.doc-card-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:20px}.doc-file-icon{display:grid;place-items:center;width:48px;height:56px;border-radius:8px 16px 8px 8px;background:#fff0e8;color:#b93926;font-size:.8rem;font-weight:800;letter-spacing:.08em}.doc-card h2{font-size:1.2rem;line-height:1.4;overflow-wrap:anywhere;margin-bottom:10px}.doc-description{white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;flex:1}.doc-admin-actions{display:flex;gap:8px;margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}.doc-pagination{display:flex;align-items:center;justify-content:center;gap:16px;margin:28px 0}.doc-pagination span{font-size:.85rem}.doc-dialog textarea{display:block;width:100%;font:inherit;border:1px solid #dcdde2;border-radius:10px;padding:12px;margin-top:9px;resize:vertical}.doc-dialog .doc-confirm{display:flex;gap:12px;align-items:flex-start;font-weight:400;line-height:1.5}.doc-confirm input{width:20px;height:20px;min-height:20px;margin:2px 0;flex-shrink:0}.doc-dialog.doc-viewer{width:min(1100px,96vw);max-width:96vw;height:92dvh;max-height:96dvh;padding:20px}.doc-viewer[open]{display:flex;flex-direction:column;gap:12px}.doc-viewer .dialog-heading{margin:0}.doc-viewer .dialog-heading h2{font-size:1.1rem;overflow-wrap:anywhere;min-width:0}.doc-viewer p{margin:0;font-size:.8rem}.doc-viewer-area{flex:1;min-height:150px;background:#f3f3f3;border-radius:12px;overflow:hidden}.doc-viewer iframe{width:100%;height:100%;border:0;display:block}.doc-category-row{padding:14px 0;border-bottom:1px solid var(--line)}.doc-category-row .doc-actions{margin-top:8px}.doc-category-list{margin-bottom:24px}.doc-dialog .notice.info{background:#fff7ed;color:#704023}.doc-card .pill{overflow-wrap:anywhere;max-width:100%}
@media(max-width:1000px){.doc-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.doc-grid{grid-template-columns:1fr}.doc-filters{flex-wrap:wrap}.doc-filters input{flex-basis:100%}.doc-filters select{min-width:0}.doc-card{padding:20px}.doc-card>.doc-actions .button{flex:1}.doc-dialog.doc-viewer{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;padding:16px;padding-bottom:max(16px,env(safe-area-inset-bottom))}.doc-pagination{gap:8px}.doc-pagination .button{padding:10px}.doc-viewer .dialog-heading .button{flex-shrink:0}.doc-viewer .doc-actions .button{padding:10px 12px;font-size:.8rem}}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button,a{touch-action:manipulation}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.55}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #bb4c15;outline-offset:3px}h1,h2,h3,p{margin-top:0}p{line-height:1.65}h1{font-size:clamp(2rem,4vw,3.5rem);letter-spacing:-.045em;line-height:1.15}h2{font-size:1.9rem;letter-spacing:-.035em}h3{font-size:1.05rem}label{display:block;font-size:.9rem;font-weight:600;margin-bottom:20px}input,select{display:block;width:100%;min-height:48px;border:1px solid #dcdde2;border-radius:10px;background:#fff;padding:12px 14px;margin-top:9px;color:#292b31}input:disabled{background:#f2f3f5;color:#676b72}.muted{color:var(--muted)}.eyebrow{font-size:.75rem;letter-spacing:.15em;font-weight:750;color:#ad4b24;display:block;margin-bottom:18px}.brand{display:flex;align-items:center;gap:10px;font-size:1.6rem;font-weight:800;letter-spacing:-.05em}.brand img{width:56px;height:46px;object-fit:cover;border-radius:10px}.brand-sub{display:block;font-size:.6rem;letter-spacing:.15em;font-weight:650;margin-top:3px}.login-layout{min-height:100svh;display:grid;grid-template-columns:1.06fr 1fr}.login-story{position:relative;overflow:hidden;padding:48px 9%;background:linear-gradient(145deg,#fff7ec,#fff1e7 60%,#ffdfc0);display:flex;flex-direction:column;justify-content:space-between;min-height:100svh}.login-story:after{content:"";position:absolute;width:320px;height:320px;border:1px solid #eb9d6555;transform:rotate(45deg);right:-180px;top:35%;box-shadow:0 0 0 48px #ffa3450a,0 0 0 96px #ffa34508;pointer-events:none}.story-copy{margin:64px 0;position:relative;z-index:1}.story-copy h1 span{color:#d95125}.story-copy p{max-width:360px;color:#805f4c;font-size:1.05rem}.story-bottom{font-size:.85rem;color:#805f4c}.login-side{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 36px 24px;position:relative}.login-box{width:100%;max-width:380px;margin:auto}.login-box h2{margin-bottom:12px}.login-box form{margin-top:34px}.password-field{position:relative}.password-field input{padding-right:100px}.password-field button{position:absolute;right:8px;top:5px;min-height:38px;background:none;border:0;color:#6a4b40;font-size:.875rem}.button{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:46px;padding:12px 19px;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:.9rem;font-weight:650}.primary{background:var(--gradient);color:#241a16;border:0;box-shadow:0 5px 14px #ff74321b}.button:hover:not(:disabled){filter:brightness(.97)}.full{width:100%;justify-content:space-between}.form-error{color:#b32c2c;font-size:.9rem;white-space:pre-wrap}.form-error:empty{display:none}.login-help{margin-top:24px;text-align:center;font-size:.85rem;color:var(--muted)}footer{font-size:.8rem;color:var(--muted);padding-top:36px;text-align:center}footer img{width:28px;height:24px;object-fit:cover;vertical-align:middle;margin-right:8px}@media(max-width:760px){.login-layout{display:block}.login-story{min-height:auto;padding:26px 24px 30px}.story-copy{margin:32px 0 0}.story-copy h1{font-size:2rem}.story-copy h1 br{display:none}.story-copy p,.story-bottom{display:none}.login-side{padding:36px 24px 24px;min-height:60svh}.login-box{max-width:420px}.login-box h2{font-size:1.65rem}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
.button svg,svg{width:21px;height:21px;flex-shrink:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.skip-link{position:fixed;top:-100px;left:16px;z-index:1000;padding:12px;background:#fff}.skip-link:focus{top:10px}.small{font-size:.875rem}.topbar{height:88px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:24px;padding:0 max(28px,calc((100vw - 1240px)/2));background:#fff}.topbar .brand{font-size:1.35rem}.topbar .brand img{width:48px;height:40px}.desktop-nav{display:flex;height:100%;gap:7px;align-items:center}.desktop-nav a{display:flex;gap:7px;align-items:center;padding:13px 12px;border-radius:10px;color:#646770;font-size:.9rem;font-weight:550}.desktop-nav a svg{width:18px;height:18px}.desktop-nav a.active{background:#fff0e7;color:#b54824}.desktop-nav a:hover{background:#f7f7f8}.account{position:relative;flex-shrink:0}.account summary{display:flex;align-items:center;gap:10px;cursor:pointer;font-size:.9rem;list-style:none}.account summary::-webkit-details-marker{display:none}.avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:50%;background:#f9eadf;color:#ad512e;font-size:.95rem;font-weight:700}.account-name{max-width:110px;overflow:hidden;text-overflow:ellipsis}.account-menu{position:absolute;right:0;top:52px;min-width:240px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px;z-index:50;box-shadow:0 10px 35px #24242412}.account-menu p{font-size:.8rem;margin:0 0 10px}.account-menu a{display:flex;align-items:center;gap:10px;padding:12px 0;font-size:.9rem}.account-menu button{width:100%;margin-top:8px}.content{max-width:1240px;margin:0 auto;padding:40px 28px 20px;min-height:calc(100svh - 180px);outline:none}.site-footer{padding:0 20px 24px}.site-footer footer{padding-top:22px}.bottom-nav{display:none}.welcome{background:linear-gradient(110deg,#fff6ec,#fff8f4 60%,#ffecd4);border:1px solid #ffe8d5;border-radius:24px;padding:42px;position:relative;overflow:hidden;min-height:306px}.welcome>div:first-child{position:relative;z-index:1;max-width:720px}.welcome .eyebrow{font-size:.75rem;text-transform:uppercase;letter-spacing:.09em}.welcome h1{font-size:2.65rem;max-width:750px;margin-bottom:18px}.welcome h1 span{font-weight:450;color:#744e3d}.welcome p{font-size:.95rem;color:#805f4c;max-width:520px;margin-bottom:24px}.geometric{position:absolute;width:260px;height:260px;right:-45px;top:30px;transform:rotate(30deg);opacity:.6}.geometric div{position:absolute;width:180px;height:180px;border:1px solid #eab283;transform:rotate(15deg);border-radius:20px;background:linear-gradient(45deg,#ffc95325,#ff805012)}.geometric div:nth-child(2){transform:translate(-45px,45px) rotate(15deg)}.geometric div:nth-child(3){transform:translate(-90px,90px) rotate(15deg)}.section-title{display:flex;align-items:center;justify-content:space-between;margin:38px 0 20px}.section-title h2{font-size:1.35rem;margin:0}.section-title>span{font-size:.875rem}.quick-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}.quick-card{position:relative;padding:24px 22px;border:1px solid var(--line);border-radius:16px;transition:transform .18s,border-color .18s;min-height:218px}.quick-card:hover{transform:translateY(-3px);border-color:#ffb57c}.icon-tile{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:14px;background:#fff0e6;color:#c15a2b;margin-bottom:22px}.quick-card:nth-child(2) .icon-tile{background:#fff7dd;color:#976c1d}.quick-card h3{margin-bottom:10px}.quick-card p{font-size:.9rem;margin-bottom:18px}.card-arrow{display:flex;justify-content:flex-end;color:#ad6144}.card-arrow svg{width:19px}.info-strip{margin-top:26px;display:flex;align-items:center;gap:18px;padding:22px 26px;background:var(--soft);border-radius:14px}.info-strip>svg{color:#8a8c94;width:26px;height:26px}.info-strip h3{font-size:.9rem;margin-bottom:3px}.info-strip p{font-size:.875rem;margin:0}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:4px 0 30px}.page-heading h1{font-size:2rem;margin-bottom:10px}.page-heading p{margin:0;font-size:.95rem}.page-heading>.button{flex-shrink:0}.calculator-panel{display:grid;grid-template-columns:1fr 1.1fr;border:1px solid var(--line);border-radius:22px;overflow:hidden;max-width:1000px}.calculator-input{padding:38px}.calculator-input h2{font-size:1.5rem}.calculator-input input{font-size:2rem;font-weight:650;padding:16px}.calculator-input p{font-size:.875rem}.calculator-result{padding:48px 38px;background:linear-gradient(130deg,#fff4e8,#ffeadb);display:flex;flex-direction:column;justify-content:center;align-items:flex-start;min-width:0}.calculation-value{display:block;font-size:clamp(2rem,4vw,3.2rem);font-weight:750;letter-spacing:-.04em;color:#b64622;overflow-wrap:anywhere;max-width:100%;margin:12px 0 28px}.rate-pill{border:1px solid #edc7aa;padding:8px 12px;border-radius:8px;font-size:.9rem;color:#92502e;margin-bottom:20px}.calculator-result p{font-size:.9rem;margin-bottom:8px}.calculator-result .eyebrow{margin:0}.empty-panel{min-height:400px;border:1px solid var(--line);border-radius:20px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:48px 24px;background:radial-gradient(ellipse at 50% 0,#fff8ef,white 65%)}.empty-icon{width:76px;height:76px;border-radius:24px;display:flex;align-items:center;justify-content:center;color:#c36933;background:#ffefe0;margin-bottom:20px}.empty-icon svg{width:32px;height:32px}.empty-panel h2{font-size:1.4rem;margin:20px 0 10px}.empty-panel p{max-width:460px;margin:0 0 10px}.pill{display:inline-flex;align-items:center;border-radius:6px;padding:5px 9px;font-size:.8rem;font-weight:550;white-space:nowrap}.neutral{background:#f0f1f4;color:#656973}.success{background:#edf6ef;color:#276340}.admin-pill{background:#fff0e6;color:#ac4c25}.chat-header{display:flex;align-items:center;gap:20px;margin-bottom:22px}.chat-header h1{font-size:1.6rem;margin:0 0 4px}.chat-header p{font-size:.875rem;margin:0}.chat-surface{min-height:550px;height:calc(100svh - 260px);border:1px solid var(--line);border-radius:20px;display:flex;flex-direction:column;padding:24px;background:linear-gradient(180deg,#fffaf5,white 45%)}.chat-empty{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;text-align:center}.chat-empty h2{font-size:1.5rem}.chat-empty p{max-width:470px}.composer{display:flex;gap:10px;border:1px solid var(--line);border-radius:14px;padding:8px}.composer input{margin:0;border:0;background:transparent;min-width:0}.admin-label{display:flex;align-items:center;gap:8px;font-size:.75rem;letter-spacing:.12em;color:#ad5027;font-weight:700;margin-bottom:18px}.admin-label svg{width:18px}.admin-tabs{display:flex;gap:28px;border-bottom:1px solid var(--line);margin-bottom:30px;overflow:auto}.admin-tabs a{font-size:.9rem;white-space:nowrap;padding:0 2px 15px;border-bottom:2px solid transparent;color:#6d6f77}.admin-tabs a.active{color:#b44925;border-color:#ef7541;font-weight:650}.users-panel{border:1px solid var(--line);border-radius:16px;overflow:hidden}.list-toolbar{padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:20px}.list-toolbar input{max-width:360px;margin:0;background:#fafafb;font-size:.9rem}.list-toolbar>span{white-space:nowrap}table{width:100%;border-collapse:collapse;text-align:left;font-size:.875rem}thead{background:#fafafa}th{padding:15px 20px;color:#7b7d85;font-weight:500;font-size:.8rem}td{padding:22px 20px;border-top:1px solid var(--line)}.user-identity{display:flex;align-items:center;gap:12px}.user-identity strong{font-size:.9rem;font-weight:650;overflow-wrap:anywhere}.user-handle{display:block;color:#777a83;font-size:.8rem;margin-top:4px;overflow-wrap:anywhere}.row-actions{display:flex;gap:7px;flex-wrap:wrap}.row-actions .button{font-size:.8rem;min-height:36px;padding:7px 10px;white-space:nowrap}.danger-text{color:#b3372f}.last-login{font-size:.8rem;max-width:170px;line-height:1.6}.notice{padding:16px 20px;margin-bottom:20px;border-radius:10px;font-size:.9rem;white-space:pre-wrap}.notice.error{background:#fff0ee;color:#a8372b}.users-panel>.notice{margin:20px}.users-panel>.button{margin:0 20px 20px}.loading,.empty-list{padding:40px;text-align:center;color:#777a83}.user-dialog{border:1px solid var(--line);border-radius:18px;padding:28px;width:calc(100% - 32px);max-width:520px;max-height:calc(100dvh - 40px);color:#292b31;box-shadow:0 20px 100px #1c151b30}.user-dialog::backdrop{background:#25212b66;backdrop-filter:blur(3px)}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.dialog-heading h2{font-size:1.45rem;margin:0}.icon-button{border:0;background:#f5f5f7;border-radius:9px;min-width:40px;min-height:40px;display:flex;align-items:center;justify-content:center}.user-dialog>p{font-size:.9rem}.user-dialog form{margin-top:24px}.user-dialog label{margin-bottom:18px}.form-columns{display:grid;grid-template-columns:1fr 1fr;gap:16px}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:28px}.danger{background:#b83730;color:#fff;border-color:#b83730}.toast{position:fixed;z-index:100;bottom:26px;left:50%;transform:translateX(-50%);background:#26352d;color:white;border-radius:12px;padding:15px 24px;max-width:calc(100% - 32px);box-shadow:0 5px 24px #0002;font-size:.9rem}.session-loading{min-height:100svh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;gap:20px}.session-loading .notice{max-width:500px}.login-box .button svg{width:19px}.login-box h2{margin-top:0}
@media(min-width:761px) and (max-width:1100px){.topbar{padding:0 24px;gap:12px}.desktop-nav{gap:0}.desktop-nav a{padding:12px 9px}.desktop-nav a svg{display:none}.account-name{display:none}.quick-grid{gap:12px}.quick-card{padding:20px 16px}th,td{padding:15px 12px}.row-actions{max-width:160px}.welcome h1{font-size:2.3rem}}
@media(max-width:760px){.topbar{height:76px;padding:0 20px}.topbar .brand{font-size:1.3rem}.topbar .brand img{width:44px;height:36px}.desktop-nav{display:none}.account-name{display:none}.content{padding:26px 20px 16px;min-height:calc(100svh - 238px)}.bottom-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;left:0;right:0;bottom:0;background:#ffffffed;backdrop-filter:blur(16px);border-top:1px solid var(--line);padding:8px 6px calc(8px + env(safe-area-inset-bottom));z-index:40}.bottom-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;color:#81838a;font-size:.65rem;min-height:50px;border-radius:10px;text-align:center;padding:5px 1px}.bottom-nav a.active{background:#fff0e6;color:#a34625}.bottom-nav svg{width:22px;height:22px}.site-footer{padding-bottom:96px}.welcome{padding:28px 24px;min-height:auto;border-radius:18px}.welcome h1{font-size:1.9rem;line-height:1.25}.welcome .eyebrow{font-size:.65rem;letter-spacing:.06em;line-height:1.7}.welcome p{font-size:.9rem}.geometric{right:-170px;opacity:.35}.welcome .button{font-size:.85rem}.section-title{margin:28px 0 16px}.section-title h2{font-size:1.2rem}.section-title>span{display:none}.quick-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.quick-card{padding:18px 16px;min-height:218px;border-radius:14px}.quick-card h3{font-size:.95rem}.quick-card p{font-size:.85rem;line-height:1.55}.icon-tile{width:42px;height:42px;border-radius:12px;margin-bottom:18px}.info-strip{padding:20px 18px;align-items:flex-start}.info-strip p{font-size:.85rem}.page-heading{align-items:flex-start;margin:0 0 24px;flex-wrap:wrap;gap:18px}.page-heading h1{font-size:1.7rem}.page-heading p{font-size:.9rem}.calculator-panel{grid-template-columns:1fr;border-radius:16px}.calculator-input,.calculator-result{padding:28px 24px}.calculator-input h2{font-size:1.3rem}.calculator-input .icon-tile{display:none}.calculator-result{min-height:250px}.calculation-value{font-size:2.4rem}.empty-panel{min-height:360px;border-radius:16px;padding:38px 22px}.empty-panel h2{font-size:1.25rem}.empty-panel p{font-size:.9rem}.chat-page .topbar,.chat-page .bottom-nav,.chat-page .site-footer{display:none}.chat-page .content{padding:0;min-height:100dvh;display:flex;flex-direction:column;height:100dvh}.chat-header{padding:16px;margin:0;border-bottom:1px solid var(--line);gap:12px}.chat-header h1{font-size:1.25rem}.chat-header .button{padding:9px 10px;font-size:.8rem}.chat-surface{border:0;border-radius:0;min-height:0;height:auto;flex:1;padding:20px 16px calc(16px + env(safe-area-inset-bottom))}.chat-empty h2{font-size:1.3rem}.chat-empty p{font-size:.9rem}.admin-tabs{gap:22px;margin-bottom:26px}.admin-tabs a{font-size:.85rem}.list-toolbar{padding:18px;align-items:flex-start;flex-direction:column;gap:12px}.list-toolbar input{max-width:none}.users-panel{border:0;border-radius:0;overflow:visible}.list-toolbar{padding:0 0 18px}table,tbody{display:block}thead{display:none}tr{display:block;border:1px solid var(--line);border-radius:14px;padding:18px;margin-bottom:14px}td{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:10px 0;border:0}td:first-child{padding:0 0 16px;margin-bottom:6px;border-bottom:1px solid var(--line)}td:not(:first-child):before{content:attr(data-label);font-size:.8rem;color:#777a83;flex-shrink:0}.last-login{max-width:none;font-size:.8rem;text-align:right}td:last-child{display:block;padding:14px 0 0}td:last-child:before{display:none}.row-actions{display:flex;gap:8px;max-width:none}.row-actions .button{flex:1;min-height:42px;padding:8px 9px}.user-dialog{padding:24px 20px}.dialog-actions .button{flex:1}.toast{bottom:90px}.user-identity strong{font-size:.95rem}}
@media(max-width:360px){.content{padding-left:14px;padding-right:14px}.quick-card{padding:16px 12px}.welcome{padding:24px 20px}.row-actions{flex-wrap:wrap}.row-actions .button{flex:auto}.bottom-nav a{font-size:.6rem}}
/* Navigation labels stay readable at narrow widths and enlarged text settings. */
@media(max-width:760px){.bottom-nav a{font-size:.75rem;min-height:60px;line-height:1.2}.bottom-nav a span{overflow-wrap:anywhere}.site-footer{padding-bottom:108px}}

/* Lightweight interaction feedback: transforms/opacity do not reflow the page. */
.button,.quick-card,.bottom-nav a,.icon-button,.account summary{transition:transform 140ms ease,background-color 140ms ease,box-shadow 140ms ease;}
.button:active:not(:disabled),.icon-button:active,.account summary:active{transform:scale(.97);}
.quick-card:active{transform:scale(.98);background:#fff7f0;border-color:#edaa76;}
.bottom-nav a:active{transform:scale(.94);}
.bottom-nav a.active{background:linear-gradient(135deg,#ffe4d1,#fff3da);box-shadow:inset 0 3px #ed7240;color:#983713;font-weight:650;}
.bottom-nav a.active svg{stroke-width:2.2;}
.content>.welcome,.content>.page-heading,.content>.calculator-panel,.content>.empty-panel,.content>.chat-surface,.users-panel{animation:section-enter 180ms ease-out both;}
@keyframes section-enter{from{opacity:.45;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
.user-dialog{animation:dialog-enter 180ms ease-out;}
.user-dialog::backdrop{animation:backdrop-enter 180ms ease-out;}
.user-dialog.closing{animation:dialog-exit 140ms ease-in forwards;}
.user-dialog.closing::backdrop{animation:backdrop-exit 140ms ease-in forwards;}
@keyframes dialog-enter{from{opacity:0;transform:translateY(8px) scale(.99)}to{opacity:1;transform:none}}
@keyframes dialog-exit{to{opacity:0;transform:translateY(6px) scale(.99)}}
@keyframes backdrop-enter{from{opacity:0}to{opacity:1}}
@keyframes backdrop-exit{to{opacity:0}}
.toast{animation:toast-enter 180ms ease-out;max-height:30svh;overflow:auto;}
.toast.leaving{animation:toast-exit 160ms ease-in forwards;}
.toast-error{background:#922d25;color:white;}
.user-dialog .toast{position:relative;left:auto;bottom:auto;transform:none;margin:16px 0 0;max-width:100%;animation:section-enter 180ms ease-out;}
@keyframes toast-enter{from{opacity:0;translate:0 6px}to{opacity:1;translate:0 0}}
@keyframes toast-exit{to{opacity:0;translate:0 4px}}
.is-loading{position:relative;}
.is-loading:before,.loading:before{content:'';display:inline-block;width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin 800ms linear infinite;flex-shrink:0;}
.loading:before{margin-right:10px;vertical-align:middle;}
@keyframes spin{to{transform:rotate(360deg)}}
.button:disabled{opacity:.7;box-shadow:none;}
.dialog-actions button[type=submit]{min-width:170px;}
.users-panel{min-height:360px;}
.skeleton-list{padding:0 24px 24px;}
.skeleton-row{display:flex;align-items:center;gap:18px;border-top:1px solid var(--line);height:84px;}
.skeleton-row span{display:block;height:14px;flex:1;background:#efefef;border-radius:6px;animation:skeleton-pulse 1.4s ease-in-out infinite;}
.skeleton-row span:first-child{flex:0 0 38px;height:38px;border-radius:50%;}
@keyframes skeleton-pulse{50%{opacity:.45}}
.calculator-input{min-width:0;}
.calculator-input input{font-variant-numeric:tabular-nums;min-width:0;}
.calculator-input h2{line-height:1.3;}
.conversion-divider{display:block;text-align:center;color:#b2643c;font-size:1.2rem;margin:-10px 0 8px;}
.calculation-value{min-height:1.4em;max-height:180px;overflow:auto;width:100%;font-variant-numeric:tabular-nums;}
.precision-note{min-height:5em;overflow-wrap:anywhere;}
.exact-value{width:100%;overflow-wrap:anywhere;font-size:.875rem;}
.exact-value summary{cursor:pointer;min-height:44px;padding:12px 0;color:#934222;}
.exact-value p{margin-top:10px;}
[hidden]{display:none!important;}
@media(max-width:760px){.row-actions .button,.icon-button{min-height:44px;}.icon-button{min-width:44px;}.dialog-actions button[type=submit]{min-width:0;}.dialog-actions .button{min-width:0;white-space:normal;}.calculator-input{padding:24px;}.calculator-input input{font-size:1.65rem;}.calculator-input h2{font-size:1.25rem;}.calculator-result{padding:28px 24px;}.users-panel{min-height:520px;}.skeleton-list{padding:0 18px 18px;}.skeleton-row{height:132px;}.toast{bottom:calc(100px + env(safe-area-inset-bottom));}.user-dialog .toast{bottom:auto;}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important;}.button:active,.quick-card:active,.bottom-nav a:active,.icon-button:active{transform:none;}}

.skip-link:not(:focus){clip-path:inset(50%);width:1px;height:1px;overflow:hidden;white-space:nowrap;}

/* Phase 3A Promo: real server data, URL-only images, no upload/persistence shim. */
textarea{display:block;width:100%;font:inherit;color:inherit;background:white;border:1px solid #dcdde2;border-radius:10px;padding:12px 14px;margin-top:9px;resize:vertical;min-height:90px;}textarea:focus-visible{outline:3px solid #bb4c15;outline-offset:3px;}
.promo-region{min-height:380px;}.promo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;}.promo-card{min-width:0;border:1px solid var(--line);border-radius:18px;overflow:hidden;animation:section-enter 180ms ease-out both;background:white;}.promo-image{display:flex;position:relative;align-items:center;justify-content:center;aspect-ratio:4/3;width:100%;border:0;border-bottom:1px solid var(--line);padding:0;background:#fff6eb;color:#8c5940;overflow:hidden;}.promo-image>img{height:100%;width:100%;object-fit:contain;}.promo-image>span:not(.preview-hint){font-size:.9rem;padding:24px;line-height:1.6;}.preview-hint{position:absolute;bottom:12px;right:12px;display:flex;align-items:center;gap:6px;background:#ffffffed;padding:8px 10px;border-radius:8px;color:#8e451f;font-size:.8rem;box-shadow:0 3px 12px #0001;}.promo-image:active{filter:brightness(.95);}.promo-copy{padding:22px;}.promo-copy h2{font-size:1.25rem;line-height:1.4;margin:12px 0;overflow-wrap:anywhere;}.promo-description{font-size:.9rem;color:#676b74;white-space:pre-wrap;overflow-wrap:anywhere;}.promo-period{font-size:.8rem;color:#7b6660;line-height:1.6;margin:20px 0 0;}.promo-actions{display:flex;gap:10px;margin-top:20px;flex-wrap:wrap;}.promo-actions .button{flex:1;min-width:0;}.promo-skeleton{border:1px solid var(--line);border-radius:18px;overflow:hidden;padding-bottom:20px;}.promo-skeleton>div{aspect-ratio:4/3;background:#f1efed;animation:skeleton-pulse 1.4s ease-in-out infinite;}.promo-skeleton>span{display:block;background:#eeedeb;height:16px;margin:20px 20px 0;border-radius:5px;animation:skeleton-pulse 1.4s ease-in-out infinite;}.promo-skeleton>span:last-child{width:55%;}
.promo-viewer{max-width:1040px;width:calc(100% - 40px);padding:22px;}.promo-viewer .dialog-heading h2{font-size:1.2rem;overflow-wrap:anywhere;}.viewer-stage{height:55dvh;min-height:180px;background:#f7f5f2;border-radius:12px;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none;cursor:grab;}.viewer-stage:active{cursor:grabbing;}.viewer-stage img{width:100%;height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none;transform-origin:center;}.viewer-controls{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:10px;margin-top:16px;}.zoom-label{font-variant-numeric:tabular-nums;min-width:48px;text-align:center;font-size:.9rem;}.viewer-status{font-size:.85rem;color:#72717a;margin:14px 0 0;line-height:1.6;}.promo-viewer>a{margin-top:12px;}
@media(max-width:1000px){.promo-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:760px){.promo-grid{gap:16px;grid-template-columns:1fr;}.promo-copy{padding:20px;}.promo-viewer{width:100%;max-width:none;height:100dvh;max-height:100dvh;margin:0;padding:18px 16px calc(18px + env(safe-area-inset-bottom));border:0;border-radius:0;}.promo-viewer .dialog-heading{min-height:48px;}.viewer-stage{height:calc(100dvh - 245px);}.viewer-controls{gap:8px;}.viewer-controls .button{min-height:44px;padding:10px 12px;}.promo-actions .button{min-height:44px;}.user-dialog input[type=date]{min-width:0;max-width:100%;}.form-columns>label{min-width:0;}}
@media(prefers-reduced-motion:reduce){.promo-card,.promo-skeleton>div,.promo-skeleton>span{animation:none!important;}}

/* Consistent, high-contrast status badges for Promo and Library. */
.pill.status-badge{font-weight:750;padding:6px 10px;border:1px solid transparent;gap:6px}.pill.status-active{background:#15803d;color:#fff;border-color:#166534}.pill.status-inactive{background:#b91c1c;color:#fff;border-color:#991b1b}
