:root {
  color-scheme: light;
  --bg:#fff;
  --panel:#f7f7f5;
  --text:#242626;
  --muted:#757975;
  --line:#e7e8e4;
  --soft:#f1f2ef;
  --accent:#245c49;
  --accent-soft:#e9f0eb;
  --shadow:0 3px 20px #19271b08;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

:root[data-theme="dark"] {
  color-scheme:dark;
  --bg:#202322;
  --panel:#191c1b;
  --text:#e8eae6;
  --muted:#a1a9a2;
  --line:#373d39;
  --soft:#2d332f;
  --accent:#a0d4b7;
  --accent-soft:#2c3c32;
  --shadow:none;
}

* {
  box-sizing:border-box;
}

[hidden] {
  display:none!important;
}

body {
  margin:0;
  color:var(--text);
  background:var(--bg);
  font-size:14px;
}

button,input,textarea {
  font:inherit;
}

button {
  cursor:pointer;
  color:inherit;
  border:1px solid var(--line);
  background:var(--bg);
  border-radius:10px;
  padding:10px 14px;
}

button:hover {
  background:var(--soft);
}

button:disabled {
  opacity:.5;
  cursor:wait;
}

input,textarea {
  color:var(--text);
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:10px;
  padding:12px;
  outline:none;
}

input:focus-visible,textarea:focus-visible,button:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:3px;
}

.muted {
  color:var(--muted);
}

.small {
  font-size:12px;
}

.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
}

.brand {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:21px;
  font-weight:650;
  letter-spacing:.02em;
}

.hal-eye {
  width:25px;
  height:25px;
  border:5px solid #252827;
  border-radius:50%;
  background:radial-gradient(circle at 42% 35%,#fff7bd 0,#f05b35 20%,#b51320 65%);
  box-shadow:0 0 0 1px #525652;
}

.version {
  font-size:10px;
  font-weight:500;
  color:var(--muted);
  border:1px solid var(--line);
  border-radius:5px;
  padding:2px 4px;
}

.workspace {
  display:grid;
  grid-template-columns:264px 1fr;
  height:100dvh;
}

.sidebar {
  display:flex;
  flex-direction:column;
  background:var(--panel);
  padding:27px 18px 16px;
  border-right:1px solid var(--line);
}

.sidebar .brand {
  margin:0 11px 28px;
}

.new-chat {
  text-align:left;
  background:var(--bg);
  box-shadow:var(--shadow);
  font-weight:550;
  padding:13px;
}

.new-chat span {
  font-size:20px;
  margin-right:8px;
}

.search-label {
  margin:20px 0 25px;
}

.search-label input {
  width:100%;
  background:transparent;
  border:none;
  padding:10px 12px;
  font-size:13px;
}

.section-label {
  font-size:10px;
  font-weight:650;
  letter-spacing:.1em;
  color:var(--muted);
  padding:0 12px 12px;
}

#bodyThreads {
  flex:1;
  overflow:auto;
}

.thread {
  display:block;
  border:0;
  background:transparent;
  width:100%;
  text-align:left;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  padding:12px;
  margin:3px 0;
  font-size:13px;
}

.thread.active {
  background:var(--accent-soft);
  color:var(--accent);
}

.sidebar-bottom {
  border-top:1px solid var(--line);
  padding:16px 10px 0;
}

.local-note {
  font-size:11px;
  color:var(--muted);
  margin-bottom:19px;
}

.status-dot {
  display:inline-block;
  width:6px;
  height:6px;
  background:#6f9b7c;
  border-radius:50%;
  margin-right:6px;
}

.account-row {
  display:flex;
  align-items:center;
  gap:10px;
}

.avatar {
  width:29px;
  height:29px;
  border-radius:50%;
  background:var(--line);
  display:grid;
  place-items:center;
  font-size:12px;
  font-weight:600;
}

.account-row .icon-button {
  margin-left:auto;
}

.icon-button {
  border:none;
  background:transparent;
  padding:7px 9px;
  font-size:19px;
}

.text-button {
  border:none;
  background:transparent;
  color:var(--muted);
  font-size:12px;
  padding:8px;
}

.main {
  min-width:0;
  display:flex;
  flex-direction:column;
}

.topbar {
  height:78px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0 34px;
  flex-shrink:0;
}

.topbar-title,.header-actions {
  display:flex;
  align-items:center;
  gap:14px;
}

.topbar strong {
  font-size:16px;
}

.model-label {
  font-size:12px;
  color:var(--muted);
  padding-left:14px;
  border-left:1px solid var(--line);
}

.conversation-scroll {
  flex:1;
  overflow:auto;
  scroll-behavior:smooth;
}

.welcome {
  max-width:760px;
  margin:clamp(35px,10vh,120px) auto 50px;
  text-align:center;
  padding:0 28px;
}

.welcome-mark {
  width:53px;
  height:53px;
  margin:0 auto 26px;
  display:grid;
  place-items:center;
  background:var(--accent-soft);
  color:var(--accent);
  font-family:Georgia,serif;
  font-size:31px;
  border-radius:18px;
}

.eyebrow {
  color:var(--muted);
  font-size:9px;
  letter-spacing:.15em;
  font-weight:600;
}

.welcome h1 {
  font-size:clamp(28px,3vw,40px);
  font-weight:500;
  letter-spacing:-1.5px;
  margin:17px 0;
}

.welcome>p:not(.eyebrow) {
  max-width:435px;
  margin:auto;
  color:var(--muted);
  line-height:1.8;
  font-size:14px;
}

.suggestions {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-top:38px;
  text-align:left;
}

.suggestions button {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  padding:19px;
  gap:7px;
  background:transparent;
}

.suggestions button>span:first-child {
  color:var(--accent);
  font-size:20px;
  margin-bottom:9px;
}

.suggestions strong {
  font-size:12px;
  font-weight:550;
}

.suggestions button>span:last-child {
  color:var(--muted);
  font-size:11px;
  line-height:1.6;
}

.composer-area {
  width:min(800px,100%);
  margin:0 auto;
  padding:12px 28px 16px;
}

.composer {
  border:1px solid var(--line);
  border-radius:20px;
  padding:8px 12px 10px;
  box-shadow:var(--shadow);
  background:var(--bg);
}

.composer textarea {
  resize:none;
  border:0;
  width:100%;
  padding:12px 6px;
  min-height:66px;
  max-height:180px;
  line-height:1.6;
}

.composer textarea:focus {
  outline:none;
}

.composer-bottom {
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.council-toggle {
  font-size:11px;
  color:var(--text);
  display:flex;
  align-items:center;
  gap:6px;
}

.council-toggle input {
  accent-color:var(--accent);
}

.council-toggle .muted {
  padding-left:6px;
  border-left:1px solid var(--line);
}

.send-button {
  border:0;
  border-radius:50%;
  background:var(--accent);
  color:var(--bg);
  width:34px;
  height:34px;
  padding:0;
  font-size:22px;
}

.send-button:hover {
  opacity:.85;
  background:var(--accent);
}

.footer-note {
  text-align:center;
  color:var(--muted);
  font-size:10px;
  margin:12px 0 0;
}

.footer-note span {
  margin-left:8px;
}

.notice {
  color:var(--muted);
  font-size:12px;
  min-height:22px;
  padding-left:8px;
}

.messages {
  max-width:770px;
  margin:auto;
  padding:20px 28px;
}

.message {
  margin:20px 0 30px;
}

.message.user {
  margin-left:auto;
  max-width:85%;
  background:var(--soft);
  border-radius:18px;
  padding:14px 18px;
}

.message-header {
  font-size:11px;
  font-weight:650;
  color:var(--muted);
  margin-bottom:10px;
  display:flex;
  gap:10px;
  align-items:center;
}

.message-content {
  line-height:1.8;
  overflow-wrap:anywhere;
  white-space:pre-wrap;
  font-size:14px;
}

.message-content pre {
  overflow:auto;
  background:var(--panel);
  border:1px solid var(--line);
  padding:15px;
  border-radius:10px;
  white-space:pre;
}

.message-content code {
  font-family:ui-monospace,monospace;
  font-size:12px;
}

.message-content a {
  color:var(--accent);
}

.message-status {
  font-size:11px;
  color:var(--muted);
  margin-top:8px;
}

.council-details {
  margin:20px 0;
  border:1px solid var(--line);
  border-radius:12px;
  padding:14px;
}

.council-details summary {
  cursor:pointer;
  font-size:12px;
  color:var(--muted);
}

.council-details .message {
  margin:15px 0 0;
}

.login-screen {
  min-height:100dvh;
  display:grid;
  place-items:center;
  background:var(--panel);
  padding:30px;
}

.login-card {
  width:min(410px,100%);
}

.login-card .brand {
  margin-bottom:44px;
}

.login-card h1 {
  font-weight:500;
  font-size:34px;
  line-height:1.3;
  letter-spacing:-1px;
}

.login-card label {
  display:flex;
  flex-direction:column;
  gap:8px;
  margin:20px 0;
  font-size:12px;
}

.primary {
  background:var(--accent);
  color:var(--bg);
  border:0;
}

.login-card .primary {
  width:100%;
  display:flex;
  justify-content:space-between;
  padding:14px;
  margin:10px 0;
}

.error {
  color:#b65249;
  min-height:16px;
  font-size:12px;
}

.mobile-only {
  display:none;
}

dialog {
  border:1px solid var(--line);
  background:var(--bg);
  color:var(--text);
  border-radius:18px;
  max-width:460px;
  padding:25px;
}

dialog::backdrop {
  background:#0006;
}

dialog p {
  line-height:1.7;
  color:var(--muted);
}

.dialog-actions {
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top:24px;
}

@media(max-width:760px) {
  .workspace {
    grid-template-columns:1fr;
  }

  .sidebar {
    display:none;
    position:fixed;
    z-index:5;
    inset:0 auto 0 0;
    width:264px;
    box-shadow:12px 0 30px #0002;
  }

  .sidebar.open {
    display:flex;
  }

  .mobile-only {
    display:block;
  }

  .topbar {
    height:65px;
    padding:0 16px;
  }

  .model-label {
    display:none;
  }

  .welcome {
    margin:45px auto 35px;
    padding:0 22px;
  }

  .suggestions {
    gap:8px;
    margin-top:30px;
  }

  .suggestions button {
    padding:13px 10px;
  }

  .suggestions button>span:last-child {
    display:none;
  }

  .suggestions strong {
    font-size:11px;
  }

  .composer-area {
    padding:8px 14px 16px;
  }

  .footer-note span {
    display:none;
  }

  .messages {
    padding:10px 20px;
  }

  .council-toggle .muted {
    display:none;
  }

}

@media(prefers-reduced-motion:reduce) {
  .conversation-scroll {
    scroll-behavior:auto;
  }

}

.main,.sidebar,.conversation-scroll {
  min-height:0;
}

@media (max-height:800px) {
  .welcome {
    margin:28px auto 20px;
  }

  .welcome-mark {
    margin-bottom:18px;
  }

  .suggestions {
    margin-top:24px;
  }

}

