/* Shared visual language for the public platform. Kept last in the cascade. */
:root {
  --ui-ink: #142c46;
  --ui-muted: #61758d;
  --ui-accent: #1769b2;
  --ui-accent-deep: #11558f;
  --ui-border: #dbe5ee;
  --ui-surface: #ffffff;
  --ui-canvas: #f3f7fa;
  --ui-shadow: 0 14px 38px rgba(21, 57, 88, .065);
  --workspace-blue: var(--ui-accent);
  --workspace-navy: #10283e;
  --workspace-ink: var(--ui-ink);
  --workspace-muted: var(--ui-muted);
  --workspace-border: var(--ui-border);
  --bs-primary: var(--ui-accent);
  --bs-primary-rgb: 23, 105, 178;
}
html { scroll-behavior: smooth; }
body.workspace { background: var(--ui-canvas); color: var(--ui-ink); }
.workspace-header { border-bottom-color: var(--ui-border); box-shadow: 0 2px 16px rgba(16, 48, 75, .035); }
.workspace-header-home { color: var(--ui-ink); font-weight: 750; }
.workspace-top-nav { gap: 5px; }
.workspace-top-nav a { border-radius: 9px; color: #4b6380; font-weight: 650; }
.workspace-top-nav a:hover, .workspace-top-nav a.is-active { color: var(--ui-accent-deep); background: #eaf3fa; }
.workspace-sidebar { background: #10283e; }
.workspace-brand { margin-bottom: 28px; }
.workspace-nav>a.is-active, .workspace-directory-list a.is-active { background: #216da7; box-shadow: none; }
.workspace-directory-list details>summary:hover, .workspace-directory-list a:hover { background: #1d3c55; }
.workspace-content { max-width: 1580px; padding: 32px clamp(20px, 3vw, 48px); }
.workspace-footer { color: #74859a; }
.workspace-login.btn, .btn-primary { --bs-btn-bg: var(--ui-accent); --bs-btn-border-color: var(--ui-accent); --bs-btn-hover-bg: var(--ui-accent-deep); --bs-btn-hover-border-color: var(--ui-accent-deep); }

/* Homepage: one focal point, then a clear reading order. */
.home-full .home-design { max-width: 1500px; }
.home-full .workspace-content { padding-top: 26px; }
.home-full .home-quick { min-height: 390px; padding: clamp(30px, 5vw, 68px); border-radius: 20px; box-shadow: 0 24px 52px rgba(13, 41, 68, .15); }
.home-quick:before { background: linear-gradient(105deg, #0b2946 3%, #123d66ef 53%, #0a355a75 100%), radial-gradient(circle at 76% 25%, #5ea7d33d, transparent 35%); }
.home-quick h1 { max-width: none; font-size: clamp(32px, 3.2vw, 48px); line-height: 1.18; }
.home-quick p { color: #d8e7f3; }
.home-quick-form { border: 1px solid #d7e7f1; box-shadow: 0 15px 35px #071c3429; }
.home-quick-form button, .home-enter a { background: var(--ui-accent); }
.home-quick-form button:hover, .home-enter a:hover { background: var(--ui-accent-deep); }
.home-full .home-background { margin-top: 36px; }
.home-background-lead { display: grid; grid-template-columns:minmax(0,1fr) auto; gap: 7px 30px; align-items: center; margin-bottom: 16px; }
.home-background-lead>span { grid-column: 1/-1; font-size: 11px; }
.home-background-lead h2 { grid-column: 1; margin: 0; color: var(--ui-ink); font-size: clamp(23px,2.2vw,31px); line-height: 1.35; }
.home-background-lead p { grid-column: 1; max-width: 95ch; color: #526982; font-size: 14px; line-height: 1.7; }
.home-background-lead .home-text-link { grid-column: 2; grid-row: 2/4; align-self: center; white-space: nowrap; }
.home-background-cards { gap: 12px; }
.home-background-cards article { min-height: 108px; padding: 17px 20px; border-color: var(--ui-border); background: var(--ui-surface) !important; box-shadow: none; }
.home-background-cards article:after { display: none; }
.home-background-cards article>span { margin-bottom: 5px; font-size: 10px; }
.home-background-cards h3 { margin-bottom: 3px; color: var(--ui-ink); font-size: 17px; }
.home-background-cards p { max-width: none; font-size: 12px; line-height: 1.5; }
.home-full .home-domains { margin-top: 34px; }
.home-full .home-domain-list { gap: 10px; }
.home-full .home-domain, .home-full .home-domain:last-child { padding: 20px 26px; border-color: var(--ui-border); background: var(--ui-surface) !important; box-shadow: none; transition: border-color .2s ease, box-shadow .2s ease; }
.home-full .home-domain:hover { border-color: #acc9dc; box-shadow: 0 10px 25px rgba(21, 57, 88, .06); }
.home-full .home-domain:before { background: #3483b9; }
.home-full .home-domain:before { top: 0; left: 26px; bottom: auto; width: 44px; height: 3px; border-radius: 0 0 4px 4px; }
.home-full .home-domain:nth-child(2):before { background: #3b998f; }
.home-full .home-domain:nth-child(3):before { background: #766da7; }
.home-domain-intro { grid-template-columns: minmax(210px,.85fr) minmax(0,1.8fr) auto; gap: 16px; }
.home-full .home-domain-title h3 { font-size: clamp(22px,2vw,28px); }
.home-domain-intro>p { max-width: 72ch; color: var(--ui-muted); font-size: 13px; line-height: 1.55; }
.home-domain-enter { border-color: #cbddea; color: var(--ui-accent-deep); }
.home-domain-enter:hover { background: #ecf5fa; }
.home-full .home-domain .home-agent-area { margin-top: 13px; padding-top: 10px; border-color: #e6edf3; }
.home-full .home-domain .home-agent-heading strong { font-size: 13px; }
.home-agent-toggle { width: 29px; height: 29px; }
.home-agent-toggle { border-color: #cddfeb; background: #eef6fb; color: var(--ui-accent-deep); }
.home-full .home-topic-card { border-color: var(--ui-border); background: #fbfdff; }
.home-full .home-topic-card h4 { color: var(--ui-ink); }
.home-full .home-agent-grid a, .home-task-group a, .home-research-agents a { background: #fff; border-color: var(--ui-border); color: #24557e; }
.home-full .home-features { margin-top: 65px; }
.home-feature-grid article { border-color: var(--ui-border); box-shadow: var(--ui-shadow); }
.home-enter { border-radius: 18px; }

/* Section and about pages use the same surfaces and typographic rhythm. */
.directory-page { color: var(--ui-ink); }
.directory-hero, .about-heading { background: linear-gradient(105deg, #102e4c, #1a5685); border-radius: 17px; }
.directory-detail, .directory-group, .directory-agent-link, .about-background, .about-platform { border-color: var(--ui-border); border-radius: 15px; box-shadow: var(--ui-shadow); }
.directory-detail { padding: 28px clamp(24px, 3vw, 46px); }
.directory-detail p, .about-background-prose, .about-platform-content { color: #405a74; line-height: 1.88; }
.directory-agents-heading h2 { color: var(--ui-ink); }
.directory-group-head h3 { color: var(--ui-ink); }
.directory-agent-list a, .directory-agent-link { color: #23557e; background: #f9fcfe; }
.directory-agent-list a:hover, .directory-agent-link:hover { background: #edf6fa; border-color: #91bbd5; }
.about-workspace { max-width: none; }
.about-background, .about-platform { gap: clamp(24px, 4vw, 56px); }
.about-actions a:last-child { background: var(--ui-accent); border-color: var(--ui-accent); }

/* Chat keeps its controls and transport; only the visual shell changes. */
.workspace-chat-page .hbm-chat-shell { border-color: var(--ui-border); border-radius: 16px; box-shadow: var(--ui-shadow); }
.workspace-chat-page .hbm-chat-sidebar { background: #f6fafc; border-right-color: var(--ui-border); }
.workspace-chat-page .hbm-chat-header { border-bottom-color: var(--ui-border); }
.workspace-chat-page .hbm-chat-header h2 { color: var(--ui-ink); }
.workspace-chat-page .workspace-chat-avatar { background: #e6f3fa; color: var(--ui-accent); }
.workspace-chat-page .hbm-action-primary { background: var(--ui-accent); }

@media (max-width: 900px) {
  .home-background-cards { gap: 10px; }
  .home-full .home-domain, .home-full .home-domain:last-child { padding: 24px; }
}
@media (max-width: 700px) {
  .workspace-content { padding: 20px 16px; }
  .home-full .home-quick { min-height: 370px; padding: 30px 24px; }
  .home-full .home-background, .home-full .home-domains, .home-full .home-features { margin-top: 30px; }
  .home-background-lead { grid-template-columns: 1fr; }
  .home-background-lead>span, .home-background-lead h2, .home-background-lead p, .home-background-lead .home-text-link { grid-column: 1; grid-row: auto; }
  .home-background-cards { grid-template-columns: 1fr; }
  .home-background-cards article { min-height: 128px; }
  .home-full .home-domain:hover { transform: none; }
  .directory-detail { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .home-full .home-domain { transition: none; }
}

/* Full-width conversation and independent desktop navigation panels. */
.workspace-chat-page .workspace-content{max-width:none;padding:0}
.workspace-chat-page .hbm-chat-shell{border:0;border-radius:0;box-shadow:none;height:100%;width:100%}
.workspace-chat-page .message.assistant{width:100%;max-width:100%;align-self:stretch}
.workspace-chat-page .message.assistant .message-content{max-width:none;width:100%}
.workspace-history-toggle{padding:8px 12px;border:1px solid var(--ui-border);border-radius:8px;background:#fff;color:var(--ui-ink)}
@media(min-width:1001px){
 .workspace-chat-page .workspace-menu-toggle{display:inline-flex}
 .workspace-navigation-collapsed .workspace-sidebar{display:none}
 .workspace-navigation-collapsed .workspace-main{margin-left:0}
 .workspace-history-collapsed .hbm-chat-sidebar{display:none!important}
}
@media(max-width:1000px){.workspace-history-toggle{display:none}}

/* Give the sidebar brand name more room without a secondary tagline. */
.workspace-brand{gap:9px;margin-bottom:22px;align-items:center}
.workspace-brand img{width:32px;height:32px}
.workspace-brand>span{flex:1;min-width:0}
.workspace-brand strong{font-size:13px;line-height:1.65;text-wrap:wrap;letter-spacing:0}

.workspace-header-home{display:inline-flex;align-items:center;gap:9px}
.workspace-header-logo{flex:none;width:32px;height:32px;object-fit:contain}
.home-full .home-quick{min-height:340px;justify-content:center;align-items:flex-end;padding:38px clamp(24px,5vw,68px)}
.home-full .home-quick-image{inset:0;width:100%;height:100%;opacity:1;object-fit:cover}
.home-full .home-quick:before{background:linear-gradient(0deg,#09233e88,transparent 65%)}
.home-full .home-quick:after{display:none}
.home-full .home-quick-content{width:min(100%,800px)}
.home-full .home-background{margin-top:24px}
@media(max-width:700px){.home-full .home-quick{min-height:260px;padding:24px}.workspace-header-logo{width:26px;height:26px}}

/* Compact task chips on phones: width follows the label, with natural wrapping. */
@media(max-width:700px){
 .home-full .home-topic-card .home-task-group>div,
 .home-full .home-education-agents,
 .home-full .home-topic-card .home-research-agents,
 .directory-subgroup .directory-agent-list,
 .directory-group-grid.is-research .directory-agent-list,
 .directory-agent-grid{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start}
 .home-full .home-agent-grid a,
 .home-task-group a,
 .home-research-agents a,
 .directory-agent-list a,
 .directory-agent-link{flex:0 1 auto;width:auto;max-width:100%;min-height:42px;padding:9px 13px;gap:14px;font-size:13px;line-height:1.5;border-radius:8px;overflow-wrap:anywhere}
 .directory-agent-link strong{font-size:13px}
 .home-full .home-topic-card .home-task-group{grid-template-columns:1fr}
}

/* Technology-led homepage entrances, with readable task surfaces. */
.home-background-cards article{
 position:relative;isolation:isolate;overflow:hidden;padding:23px 25px;
 border:1px solid #c6dfed;background:linear-gradient(125deg,#fff,#edf7fc)!important;
 box-shadow:0 8px 26px #163e6510;border-radius:14px;
}
.home-background-cards article:after{display:block;position:absolute;inset:0;z-index:-1;width:auto;height:auto;border:0;border-radius:0;box-shadow:none;opacity:.5;background:linear-gradient(90deg,transparent 95%,#65b4d51c 95%),linear-gradient(transparent 95%,#65b4d51c 95%);background-size:26px 26px;mask-image:linear-gradient(90deg,transparent,black)}
.home-background-cards article>span{color:#247da5;letter-spacing:.13em}
.home-background-cards h3{font-size:19px;margin-bottom:7px}
.home-background-cards p{color:#536f85}
.home-full .home-domain,.home-full .home-domain:last-child{
 --domain-glow:#36a8e5;position:relative;isolation:isolate;overflow:hidden;
 padding:25px 30px;border:1px solid #2a526f;border-radius:17px;
 background:radial-gradient(ellipse at 95% 0%,#1675a945,transparent 48%),linear-gradient(115deg,#102a43,#143750)!important;
 box-shadow:0 14px 30px #0c294a16;
}
.home-full .home-domain:nth-child(2){--domain-glow:#3ad3c3;background:radial-gradient(ellipse at 95% 0%,#188b8740,transparent 48%),linear-gradient(115deg,#102d3e,#143c4b)!important}
.home-full .home-domain:nth-child(3){--domain-glow:#9aabff;background:radial-gradient(ellipse at 95% 0%,#575ca440,transparent 48%),linear-gradient(115deg,#172b47,#243958)!important}
.home-full .home-domain:before{inset:0;z-index:-1;width:auto;height:auto;border-radius:inherit;background:linear-gradient(90deg,transparent 98%,#94d9ff0c 98%),linear-gradient(transparent 98%,#94d9ff0c 98%);background-size:38px 38px;mask-image:linear-gradient(90deg,transparent,black)}
.home-full .home-domain:hover{transform:none;border-color:#548fae;box-shadow:0 16px 36px #0c294a22}
.home-domain-intro{grid-template-columns:minmax(230px,.8fr) minmax(0,1.8fr) auto;gap:24px;min-height:62px}
.home-full .home-domain-title{gap:14px}
.home-domain-number{display:grid;place-items:center;flex:none;width:39px;height:39px;border:1px solid #95d6ff45;border-radius:10px;background:#91d5ff0e;color:var(--domain-glow);font-size:13px}
.home-full .home-domain-title h3{color:#f4faff;font-size:27px;font-weight:750}
.home-domain-intro>p{color:#b7cddd;font-size:13px;line-height:1.8}
.home-domain-enter{background:#a4d7ff0c;border-color:#99c9e44d;color:#e0f4ff;border-radius:9px;padding:10px 15px}
.home-domain-enter:hover{background:#9edbff20;color:#fff;border-color:#91d7ff}
.home-full .home-domain .home-agent-area{border-color:#9acbe024;margin-top:19px;padding-top:13px}
.home-full .home-domain .home-agent-heading strong{color:#c2dfef;font-size:13px;font-weight:600}
.home-agent-toggle{background:#9ad9ff12;border-color:#9ad9ff40;color:#bfeaff;border-radius:8px;width:32px;height:32px}
.home-agent-toggle:hover{background:#9ad9ff28;border-color:#9ad9ff80}
.home-full .home-topic-card{background:#f7fbfe;border-color:#c9dce9}
.home-full .home-topic-card h4{color:#193f5f}
.home-full .home-agent-panel .home-education-agents a{background:#f4faff;border-color:#b9d4e8;color:#244e70}
.home-full .home-domain-list{gap:14px}
@media(max-width:1000px){
 .home-domain-intro{grid-template-columns:1fr auto;gap:13px}
 .home-domain-intro>p{grid-column:1/-1;grid-row:2;max-width:none}
 .home-domain-enter{grid-column:2;grid-row:1}
}
@media(max-width:700px){
 .home-background-cards{gap:10px}
 .home-background-cards article{padding:18px 20px;min-height:112px}
 .home-background-cards h3{font-size:18px}
 .home-full .home-domain,.home-full .home-domain:last-child{padding:20px;border-radius:14px}
 .home-domain-intro{grid-template-columns:minmax(0,1fr) auto;gap:13px 10px;min-height:0}
 .home-full .home-domain-title{gap:9px;white-space:normal}
 .home-domain-number{width:29px;height:29px;border-radius:7px;font-size:11px}
 .home-full .home-domain-title h3{font-size:21px;line-height:1.35}
 .home-domain-enter{font-size:11px;padding:8px 9px;gap:4px}
 .home-domain-intro>p{font-size:12px;line-height:1.75}
 .home-full .home-domain .home-agent-area{margin-top:15px;padding-top:12px}
}

/* Keep the shared header readable at tablet widths and browser zoom. */
.workspace-header-back{display:none}
.workspace-header-left{flex:0 1 auto;min-width:0}
.workspace-header-home{min-width:0}
.workspace-top-nav{flex-shrink:0}
@media(max-width:1200px){
 .workspace-header,.home-full .workspace-header{height:auto;min-height:64px;display:flex;flex-wrap:wrap;gap:8px 16px;padding:12px 22px}
 .workspace-header-left{flex:1 1 0;overflow:hidden}
 .workspace-header-home{max-width:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
 .workspace-header-separator,.workspace-current-page{display:none}
 .workspace-account{order:2;flex:none}
 .workspace-top-nav,.home-full .workspace-top-nav{order:3;flex:0 0 100%;width:100%;margin:0;justify-content:flex-start;gap:6px;overflow-x:auto;scrollbar-width:none}
 .workspace-top-nav a{padding:8px 12px;font-size:13px;flex:none}
}
@media(max-width:520px){
 .workspace-header,.home-full .workspace-header{padding:10px 14px;gap:8px}
 .workspace-header-home{font-size:12px;gap:7px}
 .workspace-top-nav,.home-full .workspace-top-nav{justify-content:space-between;gap:0}
 .workspace-top-nav a{padding:8px 5px;font-size:12px}
}

/* One header row; collapse section navigation into a disclosure menu. */
.workspace-nav-dropdown{margin-left:auto;position:relative;flex:none}
.workspace-nav-dropdown>summary{display:none;list-style:none;cursor:pointer}
.workspace-nav-dropdown>summary::-webkit-details-marker{display:none}
@media(min-width:1201px){
 .workspace-nav-dropdown:not([open])>.workspace-top-nav{display:flex}
}
@media(max-width:1200px){
 .workspace-header,.home-full .workspace-header{flex-wrap:nowrap;gap:12px;min-height:64px}
 .workspace-header-left{flex:1 1 0}
 .workspace-nav-dropdown{order:1;margin-left:0}
 .workspace-nav-dropdown>summary{display:flex;align-items:center;gap:8px;padding:9px 11px;border:1px solid #d9e6ef;border-radius:8px;color:#24577e;background:#f3f8fc;font-size:13px;font-weight:650;white-space:nowrap}
 .workspace-nav-dropdown>.workspace-top-nav,.home-full .workspace-nav-dropdown>.workspace-top-nav{position:absolute;top:calc(100% + 10px);right:0;width:190px;margin:0;padding:7px;display:flex;flex-direction:column;align-items:stretch;gap:3px;background:#fff;border:1px solid #dbe5ee;border-radius:12px;box-shadow:0 16px 40px #12334f25;overflow:visible;z-index:1100}
 .workspace-nav-dropdown:not([open])>.workspace-top-nav{display:none}
 .workspace-nav-dropdown>.workspace-top-nav a{justify-content:flex-start;padding:11px 13px;font-size:13px;border-radius:7px}
 .workspace-account{order:2}
}
@media(max-width:520px){
 .workspace-header,.home-full .workspace-header{gap:8px;padding:10px 12px}
 .workspace-nav-dropdown>summary{padding:8px;font-size:12px;gap:4px}
 .workspace-register{display:none}
 .workspace-header-home{font-size:11px}
 .workspace-header-logo{width:25px;height:25px}
 .workspace-login.btn{padding:7px 9px;font-size:11px}
 .workspace-login span{display:none}
}

/* Font-independent symbols with a fixed alignment box. */
.ui-icon-slot{display:inline-flex;align-items:center;justify-content:center;flex:0 0 18px;width:18px;height:18px;line-height:1;vertical-align:middle}
.ui-icon{display:block;width:18px;height:18px;flex:none;overflow:visible}
.home-agent-toggle .ui-icon-slot{width:18px;height:18px;font-size:inherit;line-height:1}
.workspace-nav-dropdown>summary .ui-icon-slot,.workspace-user-menu>summary>.ui-icon-slot{flex-basis:16px;width:16px;height:16px;transition:transform .16s}
.workspace-nav-dropdown[open]>summary .ui-icon-slot,.workspace-user-menu[open]>summary>.ui-icon-slot{transform:rotate(180deg)}
.home-quick-form button,.home-enter a{display:inline-flex;align-items:center;justify-content:center;gap:8px}

/* Keep task-category labels close to their buttons. */
.directory-subgroup,.directory-subgroup:nth-child(3){grid-template-columns:48px minmax(0,1fr);gap:12px}
@media(max-width:700px){
 .directory-subgroup,.directory-subgroup:nth-child(3){grid-template-columns:42px minmax(0,1fr);gap:10px}
 .directory-subgroup h4{margin-top:10px}
}
@media(max-width:380px){
 .directory-subgroup,.directory-subgroup:nth-child(3){grid-template-columns:1fr;gap:6px}
 .directory-subgroup h4{margin-top:0}
}

/* Agent task buttons use text only. */
.directory-agent-link>.ui-icon-slot,
.directory-agent-list a>.ui-icon-slot,
.home-education-agents a>.ui-icon-slot,
.home-task-group a>.ui-icon-slot,
.home-research-agents a>.ui-icon-slot{display:none}
