:root {
  color-scheme: dark;
  --bg: #07100e;
  --bg-raised: #0b1613;
  --panel: #0d1a17;
  --panel-strong: #11211d;
  --panel-hover: #152722;
  --border: #21342e;
  --border-strong: #2d4940;
  --text: #eef7f3;
  --muted: #8ca39b;
  --muted-strong: #b8c9c3;
  --green: #54e6a5;
  --green-strong: #77f1bb;
  --green-soft: rgba(84, 230, 165, 0.12);
  --cyan: #6bd6df;
  --amber: #f4bf70;
  --red: #ff7d7d;
  --red-soft: rgba(255, 125, 125, 0.1);
  --sidebar-width: 284px;
  --topbar-height: 72px;
  --radius-sm: 8px;
  --radius: 13px;
  --radius-lg: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 85% -10%, rgba(50, 126, 100, 0.12), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button,
textarea,
input {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 50%;
  padding: 8px 14px;
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  color: var(--text);
  transform: translate(-50%, -150%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
}

.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: rgba(8, 18, 15, 0.96);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: var(--topbar-height);
  padding: 0 18px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(84, 230, 165, 0.32);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(84, 230, 165, 0.16), rgba(84, 230, 165, 0.04));
  color: var(--green);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-mark svg path:first-child {
  stroke-width: 1.35;
}

.brand-name,
.brand-kicker {
  display: block;
}

.brand-name {
  font-size: 14px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.brand-kicker {
  margin-top: -2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-strong);
  transition: 140ms ease;
}

.icon-button:hover {
  border-color: var(--border);
  background: var(--panel-hover);
  color: var(--text);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.sidebar-close {
  display: none;
  margin-left: auto;
}

.new-session {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  margin: 6px 12px 20px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: linear-gradient(180deg, #152722, #10201c);
  color: var(--text);
  font-size: 13px;
  font-weight: 620;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  transition: 140ms ease;
}

.new-session:hover {
  border-color: rgba(84, 230, 165, 0.45);
  background: #172b25;
}

.new-session svg {
  width: 18px;
  color: var(--green);
}

.shortcut {
  margin-left: auto;
  color: #698077;
  font-size: 11px;
  font-weight: 500;
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 17px 8px;
  color: #6f867e;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.history-count {
  display: grid;
  min-width: 20px;
  height: 18px;
  place-items: center;
  border-radius: 9px;
  background: #12211d;
  font-size: 9px;
}

.history-list {
  min-height: 80px;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 8px;
  scrollbar-color: var(--border) transparent;
  scrollbar-width: thin;
}

.history-item {
  position: relative;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 44px;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted-strong);
  text-align: left;
  transition: 120ms ease;
}

.history-item:hover {
  background: rgba(21, 39, 34, 0.7);
  color: var(--text);
}

.history-item.active {
  border-color: #243b33;
  background: #12231e;
  color: var(--text);
}

.history-item.active::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: -1px;
  width: 2px;
  border-radius: 2px;
  background: var(--green);
  content: "";
}

.history-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: #789087;
}

.active .history-icon {
  color: var(--green);
}

.history-icon svg {
  width: 14px;
  height: 14px;
}

.history-label {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-age {
  color: #60756e;
  font-size: 10px;
}

.empty-history {
  margin: 14px 12px;
  color: #60756e;
  font-size: 12px;
  text-align: center;
}

.sidebar-footer {
  padding: 10px 8px 14px;
  border-top: 1px solid rgba(33, 52, 46, 0.7);
}

.sidebar-action {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  gap: 9px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  transition: 120ms ease;
}

.sidebar-action:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.sidebar-action svg {
  width: 16px;
  height: 16px;
}

.danger-action:hover {
  background: var(--red-soft);
  color: #ffabab;
}

.account-panel {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: 4px;
  padding: 6px 7px;
  border: 1px solid rgba(33, 52, 46, 0.75);
  border-radius: 9px;
  background: rgba(13, 26, 23, 0.58);
}

.account-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--panel-strong);
  color: var(--muted-strong);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.account-panel[data-status="authenticated"] .account-avatar {
  border-color: rgba(84, 230, 165, 0.32);
  background: var(--green-soft);
  color: var(--green);
}

.account-panel[data-status="denied"] .account-avatar,
.account-panel[data-status="error"] .account-avatar {
  border-color: rgba(255, 125, 125, 0.3);
  background: var(--red-soft);
  color: var(--red);
}

.account-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.account-name,
.account-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name {
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 650;
}

.account-detail {
  color: #60756e;
  font-size: 8px;
}

.account-form {
  margin: 0;
}

.account-action {
  min-height: 27px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: #789087;
  font-size: 9px;
  font-weight: 620;
}

.account-action:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--panel-hover);
  color: var(--text);
}

.account-action:disabled {
  cursor: default;
  opacity: 0.55;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 10px 0;
  color: #60756e;
  font-size: 10px;
}

.security-note svg {
  width: 13px;
  height: 13px;
}

.workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: var(--topbar-height) minmax(0, 1fr) auto;
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(33, 52, 46, 0.78);
  background: rgba(7, 16, 14, 0.85);
  backdrop-filter: blur(14px);
}

.menu-button {
  display: none;
}

.session-context {
  min-width: 0;
}

.eyebrow {
  display: block;
  color: #668078;
  font-size: 9px;
  font-weight: 740;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.session-context h1 {
  max-width: min(50vw, 620px);
  overflow: hidden;
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 640;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(13, 26, 23, 0.8);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 580;
}

.state-light {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(84, 230, 165, 0.45);
}

.connection-state.working .state-light {
  animation: pulse 1.2s ease-in-out infinite;
  background: var(--cyan);
  box-shadow: 0 0 9px rgba(107, 214, 223, 0.5);
}

.connection-state.error .state-light {
  background: var(--red);
  box-shadow: 0 0 9px rgba(255, 125, 125, 0.4);
}

.connection-state.stopped .state-light {
  background: var(--amber);
  box-shadow: none;
}

.conversation {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--border) transparent;
  scrollbar-width: thin;
}

.message-stack {
  width: min(100%, 840px);
  min-height: 100%;
  margin: 0 auto;
  padding: 34px 28px 48px;
}

.welcome {
  display: flex;
  min-height: calc(100vh - 250px);
  flex-direction: column;
  justify-content: center;
  animation: rise-in 350ms ease both;
}

.welcome-symbol {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  place-items: center;
  border: 1px solid rgba(84, 230, 165, 0.28);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(84, 230, 165, 0.14), rgba(18, 35, 30, 0.8));
  color: var(--green);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.welcome-symbol::after {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 10px;
  height: 10px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.welcome-symbol svg {
  width: 27px;
  height: 27px;
}

.welcome h2 {
  margin: 0;
  font-size: clamp(25px, 4vw, 34px);
  font-weight: 640;
  letter-spacing: -0.04em;
  line-height: 1.14;
}

.welcome-intro {
  max-width: 560px;
  margin: 12px 0 26px;
  color: var(--muted);
  font-size: 14px;
}

.session-gate {
  align-items: center;
  text-align: center;
}

.session-gate .welcome-symbol {
  margin-right: auto;
  margin-left: auto;
}

.session-gate.session-problem .welcome-symbol {
  border-color: rgba(255, 125, 125, 0.3);
  background: var(--red-soft);
  color: var(--red);
}

.session-gate.session-problem .welcome-symbol::after {
  background: var(--red);
}

.session-gate .welcome-intro {
  max-width: 480px;
  margin-bottom: 22px;
}

.session-actions {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
}

.session-actions form {
  margin: 0;
}

.session-primary,
.session-secondary {
  min-height: 38px;
  padding: 0 15px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 680;
  transition: 130ms ease;
}

.session-primary {
  background: var(--green);
  color: #062016;
}

.session-primary:hover {
  background: var(--green-strong);
  transform: translateY(-1px);
}

.session-secondary {
  border: 1px solid var(--border-strong);
  background: var(--panel-strong);
  color: var(--muted-strong);
}

.session-secondary:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.session-checking {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.session-checking::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse 1.2s ease-in-out infinite;
  content: "";
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.suggestion {
  position: relative;
  min-height: 88px;
  padding: 14px 38px 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(13, 26, 23, 0.72);
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  transition: 150ms ease;
}

.suggestion:hover {
  border-color: var(--border-strong);
  background: var(--panel-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.suggestion-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.suggestion svg {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 15px;
  height: 15px;
  color: #587068;
}

.message {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 13px;
  margin-bottom: 28px;
  animation: rise-in 220ms ease both;
}

.message-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--muted);
}

.message-avatar svg {
  width: 17px;
  height: 17px;
}

.assistant-message .message-avatar {
  border-color: rgba(84, 230, 165, 0.27);
  background: var(--green-soft);
  color: var(--green);
}

.message-main {
  min-width: 0;
  padding-top: 3px;
}

.message-meta {
  display: flex;
  min-height: 23px;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.message-author {
  font-size: 12px;
  font-weight: 680;
}

.message-time {
  color: #61766e;
  font-size: 10px;
}

.message-copy {
  color: #dbe8e3;
  font-size: 14px;
  line-height: 1.68;
  overflow-wrap: anywhere;
}

.user-message .message-copy {
  color: var(--muted-strong);
}

.message-copy > :first-child {
  margin-top: 0;
}

.message-copy > :last-child {
  margin-bottom: 0;
}

.message-copy p {
  margin: 0 0 12px;
}

.message-copy h2,
.message-copy h3,
.message-copy h4 {
  margin: 20px 0 8px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.message-copy h2 {
  font-size: 17px;
}

.message-copy ul,
.message-copy ol {
  margin: 8px 0 13px;
  padding-left: 22px;
}

.message-copy li {
  margin: 4px 0;
  padding-left: 2px;
}

.message-copy blockquote {
  margin: 12px 0;
  padding: 2px 0 2px 13px;
  border-left: 2px solid var(--border-strong);
  color: var(--muted);
}

.markdown-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin: 13px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(7, 16, 14, 0.55);
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

.markdown-table-scroll:focus-visible {
  outline: 2px solid rgba(84, 230, 165, 0.55);
  outline-offset: 2px;
}

.message-copy .markdown-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  color: #d5e5df;
  font-size: 12px;
  line-height: 1.5;
}

.markdown-table th,
.markdown-table td {
  padding: 9px 11px;
  border-right: 1px solid rgba(45, 73, 64, 0.45);
  border-bottom: 1px solid rgba(45, 73, 64, 0.5);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.markdown-table th:last-child,
.markdown-table td:last-child {
  border-right: 0;
}

.markdown-table th {
  background: rgba(18, 35, 30, 0.88);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.markdown-table tbody tr:nth-child(even) {
  background: rgba(18, 35, 30, 0.24);
}

.markdown-table tbody tr:last-child td {
  border-bottom: 0;
}

.markdown-table .table-align-center {
  text-align: center;
}

.markdown-table .table-align-right {
  text-align: right;
}

.markdown-table .table-overflow-note {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

.message-copy pre {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  margin: 13px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #07100e;
  color: #cce3da;
  font: 12px/1.6 var(--mono);
  tab-size: 2;
}

.message-copy code {
  padding: 2px 5px;
  border: 1px solid rgba(45, 73, 64, 0.65);
  border-radius: 5px;
  background: rgba(5, 12, 10, 0.65);
  color: #9debc8;
  font-family: var(--mono);
  font-size: 0.86em;
}

.message-copy pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.message-copy a {
  color: var(--green-strong);
  text-decoration-color: rgba(119, 241, 187, 0.35);
  text-underline-offset: 3px;
}

.message-copy strong {
  color: var(--text);
  font-weight: 680;
}

.message-copy hr {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.message-actions {
  display: flex;
  height: 28px;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
}

.micro-button {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #71887f;
  font-size: 10px;
}

.micro-button:hover {
  border-color: var(--border);
  background: var(--panel);
  color: var(--muted-strong);
}

.micro-button svg {
  width: 13px;
  height: 13px;
}

.activity-panel {
  max-width: 570px;
  margin: 4px 0 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(10, 22, 18, 0.75);
  overflow: hidden;
}

.activity-heading {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 620;
}

.activity-heading svg {
  width: 14px;
  height: 14px;
  color: var(--cyan);
}

.activity-count {
  margin-left: auto;
  color: #61766e;
  font-family: var(--mono);
  font-size: 9px;
}

.activity-list {
  margin: 0;
  padding: 0 11px 9px;
  list-style: none;
}

.activity-item {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  min-height: 27px;
  align-items: start;
  gap: 7px;
  padding: 5px 0;
  border-top: 1px solid rgba(33, 52, 46, 0.55);
  color: #829a91;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.45;
}

.activity-marker {
  position: relative;
  width: 7px;
  height: 7px;
  margin: 4px 0 0 3px;
  border: 1px solid #527068;
  border-radius: 50%;
}

.activity-item.running .activity-marker {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(107, 214, 223, 0.1);
  animation: pulse 1.1s ease-in-out infinite;
}

.activity-item.tool .activity-marker {
  border-radius: 2px;
  border-color: var(--green);
  background: rgba(84, 230, 165, 0.2);
}

.activity-name {
  color: var(--green);
}

.thinking {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
}

.thinking-dots {
  display: flex;
  gap: 3px;
}

.thinking-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  animation: thinking 1.2s ease-in-out infinite;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 130ms;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 260ms;
}

.error-card {
  max-width: 610px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 125, 125, 0.28);
  border-radius: 10px;
  background: var(--red-soft);
}

.error-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: #ffc0c0;
  font-size: 12px;
  font-weight: 680;
}

.error-title svg {
  width: 15px;
  height: 15px;
}

.error-detail {
  margin: 0;
  color: #c99696;
  font-size: 11px;
}

.retry-button {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 0 10px;
  border: 1px solid rgba(255, 125, 125, 0.28);
  border-radius: 7px;
  background: rgba(255, 125, 125, 0.08);
  color: #ffd1d1;
  font-size: 10px;
  font-weight: 620;
}

.retry-button:hover {
  background: rgba(255, 125, 125, 0.14);
}

.retry-button svg {
  width: 13px;
}

.composer-region {
  position: relative;
  z-index: 4;
  padding: 0 28px 14px;
  background: linear-gradient(0deg, var(--bg) 70%, transparent);
}

.composer {
  width: min(100%, 784px);
  margin: 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  background: rgba(13, 27, 23, 0.96);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.03);
  transition: border-color 130ms ease, box-shadow 130ms ease;
}

.composer:focus-within {
  border-color: rgba(84, 230, 165, 0.5);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(84, 230, 165, 0.05);
}

.composer.session-locked {
  border-color: var(--border);
  box-shadow: none;
  opacity: 0.58;
}

.composer.session-locked:focus-within {
  border-color: var(--border);
  box-shadow: none;
}

.composer textarea:disabled {
  cursor: not-allowed;
}

.composer textarea {
  display: block;
  width: 100%;
  max-height: 180px;
  min-height: 51px;
  resize: none;
  padding: 15px 15px 5px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  scrollbar-width: thin;
}

.composer textarea::placeholder {
  color: #6a8078;
}

.composer textarea:focus-visible {
  outline: 0;
}

.composer-footer {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 10px;
  padding: 5px 7px 7px 15px;
}

.composer-hint {
  color: #5f746c;
  font-size: 10px;
}

.send-button {
  display: grid;
  width: 34px;
  height: 34px;
  margin-left: auto;
  place-items: center;
  border-radius: 9px;
  background: var(--green);
  color: #062016;
  transition: 130ms ease;
}

.send-button:hover:not(:disabled) {
  background: var(--green-strong);
  transform: translateY(-1px);
}

.send-button:disabled {
  cursor: default;
  opacity: 0.32;
}

.send-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.stop-icon {
  display: none;
}

.streaming .send-button {
  background: var(--amber);
}

.streaming .send-icon {
  display: none;
}

.streaming .stop-icon {
  display: block;
}

.disclaimer {
  margin: 7px auto 0;
  color: #50645d;
  font-size: 9px;
  text-align: center;
}

.modal {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.modal::backdrop {
  background: rgba(2, 7, 5, 0.72);
  backdrop-filter: blur(5px);
}

.modal-card {
  width: min(92vw, 470px);
  padding: 22px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: #0d1b17;
  box-shadow: var(--shadow);
  animation: modal-in 180ms ease both;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.modal h2 {
  margin: 4px 0 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.modal-copy {
  margin: 15px 0 19px;
  color: var(--muted);
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 17px;
}

.primary-button,
.secondary-button,
.destructive-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 650;
}

.primary-button {
  background: var(--green);
  color: #062016;
}

.primary-button:hover {
  background: var(--green-strong);
}

.secondary-button {
  border: 1px solid var(--border-strong);
  background: var(--panel-strong);
  color: var(--muted-strong);
}

.secondary-button:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.destructive-button {
  background: #d96767;
  color: #fff;
}

.destructive-button:hover {
  background: #ed7979;
}

.confirm-modal .modal-card {
  width: min(92vw, 390px);
  text-align: center;
}

.confirm-icon {
  display: grid;
  width: 43px;
  height: 43px;
  margin: 0 auto 13px;
  place-items: center;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
}

.confirm-icon svg {
  width: 21px;
  height: 21px;
}

.confirm-modal .modal-actions {
  justify-content: center;
}

.toast-region {
  position: fixed;
  z-index: 80;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  min-width: 190px;
  max-width: min(360px, calc(100vw - 36px));
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #13231f;
  color: var(--muted-strong);
  box-shadow: var(--shadow);
  font-size: 11px;
  animation: toast-in 180ms ease both;
}

.toast svg {
  width: 15px;
  height: 15px;
  color: var(--green);
}

.scrim {
  position: fixed;
  z-index: 15;
  inset: 0;
  background: rgba(2, 7, 5, 0.68);
  backdrop-filter: blur(3px);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes thinking {
  0%,
  60%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(4px);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (max-width: 800px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(var(--sidebar-width), calc(100vw - 48px));
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close,
  .menu-button {
    display: inline-grid;
  }

  .topbar {
    padding: 0 14px;
  }

  .reset-button {
    display: none;
  }

  .message-stack {
    padding: 27px 18px 42px;
  }

  .composer-region {
    padding: 0 13px max(10px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 560px) {
  :root {
    --topbar-height: 64px;
  }

  .connection-state {
    width: 28px;
    min-height: 28px;
    justify-content: center;
    padding: 0;
  }

  .connection-state span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .suggestion-grid {
    grid-template-columns: 1fr;
  }

  .suggestion {
    min-height: 73px;
  }

  .welcome {
    min-height: auto;
    padding: 28px 0 20px;
    justify-content: flex-start;
  }

  .message {
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 10px;
  }

  .message-avatar {
    width: 27px;
    height: 27px;
  }

  .composer-hint {
    display: none;
  }

  .composer textarea {
    min-height: 48px;
  }

  .message-actions {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
