/* src/apps/web/styles.css */
*, *:before, *:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #090a0d;
  --bg2: #121418b8;
  --bg3: #1f2228e0;
  --bg4: #2b2f38f0;
  --border: #3a3e47;
  --border-focus: #b7bdc8;
  --text: #f4f5f7;
  --text-sub: #cfd3da;
  --text-dim: #8a909c;
  --accent: #d9dde5;
  --accent-hover: #eef1f6;
  --accent-press: #b7bdc8;
  --accent-subtle: #d9dde51f;
  --green: #9fc7ad;
  --green-bg: #9fc7ad2e;
  --red: #d99ca5;
  --red-bg: #d99ca52e;
  --yellow: #d8cb9e;
  --shadow-2: 0 1.6px 3.6px #0000005c, 0 .3px .9px #00000047;
  --shadow-4: 0 3.2px 7.2px #0000005c, 0 .6px 1.8px #00000047;
  --shadow-8: 0 6.4px 14.4px #0000005c, 0 1.2px 3.6px #00000047;
  --radius: 4px;
  --radius-lg: 8px;
  --font-body: "Alliance No.1", "Avenir Next", "IBM Plex Sans", "Segoe UI", "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, sans-serif;
  --font-display: "Alliance No.2", "Alliance No.1", "Avenir Next", "IBM Plex Sans", "Segoe UI", "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New", monospace;
  --font: var(--font-body);
  --tracking-caps: .05em;
  --tracking-tight: -.02em;
}

html, body, #root {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  height: 100%;
  font-size: 14px;
  line-height: 1.3889;
}

body {
  background-image: radial-gradient(circle at 12% 8%, #ffffff14, #0000 34%), radial-gradient(circle at 84% 0%, #8a909c1a, #0000 30%), linear-gradient(#07080b 0%, #090a0d 56%, #0d1016 100%);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-tight);
}

.layout {
  display: grid;
  grid-template-columns: 268px 1fr;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  height: 100vh;
}

.layout:before {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: .22;
  z-index: -1;
  background-image: linear-gradient(#ffffff05 1px, #0000 1px), linear-gradient(90deg, #ffffff05 1px, #0000 1px);
  background-size: 28px 28px;
  inset: 0;
}

.sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  overflow: hidden;
  backdrop-filter: blur(8px);
  background: linear-gradient(#0b0c0fc7 0%, #0b0c0f9e 100%);
  flex-direction: column;
}

.sidebar-header {
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px 12px;
}

.sidebar-logo {
  font-family: var(--font-display);
  color: var(--text);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-logo span {
  color: var(--text-dim);
  letter-spacing: var(--tracking-caps);
  font-weight: 400;
}

.sidebar-section {
  padding: 10px 0 4px;
}

.sidebar-label {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 12px 4px;
  font-size: 11px;
  font-weight: 600;
}

.sessions-list {
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}

.session-item {
  cursor: pointer;
  display: flex;
  border-radius: var(--radius);
  border: 1px solid #0000;
  flex-direction: column;
  gap: 3px;
  margin: 1px 6px;
  padding: 9px 12px;
  transition: background .14s, border-color .14s;
}

.session-item:hover {
  background: #202a36bf;
}

.session-item.active {
  background: var(--accent-subtle);
  border-color: #d9dde55c;
}

.session-item .preview {
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.session-item .date {
  color: var(--text-dim);
  font-size: 11px;
}

.sidebar-new-chat {
  background: #1f2228eb;
  border-radius: 999px;
  width: 100%;
  font-weight: 600;
}

.sidebar-new-chat:hover {
  background: #2b2f38f5;
}

.btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  cursor: pointer;
  padding: 5px 12px;
  transition: background .1s, border-color .1s;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
}

.btn:hover {
  background: var(--bg3);
  border-color: var(--border);
}

.btn:active {
  background: var(--bg4);
}

.btn-subtle {
  background: #1214189e;
  border-color: #4e545fad;
}

.btn-subtle:hover {
  background: #2b2f38e0;
}

.btn-danger {
  color: var(--red);
  background: var(--red-bg);
  border-color: #d99ca573;
}

.btn-danger:hover {
  background: #d99ca53d;
  border-color: #d99ca5bf;
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-accent:active {
  background: var(--accent-press);
}

.main {
  display: flex;
  overflow: hidden;
  background: none;
  flex-direction: column;
}

.main-header {
  border-bottom: 1px solid var(--border);
  display: flex;
  backdrop-filter: blur(9px);
  background: #0b0c0f9e;
  flex-shrink: 0;
  justify-content: space-between;
  align-items:  center;
  gap: 16px;
  height: 54px;
  padding: 0 24px;
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.header-plus-wrap {
  position: relative;
}

.icon-btn {
  border: 1px solid var(--border);
  color: var(--text-sub);
  display: inline-flex;
  cursor: pointer;
  background: #14161bd1;
  border-radius: 999px;
  justify-content: center;
  align-items:  center;
  width: 30px;
  height: 30px;
  transition: background .14s, border-color .14s, color .14s;
  font-size: 18px;
  line-height: 1;
}

.icon-btn:hover {
  color: var(--text);
  background: #2b2f38e6;
  border-color: #d9dde573;
}

.plus-btn {
  font-size: 20px;
  font-weight: 500;
}

.plus-menu {
  position: absolute;
  z-index: 40;
  background: #0d0e12f5;
  border: 1px solid #494e58d1;
  border-radius: 12px;
  min-width: 220px;
  padding: 8px;
  top: 36px;
  left: 0;
  box-shadow: 0 16px 40px #0000006b;
}

.plus-menu-item {
  text-align: left;
  font-family: var(--font);
  color: var(--text);
  cursor: pointer;
  background: none;
  border: 1px solid #0000;
  border-radius: 8px;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
}

.plus-menu-item:hover {
  background: #2b2f38b8;
  border-color: #d9dde533;
}

.header-actions {
  display: flex;
  align-items:  center;
  gap: 8px;
}

.main-header .client-name {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.header-hint {
  color: var(--text-dim);
  white-space: nowrap;
  font-size: 12px;
}

.conn-dot {
  background: var(--text-dim);
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

.conn-dot.connected {
  background: var(--green);
}

.conn-dot.error {
  background: var(--red);
}

.chat-area {
  overflow-y: auto;
  display: flex;
  scroll-behavior: smooth;
  flex: 1;
  justify-content: center;
  padding: 28px 16px 18px;
}

.conversation {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min(100%, 860px);
  margin: 0 auto;
}

.chat-empty {
  display: flex;
  color: var(--text-dim);
  text-align: center;
  flex-direction: column;
  justify-content: center;
  align-items:  center;
  gap: 10px;
  min-height: min(48vh, 360px);
}

.chat-empty .big {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 600;
  line-height: 1.05;
}

.chat-empty .hint {
  font-family: var(--font-body);
  color: var(--text-sub);
  font-size: clamp(15px, 2.2vw, 19px);
}

.message-row {
  display: flex;
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.assistant {
  justify-content: flex-start;
}

.message-body {
  animation: msg-rise .24s ease both;
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  border-radius: 14px;
  max-width: min(100%, 780px);
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.6;
}

.assistant-body {
  box-shadow: none;
  background: none;
  border-color: #0000;
  padding-left: 0;
  padding-right: 0;
}

.user-body {
  box-shadow: var(--shadow-2);
  background: #21252df5;
  border-color: #676e7a57;
}

.message-body h1, .message-body h2, .message-body h3 {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  margin: 10px 0 4px;
  font-weight: 600;
}

.message-body h1 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  font-size: 17px;
}

.message-body h2 {
  font-size: 15px;
}

.message-body h3 {
  color: var(--text-sub);
  font-size: 14px;
}

.message-body code {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  color: #ce9178;
  padding: 1px 5px;
  font-size: 12.5px;
}

.message-body pre {
  border-radius: var(--radius-lg);
  overflow-x: auto;
  background: #0c121af5;
  border: 1px solid #4d5e7299;
  margin: 8px 0;
  padding: 14px 16px;
}

.message-body pre code {
  color: #d4d4d4;
  background: none;
  border: none;
  padding: 0;
  font-size: 12.5px;
}

.message-body ul, .message-body ol {
  margin: 6px 0;
  padding-left: 20px;
}

.message-body li {
  margin: 3px 0;
}

.message-body p {
  margin: 5px 0;
}

.message-body strong {
  font-weight: 600;
}

.message-body em {
  color: var(--text-sub);
  font-style: italic;
}

.message-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

.status-bar {
  display: flex;
  color: var(--text-dim);
  align-items:  center;
  gap: 8px;
  width: min(100%, 860px);
  min-height: 26px;
  margin: 0 auto;
  padding: 4px 16px 8px;
  font-size: 12px;
}

.spinner {
  display: inline-block;
  margin-right: 6px;
}

.status-chip {
  display: inline-flex;
  border: 1px solid var(--border);
  color: var(--text-sub);
  background: #0f1014c7;
  border-radius: 999px;
  align-items:  center;
  padding: 3px 11px;
  font-size: 11px;
}

.cost-line {
  color: var(--text-dim);
  margin-left: auto;
  font-size: 11px;
}

.input-area {
  border-top: 1px solid var(--border);
  backdrop-filter: blur(7px);
  background: linear-gradient(#090a0d47 0%, #090a0de6 32%);
  flex-shrink: 0;
  padding: 0 16px 18px;
}

.composer-shell {
  overflow: hidden;
  background: #0d0e12eb;
  border: 1px solid #4d535eb3;
  border-radius: 18px;
  width: min(100%, 860px);
  margin: 0 auto;
  box-shadow: 0 10px 36px #0000003d;
}

.attachments-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 10px 0;
}

.attachment-chip {
  display: inline-flex;
  background: #1d1f25f2;
  border: 1px solid #4a505abf;
  border-radius: 999px;
  align-items:  center;
  gap: 6px;
  max-width: min(100%, 320px);
  padding: 3px 8px 3px 10px;
}

.attachment-name {
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 190px;
  font-size: 12px;
}

.attachment-size {
  color: var(--text-dim);
  font-size: 11px;
}

.attachment-remove {
  color: var(--text-sub);
  cursor: pointer;
  background: #7c8ea133;
  border: none;
  border-radius: 999px;
  width: 18px;
  height: 18px;
  line-height: 1;
}

.attachment-remove:hover {
  color: #ffe2e7;
  background: #d99ca54d;
}

.input-row {
  display: flex;
  align-items:  flex-end;
  gap: 10px;
  padding: 10px;
}

.slash-panel {
  background: #0b0c0f9e;
  border-top: 1px solid #4a505a9e;
  padding: 8px 10px 4px;
}

.slash-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slash-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background: #14161bd6;
  border: 1px solid #494e58c7;
  border-radius: 10px;
  align-items:  center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  transition: border-color .12s, background .12s;
}

.slash-item:hover {
  background: #2b2f38d1;
  border-color: #d9dde575;
}

.slash-item-fill {
  color: inherit;
  text-align: left;
  display: inline-flex;
  background: none;
  border: 0;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 0;
}

.slash-item-run {
  color: var(--text);
  cursor: pointer;
  background: #1f2228db;
  border: 1px solid #d9dde54d;
  border-radius: 7px;
  justify-self: end;
  width: 100%;
  padding: 4px 8px;
  font-size: 11px;
}

.slash-item-run:hover {
  background: #2b2f38f0;
  border-color: #d9dde585;
}

.slash-code {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 12px;
}

.slash-label {
  color: var(--text-sub);
  font-size: 12px;
}

.slash-tool {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
}

.slash-empty {
  color: var(--text-dim);
  padding: 0 2px 4px;
  font-size: 12px;
}

.slash-hint {
  color: var(--text-dim);
  padding: 6px 2px 2px;
  font-size: 11px;
}

.input-notice {
  color: #f2d8dc;
  padding: 0 12px 8px;
  font-size: 12px;
}

.composer-plus {
  border-radius: 12px;
  width: 38px;
  min-width: 38px;
  height: 38px;
  font-size: 20px;
}

.input-box {
  color: var(--text);
  font-family: var(--font);
  resize: none;
  outline: none;
  background: #12141899;
  border: 1px solid #0000;
  border-radius: 12px;
  flex: 1;
  min-height: 44px;
  max-height: 160px;
  padding: 10px 12px;
  transition: border-color .16s, box-shadow .16s, background .16s;
  font-size: 15px;
  line-height: 1.5;
}

.input-box:focus {
  border-color: var(--border-focus);
  box-shadow: inset 0 0 0 1px var(--border-focus);
  background: #121418e0;
}

.input-box:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.input-box::placeholder {
  color: var(--text-dim);
}

.send-btn {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #0b0c10;
  font-family: var(--font);
  cursor: pointer;
  border-radius: 999px;
  flex-shrink: 0;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  transition: background .16s, border-color .16s, transform .16s;
  font-size: 14px;
  font-weight: 700;
}

.send-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.send-btn:active:not(:disabled) {
  background: var(--accent-press);
  transform: translateY(1px);
}

.send-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.composer-footer {
  display: flex;
  color: var(--text-dim);
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px 8px;
  font-size: 11px;
}

.version-label {
  font-family: var(--font-mono);
  color: var(--text-dim);
  opacity: .5;
  letter-spacing: .02em;
  font-size: 10px;
}

.integrations-grid {
  display: grid;
  overflow-y: auto;
  gap: 10px;
  max-height: 60vh;
  padding: 16px;
}

.integration-card {
  display: flex;
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 10px;
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
  padding: 14px 16px;
}

.integration-card.connected {
  border-color: #34d39940;
}

.integration-info {
  flex: 1;
  min-width: 0;
}

.integration-name {
  color: var(--text);
  display: flex;
  align-items:  center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.integration-dot {
  background: #34d399;
  border-radius: 50%;
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  box-shadow: 0 0 6px #34d39980;
}

.integration-desc {
  color: var(--text-dim);
  margin-top: 2px;
  font-size: 11px;
}

.btn-accent {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  cursor: pointer;
  border-radius: 7px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
}

.btn-accent:hover {
  background: var(--accent-hover);
}

@keyframes msg-rise {
  from {
    transform: translateY(10px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.no-client {
  display: flex;
  color: var(--text-dim);
  flex: 1;
  justify-content: center;
  align-items:  center;
  font-size: 14px;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: none;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #c1bfbd;
}

.login-screen {
  display: flex;
  background: var(--bg);
  justify-content: center;
  align-items:  center;
  height: 100vh;
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-8);
  width: 380px;
  padding: 36px 32px;
}

.login-logo {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-tight);
  color: var(--accent);
  margin-bottom: 4px;
  font-size: 22px;
  font-weight: 700;
}

.login-sub {
  color: var(--text-sub);
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.4;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  outline: none;
  width: 100%;
  padding: 9px 12px;
  transition: border-color .1s, box-shadow .1s;
  font-size: 14px;
}

.login-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px var(--border-focus);
}

.login-input:disabled {
  opacity: .4;
}

.login-input::placeholder {
  color: var(--text-dim);
}

.login-btn {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font);
  cursor: pointer;
  width: 100%;
  padding: 9px 16px;
  transition: background .1s, border-color .1s;
  font-size: 14px;
  font-weight: 600;
}

.login-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.login-btn:active:not(:disabled) {
  background: var(--accent-press);
}

.login-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.login-divider {
  display: flex;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .1em;
  align-items:  center;
  gap: 12px;
  margin: 16px 0 12px;
  font-size: 11px;
}

.login-divider:before, .login-divider:after {
  content: "";
  background: var(--border);
  flex: 1;
  height: 1px;
}

.google-btn {
  display: flex;
  background: var(--bg2);
  border-color: var(--border);
  color: var(--text);
  justify-content: center;
  align-items:  center;
  gap: 10px;
}

.google-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--text-dim);
}

.google-btn svg {
  flex-shrink: 0;
}

.login-error {
  color: var(--red);
  margin-top: 8px;
  font-size: 12px;
}

.wizard-screen {
  display: flex;
  background: var(--bg);
  justify-content: center;
  align-items:  center;
  height: 100vh;
}

.wizard-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-8);
  width: 540px;
  padding: 36px 32px;
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  margin-bottom: 28px;
}

.wizard-brand {
  font-family: var(--font-display);
  color: var(--accent);
  letter-spacing: var(--tracking-tight);
  font-size: 16px;
  font-weight: 700;
}

.wizard-brand span {
  color: var(--text-sub);
  font-weight: 400;
}

.wizard-progress {
  display: flex;
  align-items:  center;
  gap: 5px;
}

.wizard-dot {
  background: var(--border);
  border-radius: 50%;
  width: 8px;
  height: 8px;
  transition: background .2s;
}

.wizard-dot.active {
  background: var(--accent);
}

.wizard-title {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  margin-bottom: 18px;
  font-size: 16px;
  font-weight: 600;
}

.wizard-body {
  margin-bottom: 24px;
}

.wizard-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wizard-label {
  color: var(--text-sub);
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
}

.wizard-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  outline: none;
  width: 100%;
  padding: 8px 12px;
  transition: border-color .1s, box-shadow .1s;
  font-size: 14px;
}

.wizard-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px var(--border-focus);
}

.wizard-textarea {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  resize: vertical;
  outline: none;
  width: 100%;
  padding: 8px 12px;
  transition: border-color .1s, box-shadow .1s;
  font-size: 14px;
  line-height: 1.55;
}

.wizard-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px var(--border-focus);
}

.wizard-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wizard-pill {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-family: var(--font);
  cursor: pointer;
  border-radius: 16px;
  padding: 5px 14px;
  transition: border-color .1s, background .1s, color .1s;
  font-size: 13px;
}

.wizard-pill:hover, .wizard-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.wizard-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wizard-checkbox {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-sub);
  align-items:  center;
  gap: 7px;
  padding: 6px 12px;
  transition: border-color .1s, background .1s, color .1s;
  font-size: 13px;
}

.wizard-checkbox input {
  display: none;
}

.wizard-checkbox:hover, .wizard-checkbox.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.wizard-actions {
  display: flex;
  border-top: 1px solid var(--border);
  align-items:  center;
  gap: 10px;
  padding-top: 8px;
}

.admin-layout {
  display: flex;
  background: var(--bg);
  flex-direction: column;
  height: 100vh;
}

.admin-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  box-shadow: var(--shadow-2);
  flex-shrink: 0;
  justify-content: space-between;
  align-items:  center;
  height: 48px;
  padding: 0 24px;
}

.admin-body {
  overflow-y: auto;
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 32px;
}

.admin-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  flex: 1;
  padding: 20px 22px;
}

.stat-value {
  font-family: var(--font-display);
  color: var(--accent);
  letter-spacing: var(--tracking-tight);
  margin-bottom: 6px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 400;
}

.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  margin-bottom: 12px;
}

.admin-section-header h2 {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.admin-table {
  border-collapse: collapse;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-2);
  width: 100%;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  border-bottom: 1px solid var(--border);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-sub);
  background: var(--bg3);
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
}

.admin-table td {
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover td {
  background: var(--bg3);
}

.badge {
  display: inline-block;
  letter-spacing: .02em;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.badge-active {
  background: var(--green-bg);
  color: var(--green);
}

.badge-inactive {
  background: var(--bg4);
  color: var(--text-dim);
}

.modal-backdrop {
  position: fixed;
  display: flex;
  z-index: 100;
  background: #0006;
  justify-content: center;
  align-items:  center;
  inset: 0;
}

.modal-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-8);
  width: 460px;
  padding: 24px 24px 20px;
}

.modal-header {
  font-family: var(--font-display);
  display: flex;
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  justify-content: space-between;
  align-items:  center;
  margin-bottom: 18px;
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  color: var(--text-dim);
  cursor: pointer;
  border-radius: var(--radius);
  background: none;
  border: none;
  padding: 0 4px;
  font-size: 18px;
  line-height: 1;
}

.modal-close:hover {
  background: var(--bg3);
  color: var(--text);
}

.chat-modal {
  width: min(640px, 94vw);
}

.chat-modal-body {
  display: flex;
  color: var(--text-sub);
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

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

.command-card {
  display: flex;
  background: #14161bc7;
  border: 1px solid #444953b8;
  border-radius: 12px;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
}

.command-head {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 8px;
}

.command-actions-row {
  display: inline-flex;
  align-items:  center;
  gap: 8px;
}

.command-head code {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 11.5px;
}

.command-use {
  color: var(--text);
  cursor: pointer;
  background: #1f2228db;
  border: 1px solid #d9dde552;
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 11px;
}

.command-use:hover {
  background: #2b2f38f0;
  border-color: #d9dde585;
}

.command-run {
  color: #d7f4d7;
  cursor: pointer;
  background: #162318d6;
  border: 1px solid #beddb46b;
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 11px;
}

.command-run:hover {
  background: #1f3422f0;
  border-color: #beddb4a3;
}

.command-body {
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.45;
}

.command-tool {
  color: var(--text-dim);
  font-size: 11px;
}

.command-tool code, .command-example code {
  font-family: var(--font-mono);
}

.command-example {
  color: #d4d7dd;
  overflow-x: auto;
  background: #0a0b0edb;
  border: 1px solid #494e58a6;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 11px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  background: #14161bcc;
  border: 1px solid #444953ad;
  border-radius: 10px;
  align-items:  center;
  gap: 8px;
  padding: 8px 10px;
}

.activity-kind {
  display: inline-flex;
  text-transform: lowercase;
  color: #d9dde5;
  border: 1px solid #d9dde559;
  border-radius: 999px;
  justify-content: center;
  align-items:  center;
  padding: 2px 8px;
  font-size: 11px;
}

.activity-kind.agent {
  color: #d8cb9e;
  border-color: #d8cb9e61;
}

.activity-label {
  color: var(--text);
  font-size: 13px;
}

.activity-state {
  color: var(--text-dim);
  font-size: 12px;
}

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

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 230px;
  }

  .sidebar-section {
    min-height: 0;
  }

  .sessions-list {
    max-height: 120px;
  }

  .main-header {
    height: 52px;
    padding: 0 14px;
  }

  .header-hint {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
  }

  .chat-area {
    padding: 16px 14px;
  }

  .conversation {
    gap: 14px;
  }

  .status-bar {
    width: 100%;
    padding: 4px 14px 8px;
  }

  .input-area {
    padding: 0 12px 14px;
  }

  .composer-shell {
    border-radius: 14px;
  }

  .plus-menu {
    min-width: 190px;
    left: -4px;
  }

  .attachments-row {
    gap: 6px;
  }

  .attachment-chip {
    max-width: 100%;
  }

  .slash-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .slash-tool {
    font-size: 10px;
  }

  .composer-footer {
    padding: 0 10px 7px;
    font-size: 10px;
  }

  .composer-footer span:last-child {
    display: none;
  }

  .login-card, .wizard-card, .modal-card {
    width: min(94vw, 560px);
    padding: 24px 18px;
  }

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

  .admin-body {
    padding: 20px 14px;
  }

  .admin-stats {
    flex-direction: column;
  }

  .admin-table {
    display: block;
    overflow: auto;
    white-space: nowrap;
  }
}
