:root {
  color-scheme: dark;
  --ink: #f3f6f2;
  --muted: #9aa9aa;
  --subtle: #687879;
  --canvas: #091112;
  --panel: #0d1819;
  --panel-raised: #122122;
  --line: #203234;
  --line-bright: #30484a;
  --mint: #6aad35;
  --mint-deep: #1c3023;
  --blue-accent: #82b6e2;
  --aqua-accent: #8fd3c1;
  --amber: var(--aqua-accent);
  --danger: #f18b82;
  --shadow: 0 24px 80px rgba(0, 0, 0, .32);
  font-family: "IBM Plex Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { overflow-x: hidden; }
body { margin: 0; overflow-x: hidden; background: var(--canvas); color: var(--ink); font-size: 17px; }
button, textarea, input { font: inherit; }
button { color: inherit; }

.portal-shell { min-height: 100vh; display: grid; grid-template-columns: 292px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 26px 18px 20px; background: #0a1415; border-right: 1px solid var(--line);
}
.brand { display: block; color: inherit; text-decoration: none; padding: 0 8px; }
.brand-company { grid-column: 1 / -1; display: flex; align-items: center; gap: 11px; }
.brand-mark { display: block; width: 91px; height: auto; }
.brand-name { min-width: 0; padding-left: 15px; border-left: 1px solid #81908d; text-transform: uppercase; }
.brand-name strong, .brand-name small, .brand-product strong { display: block; }
.brand-name strong { color: #f5f7f4; font-size: 19px; font-weight: 750; letter-spacing: .22em; }
.brand-name small { margin-top: 4px; color: var(--mint); font-size: 11px; font-weight: 800; letter-spacing: .17em; }
.brand-divider { display: block; height: 1px; margin: 19px 0 14px; background: linear-gradient(90deg, #596869 72%, transparent); }
.brand-product strong { font-size: 14px; font-weight: 650; letter-spacing: .055em; }
.sidebar-label { margin: 46px 10px 10px; color: var(--subtle); font-size: 13px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.agent-nav { display: grid; gap: 5px; }
.agent-link {
  width: 100%; display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 10px;
  padding: 11px 10px; border: 1px solid transparent; border-radius: 11px; background: transparent;
  text-decoration: none; text-align: left; cursor: pointer;
}
.agent-link:hover { background: rgba(255,255,255,.025); }
.agent-link.active { background: var(--panel-raised); border-color: var(--line); }
.agent-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; background: #172728; color: var(--mint); font-size: 14px; font-weight: 800; }
.agent-link strong { display: block; color: var(--blue-accent); font-size: 15px; font-weight: 650; }
.agent-link small { display: block; margin-top: 3px; color: var(--subtle); font-size: 13px; }
.soon { color: var(--subtle); border: 1px solid var(--line); border-radius: 999px; padding: 2px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.agent-link.planned { opacity: .58; cursor: default; }
.sidebar-footer { margin-top: auto; padding: 0 8px; }
.access-button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: transparent; cursor: pointer; }
.access-button:hover { border-color: var(--line-bright); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(227,174,112,.1); }
.access-button.configured .status-dot { background: var(--mint); box-shadow: 0 0 0 4px rgba(146,224,192,.1); }
.sidebar-footer p { margin: 9px 2px 0; color: var(--subtle); font-size: 12px; }

.workspace { min-width: 0; height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background: radial-gradient(circle at 55% -15%, rgba(55,110,96,.13), transparent 34%); }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 34px 21px; border-bottom: 1px solid var(--line); }
.eyebrow, .dialog-kicker { color: var(--mint); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.workspace-header h1 { margin: 5px 0 0; font-family: "IBM Plex Serif", Georgia, serif; font-size: 27px; font-weight: 500; letter-spacing: -.02em; }
.header-meta { display: flex; align-items: center; gap: 10px; }
.availability, .model-badge { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; color: var(--muted); font-size: 13px; }
.execution-mode { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.execution-mode[hidden] { display: none; }
.execution-option { padding: 6px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.execution-option.active { background: var(--mint-deep); color: var(--mint); }
.availability i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--mint); }
.conversation { overflow-y: auto; padding: 50px max(34px, calc((100% - 850px) / 2)); }
.welcome { max-width: 760px; margin: 5vh auto 0; }
.welcome-kicker { color: var(--amber); font-size: 14px; letter-spacing: .05em; }
.welcome h2 { max-width: 650px; margin: 12px 0 14px; font-family: "IBM Plex Serif", Georgia, serif; font-size: clamp(38px, 5vw, 64px); line-height: .98; font-weight: 500; letter-spacing: -.045em; }
.welcome > p { max-width: 620px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.suggestions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 32px; }
.suggestions button { min-height: 84px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(18,33,34,.7); color: #cbd5d3; text-align: left; font-size: 14px; line-height: 1.45; cursor: pointer; }
.suggestions button:hover { transform: translateY(-1px); border-color: var(--line-bright); background: var(--panel-raised); }
.suggestion-topic { display: block; margin-bottom: 7px; color: var(--mint); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.suggestion-question { display: block; }
.message { max-width: 850px; margin: 0 auto 28px; }
.comparison-message { max-width: 1100px; margin: 0 auto 32px; }
.comparison-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.comparison-card { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.comparison-heading { display: flex; justify-content: space-between; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.comparison-heading strong { font-size: 13px; text-transform: capitalize; }
.comparison-heading span { color: var(--subtle); font-size: 10px; }
.comparison-answer { flex: 1; min-height: 180px; padding: 14px 13px; color: #d8dfdd; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.comparison-metrics { padding: 10px 13px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 10px; }
.comparison-pick { margin: 0 13px 13px; padding: 8px; border: 1px solid var(--line-bright); border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.comparison-pick:hover, .comparison-pick.selected { border-color: var(--mint); background: var(--mint-deep); color: var(--mint); }
.comparison-context { margin-top: 9px; color: var(--subtle); font-size: 10px; }
.message-label { margin-bottom: 9px; color: var(--subtle); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.message.user .message-body { margin-left: auto; width: fit-content; max-width: 75%; padding: 12px 16px; background: var(--mint-deep); border: 1px solid #245747; border-radius: 16px 16px 4px 16px; line-height: 1.55; }
.message.agent .message-body { color: #d8dfdd; font-size: 17px; line-height: 1.72; overflow-wrap: anywhere; }
.message-body > :first-child, .comparison-answer > :first-child { margin-top: 0; }
.message-body > :last-child, .comparison-answer > :last-child { margin-bottom: 0; }
.message-body p, .comparison-answer p { margin: 0 0 .9em; }
.message-body h2, .message-body h3, .message-body h4, .message-body h5,
.comparison-answer h2, .comparison-answer h3, .comparison-answer h4, .comparison-answer h5 { margin: 1.45em 0 .45em; color: var(--ink); line-height: 1.25; letter-spacing: -.015em; }
.message-body h2, .comparison-answer h2 { font-family: "IBM Plex Serif", Georgia, serif; font-size: 1.35em; font-weight: 500; }
.message-body h3, .comparison-answer h3 { font-size: 1.05em; }
.message-body h4, .message-body h5, .comparison-answer h4, .comparison-answer h5 { font-size: .95em; }
.message-body ul, .message-body ol, .comparison-answer ul, .comparison-answer ol { margin: .35em 0 1em; padding-left: 1.35em; }
.message-body li, .comparison-answer li { margin: .3em 0; padding-left: .15em; }
.message-body strong, .comparison-answer strong { color: var(--ink); font-weight: 720; }
.message-body em, .comparison-answer em { color: #e4ebe9; }
.message-body a, .comparison-answer a { color: var(--blue-accent); text-decoration-color: rgba(130,182,226,.55); text-underline-offset: .16em; }
.message-body a:hover, .comparison-answer a:hover { color: var(--aqua-accent); text-decoration-color: currentColor; }
.message-body code, .comparison-answer code { padding: .12em .34em; border-radius: 4px; background: #152728; color: #b8ecd7; font: .84em ui-monospace, SFMono-Regular, Menlo, monospace; }
.message-body pre, .comparison-answer pre { margin: .6em 0 1em; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: #071011; line-height: 1.55; }
.message-body pre code, .comparison-answer pre code { padding: 0; background: transparent; color: #d8dfdd; white-space: pre; }
.message-body blockquote, .comparison-answer blockquote { margin: .6em 0 1em; padding: .15em 0 .15em 1em; border-left: 3px solid var(--line-bright); color: var(--muted); }
.table-wrap { max-width: 100%; margin: .7em 0 1.15em; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
.table-wrap table { width: 100%; min-width: 680px; border-collapse: collapse; background: rgba(13,24,25,.7); font-size: .86em; line-height: 1.45; }
.table-wrap th, .table-wrap td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.table-wrap th { position: sticky; top: 0; background: #132122; color: var(--ink); font-size: .78em; letter-spacing: .06em; text-transform: uppercase; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:nth-child(even) { background: rgba(255,255,255,.018); }
.table-wrap code { white-space: normal; }
.citation { display: inline-block; margin: 2px 2px; padding: 3px 7px; border-radius: 6px; background: #152728; border: 1px solid var(--line); color: var(--mint); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: normal; }
.message-meta { margin-top: 12px; color: var(--subtle); font-size: 10px; }
.thinking { display: flex; gap: 5px; padding: 8px 0; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); animation: pulse 1.2s infinite ease-in-out; }
.thinking i:nth-child(2) { animation-delay: .16s; }
.thinking i:nth-child(3) { animation-delay: .32s; }
@keyframes pulse { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }

.composer-wrap { padding: 12px max(34px, calc((100% - 850px) / 2)) 22px; background: linear-gradient(transparent, var(--canvas) 24%); }
.answer-mode { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin: 0 4px 8px; }
.answer-mode > span { margin-right: 3px; color: var(--subtle); font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }
.mode-option { padding: 5px 9px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.mode-option:hover { color: var(--ink); }
.mode-option.active { border-color: var(--line-bright); background: var(--panel-raised); color: var(--mint); }
.composer { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px; padding: 11px 11px 11px 18px; border: 1px solid var(--line-bright); border-radius: 16px; background: var(--panel-raised); box-shadow: var(--shadow); }
.composer:focus-within { border-color: #4b756d; }
.composer textarea { width: 100%; max-height: 180px; resize: none; padding: 7px 0; border: 0; outline: 0; background: transparent; color: var(--ink); line-height: 1.5; }
.composer textarea::placeholder { color: var(--subtle); }
.composer button { width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--mint); color: #07110f; font-size: 20px; font-weight: 800; cursor: pointer; }
.composer button:disabled { opacity: .38; cursor: wait; }
.composer-wrap > p { margin: 9px 0 0; color: var(--subtle); text-align: center; font-size: 10px; }
.error { color: var(--danger); }

.access-dialog { width: min(440px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line-bright); border-radius: 16px; background: var(--panel-raised); color: var(--ink); box-shadow: var(--shadow); }
.access-dialog::backdrop { background: rgba(2,7,8,.8); backdrop-filter: blur(5px); }
.access-dialog form { position: relative; padding: 30px; }
.access-dialog h2 { margin: 8px 0; font-family: "IBM Plex Serif", Georgia, serif; font-size: 30px; font-weight: 500; }
.access-dialog p { color: var(--muted); line-height: 1.55; font-size: 13px; }
.access-dialog code { color: var(--mint); }
.access-dialog label { display: block; margin: 22px 0 7px; color: var(--muted); font-size: 11px; }
.access-dialog input { width: 100%; padding: 12px; border: 1px solid var(--line-bright); border-radius: 9px; outline: 0; background: #091415; color: var(--ink); }
.access-dialog input:focus { border-color: var(--mint); }
.dialog-submit { width: 100%; margin-top: 12px; padding: 12px; border: 0; border-radius: 9px; background: var(--mint); color: #07110f; font-weight: 750; cursor: pointer; }
.dialog-close { position: absolute; top: 15px; right: 16px; border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 960px) {
  .portal-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; min-width: 0; padding: 12px 16px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-label, .sidebar-footer { display: none; }
  .agent-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; }
  .agent-link { min-width: 0; padding: 8px; }
  .agent-link small, .soon { display: none; }
  .workspace { height: calc(100dvh - 116px); min-height: 360px; }
  .workspace-header { min-width: 0; padding: 12px 16px; }
  .workspace-header h1 { font-size: 23px; }
  .header-meta .model-badge { display: none; }
  .availability { display: none; }
  .conversation { min-width: 0; padding: 24px 18px; }
  .welcome { margin-top: 1vh; }
  .welcome h2 { font-size: clamp(34px, 10vw, 46px); }
  .welcome > p { font-size: 17px; }
  .suggestions { grid-template-columns: 1fr; }
  .comparison-results { grid-template-columns: 1fr; }
  .comparison-answer { min-height: auto; }
  .suggestions button { min-height: auto; }
  .composer-wrap { padding: 10px 16px 14px; }
  .composer, .message, .comparison-message { min-width: 0; }
  .message.user .message-body { max-width: 90%; overflow-wrap: anywhere; }
}

@media (max-width: 960px) and (orientation: landscape) and (max-height: 500px) {
  .sidebar { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 7px 12px; }
  .brand { display: block; padding: 0; }
  .brand-company { gap: 7px; }
  .brand-mark { width: 54px; }
  .brand-name { padding-left: 8px; }
  .brand-name strong { font-size: 12px; }
  .brand-name small { font-size: 7px; }
  .brand-divider, .brand-product { display: none; }
  .agent-nav { margin-top: 0; }
  .agent-link { grid-template-columns: 26px minmax(0, 1fr); padding: 5px 7px; }
  .agent-icon { width: 26px; height: 26px; }
  .agent-link strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .workspace { height: calc(100dvh - 49px); min-height: 0; }
  .workspace-header { padding: 7px 14px; }
  .workspace-header h1 { margin-top: 2px; font-size: 19px; }
  .eyebrow { display: none; }
  .conversation { padding: 16px 18px; }
  .welcome { margin-top: 0; }
  .welcome h2 { margin: 6px 0 8px; font-size: clamp(28px, 7vw, 38px); line-height: 1; }
  .welcome > p { margin: 0; font-size: 15px; line-height: 1.45; }
  .suggestions { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
  .suggestions button { padding: 9px; font-size: 12px; }
  .answer-mode { margin-bottom: 4px; }
  .composer-wrap { padding: 5px 14px 8px; }
  .composer-wrap > p { display: none; }
}
