* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--oz-font-body);
  background: var(--oz-black);
  color: var(--oz-white);
}

a {
  color: var(--oz-gray-light);
  text-decoration: none;
}

a:hover {
  color: var(--oz-white);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    linear-gradient(rgba(5, 5, 5, 0.72), rgba(5, 5, 5, 0.88)),
    url("../branding/backgrounds/home-bg.svg") center / cover no-repeat;
}

.auth-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(26, 26, 26, 0.96), rgba(13, 13, 13, 0.96));
  border: 1px solid var(--oz-line);
  border-radius: var(--oz-radius-xl);
  box-shadow: var(--oz-elevation-card);
  padding: 32px 28px 28px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.brand-row img {
  width: 48px;
  height: 48px;
}

.brand-row h1 {
  margin: 0;
  font-family: var(--oz-font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-row h1 span {
  color: var(--oz-red);
}

.lede {
  margin: 0 0 20px;
  color: var(--oz-gray-light);
  font-size: 0.95rem;
  line-height: 1.5;
}

label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--oz-gray-light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field {
  margin-bottom: 14px;
}

input,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--oz-radius-md);
  border: 1px solid var(--oz-line);
  background: var(--oz-tile);
  color: var(--oz-white);
  font: inherit;
}

input:focus,
select:focus {
  outline: 2px solid var(--oz-neon-red-low);
  border-color: var(--oz-red);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--oz-radius-md);
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  margin-top: 8px;
  background: var(--oz-red);
  color: var(--oz-white);
  box-shadow: 0 0 24px var(--oz-neon-red-low);
}

.btn-primary:hover {
  background: var(--oz-red-dark);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--oz-gray-light);
  border: 1px solid var(--oz-line);
}

.btn-danger {
  background: transparent;
  color: var(--oz-red);
  border: 1px solid rgba(255, 30, 30, 0.35);
}

.error {
  display: none;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--oz-radius-sm);
  background: rgba(181, 15, 20, 0.2);
  border: 1px solid rgba(255, 30, 30, 0.35);
  color: var(--oz-gray-light);
  font-size: 0.9rem;
}

.error.visible {
  display: block;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  background: var(--oz-black);
}

.sidebar {
  background: var(--oz-rich-black);
  border-right: 1px solid var(--oz-line);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar .brand-row {
  margin-bottom: 16px;
}

.sidebar .brand-row img {
  width: 36px;
  height: 36px;
}

.sidebar .brand-row h1 {
  font-size: 1rem;
}

.nav a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--oz-radius-sm);
  color: var(--oz-gray-light);
}

.nav a.active,
.nav a:hover {
  background: var(--oz-charcoal);
  color: var(--oz-white);
}

.nav .section {
  margin: 16px 0 6px;
  padding: 0 12px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oz-gray);
}

.main {
  padding: 28px 32px 48px;
}

.main h2 {
  margin: 0 0 8px;
  font-family: var(--oz-font-headline);
  font-size: 1.6rem;
}

.main .lede {
  max-width: 42rem;
}

.panel {
  margin-top: 20px;
  background: var(--oz-rich-black);
  border: 1px solid var(--oz-line);
  border-radius: var(--oz-radius-lg);
  box-shadow: var(--oz-elevation-panel);
  padding: 18px;
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--oz-gray);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--oz-line);
}

.table th {
  color: var(--oz-gray);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--oz-radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--oz-charcoal);
  color: var(--oz-gray-light);
}

.badge.admin {
  background: rgba(255, 30, 30, 0.18);
  color: #ff8a8a;
}

.badge.active {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.badge.suspended {
  background: rgba(108, 108, 108, 0.25);
  color: var(--oz-gray-light);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-grid {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.muted {
  color: var(--oz-gray);
  font-size: 0.9rem;
}

.chat-layout .sidebar {
  display: flex;
  flex-direction: column;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 40vh;
  overflow: auto;
}

.session-item {
  text-align: left;
  border: none;
  background: transparent;
  color: var(--oz-gray-light);
  padding: 8px 10px;
  border-radius: var(--oz-radius-sm);
  cursor: pointer;
  font: inherit;
}

.session-item:hover,
.session-item.active {
  background: var(--oz-charcoal);
  color: var(--oz-white);
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 20px;
}

.chat-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--oz-gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.toolbar-field.grow {
  flex: 1;
  min-width: 180px;
}

.toolbar-field select,
.toolbar-field input {
  text-transform: none;
  letter-spacing: normal;
}

.chat-log {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0 16px;
  min-height: 280px;
}

.bubble {
  max-width: min(720px, 100%);
  padding: 12px 14px;
  border-radius: var(--oz-radius-lg);
  line-height: 1.5;
  white-space: pre-wrap;
}

.bubble.user {
  align-self: flex-end;
  background: var(--oz-charcoal);
  border: 1px solid var(--oz-line);
}

.bubble.assistant {
  align-self: flex-start;
  background: var(--oz-rich-black);
  border: 1px solid rgba(255, 30, 30, 0.22);
  white-space: normal;
}

.bubble.tool,
.bubble.system {
  align-self: stretch;
  background: var(--oz-tile);
  border: 1px dashed var(--oz-line);
  color: var(--oz-gray-light);
  font-size: 0.88rem;
  white-space: pre-wrap;
}

.bubble.assistant h1,
.bubble.assistant h2,
.bubble.assistant h3 {
  font-family: var(--oz-font-headline);
  margin: 0.4em 0;
}

.bubble.assistant p {
  margin: 0.4em 0;
}

.bubble.assistant .md-code,
.bubble.assistant code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.86em;
}

.bubble.assistant .md-code {
  display: block;
  padding: 10px 12px;
  overflow: auto;
  background: #0a0a0a;
  border-radius: var(--oz-radius-sm);
  border: 1px solid var(--oz-line);
}

.composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 8px;
}

.composer textarea {
  flex: 1;
  resize: vertical;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: var(--oz-radius-md);
  border: 1px solid var(--oz-line);
  background: var(--oz-tile);
  color: var(--oz-white);
  font: inherit;
}

.composer-hint {
  margin: 8px 0 0;
}

.approval-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: var(--oz-radius-md);
  border: 1px solid rgba(255, 30, 30, 0.45);
  background: rgba(181, 15, 20, 0.18);
}

@media (max-width: 840px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--oz-line);
  }
}

/* Chat/inference interaction hardening */
[hidden] {
  display: none !important;
}

.btn.compact {
  width: auto;
  margin: 0;
  padding: 9px 12px;
  min-height: 38px;
}

.sidebar-section-label {
  padding: 0 10px 6px;
  color: var(--oz-gray);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-radius: var(--oz-radius-sm);
}

.session-row.active,
.session-row:hover {
  background: var(--oz-charcoal);
}

.session-row .session-item {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-delete {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--oz-radius-sm);
  background: transparent;
  color: var(--oz-gray);
  cursor: pointer;
  font-size: 18px;
}

.session-delete:hover {
  color: var(--oz-red);
  background: rgba(255, 30, 30, 0.1);
}

.chat-main {
  position: relative;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 0 28px 18px;
}

.chat-header {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 -28px;
  padding: 14px 28px 10px;
  border-bottom: 1px solid var(--oz-line);
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.99), rgba(5, 5, 5, 0.95));
  backdrop-filter: blur(14px);
}

.chat-header-row {
  display: flex;
  align-items: end;
  gap: 10px;
}

.chat-header-row.secondary {
  margin-top: 8px;
  align-items: center;
}

.model-field {
  width: min(260px, 28vw);
  flex: 0 0 auto;
}

.workspace-field {
  min-width: 260px;
}

.workspace-control {
  display: flex;
  gap: 8px;
  align-items: center;
}

.workspace-control input {
  min-width: 0;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.workspace-save-state {
  margin-left: auto;
  min-width: 64px;
  text-align: right;
}

.mode-switch,
.preset-row {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--oz-line);
  border-radius: var(--oz-radius-md);
  background: var(--oz-tile);
}

.mode-btn,
.preset-btn {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--oz-gray-light);
  padding: 6px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
}

.mode-btn:hover,
.preset-btn:hover {
  color: var(--oz-white);
  background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active,
.preset-btn.active {
  color: var(--oz-white);
  background: rgba(255, 30, 30, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 30, 30, 0.24);
}

.run-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--oz-gray-light);
  font-size: 0.78rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5dca78;
  box-shadow: 0 0 8px rgba(93, 202, 120, 0.45);
}

.run-status[data-state="busy"] .status-dot,
.run-status[data-state="tool"] .status-dot {
  background: #f6c760;
  box-shadow: 0 0 8px rgba(246, 199, 96, 0.45);
  animation: statusPulse 1.2s ease-in-out infinite;
}

.run-status[data-state="approval"] .status-dot,
.run-status[data-state="warning"] .status-dot {
  background: var(--oz-red);
  box-shadow: 0 0 8px var(--oz-neon-red-high);
}

@keyframes statusPulse {
  50% { opacity: 0.4; }
}

.inference-panel {
  position: absolute;
  z-index: 40;
  top: 118px;
  right: 28px;
  width: min(720px, calc(100% - 56px));
  padding: 16px;
  border: 1px solid var(--oz-line);
  border-radius: var(--oz-radius-lg);
  background: rgba(18, 18, 18, 0.98);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}


.settings-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
  gap: 14px;
}

.settings-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--oz-line);
  border-radius: var(--oz-radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.settings-section-heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}

.settings-section-heading strong {
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.control-field > span {
  color: var(--oz-gray-light);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.control-field input {
  padding: 9px 10px;
}

.chat-log {
  min-height: 0;
  padding: 18px 0 24px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.jump-latest {
  position: absolute;
  z-index: 24;
  right: 36px;
  bottom: 116px;
  border: 1px solid var(--oz-line);
  border-radius: var(--oz-radius-pill);
  background: rgba(26, 26, 26, 0.96);
  color: var(--oz-white);
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: var(--oz-elevation-panel);
}

.approval-bar {
  position: relative;
  z-index: 25;
  flex: 0 0 auto;
  margin: 0 0 8px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
}

.approval-copy {
  min-width: 0;
}

#approval-detail {
  margin-top: 5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 130px;
  overflow: auto;
}

.composer {
  flex: 0 0 auto;
  margin-top: 0;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0), var(--oz-black) 24%);
}

.composer #send {
  width: auto;
  margin: 0;
  min-width: 82px;
  min-height: 56px;
}

.composer-hint {
  flex: 0 0 auto;
}

.toast-stack {
  position: fixed;
  z-index: 1000;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--oz-line);
  border-radius: var(--oz-radius-md);
  background: rgba(26, 26, 26, 0.98);
  color: var(--oz-white);
  box-shadow: var(--oz-elevation-card);
  animation: toastIn 0.18s ease-out;
}

.toast.success { border-color: rgba(93, 202, 120, 0.35); }
.toast.warning { border-color: rgba(246, 199, 96, 0.4); }
.toast.error { border-color: rgba(255, 30, 30, 0.45); }
.toast.leaving { opacity: 0; transform: translateY(-6px); transition: 0.18s ease; }
.toast button {
  border: 0;
  background: transparent;
  color: var(--oz-gray-light);
  cursor: pointer;
  font-size: 18px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .settings-stack { grid-template-columns: 1fr; }
  .control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-header-row { flex-wrap: wrap; }
  .model-field { width: 220px; }
  .workspace-field { order: 3; flex-basis: 100%; }
}

@media (max-width: 840px) {
  .chat-main { height: auto; min-height: 100vh; padding: 0 16px 16px; overflow: visible; }
  .chat-header { margin: 0 -16px; padding: 12px 16px 10px; }
  .chat-log { min-height: 55vh; max-height: 68vh; }
  .inference-panel { position: fixed; top: 16px; right: 16px; left: 16px; width: auto; max-height: calc(100vh - 32px); overflow: auto; }
}

@media (max-width: 560px) {
  .control-grid { grid-template-columns: 1fr; }
  .model-field { width: 100%; }
  .header-actions { width: 100%; }
  .header-actions .btn { flex: 1; }
  .chat-header-row.secondary { align-items: flex-start; }
  .workspace-save-state { display: none; }
  .approval-bar { align-items: stretch; flex-direction: column; }
  .approval-bar .row-actions { width: 100%; }
  .approval-bar .row-actions .btn { flex: 1; }
}

.run-status[data-state="error"] .status-dot {
  background: var(--oz-red);
  box-shadow: 0 0 8px var(--oz-neon-red-high);
}

/* Run timeline: compact persistent activity, separate from toasts. */
.run-timeline {
  margin: 6px 0 2px;
  padding: 8px 10px;
  border: 1px solid var(--oz-line);
  border-radius: var(--oz-radius-md);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.8rem;
}

.tl-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tl-head .btn { margin-left: auto; }

.tl-dot { width: 7px; height: 7px; border-radius: 50%; background: #5dca78; flex: none; }
.tl-dot[data-state="busy"] { background: #f6c760; animation: statusPulse 1.2s ease-in-out infinite; }
.tl-dot[data-state="approval"] { background: var(--oz-red); }
.tl-dot[data-state="ok"] { background: #5dca78; }
.tl-dot[data-state="error"] { background: var(--oz-red); }
.tl-dot[data-state="idle"] { background: var(--oz-gray); animation: none; }

.tl-label { color: var(--oz-gray-light); font-weight: 600; }
.tl-elapsed { font-variant-numeric: tabular-nums; }
.tl-details { margin: 6px 0 2px; font-size: 0.75rem; word-break: break-all; }
.tl-rows { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }

.tl-row { border: 0; padding: 0; }
.tl-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  cursor: pointer;
  padding: 2px 0;
  list-style: none;
}
.tl-summary::-webkit-details-marker { display: none; }
.tl-summary::before { content: "▸"; color: var(--oz-gray); font-size: 0.7rem; }
.tl-row[open] .tl-summary::before { content: "▾"; }
.tl-icon { width: 14px; flex: none; text-align: center; }
.tl-row[data-state="ok"] .tl-icon { color: #5dca78; }
.tl-row[data-state="error"] .tl-icon,
.tl-row[data-state="denied"] .tl-icon,
.tl-row[data-state="waiting"] .tl-icon { color: var(--oz-red); }
.tl-row[data-state="running"] .tl-icon { color: #f6c760; }
.tl-text { color: var(--oz-gray-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-row[data-state="error"] .tl-text,
.tl-row[data-state="denied"] .tl-text { color: var(--oz-white); }
.tl-dur { margin-left: auto; flex: none; font-variant-numeric: tabular-nums; }
.tl-detail { padding: 4px 0 6px 22px; }
.tl-pre {
  margin: 4px 0;
  padding: 6px 8px;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--oz-line);
  border-radius: var(--oz-radius-sm);
  font-size: 0.75rem;
  color: var(--oz-gray-light);
}
.tl-foot { margin-top: 8px; }

/* Premium theme (reference): deep graphite surfaces, red accent. */
.app-shell {
  background: #08080a;
}

.chat-layout .sidebar,
.sidebar {
  width: 264px;
  background: #0c0c0f;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  padding: 20px 14px 16px;
}

.app-shell.chat-layout { grid-template-columns: 264px 1fr; }

.sidebar .brand-row img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.sidebar .brand-row h1 { font-size: 1.15rem; }

.btn-primary.new-chat {
  width: 100%;
  margin: 4px 0 14px;
  padding: 12px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f43f4e, #dc2626);
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.35);
  font-size: 0.92rem;
}

.btn-primary.new-chat span { font-size: 1.1rem; line-height: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--oz-gray-light);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
}

.nav-item svg { width: 15px; height: 15px; fill: currentColor; flex: none; }

.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--oz-white); }

.admin-nav { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--oz-charcoal);
  color: var(--oz-white);
  font-weight: 700;
  font-size: 0.85rem;
}

.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-meta strong { font-size: 0.85rem; }
.user-meta .muted { font-size: 0.72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-ghost.signout { width: 100%; justify-content: flex-start; }

.chat-main { padding: 0 28px 18px; }

.chat-header {
  margin: 0 -28px 6px;
  background: linear-gradient(180deg, rgba(8, 8, 10, 0.99), rgba(8, 8, 10, 0.94));
}

.toolbar-field select,
.toolbar-field input {
  background: #101014;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  padding: 10px 12px;
}

.btn-danger.compact {
  background: linear-gradient(135deg, #f43f4e, #dc2626);
  border: 0;
  color: #fff;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.btn-danger.compact:disabled {
  background: rgba(255, 255, 255, 0.06);
  color: var(--oz-gray);
  box-shadow: none;
}

.status-copy { display: flex; flex-direction: column; line-height: 1.3; }
.conn-line { font-size: 0.68rem; }

/* Settings view: Generation + Tools cards. */
.settings-view {
  margin: 4px 0 12px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: #0e0e12;
  box-shadow: var(--oz-elevation-card);
  overflow: auto;
}

.settings-view .settings-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 18px;
  margin-top: 16px;
}

.settings-view .settings-section {
  background: #121218;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 18px;
}

.settings-view .settings-section-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.settings-view .settings-section-heading strong { font-size: 0.95rem; }

/* Welcome screen. */
.welcome {
  max-width: 760px;
  margin: 5vh auto 0;
  text-align: center;
  padding: 12px 8px 4px;
}

.welcome img { width: 72px; height: 72px; border-radius: 16px; }

.welcome h2 { font-family: var(--oz-font-headline); font-size: 1.5rem; margin: 14px 0 6px; }
.welcome h2 span { color: var(--oz-red); }
.welcome p { margin: 0 0 22px; }

.welcome-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  text-align: left;
}

.welcome-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #111116;
  color: var(--oz-white);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.welcome-card:hover { border-color: rgba(255, 30, 30, 0.45); transform: translateY(-2px); }
.welcome-card strong { font-size: 0.92rem; }
.welcome-card .muted { font-size: 0.8rem; line-height: 1.5; }

/* Composer. */
.composer {
  background: #101014;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 10px 10px 10px 18px;
}

.composer textarea {
  border: 0;
  background: transparent;
  padding: 10px 0;
  min-height: 48px;
}

.composer textarea:focus { outline: none; }
.composer:focus-within { border-color: rgba(255, 30, 30, 0.45); }

.composer .btn-primary {
  width: auto;
  margin: 0;
  border-radius: 10px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #f43f4e, #dc2626);
  align-self: flex-end;
}

.composer .btn-primary svg { width: 14px; height: 14px; fill: currentColor; }

/* Bubbles inherit the darker surfaces. */
.bubble.user { background: #17171c; }
.bubble.assistant { background: #101014; }

@media (max-width: 1100px) {
  .settings-view .settings-stack { grid-template-columns: 1fr; }
  .welcome-cards { grid-template-columns: 1fr; }
  .welcome { margin-top: 2vh; }
}

.nav-item.active { background: rgba(255, 255, 255, 0.06); color: var(--oz-white); }
.auth-card .brand-row img { border-radius: 10px; }
.auth-card .btn-primary { background: linear-gradient(135deg, #f43f4e, #dc2626); }

/* Premium content surfaces (admin, profile, auth): same card language as chat. */
.main h2 { font-size: 1.7rem; letter-spacing: 0.01em; }
.main .lede { color: var(--oz-gray-light); max-width: 46rem; }

.panel {
  background: #121218;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  box-shadow: var(--oz-elevation-card);
  padding: 20px 22px;
}

.panel h3 {
  color: var(--oz-white);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: none;
  margin-bottom: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, #f43f4e, #dc2626);
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.35);
  border-radius: 10px;
}

.btn-primary:hover { background: linear-gradient(135deg, #ef2b3a, #c22222); }

.form-grid { max-width: 480px; gap: 14px; }

.form-grid label { color: var(--oz-gray-light); }

.form-grid input,
.form-grid select {
  background: #0d0d10;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
}

.table th {
  color: var(--oz-gray-light);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.table td { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }

.table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }

.auth-card { background: linear-gradient(180deg, #141419, #0d0d10); }
