:root {
  color-scheme: dark;
  --bg: #101211;
  --panel: #171a18;
  --panel-2: #1c201e;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f3f5f3;
  --muted: #969d98;
  --cyan: #43a7d3;
  --green: #7aaa69;
  --amber: #dda446;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0; }
button, textarea { font: inherit; }
button { cursor: pointer; }
select { font: inherit; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 70px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(16,18,17,.94); position: relative; z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 16px; color: inherit; text-decoration: none; }
.brand-lockup img { width: 38px; height: 38px; object-fit: contain; display: block; }
.brand-name { display: flex; flex-direction: column; line-height: 1; gap: 4px; }
.brand-name strong { font-size: 16px; letter-spacing: .28em; font-weight: 650; }
.brand-name small { font-size: 7px; letter-spacing: .42em; color: #c7cbc8; }
.lab-badge { border: 1px solid rgba(67,167,211,.4); color: #9bd4ec; background: rgba(67,167,211,.08); padding: 5px 9px; border-radius: 4px; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.topbar-status { display: flex; align-items: center; gap: 16px; }
.new-question-button { padding: 7px 10px; color: #c8cfca; background: transparent; border: 1px solid var(--line); border-radius: 5px; font-size: 10px; font-weight: 700; }
.new-question-button:hover { color: white; border-color: rgba(67,167,211,.55); background: rgba(67,167,211,.06); }
.mobile-evidence-toggle { display: none; padding: 6px 8px; color: #c9ceca; background: transparent; border: 1px solid var(--line-strong); border-radius: 4px; font-size: 9px; font-weight: 750; }
.release-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.allowance-status { color: #c2c8c3; font-size: 10px; white-space: nowrap; }
.allowance-status[hidden] { display: none !important; }
.test-tier-control { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.test-tier-control[hidden] { display: none !important; }
.test-tier-control select { color: #dbe0dc; background: #1a1d1b; border: 1px solid var(--line-strong); border-radius: 4px; padding: 5px 7px; outline: none; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(122,170,105,.65); }

.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.conversation-panel { min-height: calc(100vh - 70px); display: flex; flex-direction: column; position: relative; }
.empty-state { width: min(760px, calc(100% - 48px)); margin: auto; padding: 58px 0 140px; text-align: center; }
.eyebrow { margin: 0 0 9px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.empty-state h1 { margin: 0; font-size: 42px; line-height: 1.1; font-weight: 690; }
.ask-title-row { display: flex; align-items: center; justify-content: center; gap: 11px; }
.beta-badge { padding: 4px 7px; border: 1px solid rgba(67,167,211,.45); border-radius: 4px; color: #9bd4ec; background: rgba(67,167,211,.08); font-size: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.intro { max-width: 650px; margin: 17px auto 30px; color: #b8beb9; line-height: 1.7; font-size: 14px; }
.example-question { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 36px; margin: -16px auto 24px; color: var(--muted); font-size: 9px; }
.example-question > span { flex: 0 0 auto; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.example-question button { max-width: 570px; padding: 0; overflow: hidden; color: #9bd4ec; background: transparent; border: 0; text-align: left; text-overflow: ellipsis; white-space: nowrap; transition: opacity .18s, color .18s; }
.example-question button:hover { color: white; }
.example-question button.changing { opacity: 0; }

.mimir-mark { width: 82px; height: 82px; margin: 0 auto 24px; position: relative; display: grid; place-items: center; }
.mimir-mark img { width: 42px; position: relative; z-index: 2; filter: drop-shadow(0 0 14px rgba(255,255,255,.15)); }
.orbit { position: absolute; border: 1px solid rgba(67,167,211,.3); inset: 8px; transform: rotate(45deg); animation: orbitPulse 2.8s ease-in-out infinite; }
.orbit-two { inset: 0; border-color: rgba(221,164,70,.18); animation-delay: .65s; }
@keyframes orbitPulse { 0%,100% { transform: rotate(45deg) scale(.92); opacity: .35; } 50% { transform: rotate(135deg) scale(1.04); opacity: 1; } }

.prompt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prompt-grid button { min-height: 76px; padding: 15px 16px; text-align: left; color: #cbd0cc; background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; transition: border-color .18s, background .18s, color .18s; }
.prompt-grid button:hover { color: white; border-color: rgba(67,167,211,.55); background: rgba(67,167,211,.06); }
.prompt-grid button strong { display: block; color: #e5e8e5; font-size: 13px; }
.prompt-grid button span { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }

.messages { width: min(850px, calc(100% - 48px)); margin: 0 auto; padding: 40px 0 150px; display: none; flex-direction: column; gap: 24px; }
.messages.active { display: flex; }
.message { border-left: 2px solid var(--line-strong); padding: 2px 0 2px 18px; }
.message.user { border-color: var(--amber); color: #dfe2df; font-size: 15px; }
.message.assistant { border-color: var(--cyan); }
.message-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.message-label { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.message-duration { color: #747b76; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.message-body { color: #c9ceca; font-size: 13px; line-height: 1.7; }
.message-body h3 { color: white; font-size: 13px; margin: 20px 0 7px; }
.message-body p { margin: 0 0 10px; }
.message-body ul { margin: 7px 0 14px; padding-left: 20px; }
.message-body strong { color: white; }
.message-body a { color: #82c6e4; text-decoration: none; }
.message-body a:hover { text-decoration: underline; }
.answer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.answer-report-download { display: inline-flex; align-items: center; padding: 7px 10px; color: #9fd3ef; background: rgba(72,154,198,.08); border: 1px solid rgba(72,154,198,.5); border-radius: 5px; font-size: 9px; font-weight: 750; text-decoration: none; }
.answer-report-download:hover { color: white; border-color: rgba(72,154,198,.9); background: rgba(72,154,198,.14); }
.answer-report-download:disabled { cursor: wait; opacity: .65; }
.exploration-prompts { margin-top: 16px; padding: 14px; border: 1px solid rgba(67,167,211,.22); border-radius: 6px; background: rgba(67,167,211,.035); }
.exploration-prompts strong { display: block; margin-bottom: 4px; color: white; font-size: 11px; }
.exploration-prompts p { margin: 0 0 10px; color: var(--muted); font-size: 10px; }
.exploration-options { display: flex; flex-wrap: wrap; gap: 7px; }
.exploration-options button { padding: 7px 9px; color: #b9dced; background: rgba(67,167,211,.055); border: 1px solid rgba(67,167,211,.3); border-radius: 5px; font-size: 9px; font-weight: 700; }
.exploration-options button:hover { color: white; border-color: rgba(67,167,211,.72); background: rgba(67,167,211,.11); }
.limit-card { display: grid; gap: 9px; max-width: 520px; margin-top: 8px; padding: 17px; border: 1px solid rgba(67,167,211,.3); border-radius: 6px; background: rgba(67,167,211,.045); }
.limit-card strong { color: white; font-size: 15px; }
.limit-card p { margin: 0; color: #b8beb9; font-size: 12px; line-height: 1.6; }
.limit-card a { width: fit-content; padding: 9px 13px; border-radius: 5px; color: white; background: #327fa0; font-size: 11px; font-weight: 750; text-decoration: none; }
.limit-card a:hover { background: #4092b6; }
.limit-card span { color: #777f79; font-size: 9px; }
.answer-table-shell { margin: 14px 0 24px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.016); overflow: hidden; }
.answer-table-label { padding: 10px 12px; border-bottom: 1px solid var(--line); color: #dfe3df; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.answer-table-scroll { overflow-x: auto; }
.answer-table-shell table { width: 100%; min-width: 980px; border-collapse: collapse; font-size: 10px; line-height: 1.45; }
.answer-table-shell th { padding: 9px 10px; color: #aeb5b0; background: rgba(255,255,255,.025); border-bottom: 1px solid var(--line); text-align: left; font-weight: 750; vertical-align: top; }
.answer-table-shell td { padding: 9px 10px; color: #bfc5c0; border-top: 1px solid rgba(255,255,255,.055); vertical-align: top; }
.answer-table-shell tbody tr:hover { background: rgba(67,167,211,.035); }
.answer-table-more { border-top: 1px solid var(--line); }
.answer-table-more summary { padding: 11px 12px; color: #8dcbe6; cursor: pointer; font-size: 10px; font-weight: 750; list-style: none; }
.answer-table-more summary::-webkit-details-marker { display: none; }
.answer-table-more[open] summary { border-bottom: 1px solid var(--line); }
.answer-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.answer-feedback > span { margin-right: 3px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.answer-feedback button { padding: 5px 8px; color: #aeb5b0; background: transparent; border: 1px solid var(--line); border-radius: 4px; font-size: 9px; }
.answer-feedback button:hover { color: white; border-color: rgba(67,167,211,.55); }
.answer-feedback.recorded { color: #a9c9a0; font-size: 10px; }
.clarification-options { display: grid; gap: 8px; margin-top: 14px; }
.clarification-options button { width: 100%; padding: 11px 12px; color: #d9e0db; background: rgba(67,167,211,.045); border: 1px solid rgba(67,167,211,.28); border-radius: 5px; text-align: left; font-size: 11px; line-height: 1.45; transition: border-color .18s, background .18s, color .18s; }
.clarification-options button:hover, .clarification-options button:focus-visible { color: white; border-color: rgba(67,167,211,.72); background: rgba(67,167,211,.1); outline: none; }

.thinking { width: min(850px, calc(100% - 48px)); margin: -120px auto 130px; padding: 14px 16px; align-items: center; gap: 14px; color: #dce0dc; background: rgba(28,32,30,.96); border: 1px solid rgba(67,167,211,.3); border-radius: 7px; box-shadow: 0 16px 42px rgba(0,0,0,.22); }
.thinking:not([hidden]) { display: flex; }
.thinking span { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.thinking .thinking-guidance { max-width: 650px; margin-top: 9px; padding-top: 8px; color: #aab3ad; border-top: 1px solid rgba(255,255,255,.08); font-size: 10.5px; line-height: 1.5; }
.thinking .thinking-guidance strong { display: inline; margin-right: 4px; color: #9bd4ec; font-size: inherit; }
.thinking time { margin-left: auto; color: #747b76; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.thinking-copy { flex: 1; min-width: 0; }
.thinking-track { width: min(360px, 100%); height: 2px; margin-top: 10px; overflow: hidden; background: rgba(255,255,255,.08); }
.thinking-track i { display: block; width: 0; height: 100%; background: var(--cyan); box-shadow: 0 0 10px rgba(67,167,211,.6); transition: width .45s ease; }
.thinking-mark { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border: 1px solid rgba(67,167,211,.45); animation: thinkSpin 2.4s linear infinite; }
.thinking-mark img { width: 19px; animation: thinkSpin 2.4s linear infinite reverse; }
@keyframes thinkSpin { to { transform: rotate(360deg); } }

.composer { position: fixed; z-index: 5; left: 0; right: 360px; bottom: 0; min-height: 104px; padding: 18px max(24px, calc((100% - 360px - 850px) / 2)); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: end; background: linear-gradient(to top, #101211 68%, rgba(16,18,17,0)); }
.composer textarea { width: 100%; min-height: 54px; max-height: 150px; resize: none; padding: 16px; color: white; background: #1b1e1c; border: 1px solid var(--line-strong); border-radius: 6px; outline: none; line-height: 1.45; }
.composer textarea:focus { border-color: rgba(67,167,211,.65); box-shadow: 0 0 0 3px rgba(67,167,211,.07); }
.composer button { height: 54px; min-width: 110px; border: 1px solid #4092b6; border-radius: 6px; background: #327fa0; color: white; font-weight: 750; font-size: 12px; }
.composer button:disabled { opacity: .45; cursor: not-allowed; }
.composer-validation { grid-column: 1 / -1; margin: 0; color: #efb86a; font-size: 10px; line-height: 1.4; }
.composer-validation[hidden] { display: none; }
.ai-disclosure { grid-column: 1 / -1; margin: 0; padding-left: 112px; color: #777f79; font-size: 9px; line-height: 1.35; }

.evidence-panel { border-left: 1px solid var(--line); background: rgba(23,26,24,.76); min-height: calc(100vh - 70px); padding: 24px 20px; overflow-y: auto; }
.evidence-header { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.evidence-header h2 { font-size: 17px; margin: 0; }
.evidence-header > span { color: var(--muted); font-size: 10px; }
.evidence-legend { display: flex; gap: 14px; padding: 13px 0; color: var(--muted); font-size: 9px; border-bottom: 1px solid var(--line); }
.evidence-legend span { display: flex; align-items: center; gap: 5px; }
.evidence-legend i { display: block; width: 6px; height: 6px; border-radius: 50%; }
.evidence-legend .source { background: var(--green); }
.evidence-legend .calculation { background: var(--cyan); }
.evidence-legend .analysis { background: var(--amber); }
.evidence-list { padding-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.evidence-download { display: block; padding: 10px 12px; border: 1px solid rgba(72,154,198,.5); border-radius: 6px; color: #9fd3ef; background: rgba(72,154,198,.08); font-size: 10px; font-weight: 700; text-decoration: none; text-align: center; }
.evidence-download:hover { border-color: rgba(72,154,198,.9); background: rgba(72,154,198,.14); }
.evidence-download[aria-busy="true"] { cursor: wait; opacity: .65; pointer-events: none; }
.evidence-pack-gate { display: grid; gap: 11px; padding: 13px; border: 1px solid rgba(221,164,70,.38); border-radius: 6px; background: rgba(221,164,70,.055); }
.evidence-pack-gate strong { display: block; color: #f0e2c5; font-size: 11px; }
.evidence-pack-gate span { display: block; margin-top: 5px; color: #a9a397; font-size: 9px; line-height: 1.5; }
.evidence-pack-gate a { display: block; padding: 8px 10px; border: 1px solid rgba(221,164,70,.5); border-radius: 4px; color: #f0c77f; text-align: center; text-decoration: none; font-size: 10px; font-weight: 750; }
.evidence-pack-gate a:hover { background: rgba(221,164,70,.1); border-color: rgba(221,164,70,.8); }
.evidence-placeholder { color: #777e79; line-height: 1.6; font-size: 11px; padding: 16px 2px; }
.evidence-intro { padding-top: 18px; }
.evidence-intro strong { display: block; margin-bottom: 6px; color: #d7dbd8; font-size: 12px; }
.evidence-intro span { display: block; }
.evidence-card { border: 1px solid var(--line); background: rgba(255,255,255,.018); border-radius: 6px; overflow: hidden; }
.evidence-card summary { list-style: none; padding: 12px; cursor: pointer; }
.evidence-card summary::-webkit-details-marker { display: none; }
.evidence-card .tool-name { display: block; color: #d7dbd8; font-size: 11px; font-weight: 750; }
.evidence-card .tool-meta { display: block; color: var(--muted); font-size: 9px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evidence-detail { border-top: 1px solid var(--line); padding: 11px; color: #a8aea9; font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.evidence-detail pre { margin: 0; white-space: pre-wrap; font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.evidence-section { border-top: 1px solid var(--line); padding: 11px 12px; }
.evidence-section:first-child { border-top: 0; }
.evidence-section h4 { margin: 0 0 8px; color: #dfe3df; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.evidence-row { padding: 8px 0; border-top: 1px solid rgba(255,255,255,.055); color: #a8aea9; font-size: 10px; line-height: 1.5; }
.evidence-row:first-of-type { border-top: 0; padding-top: 0; }
.evidence-row strong { display: block; color: #d5dad6; font-size: 10px; margin-bottom: 2px; }
.evidence-row a { color: #82c6e4; text-decoration: none; }
.evidence-row a:hover { text-decoration: underline; }
.evidence-tag { display: inline-block; margin: 3px 4px 0 0; padding: 2px 5px; border: 1px solid var(--line); border-radius: 3px; color: #969d98; font-size: 8px; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .topbar { z-index: 10; }
  .mobile-evidence-toggle { display: block; }
  .evidence-panel { display: block; position: fixed; z-index: 9; top: 70px; right: 0; bottom: 0; width: min(92vw, 380px); min-height: 0; transform: translateX(101%); transition: transform .22s ease; box-shadow: -18px 0 40px rgba(0,0,0,.32); }
  .evidence-panel.mobile-open { transform: translateX(0); }
  .composer { right: 0; }
  .release-status { display: none; }
  .topbar-status { gap: 8px; }
}

.pending-research-notice { width: min(850px, calc(100% - 32px)); margin: 16px auto; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 7px; color: #dce0dc; background: #1b1e1c; font-size: 13px; }
.pending-research-notice p { margin: 0 0 8px; }
.pending-research-notice button { margin: 4px 8px 4px 0; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 5px; color: #9bd4ec; background: transparent; font: inherit; cursor: pointer; white-space: normal; }
.pending-research-notice button:disabled { opacity: .5; cursor: default; }

@media (max-width: 620px) {
  .topbar { padding: 0 16px; }
  .brand-lockup img { width: 34px; height: 34px; }
  .brand-name { display: none; }
  .allowance-status { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  .test-tier-control label { display: none; }
  .empty-state { width: calc(100% - 30px); padding: 38px 0 220px; }
  .empty-state h1 { font-size: 34px; }
  .example-question { display: block; margin-top: -14px; }
  .example-question > span { display: block; margin-bottom: 6px; }
  .example-question button { max-width: 100%; text-align: center; white-space: normal; }
  .prompt-grid { grid-template-columns: 1fr; }
  .messages { width: calc(100% - 30px); }
  .composer { padding: 16px; grid-template-columns: 1fr; align-items: stretch; }
  .composer textarea { min-height: 58px; padding: 15px 16px 16px; line-height: 1.5; overflow-y: auto; }
  .composer button { width: 100%; }
  .ai-disclosure { padding-left: 128px; }
  .answer-table-shell table { min-width: 820px; }
}
