/* Reference-inspired surfaces; navigation and workflows remain shared. */
:root{--surface-gap:8px;--surface-border:#dfe4eb;--surface-shadow:0 10px 32px #26364c0b,0 2px 7px #26364c08;--card-shadow:0 4px 16px #26364c06,0 1px 3px #26364c04;--popover-shadow:0 18px 48px #26364c26,0 3px 10px #26364c12;--line:#e6ebf1;--bg:#f7f9fc;--ink:#202c40;--muted:#8793a4}
body{min-height:100dvh;background:linear-gradient(145deg,#edf0f4,#e8ecf1);-webkit-font-smoothing:antialiased}
#sidebar{background:transparent;border-right:0}
#sidebar .brand strong{letter-spacing:-.65px;font-weight:750}
#sidebar .brand small{color:#8994a5}
#sidebar .brand-mark,#sidebar .brand-mark:hover{border-radius:0;background:none;box-shadow:none}
#sidebar .brand-mark .calldesk-brand-icon{display:block;width:100%;height:100%}
#sidebar .workspace{background:#ffffffab;border:1px solid #ffffffc9;border-radius:12px;box-shadow:0 2px 6px #27374c06;padding:13px;margin-inline:0}
#sidebar nav button{border-radius:10px;color:#778397;transition:background 140ms ease,box-shadow 140ms ease,color 140ms ease}
#sidebar nav button:hover{background:#ffffffa6;color:#26364c}
#sidebar nav button.active{background:#ffffffd9;color:#4263eb;box-shadow:0 3px 10px #26364c09,0 1px 2px #26364c05}
#sidebar .nav-count{background:#edf2ff;color:#4263eb}
#sidebar .trial{background:linear-gradient(135deg,#ffffffa6,#f3f6fcaa);border:1px solid #ffffffb3;border-radius:14px;box-shadow:0 2px 8px #26364c04}
#sidebar .profile{border-radius:12px}#sidebar .profile:hover{background:#ffffffa6}
#sidebar .avatar{background:#ffffffbd;box-shadow:0 2px 7px #26364c06}
#studio,#crm-module{top:var(--surface-gap);bottom:var(--surface-gap);left:calc(var(--nav-width) + var(--surface-gap));right:calc(var(--ai-width) + var(--surface-gap));border:1px solid var(--surface-border);border-radius:15px;box-shadow:var(--surface-shadow)}
#studio{overflow:hidden}#crm-module{background:var(--bg);scrollbar-width:none}
#crm-module::-webkit-scrollbar{display:none}
#topbar{background:#ffffffed;border-bottom-color:#edf0f4}
.prototype-banner{background:#f3f6fc;color:#8d9aae}
.page-heading{margin-bottom:28px}h1{font-weight:720;letter-spacing:-1px}.subtitle{color:#8996aa}
.card,.stat{border:1px solid #e5eaf1;border-radius:16px;box-shadow:var(--card-shadow)}
.card-head{padding-top:22px;padding-bottom:22px}.stat{background:linear-gradient(145deg,#fff,#fdfefe)}
.stat .number{font-weight:700}.stat-icon{border-radius:12px}.stat .foot{color:#97a3b4}
.welcome{border-radius:15px;background:linear-gradient(110deg,#edf3ff,#f7faff);border-color:#e5ecfa;box-shadow:0 2px 8px #4263eb04}
.notice{border-radius:10px;background:#f5f7fb;border-color:#e8edf4}
button{transition:background 140ms ease,border-color 140ms ease,box-shadow 140ms ease}
button.primary{background:linear-gradient(145deg,#4d70f2,#3560e1);border-color:#4165e7;border-radius:10px;box-shadow:0 4px 10px #4263eb21,0 1px 2px #4263eb15}
button.primary:hover{background:linear-gradient(145deg,#466aec,#2e55d7);box-shadow:0 5px 14px #4263eb2c}
button.primary:active{box-shadow:0 1px 4px #4263eb20}
input,select,textarea{border-radius:9px;border-color:#e0e6ef;transition:border-color 140ms ease,box-shadow 140ms ease}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #4263eb50;outline-offset:2px}
.toolbar{background:#fdfefe}.segmented{border-radius:10px;background:#edf1f7}.segmented button.active{border-radius:8px;box-shadow:0 2px 6px #26364c0b}
th{background:#fafbfd}tbody tr:hover{background:#f7faff}.calendar-cell:hover{background:#f5f8fd}
.profile-menu,.ai-menu{background:#ffffffed;backdrop-filter:blur(16px);border-color:#d8dfe9;border-radius:12px;box-shadow:var(--popover-shadow)}
.profile-menu button:hover{background:#eaf0fa}.profile-menu hr{border-top-color:#e4e8f0}
dialog{border-radius:18px;border-color:#dfe5ee;box-shadow:0 24px 80px #182a4833,0 4px 12px #182a4814}
dialog::backdrop{background:#24344c29;backdrop-filter:blur(4px)}
dialog.drawer{border-radius:18px 0 0 18px}#call-tools{border-radius:18px;box-shadow:0 24px 80px #182a4833,0 4px 12px #182a4814}
.modal-head,.modal-footer{background:#fdfefe}#toast{border:1px solid #ffffff18;border-radius:13px;box-shadow:0 8px 28px #182a4826}
#ai-panel{border-left:0;background:#e9edf2}
.ai-header{background:transparent;height:48px}
.ai-status-pill{background:#ffffffc9;box-shadow:0 2px 6px #26364c08;border-color:#dce2e9}
.ai-composer-card{border-color:#ffffffd9;border-radius:24px;box-shadow:0 8px 22px #26364c10,0 2px 5px #26364c08}
.ai-reference-card{border-radius:15px;border-color:#e6eaf0;box-shadow:0 2px 5px #26364c07}
#ai-panel .chat-bubble.question{background:#dde4ed;box-shadow:0 1px 2px #26364c03}
.ai-reference-icon{box-shadow:0 2px 6px #4263eb1a}
.ai-watermark{color:#ccd3db;border-color:#d3dae2}
@media(max-width:950px){:root{--surface-gap:5px}#studio,#crm-module{left:calc(64px + var(--surface-gap));right:calc(48px + var(--surface-gap));border-radius:12px}#sidebar:not(.collapsed){background:#edf1f6eF;backdrop-filter:blur(18px);box-shadow:12px 0 36px #26364c1c}}
@media(max-width:600px){.card,.stat{border-radius:13px}dialog.drawer{border-radius:0}.page-heading{margin-bottom:22px}.stat{padding:13px}}
@media(prefers-reduced-motion:reduce){button,input,select,textarea,#sidebar nav button{transition:none}}
/* Top profile control and native-style cascading menus. */
#sidebar{padding:12px 15px 14px}
.sidebar-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 19px;min-height:34px;flex-shrink:0}
#sidebar .sidebar-profile{display:inline-flex;align-items:center;gap:7px;background:transparent;border:0;padding:0 3px 0 0;border-radius:20px;box-shadow:none;width:auto;height:34px}
#sidebar .sidebar-profile:hover{background:#ffffff70}#sidebar .sidebar-profile .profile-chevron{display:flex;color:#868d98}#sidebar .sidebar-profile .profile-chevron .i{width:11px;height:11px;font-size:9px}
.profile-avatar{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:30px;height:30px;border-radius:50%;background:linear-gradient(145deg,#f4dcef,#dddaf8);color:#8d689f;font-size:12px;font-weight:650;box-shadow:inset 0 0 0 1px #ffffff70}
.sidebar-tools{display:flex;align-items:center;gap:5px}#sidebar .sidebar-tools button{display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:7px;background:transparent;color:#868e9a}#sidebar .sidebar-tools button:hover{background:#ffffff80;color:#526071}#sidebar .sidebar-tools .i{width:17px;height:17px;font-size:15px}
.sidebar-brand-row{display:flex;align-items:center;gap:9px;padding:0 4px;margin-bottom:19px;flex-shrink:0}.sidebar-brand-row strong{display:block;font-size:17px;letter-spacing:-.6px}.sidebar-brand-row small{display:block;font-size:9px;color:#8d98a9;margin-top:1px}.sidebar-brand-row .brand-mark{display:grid;place-items:center;width:29px;height:29px;border-radius:9px;flex-shrink:0}.sidebar-brand-row .brand-mark .i{font-size:16px;width:18px;height:18px}
#sidebar.collapsed{padding:12px 12px 14px}#sidebar.collapsed .sidebar-toolbar{flex-direction:column;gap:10px;margin-bottom:21px}#sidebar.collapsed .sidebar-profile{width:34px;height:34px;padding:0;justify-content:center}#sidebar.collapsed .sidebar-profile .profile-chevron,#sidebar.collapsed .sidebar-search,#sidebar.collapsed .sidebar-brand-row,#sidebar.collapsed .side-bottom{display:none}#sidebar.collapsed .sidebar-tools{gap:0}
.profile-menu{inset:auto;left:10px;top:54px;bottom:auto;width:248px;padding:5px;background:#e5e9ecee;color:#4c5259;border:1px solid #bec7ce;border-radius:11px;box-shadow:0 14px 38px #26364c2d,0 2px 6px #26364c18;backdrop-filter:blur(22px);z-index:80;overflow-y:auto;scrollbar-width:thin}
.profile-menu-caption{padding:6px 10px 5px;font-size:11px;color:#8a9198}.profile-menu hr{margin:5px -5px;border-top-color:#c5cdd480}
.profile-menu button{background:transparent;box-shadow:none;color:inherit;padding:8px 10px;min-height:34px;border:0;border-radius:6px;font-size:13px}.profile-menu button:hover,.profile-menu button.submenu-active{background:#c9d0d87d;color:#303a48}
.profile-menu .profile-current{display:flex;align-items:center;gap:8px;min-height:40px}.profile-menu .profile-current .profile-avatar{width:23px;height:23px;font-size:10px}.profile-menu .profile-current strong{min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:13px;font-weight:550}.profile-menu .profile-current>.i{margin-left:auto;color:#7c878f;font-size:12px}
.profile-menu .profile-menu-row{display:flex;align-items:center;justify-content:flex-start;width:100%;gap:9px;text-align:left}.profile-menu-row>.i:first-child{width:17px;height:17px;color:#828b92;font-size:14px}.profile-menu-row>span{flex:1;min-width:0}.profile-menu-row>.i:last-child:not(:first-child){width:11px;height:11px;font-size:10px;color:#8b939b}.profile-menu button.danger{color:#be6267}.workspace-check{float:right;margin-left:8px;color:#6a7a86}
.profile-menu.profile-flyout{width:224px;max-height:calc(100dvh - 16px);z-index:81;background:#e8ecedeb;border-radius:10px;box-shadow:0 18px 44px #26364c29,0 2px 7px #26364c16}
@media(max-width:600px){.profile-menu{width:min(248px,calc(100vw - 20px))}.profile-menu.profile-flyout{width:min(224px,calc(100vw - 16px));background:#eef1f3f5}}
/* CRM controls and the record column use the same floating surface language. */
.custom-select{position:relative;display:inline-flex;min-width:0;vertical-align:middle;width:100%}
.custom-select>select{display:none!important}
.select-trigger{width:100%;min-height:36px;text-align:left;display:block;padding:9px 32px 9px 12px!important;border:1px solid #dce2eb!important;border-radius:10px!important;background:#ffffffd9!important;color:#26374c!important;font:inherit;position:relative;box-shadow:0 1px 3px #1c304709;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.select-trigger::after{content:'';position:absolute;right:14px;top:42%;width:6px;height:6px;border-right:1.5px solid #748297;border-bottom:1.5px solid #748297;transform:rotate(45deg)}
.select-trigger:hover{border-color:#b4c2d5!important;background:white!important}.select-trigger:focus-visible{outline:3px solid #4166ec29;outline-offset:2px}.select-trigger[aria-expanded=true]{border-color:#6984f4!important}
.select-menu{position:fixed;z-index:1200;max-height:280px;overflow:auto;padding:6px;background:#f7f9fbed;backdrop-filter:blur(20px);border:1px solid #cdd5e0;border-radius:12px;box-shadow:0 12px 32px #182d4b26,0 2px 5px #182d4b10;font-size:13px}
.select-menu>button{width:100%;display:flex;align-items:center;justify-content:space-between;text-align:left;border:0;background:transparent;color:#26374c;padding:10px 12px;border-radius:7px;font:inherit;min-height:36px}
.select-menu>button.focused,.select-menu>button:hover{background:#e1e8f6}.select-menu>button[aria-selected=true]{color:#4166ec;font-weight:650}.select-menu>button[aria-selected=true]::after{content:'✓';padding-left:12px}.select-menu>button:disabled{opacity:.4}
.workspace .custom-select{width:100%}.workspace .select-trigger{background:transparent!important;border:0!important;box-shadow:none;font-weight:650}.collapsed .workspace .custom-select{display:none}
.filters .custom-select,.ai-bottom-bar .custom-select,#topbar .custom-select{width:auto;min-width:100px}.filters .select-trigger,.ai-bottom-bar .select-trigger,#topbar .select-trigger{font-size:12px}
.card-head .custom-select{width:auto;min-width:110px;max-width:170px;flex-shrink:0}.card-head h2{white-space:nowrap}.toolbar .custom-select{width:auto;flex:0 1 130px;min-width:90px}.toolbar .select-trigger,.card-head .select-trigger{font-size:12px}
@media(max-width:700px){.toolbar .custom-select{flex:1 1 120px}}
.customer-picker{gap:9px}.customer-picker .customer-query{background:#f6f8fb;border-radius:11px}.customer-search-results{display:grid;gap:5px;max-height:300px;overflow:auto}.customer-search-row{padding:10px;background:white;border:1px solid #e0e5ef;border-radius:12px;display:flex;gap:10px;text-align:left;align-items:center;width:100%}.customer-search-row:hover{background:#edf2ff;border-color:#bdcbfb}.customer-search-row>span:nth-child(2){flex:1}.customer-search-row small,.selected-customer small{display:block;color:#8b98a9;margin-top:4px;font-size:11px}.customer-search-row .avatar{width:32px;height:32px;font-size:12px}.selected-customer{display:flex;align-items:center;justify-content:space-between;padding:12px;border:1px solid #cbd7fa;border-radius:11px;background:#f0f4ff}.timeline-heading{display:flex;align-items:center;justify-content:space-between;margin:14px 0}.note-text{white-space:pre-wrap;overflow-wrap:anywhere}
body>section#call-tools{position:fixed;inset:auto;margin:0;min-width:0;max-height:none;display:flex;border:0;border-left:1px solid #e4e9f3;border-radius:0;box-shadow:none;background:#fff;z-index:35;overflow:hidden}
body>section#call-tools[hidden]{display:none!important}
body>section#call-tools:not([hidden]){display:flex}
#call-tools .call-tools-header{height:47px;min-height:47px;box-sizing:border-box;padding:8px 10px;background:#fff;font-size:12px;gap:5px}.call-tools-header button{padding:5px 7px!important}
#call-tools .panel-body{padding:12px}#call-tools .panel-customer{padding:0 0 13px;gap:7px}#call-tools .panel-customer .avatar{width:30px;height:30px;font-size:13px}#call-tools .panel-customer small{font-size:10px}#call-tools .field{font-size:11px}#call-tools .form-grid{gap:7px}#call-tools input{min-width:0}#call-tools .studio-panel{overflow:auto}#call-tools .history-item p{white-space:pre-wrap}#call-tools .notice{font-size:11px}
.customer-picker{display:grid;gap:9px;font-size:12px;color:#7e8da5}.customer-picker .customer-query{width:100%;font-size:13px;color:#26374c}.customer-search-row{color:#26374c}
.select-menu[data-navigation]>button{background:transparent;transition:none}
.select-menu[data-navigation=pointer]>button:hover:not(:disabled),
.select-menu[data-navigation=keyboard]>button.focused{background:#e1e8f6}

.select-menu>button.select-menu-footer{margin-top:6px;padding-top:12px;border-top:1px solid #dce3ed;border-radius:0 0 7px 7px;color:#7c8aa1;font-size:13px}
.select-menu>button.select-menu-footer:hover{background:#e1e8f6;color:#4263eb}
#profile-form .form-grid{align-items:start}
#profile-form label.field{grid-template-rows:18px 40px;align-content:start;gap:8px;line-height:18px}
#profile-form .field>input,#profile-form .field>.custom-select,#profile-form .select-trigger{height:40px}
#profile-form .field>input,#profile-form .select-trigger{font-size:13px;line-height:20px;padding:9px 12px}
#profile-form .select-trigger{padding-right:32px}
#profile-form .field>small{margin:0;font-size:11px;line-height:18px}
.workspace-list{display:grid;gap:10px;margin:20px 0}
.workspace-row{display:flex;align-items:center;gap:14px;padding:18px;border:1px solid #e4e9f2;border-radius:15px;background:#fafbfe}
.workspace-symbol{display:grid;place-items:center;width:42px;height:42px;flex-shrink:0;border-radius:12px;background:#edf1ff;color:#4965ed}
.workspace-info{flex:1;min-width:0}.workspace-info strong{overflow-wrap:anywhere}.workspace-info small{display:block;color:#8b98ae;margin-top:6px}.workspace-info .pill{font-size:10px;margin-left:5px}
.workspace-row-actions{display:flex;gap:6px;flex-shrink:0}.workspace-create{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:18px 0}
@media(max-width:600px){.workspace-row{flex-wrap:wrap;padding:14px}.workspace-row-actions{width:100%;justify-content:flex-end}}

/* Three filled AI stars in the product's main blue. */
:root{--ai-accent:#4263eb}
/* Standalone account entry keeps the workspace rails out of the signed-out view. */
body.auth-view{overflow:auto}
#auth-screen{display:flex;align-items:center;justify-content:center;min-height:100dvh;max-width:none;padding:48px 28px}
#auth-screen .auth-grid{width:min(100%,980px);grid-template-columns:1fr 420px;gap:64px;margin:0}
#auth-screen .auth-story{padding:12px 0;margin:0}
.auth-brand{display:flex;align-items:center;gap:12px;margin-bottom:48px;font-size:25px;font-weight:750;letter-spacing:-.7px}
.auth-brand .brand-mark{width:46px;height:46px;border-radius:15px;background:linear-gradient(155deg,#5572fa,#3e5ce3);box-shadow:0 6px 16px #4263eb22}
#auth-screen .auth-story .eyebrow{color:#8793a4;font-size:10px;letter-spacing:1.8px}
#auth-screen .auth-story h2{font-size:32px;line-height:1.55;letter-spacing:-1px;margin-top:15px}
#auth-screen .auth-story p{font-size:14px;line-height:1.9;color:#8793a4;margin-bottom:0}
#auth-screen .auth-card{padding:30px;border:1px solid #ffffffcf;border-radius:22px;background:#ffffffd9;box-shadow:var(--surface-shadow)}
#auth-screen .auth-tabs{display:flex;gap:4px;padding:4px;border-radius:12px;background:#eef1f6;margin-bottom:27px}
#auth-screen .auth-tabs button{width:auto;flex:1;margin:0;border:0;border-radius:9px;background:transparent;padding:9px;color:#8793a4}
#auth-screen .auth-tabs button[aria-selected=true]{background:white;color:#4263eb;box-shadow:0 2px 7px #26364c0b;font-weight:650}
#auth-screen h1{font-size:24px;margin:0 0 4px;letter-spacing:-.6px}
#auth-screen .subtitle{margin:0 0 23px;font-size:13px;color:#8793a4}
#auth-screen .stack{gap:16px}
#auth-screen label{margin:0}
#auth-screen input:not([type=checkbox]){min-height:44px;background:white;border-radius:10px}
#auth-screen .auth-consent{display:flex;gap:8px;align-items:center;font-size:11px;color:#8793a4}
#auth-screen .auth-consent input{flex-shrink:0;accent-color:#4263eb}
#auth-screen .error{margin:12px 0;min-height:0}
#auth-screen .auth-submit{margin:4px 0 0;min-height:44px;border-radius:10px;justify-content:center;box-shadow:0 4px 12px #4263eb1c}
#auth-screen .auth-recovery{margin:9px 0 0;font-size:12px;color:#8793a4}
.auth-prototype-note{border-top:1px solid var(--line);padding-top:17px;margin:20px 0 0;color:#8793a4;font-size:11px;line-height:1.8;text-align:center}
@media(max-width:850px){#auth-screen{padding:32px 20px}#auth-screen .auth-grid{grid-template-columns:minmax(0,420px);justify-content:center;gap:27px}.auth-brand{margin-bottom:20px}#auth-screen .auth-story h2{font-size:23px}#auth-screen .auth-story p,#auth-screen .auth-story .eyebrow{display:none}}
@media(max-width:450px){#auth-screen{padding:24px 16px}#auth-screen .auth-card{padding:23px 20px}#auth-screen .auth-story h2{font-size:21px}.auth-brand{font-size:23px}}
.i.ai-sparkles{color:var(--ai-accent);fill:currentColor}
#ai-panel .ai-tool .ai-sparkles{width:20px;height:20px}
.ai-footer>label>.ai-sparkles{width:16px;height:16px}

/* Integrated workspace dashboard: studio work and customer conversations. */
.workspace-overview-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px;margin-bottom:30px}.workspace-overview-grid .card-head{flex-wrap:wrap}.workspace-overview-grid .card-head h2{white-space:normal}.continue-script{display:flex;gap:13px;align-items:center;margin-bottom:17px}.continue-script .routine-symbol{flex-shrink:0;margin:0}.continue-script small{display:block;font-size:11px;color:#8996ab;margin-bottom:4px}.continue-script strong{font-size:16px;overflow-wrap:anywhere}.continue-script p{font-size:11px;color:#8996ab;margin-top:4px}.workspace-script-list{margin-top:19px;border-top:1px solid #edf1f7}.workspace-script-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 0;border-bottom:1px solid #edf1f7}.workspace-script-row:last-child{border-bottom:0}.workspace-script-row>span{min-width:0;display:grid;grid-template-columns:18px minmax(0,1fr);gap:3px 7px}.workspace-script-row .i{grid-row:span 2;color:#93a2b9;align-self:center}.workspace-script-row strong{font-size:12px;overflow-wrap:anywhere}.workspace-script-row small{color:#99a5b7;font-size:10px;overflow-wrap:anywhere}.workspace-script-row>b{font-size:10px;color:#8c9aaf;font-weight:500;white-space:nowrap}.dashboard-section-title{margin-bottom:18px}.dashboard-section-title p{color:#99a5b7;font-size:11px;margin-top:4px}.dashboard-record{display:flex;align-items:center;gap:10px;width:100%;border:0;border-bottom:1px solid #edf1f7;border-radius:0;background:transparent;padding:13px 0;text-align:left}.dashboard-record:last-child{border:0}.dashboard-record>span:nth-child(2){min-width:0;flex:1}.dashboard-record strong{display:block;font-size:12px}.dashboard-record em{font-style:normal;font-size:10px;color:#6483c3;font-weight:500;margin-left:6px}.dashboard-record small{display:block;font-size:10px;color:#99a5b7;margin-top:3px}.dashboard-record p{font-size:11px;color:#8191a8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:5px}.dashboard-record>.i{color:#a6b2c5}.dashboard-record-empty{display:grid;justify-items:center;align-content:center;min-height:173px;color:#a0adbf;text-align:center;gap:10px}.dashboard-record-empty>.i{font-size:25px}.dashboard-record-empty strong{font-size:12px;color:#8796ad}.dashboard-record-empty p{font-size:11px;max-width:250px;line-height:1.8}@media(max-width:1150px){.workspace-overview-grid{grid-template-columns:minmax(0,1fr)}}

/* Give holiday labels breathing room beside the date circle. */
.calendar-holiday-label{display:inline-block;margin-inline-start:6px}
/* Subscription cards use the same surfaces and spacing as CRM settings. */
.plan-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.plan-card{display:flex;flex-direction:column;gap:14px;min-width:0}.plan-card>.pill{align-self:flex-start}.plan-card h2{font-size:25px;line-height:1.5;margin:0}.plan-card h2 small{font-size:13px;font-weight:500}.plan-card p{margin:0;line-height:1.7}.plan-card button{margin-top:auto}.credit-policy{line-height:1.8;padding:12px 4px}.plan-card .tiny{font-size:12px}#main .integration-card .kv{gap:16px;flex-wrap:wrap}@media(max-width:1200px){.plan-grid{grid-template-columns:1fr}.plan-card h2{font-size:23px}}

.auth-loading{display:grid;place-items:center;min-height:100dvh;color:#73829c;font-size:15px}.setting-row>div{flex:1;min-width:0}.setting-row small,.table-wrap td>small{display:block;color:#7d8fa9;margin-top:5px}.setting-row{flex-wrap:wrap}.note-text{overflow-wrap:anywhere}
.payment-method-card .kv{grid-template-columns:minmax(0,1fr) auto;align-items:center}.payment-method-card .kv button{justify-self:end;white-space:nowrap}.payment-method-card .kv>span{color:var(--ink);font-weight:600}

/* Dialog rhythm: space whole fields, never the label and its control separately. */
.modal-body{--modal-field-gap:18px;--modal-help-gap:14px;line-height:1.7;overflow-wrap:anywhere}
.modal-body> :where(* + *:not(.gap):not(.setting-row):not(.error:empty)){margin-block-start:var(--modal-field-gap)}
.modal-body> :where(.field,.form-grid,button,.toolbar,.checks)+p{margin-block-start:var(--modal-help-gap)}
.modal-body label.field{gap:8px;min-width:0}
.modal-body .form-grid{row-gap:var(--modal-field-gap)}
.modal-body .stack{gap:var(--modal-field-gap)}
.modal-body :where(label.auth-consent,label.checks,.checks>label){display:flex;align-items:flex-start;gap:10px;min-width:0;font-size:13px;line-height:1.7}
.modal-body .auth-consent>span{min-width:0}
.modal-body :where(.auth-consent,.checks) input:is([type=checkbox],[type=radio]){flex:0 0 16px;width:16px;height:16px;margin:3px 0 0;accent-color:var(--accent)}
.modal-body .checks:not(label){gap:12px 18px}
.modal-body .detail-actions{gap:10px;row-gap:12px}
.modal-footer{gap:10px;flex-wrap:wrap}
.modal-footer>button{white-space:normal}
.modal-body .field> :where(input,textarea,.custom-select,.date-time-control){min-width:0;max-width:100%}
.modal-body>p{line-height:1.8;overflow-wrap:anywhere}
.modal-body>#form-error:empty{display:none}
.modal-body>.gap+*{margin-block-start:0}
@media(max-width:600px){.modal-body{--modal-field-gap:16px;--modal-help-gap:12px}}
/* Phone shell: full-width content, off-canvas navigation and a full-screen AI sheet. */
#mobile-appbar{display:none}
@media(max-width:767px),(max-width:950px) and (pointer:coarse){
  body:not(.auth-view){overflow:hidden}
  body:not(.auth-view) #mobile-appbar{position:fixed;inset:0 0 auto;height:52px;z-index:50;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 8px;background:var(--surface);border-bottom:1px solid var(--line)}
  #mobile-appbar>span{display:flex;align-items:center;gap:8px;font-weight:750;font-size:16px;color:var(--ink)}
  #mobile-appbar button{min-width:44px;min-height:44px;display:flex;align-items:center;justify-content:center;gap:6px;padding:8px;border:0;border-radius:10px;background:var(--accent-soft);color:var(--accent)}
  body:not(.auth-view) :is(#studio,#crm-module){top:57px;left:0;right:0;bottom:0;border-radius:0;border-width:0;box-shadow:none;min-width:0}
  body:not(.auth-view) #sidebar{width:min(288px,calc(100vw - 44px));max-width:100%;z-index:60}
  body:not(.auth-view) #sidebar.collapsed{display:none}
  #nav-backdrop:not([hidden]){left:0;z-index:55}
  body:not(.auth-view) #ai-panel{inset:0;width:100%;max-width:none;height:100dvh;z-index:80;border:0;border-radius:0;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);background:var(--surface)}
  body:not(.auth-view) #ai-panel.wide{width:100%}
  body:not(.auth-view) #ai-panel.collapsed{display:none;width:0}
  #ai-panel .ai-header{height:auto;min-height:60px;padding:6px 12px;gap:8px;flex-shrink:0}
  #ai-panel .ai-thread-title{min-height:44px;min-width:0;flex:1}
  #ai-panel .ai-thread-title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #ai-panel .ai-tool{min-width:44px;min-height:44px}
  #ai-panel [data-action=ai-wide]{display:none}
  #ai-panel .ai-content{min-height:0}
  #ai-panel .ai-scroll{overscroll-behavior:contain}
  #ai-panel .ai-compose{padding:10px 12px}
  #ai-panel textarea{font-size:16px}
  #ai-panel .ai-send{min-width:44px;min-height:44px}
  #crm-module .app,#main{min-width:0;max-width:100%}
}

/* Tier inventory and downgrade selection */
.plan-card .plan-limits{padding-left:18px;margin:16px 0 24px;font-size:13px;line-height:1.8;color:var(--muted)}
.quota-summary{margin-top:24px}.quota-summary>.primary{margin-top:12px}
.quota-choice{border:1px solid var(--line);border-radius:14px;padding:16px;display:grid;gap:12px;min-width:0;margin:0}
.quota-choice legend{padding:0 8px;font-weight:650}.quota-choice legend small{font-weight:400;color:var(--muted)}
.quota-choice label{display:flex;align-items:center;gap:12px;min-width:0}.quota-choice label span{overflow-wrap:anywhere}
.quota-choice input{width:18px;height:18px;margin:0;flex:0 0 18px;accent-color:var(--primary)}.quota-choice-count{color:var(--muted)}
.quota-readonly-banner{display:flex;align-items:center;gap:12px;padding:10px 16px;background:var(--surface);color:var(--muted);border-bottom:1px solid var(--line);font-size:13px;flex:0 0 auto}
#studio:not([hidden]):has(>.quota-readonly-banner){display:flex;flex-direction:column}#studio:not([hidden]):has(>.quota-readonly-banner)>iframe{min-height:0;flex:1}

.quota-summary .kv{display:grid;grid-template-columns:minmax(220px,1fr) minmax(130px,2fr);gap:24px}.quota-summary .kv>span:first-child{width:auto;max-width:none}

/* These cards already provide their own inset; keep headings on the body line. */
.integration-card>.card-head{padding:0;margin-bottom:20px}
