:root {
  font-family:
    Inter,
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  color-scheme: dark;
  background: #0b0c0f;
  color: #f7f7f8;
  --bg: #0b0c0f;
  --panel: #111318;
  --panel2: #161920;
  --panel3: #1d212a;
  --line: #272b35;
  --line2: #343945;
  --muted: #9096a3;
  --text: #f7f7f8;
  --soft: #c8ccd4;
  --accent: #f3f4f6;
  --ok: #57d68d;
  --warn: #f0b95b;
  --danger: #ff7777;
  --sidebar: 282px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}
body {
  min-height: 100vh;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a {
  outline: none;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  background:
    radial-gradient(circle at 55% -15%, #20242d 0, transparent 34%), var(--bg);
}
.sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 16px 14px 14px;
  border-right: 1px solid var(--line);
  background: #0e1014;
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.brand-block {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 5px 16px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f7f7f8, #bfc4cf);
  color: #111318;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -0.4px;
  box-shadow: 0 8px 24px #0005;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-copy strong {
  font-size: 15px;
}
.brand-copy span {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.icon-button {
  border: 0;
  background: transparent;
  color: var(--soft);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
}
.icon-button:hover {
  background: var(--panel2);
  color: #fff;
}
.sidebar-close {
  display: none;
  margin-left: auto;
  font-size: 24px;
}
.new-chat {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: #fff;
  border-radius: 11px;
  padding: 11px 13px;
  font-weight: 650;
  cursor: pointer;
}
.new-chat:hover {
  background: #1b1f27;
}
.sidebar-section-title {
  padding: 20px 8px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #626977;
}
.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: auto;
  min-height: 0;
}
.conversation-item {
  position: relative;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--soft);
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 26px;
  gap: 8px;
  align-items: center;
  text-align: left;
  padding: 9px 7px;
  border-radius: 9px;
  cursor: pointer;
}
.conversation-item:hover,
.conversation-item.active {
  background: #171a21;
  color: #fff;
}
.conversation-icon {
  font-size: 15px;
  color: #7f8796;
}
.conversation-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.conversation-copy strong {
  font-size: 13px;
  font-weight: 580;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conversation-copy small {
  font-size: 10px;
  color: #707786;
  margin-top: 3px;
}
.conversation-delete {
  border: 0;
  background: transparent;
  color: #626977;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
}
.conversation-item:hover .conversation-delete {
  opacity: 1;
}
.conversation-delete:hover {
  background: #252a34;
  color: #fff;
}
.sidebar-spacer {
  flex: 1;
}
.sidebar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border-top: 1px solid var(--line);
}
.sidebar-status > div {
  display: flex;
  flex-direction: column;
}
.sidebar-status strong {
  font-size: 12px;
}
.sidebar-status small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #707784;
  flex: 0 0 auto;
}
.dot.ok {
  background: var(--ok);
  box-shadow: 0 0 10px #57d68d66;
}
.dot.bad {
  background: var(--danger);
}
.admin-entry {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 14px;
  gap: 7px;
  align-items: center;
  text-decoration: none;
  color: #c8ccd4;
  padding: 10px;
  border-radius: 9px;
  font-size: 13px;
}
.admin-entry:hover {
  background: #171a21;
  color: #fff;
}
.admin-entry .lock {
  color: #687080;
  text-align: right;
}
.version-line {
  display: flex;
  justify-content: space-between;
  padding: 9px 10px 1px;
  font-size: 10px;
  color: #555c69;
}
.sidebar-backdrop {
  display: none;
}
.workspace {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.topbar {
  height: 64px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: #0d0f13d9;
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-left > div {
  display: flex;
  flex-direction: column;
}
.topbar-left strong {
  font-size: 14px;
}
.topbar-sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.mobile-menu {
  display: none;
}
.mode-bar {
  display: flex;
  align-items: center;
  background: #15181e;
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: 11px;
}
.mode {
  border: 0;
  background: transparent;
  color: #8f96a4;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.mode:hover {
  color: #fff;
}
.mode.active {
  background: #282d37;
  color: #fff;
  box-shadow: inset 0 0 0 1px #3b414d;
}
.status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: #13161b;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: #b9bec8;
}
.chat-stage {
  min-height: 0;
  display: flex;
  justify-content: center;
}
.chat {
  width: min(860px, 100%);
  padding: 34px 24px 180px;
  overflow: auto;
  min-height: calc(100vh - 64px);
}
.welcome {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 0;
}
.welcome-mark {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f4f4f5, #aeb4c1);
  color: #101217;
  font-weight: 900;
  box-shadow: 0 18px 60px #0008;
}
.welcome h1 {
  font-size: 31px;
  letter-spacing: -0.04em;
  margin: 18px 0 8px;
}
.welcome p {
  margin: 0;
  color: var(--muted);
  max-width: 540px;
  line-height: 1.55;
}
.starter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: min(700px, 100%);
  margin-top: 28px;
}
.starter-card {
  text-align: left;
  border: 1px solid var(--line);
  background: #111419;
  color: #fff;
  border-radius: 13px;
  padding: 14px;
  cursor: pointer;
}
.starter-card:hover {
  background: #171b22;
  border-color: #363c48;
}
.starter-card strong {
  display: block;
  font-size: 13px;
}
.starter-card span {
  display: block;
  color: #848b99;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 5px;
}
.capability-row {
  display: flex;
  gap: 7px;
  margin-top: 18px;
  flex-wrap: wrap;
  justify-content: center;
}
.cap-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: #8f96a4;
  font-size: 10px;
  background: #101217;
}
.cap-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #626977;
}
.cap-chip.ready {
  color: #b9e6ca;
}
.cap-chip.ready .cap-dot {
  background: var(--ok);
}
.cap-chip.planned .cap-dot {
  background: #616875;
}
.message-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  margin: 22px 0;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #212630;
  color: #cdd1d9;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
}
.message-row.user .avatar {
  background: #e7e8eb;
  color: #17191d;
}
.message-body {
  min-width: 0;
}
.message-author {
  font-size: 11px;
  color: #777f8e;
  margin: 0 0 6px 2px;
}
.msg {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.62;
  font-size: 14px;
  color: #e7e9ed;
}
.msg.user {
  display: inline-block;
  background: #252a33;
  border: 1px solid #303642;
  border-radius: 14px;
  padding: 10px 13px;
}
.message-row.user .message-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.message-row.assistant .msg {
  padding: 2px;
}
.capability-message .msg {
  border-left: 2px solid var(--warn);
  padding: 11px 13px;
  background: #1a1711;
  border-radius: 0 10px 10px 0;
  color: #ead6ad;
}
.composer-zone {
  position: fixed;
  bottom: 0;
  left: var(--sidebar);
  right: 0;
  padding: 10px 20px 18px;
  background: linear-gradient(180deg, transparent, #0b0c0f 25%);
  z-index: 15;
}
.composer-zone > * {
  width: min(860px, 100%);
  margin-left: auto;
  margin-right: auto;
}
.capability-banner {
  margin-bottom: 8px;
  border: 1px solid var(--line);
  background: #12151a;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 11px;
  color: #b9bec8;
}
.capability-banner.warning {
  border-color: #5f4c25;
  background: #19150e;
  color: #e4c687;
}
.composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  border: 1px solid #323844;
  background: #14171d;
  border-radius: 17px;
  padding: 8px;
  box-shadow: 0 18px 60px #0008;
}
.composer:focus-within {
  border-color: #505867;
}
.composer-actions {
  display: flex;
  align-items: center;
}
.tool-button {
  border: 0;
  background: transparent;
  color: #9aa1ae;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 20px;
}
.tool-button:hover {
  background: #20242c;
  color: #fff;
}
.composer textarea {
  width: 100%;
  min-height: 44px;
  max-height: 180px;
  resize: none;
  overflow: auto;
  background: transparent;
  color: #fff;
  border: 0;
  outline: 0;
  padding: 11px 5px;
  line-height: 1.45;
}
.composer textarea::placeholder {
  color: #666d79;
}
.send-button {
  height: 40px;
  border: 0;
  border-radius: 11px;
  background: #eceef1;
  color: #111318;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
  cursor: pointer;
}
.send-button:hover {
  background: #fff;
}
.send-button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.send-button.working span:last-child {
  animation: pulse 1s infinite;
}
.composer-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
  color: #555d6a;
  padding: 7px 4px 0;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
/* Admin */
.admin-page {
  background: #0b0c0f;
}
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}
.admin-sidebar {
  border-right: 1px solid var(--line);
  background: #0e1014;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  padding: 2px 6px 18px;
}
.admin-brand > span:last-child {
  display: flex;
  flex-direction: column;
}
.admin-brand strong {
  font-size: 14px;
}
.admin-brand small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.admin-nav-item {
  border: 0;
  background: transparent;
  color: #939aa8;
  text-align: left;
  padding: 10px 11px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}
.admin-nav-item:hover,
.admin-nav-item.active {
  background: #191c23;
  color: #fff;
}
.admin-back {
  color: #aab0bc;
  text-decoration: none;
  font-size: 12px;
  padding: 10px;
  border-radius: 8px;
}
.admin-back:hover {
  background: #171a21;
  color: #fff;
}
.admin-logout {
  border: 0;
  background: transparent;
  color: #777f8d;
  text-align: left;
  padding: 10px;
  cursor: pointer;
}
.admin-content {
  padding: 30px 34px;
  max-width: 1180px;
  width: 100%;
}
.admin-login-card {
  max-width: 460px;
  margin: 12vh auto;
  border: 1px solid var(--line);
  background: #111318;
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 24px 80px #0007;
}
.login-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #22262f;
  display: grid;
  place-items: center;
  font-size: 20px;
}
.admin-login-card h1 {
  margin: 17px 0 8px;
}
.admin-login-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.admin-login-card label {
  display: block;
  font-size: 11px;
  color: #9da4b1;
  margin: 20px 0 7px;
}
.admin-login-card input,
.pull input,
.route-card select {
  width: 100%;
  background: #171a20;
  color: #fff;
  border: 1px solid #303541;
  border-radius: 10px;
  padding: 11px;
  outline: 0;
}
.admin-login-card input:focus,
.pull input:focus,
.route-card select:focus {
  border-color: #555e6d;
}
.primary-button {
  border: 0;
  background: #eff0f2;
  color: #111318;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 750;
  cursor: pointer;
}
.admin-login-card .primary-button {
  width: 100%;
  margin-top: 10px;
}
.error {
  color: #ff8585 !important;
}
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.admin-topbar h1 {
  margin: 4px 0 0;
  font-size: 26px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: #707887;
}
.admin-tab {
  display: none;
}
.admin-tab.active {
  display: block;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
  margin-bottom: 18px;
}
.metric-card {
  border: 1px solid var(--line);
  background: #111318;
  border-radius: 14px;
  padding: 16px;
}
.metric-card span {
  font-size: 10px;
  color: #737b89;
}
.metric-card strong {
  display: block;
  font-size: 22px;
  margin: 8px 0 6px;
}
.metric-card small {
  font-size: 10px;
  color: #686f7d;
}
.metric-card .planned-text {
  font-size: 14px;
  color: #d9c38e;
}
.panel {
  border: 1px solid var(--line);
  background: #111318;
  border-radius: 14px;
  padding: 19px;
  margin-bottom: 16px;
}
.panel h2 {
  margin: 3px 0 8px;
  font-size: 18px;
}
.panel p {
  color: #8d94a2;
  font-size: 12px;
  line-height: 1.55;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.info-callout {
  border-left: 2px solid #535b69;
  background: #15181e;
  padding: 11px 12px;
  color: #aab0bc;
  font-size: 11px;
  margin-top: 14px;
}
.route-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.route-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(300px, 1.2fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  background: #15181e;
  border-radius: 11px;
  padding: 12px;
}
.route-copy {
  display: flex;
  flex-direction: column;
}
.route-copy strong {
  font-size: 13px;
}
.route-copy small {
  font-size: 10px;
  color: #777f8e;
  margin-top: 4px;
}
.panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.success-text {
  color: #72d99a;
  font-size: 11px;
}
.model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.model-card {
  border: 1px solid var(--line);
  background: #15181e;
  border-radius: 12px;
  padding: 13px;
  min-width: 0;
}
.model-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.model-glyph {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #242934;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 900;
}
.model-ready {
  font-size: 9px;
  color: #7bdca0;
}
.model-name {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.model-meta {
  color: #757d8a;
  font-size: 10px;
  margin-top: 5px;
}
.count-badge {
  border: 1px solid var(--line);
  background: #181b21;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 10px;
}
.pull {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}
.job-state {
  margin-top: 10px;
  font-size: 11px;
  color: #aeb4bf;
}
.job-state.completed {
  color: #73d99a;
}
.job-state.failed {
  color: #ff8585;
}
pre {
  overflow: auto;
  border: 1px solid #242933;
  background: #0e1014;
  border-radius: 10px;
  padding: 13px;
  color: #b7bdc9;
  font-size: 11px;
  line-height: 1.5;
}
.muted {
  color: var(--muted);
}
@media (max-width: 920px) {
  :root {
    --sidebar: 250px;
  }
  .topbar-sub {
    display: none;
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .route-card {
    grid-template-columns: 1fr;
  }
  .model-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(86vw, 310px);
    transform: translateX(-105%);
    transition: none;
  }
  .user-page.ui-ready .sidebar {
    transition: transform 0.2s ease;
  }
  .sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: #0009;
    z-index: 25;
  }
  .sidebar-close,
  .mobile-menu {
    display: inline-grid;
    place-items: center;
  }
  .composer-zone {
    left: 0;
    padding: 8px 10px 12px;
  }
  .topbar {
    padding: 0 10px;
    height: 58px;
  }
  .topbar-right {
    gap: 7px;
  }
  .status-pill {
    display: none;
  }
  .mode {
    padding: 6px 8px;
    font-size: 11px;
  }
  .chat {
    padding: 22px 14px 160px;
    min-height: calc(100vh - 58px);
  }
  .welcome {
    min-height: 58vh;
  }
  .welcome h1 {
    font-size: 27px;
  }
  .starter-grid {
    grid-template-columns: 1fr;
  }
  .starter-card {
    padding: 12px;
  }
  .composer-meta span:last-child {
    display: none;
  }
  .send-button span:first-child {
    display: none;
  }
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px;
  }
  .admin-nav {
    flex-direction: row;
    overflow: auto;
  }
  .admin-back,
  .admin-logout {
    display: none;
  }
  .admin-content {
    padding: 18px 12px;
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .admin-topbar {
    margin-top: 4px;
  }
  .admin-topbar h1 {
    font-size: 22px;
  }
}
@media (max-width: 420px) {
  .mode-bar {
    max-width: 190px;
  }
  .mode {
    font-size: 10px;
    padding: 6px;
  }
  .message-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
  }
  .avatar {
    width: 26px;
    height: 26px;
  }
  .metric-grid {
    grid-template-columns: 1fr;
  }
  .composer {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .composer-meta {
    font-size: 8px;
  }
}
/* Product Shell v2 */
.brand-home {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.new-chat kbd {
  margin-left: auto;
  font-size: 9px;
  font-weight: 500;
  color: #747b88;
  border: 1px solid #343945;
  background: #101217;
  border-radius: 6px;
  padding: 2px 5px;
}
.chat-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #111318;
}
.chat-search-wrap:focus-within {
  border-color: #323844;
  background: #14171d;
}
.search-icon {
  color: #707786;
  font-size: 15px;
}
.chat-search {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e8eaee;
  padding: 9px 0;
  font-size: 12px;
}
.chat-search::placeholder {
  color: #626977;
}
.sidebar-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 8px 7px;
}
.sidebar-section-row .sidebar-section-title {
  padding: 0;
}
.text-icon-button {
  border: 0;
  background: transparent;
  color: #656d7b;
  font-size: 10px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.text-icon-button:hover {
  color: #e8eaee;
  background: #181b22;
}
.conversation-empty {
  color: #626977;
  font-size: 11px;
  text-align: center;
  padding: 18px 8px;
}
.sidebar-link {
  width: 100%;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 14px;
  gap: 7px;
  align-items: center;
  border: 0;
  background: transparent;
  text-align: left;
  text-decoration: none;
  color: #b8bec8;
  padding: 10px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
}
.sidebar-link:hover {
  background: #171a21;
  color: #fff;
}
.sidebar-link .lock {
  color: #687080;
  text-align: right;
}
.menu-wrap {
  position: relative;
}
.popover-menu {
  position: absolute;
  right: 0;
  top: 44px;
  width: 210px;
  padding: 6px;
  border: 1px solid #2d323d;
  border-radius: 11px;
  background: #14171d;
  box-shadow: 0 18px 50px #0009;
  z-index: 80;
}
.popover-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #cbd0d8;
  text-align: left;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
}
.popover-menu button:hover {
  background: #22262f;
  color: #fff;
}
.popover-menu .danger-menu {
  color: #ff9999;
}
.tool-tray {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid #282e39;
  background: #11141a;
  border-radius: 14px;
  box-shadow: 0 16px 50px #0008;
}
.tool-card {
  border: 1px solid #282d37;
  background: #15181e;
  color: #e8eaee;
  border-radius: 11px;
  padding: 11px;
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}
.tool-card:hover {
  background: #1b1f27;
  border-color: #353b47;
}
.tool-card .tool-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #222731;
  color: #9fa6b2;
  font-size: 11px;
  flex: 0 0 auto;
}
.tool-card strong {
  display: block;
  font-size: 11px;
}
.tool-card small {
  display: block;
  margin-top: 4px;
  color: #707887;
  font-size: 9px;
  line-height: 1.35;
}
.tool-card.planned {
  opacity: 0.82;
}
.message-actions {
  display: flex;
  gap: 4px;
  margin-top: 7px;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.message-row:hover .message-actions,
.message-row:focus-within .message-actions {
  opacity: 1;
}
.message-action,
.code-copy {
  border: 0;
  background: transparent;
  color: #69717f;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 9px;
  cursor: pointer;
}
.message-action:hover,
.code-copy:hover {
  background: #1c2027;
  color: #d8dce3;
}
.msg.assistant {
  white-space: normal;
}
.msg.assistant p {
  margin: 0 0 10px;
  white-space: pre-wrap;
}
.msg.assistant p:last-child {
  margin-bottom: 0;
}
.msg.assistant h3,
.msg.assistant h4 {
  margin: 16px 0 8px;
  line-height: 1.3;
}
.msg.assistant h3 {
  font-size: 16px;
}
.msg.assistant h4 {
  font-size: 14px;
}
.msg.assistant ul,
.msg.assistant ol {
  margin: 7px 0 12px 20px;
  padding: 0;
}
.msg.assistant li {
  margin: 4px 0;
}
.msg.assistant blockquote {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 2px solid #4f5765;
  color: #b6bcc6;
  background: #111419;
}
.msg.assistant a {
  color: #9fc2ff;
  text-decoration: none;
}
.msg.assistant a:hover {
  text-decoration: underline;
}
.inline-code {
  background: #20242c;
  border: 1px solid #2e3440;
  border-radius: 5px;
  padding: 1px 5px;
  color: #e8ebf0;
  font-size: 0.92em;
}
.code-block {
  margin: 12px 0;
  border: 1px solid #292f3a;
  border-radius: 11px;
  background: #0d0f13;
  overflow: hidden;
}
.code-header {
  height: 34px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #15181e;
  border-bottom: 1px solid #252a34;
  color: #7f8794;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.code-block pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #0c0e12;
  padding: 14px;
  white-space: pre;
  overflow: auto;
}
.code-block code {
  font:
    12px/1.55 Consolas,
    "Cascadia Code",
    monospace;
  color: #dfe3e9;
}
.thinking-row {
  opacity: 0.9;
}
.thinking-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 26px;
}
.thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #717988;
  animation: thinking 1.15s infinite ease-in-out;
}
.thinking-dots span:nth-child(2) {
  animation-delay: 0.12s;
}
.thinking-dots span:nth-child(3) {
  animation-delay: 0.24s;
}
@keyframes thinking {
  0%,
  70%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  35% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #000a;
  backdrop-filter: blur(5px);
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop[hidden] {
  display: none;
}
.settings-modal {
  width: min(860px, 100%);
  max-height: min(720px, 90vh);
  overflow: hidden;
  border: 1px solid #303642;
  background: #101217;
  border-radius: 18px;
  box-shadow: 0 30px 100px #000c;
}
.settings-header {
  height: 78px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #272c36;
}
.settings-header h2 {
  margin: 3px 0 0;
  font-size: 20px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 430px;
}
.settings-nav {
  padding: 14px;
  border-right: 1px solid #272c36;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-nav button,
.settings-nav a {
  border: 0;
  background: transparent;
  text-align: left;
  color: #8e95a2;
  text-decoration: none;
  padding: 10px 11px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}
.settings-nav button:hover,
.settings-nav a:hover,
.settings-nav button.active {
  background: #1a1e25;
  color: #fff;
}
.settings-content {
  padding: 24px;
  overflow: auto;
}
.settings-panel {
  display: none;
}
.settings-panel.active {
  display: block;
}
.settings-panel h3 {
  margin: 0 0 18px;
  font-size: 17px;
}
.setting-row,
.capability-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid #232832;
}
.setting-row > div,
.capability-setting > div {
  display: flex;
  flex-direction: column;
}
.setting-row strong,
.capability-setting strong {
  font-size: 12px;
}
.setting-row span:not(.setting-value),
.capability-setting span:not(.capability-badge) {
  margin-top: 4px;
  color: #737b89;
  font-size: 10px;
}
.setting-value {
  font-size: 10px;
  color: #aab0ba;
  border: 1px solid #2b303a;
  background: #15181e;
  border-radius: 999px;
  padding: 5px 8px;
}
.settings-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.secondary-button,
.danger-button {
  border: 1px solid #303641;
  background: #181b22;
  color: #d5d9e0;
  border-radius: 9px;
  padding: 9px 12px;
  font-weight: 650;
  cursor: pointer;
}
.secondary-button:hover {
  background: #20242c;
}
.danger-button {
  border-color: #57343a;
  background: #211518;
  color: #ffb1b1;
}
.danger-button:hover {
  background: #2b181d;
}
.capability-badge {
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 9px;
  border: 1px solid #313743;
  color: #8d95a3;
  background: #171a20;
}
.capability-badge.ready {
  color: #9de4b7;
  border-color: #28533a;
  background: #112019;
}
.action-modal {
  width: min(440px, 100%);
  border: 1px solid #303642;
  background: #121419;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 30px 90px #000c;
}
.action-modal h2 {
  margin: 0 0 8px;
  font-size: 18px;
}
.action-modal p {
  margin: 0;
  color: #8d95a2;
  font-size: 12px;
  line-height: 1.5;
}
.action-modal label {
  display: block;
  margin: 18px 0 6px;
  font-size: 10px;
  color: #9097a4;
}
.modal-input {
  width: 100%;
  border: 1px solid #303642;
  background: #191c23;
  color: #fff;
  border-radius: 9px;
  padding: 10px;
  outline: 0;
}
.modal-input:focus {
  border-color: #596271;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  min-width: 220px;
  max-width: 360px;
  border: 1px solid #323844;
  background: #171a20;
  color: #d9dde4;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 16px 50px #000a;
  font-size: 11px;
  transform: translateY(8px);
  opacity: 0;
  transition: 0.16s ease;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success {
  border-color: #29533b;
  color: #a9e6bd;
}
.toast.error {
  border-color: #5b3339;
  color: #ffb0b0;
}
.login-back {
  display: inline-block;
  margin-top: 14px;
  color: #808896;
  text-decoration: none;
  font-size: 11px;
}
.login-back:hover {
  color: #fff;
}
@media (max-width: 920px) {
  .tool-tray {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-grid {
    grid-template-columns: 160px minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .new-chat kbd {
    display: none;
  }
  .sidebar-status {
    padding-bottom: 8px;
  }
  .message-actions {
    opacity: 1;
  }
  .tool-tray {
    grid-template-columns: 1fr 1fr;
  }
  .settings-modal {
    max-height: 92vh;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .settings-nav {
    border-right: 0;
    border-bottom: 1px solid #272c36;
    flex-direction: row;
    overflow: auto;
  }
  .settings-nav button,
  .settings-nav a {
    white-space: nowrap;
  }
  .settings-content {
    padding: 18px;
  }
  .modal-backdrop {
    padding: 10px;
  }
  .toast-region {
    left: 10px;
    right: 10px;
    bottom: 12px;
  }
  .toast {
    max-width: none;
    min-width: 0;
  }
  .popover-menu {
    right: -4px;
  }
}
@media (max-width: 460px) {
  .tool-tray {
    grid-template-columns: 1fr;
  }
  .settings-header {
    height: 66px;
    padding: 0 14px;
  }
  .settings-content {
    padding: 14px;
  }
  .topbar-right {
    gap: 4px;
  }
  .mode-bar {
    max-width: 210px;
  }
  .popover-menu {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 86px;
    width: auto;
  }
  .conversation-delete {
    opacity: 1;
  }
  .composer-meta {
    display: none;
  }
}
[hidden] {
  display: none !important;
}
/* v0.2.5 auth/account surfaces */
.auth-page {
  min-height: 100vh;
  background: var(--page, #f7f7f8);
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-shell {
  width: min(100%, 460px);
}
.auth-page[data-auth-page="account"] {
  place-items: start center;
}
.auth-page[data-auth-page="account"] .auth-shell {
  width: min(100%, 980px);
}
.auth-card {
  background: var(--panel, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}
.auth-page[data-auth-page="account"] .auth-card {
  padding: 32px;
  min-width: 0;
}
.auth-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  margin-bottom: 28px;
}
.auth-brand > span:last-child {
  display: flex;
  flex-direction: column;
}
.auth-card form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}
.auth-card label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
}
.auth-card input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border, #d7dbe2);
  border-radius: 12px;
  padding: 12px 14px;
  background: transparent;
  color: inherit;
}
.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  font-size: 13px;
}
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.legal-links a {
  text-decoration: none;
  color: inherit;
}
.legal-links a:hover {
  text-decoration: underline;
}
.account-info {
  padding: 16px;
  border-radius: 14px;
  background: rgba(127, 127, 127, 0.08);
  margin: 18px 0;
  line-height: 1.5;
}
/* v0.2.5 provider registry */
.provider-grid {
  display: grid;
  gap: 12px;
}
.provider-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 8px;
}
.provider-card-head,
.provider-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.provider-meta {
  font-size: 12px;
  opacity: 0.72;
  overflow-wrap: anywhere;
}
.provider-health {
  font-size: 12px;
  font-weight: 700;
}
.provider-health.ok {
  color: #18864b;
}
.provider-health.bad {
  color: #b42318;
}
.provider-actions {
  justify-content: flex-start;
  margin-top: 6px;
}
.provider-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.provider-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}
.provider-form input,
.provider-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border, #d7dbe2);
  border-radius: 10px;
  background: transparent;
  color: inherit;
}
.provider-form button,
.provider-form p {
  grid-column: 1/-1;
}
.user-list {
  display: grid;
  gap: 10px;
}
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 12px;
}
.user-row > div {
  display: grid;
  gap: 4px;
}
.user-row small {
  opacity: 0.7;
}
@media (max-width: 760px) {
  .provider-form {
    grid-template-columns: 1fr;
  }
}
.starter-card.active {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
/* v0.3 Web source evidence */
.tool-card.ready {
  border-color: var(--border-strong);
  background: var(--surface-raised);
}
.tool-card.ready .tool-icon {
  color: var(--accent);
}
.message-sources {
  margin-top: 10px;
  max-width: 760px;
}
.sources-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.source-list {
  display: grid;
  gap: 6px;
}
.source-card {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 10px;
  background: var(--surface-soft);
}
.source-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
}
.source-index {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--surface-raised);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
}
.source-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.source-copy strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-copy small {
  font-size: 11px;
  color: var(--muted);
}
/* v0.4 Files / Workspace / Artifacts */
.attachment-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}
.attachment-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 260px;
  padding: 7px 9px;
  border: 1px solid #303642;
  background: #15191f;
  border-radius: 10px;
  font-size: 10px;
  color: #d7dbe2;
}
.attachment-chip strong {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-chip small {
  color: #747c89;
}
.attachment-chip button {
  border: 0;
  background: transparent;
  color: #79818f;
  cursor: pointer;
  padding: 0 2px;
}
.attachment-chip button:hover {
  color: #fff;
}
.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}
.message-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #bfc7d2;
  border: 1px solid #2d333e;
  background: #15181e;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 9px;
}
.message-file:hover {
  color: #fff;
  border-color: #454d5b;
}
.artifact-create {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid #282e39;
  background: #111419;
  border-radius: 12px;
  margin: 12px 0 18px;
}
.form-grid.compact {
  grid-template-columns: 140px minmax(0, 1fr);
}
.artifact-create label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #9da5b1;
  font-size: 10px;
}
.artifact-create input,
.artifact-create select,
.artifact-create textarea {
  width: 100%;
  border: 1px solid #303642;
  background: #0e1116;
  color: #f0f2f5;
  border-radius: 8px;
  padding: 9px 10px;
  outline: 0;
}
.artifact-create textarea {
  resize: vertical;
  min-height: 100px;
}
.artifact-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.artifact-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #272d37;
  background: #111419;
  border-radius: 10px;
  padding: 9px 10px;
}
.artifact-kind {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #20252e;
  color: #bac2ce;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.artifact-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.artifact-copy strong {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artifact-copy small {
  font-size: 9px;
  color: #727a87;
  margin-top: 3px;
}
.artifact-actions {
  display: flex;
  gap: 5px;
}
.artifact-actions a,
.artifact-actions button {
  border: 1px solid #303642;
  background: #171b22;
  color: #bdc4ce;
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 9px;
  text-decoration: none;
  cursor: pointer;
}
.artifact-actions a:hover,
.artifact-actions button:hover {
  background: #222731;
  color: #fff;
}
@media (max-width: 720px) {
  .form-grid.compact {
    grid-template-columns: 1fr;
  }
  .artifact-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }
  .artifact-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}
.code-editor {
  font-family:
    ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  min-height: 260px;
  resize: vertical;
  tab-size: 2;
}
.code-run-state {
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-2);
}
.code-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.code-result-grid > div {
  min-width: 0;
}
.code-output {
  min-height: 120px;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0e1116;
  color: #e8edf2;
  border-radius: 10px;
  padding: 12px;
  font:
    13px/1.5 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.code-result-grid strong {
  display: block;
  margin-bottom: 6px;
}
@media (max-width: 760px) {
  .code-result-grid {
    grid-template-columns: 1fr;
  }
  .code-editor {
    min-height: 220px;
  }
}
/* v0.6 billing / usage */
.account-billing {
  display: grid;
  gap: 14px;
  margin: 18px 0 22px;
}
.account-billing > * {
  min-width: 0;
}
.account-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.account-plan-head h2 {
  margin: 5px 0 0;
}
.usage-box {
  border: 1px solid var(--border, #d9dde5);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 9px;
  min-width: 0;
  overflow: hidden;
}
.usage-summary {
  font-size: 12px;
  line-height: 1.6;
  opacity: 0.78;
  overflow-wrap: anywhere;
}
.token-toggle {
  display: flex !important;
  grid-template-columns: auto 1fr !important;
  align-items: center;
  gap: 8px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}
.token-toggle input {
  width: auto !important;
}
.plan-catalog {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.plan-card {
  border: 1px solid var(--border, #d9dde5);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
  min-width: 0;
}
.plan-card.current {
  outline: 2px solid rgba(90, 110, 150, 0.35);
}
.plan-card strong {
  font-size: 14px;
}
.plan-price {
  font-weight: 800;
}
.plan-card small {
  opacity: 0.7;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.account-note {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel2);
  font-size: 12px;
  line-height: 1.5;
}
.billing-plan-admin {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.billing-plan-row {
  border: 1px solid var(--border, #d9dde5);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1.2fr);
  gap: 14px;
  align-items: center;
}
.billing-plan-row > div:first-child {
  display: grid;
  gap: 5px;
}
.billing-plan-row small {
  opacity: 0.7;
}
.billing-plan-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}
.billing-plan-controls input {
  min-width: 0;
  background: transparent;
  color: inherit;
  border: 1px solid var(--border, #d7dbe2);
  border-radius: 9px;
  padding: 9px;
}
.usage-admin-list {
  display: grid;
  gap: 8px;
}
.usage-admin-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.6fr 0.6fr;
  gap: 10px;
  border: 1px solid var(--border, #d9dde5);
  border-radius: 12px;
  padding: 10px;
  font-size: 11px;
  align-items: center;
}
.usage-admin-row span {
  opacity: 0.75;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .plan-catalog {
    grid-template-columns: 1fr;
  }
  .billing-plan-row {
    grid-template-columns: 1fr;
  }
  .billing-plan-controls {
    grid-template-columns: 1fr 1fr;
  }
  .billing-plan-controls button {
    grid-column: 1/-1;
  }
  .usage-admin-row {
    grid-template-columns: 1fr 1fr;
  }
  .usage-admin-row strong {
    grid-column: 1/-1;
  }
  .yoomoney-widget iframe {
    width: 100%;
    max-width: 100%;
  }
  .account-note {
    font-size: 11px;
  }
}
.task-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.task-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.task-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-copy small {
  color: var(--muted);
}
.task-actions {
  display: flex;
  gap: 8px;
}
.system-output {
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.provider-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 90px;
}
/* v0.8.0-alpha.2 quality pass: readable chat, visible export, calmer sources */
.topbar-export {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  background: #15191f;
  color: #cfd4dc;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.topbar-export:hover {
  background: #20252d;
  color: #fff;
  border-color: #454d5a;
}
.topbar-export span:first-child {
  font-size: 15px;
  line-height: 1;
}
.message-row.user {
  display: flex;
  justify-content: flex-end;
  margin: 18px 0;
}
.message-row.user > .avatar {
  display: none;
}
.message-row.user .message-body {
  max-width: min(76%, 680px);
  align-items: flex-end;
}
.message-row.user .msg.user {
  background: #252b35;
  border-color: #343b47;
  border-radius: 16px 16px 5px 16px;
  padding: 10px 14px;
}
.message-row.user .message-actions {
  justify-content: flex-end;
}
.message-row.assistant {
  margin: 26px 0;
}
.message-row.assistant .message-body {
  max-width: 100%;
}
.message-row.assistant .msg {
  font-size: 14.5px;
  line-height: 1.68;
}
.message-sources {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #20252d;
}
.sources-title {
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}
.source-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.source-card {
  min-width: 0;
  padding: 10px;
  background: #101318;
}
.source-copy strong {
  font-weight: 620;
}
.source-copy small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.capability-banner.success {
  border-color: #28543a;
  background: #101a14;
  color: #bfe5cc;
}
@media (max-width: 900px) {
  .topbar-export span:last-child {
    display: none;
  }
  .topbar-export {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
  .source-list {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .message-row.user .message-body {
    max-width: 88%;
  }
  .message-row.assistant {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
  }
  .message-row.assistant .avatar {
    width: 28px;
    height: 28px;
  }
  .topbar-export {
    display: none;
  }
}
.title-stack {
  min-width: 0;
  max-width: min(520px, 42vw);
}
#conversationTitle {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-left {
  min-width: 0;
}
.topbar-right {
  flex: 0 0 auto;
}
@media (max-width: 720px) {
  .title-stack {
    max-width: 125px;
  }
  .topbar-sub {
    display: none;
  }
  #conversationTitle {
    font-size: 13px;
  }
  .mode {
    padding: 6px 7px;
    font-size: 10px;
  }
}
/* v0.8.0-alpha.2 Productization Foundation */
:root {
  --sidebar-user: 282px;
}
.app-shell {
  grid-template-columns: var(--sidebar-user) minmax(0, 1fr);
}
.composer-zone {
  left: var(--sidebar-user);
}
.brand-home {
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.brand-home:hover .brand-copy strong {
  color: #fff;
}
.sidebar-collapse {
  margin-left: auto;
  font-size: 19px;
}
.sidebar-resizer {
  position: absolute;
  right: -4px;
  top: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 40;
}
.sidebar-resizer:hover:after,
.sidebar-resizer.dragging:after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #5d6572;
}
.sidebar {
  position: sticky;
}
.sidebar.collapsed {
  padding-left: 8px;
  padding-right: 8px;
}
.sidebar.collapsed .brand-copy,
.sidebar.collapsed .new-chat span:nth-child(2),
.sidebar.collapsed .new-chat kbd,
.sidebar.collapsed .chat-search-wrap,
.sidebar.collapsed .sidebar-section-row,
.sidebar.collapsed .conversation-copy,
.sidebar.collapsed .conversation-delete,
.sidebar.collapsed .folder-copy,
.sidebar.collapsed .sidebar-status > div,
.sidebar.collapsed .sidebar-link span:nth-child(2),
.sidebar.collapsed .sidebar-link .lock,
.sidebar.collapsed .version-line {
  display: none;
}
.sidebar.collapsed .brand-block {
  justify-content: center;
}
.sidebar.collapsed .brand-home {
  gap: 0;
}
.sidebar.collapsed .sidebar-collapse {
  position: absolute;
  top: 56px;
  right: 4px;
  width: 24px;
  height: 24px;
}
.sidebar.collapsed .new-chat {
  justify-content: center;
  padding: 10px;
}
.sidebar.collapsed .conversation-item {
  grid-template-columns: 1fr;
  padding: 9px;
  justify-items: center;
}
.sidebar.collapsed .folder-item {
  justify-content: center;
}
.sidebar.collapsed .sidebar-link {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 10px;
}
.sidebar.collapsed .sidebar-status {
  justify-content: center;
}
.sidebar.collapsed .sidebar-resizer {
  display: none;
}
.sidebar-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-section-row .sidebar-section-title {
  padding-right: 4px;
}
.folder-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.folder-item {
  border: 0;
  background: transparent;
  color: #9aa1ae;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}
.folder-item:hover,
.folder-item.active {
  background: #161a20;
  color: #fff;
}
.folder-icon {
  font-size: 13px;
}
.folder-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  justify-content: space-between;
  gap: 6px;
}
.folder-copy strong {
  font-size: 12px;
  font-weight: 580;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folder-copy small {
  font-size: 10px;
  color: #69717e;
}
.conversation-group {
  margin-top: 10px;
}
.conversation-group-title {
  padding: 7px 8px 4px;
  font-size: 10px;
  color: #5f6673;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.privacy-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #253b31;
  background: #111b16;
  color: #b9dfc7;
  border-radius: 999px;
  padding: 7px 9px;
  font-size: 10px;
}
.privacy-pill span:first-child {
  color: var(--ok);
  font-size: 10px;
}
.composer {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}
.composer-mode-wrap {
  position: relative;
  align-self: center;
}
.composer-mode {
  height: 38px;
  border: 1px solid #303642;
  background: #191d24;
  color: #d7dbe2;
  border-radius: 10px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
}
.composer-mode:hover {
  background: #222730;
}
.composer-mode-menu {
  position: absolute;
  bottom: 46px;
  right: 0;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line2);
  background: #111419;
  border-radius: 12px;
  box-shadow: 0 20px 50px #000a;
  z-index: 55;
}
.composer-mode-menu .mode {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
}
.composer-mode-menu .mode.active:after {
  content: "✓";
  float: right;
}
.topbar .mode-bar {
  display: none;
}
.help-modal {
  width: min(760px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  background: #111419;
  border: 1px solid var(--line2);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 90px #000b;
}
.help-lead {
  color: #aab1bd;
  line-height: 1.55;
  max-width: 650px;
}
.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.help-grid button,
.help-grid a {
  border: 1px solid var(--line);
  background: #15191f;
  color: #fff;
  border-radius: 13px;
  padding: 15px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  display: grid;
  gap: 6px;
}
.help-grid button:hover,
.help-grid a:hover {
  border-color: #444b58;
  background: #1c2129;
}
.help-grid strong {
  font-size: 13px;
}
.help-grid span {
  font-size: 11px;
  color: #858d9a;
  line-height: 1.45;
}
.help-capabilities {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.help-capability {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 9px;
  background: #0e1116;
  border-radius: 9px;
}
.help-capability strong {
  font-size: 11px;
}
.help-capability small {
  display: block;
  color: #777f8d;
  margin-top: 2px;
}
.tour-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.tour-dim {
  position: absolute;
  inset: 0;
  background: #000a;
}
.tour-spotlight {
  position: fixed;
  border: 2px solid #e9edf3;
  border-radius: 14px;
  box-shadow:
    0 0 0 9999px #0009,
    0 0 28px #fff2;
  transition: all 0.24s ease;
  pointer-events: none;
}
.tour-card {
  position: fixed;
  width: min(360px, calc(100vw - 28px));
  background: #15191f;
  border: 1px solid #3a414d;
  border-radius: 16px;
  padding: 17px;
  box-shadow: 0 24px 90px #000d;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.tour-progress {
  font-size: 10px;
  color: #78808e;
  margin-bottom: 6px;
}
.tour-card h2 {
  margin: 0 0 7px;
  font-size: 18px;
}
.tour-card p {
  margin: 0;
  color: #aab1bd;
  font-size: 12px;
  line-height: 1.55;
}
.tour-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.tour-spacer {
  flex: 1;
}
@media (prefers-reduced-motion: reduce) {
  .tour-spotlight,
  .tour-card {
    transition: none !important;
  }
  * {
    scroll-behavior: auto !important;
  }
}
@media (max-width: 720px) {
  :root {
    --sidebar-user: 0px;
  }
  .app-shell {
    display: block;
  }
  .composer-zone {
    left: 0;
  }
  .sidebar-collapse,
  .sidebar-resizer {
    display: none;
  }
  .help-grid,
  .help-capabilities {
    grid-template-columns: 1fr;
  }
  .composer {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .composer-mode-wrap {
    grid-column: 2;
    justify-self: start;
  }
  .composer-mode {
    height: 30px;
    padding: 0 8px;
  }
  .send-button {
    grid-column: 3;
    grid-row: 1/3;
    height: 42px;
    align-self: end;
  }
  .privacy-pill {
    display: none;
  }
}
.guide-page {
  background: #0b0c0f;
  color: #eef1f5;
}
.guide-shell {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 80px;
}
.guide-back {
  color: #aab2bf;
  text-decoration: none;
}
.guide-shell h1 {
  font-size: 34px;
  letter-spacing: -0.035em;
  margin: 26px 0 10px;
}
.guide-lead {
  font-size: 16px;
  line-height: 1.65;
  color: #aeb5c0;
  max-width: 720px;
}
.guide-shell h2 {
  font-size: 18px;
  margin: 30px 0 8px;
}
.guide-shell p {
  color: #aeb5c0;
  line-height: 1.65;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.why-grid article {
  border: 1px solid var(--line);
  background: #111419;
  border-radius: 14px;
  padding: 18px;
}
.why-grid article h2 {
  margin: 0 0 8px;
}
@media (max-width: 700px) {
  .why-grid {
    grid-template-columns: 1fr;
  }
  .guide-shell h1 {
    font-size: 28px;
  }
}
.folder-item:not(button) {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 0;
}
.folder-select {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  padding: 8px 8px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  border-radius: 9px;
}
.folder-select:hover {
  background: var(--surface-hover);
}
.folder-actions {
  display: flex;
  opacity: 0.15;
  transition: opacity 0.15s ease;
}
.folder-item:hover .folder-actions,
.folder-item:focus-within .folder-actions {
  opacity: 1;
}
.folder-mini {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.folder-mini:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.conversation-icon {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 3px;
  border-radius: 6px;
}
.conversation-icon:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.log-filters {
  display: grid;
  grid-template-columns: 110px minmax(150px, 1fr) minmax(180px, 1fr) minmax(
      180px,
      1fr
    );
  gap: 8px;
  margin: 12px 0;
}
.log-filters label {
  display: grid;
  gap: 5px;
  font-size: 10px;
  color: var(--muted);
}
.log-filters input,
.log-filters select {
  min-width: 0;
  background: #0f1217;
  color: var(--text);
  border: 1px solid var(--line2);
  border-radius: 9px;
  padding: 8px 9px;
}
@media (max-width: 900px) {
  .log-filters {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .log-filters {
    grid-template-columns: 1fr;
  }
}
.entitlement-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.entitlement-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}
.entitlement-chip.on {
  background: rgba(72, 187, 120, 0.08);
}
.entitlement-chip.off {
  opacity: 0.55;
}
.session-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.session-row,
.user-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.session-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.session-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.admin-inline-settings {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 18px;
}
.admin-inline-settings label {
  min-width: 260px;
}
.user-row-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}
.entitlement-admin-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}
.entitlement-admin-item {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.lan-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
  gap: 20px;
  align-items: start;
}
.lan-qr {
  width: 220px;
  max-width: 100%;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
}
@media (max-width: 720px) {
  .lan-admin-grid {
    grid-template-columns: 1fr;
  }
  .session-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* 0.8 alpha.3 scenario-first beginner UX */
.scenario-heading {
  margin: 22px 0 10px;
  font-size: 15px;
  text-align: left;
  width: min(760px, 100%);
}
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(760px, 100%);
}
.scenario-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--text);
  cursor: pointer;
}
.scenario-card:hover,
.scenario-card.active {
  border-color: var(--accent);
  background: var(--panel-strong);
}
.scenario-icon {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface);
  font-size: 18px;
}
.scenario-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.scenario-copy strong {
  font-size: 14px;
}
.scenario-copy small {
  color: var(--muted);
  line-height: 1.35;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
}
.check-row input {
  margin-top: 3px;
}
@media (max-width: 720px) {
  .scenario-grid {
    grid-template-columns: 1fr;
  }
  .scenario-heading {
    margin-top: 18px;
  }
}
/* 0.8 alpha.4 UX/Admin hardening */
:root {
  --sidebar-user: 282px;
  --surface: #15191f;
  --surface-hover: #1b2028;
  --border: var(--line);
  --panel-strong: #1b2028;
}
html[data-theme="dark"] {
  color-scheme: dark;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel2: #f0f2f5;
  --panel3: #e7eaf0;
  --line: #dce0e7;
  --line2: #cdd3dc;
  --muted: #667085;
  --text: #16181d;
  --soft: #414753;
  --accent: #17191f;
  --surface: #f5f6f8;
  --surface-hover: #eceff3;
  --panel-strong: #eef1f5;
  background: #f6f7f9;
  color: #16181d;
}
html[data-theme="light"] body,
html[data-theme="light"] .app-shell,
html[data-theme="light"] .admin-page,
html[data-theme="light"] .guide-page {
  background: var(--bg);
  color: var(--text);
}
html[data-theme="light"] .app-shell {
  background:
    radial-gradient(circle at 55% -15%, #e5e8ef 0, transparent 34%), var(--bg);
}
html[data-theme="light"] .sidebar,
html[data-theme="light"] .admin-sidebar {
  background: #fff;
}
html[data-theme="light"] .topbar {
  background: #ffffffdb;
}
html[data-theme="light"] .composer,
html[data-theme="light"] .help-modal,
html[data-theme="light"] .settings-modal,
html[data-theme="light"] .panel,
html[data-theme="light"] .admin-login-card {
  background: #fff;
  color: var(--text);
}
html[data-theme="light"] .composer textarea,
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  color: var(--text);
}
html[data-theme="light"] .send-button {
  background: #181a20;
  color: #fff;
}
html[data-theme="light"] .msg.user {
  background: #edf0f4;
  border-color: #dce0e7;
  color: #16181d;
}
html[data-theme="light"] .message-row.assistant .msg {
  color: #20242b;
}
html[data-theme="light"] .privacy-pill,
html[data-theme="light"] .status-pill {
  background: #fff;
}
html[data-theme="light"] .composer-zone {
  background: linear-gradient(180deg, transparent, #f6f7f9 25%);
}
.app-shell {
  grid-template-columns: var(--sidebar-user) minmax(0, 1fr);
}
.composer-zone {
  left: var(--sidebar-user);
}
.sidebar.collapsed {
  width: 68px;
  overflow: visible;
}
.sidebar.collapsed + .sidebar-backdrop + .workspace {
  min-width: 0;
}
.sidebar.collapsed .folder-list,
.sidebar.collapsed .conversation-list {
  overflow: visible;
}
.sidebar.collapsed .conversation-empty {
  display: none !important;
}
.sidebar.collapsed .folder-item,
.sidebar.collapsed .conversation-item {
  min-height: 42px;
}
.sidebar.collapsed .folder-actions {
  display: none;
}
.sidebar.collapsed .conversation-group-title {
  display: none;
}
.sidebar.collapsed .conversation-group {
  margin-top: 2px;
}
.sidebar.collapsed .conversation-icon {
  font-size: 16px;
}
.sidebar.collapsed .folder-icon {
  font-size: 16px;
}
.settings-content label,
.provider-form label,
.artifact-create > label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--soft);
  font-size: 12px;
}
.settings-content input,
.settings-content select,
.settings-content textarea,
.provider-form input,
.provider-form select,
.provider-form textarea,
.modal-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: #0f1217;
  color: var(--text);
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 10px 11px;
  outline: none;
}
.settings-content textarea,
.provider-form textarea {
  display: block;
  resize: vertical;
  line-height: 1.5;
}
.settings-content textarea:focus,
.provider-form textarea:focus,
.settings-content input:focus,
.settings-content select:focus,
.provider-form input:focus,
.provider-form select:focus {
  border-color: #697383;
  box-shadow: 0 0 0 3px #68708020;
}
.settings-content .code-editor {
  width: 100%;
  min-height: 320px;
  max-height: 70vh;
  font-family: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
}
.vpn-routing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.vpn-routing-grid .system-output {
  min-height: 220px;
}
.vpn-notes {
  grid-column: 1/-1;
}
.form-grid.compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.experience-grid {
  margin: 12px 0;
}
.experience-wide {
  grid-column: 1/-1;
}
.settings-panel {
  min-width: 0;
}
.settings-content {
  min-width: 0;
  overflow: auto;
}
.settings-grid {
  min-width: 0;
}
.admin-content {
  max-width: none;
}
.admin-tab,
.panel {
  min-width: 0;
}
.provider-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.provider-form > button,
.provider-form > .job-state {
  align-self: end;
}
#deployPrivateKey,
#webAllowedDomains,
#webExcludedDomains,
#artifactContent {
  width: 100%;
}
.privacy-pill {
  border: 1px solid #314338;
  cursor: pointer;
}
.privacy-pill:hover {
  filter: brightness(1.08);
}
.topbar-export {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #13161b;
  color: var(--soft);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11px;
  cursor: pointer;
}
.topbar-export:hover {
  background: var(--panel2);
  color: var(--text);
}
.feedback-inline {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.feedback-inline h3 {
  margin: 0 0 6px;
}
.feedback-admin-list {
  display: grid;
  gap: 10px;
}
.feedback-admin-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel2);
}
.feedback-admin-item header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.feedback-admin-item p {
  white-space: pre-wrap;
  color: var(--soft);
}
.feedback-inline label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--soft);
  font-size: 12px;
}
.feedback-inline input,
.feedback-inline select,
.feedback-inline textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: #0f1217;
  color: var(--text);
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 10px 11px;
  outline: none;
}
.feedback-inline textarea {
  display: block;
  resize: vertical;
  line-height: 1.5;
  min-height: 110px;
}
.feedback-inline input:focus,
.feedback-inline select:focus,
.feedback-inline textarea:focus {
  border-color: #697383;
  box-shadow: 0 0 0 3px #68708020;
}
.share-notice {
  display: grid;
  gap: 8px;
}
.share-notice input {
  width: 100%;
}
.setup-steps {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}
.setup-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 15px;
  padding: 16px;
}
.setup-step-number {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--panel3);
  font-weight: 800;
}
.setup-step h2 {
  margin: 0 0 6px;
}
.setup-step p {
  margin: 0;
}
.setup-command {
  background: #0e1116;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  overflow: auto;
  color: #dce1e8;
}
@media (max-width: 900px) {
  .provider-form {
    grid-template-columns: 1fr;
  }
  .vpn-routing-grid {
    grid-template-columns: 1fr;
  }
  .topbar-export span:last-child {
    display: none;
  }
  .form-grid.compact {
    grid-template-columns: 1fr;
  }
  .experience-wide {
    grid-column: auto;
  }
}
@media (max-width: 720px) {
  .app-shell {
    display: block;
  }
  .composer-zone {
    left: 0;
  }
  .topbar {
    padding: 0 12px;
  }
  .topbar-right {
    gap: 6px;
  }
  .topbar-export {
    padding: 8px;
  }
  .settings-grid {
    display: block;
  }
  .settings-nav {
    display: flex;
    overflow: auto;
    gap: 6px;
    padding-bottom: 10px;
  }
  .settings-nav > * {
    white-space: nowrap;
  }
  .settings-content {
    padding-top: 8px;
  }
  .provider-form {
    grid-template-columns: 1fr;
  }
  .settings-content .code-editor {
    min-height: 240px;
  }
}
@media (max-width: 720px) {
  .user-page .sidebar,
  .user-page .sidebar.collapsed {
    position: fixed;
    left: 0;
    top: 0;
    width: min(86vw, 310px);
    height: 100dvh;
    padding: 16px 14px 14px;
    transform: translateX(-105%);
    z-index: 30;
  }
  .user-page.ui-ready .sidebar {
    transition: transform 0.2s ease;
  }
  .user-page.sidebar-open .sidebar {
    transform: translateX(0);
  }
}
/* 0.8.0-alpha.5 UX/Admin hardening */
.sidebar.collapsed .folder-list,
.sidebar.collapsed .conversation-list,
.sidebar.collapsed .conversation-empty {
  display: none !important;
}
.sidebar.collapsed .sidebar-spacer {
  flex: 1;
}
.sidebar.collapsed .new-chat {
  margin-top: 6px;
}
.sidebar.collapsed .sidebar-status {
  border-top: 0;
}
.sidebar.collapsed .feedback-entry {
  margin-top: 2px;
}
.composer-mode-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.composer-tone {
  height: 30px;
  min-width: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel2);
  color: var(--soft);
  cursor: pointer;
}
.composer-tone:hover {
  background: var(--panel3);
  color: var(--text);
}
.tone-menu {
  left: auto;
  right: 0;
  min-width: 190px;
  max-height: 330px;
  overflow: auto;
}
.feedback-entry {
  opacity: 0.86;
}
.feedback-entry:hover {
  opacity: 1;
}
.feedback-admin-card {
  border: 1px solid var(--line);
  background: var(--panel2);
  padding: 13px 14px;
  border-radius: 13px;
}
.feedback-admin-card p {
  white-space: pre-wrap;
  line-height: 1.5;
  margin: 9px 0;
  color: var(--soft);
}
.setup-guide {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 70px;
}
.setup-hero {
  padding: 30px 0 20px;
  max-width: 800px;
}
.setup-hero h1 {
  font-size: clamp(30px, 5vw, 54px);
  letter-spacing: -0.04em;
  margin: 8px 0 12px;
}
.setup-hero p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}
.setup-step-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 22px 0 30px;
}
.setup-step > span {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--panel3);
  font-weight: 800;
}
.setup-step h2 {
  font-size: 16px;
}
.setup-step p {
  color: var(--muted);
  line-height: 1.55;
}
.setup-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 28px 0;
}
.setup-choice {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 18px;
}
.setup-choice-icon {
  font-size: 25px;
}
.setup-choice h2 {
  font-size: 16px;
  margin: 12px 0 6px;
}
.setup-choice p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
.setup-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.link-button {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 11px;
}
.guide-page code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: var(--panel3);
  padding: 2px 6px;
  border-radius: 6px;
}
#webAllowedDomains,
#webExcludedDomains,
#artifactContent,
#codeEditor,
#deployPrivateKey {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
}
.provider-form > label,
.form-grid > label,
.settings-content label {
  min-width: 0;
}
.admin-content textarea,
.admin-content input,
.admin-content select {
  max-width: 100%;
}
@media (max-width: 760px) {
  .setup-step-grid,
  .setup-choice-grid {
    grid-template-columns: 1fr;
  }
  .setup-guide {
    width: min(100% - 22px, 1040px);
    padding-top: 20px;
  }
  .topbar-export span:last-child {
    display: none;
  }
  .composer-mode-wrap {
    gap: 4px;
  }
  .tone-menu {
    right: 0;
  }
}
/* 0.8.0-alpha.5 UX Complete Pass */
:root {
  --content-max: 980px;
}
.chat,
.composer-zone > * {
  width: min(var(--content-max), 100%);
}
.new-project-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 11px;
  cursor: pointer;
}
.new-project-button:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--line);
}
.new-project-button span:first-child {
  font-size: 14px;
}
.new-project-label {
  white-space: nowrap;
}
.folder-item:not(button) {
  border-radius: 10px;
}
.folder-item:not(button):hover {
  background: rgba(127, 127, 127, 0.045);
}
.folder-select {
  min-height: 38px;
}
.folder-copy {
  align-items: center;
}
.folder-copy strong {
  font-size: 12px;
}
.folder-copy small {
  min-width: 18px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 5px;
}
.runtime-state {
  position: sticky;
  top: 64px;
  z-index: 18;
  margin: 10px auto 0;
  width: min(var(--content-max), calc(100% - 32px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 14px 40px #0003;
  backdrop-filter: blur(14px);
}
.runtime-state[hidden] {
  display: none;
}
.runtime-state-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--panel3);
  font-weight: 900;
}
.runtime-state-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.runtime-state-copy strong {
  font-size: 12px;
}
.runtime-state-copy span {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.4;
}
.runtime-state.offline,
.runtime-state.error {
  border-color: #66383e;
}
.runtime-state.offline .runtime-state-icon,
.runtime-state.error .runtime-state-icon {
  color: #ff9b9b;
  background: #2a171a;
}
.runtime-state.degraded,
.runtime-state.quota,
.runtime-state.permission {
  border-color: #665126;
}
.runtime-state.degraded .runtime-state-icon,
.runtime-state.quota .runtime-state-icon,
.runtime-state.permission .runtime-state-icon {
  color: #f1c46f;
  background: #251f12;
}
.runtime-state.starting,
.runtime-state.booting {
  border-color: #38485d;
}
.runtime-state.starting .runtime-state-icon,
.runtime-state.booting .runtime-state-icon {
  color: #a8c8ff;
  background: #151f2d;
}
.runtime-state-action {
  margin: 0;
}
.chat[aria-busy="true"]:empty:before {
  content: "";
  display: block;
  width: min(620px, 90%);
  height: 18px;
  margin: 90px auto 14px;
  border-radius: 9px;
  background: linear-gradient(
    90deg,
    var(--panel2),
    var(--panel3),
    var(--panel2)
  );
  background-size: 200% 100%;
  animation: skeleton 1.2s ease-in-out infinite;
}
.chat[aria-busy="true"]:empty:after {
  content: "";
  display: block;
  width: min(460px, 70%);
  height: 12px;
  margin: 0 auto;
  border-radius: 7px;
  background: linear-gradient(
    90deg,
    var(--panel2),
    var(--panel3),
    var(--panel2)
  );
  background-size: 200% 100%;
  animation: skeleton 1.2s ease-in-out infinite;
}
@keyframes skeleton {
  to {
    background-position: -200% 0;
  }
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #8db8ff !important;
  outline-offset: 2px;
}
.sidebar-resizer:focus-visible:after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #8db8ff;
}
.sidebar-resizer {
  touch-action: none;
}
.sidebar-resizer[aria-valuenow] {
  outline-offset: -2px;
}
.locale-toggle {
  position: absolute;
  right: 22px;
  top: 22px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--soft);
  border-radius: 9px;
  padding: 6px 9px;
  font-size: 11px;
  cursor: pointer;
}
.auth-card {
  position: relative;
}
.admin-quick-preferences {
  display: flex;
  gap: 4px;
}
.admin-quick-preferences .admin-back {
  flex: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
html[data-theme="light"] .starter-card,
html[data-theme="light"] .tool-card,
html[data-theme="light"] .scenario-card,
html[data-theme="light"] .cap-chip {
  background: var(--panel);
  color: var(--text);
}
html[data-theme="light"] .chat-search {
  color: var(--text);
}
html[data-theme="light"] .settings-content input,
html[data-theme="light"] .settings-content select,
html[data-theme="light"] .settings-content textarea,
html[data-theme="light"] .provider-form input,
html[data-theme="light"] .provider-form select,
html[data-theme="light"] .provider-form textarea,
html[data-theme="light"] .feedback-inline input,
html[data-theme="light"] .feedback-inline select,
html[data-theme="light"] .feedback-inline textarea,
html[data-theme="light"] .modal-input {
  background: #fff;
  color: var(--text);
}
html[data-theme="light"] .runtime-state {
  background: #ffffffee;
}
html[data-theme="light"] .sidebar,
html[data-theme="light"] .admin-sidebar {
  background: #fff;
  border-color: var(--line);
}
html[data-theme="light"] .topbar,
html[data-theme="light"] .status-pill,
html[data-theme="light"] .mode-bar,
html[data-theme="light"] .popover-menu,
html[data-theme="light"] .tool-tray {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}
html[data-theme="light"] .conversation-item:hover,
html[data-theme="light"] .conversation-item.active,
html[data-theme="light"] .admin-entry:hover,
html[data-theme="light"] .admin-nav-item:hover,
html[data-theme="light"] .admin-nav-item.active,
html[data-theme="light"] .folder-item:hover,
html[data-theme="light"] .folder-item.active {
  background: #edf1f5;
  color: var(--text);
}
html[data-theme="light"] .panel,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .route-card,
html[data-theme="light"] .model-card,
html[data-theme="light"] .admin-login-card,
html[data-theme="light"] .info-callout,
html[data-theme="light"] .billing-setup-checklist,
html[data-theme="light"] .search-provider-status,
html[data-theme="light"] .feedback-admin-card,
html[data-theme="light"] .feedback-admin-item,
html[data-theme="light"] .setup-choice,
html[data-theme="light"] .setup-step,
html[data-theme="light"] .tour-card,
html[data-theme="light"] .help-modal,
html[data-theme="light"] .settings-modal,
html[data-theme="light"] .code-block,
html[data-theme="light"] .system-output,
html[data-theme="light"] .log-filters input,
html[data-theme="light"] .log-filters select {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}
html[data-theme="light"] .preset-chip {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}
html[data-theme="light"] .preset-chip:hover {
  background: #f5f7fa;
  border-color: #c9d2df;
}
html[data-theme="light"] .preset-chip.active {
  background: #17191f;
  color: #fff;
  border-color: #17191f;
}
html[data-theme="light"] .metric-card span,
html[data-theme="light"] .metric-card small,
html[data-theme="light"] .panel p,
html[data-theme="light"] .info-callout,
html[data-theme="light"] .route-copy small,
html[data-theme="light"] .model-meta,
html[data-theme="light"] .admin-brand small,
html[data-theme="light"] .admin-nav-item,
html[data-theme="light"] .eyebrow,
html[data-theme="light"] .job-state,
html[data-theme="light"] .muted {
  color: var(--muted);
}
html[data-theme="light"] .admin-page .primary-button {
  background: #17191f;
  color: #fff;
}
html[data-theme="light"] .admin-page .secondary-button,
html[data-theme="light"] .admin-page .text-icon-button,
html[data-theme="light"] .admin-page .admin-back,
html[data-theme="light"] .admin-page .admin-logout {
  background: #f1f4f7;
  color: #2b313b;
  border: 1px solid var(--line);
}
html[data-theme="light"] .admin-page .admin-nav-item:hover,
html[data-theme="light"] .admin-page .admin-nav-item.active {
  background: #edf1f5;
  color: #17191f;
}
html[data-theme="light"] .admin-page .count-badge,
html[data-theme="light"] .admin-page .status-pill {
  background: #f7f8fa;
  color: #2b313b;
}
html[data-theme="light"] .admin-page .route-card,
html[data-theme="light"] .admin-page .panel,
html[data-theme="light"] .admin-page .metric-card,
html[data-theme="light"] .admin-page .model-card,
html[data-theme="light"] .admin-page .admin-login-card,
html[data-theme="light"] .admin-page .info-callout,
html[data-theme="light"] .admin-page .billing-setup-checklist,
html[data-theme="light"] .admin-page .search-provider-status,
html[data-theme="light"] .admin-page .feedback-admin-card,
html[data-theme="light"] .admin-page .feedback-admin-item,
html[data-theme="light"] .admin-page .setup-choice,
html[data-theme="light"] .admin-page .setup-step,
html[data-theme="light"] .admin-page .tour-card {
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}
html[data-theme="light"] .auth-card,
html[data-theme="light"] .guide-page {
  background: var(--bg);
  color: var(--text);
}
html[data-theme="light"] .auth-card {
  border-color: var(--line);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}
html[data-theme="light"] .guide-shell p,
html[data-theme="light"] .guide-back,
html[data-theme="light"] .guide-lead {
  color: var(--muted);
}
.sidebar.collapsed .new-project-label {
  display: none;
}
.sidebar.collapsed .new-project-button {
  display: none;
}
.sidebar.collapsed .project-heading {
  display: none;
}
.sidebar.collapsed .brand-mark {
  width: 38px;
  height: 38px;
}
.sidebar.collapsed .sidebar-link,
.sidebar.collapsed .new-chat {
  position: relative;
}
.sidebar.collapsed .sidebar-link:hover:after,
.sidebar.collapsed .new-chat:hover:after {
  content: attr(aria-label);
  position: absolute;
  left: 54px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: var(--panel3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 11px;
  box-shadow: 0 10px 30px #0007;
  pointer-events: none;
  z-index: 100;
}
.settings-modal {
  width: min(1040px, calc(100vw - 32px));
  max-height: min(820px, 92vh);
}
.settings-grid {
  grid-template-columns: 210px minmax(0, 1fr);
}
.settings-content {
  padding: 26px 28px;
}
.settings-content label {
  width: 100%;
}
.settings-content textarea {
  min-height: 96px;
}
.settings-content #webAllowedDomains {
  min-height: 128px;
}
.settings-content #webExcludedDomains {
  min-height: 104px;
}
.settings-content .code-editor {
  min-height: 360px;
}
.code-result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}
.preset-chip {
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--soft);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 11px;
  cursor: pointer;
  transition:
    background 0.14s ease,
    border-color 0.14s ease,
    transform 0.14s ease;
}
.preset-chip:hover {
  background: var(--panel3);
  border-color: #596171;
  transform: translateY(-1px);
}
.preset-chip.active {
  background: #e9eef5;
  color: #101318;
  border-color: #e9eef5;
  font-weight: 700;
}
@media (max-width: 900px) {
  :root {
    --content-max: 900px;
  }
  .runtime-state {
    top: 64px;
  }
  .settings-modal {
    width: min(960px, calc(100vw - 20px));
  }
  .settings-grid {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .runtime-state {
    top: 58px;
    width: calc(100% - 20px);
    grid-template-columns: auto minmax(0, 1fr);
    margin-top: 8px;
  }
  .runtime-state-action {
    grid-column: 2;
    justify-self: start;
  }
  .new-project-label {
    display: none;
  }
  .settings-modal {
    width: 100%;
    height: min(94vh, 820px);
    border-radius: 16px;
  }
  .settings-content {
    padding: 16px;
  }
  .code-result-grid {
    grid-template-columns: 1fr;
  }
  .locale-toggle {
    right: 16px;
    top: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .chat[aria-busy="true"]:empty:before,
  .chat[aria-busy="true"]:empty:after {
    animation: none !important;
  }
}
.auth-page {
  background: var(--bg);
  color: var(--text);
}
.auth-card {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}
.auth-card input {
  border-color: var(--line2);
  background: var(--panel2);
  color: var(--text);
}
.auth-links a {
  color: #9fc2ff;
}
.auth-brand small {
  color: var(--muted);
}
@media (max-width: 720px) {
  .auth-page {
    display: block;
    padding: 16px;
    min-height: 100dvh;
  }
  .auth-shell {
    width: 100%;
    max-width: 100%;
  }
  .auth-card {
    width: 100%;
    padding: 22px 18px 18px;
    border-radius: 18px;
  }
  .auth-brand {
    margin-bottom: 22px;
    padding-right: 56px;
    align-items: flex-start;
  }
  .auth-brand .brand-mark {
    flex: 0 0 auto;
  }
  .auth-brand > span:last-child {
    min-width: 0;
  }
  .auth-brand strong,
  .auth-brand small {
    overflow-wrap: anywhere;
  }
  .auth-card form {
    gap: 14px;
  }
  .auth-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .legal-links {
    gap: 10px 12px;
  }
  .locale-toggle {
    right: 14px;
    top: 14px;
  }
}
@media (max-width: 420px) {
  .auth-page {
    padding: 10px;
  }
  .auth-card {
    padding: 18px 14px 16px;
    border-radius: 16px;
  }
  .auth-brand {
    gap: 8px;
    padding-right: 52px;
  }
  .auth-card label {
    font-size: 12px;
  }
  .auth-card input {
    padding: 11px 12px;
  }
  .auth-links,
  .legal-links {
    font-size: 12px;
  }
  .locale-toggle {
    padding: 5px 8px;
    font-size: 10px;
  }
}
/* 1.0.0 Search Integrity + lightweight Result Cards */
.message-sources.result-section {
  max-width: 900px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.result-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.result-section .sources-title {
  margin: 0;
  font-size: 11px;
  font-weight: 720;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}
.result-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.result-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  min-height: 126px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--panel2) 96%, transparent),
    var(--panel)
  );
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: 150px;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
  animation: result-card-enter 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(min(var(--result-index), 6) * 28ms);
}
.result-card:hover {
  transform: translateY(-2px);
  border-color: var(--line2);
  background: var(--panel2);
  box-shadow: 0 10px 28px #0003;
}
.result-card:active {
  transform: translateY(0);
}
.result-card-top,
.result-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.result-card-top {
  justify-content: space-between;
}
.result-kind {
  flex: 0 0 auto;
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.02em;
  color: var(--soft);
  background: var(--panel3);
}
.result-kind-news {
  color: #b9d7ff;
  background: #142034;
  border-color: #29456c;
}
.result-kind-product {
  color: #c8efd3;
  background: #12251a;
  border-color: #28553a;
}
.result-kind-real_estate {
  color: #ead6ff;
  background: #21162c;
  border-color: #4e3364;
}
.result-kind-procurement {
  color: #ffe0ab;
  background: #281e10;
  border-color: #5c4521;
}
.result-kind-marketplace {
  color: #c6e2ff;
  background: #152739;
  border-color: #2f5784;
}
.result-kind-registry {
  color: #ffd9c1;
  background: #2a1c16;
  border-color: #664432;
}
.result-domain {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: var(--muted);
  text-align: right;
}
.result-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.38;
  font-weight: 700;
}
.result-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.result-meta {
  margin-top: auto;
  min-height: 22px;
  color: var(--muted);
  font-size: 9px;
  flex-wrap: wrap;
}
.result-price {
  margin-left: auto;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}
.result-open {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.result-price + .result-open {
  margin-left: 0;
}
.result-strategy {
  opacity: 0.72;
}
.result-date {
  white-space: nowrap;
}
@keyframes result-card-enter {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
html[data-theme="light"] .result-card {
  background: linear-gradient(180deg, #fff, var(--panel));
  box-shadow: 0 2px 10px #1f29370a;
}
html[data-theme="light"] .result-card:hover {
  background: #fff;
  box-shadow: 0 10px 26px #1f293718;
}
@media (max-width: 760px) {
  .result-card-grid {
    grid-template-columns: 1fr;
  }
  .result-card {
    min-height: 112px;
    padding: 11px 12px;
  }
  .result-summary {
    -webkit-line-clamp: 2;
  }
  .message-sources.result-section {
    max-width: 100%;
  }
}
@media (max-width: 420px) {
  .result-card {
    border-radius: 12px;
  }
  .result-kind {
    font-size: 8px;
  }
  .result-title {
    font-size: 12px;
  }
  .result-domain {
    max-width: 42%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .result-card {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
.search-provider-status {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: 12px;
  padding: 11px 12px;
  margin: 14px 0;
}
.search-provider-status small {
  color: var(--muted);
  line-height: 1.4;
}
.search-policy-grid {
  margin: 12px 0;
}
.search-domain-policy {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.search-domain-policy textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
}
.search-domain-policy small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.4;
}
@media (max-width: 800px) {
  .search-provider-status {
    grid-template-columns: 1fr;
  }
  .search-domain-policy {
    grid-template-columns: 1fr;
  }
}
/* alpha.6 request timing / debug details */
.message-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}
.message-meta-chip {
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: 999px;
  padding: 3px 7px;
}
.message-debug {
  width: 100%;
  max-width: 760px;
  margin-top: 3px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  background: color-mix(in srgb, var(--panel2) 74%, transparent);
}
.message-debug summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--soft);
}
.message-debug-row {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  color: var(--muted);
}
@media (max-width: 760px) {
  .message-meta {
    font-size: 9px;
  }
  .message-debug {
    max-width: 100%;
  }
}
.billing-setup-checklist {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel2);
}
.billing-setup-step {
  font-size: 11px;
  color: var(--muted);
}
.billing-setup-step.ok {
  color: #8ed6a2;
}
.billing-setup-step.pending {
  color: var(--muted);
}
/* 1.0.0 responsive density, progressive answers and clarification chips */
html[data-ui-scale="compact"] .topbar {
  height: 56px;
  padding-inline: 18px;
}
html[data-ui-scale="compact"] .chat {
  width: min(980px, 100%);
  padding: 26px 20px 160px;
}
html[data-ui-scale="compact"] .msg {
  font-size: 13px;
  line-height: 1.55;
}
html[data-ui-scale="compact"] .message-row {
  margin: 17px 0;
  gap: 10px;
}
html[data-ui-scale="compact"] .composer {
  padding: 6px;
  border-radius: 14px;
}
html[data-ui-scale="compact"] .composer textarea {
  min-height: 38px;
  padding: 8px 4px;
}
html[data-ui-scale="compact"] .send-button {
  height: 36px;
  padding-inline: 11px;
}
html[data-ui-scale="compact"] .scenario-card,
html[data-ui-scale="compact"] .starter-card {
  padding: 11px 12px;
}
html[data-ui-scale="compact"] .result-card {
  min-height: 112px;
  padding: 10px 11px;
}
html[data-ui-scale="large"] .topbar {
  height: 72px;
  padding-inline: 26px;
}
html[data-ui-scale="large"] .chat {
  width: min(920px, 100%);
  padding: 40px 28px 200px;
}
html[data-ui-scale="large"] .msg {
  font-size: 16px;
  line-height: 1.68;
}
html[data-ui-scale="large"] .message-row {
  margin: 27px 0;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 15px;
}
html[data-ui-scale="large"] .avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 11px;
}
html[data-ui-scale="large"] .composer {
  padding: 10px;
  border-radius: 19px;
}
html[data-ui-scale="large"] .composer textarea {
  min-height: 50px;
  padding: 13px 7px;
  font-size: 15px;
}
html[data-ui-scale="large"] .send-button {
  height: 46px;
  padding-inline: 16px;
  font-size: 14px;
}
html[data-ui-scale="large"] .scenario-card,
html[data-ui-scale="large"] .starter-card {
  padding: 16px 17px;
}
html[data-ui-scale="large"] .result-card {
  min-height: 146px;
  padding: 15px 16px;
}
.quick-replies {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 9px 0 2px;
}
.quick-reply {
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--soft);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  cursor: pointer;
  transition:
    background 0.14s ease,
    border-color 0.14s ease,
    transform 0.14s ease;
}
.quick-reply:hover {
  background: var(--panel3);
  border-color: #586171;
  transform: translateY(-1px);
}
.progressive-reveal:after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -0.12em;
  background: currentColor;
  opacity: 0.72;
  animation: reveal-caret 0.7s steps(1, end) infinite;
}
@keyframes reveal-caret {
  50% {
    opacity: 0.08;
  }
}
.scenario-card.active {
  border-color: #8db8ff;
  background: color-mix(in srgb, var(--panel-strong) 82%, #315d9440);
  box-shadow: inset 0 0 0 1px #8db8ff30;
}
.scenario-card.active:after {
  content: "✓";
  margin-left: auto;
  color: #9fc2ff;
  font-weight: 800;
}
.starter-card.active {
  border-color: #8db8ff;
  background: color-mix(in srgb, var(--panel-strong) 82%, #315d9435);
  box-shadow: inset 0 0 0 1px #8db8ff2f;
}
.scenario-card:focus-visible,
.starter-card:focus-visible {
  outline: 2px solid #e8edf6 !important;
  outline-offset: 3px;
}
.scenario-card.active:focus-visible,
.starter-card.active:focus-visible {
  outline-color: #8db8ff !important;
}
@media (max-width: 720px) {
  html[data-ui-scale="large"] .chat {
    padding-inline: 18px;
  }
  .quick-reply {
    font-size: 10px;
    padding: 6px 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .progressive-reveal:after {
    display: none !important;
  }
  .quick-reply,
  .scenario-card,
  .starter-card {
    transition: none !important;
    transform: none !important;
  }
}

.wallet-box { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel2); margin-bottom: 20px; }
#walletAmount { font-size: clamp(30px, 6vw, 44px); font-weight: 700; margin-top: 8px; }
.theme-row { display:flex; gap:16px; align-items:center; justify-content:space-between; border:1px solid var(--line); border-radius:12px; padding:14px; }
.theme-row > div { display:grid; gap:6px; }
.theme-row small { color:var(--muted); }

.welcome-nav { display:flex; justify-content:space-between; align-items:center; margin-bottom:42px; }
.welcome-demo { margin:40px 0; padding:24px; background:var(--panel); border:1px solid var(--line); border-radius:18px; }
.welcome-demo textarea { display:block; width:100%; margin:10px 0 14px; min-height:100px; }
.demo-answer { white-space:pre-wrap; border-left:3px solid var(--accent); padding:18px; margin:16px 0; background:var(--panel2); }
.welcome-shell .panel-actions { flex-wrap:wrap; }
