/* RayCraft Office, approved v2 palette and controls. */
:root{--rc-bg:#eef3f6;--rc-surface:#fff;--rc-raised:#f4f8fa;--rc-field:#f9fbfc;--rc-line:#ccd8e1;--rc-text:#152f40;--rc-muted:#495f70;--rc-accent:#00648b;--rc-button:#0875a3;--rc-button-ink:#fff}
html[data-theme=dark]{--rc-bg:#111d29;--rc-surface:#1b2a39;--rc-raised:#213344;--rc-field:#142331;--rc-line:#344657;--rc-text:#eff5fa;--rc-muted:#acc0cd;--rc-accent:#67d3fa;--rc-button:#87def8;--rc-button-ink:#073549}
html body{font-family:"Segoe UI",sans-serif;font-size:14px;color:var(--rc-text);background:radial-gradient(ellipse at 90% 0,color-mix(in srgb,var(--rc-accent) 7%,transparent),transparent 45%),var(--rc-bg)}
html body .workspace:before{display:none}
html body .sidebar{background:linear-gradient(150deg,#142b3b,#122231 60%);box-shadow:none;border-right:1px solid #344655;width:200px;padding:17px 10px 10px}
html body .workspace{margin-left:200px}
html body .sidebar .brand{padding:8px 12px 18px}
html body .sidebar .brand-wordmark{width:145px}
html body .sidebar .nav-label{display:none}
html body #main-nav a{font-size:13px;border-radius:7px;box-shadow:none;min-height:36px;border:1px solid transparent;padding:7px 10px;color:#cbd9e2}
html body #main-nav a.active,html body #main-nav a[aria-current=page]{background:linear-gradient(95deg,#174659,#1c3546);box-shadow:inset 3px 0 #6cd4f4;border-color:transparent;color:#e7f9ff}
html body #main-nav details>summary{letter-spacing:.04em;padding:8px 10px;color:#a8bfce;font-size:11px}
html body main{padding:28px clamp(18px,3vw,42px);max-width:1300px}
html body .page-head{position:relative;isolation:isolate;overflow:hidden;background:linear-gradient(108deg,var(--rc-surface) 35%,color-mix(in srgb,var(--rc-accent) 9%,var(--rc-surface)));border:1px solid var(--rc-line);border-radius:14px;padding:22px 25px;margin-bottom:18px;box-shadow:inset 0 1px #ffffff0d}
html body .page-head:after{content:"";position:absolute;z-index:-1;right:0;top:0;bottom:0;width:28%;opacity:.32;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 120'%3E%3Cg fill='none' stroke='%235593a5'%3E%3Cpath d='M0 90H62L87 69l11 8 16-26 13 41 14-70 13 63 11-23 9 11h86'/%3E%3Cpath opacity='.3' d='M0 30h260M0 60h260M0 90h260M30 0v120M60 0v120M90 0v120M120 0v120M150 0v120M180 0v120M210 0v120'/%3E%3C/g%3E%3C/svg%3E") right center/cover;mask-image:linear-gradient(90deg,transparent,#000)}
html body h1{font-size:32px;font-weight:650;letter-spacing:-1px;line-height:1.17;margin:6px 0 10px;color:var(--rc-text)}
html body h2{font-size:22px;color:var(--rc-text)}html body h3{color:var(--rc-text)}
html body .page-head p,html body .source-label,html body .muted{color:var(--rc-muted)}
html body .eyebrow{color:var(--rc-accent);font-size:10px;letter-spacing:.13em}
html body .panel,html body .kb-card,html body dialog{border:1px solid var(--rc-line);background:var(--rc-surface);color:var(--rc-text);border-radius:12px;box-shadow:inset 0 1px #ffffff0a,0 8px 25px #050b140c}
html body .panel{padding:22px 24px}
html body input:not([type=checkbox]):not([type=radio]),html body textarea,html body select{background:var(--rc-field);border:1px solid var(--rc-line);border-radius:8px;color:var(--rc-text);font-size:14px;padding:10px 12px;box-shadow:inset 0 1px 2px #0001}
html body input::placeholder,html body textarea::placeholder{color:var(--rc-muted);opacity:.85}
html body label{font-size:13px;font-weight:600;color:var(--rc-text)}
html body button,html body a.primary,html body a.secondary{font-size:13px}
html body .primary{color:var(--rc-button-ink);background:linear-gradient(180deg,color-mix(in srgb,var(--rc-button) 91%,white),var(--rc-button));border:1px solid transparent;border-radius:8px;box-shadow:inset 0 1px #ffffff55,0 2px 5px #0002;min-height:38px;padding:8px 14px;text-shadow:none}
html body .secondary,html body .quiet{color:var(--rc-text);background:var(--rc-raised);border:1px solid var(--rc-line);border-radius:8px;box-shadow:inset 0 1px #ffffff10;min-height:36px;padding:7px 12px}
html body button:hover:not(:disabled){filter:brightness(1.06)}
html body button:active:not(:disabled){transform:translateY(1px)}
html body button:disabled{opacity:.55;cursor:default}
html body :is(button,a,input,textarea,select):focus-visible{outline:2px solid var(--rc-accent);outline-offset:3px}
html body :is(input,textarea):focus{border-color:var(--rc-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--rc-accent) 22%,transparent)}
html body .office-tab-strip{height:50px;background:linear-gradient(110deg,#14293a,#0e1c29 65%);border-bottom:1px solid #3b4d5a;gap:5px;padding:0 12px;right:44px;overflow-x:auto}
html body .office-tab-strip button{border-radius:7px;min-height:36px;font-size:13px;font-weight:600}
html body .office-tab-strip button[aria-pressed=true]{background:#24394a;box-shadow:inset 0 -2px #6cd4f4}
html body .with-office-tabs{padding-top:50px}
body.with-office-tabs:not(.auth-locked){padding-top:50px}
body.with-office-tabs:not(.auth-locked)>.sidebar{top:50px;height:calc(100dvh - 50px)}
html body .office-tab-frame{top:50px;height:calc(100% - 50px)}
html body .compact-tools{height:50px;background:#0e1c29;color:#e1edf5}
html body .compact-tools summary{line-height:50px}
html body .compact-tools>div{background:var(--rc-surface);color:var(--rc-text);border:1px solid var(--rc-line);border-radius:9px;padding:7px;width:220px;box-shadow:0 12px 28px #0003}
html body .compact-tools button{background:transparent;color:inherit;min-height:38px}
html body .office-drawer:not([hidden]){top:50px;width:350px;background:var(--rc-surface);color:var(--rc-text);border-left:1px solid var(--rc-line);box-shadow:none}
html body .office-drawer>header{height:auto;min-height:64px;border-color:var(--rc-line);padding:14px;gap:8px;background:var(--rc-surface)}
html body .office-drawer>header h2{font-size:18px;flex:1}
html body .office-drawer>header button{font-size:12px;background:var(--rc-raised);color:var(--rc-text);border-radius:7px;padding:7px 10px}
html body.drawer-open>.workspace{margin-right:350px}
html body.drawer-open>.office-tab-frame{width:calc(100% - 350px)}
.drawer-chat-home{padding:16px;overflow-y:auto}
.drawer-chat-home h3{font-size:12px;color:var(--rc-muted);margin:0 0 12px}
.drawer-chat-grid{display:grid;grid-template-columns:1fr;gap:10px}
.drawer-chat-grid button{display:grid;grid-template-columns:40px 1fr auto;align-items:center;gap:10px;text-align:left;width:100%;padding:14px 12px;border:1px solid var(--rc-line);border-radius:11px;background:var(--rc-raised);color:var(--rc-text)}
.drawer-chat-grid button strong{display:block;font-size:15px}
.drawer-chat-grid button small{display:block;color:var(--rc-muted);font-size:12px;font-weight:400;line-height:1.5;margin-top:4px;overflow-wrap:anywhere}
.drawer-chat-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:color-mix(in srgb,var(--rc-accent) 14%,var(--rc-surface));color:var(--rc-accent);font-size:20px}
.drawer-chat-count{font-size:11px;background:var(--rc-button);color:var(--rc-button-ink);border-radius:20px;padding:2px 7px}
.drawer-chat-actions{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}
.drawer-chat-error{color:var(--rc-muted);white-space:pre-wrap}
body.conversation-panel main{padding:12px}
body.conversation-panel .page-head,body.conversation-panel .work-banner,body.conversation-panel #main>.actions,body.conversation-panel #main>.chat-map{display:none!important}
body.conversation-panel .chat-shell{grid-template-columns:1fr;height:calc(100dvh - 24px);min-height:0}
body.conversation-panel .chat-shell.room-open .chat-rooms{display:none}
body.conversation-panel .chat-shell.room-open .chat-pane{display:flex}
body.conversation-panel .back-rooms{display:inline-block}
body.conversation-panel .chat-pane{min-height:0}
html body .chat-rooms,html body .chat-top,html body .composer,html body .chat-sync,html body .chat-pane{background:var(--rc-surface);color:var(--rc-text);border-color:var(--rc-line)}
html body .messages{background:var(--rc-bg)}
html body .bubble{background:var(--rc-raised);color:var(--rc-text);border-color:var(--rc-line);box-shadow:none;border-radius:3px 12px 12px}
html body .bubble.mine{background:color-mix(in srgb,var(--rc-accent) 12%,var(--rc-surface));border-radius:12px 3px 12px 12px}
html body .bubble .author,html body .bubble time{color:var(--rc-muted)}
.rc-quote-steps{display:flex;gap:8px;margin:0 0 12px}
.rc-quote-steps button{flex:1;text-align:left;border:0;border-bottom:2px solid var(--rc-line);border-radius:0;background:transparent;color:var(--rc-muted);padding:10px 2px}
.rc-quote-steps button.active{border-color:var(--rc-accent);color:var(--rc-text);font-weight:700}
.rc-quote-readiness{font-size:12px;color:var(--rc-muted);padding:0 0 14px}
html body .quote-workspace{grid-template-columns:minmax(0,1fr);position:relative}
html body .quote-template-sidebar{position:static}
html body .quote-template-sidebar>button{margin:0 0 18px}
.chat-admin-dialog{width:min(720px,94vw);max-height:90dvh;overflow:auto;padding:22px}
.chat-admin-row{display:flex;justify-content:space-between;align-items:center;gap:12px;border-top:1px solid var(--rc-line);padding:12px 0}
.chat-admin-row strong,.chat-admin-row small{display:block}
.chat-admin-row small{color:var(--rc-muted)}
.chat-admin-members{max-height:190px;overflow:auto;border:1px solid var(--rc-line);border-radius:8px;padding:10px}
.chat-admin-members label{display:flex;align-items:center;gap:8px;padding:5px}
html body.nav-collapsed .sidebar{width:76px}
html body.nav-collapsed .workspace{margin-left:76px}
@media(max-width:760px){
 html body .workspace{margin-left:0!important}
 html body.drawer-open>.workspace{margin-right:0}
 html body.drawer-open>.office-tab-frame{width:100%}
 html body .office-drawer:not([hidden]){width:100%;top:50px}
 html body .compact-bottom{background:#102130;border-top:1px solid #395063}
 html body main{padding:16px 12px}
 html body .panel{padding:16px}
 html body h1{font-size:26px}
 html body .page-head{padding:16px}
 html body .form-two{grid-template-columns:1fr}
 html body .office-tab-strip button{max-width:145px;font-size:12px;padding:0 8px}
 body.conversation-panel .compact-bottom{display:none!important}
 body.conversation-panel .workspace{padding-bottom:0}
 .chat-admin-row{align-items:flex-start;flex-wrap:wrap}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
html body .office-drawer{font-family:"Segoe UI",sans-serif;font-size:14px}
html body .office-drawer .drawer-chat-grid button{display:grid;grid-template-columns:40px minmax(0,1fr) auto;width:100%;text-align:left}
html body .office-drawer .drawer-chat-actions button{border:1px solid var(--rc-line);color:var(--rc-text);background:var(--rc-raised);border-radius:8px;padding:9px 12px;font-family:inherit}
html body .office-drawer .drawer-chat-home{padding:16px}
