:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #edf7f4;
  --muted: #8eaaa5;
  --quiet: #8aa7a2;
  --surface: rgba(12, 26, 29, .9);
  --surface-strong: #0d2023;
  --surface-soft: #112b2e;
  --line: rgba(139, 194, 183, .18);
  --line-strong: rgba(139, 194, 183, .32);
  --mint: #72e3bd;
  --mint-soft: #b1f4dc;
  --coral: #ff9e98;
  --amber: #e8bd72;
  background: #071013;
  color: var(--ink);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -8%, rgba(55, 133, 127, .34), transparent 34rem),
    radial-gradient(circle at 92% 18%, rgba(35, 83, 99, .22), transparent 30rem),
    linear-gradient(155deg, #091518 0%, #071013 52%, #091315 100%);
  background-attachment: fixed;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
button {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: .7rem;
  padding: .72rem 1rem;
  color: #06120f;
  background: var(--mint);
  font-weight: 760;
  min-height: 2.75rem;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); background: #91edcc; }
button:disabled { cursor: not-allowed; opacity: .45; }
button.secondary { color: #d9eeea; background: #183136; border-color: var(--line); }
button.secondary:hover:not(:disabled) { background: #203f43; border-color: var(--line-strong); }
button.quiet { color: #a9c5c1; background: transparent; padding: .45rem .55rem; }
button.quiet:hover:not(:disabled) { color: var(--ink); background: rgba(255, 255, 255, .05); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible,
summary:focus-visible, [role="tabpanel"]:focus-visible, [tabindex="-1"]:focus-visible {
  outline: 3px solid rgba(114, 227, 189, .38);
  outline-offset: 2px;
}
.shell { width: min(1240px, 100%); margin: auto; padding: 1.5rem 2rem 3rem; }
.topbar, .section-heading, .composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.topbar { min-height: 5rem; margin-bottom: .65rem; }
.app-update-notice { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-block: 1rem; border-color: var(--amber); }
.app-update-notice > div { flex: 1 1 16rem; min-width: 0; }
.app-update-notice h2 { font-size: 1rem; margin-bottom: .35rem; }
.app-update-notice p { color: var(--muted); margin-bottom: 0; }
.app-update-notice button { flex: 0 0 auto; }
.brand-lockup { display: flex; align-items: center; gap: .8rem; }
.brand-mark {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid rgba(114, 227, 189, .48);
  border-radius: .85rem;
  color: var(--mint);
  background: linear-gradient(145deg, rgba(114, 227, 189, .12), rgba(114, 227, 189, .03));
  box-shadow: inset 0 0 1.2rem rgba(114, 227, 189, .08);
  font-weight: 850;
}
.brand-subtitle { margin: .2rem 0 0; color: var(--muted); font-size: .78rem; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; letter-spacing: .12em; font-size: 1.35rem; }
h2 { font-size: 1.05rem; margin-bottom: .7rem; }
.eyebrow { color: var(--mint); font-size: .68rem; font-weight: 760; text-transform: uppercase; letter-spacing: .14em; margin-bottom: .35rem; }
.status, .badge { border: 1px solid var(--line-strong); border-radius: 99px; padding: .35rem .65rem; color: #b4c5c4; font-size: .75rem; overflow-wrap: anywhere; }
.status[data-tone="ready"], .save-status[data-tone="ready"] { color: var(--mint); border-color: #36866d; }
.status[data-tone="denied"], .save-status[data-tone="denied"] { color: var(--coral); border-color: #8a4845; }
.panel {
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.2rem;
  background: var(--surface);
  box-shadow: 0 22px 65px rgba(0, 0, 0, .19);
  backdrop-filter: blur(18px);
}
.auth-panel { width: min(480px, 100%); margin: 8vh auto; }
.access-retry-panel { display: grid; gap: .8rem; }
.access-retry-panel p { margin-bottom: 0; color: #c7d8d5; line-height: 1.55; }
.access-retry-panel button { justify-self: start; }
form { display: grid; gap: .9rem; }
label { display: grid; gap: .35rem; color: #adc1bf; font-size: .85rem; }
input, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: .65rem; padding: .75rem; background: #081518; color: #f1f7f6; }
input:hover, textarea:hover { border-color: rgba(139, 194, 183, .46); }
textarea { resize: vertical; min-height: 7rem; }
.error { color: #ff9e98; min-height: 1.2em; margin-top: .8rem; }
.qr-frame { display: grid; place-items: center; min-height: 220px; margin: 1rem 0; padding: 1rem; border: 1px solid #385154; border-radius: .8rem; background: #fff; color: #142326; text-align: center; }
.qr-frame img { width: min(280px, 100%); height: auto; }
.product-shell { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; min-width: 0; gap: 1rem; }
.product-toolbar {
  position: sticky;
  z-index: 10;
  top: .75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem;
  border: 1px solid var(--line);
  border-radius: .95rem;
  background: rgba(7, 18, 21, .9);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .26);
  backdrop-filter: blur(20px);
  width: 100%;
  min-width: 0;
}
.product-tabs { display: flex; min-width: 0; gap: .25rem; padding: .1rem; }
.product-tabs button {
  min-height: 2.75rem;
  padding: .55rem .9rem;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  white-space: nowrap;
}
.product-tabs button:hover:not(:disabled) { color: var(--ink); background: rgba(255, 255, 255, .045); transform: none; }
.product-tabs button.is-active, .product-tabs button[aria-selected="true"] { color: var(--mint-soft); background: #173331; border-color: rgba(114, 227, 189, .2); }
.sign-out-button { flex: 0 0 auto; margin-right: .25rem; }
.product-panel { min-width: 0; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 285px); align-items: start; gap: 1rem; }
.rail { display: grid; min-width: 0; align-content: start; gap: 1rem; }
dl { display: grid; gap: .7rem; }
dl div { display: grid; gap: .12rem; }
dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #75908d; }
dd { margin: 0; word-break: break-word; font-size: .88rem; }
.proof-card { background: rgba(12, 28, 31, .78); box-shadow: none; }
.proof-card dd { color: #cfdfdc; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .72rem; }
.proof-card .run-summary dd { font: inherit; font-size: .85rem; line-height: 1.5; }
.proof-card .microcopy { margin-top: .75rem; }
.proof-card #pair-device { width: 100%; margin-top: .85rem; }
.proof-details { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--line); }
summary { cursor: pointer; color: #c6dbd6; line-height: 1.5; }
.proof-details summary { font-size: .78rem; }
.proof-details[open] summary { margin-bottom: .7rem; color: var(--mint-soft); }
.proof-details dl { margin-bottom: 0; }
.proof-details dd { overflow-wrap: anywhere; }
.chat-panel { min-width: 0; min-height: calc(100vh - 11rem); display: flex; flex-direction: column; }
.conversation-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; padding-bottom: .75rem; }
.conversation-toolbar > label { flex: 1 1 16rem; min-width: 0; }
.conversation-toolbar select { width: 100%; min-height: 2.75rem; padding: .65rem; border: 1px solid var(--line-strong); border-radius: .65rem; background: #081518; color: var(--ink); font: inherit; }
.conversation-toolbar > button { flex: 0 0 auto; }
.conversation-options { flex: 1 1 100%; }
.conversation-options summary { width: fit-content; padding: .25rem 0; font-size: .75rem; }
.conversation-option-actions { display: flex; flex-wrap: wrap; gap: .5rem; padding: .6rem 0; }
.conversation-option-actions button { font-size: .75rem; }
.conversation-status { margin: 0 0 1rem; }
.conversation-status[data-tone="denied"] { color: var(--coral); }
.conversation-history-actions { text-align: center; }
.conversation-history-actions button { margin-top: .75rem; font-size: .78rem; }
.chat-heading { padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
.eve-presence { display: inline-flex; align-items: center; color: var(--muted); font-size: .72rem; text-align: right; line-height: 1.45; }
.messages { flex: 1; min-width: 0; padding: 1rem 0 1.5rem; margin: 0; list-style: none; display: grid; align-content: start; gap: .75rem; }
.messages li { min-width: 0; max-width: min(88%, 44rem); padding: .85rem 1rem; border: 1px solid transparent; border-radius: .8rem; background: #12272b; overflow-wrap: anywhere; }
.messages li[data-role="user"] { justify-self: end; background: #183c35; border-color: rgba(114, 227, 189, .1); }
.welcome-message { background: transparent !important; border-color: var(--line) !important; }
.messages strong { color: #71e0bd; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.messages p { margin: .3rem 0 0; white-space: pre-wrap; line-height: 1.6; }
.microcopy { color: var(--muted); font-size: .75rem; line-height: 1.55; margin-bottom: 0; }
output { display: block; margin-top: .8rem; color: #71e0bd; font-family: ui-monospace, monospace; letter-spacing: .08em; }
.run-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.run-actions button { padding-inline: .55rem; font-size: .78rem; }
.composer { padding-top: 1rem; border-top: 1px solid var(--line); }
.composer > label[for="message"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.composer textarea { min-height: 6rem; background: rgba(4, 13, 15, .76); }
.composer .evan-model-controls { margin-bottom: 0; border-color: var(--line-strong); background: rgba(6, 18, 21, .5); }
.composer .evan-model-status { color: var(--muted); }
.proposal-review { border-top: 1px solid #284047; padding-top: 1rem; }
.proposal-list { display: grid; gap: .75rem; list-style: none; margin: 0; padding: 0; }
.proposal-card { background: #14282c; border: 1px solid #284047; border-radius: .75rem; padding: .85rem; }
.proposal-card p { margin: .35rem 0; }
.proposal-actions { display: flex; gap: .6rem; margin-top: .7rem; }
.evan-workspace-panel { grid-column: 1 / -1; min-width: 0; }
.product-page { min-height: calc(100vh - 9.5rem); padding: clamp(1.1rem, 2.3vw, 2rem); }
.product-page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; }
.product-page-heading > div { max-width: 48rem; }
.product-page-heading h2 { margin-bottom: .5rem; font-size: clamp(1.35rem, 2vw, 1.8rem); }
.product-page-heading p:last-child { margin-bottom: 0; color: var(--muted); line-height: 1.65; }
.memory-proof-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 1.5rem 0; }
.memory-proof-grid article {
  display: grid;
  min-width: 0;
  gap: .3rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: rgba(5, 17, 19, .48);
}
.memory-proof-grid span { color: var(--quiet); font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.memory-proof-grid strong { overflow-wrap: anywhere; color: var(--mint-soft); font-size: .9rem; }
.memory-proof-grid small { overflow-wrap: anywhere; color: var(--muted); }
.memory-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.memory-form fieldset:disabled { opacity: .62; }
.memory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.memory-grid label {
  gap: .25rem;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  color: #dbe9e6;
  background: rgba(7, 20, 23, .6);
  font-weight: 700;
}
.memory-grid label > span { color: var(--muted); font-size: .7rem; font-weight: 450; line-height: 1.45; }
.memory-grid textarea { margin-top: .35rem; min-height: 8rem; font-size: .82rem; line-height: 1.55; }
.memory-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.memory-actions p { margin: 0; color: var(--muted); font-size: .75rem; }
.save-status { margin: 1rem 0 0; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: .7rem; color: var(--amber); background: rgba(5, 16, 18, .62); font-size: .78rem; }
#memory-conflict { margin-top: 1rem; box-shadow: none; }
#memory-conflict h3 { margin-top: 0; }
#memory-conflict > p { color: var(--muted); line-height: 1.6; }
#memory-conflict .memory-proof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#memory-conflict article { align-content: start; overflow-wrap: anywhere; }
#memory-conflict article h4 { margin: 0 0 .5rem; }
#memory-conflict article p { margin-bottom: .7rem; color: var(--muted); line-height: 1.55; }
#memory-conflict .memory-actions { flex-wrap: wrap; }
.overwatch-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin: 1.5rem 0 1rem;
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--line-strong);
  border-radius: 1rem;
  background: radial-gradient(circle at 85% 0, rgba(114, 227, 189, .1), transparent 45%), #0a1c1f;
}
.overwatch-hero h3 { margin: .8rem 0 .35rem; font-size: clamp(1.15rem, 2vw, 1.55rem); }
.overwatch-hero p { margin: 0; color: var(--muted); }
.overwatch-hero > strong { color: var(--mint); font-size: clamp(2.2rem, 6vw, 4.2rem); letter-spacing: -.06em; }
.overwatch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.overwatch-grid article { padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: rgba(6, 18, 21, .62); }
.overwatch-grid article > div { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .65rem; }
.overwatch-grid i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--amber); box-shadow: 0 0 .7rem rgba(232, 189, 114, .25); }
.overwatch-grid article[data-state="ready"] i { background: var(--mint); box-shadow: 0 0 .7rem rgba(114, 227, 189, .45); }
.overwatch-grid h3 { margin: 0; font-size: .86rem; }
.overwatch-grid span { color: var(--amber); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.overwatch-grid article[data-state="ready"] span { color: var(--mint); }
.overwatch-grid p { margin: .65rem 0 0 1.25rem; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.boundary-note { display: flex; gap: 1rem; margin-top: 1rem; padding: .9rem 1rem; border-left: 3px solid var(--mint); color: #cbdad7; background: rgba(114, 227, 189, .045); }
.boundary-note strong { flex: 0 0 auto; }
.boundary-note p { margin: 0; color: var(--muted); }
.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; }
.evan-workspace-control { display: grid; gap: 1rem; margin-top: 1rem; }
.evan-workspace-section, .evan-workspace-status, .evan-workspace-record {
  border: 1px solid #294044; border-radius: .65rem; background: #0b171a;
}
.evan-workspace-section { padding: 1rem; }
.evan-workspace-section h3, .evan-workspace-status p, .evan-workspace-detail, .evan-workspace-empty { margin: 0; }
.evan-workspace-status p, .evan-workspace-detail, .evan-workspace-empty { color: #78918f; font-size: .76rem; }
.evan-workspace-status-grid, .evan-workspace-records {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem;
}
.evan-workspace-status, .evan-workspace-record { min-width: 0; padding: .8rem; }
.evan-workspace-status-heading, .evan-workspace-record-heading, .evan-workspace-section-heading {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem;
}
.evan-workspace-status p { margin-top: .35rem; }
.evan-workspace-state {
  flex: 0 0 auto; border-radius: 999px; padding: .25rem .52rem; color: #e2bd72;
  background: #211b10; font-size: .66rem; font-weight: 800; text-transform: lowercase;
}
.evan-workspace-state.is-active, .evan-workspace-state.is-approved,
.evan-workspace-state.is-succeeded, .evan-workspace-state.is-dispatched {
  color: #9cf0c5; background: #123b29;
}
.evan-workspace-field { display: grid; gap: .4rem; margin-top: .75rem; color: #adc1bf; font-size: .72rem; font-weight: 700; }
.evan-workspace-field select, .evan-workspace-field input, .evan-workspace-field textarea {
  width: 100%; border: 1px solid #385154; border-radius: .48rem; padding: .7rem; color: #f1f7f6; background: #0a1518;
}
.evan-workspace-field textarea { min-height: 6rem; resize: vertical; }
.evan-workspace-field :disabled { cursor: not-allowed; color: #78918f; opacity: 1; }
.evan-workspace-task-form { display: grid; gap: .7rem; }
.evan-workspace-task-form > .button { justify-self: start; }
.compact-button { width: fit-content; margin-top: .65rem; }
.evan-workspace-file-content {
  max-height: 24rem; overflow: auto; margin: .75rem 0 0; border: 1px solid #294044;
  border-radius: .45rem; padding: .7rem; color: #d9eeea; background: #091215;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.evan-workspace-records, .evan-workspace-detail { margin-top: .7rem; }
.evan-workspace-facts { display: grid; grid-template-columns: minmax(7rem, .35fr) minmax(0, 1fr); margin: .65rem 0 0; font-size: .72rem; }
.evan-workspace-facts dt, .evan-workspace-facts dd {
  min-width: 0; overflow-wrap: anywhere; margin: 0; padding: .35rem 0; border-top: 1px solid #294044;
}
.evan-workspace-facts dt { color: #78918f; font-weight: 700; }
.evan-workspace-facts dd { color: #d9eeea; }
.evan-workspace-empty { grid-column: 1 / -1; padding: .75rem; border: 1px dashed #385154; border-radius: .5rem; }
@media (max-width: 760px) {
  .shell { padding: .75rem .75rem max(2rem, env(safe-area-inset-bottom)); }
  .topbar { align-items: center; gap: .6rem; min-height: 4rem; }
  .topbar > .status { max-width: 48%; font-size: .68rem; }
  .brand-subtitle { display: none; }
  .product-toolbar { align-items: center; gap: .4rem; top: .4rem; }
  .product-tabs { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-tabs button { padding: .55rem .35rem; font-size: .8rem; line-height: 1.3; white-space: normal; }
  .sign-out-button { padding-inline: .45rem; font-size: .75rem; }
  .workspace, .memory-proof-grid, .memory-grid, .overwatch-grid,
  .evan-workspace-status-grid, .evan-workspace-records, .evan-workspace-facts { grid-template-columns: 1fr; }
  .chat-panel { min-height: 0; }
  .chat-heading { align-items: flex-start; }
  .chat-heading h2 { font-size: 1.05rem; }
  .eve-presence { max-width: 6.5rem; font-size: .68rem; }
  .messages li { max-width: 95%; padding: .75rem .85rem; }
  .composer-actions { flex-wrap: wrap; gap: .6rem; }
  .composer-actions > button { flex: 1 1 8rem; }
  .composer textarea, input { font-size: 1rem; }
  .conversation-toolbar > label { flex-basis: 100%; }
  .conversation-toolbar > button { width: 100%; }
  .conversation-toolbar select { font-size: 1rem; }
  .rail .run-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-page { min-height: 0; }
  .product-page-heading, .memory-actions, .overwatch-hero, .boundary-note,
  .evan-workspace-section-heading { align-items: stretch; flex-direction: column; }
  .overwatch-hero > strong { align-self: flex-end; }
  .boundary-note { gap: .35rem; }
  #memory-conflict .memory-proof-grid { grid-template-columns: 1fr; }
}
@media (min-width: 761px) and (max-width: 1040px) {
  .shell { padding-inline: 1.15rem; }
  .workspace { grid-template-columns: minmax(0, 1fr) 250px; }
  .chat-heading { align-items: flex-start; }
  .eve-presence { max-width: 6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.history-search { display: flex; align-items: end; gap: .75rem; margin: 1.25rem 0 .75rem; }
.history-search label { flex: 1; min-width: 0; }
.history-search select { display: block; width: 100%; min-width: 0; min-height: 44px; margin-top: .4rem; padding: .6rem; background: #14252b; color: #d9eeea; border: 1px solid #385154; border-radius: .4rem; font: inherit; }
.history-detail:has(#memory-activity-heading) { margin-top: 1.25rem; }
.history-layout { display: grid; grid-template-columns: minmax(15rem, .8fr) minmax(0, 1.3fr); gap: 1.25rem; }
.history-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .65rem; }
.history-record { width: 100%; text-align: left; padding: 1rem; background: #14252b; border: 1px solid #385154; color: #d9eeea; border-radius: .6rem; overflow-wrap: anywhere; }
.history-record[aria-pressed="true"] { border-color: #94d6c8; background: #19353a; }
.history-record strong, .history-record span { display: block; }
.history-record span { margin-top: .35rem; color: #a9c3be; font-size: .875rem; }
.history-record p { margin: .6rem 0 0; font-weight: 400; line-height: 1.5; }
.history-detail { min-width: 0; padding: 1.1rem; border: 1px solid #385154; border-radius: .6rem; }
.history-detail h4 { margin: 1.3rem 0 .6rem; }
.history-detail p, .history-detail li { line-height: 1.6; overflow-wrap: anywhere; }
.history-output { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.history-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin: .75rem 0; }
.history-facts dt { color: #a9c3be; font-size: .875rem; }
.history-facts dd { margin: .25rem 0 0; overflow-wrap: anywhere; }
.history-retrieval { padding-top: .7rem; border-top: 1px solid #385154; }
.history-retrieval ul { padding-left: 1.25rem; }
.history-detail pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8125rem; }
@media (max-width: 760px) { .history-layout { grid-template-columns: 1fr; } .history-search { flex-direction: column; align-items: stretch; } }

.history-list .history-record:hover, .history-list .history-record:focus-visible { background: #163c38; color: #f2fffb; border-color: #77dfbd; }
.history-list { max-height: 65vh; overflow-y: auto; overscroll-behavior: contain; }
.history-attempts { padding-left: 1.25rem; }
.history-attempts h5 { font-size: 1rem; margin: .6rem 0; }
.history-attempts .history-retrieval { margin: .8rem 0; }

/* Chat is the primary surface; diagnostic controls stay in Settings. */
body { background: #111516; }
.shell { width: min(1080px, 100%); padding-top: .65rem; }
.topbar { min-height: 3.75rem; }
.topbar .eyebrow { display: none; }
.brand-mark { width: 2.2rem; height: 2.2rem; border-radius: .65rem; background: #192623; box-shadow: none; }
.brand-subtitle { font-size: .7rem; }
.panel { background: #151b1c; box-shadow: none; backdrop-filter: none; }
.product-toolbar { position: static; border: 0; padding: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.product-tabs { gap: .3rem; }
.product-tabs button { min-height: 2.75rem; padding-inline: 1rem; }
#product-chat .workspace { display: block; }
.chat-panel { height: calc(100dvh - 11rem); min-height: 32rem; max-width: 54rem; margin-inline: auto; border: 0; padding: .4rem .5rem 0; background: transparent; }
.chat-topline { display: flex; align-items: flex-start; gap: .8rem; }
.chat-topline > .evan-model-controls { flex: 1 1 15rem; min-width: 0; margin: 0; }
.chat-topline > button { flex: 0 0 auto; }
.conversation-toolbar { padding: .25rem 0 0; }
.conversation-options { min-width: 0; }
.conversation-options > summary { min-height: 2.75rem; display: list-item; padding: .65rem .1rem; color: #acbdb8; font-size: .8rem; }
.conversation-options[open] { padding-bottom: .7rem; }
.conversation-options select { margin-top: .2rem; }
.conversation-status { margin: 0 0 .25rem; font-size: .72rem; }
.messages { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; min-height: 8rem; padding: 1.2rem .2rem 1.5rem; gap: 1.5rem; }
.messages li { max-width: 100%; padding: .2rem .1rem; border: 0; border-radius: .9rem; background: transparent; }
.messages li[data-role="user"] { max-width: 85%; padding: .85rem 1rem; background: #26322f; border: 0; }
.messages li[data-role="assistant"] { width: 100%; }
.assistant-stream-status { display: block; margin-top: .35rem; }
.messages li[data-live="true"] .assistant-stream-status::after {
  content: "";
  display: inline-block;
  width: .35rem;
  height: .35rem;
  margin-left: .45rem;
  border-radius: 999px;
  background: var(--accent, #72e3bd);
  animation: evan-pulse 1s ease-in-out infinite alternate;
}
@keyframes evan-pulse { to { opacity: .25; transform: scale(.75); } }
.messages strong { display: block; color: #9db1a9; font-size: .7rem; letter-spacing: .06em; }
.messages p { font-size: .98rem; line-height: 1.75; }
.welcome-message { align-self: center; text-align: center; padding-block: 3.5rem !important; border: 0 !important; }
.welcome-message strong { display: none; }
.welcome-message p { font-size: clamp(1.35rem, 3vw, 1.9rem); font-weight: 550; letter-spacing: -.025em; }
.composer { flex: 0 0 auto; padding: .75rem; border: 1px solid #40514a; border-radius: 1rem; background: #1b2422; gap: .55rem; }
.composer textarea { min-height: 4.5rem; max-height: 35dvh; border: 0; padding: .35rem .25rem; background: transparent; resize: vertical; font-size: 1rem; line-height: 1.6; }
.composer textarea:focus-visible { outline-offset: 2px; }
.composer-actions { align-items: center; gap: .5rem; }
.composer-buttons { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .45rem; margin-left: auto; }
.composer-buttons button { min-height: 2.75rem; }
#chat-progress { font-size: .75rem; flex: 1 1 auto; }
#composer-help { font-size: .68rem; }
.settings-heading { padding: .5rem 0 1rem; }
.settings-heading h2 { margin-bottom: .4rem; font-size: 1.35rem; }
.settings-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.settings-tabs button { color: var(--muted); background: transparent; border-color: var(--line); }
.settings-tabs button[aria-pressed="true"] { color: var(--ink); background: #24352f; border-color: #5c8778; }
.settings-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.settings-detail-grid > section { min-width: 0; }
.settings-detail-grid > section:last-child { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .shell { padding: .5rem .65rem max(1rem, env(safe-area-inset-bottom)); }
  .topbar { min-width: 0; min-height: 3rem; }
  .topbar .brand-lockup { min-width: 0; }
  .topbar > .status { min-width: 0; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .product-tabs { display: flex; }
  .product-tabs button { font-size: .8rem; padding-inline: .65rem; white-space: nowrap; }
  .chat-panel { height: calc(100dvh - 10rem); min-height: 27rem; padding-inline: 0; }
  .chat-topline { gap: .4rem; }
  .chat-topline > button { font-size: .75rem; padding-inline: .7rem; }
  .messages li[data-role="user"] { max-width: 92%; }
  .messages p { font-size: 1rem; }
  .composer { padding: .6rem; }
  .composer-actions { flex-wrap: wrap; }
  .composer-buttons { flex: 0 1 auto; }
  .composer-buttons button { font-size: .8rem; padding-inline: .7rem; }
  .settings-tabs { gap: .4rem; }
  .settings-tabs button { flex: 1 1 auto; font-size: .8rem; padding-inline: .65rem; }
  .settings-detail-grid { grid-template-columns: 1fr; }
}
