/* Shared, responsive finishing layer for public, account and owner screens. */
.control-modules{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:16px;margin-top:28px}.control-module{display:flex;gap:14px;align-items:center;border:1px solid var(--line-soft);border-radius:16px;padding:24px;color:inherit;text-decoration:none;background:var(--surface-soft)}.control-module strong{flex:1}.control-module:hover{border-color:var(--primary);transform:translateY(-2px)}
:root{--surface-soft:#f3f6fc;--line-soft:#dfe6f2}
[data-theme=dark]{--surface-soft:#172238;--line-soft:#31405b}
body .auth-shell{max-width:1080px;margin:clamp(24px,5vw,72px) auto;padding:24px;display:grid;grid-template-columns:1fr 1fr;gap:clamp(24px,5vw,72px);align-items:center;min-height:540px}
body .auth-art{padding:clamp(24px,4vw,48px);border-radius:28px;background:linear-gradient(145deg,#162963,#3565ed);color:white;min-height:430px;display:flex;flex-direction:column;justify-content:center;position:relative;overflow:hidden}
.auth-art:after{content:'↗';font-size:180px;position:absolute;right:12px;bottom:-60px;opacity:.14}
body .auth-art h1{font-size:clamp(32px,4vw,54px);line-height:1.06;letter-spacing:-2px;color:white}
body .auth-art p{color:#e2eaff;line-height:1.8}
body .auth-card{padding:clamp(20px,3vw,38px);border:1px solid var(--line-soft);border-radius:24px;box-shadow:0 16px 60px #123b7210;background:var(--card,var(--surface-soft))}
.auth-card h2{font-size:28px;letter-spacing:-1px}.auth-card form p,.polished-form p{display:grid;gap:9px;margin:18px 0}
body input:not([type=checkbox]):not([type=radio]):not([type=color]),body select,body textarea{max-width:100%;box-sizing:border-box;border:1px solid var(--line-soft);border-radius:12px;padding:13px 15px;font:inherit;background:var(--surface-soft);color:inherit}
body textarea{min-height:130px}body input:focus-visible,body textarea:focus-visible,body select:focus-visible{outline:3px solid #477bff55;outline-offset:2px}
.helptext{font-size:12px;line-height:1.6;opacity:.75}.errorlist{padding:14px 24px;color:#b42335;background:#fff0f0;border-radius:12px;font-size:14px}
.password-toggle{justify-self:end;border:0;background:none;color:var(--primary);font:inherit;font-size:12px;cursor:pointer;padding:4px}
body .footer-grid{display:grid;grid-template-columns:minmax(190px,1.05fr) minmax(320px,1.65fr) minmax(190px,1fr) minmax(190px,1fr);align-items:start;gap:clamp(20px,3vw,42px)}
.footer-link-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:5px 18px}.footer-grid>div:nth-child(4) .footer-link-grid{grid-template-columns:1fr}.footer-grid .footer-link-grid a{margin:0;min-width:0;overflow-wrap:anywhere}.footer-logo{display:block;max-width:130px;max-height:48px;object-fit:contain;margin-bottom:10px}
.brand-logo{width:auto;height:auto;max-width:150px;max-height:46px;object-fit:contain}body[data-workspace=true] #main-content{margin-left:278px;min-height:calc(100svh - 70px);padding-top:1px}body[data-workspace=true] .portal-shell{padding:26px clamp(18px,4vw,55px);max-width:none}body[data-workspace=true] .workspace-topbar{margin-left:278px}
.control-shell{max-width:1440px;margin:auto;padding:48px 5%;display:grid;grid-template-columns:240px minmax(0,1fr);gap:40px}.control-sidebar nav{display:grid;gap:4px;max-height:70vh;overflow:auto;margin-top:24px}.control-sidebar a{padding:10px 12px;border-radius:10px;text-decoration:none;color:inherit}.control-sidebar a[aria-current]{background:var(--primary);color:white}
.workspace-frame{--sidebar-width:278px;min-height:calc(100svh - 82px);background:var(--background)}.workspace-main{min-width:0;margin-left:var(--sidebar-width);transition:margin .22s ease}.portal-nav{position:fixed;z-index:45;inset:0 auto 0 0;width:var(--sidebar-width);padding:20px 15px 16px;display:flex;flex-direction:column;gap:0;background:var(--surface);border-right:1px solid var(--border);color:var(--text);box-shadow:12px 0 40px #101d370b}.workspace-brand{height:54px;display:flex;align-items:center;gap:10px;padding:0 8px;font-size:13px;font-weight:800;min-width:0}.workspace-brand>img{width:38px;height:38px;object-fit:contain;border-radius:11px}.workspace-brand>span:last-of-type{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.workspace-brand small,.workspace-user small{display:block;font-size:10px;letter-spacing:.08em;color:var(--subtle);font-weight:550}.workspace-user{display:flex;align-items:center;gap:11px;padding:15px 10px;margin:14px 0;border:1px solid var(--border);background:var(--background);border-radius:15px;min-width:0}.workspace-user img,.workspace-avatar-fallback{width:42px;height:42px;flex:0 0 42px;object-fit:cover;border-radius:50%;background:var(--primary);color:white;display:grid;place-items:center;font-weight:800}.workspace-user>span:last-child{min-width:0;overflow:hidden}.workspace-user strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.workspace-menu{display:flex;flex:1;min-height:0;overflow:auto;flex-direction:column;gap:3px}.workspace-nav-label{padding:15px 11px 5px;font-size:9px;letter-spacing:.14em;color:var(--subtle);font-weight:800}.workspace-menu>a{display:flex;gap:12px;align-items:center;padding:10px 12px;border-radius:11px;color:var(--subtle);font-size:12px;font-weight:650;transition:background .15s,color .15s}.workspace-menu>a>span:first-child{width:18px;text-align:center;color:var(--primary);font-size:16px}.workspace-menu>a:hover,.workspace-menu>a[aria-current=page]{color:var(--primary);background:color-mix(in srgb,var(--primary) 10%,var(--surface))}.sidebar-count{margin-left:auto;padding:2px 7px;border-radius:20px;background:var(--primary);color:white}.workspace-logout{padding:13px 3px 0;border-top:1px solid var(--border)}.workspace-logout button{width:100%;display:flex;gap:12px;align-items:center;padding:10px 12px;border:0;border-radius:10px;background:transparent;color:var(--subtle);font:inherit;font-size:12px;text-align:left}.workspace-logout button:hover{background:var(--background);color:#c03952}.workspace-topbar{position:sticky;z-index:25;top:0;height:70px;padding:0 clamp(18px,4vw,55px);display:flex;align-items:center;gap:13px;background:color-mix(in srgb,var(--surface) 92%,transparent);border-bottom:1px solid var(--border);backdrop-filter:blur(14px)}.workspace-topbar>div{display:grid}.workspace-topbar-brand{font-size:13px;font-weight:800}.workspace-topbar small{font-size:10px;color:var(--subtle)}.sidebar-toggle,.sidebar-close{display:grid;place-items:center;width:40px;height:40px;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);font-size:18px}.topbar-profile{margin-left:auto}.topbar-profile img,.topbar-profile span{width:38px;height:38px;display:grid;place-items:center;border-radius:50%;object-fit:cover;background:var(--primary);color:white;font-weight:800}.sidebar-close,.workspace-scrim{display:none}.portal-shell{max-width:1600px;margin:auto;padding:32px clamp(18px,4vw,55px);display:block}.portal-main{min-width:0}.workspace-sidebar-open{overflow:hidden}
.polished-form{padding:28px;border:1px solid var(--line-soft);border-radius:20px;max-width:900px}.polished-form select[multiple]{min-height:140px}.record-search{display:flex;gap:12px;margin:24px 0}.record-list>a{display:flex;align-items:center;gap:20px;padding:20px;border-bottom:1px solid var(--line-soft);text-decoration:none;color:inherit}.record-list>a strong{flex:1;overflow-wrap:anywhere}.record-list>a:hover{background:var(--surface-soft)}.pagination{display:flex;justify-content:space-between;gap:16px;margin:24px 0}
.chat-message{overflow-wrap:anywhere}.chat-message p{margin:0 0 10px}.chat-message h4{margin:12px 0 8px;font-size:16px}.chat-message ul,.chat-message ol{padding-left:22px}.chat-message li{margin:6px 0}.chat-table-scroll{overflow:auto;max-width:100%;margin:12px 0}.chat-message table{border-collapse:collapse;font-size:12px;min-width:280px}.chat-message th,.chat-message td{padding:9px;text-align:left;border:1px solid var(--line-soft)}.chat-message th{background:var(--surface-soft)}
@media(max-width:1050px){body .footer-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.footer-grid>div:first-child,.footer-grid>div:nth-child(2){grid-column:auto}.footer-link-grid{grid-template-columns:1fr}}
@media(max-width:800px){body .auth-shell{grid-template-columns:1fr;min-height:0;max-width:540px;padding:16px;margin:16px auto;gap:18px}body .auth-art{min-height:0;padding:24px}body .auth-art h1{font-size:32px;letter-spacing:-1px}body .auth-art p{margin:6px 0}body .footer-grid{grid-template-columns:1fr 1fr;gap:24px}.footer-link-grid{grid-template-columns:1fr}.control-shell{grid-template-columns:1fr;padding:24px 5%;gap:24px}.control-sidebar nav{display:flex;overflow:auto;max-height:none}.control-sidebar nav a{white-space:nowrap}.polished-form{padding:18px}.record-search input{min-width:0}.workspace-frame{--sidebar-width:280px;min-height:100svh}.workspace-main{margin-left:0}.workspace-topbar{height:64px;padding:0 16px}.portal-shell{padding:24px 16px}.portal-nav{transform:translateX(-105%);transition:transform .24s ease;box-shadow:20px 0 55px #07132935}.portal-nav.is-open{transform:translateX(0)}.workspace-scrim{position:fixed;z-index:40;inset:0;background:#06112788;border:0;backdrop-filter:blur(2px)}.portal-nav.is-open~.workspace-scrim,.workspace-frame:has(.portal-nav.is-open) .workspace-scrim{display:block}.sidebar-close{display:grid;margin-left:auto;flex:0 0 36px;width:36px;height:36px}.sidebar-toggle{width:38px;height:38px}}
@media(max-width:480px){body .footer-grid{grid-template-columns:1fr 1fr}.footer-grid>div:first-child,.footer-grid>div:nth-child(2){grid-column:1/-1}.footer-link-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.footer-grid>div:nth-child(3) .footer-link-grid,.footer-grid>div:nth-child(4) .footer-link-grid{grid-template-columns:1fr}.auth-card h2{font-size:24px}.record-list>a{padding:15px 4px;gap:10px}.portal-nav{width:min(88vw,310px)}.workspace-user{margin:9px 0}.portal-shell{padding:22px 13px}}
@media(max-width:800px){body[data-workspace=true] #main-content{margin-left:0;padding-top:1px}body[data-workspace=true] .workspace-topbar{margin-left:0}}
/* Keep the public AI entry small and clear of fixed bottom controls. Workspace users have the sidebar link. */
body[data-workspace=true] .chat-launcher{display:none}
body:not([data-workspace=true]) .chat-launcher{right:14px;bottom:82px;width:46px;height:46px;min-width:46px;min-height:46px;padding:0;display:grid;place-items:center;border-radius:50%;font-size:20px;line-height:1;box-shadow:0 6px 18px #13275b35;cursor:pointer}
body:not([data-workspace=true]) .chat-launcher span{display:none}
body:not([data-workspace=true]) .chat-panel{right:14px;bottom:140px}
@media(max-width:600px){body:not([data-workspace=true]) .chat-launcher{right:12px;bottom:82px;width:44px;height:44px;min-width:44px;min-height:44px}body:not([data-workspace=true]) .chat-panel{right:12px;bottom:138px}}
.page-loader[hidden],.notification-toast[hidden],.notification-badge[hidden]{display:none!important}.page-loader{position:fixed;z-index:200;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background:color-mix(in srgb,var(--background) 88%,transparent);backdrop-filter:blur(12px);color:var(--text);font-weight:700;opacity:0;transition:opacity .18s}.page-loader.is-visible{opacity:1}.page-loader-mark{width:76px;height:76px;display:grid;place-items:center;border:1px solid var(--line-soft);border-radius:24px;background:var(--surface);box-shadow:0 14px 48px #19315a18;animation:loader-pulse 1.2s ease-in-out infinite}.page-loader-mark img{width:54px;height:54px;object-fit:contain}.page-loader-mark .brand-symbol{font-size:26px}.page-loader>i{width:84px;height:3px;border-radius:5px;background:linear-gradient(90deg,var(--primary) 35%,var(--line-soft) 35%);background-size:220% 100%;animation:loader-track .8s linear infinite}.notification-toast{position:fixed;z-index:210;right:22px;bottom:22px;max-width:min(460px,calc(100vw - 28px));display:flex;align-items:center;gap:14px;padding:14px 16px;border:1px solid var(--line-soft);border-radius:16px;background:var(--surface);color:var(--text);box-shadow:0 16px 56px #0b1b3433}.notification-toast [data-notification-toast-text]{flex:1;font-size:13px}.notification-toast a{color:var(--primary);font-weight:750}.notification-toast button{border:0;background:transparent;color:inherit;font-size:20px;cursor:pointer}.toast-bell{font-size:20px}.notification-bell{position:relative}.notification-badge{position:absolute;top:3px;right:5px;min-width:17px;height:17px;padding:0 4px;display:inline-grid;place-items:center;border:2px solid var(--surface);border-radius:20px;background:#e34358;color:white;font-size:9px;font-weight:850;line-height:1}.workspace-menu .notification-bell>span:first-child{font-size:14px}.topbar-profile{margin-left:auto;flex:0 0 38px}.device-upload-block{padding:18px;margin:16px 0;border:1px dashed var(--line-soft);border-radius:15px;background:var(--surface-soft)}.device-upload-block label{display:block;font-weight:750;margin-bottom:10px}.device-upload-block input[type=file]{display:block;width:100%;padding:12px;border:1px solid var(--line-soft);border-radius:11px;background:var(--surface)}.device-upload-block [role=status]{display:block;margin-top:9px;font-size:12px}.upload-preview img{display:block;width:88px;height:88px;object-fit:cover;border-radius:18px;margin-top:12px}.people-invite .polished-form{max-width:650px;padding:0;border:0}.people-list{display:grid}.people-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 0;border-top:1px solid var(--line-soft)}.people-row h3,.people-row p{margin:0 0 5px}.people-row p,.people-row small{font-size:12px;color:var(--subtle)}.people-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.media-library-grid{margin-top:38px}.media-assets{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:16px}.media-asset{min-width:0;display:grid;gap:8px;padding:12px;border:1px solid var(--line-soft);border-radius:15px;background:var(--surface)}.media-asset img,.media-asset-file{width:100%;height:130px;object-fit:cover;border-radius:10px;background:var(--surface-soft)}.media-asset-file{display:grid;place-items:center;font-weight:800;color:var(--primary)}.media-asset strong{overflow-wrap:anywhere}
@keyframes loader-pulse{50%{transform:scale(.94);box-shadow:0 8px 32px #19315a0e}}@keyframes loader-track{to{background-position:-220% 0}}
.workspace-menu .notification-bell .notification-badge{position:static;margin-left:auto;min-width:18px;height:auto;border:0;padding:2px 7px;background:var(--primary)}@media(max-width:600px){.people-row{align-items:flex-start;flex-direction:column}.people-actions{width:100%}.notification-toast{right:12px;bottom:12px;gap:9px;padding:12px}.media-assets{grid-template-columns:repeat(2,minmax(0,1fr))}}
.media-intro{max-width:720px;line-height:1.75}.media-upload-form{max-width:860px;padding:clamp(18px,3vw,32px)}.media-source-tabs{display:flex;gap:8px;flex-wrap:wrap;padding:6px;margin-bottom:24px;border:1px solid var(--line-soft);border-radius:15px;background:var(--surface-soft)}.media-source-tabs button{flex:1;min-width:180px;padding:13px 16px;border:0;border-radius:10px;background:transparent;color:var(--text);font:inherit;font-weight:700}.media-source-tabs button.is-selected{background:var(--surface);color:var(--primary);box-shadow:0 4px 15px #182b5010}.media-source-panel{display:grid;gap:10px;padding:20px;border:1px dashed var(--line-soft);border-radius:15px;background:var(--surface-soft)}.media-source-panel[hidden]{display:none}.media-source-panel label,.media-upload-details label,.media-choice-content>label:not(.button){font-size:13px;font-weight:750}.media-source-panel small,.field-hint{font-size:12px;line-height:1.6;color:var(--subtle)}.media-source-panel input[type=file]{width:100%;padding:14px;border:1px solid var(--line-soft);border-radius:12px;background:var(--surface)}.media-upload-details{display:grid;gap:9px;margin-top:22px}.media-upload-details label:not(:first-child){margin-top:10px}.media-upload-details input,.media-source-panel input[type=url]{width:100%}.media-choice-card{display:grid;grid-template-columns:minmax(150px,.7fr) minmax(0,1.3fr);gap:clamp(18px,4vw,36px);align-items:center;margin:18px 0;padding:clamp(18px,3vw,28px);border:1px solid var(--line-soft);border-radius:20px;background:linear-gradient(140deg,var(--surface-soft),var(--surface))}.media-choice-content{min-width:0}.media-choice-content h2{margin:6px 0;font-size:clamp(19px,2.5vw,25px)}.media-choice-content p{line-height:1.65;color:var(--subtle)}.media-choice-content input[type=url]{width:100%;margin-top:8px}.choice-step{font-size:10px;letter-spacing:.12em;font-weight:850;color:var(--primary)}.file-choice{display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin:6px 0;cursor:pointer}.or-divider{display:flex;align-items:center;gap:12px;margin:10px 0;color:var(--subtle);font-size:11px}.or-divider:before,.or-divider:after{content:"";height:1px;flex:1;background:var(--line-soft)}.device-photo-preview,.cover-photo-preview{width:min(100%,170px);aspect-ratio:1;display:grid;place-items:center;overflow:hidden;border:1px solid var(--line-soft);border-radius:22px;background:radial-gradient(circle at 35% 25%,color-mix(in srgb,var(--primary) 18%,var(--surface)),var(--surface-soft));color:var(--subtle);font-weight:700;text-align:center}.device-photo-preview{width:min(100%,156px);border-radius:50%}.device-photo-preview img,.cover-photo-preview img{width:100%;height:100%;object-fit:cover}.cover-photo-preview{width:100%;aspect-ratio:16/9}.empty-photo-preview{display:grid;width:100%;height:100%;place-items:center;border:1px dashed var(--line-soft);border-radius:14px;color:var(--subtle)}.profile-fields{margin:32px 0}.profile-fields h2{margin-bottom:4px}.profile-field{display:grid;gap:8px;margin:17px 0}.profile-field>label{font-weight:700}.profile-field .errorlist{margin:0}.profile-edit-form{max-width:1000px}.media-asset video{width:100%;height:130px;object-fit:cover;border-radius:10px;background:var(--surface-soft)}.media-asset-file{box-sizing:border-box;display:grid;place-items:center;text-align:center;text-decoration:none;color:var(--primary);font-weight:800}.media-upload-form button:disabled{opacity:.65;cursor:wait}
@media(max-width:650px){.media-choice-card{grid-template-columns:1fr;justify-items:start}.cover-choice-card .cover-photo-preview{max-width:100%}.media-source-tabs{display:grid;grid-template-columns:1fr}.media-source-tabs button{min-width:0}.media-source-panel{padding:16px}.media-upload-form{padding:16px}.profile-edit-form{padding:16px}.profile-field{margin:14px 0}}
