:root {
  --canvas: #f7f8fc;
  --canvas-deep: #eef0f8;
  --surface: #fff;
  --surface-muted: #f6f5fd;
  --ink: #12183d;
  --ink-muted: #697195;
  --line: rgb(31 39 82 / 12%);
  --line-strong: rgb(31 39 82 / 22%);
  --accent: #4317c6;
  --accent-strong: #27128f;
  --accent-soft: #eeeaff;
  --platinum: #73799b;
  --danger: #9f1d1d;
  --danger-soft: #fff0f0;
  --warning: #8b5f08;
  --warning-soft: #fff7df;
  --shadow-sm: 0 1px 2px rgb(18 24 61 / 5%), 0 8px 24px rgb(18 24 61 / 5%);
  --shadow-lg: 0 24px 70px rgb(18 24 61 / 16%);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --topbar-height: 68px;
  font-family: ui-sans-serif, Aptos, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--canvas);
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgb(67 23 198 / 34%);
  outline-offset: 2px;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent-strong);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.offline-banner {
  position: fixed;
  z-index: 1100;
  top: 0;
  right: 0;
  left: 0;
  padding: 9px 16px;
  color: #fff;
  background: #6d4816;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 650;
  box-shadow: var(--shadow-sm);
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #296f56, #123f30);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), 0 5px 16px rgb(18 71 53 / 18%);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  font-weight: 700;
}

.brand-mark-large {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  border-radius: 17px;
  font-size: 1.5rem;
}

.brand-word {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Auth and first-run setup */

.auth-view,
.loading-view {
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-view {
  display: grid;
  grid-template-rows: auto 1fr auto;
  place-items: center;
  gap: 28px;
  padding: 42px 24px 24px;
  background:
    radial-gradient(circle at 15% 12%, rgb(255 255 255 / 80%), transparent 30%),
    radial-gradient(circle at 88% 86%, rgb(193 207 197 / 42%), transparent 28%),
    var(--canvas);
}

.auth-brand,
.shell-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.shell-brand {
  text-decoration: none;
}

.auth-card {
  width: min(100%, 460px);
  padding: clamp(26px, 5vw, 42px);
  border: 1px solid rgb(203 199 189 / 75%);
  border-radius: var(--radius-lg);
  background: rgb(255 253 249 / 94%);
  box-shadow: var(--shadow-lg);
}

.auth-intro {
  margin-bottom: 28px;
}

.auth-intro h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 7vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.auth-copy {
  margin: 14px 0 0;
  color: var(--ink-muted);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.form-heading {
  margin-bottom: 8px;
}

.form-heading h2 {
  margin: 0 0 5px;
  font-size: 1.05rem;
}

.form-heading p,
.field-help {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.auth-form label {
  margin-top: 8px;
  font-size: 0.84rem;
  font-weight: 680;
}

.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-form input:hover {
  border-color: #aaa59a;
}

.auth-form input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgb(28 91 69 / 12%);
}

.form-error {
  margin: 7px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  color: #7d2c28;
  background: var(--danger-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}

.primary-button,
.new-thread-button,
.send-button {
  border: 0;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 720;
  transition: background 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.primary-button:hover,
.new-thread-button:hover,
.send-button:hover {
  background: var(--accent-strong);
}

.primary-button:active,
.new-thread-button:active,
.send-button:active {
  transform: translateY(1px);
}

.primary-button:disabled,
.new-thread-button:disabled,
.send-button:disabled,
.cancel-button:disabled,
.quiet-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.primary-button {
  min-height: 48px;
  margin-top: 14px;
  padding: 12px 18px;
  border-radius: 11px;
}

.full-width {
  width: 100%;
}

.auth-footnote {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
  text-align: center;
}

.loading-view {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink-muted);
  background: var(--canvas);
  font-size: 0.92rem;
}

/* Main application shell */

.app-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: var(--topbar-height) minmax(0, 1fr);
  overflow: hidden;
  background: var(--surface);
}

.topbar {
  z-index: 30;
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 253 249 / 96%);
}

.topbar-leading,
.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
}

.topbar .mobile-only {
  display: none;
}

.topbar-leading {
  gap: 8px;
}

.topbar-actions {
  gap: 12px;
}

.provider-badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-muted);
  background: var(--surface-muted);
  font-size: 0.76rem;
  font-weight: 680;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--platinum);
  box-shadow: 0 0 0 3px rgb(138 129 115 / 12%);
}

.provider-badge[data-tone="ready"] {
  color: #1c5b45;
  border-color: #c8ddd2;
  background: #edf6f1;
}

.provider-badge[data-tone="ready"] .status-dot {
  background: #2a8b68;
  box-shadow: 0 0 0 3px rgb(42 139 104 / 13%);
}

.provider-badge[data-tone="demo"] {
  color: #80551c;
  border-color: #ead6b3;
  background: var(--warning-soft);
}

.provider-badge[data-tone="demo"] .status-dot {
  background: #b67a26;
  box-shadow: 0 0 0 3px rgb(182 122 38 / 13%);
}

.provider-badge[data-tone="unavailable"] {
  color: #88332f;
  border-color: #e8c9c5;
  background: var(--danger-soft);
}

.provider-badge[data-tone="unavailable"] .status-dot {
  background: var(--danger);
}

.user-label {
  max-width: 220px;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiet-button,
.icon-button,
.cancel-button {
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 650;
  transition: background 150ms ease, border-color 150ms ease;
}

.quiet-button:hover,
.icon-button:hover,
.cancel-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

.icon-button {
  display: inline-grid;
  width: 42px;
  padding: 0;
  place-items: center;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.menu-icon {
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  position: absolute;
  left: 0;
  content: "";
}

.menu-icon::before {
  top: -6px;
}

.menu-icon::after {
  top: 6px;
}

.mobile-only {
  display: none;
}

.sidebar {
  z-index: 20;
  display: flex;
  min-height: 0;
  flex-direction: column;
  grid-column: 1;
  grid-row: 2;
  border-right: 1px solid var(--line);
  background: var(--surface-muted);
}

.sidebar-header {
  padding: 20px 16px 12px;
}

.sidebar-title {
  margin: 0 0 11px 4px;
  color: var(--ink-muted);
  font-size: 0.71rem;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.new-thread-button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 11px;
  box-shadow: 0 5px 14px rgb(28 91 69 / 13%);
  font-size: 0.88rem;
}

.thread-nav {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 4px 10px 16px;
  scrollbar-color: var(--line-strong) transparent;
}

.thread-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.thread-button {
  display: grid;
  width: 100%;
  min-height: 51px;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink-muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.thread-button:hover {
  color: var(--ink);
  background: #efebe4;
}

.thread-button[aria-current="page"] {
  color: var(--ink);
  border-color: #ddd7cc;
  background: var(--surface);
  box-shadow: 0 2px 9px rgb(23 34 29 / 5%);
}

.thread-glyph {
  position: relative;
  display: block;
  width: 14px;
  height: 12px;
  margin-left: 2px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  color: var(--platinum);
}

.thread-glyph::after {
  position: absolute;
  bottom: -3px;
  left: 3px;
  width: 4px;
  height: 4px;
  border-bottom: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  background: inherit;
  content: "";
  transform: skewY(-35deg);
}

.thread-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.thread-copy strong,
.thread-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-copy strong {
  font-size: 0.85rem;
  font-weight: 650;
}

.thread-copy small {
  color: var(--ink-muted);
  font-size: 0.69rem;
}

.thread-running {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.35s ease-in-out infinite;
}

.thread-empty {
  margin: 28px 12px;
  color: var(--ink-muted);
  font-size: 0.82rem;
  text-align: center;
}

.sidebar-footer {
  padding: 13px 14px 15px;
  border-top: 1px solid var(--line);
}

.workspace-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
}

.workspace-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent);
  background: var(--surface);
}

.workspace-card > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.workspace-card strong,
.workspace-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-card strong {
  font-size: 0.81rem;
}

.workspace-card small {
  color: var(--ink-muted);
  font-size: 0.69rem;
}

.provider-note {
  margin: 7px 8px 0;
  color: var(--ink-muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.chat-main {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-column: 2;
  grid-row: 2;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px clamp(22px, 5vw, 64px) 15px;
  border-bottom: 1px solid rgb(222 219 210 / 65%);
}

.chat-header h1 {
  max-width: 700px;
  margin: 0;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.32rem, 2.6vw, 1.72rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-state {
  flex: 0 0 auto;
  color: var(--ink-muted);
  font-size: 0.74rem;
}

.chat-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 28px clamp(22px, 6vw, 76px) 36px;
  scroll-behavior: smooth;
  scrollbar-color: var(--line-strong) transparent;
}

.empty-chat {
  display: grid;
  min-height: 100%;
  place-content: center;
  justify-items: center;
  padding: 36px 16px 84px;
  text-align: center;
}

.empty-orbit {
  position: relative;
  display: grid;
  width: 84px;
  height: 84px;
  margin-bottom: 22px;
  place-items: center;
  border: 1px solid #dcd8cf;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 40%, #efebe3 100%);
}

.empty-orbit::after {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
  transform: translate(38px, -19px);
}

.empty-chat h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.empty-chat > p:last-child {
  max-width: 430px;
  margin: 12px 0 0;
  color: var(--ink-muted);
  line-height: 1.55;
}

.message-list {
  display: grid;
  width: min(100%, 860px);
  gap: 26px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.message {
  display: grid;
  width: min(100%, 860px);
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  margin: 0 auto;
}

.message-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--accent);
  background: var(--surface-muted);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.message-body {
  min-width: 0;
}

.message-meta {
  display: flex;
  min-height: 23px;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 5px;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.message-meta strong {
  color: var(--ink);
  font-size: 0.79rem;
}

.message-content {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.66;
  white-space: pre-wrap;
}

.message-user {
  grid-template-columns: minmax(0, 1fr) 36px;
}

.message-user .message-avatar {
  grid-column: 2;
  grid-row: 1;
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.message-user .message-body {
  max-width: min(100%, 680px);
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  padding: 12px 15px;
  border-radius: 15px 4px 15px 15px;
  background: var(--accent-soft);
}

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

.message-system .message-avatar {
  color: var(--warning);
  background: var(--warning-soft);
}

.message-draft {
  margin-top: 26px;
}

.message-draft .message-avatar {
  animation: softGlow 1.8s ease-in-out infinite;
}

.message-draft .message-meta span {
  color: var(--accent);
  font-weight: 670;
}

.browser-artifacts {
  width: min(100%, 860px);
  margin: 34px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.browser-artifacts-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.browser-artifacts-header .eyebrow {
  margin-bottom: 4px;
}

.browser-artifacts-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  font-weight: 600;
}

.browser-artifact-count,
.browser-artifact-meta,
.browser-artifacts-status {
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.browser-artifacts-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-muted);
  line-height: 1.45;
}

.browser-artifact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px;
}

.browser-artifact-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.browser-artifact-preview {
  display: grid;
  aspect-ratio: 16 / 10;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.browser-artifact-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.browser-artifact-copy {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.browser-artifact-copy strong {
  font-size: 0.82rem;
}

.browser-artifact-open {
  justify-self: start;
  padding: 7px 10px;
  border: 1px solid #bed5ca;
  border-radius: 9px;
  color: var(--accent);
  background: #f0f7f3;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.browser-artifact-open:hover {
  border-color: #8eaa9c;
  background: var(--accent-soft);
}

.composer-zone {
  position: relative;
  z-index: 5;
  padding: 10px clamp(22px, 6vw, 76px) 17px;
  background: linear-gradient(to bottom, rgb(255 253 249 / 50%), var(--surface) 18%);
}

.browser-controls,
.run-status,
.composer-form,
.composer-help {
  width: min(100%, 860px);
  margin-right: auto;
  margin-left: auto;
}

.browser-controls {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 7px 9px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(248 245 239 / 82%);
}

.browser-capability-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.browser-capability-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: var(--ink-muted);
  font-size: 0.74rem;
  font-weight: 720;
  white-space: nowrap;
}

.browser-capability-badge[data-tone="ready"] {
  color: var(--accent);
}

.browser-capability-badge[data-tone="ready"] .status-dot {
  background: #2a8b68;
  box-shadow: 0 0 0 3px rgb(42 139 104 / 13%);
}

.browser-capability-badge[data-tone="unavailable"] {
  color: #7d4e20;
}

.browser-capability-badge[data-tone="unavailable"] .status-dot {
  background: #b67a26;
  box-shadow: 0 0 0 3px rgb(182 122 38 / 13%);
}

.browser-capability-note {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-suggestion-button {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid #bed5ca;
  border-radius: 9px;
  color: var(--accent);
  background: #fff;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
}

.browser-suggestion-button:hover:not(:disabled) {
  background: var(--accent-soft);
}

.browser-suggestion-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.run-status {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  padding: 6px 8px 6px 12px;
  border: 1px solid #d4e3db;
  border-radius: 11px;
  color: var(--accent);
  background: #f0f7f3;
  font-size: 0.77rem;
  font-weight: 650;
}

.run-status > span:nth-child(2) {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-spinner {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border: 2px solid #b6d2c5;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.cancel-button {
  min-height: 30px;
  padding: 4px 9px;
  border-color: #bed5ca;
  font-size: 0.72rem;
}

.composer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 9px 9px 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 7px 24px rgb(23 34 29 / 8%);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.composer-form:focus-within {
  border-color: #8eaa9c;
  box-shadow: 0 0 0 3px rgb(28 91 69 / 9%), 0 8px 26px rgb(23 34 29 / 8%);
}

.composer-attachments {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 7px;
}

.composer-attachments[hidden] {
  display: none;
}

.composer-attachment-chip {
  display: inline-flex;
  max-width: min(100%, 360px);
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 5px 6px 5px 10px;
  border: 1px solid rgb(67 23 198 / 20%);
  border-radius: 999px;
  color: #2c1a73;
  background: #f4f1ff;
  font-size: 0.7rem;
  font-weight: 750;
}

.composer-attachment-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-attachment-remove {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #4317c6;
  background: rgb(67 23 198 / 9%);
  cursor: pointer;
  font: inherit;
}

.composer-form textarea {
  width: 100%;
  max-height: 160px;
  resize: none;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 0.94rem;
  line-height: 1.45;
  scrollbar-color: var(--line-strong) transparent;
}

.composer-form textarea::placeholder {
  color: #93998f;
}

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

.send-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  font-size: 1.25rem;
  line-height: 1;
}

.composer-help {
  margin-top: 7px;
  margin-bottom: 0;
  color: #888e86;
  font-size: 0.67rem;
  text-align: center;
}

.sidebar-scrim {
  display: none;
}

.toast-region {
  position: fixed;
  z-index: 1200;
  right: 20px;
  bottom: 20px;
  width: min(calc(100% - 40px), 390px);
  pointer-events: none;
}

.toast {
  padding: 12px 15px;
  border: 1px solid #d2cec5;
  border-radius: 11px;
  color: var(--ink);
  background: rgb(255 253 249 / 98%);
  box-shadow: var(--shadow-lg);
  font-size: 0.84rem;
  line-height: 1.45;
  animation: toastIn 180ms ease-out;
}

.toast-error {
  border-color: #e3c2be;
  color: #762d29;
  background: #fff8f7;
}

.noscript-message {
  position: fixed;
  z-index: 2000;
  inset: 20px;
  display: grid;
  place-content: center;
  margin: 0;
  padding: 30px;
  border-radius: 16px;
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.38;
    transform: scale(0.88);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes softGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgb(28 91 69 / 0%);
  }
  50% {
    box-shadow: 0 0 0 5px rgb(28 91 69 / 9%);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .mobile-only {
    display: inline-grid;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    top: var(--topbar-height);
    bottom: 0;
    left: 0;
    width: min(86vw, 310px);
    transform: translateX(-103%);
    transition: transform 190ms ease-out;
    box-shadow: 16px 0 40px rgb(23 34 29 / 15%);
  }

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

  .sidebar-scrim {
    position: fixed;
    z-index: 40;
    inset: var(--topbar-height) 0 0;
    display: block;
    padding: 0;
    border: 0;
    background: rgb(23 34 29 / 36%);
    cursor: pointer;
  }

  .chat-main {
    grid-column: 1;
  }

  .chat-header {
    padding-right: 22px;
    padding-left: 22px;
  }

  .chat-scroll,
  .composer-zone {
    padding-right: 22px;
    padding-left: 22px;
  }

  .user-label {
    display: none;
  }
}

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

  .topbar {
    padding: 0 12px;
  }

  .topbar-leading,
  .topbar-actions {
    gap: 7px;
  }

  .topbar .brand-word {
    display: none;
  }

  .provider-badge {
    max-width: 128px;
  }

  .provider-badge > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .quiet-button {
    padding: 7px 9px;
    font-size: 0.75rem;
  }

  .chat-header {
    padding: 16px 15px 12px;
  }

  .chat-header .eyebrow,
  .connection-state {
    display: none;
  }

  .chat-header h1 {
    font-size: 1.3rem;
  }

  .chat-scroll {
    padding: 20px 15px 28px;
  }

  .message-list {
    gap: 22px;
  }

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

  .message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 0.84rem;
  }

  .message-user {
    grid-template-columns: minmax(0, 1fr) 30px;
  }

  .message-user .message-body {
    padding: 10px 12px;
  }

  .message-content {
    font-size: 0.92rem;
  }

  .browser-artifacts {
    margin-top: 28px;
    padding-top: 20px;
  }

  .browser-artifacts-header {
    align-items: start;
  }

  .composer-zone {
    padding: 8px 12px 10px;
  }

  .browser-controls {
    flex-wrap: wrap;
    gap: 7px;
    padding: 8px 9px;
  }

  .browser-capability-copy {
    width: 100%;
    align-items: start;
  }

  .browser-capability-note {
    overflow: visible;
    line-height: 1.35;
    text-overflow: clip;
    white-space: normal;
  }

  .browser-suggestion-button {
    width: 100%;
  }

  .composer-form {
    padding-left: 13px;
    border-radius: 15px;
  }

  .composer-help {
    display: none;
  }

  .run-status {
    margin-bottom: 6px;
  }

  .auth-view {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    padding: 24px 14px;
  }

  .auth-card {
    padding: 27px 22px;
    border-radius: 20px;
  }

  .auth-footnote {
    margin-top: 4px;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
  }
}

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

/* Octramind shell refresh: independently implemented for the Platinum runtime. */

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 74px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 640px;
  padding: 8px;
  overflow: hidden;
  background: var(--canvas);
}

.topbar {
  position: relative;
  z-index: 50;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 360px;
  grid-column: 1;
  grid-row: 1;
  align-items: center;
  width: auto;
  height: 74px;
  padding: 0 18px 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 4px 18px rgb(18 24 61 / 4%);
  backdrop-filter: blur(16px);
}

.topbar-leading,
.topbar-actions,
.topbar-context,
.user-cluster {
  display: flex;
  align-items: center;
}

.topbar-leading {
  min-width: 0;
  gap: 12px;
}

.octramind-brand {
  min-width: 0;
  color: var(--ink);
}

.octramind-mark {
  display: inline-grid;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #5d2de2, #27128f);
  box-shadow: 0 8px 20px rgb(67 23 198 / 22%);
}

.octramind-mark svg {
  width: 29px;
  height: 29px;
  overflow: visible;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.octramind-mark svg circle {
  fill: currentcolor;
  stroke: none;
}

.octramind-mark-large {
  width: 58px;
  height: 58px;
  border-radius: 18px;
}

.octramind-mark-large svg {
  width: 42px;
  height: 42px;
}

.octramind-word {
  overflow: hidden;
  color: #152044;
  font-size: 1.09rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-overflow: ellipsis;
}

.topbar-context {
  min-width: 0;
  justify-content: center;
  gap: 18px;
  padding: 0 20px;
}

.berlin-time,
.thread-context {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.berlin-time {
  text-align: right;
}

.berlin-time > span,
.thread-context strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.berlin-time small,
.thread-context small {
  color: var(--ink-muted);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thread-context {
  width: min(24vw, 260px);
}

.topbar-divider {
  width: 1px;
  height: 34px;
  background: var(--line);
}

.topbar .provider-badge {
  min-width: 0;
  max-width: 260px;
  height: 32px;
  padding: 0 11px;
  overflow: hidden;
  border-radius: 999px;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .provider-badge > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  min-width: 0;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #303866;
  background: #fff;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, transform 140ms ease, background 140ms ease;
}

.topbar-icon-button:hover:not(:disabled) {
  border-color: rgb(67 23 198 / 34%);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.topbar-icon-button:disabled {
  color: #a4a9c0;
  background: #f6f7fb;
  cursor: not-allowed;
}

.topbar-icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.user-cluster {
  min-width: 0;
  gap: 9px;
  padding: 0 4px 0 6px;
}

.user-avatar {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #3520a8, #6d44e8);
  box-shadow: 0 0 0 1px rgb(67 23 198 / 18%);
  font-size: 0.82rem;
  font-weight: 850;
}

.topbar .user-label {
  max-width: 126px;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-grid {
  display: grid;
  grid-column: 1;
  grid-row: 2;
  grid-template-columns: 300px minmax(540px, 1fr) 360px;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.sidebar,
.chat-main,
.insights-sidebar {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(255 255 255 / 76%);
  box-shadow: 0 5px 22px rgb(18 24 61 / 4%);
  backdrop-filter: blur(14px);
}

.sidebar {
  position: relative;
  inset: auto;
  display: flex;
  grid-area: auto;
  flex-direction: column;
  width: auto;
  height: auto;
  overflow: hidden;
  border-right: 1px solid var(--line);
  transform: none;
}

.left-navigation {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  padding: 20px 18px 12px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgb(67 23 198 / 22%) transparent;
}

.sidebar-section,
.insight-section {
  display: grid;
  gap: 10px;
}

.section-heading-row {
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-heading-row h2,
.sidebar-title {
  margin: 0;
  color: #242b58;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.section-count,
.later-label,
.preview-pill,
.active-pill {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.59rem;
  font-weight: 820;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.section-count {
  color: var(--accent);
  background: var(--accent-soft);
}

.later-label,
.preview-pill {
  color: #7a819f;
  background: #eff1f7;
}

.active-pill {
  color: #1d7548;
  background: #e6f6ed;
}

.role-list,
.future-list,
.source-list {
  display: grid;
  gap: 7px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.role-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 55px;
  align-items: center;
  gap: 10px;
  padding: 6px 9px 6px 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: rgb(255 255 255 / 68%);
}

.role-card.is-active {
  border-color: rgb(67 23 198 / 18%);
  background: linear-gradient(90deg, rgb(238 234 255 / 96%), rgb(255 255 255 / 88%));
  box-shadow: inset 3px 0 var(--accent);
}

.role-card > span:nth-child(2),
.future-list button > span:last-child,
.source-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  text-align: left;
}

.role-card strong,
.future-list strong,
.source-copy strong {
  overflow: hidden;
  font-size: 0.79rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-card small,
.future-list small,
.source-copy small {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 0.65rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-icon,
.source-icon {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: #3e456e;
  background: #eef0f7;
  font-size: 0.74rem;
  font-weight: 900;
}

.role-icon-violet,
.source-icon-violet {
  color: #5527c8;
  background: #eee8ff;
}

.role-icon-blue,
.source-icon-blue {
  color: #27128f;
  background: #e8e7fb;
}

.role-icon-cyan,
.source-icon-cyan {
  color: #08768c;
  background: #e1f5f7;
}

.role-icon-green {
  color: #24794f;
  background: #e5f5ec;
}

.future-list button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border: 1px dashed rgb(31 39 82 / 13%);
  border-radius: 8px;
  color: #747b99;
  background: #f8f9fc;
  opacity: 0.82;
}

.future-list button > span:first-child {
  display: inline-grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  background: #eef0f6;
  font-size: 1rem;
}

.conversations-section {
  min-height: 180px;
  flex: 1;
  grid-template-rows: auto minmax(120px, 1fr);
}

.compact-add-button {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 0.66rem;
  font-weight: 800;
  cursor: pointer;
}

.compact-add-button:hover {
  background: var(--accent-strong);
}

.thread-nav {
  min-height: 0;
  padding: 0;
  overflow: auto;
}

.thread-list {
  gap: 5px;
}

.thread-button {
  min-height: 49px;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
}

.thread-button:hover {
  border-color: var(--line);
  background: #fff;
}

.thread-button[aria-current="page"] {
  border-color: rgb(67 23 198 / 18%);
  color: #291169;
  background: #eeeaff;
  box-shadow: inset 3px 0 var(--accent);
}

.thread-glyph {
  width: 29px;
  height: 29px;
  border-color: rgb(67 23 198 / 20%);
  border-radius: 9px;
  background: #f1edff;
}

.thread-glyph::after {
  border-color: var(--accent);
}

.thread-copy strong {
  font-size: 0.76rem;
}

.thread-copy small {
  font-size: 0.62rem;
}

.thread-running {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(67 23 198 / 10%);
}

.sidebar-footer {
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  background: rgb(249 249 253 / 78%);
}

.workspace-card {
  min-height: 52px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.workspace-icon {
  color: var(--accent);
  background: var(--accent-soft);
}

.provider-note {
  max-height: 34px;
  margin: 0 3px;
  overflow: hidden;
  font-size: 0.62rem;
  line-height: 1.35;
}

.chat-main {
  display: grid;
  grid-template-rows: 74px minmax(0, 1fr) auto;
  grid-area: auto;
  height: auto;
  overflow: hidden;
}

.chat-header {
  min-height: 74px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 72%);
}

.chat-heading-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.chat-heading-copy > div {
  min-width: 0;
}

.role-kicker {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #4317c6, #27128f);
  font-size: 0;
  box-shadow: 0 8px 20px rgb(67 23 198 / 18%);
}

.role-kicker::before {
  content: "A";
  font-size: 0.86rem;
  font-weight: 900;
}

.chat-header h1 {
  max-width: min(46vw, 620px);
  overflow: hidden;
  color: var(--ink);
  font-size: 1.03rem;
  font-weight: 850;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header p {
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.connection-state {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #586083;
  background: #f7f8fc;
  font-size: 0.65rem;
  font-weight: 760;
}

.chat-scroll {
  min-height: 0;
  padding: clamp(24px, 4vw, 48px) clamp(22px, 5vw, 72px) 28px;
  background:
    radial-gradient(circle at 50% 4%, rgb(238 234 255 / 60%), transparent 28%),
    #fbfbfe;
  scrollbar-color: rgb(67 23 198 / 20%) transparent;
}

.empty-chat {
  max-width: 560px;
  min-height: 54%;
}

.empty-chat::before,
.empty-chat::after {
  background: rgb(67 23 198 / 10%);
}

.empty-orbit {
  background: rgb(238 234 255 / 62%);
  box-shadow: 0 0 0 14px rgb(238 234 255 / 32%);
}

.empty-chat h2 {
  color: var(--ink);
  font-family: inherit;
  font-size: clamp(1.75rem, 3.1vw, 2.55rem);
  font-weight: 850;
}

.message-list {
  width: min(100%, 900px);
  gap: 20px;
  margin: 0 auto;
}

.message {
  width: min(100%, 900px);
  margin-inline: auto;
}

.message-avatar {
  color: #fff;
  background: linear-gradient(145deg, #4317c6, #27128f);
}

.message-body {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px 16px 16px;
  background: #fff;
  box-shadow: 0 8px 26px rgb(18 24 61 / 5%);
}

.message-user .message-body {
  border-color: rgb(67 23 198 / 13%);
  border-radius: 16px 8px 16px 16px;
  background: #eeeaff;
  box-shadow: none;
}

.message-user .message-avatar {
  background: #303866;
}

.message-content {
  color: #20274f;
  font-size: 0.92rem;
  line-height: 1.62;
}

.browser-artifacts {
  width: min(100%, 900px);
  margin: 28px auto 0;
  border-color: rgb(67 23 198 / 14%);
  background: #fff;
}

.browser-artifact-card {
  border-radius: 10px;
  background: #f8f8fc;
}

.browser-artifact-open {
  color: var(--accent);
}

.composer-zone {
  width: 100%;
  max-width: none;
  padding: 12px clamp(18px, 4vw, 58px) 16px;
  border-top: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 -12px 35px rgb(18 24 61 / 4%);
}

.browser-controls,
.run-status {
  border-color: var(--line);
  border-radius: 10px;
  background: #f8f8fc;
}

.browser-controls {
  min-height: 42px;
  padding: 6px 8px 6px 11px;
}

.browser-capability-note {
  max-width: min(34vw, 410px);
}

.browser-suggestion-button {
  border-color: rgb(67 23 198 / 18%);
  color: var(--accent);
  background: #fff;
}

.browser-suggestion-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.run-status {
  color: #2c1a73;
  background: #f1edff;
}

.run-spinner {
  border-color: rgb(67 23 198 / 20%);
  border-top-color: var(--accent);
}

.composer-form {
  grid-template-columns: 50px minmax(0, 1fr) 54px;
  min-height: 60px;
  padding: 4px;
  border: 1.5px solid rgb(67 23 198 / 34%);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgb(67 23 198 / 8%);
}

.composer-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgb(67 23 198 / 9%), 0 12px 32px rgb(67 23 198 / 10%);
}

.composer-attachment {
  display: inline-grid;
  width: 46px;
  height: 50px;
  place-items: center;
  align-self: end;
  border: 0;
  border-radius: 12px;
  color: #8b91ac;
  background: #f0f1f7;
  font-size: 1.35rem;
}

.composer-form textarea {
  min-height: 50px;
  max-height: 170px;
  padding: 14px 10px 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.94rem;
}

.composer-form textarea:focus {
  box-shadow: none;
}

.send-button {
  width: 50px;
  height: 50px;
  align-self: end;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 8px 18px rgb(67 23 198 / 24%);
}

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

.composer-help {
  color: #777e9c;
  font-size: 0.64rem;
  text-align: center;
}

.insights-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 18px 16px;
  overflow: auto;
}

.knowledge-preview {
  display: grid;
  gap: 8px;
}

.knowledge-preview article {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  min-height: 76px;
  align-items: start;
  gap: 11px;
  padding: 11px;
  border: 1px dashed rgb(31 39 82 / 16%);
  border-radius: 8px;
  background: #fafafe;
  opacity: 0.84;
}

.knowledge-preview article > div {
  min-width: 0;
}

.knowledge-preview strong {
  color: #343b68;
  font-size: 0.79rem;
}

.knowledge-preview p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 0.67rem;
  line-height: 1.4;
}

.connected-sources {
  padding-top: 2px;
}

.source-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fafafe;
  opacity: 0.72;
}

.source-row-active:not(:disabled) {
  border-color: rgb(67 23 198 / 19%);
  background: #fff;
  box-shadow: 0 7px 22px rgb(18 24 61 / 6%);
  opacity: 1;
  cursor: pointer;
}

.source-row-active:hover:not(:disabled) {
  border-color: rgb(67 23 198 / 40%);
  background: #f8f6ff;
}

.source-action {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 0.86rem;
}

.right-sidebar-footnote {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  margin-top: auto;
  border-radius: 8px;
  color: #747b9b;
  background: #f5f6fa;
  font-size: 0.64rem;
  line-height: 1.35;
}

.right-sidebar-footnote .status-dot {
  background: #2f9b66;
}

/* Credential manager */

.app-dialog {
  width: min(760px, calc(100% - 44px));
  max-width: 760px;
  max-height: min(88vh, 820px);
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 34px 100px rgb(18 24 61 / 20%);
}

.app-dialog::backdrop {
  background: rgb(18 24 61 / 24%);
  backdrop-filter: blur(14px);
}

.app-dialog[open] {
  display: block;
}

.app-dialog-small {
  width: min(520px, calc(100% - 44px));
}

.dialog-shell {
  display: flex;
  max-height: min(88vh, 820px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgb(31 39 82 / 12%);
  border-radius: 22px;
  background: rgb(255 255 255 / 96%);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 850;
  letter-spacing: -0.025em;
}

.dialog-close {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #606887;
  background: #f7f8fc;
  font-size: 1.25rem;
  cursor: pointer;
}

.dialog-close:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.dialog-content {
  display: grid;
  min-height: 0;
  gap: 16px;
  padding: 18px 22px 22px;
  overflow: auto;
}

.dialog-copy,
.credential-manager-intro > p,
.delete-confirmation p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.credential-manager-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.credential-manager-intro > p {
  max-width: 490px;
}

.compact-button {
  min-height: 38px;
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 10px;
  white-space: nowrap;
}

.dialog-status {
  min-height: 20px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.dialog-status[data-tone="error"] {
  color: var(--danger);
}

.credential-list {
  display: grid;
  gap: 9px;
}

.credential-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  min-height: 74px;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 18px rgb(18 24 61 / 4%);
}

.credential-item-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 1.1rem;
  font-weight: 900;
}

.credential-item-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.credential-item-copy strong,
.credential-item-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-item-copy strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.credential-item-copy span,
.credential-item-copy time {
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.credential-item-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.credential-item-actions button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #475079;
  background: #f8f9fc;
  font-size: 0.68rem;
  font-weight: 760;
  cursor: pointer;
}

.credential-item-actions button:hover {
  border-color: rgb(67 23 198 / 28%);
  color: var(--accent);
  background: var(--accent-soft);
}

.credential-item-actions .credential-delete-button:hover {
  border-color: rgb(159 29 29 / 20%);
  color: var(--danger);
  background: var(--danger-soft);
}

.credential-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--ink-muted);
  text-align: center;
  background: #fafafe;
}

.credential-empty > span {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 1.2rem;
}

.credential-empty strong {
  color: var(--ink);
}

.credential-empty p {
  margin: 0;
  font-size: 0.76rem;
}

.editor-fields {
  grid-template-columns: 1fr;
}

.editor-fields label {
  margin-bottom: -10px;
  color: #3b426a;
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.editor-fields input,
.editor-fields select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
}

.editor-fields input:focus,
.editor-fields select:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 4px rgb(67 23 198 / 9%);
}

.model-access-current {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid rgb(47 155 102 / 24%);
  border-radius: 12px;
  color: var(--ink);
  background: rgb(47 155 102 / 7%);
}

.model-access-platform {
  display: grid;
  gap: 14px;
  padding: 15px;
  border: 1px solid rgb(67 23 198 / 18%);
  border-radius: 14px;
  background: linear-gradient(145deg, rgb(67 23 198 / 7%), rgb(255 255 255 / 92%));
}

.model-access-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.model-access-section-heading > div {
  display: grid;
  gap: 3px;
}

.model-access-section-heading small,
.model-access-updated {
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.compact-button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.76rem;
}

.model-access-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.model-access-metrics > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgb(255 255 255 / 76%);
}

.model-access-metrics dt {
  margin-bottom: 4px;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.model-access-metrics dd {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#model-access-credit-rates,
#model-access-credit-formula {
  overflow-wrap: anywhere;
  white-space: normal;
}

.model-access-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-muted);
  font-size: 0.7rem;
  font-weight: 760;
  text-transform: uppercase;
}

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

@media (max-width: 680px) {
  .model-access-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.model-access-current[hidden] {
  display: none;
}

.model-access-current span,
.model-access-current small {
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.model-access-actions .dialog-action-spacer {
  flex: 1 1 auto;
}

.mail-access-dialog {
  width: min(820px, calc(100vw - 32px));
}

.mail-access-content {
  display: grid;
  gap: 18px;
}

.mail-access-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.mail-access-heading p {
  margin: 5px 0 0;
  color: var(--ink-muted);
}

.mail-account-list {
  display: grid;
  gap: 10px;
}

.mail-account-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.mail-account-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: rgb(67 23 198 / 8%);
  font-size: 20px;
}

.mail-account-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.mail-account-copy strong,
.mail-account-copy span,
.mail-account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-account-copy span,
.mail-account-copy small {
  color: var(--ink-muted);
}

.mail-account-actions,
.mail-provider-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mail-imap-form {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbfe;
}

.mail-server-grid {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 10px 12px;
}

.inline-check {
  display: flex !important;
  align-items: center;
  gap: 9px;
}

.inline-check input {
  width: auto;
}

@media (max-width: 680px) {
  .mail-access-heading {
    display: grid;
  }

  .mail-account-item {
    grid-template-columns: 1fr;
  }

  .mail-account-icon {
    display: none;
  }

  .mail-account-actions > button,
  .mail-provider-actions > button {
    flex: 1 1 140px;
  }

  .mail-server-grid {
    grid-template-columns: 1fr;
  }
}

.editor-fields .field-help {
  margin: -10px 0 0;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 20px;
  border-top: 1px solid var(--line);
  background: #fbfbfe;
}

.secondary-button,
.danger-button {
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 10px;
  font-weight: 780;
  cursor: pointer;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: #475079;
  background: #fff;
}

.danger-button {
  border: 1px solid var(--danger);
  color: #fff;
  background: var(--danger);
}

.danger-button:hover {
  background: #7f1515;
}

.delete-confirmation strong {
  color: var(--ink);
}

@media (max-width: 1260px) {
  .topbar {
    grid-template-columns: 280px minmax(0, 1fr) auto;
  }

  .shell-grid {
    grid-template-columns: 280px minmax(540px, 1fr);
  }

  .insights-sidebar {
    display: none;
  }

  .topbar .user-label {
    display: none;
  }

  .thread-context {
    width: min(25vw, 220px);
  }
}

@media (max-width: 980px) {
  .topbar-context {
    gap: 10px;
    padding-inline: 10px;
  }

  .berlin-time,
  .topbar-divider {
    display: none;
  }

  .topbar .provider-badge {
    max-width: 190px;
  }

  .browser-capability-note {
    display: none;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-rows: 66px minmax(0, 1fr);
    min-height: 500px;
    gap: 6px;
    padding: 6px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    height: 66px;
    padding: 0 10px;
    border-radius: 10px;
  }

  .mobile-only {
    display: inline-grid;
  }

  .topbar-leading {
    gap: 8px;
  }

  .octramind-word {
    font-size: 0.92rem;
    letter-spacing: 0.11em;
  }

  .topbar-context {
    justify-content: flex-end;
  }

  .thread-context {
    width: min(30vw, 190px);
  }

  .topbar .provider-badge,
  .future-control,
  .user-cluster {
    display: none;
  }

  .topbar-actions {
    gap: 6px;
  }

  .shell-grid {
    display: block;
  }

  .chat-main {
    width: 100%;
    height: 100%;
    border-radius: 10px;
  }

  .sidebar {
    position: fixed;
    z-index: 90;
    top: 78px;
    bottom: 6px;
    left: 6px;
    width: min(88vw, 330px);
    border-radius: 12px;
    box-shadow: 24px 0 60px rgb(18 24 61 / 18%);
    transform: translateX(calc(-100% - 16px));
    transition: transform 180ms ease;
  }

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

  .sidebar-scrim:not([hidden]) {
    position: fixed;
    z-index: 80;
    inset: 72px 0 0;
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    background: rgb(18 24 61 / 24%);
    backdrop-filter: blur(5px);
  }

  .chat-header {
    min-height: 68px;
    padding: 9px 14px;
  }

  .chat-main {
    grid-template-rows: 68px minmax(0, 1fr) auto;
  }

  .chat-header h1 {
    max-width: 52vw;
  }

  .chat-header p {
    display: none;
  }

  .chat-scroll {
    padding: 26px 16px 20px;
  }

  .composer-zone {
    padding: 8px 10px 10px;
  }

  .browser-controls {
    align-items: center;
  }

  .browser-suggestion-button {
    min-height: 34px;
    font-size: 0.66rem;
  }

  .composer-form {
    grid-template-columns: 44px minmax(0, 1fr) 48px;
    min-height: 54px;
  }

  .composer-attachment,
  .send-button {
    width: 44px;
    height: 44px;
  }

  .composer-form textarea {
    min-height: 44px;
    padding-top: 12px;
  }

  .app-dialog {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
  }

  .dialog-shell {
    max-height: calc(100dvh - 24px);
  }
}

@media (max-width: 560px) {
  .octramind-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .octramind-word {
    display: none;
  }

  .thread-context {
    width: min(36vw, 150px);
  }

  .thread-context small {
    display: none;
  }

  .topbar-icon-button {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .role-kicker {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .connection-state {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .browser-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .browser-capability-badge {
    font-size: 0.66rem;
  }

  .browser-suggestion-button {
    max-width: 122px;
    padding-inline: 9px;
    line-height: 1.2;
  }

  .composer-help {
    max-width: 94vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .credential-manager-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .credential-manager-intro .compact-button {
    align-self: flex-start;
  }

  .credential-item {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .credential-item-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .dialog-header {
    padding: 18px 16px 12px;
  }

  .dialog-header h2 {
    font-size: 1.24rem;
  }

  .dialog-content {
    padding: 16px;
  }

  .dialog-actions {
    padding: 12px 16px 16px;
  }
}

/* Golden shell parity. The authenticated surface follows the managed Octramind
   shell geometry while retaining Platinum's own API and security model. */

body:has(.app-shell:not([hidden])) {
  overflow: hidden;
  background: linear-gradient(135deg, #f9fbff 0%, #eef4ff 42%, #fff8f2 100%);
}

.app-shell {
  grid-template-rows: 74px minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  padding: 8px;
  background: transparent;
  font: 15px/1.45 ui-sans-serif, Aptos, "Segoe UI", system-ui, sans-serif;
}

.topbar,
.sidebar,
.chat-main,
.insights-sidebar {
  border: 1px solid rgb(31 39 82 / 12%);
  border-radius: 0;
  background: rgb(255 255 255 / 78%);
  box-shadow: none;
  backdrop-filter: blur(20px);
}

.topbar {
  display: flex;
  width: 100%;
  height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 18px 0 22px;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 18px 60px rgb(25 28 31 / 8%);
}

.topbar-leading {
  min-width: 0;
  flex: 1 1 auto;
  gap: clamp(18px, 3vw, 42px);
}

.octramind-brand {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
}

.octramind-brand img {
  display: block;
  width: min(210px, 30vw);
  height: auto;
  max-height: 54px;
  object-fit: contain;
}

.topbar-session {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.berlin-time {
  display: flex;
  min-width: max-content;
  align-items: baseline;
  gap: 4px;
  text-align: left;
}

.berlin-time > span,
.berlin-time small {
  color: #111a2c;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

.thread-context {
  display: inline-flex;
  width: auto;
  max-width: min(320px, 27vw);
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid rgb(67 23 198 / 22%);
  border-radius: 8px;
  color: #4317c6;
  background: rgb(255 255 255 / 68%);
  cursor: pointer;
  font: inherit;
}

.thread-context strong {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 0.8rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-context svg,
.account-chevron {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.topbar .provider-badge {
  display: inline-flex;
  max-width: min(330px, 24vw);
  height: auto;
  min-height: 0;
  gap: 5px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: #697195;
  background: transparent;
  font-size: 0.73rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .provider-badge .status-dot {
  display: none;
}

.topbar-actions {
  flex: 0 0 auto;
  gap: 12px;
}

.topbar-icon-button {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-color: transparent;
  color: #152044;
  background: transparent;
}

.topbar-icon-button:hover:not(:disabled),
.account-menu-button:hover {
  border-color: rgb(67 23 198 / 18%);
  color: #152044;
  background: rgb(67 23 198 / 5%);
  transform: none;
}

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

.account-menu-wrap {
  position: relative;
}

.account-menu-button {
  display: inline-flex;
  min-height: 44px;
  max-width: 238px;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #152044;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.user-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #1d2752;
  background: linear-gradient(135deg, #ffe8d8, #d8ecff);
  box-shadow: none;
}

.user-avatar svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.topbar .user-label {
  max-width: 170px;
  color: #152044;
  font-size: 0.8rem;
  font-weight: 750;
}

.account-popover {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: 190px;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgb(31 39 82 / 14%);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 46px rgb(18 24 61 / 18%);
}

.account-popover[hidden] {
  display: none;
}

.account-popover > span {
  padding: 2px 4px;
  color: #697195;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-popover button {
  min-height: 38px;
  border: 1px solid rgb(31 39 82 / 12%);
  border-radius: 8px;
  color: #152044;
  background: #f8f9fc;
  cursor: pointer;
  font-weight: 800;
}

.shell-grid {
  grid-template-columns: 300px minmax(540px, 1fr) 360px;
  gap: 0;
}

.sidebar {
  border-right: 0;
}

.left-navigation {
  gap: 18px;
  padding: 22px;
}

.sidebar-section {
  gap: 10px;
}

.section-heading-row {
  min-height: 0;
  align-items: flex-start;
}

.section-heading-row h2,
.insight-card-header h2 {
  margin: 0;
  color: #1d2752;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-heading-row p,
.insight-card-header p {
  margin: 3px 0 0;
  color: #697195;
  font-size: 0.7rem;
  line-height: 1.4;
}

#tasks-title {
  font-size: 0.7rem;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.role-list,
.prompt-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.role-list li {
  min-width: 0;
}

.role-card {
  display: grid;
  width: 100%;
  min-height: 51px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border: 1px solid rgb(21 32 68 / 12%);
  border-radius: 8px;
  color: #152044;
  background: rgb(255 255 255 / 78%);
  box-shadow: 0 10px 26px rgb(25 28 31 / 5%);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.role-card.is-active {
  border-color: rgb(67 23 198 / 70%);
  color: #4317c6;
  background: linear-gradient(135deg, rgb(67 23 198 / 8%), rgb(10 140 168 / 5%));
  box-shadow: 0 10px 30px rgb(67 23 198 / 12%);
}

.role-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgb(67 23 198 / 18%);
  border-radius: 999px;
  color: #4317c6;
  background: rgb(255 255 255 / 62%);
}

.role-card.is-active .role-icon {
  border-color: rgb(67 23 198 / 34%);
  background: rgb(244 241 255 / 92%);
}

.role-icon svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.role-card > span:nth-child(2) {
  display: block;
}

.role-card strong,
.role-card small,
.prompt-button strong,
.prompt-button small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-card strong,
.prompt-button strong {
  color: inherit;
  font-size: 0.82rem;
  font-weight: 850;
}

.role-card small,
.prompt-button small {
  margin-top: 2px;
  color: #697195;
  font-size: 0.66rem;
  font-style: italic;
}

.sidebar-plus-button,
.round-mini-button {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(31 39 82 / 12%);
  border-radius: 8px;
  color: #4317c6;
  background: rgb(255 255 255 / 72%);
  cursor: pointer;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 900;
}

.prompt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
}

.prompt-button {
  display: grid;
  min-width: 0;
  min-height: 42px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid rgb(31 39 82 / 12%);
  border-radius: 8px;
  color: #12183d;
  background: rgb(255 255 255 / 78%);
  box-shadow: 0 8px 24px rgb(25 28 31 / 4%);
  cursor: pointer;
  text-align: left;
}

.prompt-button > span:first-child {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #4317c6;
  font-size: 1.1rem;
}

.prompt-button > span:last-child {
  min-width: 0;
}

.prompt-gear {
  width: 34px;
  height: 42px;
  padding: 0;
  border: 1px solid rgb(31 39 82 / 12%);
  border-radius: 999px;
  color: #1d2752;
  background: rgb(255 255 255 / 62%);
  cursor: pointer;
}

.conversations-section {
  min-height: 0;
  flex: 1 1 auto;
  grid-template-rows: auto minmax(80px, 1fr) auto;
  padding-top: 18px;
  border-top: 1px solid rgb(31 39 82 / 12%);
}

.thread-nav {
  min-height: 0;
}

.thread-list {
  display: grid;
  gap: 8px;
}

.thread-row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
}

.thread-row:has(.thread-button[aria-current="page"]) {
  border-color: rgb(67 23 198 / 64%);
  background: linear-gradient(135deg, rgb(67 23 198 / 10%), rgb(255 255 255 / 72%));
}

.thread-button,
.thread-button[aria-current="page"] {
  display: grid;
  width: 100%;
  min-height: 59px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  color: #12183d;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.thread-button:hover,
.thread-button[aria-current="page"]:hover {
  border: 0;
  background: rgb(255 255 255 / 34%);
}

.thread-glyph {
  display: none;
}

.thread-copy {
  display: grid;
  min-width: 0;
  grid-column: 1;
  grid-row: 1 / span 2;
  gap: 2px;
}

.thread-copy strong {
  font-size: 0.8rem;
  font-weight: 850;
}

.thread-copy small {
  color: #697195;
  font-size: 0.69rem;
}

.thread-running {
  align-self: center;
  grid-column: 2;
  grid-row: 1 / span 2;
  background: #4317c6;
  box-shadow: 0 0 0 4px rgb(67 23 198 / 10%);
}

.thread-options-button,
.thread-protected-marker {
  align-self: center;
  display: grid;
  width: 30px;
  height: 32px;
  place-items: center;
  margin-right: 5px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #697195;
  background: transparent;
}

.thread-options-button {
  cursor: pointer;
  font-size: 1.2rem;
}

.thread-protected-marker svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.new-topic-button {
  width: 100%;
  min-height: 42px;
  border: 1px dashed rgb(67 23 198 / 26%);
  border-radius: 8px;
  color: #4317c6;
  background: rgb(255 255 255 / 38%);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 850;
}

.chat-main {
  position: relative;
  grid-template-rows: minmax(0, 1fr) auto;
  border-radius: 0;
}

.chat-header[hidden] {
  display: none;
}

.chat-scroll {
  padding: 18px 28px;
  background: transparent;
}

.empty-chat {
  min-height: 100%;
  padding-bottom: 36px;
}

.empty-chat .empty-orbit {
  width: 88px;
  height: 88px;
  border: 0;
  background: transparent;
}

.empty-chat .octramind-mark {
  width: 82px;
  height: 82px;
  background: url("/assets/octra-icon-02.png") center / contain no-repeat;
  box-shadow: none;
}

.empty-chat .octramind-mark svg {
  display: none;
}

.message-list {
  display: flex;
  width: 100%;
  max-width: none;
  flex-direction: column;
  gap: 10px;
}

.message,
.message-draft {
  position: relative;
  display: block;
  width: 92%;
  max-width: none;
  padding-top: 4px;
  margin: 0 8% 0 0;
}

.message-user {
  margin: 0 0 0 8%;
}

.message-avatar {
  display: none;
}

.message-body,
.message-user .message-body {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-height: 0;
  padding: 10px 12px 31px;
  border: 1px solid rgb(22 32 43 / 14%);
  border-radius: 10px;
  color: #12183d;
  background: rgb(255 255 255 / 52%);
  box-shadow: 0 12px 34px rgb(25 28 31 / 4%);
}

.message-assistant .message-body,
.message-draft .message-body {
  border-color: rgb(67 23 198 / 18%);
  background: rgb(255 255 255 / 78%);
  padding-left: 64px;
}

.message-assistant::before,
.message-draft::before {
  position: absolute;
  z-index: 1;
  top: 32px;
  left: 14px;
  width: 40px;
  height: 42px;
  background: url("/assets/octra-icon-02.png") center / contain no-repeat;
  content: "";
  filter: drop-shadow(0 8px 14px rgb(67 23 198 / 16%));
  pointer-events: none;
}

.message-user .message-body {
  border-color: rgb(67 23 198 / 24%);
  background: linear-gradient(135deg, rgb(244 241 255 / 96%), rgb(238 247 255 / 92%));
  box-shadow: 0 12px 34px rgb(25 28 31 / 4%);
}

.message-meta,
.message-user .message-meta {
  min-height: 15px;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 7px;
  color: #697195;
  font-size: 0.7rem;
  line-height: 1.2;
}

.message-meta strong {
  display: none;
}

.message-id {
  position: absolute;
  right: 10px;
  bottom: 8px;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid rgb(24 32 39 / 16%);
  border-radius: 999px;
  color: #697195;
  background: transparent;
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
}

.message-content {
  color: #12183d;
  font-size: 0.9rem;
  line-height: 1.35;
}

.message-draft {
  margin-top: 10px;
}

.message-draft .message-meta strong {
  display: inline;
}

.browser-artifacts {
  width: 92%;
  max-width: none;
  margin: 10px 8% 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.browser-artifacts-header {
  margin-bottom: 10px;
}

.browser-artifact-list {
  grid-template-columns: minmax(0, 1fr);
}

.browser-artifact-card {
  border-radius: 10px;
}

.browser-artifact-preview {
  max-height: min(520px, 55vh);
  aspect-ratio: 16 / 9;
  background: #f5f6fb;
}

.scroll-bottom-button {
  position: absolute;
  z-index: 12;
  right: 50%;
  bottom: 158px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgb(31 39 82 / 12%);
  border-radius: 999px;
  color: #12183d;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 10px 28px rgb(18 24 61 / 12%);
  cursor: pointer;
  transform: translateX(50%);
}

.composer-zone {
  padding: 14px 28px 20px;
  border-top: 1px solid rgb(31 39 82 / 12%);
  background: rgb(255 255 255 / 46%);
  box-shadow: none;
}

.run-status {
  width: 100%;
  min-height: 38px;
  margin: 0 0 10px;
  padding: 6px 10px;
  border-color: rgb(67 23 198 / 18%);
  border-radius: 10px;
  color: #2c1a73;
  background: rgb(244 241 255 / 88%);
}

.run-status .cancel-button {
  display: none;
}

.composer-form {
  display: grid;
  width: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.composer-form:focus-within {
  border: 0;
  box-shadow: none;
}

.composer-form textarea {
  width: 100%;
  min-height: 50px;
  max-height: calc(1.45em * 6 + 28px);
  padding: 14px 18px;
  resize: none;
  overflow-y: auto;
  border: 1px solid rgb(67 23 198 / 38%);
  border-radius: 14px;
  color: #12183d;
  background: rgb(255 255 255 / 70%);
  font: inherit;
}

.composer-form textarea:focus {
  border-color: #4317c6;
  outline: 0;
  box-shadow: 0 0 0 3px rgb(67 23 198 / 8%);
}

.composer-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.composer-actions-spacer {
  min-width: 8px;
  flex: 1 1 auto;
}

.composer-tool-button {
  width: 50px;
  min-height: 50px;
  flex: 0 0 50px;
  border: 1px solid rgb(31 39 82 / 12%);
  border-radius: 18px;
  color: #12183d;
  background: rgb(255 255 255 / 70%);
  cursor: pointer;
  font-size: 1.2rem;
}

.send-button,
.composer-cancel-button {
  display: grid;
  width: 54px;
  min-width: 54px;
  min-height: 54px;
  flex: 0 0 54px;
  place-items: center;
  padding: 0;
  border-radius: 999px;
}

.send-button {
  color: #fff7ec;
  background: #4317c6;
  box-shadow: none;
}

.composer-cancel-button {
  border: 1px solid rgb(180 35 24 / 22%);
  color: #9f1d1d;
  background: rgb(255 255 255 / 70%);
  cursor: pointer;
  font-size: 1.5rem;
}

.composer-help {
  display: none;
}

.insights-sidebar {
  display: flex;
  gap: 18px;
  padding: 24px 22px;
  overflow: hidden;
  border-left: 0;
}

.insight-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgb(21 32 68 / 12%);
  border-radius: 8px;
  background: rgb(255 255 255 / 70%);
  box-shadow: 0 12px 34px rgb(25 28 31 / 5%);
}

.insight-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.insight-card-header p {
  max-width: 280px;
  margin-top: 8px;
}

.round-mini-button {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 999px;
  color: #1d2752;
  font-size: 0.8rem;
}

.knowledge-card {
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.knowledge-list {
  display: grid;
  min-height: 0;
  gap: 10px;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-color: rgb(67 23 198 / 24%) transparent;
  scrollbar-width: thin;
}

.knowledge-row {
  display: grid;
  min-height: 58px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgb(21 32 68 / 10%);
  border-radius: 8px;
  background: rgb(255 255 255 / 72%);
}

.knowledge-row > div:first-child {
  min-width: 0;
}

.knowledge-row strong,
.knowledge-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-row strong {
  color: #152044;
  font-size: 0.8rem;
}

.knowledge-row small {
  margin-top: 2px;
  color: #697195;
  font-size: 0.64rem;
  font-style: italic;
}

.knowledge-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.knowledge-actions button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #4317c6;
  background: transparent;
  cursor: pointer;
}

.knowledge-actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.knowledge-actions .knowledge-check {
  position: relative;
}

.knowledge-check::before {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgb(67 23 198 / 42%);
  border-radius: 6px;
  background: rgb(255 255 255 / 86%);
  content: "";
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 94%);
}

.knowledge-check.is-checked::before {
  border-color: #4317c6;
  background: #4317c6;
}

.knowledge-check.is-checked::after {
  position: absolute;
  width: 8px;
  height: 5px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  content: "";
  transform: translateY(-1px) rotate(-45deg);
}

.source-card {
  flex: 0 0 auto;
}

.source-list {
  display: grid;
  gap: 10px;
}

.source-row {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 48px;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgb(21 32 68 / 10%);
  border-radius: 8px;
  color: #12183d;
  background: rgb(255 255 255 / 72%);
  cursor: pointer;
  font: inherit;
  opacity: 1;
  text-align: left;
}

.source-row strong {
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-logo {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
}

.source-logo svg {
  display: block;
  width: 28px;
  height: 28px;
}

.source-logo.mail-logo svg {
  fill: none;
  stroke: currentcolor;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.source-status {
  color: #2f9b66;
  font-size: 0.7rem;
  font-weight: 750;
  white-space: nowrap;
}

.source-row > span:last-child {
  color: #697195;
  font-size: 1.2rem;
}

.button-dialog-shell {
  min-height: 180px;
}

/* Authenticated, exact-origin browser handoff. */
.browser-control-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.browser-handoff-button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 760;
}

.browser-handoff-button:hover:not(:disabled) {
  filter: brightness(1.08);
}

.browser-handoff-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.browser-handoff-dialog {
  width: min(680px, calc(100% - 32px));
}

.browser-handoff-content {
  gap: 14px;
}

.browser-handoff-summary {
  display: grid;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8f8fc;
}

.browser-handoff-status-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  color: #66562f;
  font-size: 0.76rem;
  font-weight: 800;
}

.browser-handoff-status-badge[data-tone="active"] {
  color: #167450;
}

.browser-handoff-status-badge[data-tone="error"] {
  color: var(--danger);
}

.browser-handoff-status-badge[data-tone="active"] .status-dot {
  background: #2a8b68;
  box-shadow: 0 0 0 3px rgb(42 139 104 / 13%);
}

.browser-handoff-status-badge[data-tone="error"] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgb(159 29 29 / 12%);
}

.browser-handoff-summary dl,
.browser-handoff-summary dl > div {
  display: grid;
  gap: 3px;
  margin: 0;
}

.browser-handoff-summary dl {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.browser-handoff-summary dt {
  color: var(--ink-muted);
  font-size: 0.66rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.browser-handoff-summary dd {
  max-width: 420px;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-handoff-step {
  display: grid;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.browser-handoff-step[hidden] {
  display: none;
}

.browser-handoff-step h3,
.browser-handoff-step p {
  margin: 0;
}

.browser-handoff-step h3 {
  color: var(--ink);
  font-size: 0.93rem;
}

.browser-handoff-step > p:not(.field-help) {
  color: var(--ink-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.browser-handoff-step > button {
  justify-self: end;
}

.browser-handoff-actions {
  align-items: center;
}

@media (max-width: 720px) {
  .browser-control-actions {
    width: 100%;
  }

  .browser-control-actions > button {
    flex: 1 1 0;
  }

  .browser-handoff-summary dl {
    grid-template-columns: 1fr;
  }
}

.button-dialog-content {
  place-content: center;
  text-align: center;
}

.button-dialog-content p {
  margin: 0;
  color: #12183d;
  font-size: 1rem;
}

.composer-tool-button svg {
  display: block;
  width: 24px;
  height: 24px;
  margin: auto;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.files-dialog-content {
  display: grid;
  min-height: 300px;
  gap: 16px;
  overflow: auto;
}

.files-manager-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgb(21 32 68 / 10%);
}

.files-manager-intro p,
.files-manager-intro small {
  margin: 0;
  color: #697195;
  line-height: 1.45;
}

.files-manager-intro p {
  font-size: 0.82rem;
}

.files-manager-intro small {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
}

.file-upload-progress {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid rgb(67 23 198 / 18%);
  border-radius: 10px;
  color: #2c1a73;
  background: #f4f1ff;
}

.file-upload-progress[hidden] {
  display: none;
}

.file-upload-progress .run-spinner {
  width: 20px;
  height: 20px;
}

.file-upload-progress div,
.file-item-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.file-upload-progress strong,
.file-upload-progress small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-upload-progress strong {
  font-size: 0.78rem;
}

.file-upload-progress small {
  color: #697195;
  font-size: 0.68rem;
}

.files-list {
  display: grid;
  gap: 9px;
}

.file-item {
  display: grid;
  grid-template-columns: 86px 42px minmax(0, 1fr) 100px;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid rgb(21 32 68 / 11%);
  border-radius: 10px;
  background: rgb(255 255 255 / 82%);
}

.file-item-actions {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.files-mark-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2c1a73;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 750;
}

.files-mark-all input,
.file-select-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #4317c6;
}

.file-item-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  color: #4317c6;
  background: #f0ebff;
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.file-item-copy strong,
.file-item-copy span,
.file-item-copy time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-copy strong {
  color: #12183d;
  font-size: 0.82rem;
}

.file-item-copy span,
.file-item-copy time {
  color: #697195;
  font-size: 0.67rem;
}

.file-download-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 1px solid rgb(67 23 198 / 25%);
  border-radius: 9px;
  color: #4317c6;
  background: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  text-decoration: none;
}

.file-download-button:hover,
.file-download-button:focus-visible {
  border-color: #4317c6;
  background: #f7f4ff;
}

@media (max-width: 1260px) {
  .shell-grid {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .insights-sidebar {
    display: none;
  }

  .thread-context {
    max-width: 220px;
  }

  .topbar .provider-badge {
    max-width: 210px;
  }
}

@media (max-width: 980px) {
  .berlin-time,
  .topbar .provider-badge {
    display: none;
  }

  .topbar-leading {
    gap: 12px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-rows: 66px minmax(0, 1fr);
    height: 100dvh;
    gap: 0;
    padding: 6px;
  }

  .topbar {
    height: 66px;
    gap: 8px;
    padding: 0 10px;
    border-radius: 18px 18px 0 0;
  }

  .topbar-leading {
    flex: 1 1 auto;
    gap: 10px;
  }

  .octramind-brand img {
    width: 132px;
    max-height: 40px;
  }

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

  .thread-context {
    max-width: min(32vw, 150px);
    padding-inline: 8px;
  }

  .topbar-actions {
    gap: 4px;
  }

  .topbar-icon-button {
    display: none;
  }

  .topbar .mobile-only {
    display: grid;
  }

  .topbar-actions .topbar-icon-button:nth-child(3) {
    display: grid;
  }

  .account-menu-button {
    min-height: 36px;
    max-width: 52px;
    gap: 0;
    padding: 0 3px;
  }

  .user-avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .topbar .user-label,
  .account-chevron {
    display: none;
  }

  .shell-grid {
    display: block;
  }

  .chat-main {
    width: 100%;
    height: 100%;
    border-radius: 0 0 18px 18px;
  }

  .sidebar {
    top: 72px;
    bottom: 6px;
    left: 6px;
  }

  .chat-scroll {
    padding: 8px;
  }

  .message,
  .message-draft,
  .browser-artifacts {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

  .message-body,
  .message-user .message-body {
    padding: 8px 9px 30px;
  }

  .message-assistant .message-body,
  .message-draft .message-body {
    padding-left: 52px;
  }

  .message-assistant::before,
  .message-draft::before {
    top: 29px;
    left: 9px;
    width: 34px;
    height: 36px;
  }

  .composer-zone {
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  }

  .composer-form textarea {
    min-height: 46px;
    padding: 12px 13px;
    font-size: 16px;
  }

  .composer-actions {
    gap: 8px;
  }

  .composer-tool-button,
  .send-button,
  .composer-cancel-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    flex-basis: 44px;
    border-radius: 16px;
  }

  .send-button,
  .composer-cancel-button {
    border-radius: 999px;
  }

  .scroll-bottom-button {
    bottom: 138px;
  }
}

@media (max-width: 560px) {
  .octramind-brand img {
    width: 112px;
  }

  .thread-context {
    max-width: 105px;
  }

  .files-manager-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .files-manager-intro .compact-button {
    align-self: flex-start;
  }

}

.files-sticky-header { position: sticky; top: 0; z-index: 5; background: #fcfcff; padding-top: 10px; box-shadow: 0 5px 8px rgb(21 32 68 / 6%); }
.files-selection-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px 12px; color: #656d89; font-size: 12px; }
.files-column-headings { display: grid; grid-template-columns: 86px 42px minmax(0, 1fr) 100px; gap: 12px; align-items: center; padding: 10px 12px; border-block: 1px solid #e5e1f1; font-size: 11px; color: #465076; font-weight: 750; }
.files-name-heading { grid-column: 2 / 4; }
.files-actions-dropdown { position: relative; }
.files-actions-menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 205px; padding: 5px; border: 1px solid #e5e1f1; border-radius: 10px; background: #fff; box-shadow: 0 8px 24px #20134624; }
.files-actions-menu button { display: block; width: 100%; padding: 11px 12px; border: 0; border-radius: 6px; color: #28204c; background: transparent; text-align: left; cursor: pointer; }
.files-actions-menu button:hover, .files-actions-menu button:focus-visible { background: #f0ebff; }
.file-select-checkbox { justify-self: start; }
@media (max-width: 560px) {
  .file-item, .files-column-headings { grid-template-columns: 68px minmax(0, 1fr) 86px; gap: 8px; padding-inline: 8px; }
  .file-item-icon { display: none; }
  .files-name-heading { grid-column: 2; }
  .files-mark-all { flex-direction: column; align-items: flex-start; gap: 4px; }
  .file-download-button { padding-inline: 7px; }
}

/* Screenshots rendered inside the answer they belong to. The trailing
   section keeps its own spacing; this block only has to sit apart from the
   message text without competing with it. */
.message-artifacts {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.25));
}

.message-artifacts-label {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
}

.message-artifacts .browser-artifact-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 10px;
}

/* Downloads and uploads live in one dialog but answer different questions:
   what the agent gave me, and what I gave the agent. Group headings keep that
   distinction readable without a second dialog. */
.files-group + .files-group {
  margin-top: 22px;
}

.files-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
}

.files-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-raised, rgba(148, 163, 184, 0.16));
  font-size: 0.72rem;
  letter-spacing: 0;
}

.files-group-note {
  margin: 4px 0 10px;
  font-size: 0.76rem;
  color: var(--text-muted, #94a3b8);
}

.files-group-placeholder {
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed var(--border-subtle, rgba(148, 163, 184, 0.3));
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
}

/* The watcher sits beside the two existing browser actions and reads as a
   peer of them, not as a primary action: watching is passive. */
.browser-watch-button {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid #bed5ca;
  border-radius: 9px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.browser-watch-button:hover:not(:disabled) {
  background: rgba(90, 143, 118, 0.1);
}

.browser-watch-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.browser-watch-dialog {
  width: calc(100vw - 24px);
  max-width: none;
  height: calc(100dvh - 24px);
  max-height: none;
  margin: auto;
  border-radius: 14px;
}

.browser-watch-dialog .dialog-shell {
  display: grid;
  width: 100%;
  height: 100%;
  max-height: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 14px;
}

.browser-watch-dialog .dialog-header {
  padding: 14px 18px 10px;
}

.browser-watch-dialog .dialog-header h2 {
  font-size: 1.25rem;
}

.browser-watch-content {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: #e7e9ed;
}

.browser-watch-toolbar {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid rgb(31 39 82 / 14%);
  background: #f5f6f8;
}

.browser-watch-toolbar-dots {
  display: flex;
  gap: 6px;
}

.browser-watch-toolbar-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c2c6ce;
}

.browser-watch-toolbar-dots i:first-child {
  background: #e4655f;
}

.browser-watch-toolbar-dots i:nth-child(2) {
  background: #e6b84f;
}

.browser-watch-toolbar-dots i:last-child {
  background: #5eb77a;
}

.browser-watch-address {
  min-width: 0;
  margin: 0;
  padding: 7px 12px;
  overflow: hidden;
  border: 1px solid rgb(31 39 82 / 14%);
  border-radius: 8px;
  color: #32394f;
  background: #fff;
  font-size: 0.78rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-watch-status {
  margin: 0;
  color: #626a80;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.browser-watch-status[data-tone="ready"] {
  color: #237247;
}

.browser-watch-status[data-tone="error"] {
  color: #a42323;
}

.browser-watch-stage {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #202327;
  overflow: hidden;
}

.browser-watch-stage img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
}

.browser-watch-actions {
  min-height: 64px;
  padding: 10px 18px 14px;
}

.browser-watch-native-dialog {
  position: absolute;
  z-index: 1;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 32px));
  max-height: calc(100% - 48px);
  overflow: auto;
  padding: 22px;
  border: 1px solid #d9d3f4;
  border-radius: 14px;
  background: #fff;
  color: #19173f;
  box-shadow: 0 12px 48px #0005;
  overflow-wrap: anywhere;
}

.browser-watch-native-title { margin: 0 0 12px; font-weight: 700; }
.browser-watch-native-message { white-space: pre-wrap; margin: 0 0 14px; }
.browser-watch-native-input { display: block; padding: 10px 12px; border: 1px solid #c6bedf; border-radius: 6px; }
.browser-watch-native-status { font-size: .85rem; font-weight: 600; }
.browser-watch-native-dialog small { color: #686580; }

.browser-watch-placeholder {
  margin: 0;
  padding: 24px;
  text-align: center;
  font-size: 0.86rem;
  color: #c8cbd2;
}

@media (max-width: 700px) {
  .browser-watch-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }

  .browser-watch-dialog .dialog-shell {
    border: 0;
    border-radius: 0;
  }

  .browser-watch-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .browser-watch-toolbar-dots {
    display: none;
  }
}

/* Offered inside the run status so the invitation appears exactly when there
   is something live to look at, rather than as a control the person has to
   remember exists. */
.run-status-watch {
  flex: 0 0 auto;
  padding: 4px 12px;
  border: 1px solid var(--accent, #5a8f76);
  border-radius: 999px;
  background: transparent;
  color: var(--accent, #5a8f76);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.run-status-watch:hover {
  background: rgba(90, 143, 118, 0.12);
}

/* A canceled run is durable state, not an assistant answer. It therefore
   appears as a compact timeline notice attached to the originating user
   message and remains visible after reload. */
.message-run-notice {
  width: min(100%, 900px);
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  margin-top: -10px;
}

.message-run-notice .message-avatar {
  width: 28px;
  height: 28px;
  border-color: rgb(154 88 28 / 24%);
  border-radius: 50%;
  color: #9a581c;
  background: #fff3df;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
}

.message-run-notice .message-body {
  padding: 8px 12px;
  border: 1px solid rgb(154 88 28 / 18%);
  border-radius: 10px;
  background: rgb(255 248 237 / 88%);
  box-shadow: none;
}

.message-run-notice .message-meta {
  min-height: 0;
  justify-content: flex-start;
  margin: 0 0 2px;
}

.message-run-notice .message-meta strong {
  display: inline;
  color: #7a4517;
  font-size: 0.74rem;
}

.message-run-notice .message-content {
  color: #744b28;
  font-size: 0.78rem;
  line-height: 1.4;
}

.thread-manager-content {
  gap: 20px;
}

.thread-rename-form {
  display: grid;
  gap: 7px;
}

.thread-rename-form > label {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 750;
}

.thread-rename-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.thread-rename-controls input {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgb(31 39 82 / 18%);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.thread-rename-controls input:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px rgb(67 23 198 / 8%);
}

.thread-archive-button {
  justify-self: start;
}

.thread-archive-section {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.thread-archive-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.thread-archive-heading h3,
.thread-archive-heading p {
  margin: 0;
}

.thread-archive-heading h3 {
  color: var(--ink);
  font-size: 0.92rem;
}

.thread-archive-heading p {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.thread-archive-list {
  display: grid;
  gap: 8px;
}

.thread-archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfe;
}

.thread-archive-row > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.thread-archive-row strong,
.thread-archive-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-archive-row strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.thread-archive-row small {
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.message-actions-content {
  gap: 14px;
}

.message-actions-preview {
  max-height: 180px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-muted);
  background: #fafbfe;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

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

.message-actions-buttons .primary-button {
  grid-column: 1 / -1;
}

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

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

.message-content p,
.message-content ul,
.message-content blockquote,
.message-content pre,
.message-content h3,
.message-content h4,
.message-content h5 {
  margin: 0 0 0.72em;
}

.message-content ul {
  padding-left: 1.4em;
}

.message-content li + li {
  margin-top: 0.25em;
}

.message-content h3,
.message-content h4,
.message-content h5 {
  color: #101633;
  line-height: 1.25;
}

.message-content h3 {
  font-size: 1.12rem;
}

.message-content h4 {
  font-size: 1rem;
}

.message-content h5 {
  font-size: 0.92rem;
}

.message-content blockquote {
  padding: 0.35em 0 0.35em 0.85em;
  border-left: 3px solid rgb(67 23 198 / 30%);
  color: #555d7d;
}

.message-content code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: rgb(31 39 82 / 8%);
  font: 0.88em/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.message-content pre {
  max-width: 100%;
  padding: 12px 14px;
  overflow: auto;
  border-radius: 9px;
  color: #e9ecf5;
  background: #202534;
}

.message-content pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}

.message-content a {
  color: #3d20b8;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.message-usage {
  margin: 10px 0 0;
  color: #7a819d;
  overflow-x: auto;
  overflow-y: hidden;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

.message-usage-depleted {
  color: #a11b1b;
}

.message-downloads { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.message-downloads[hidden] { display: none; }
.message-downloads p { flex-basis: 100%; margin: 0; font-size: 12px; color: #656d89; }
.message-download-button {
  display: inline-flex; align-items: center; width: auto; flex: 0 1 auto; cursor: pointer; font-family: inherit;
  padding: 9px 12px; border: 1px solid #b9a6fb; border-radius: 9px;
  color: #421cc8; background: #faf8ff; font-size: 13px; font-weight: 700;
  text-decoration: none; overflow-wrap: anywhere; max-width: 100%;
}
.message-download-button:hover { background: #eee8ff; }
.message-download-button:focus-visible { outline: 2px solid #542bce; outline-offset: 3px; }
.message-content ul.message-file-link-list,
.message-content ol.message-file-link-list { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 0; list-style: none; }
.message-content .message-file-link-list > li { display: inline; margin: 0; }
.message-content p.message-file-link-paragraph { display: inline-flex; flex-wrap: wrap; gap: 8px; margin: 4px 14px 4px 0; }

.message-usage-details {
  margin-top: 8px;
  color: #656d89;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.message-usage-details summary { cursor: pointer; text-align: right; }
.message-usage-details summary:focus-visible { outline: 2px solid #542bce; outline-offset: 3px; }
.message-usage-breakdown { max-width: 100%; overflow-x: auto; }
.message-usage-breakdown p { margin: 10px 0; line-height: 1.5; }
.message-usage-breakdown table { width: 100%; border-collapse: collapse; text-align: left; }
.message-usage-breakdown caption { text-align: left; padding-bottom: 8px; }
.message-usage-breakdown th, .message-usage-breakdown td {
  padding: 8px; border-bottom: 1px solid #e5e1f1; vertical-align: top;
}
.message-usage-breakdown td:nth-last-child(-n+2) { text-align: right; white-space: nowrap; }

.topbar .provider-badge {
  max-width: min(650px, 52vw);
  overflow: visible;
}

.broker-model-controls {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.topbar .provider-badge > .broker-model-controls {
  overflow: visible;
  text-overflow: clip;
}

.broker-model-controls[hidden] {
  display: none;
}

.broker-model-controls select {
  width: auto;
  min-width: 0;
  height: 28px;
  padding: 2px 24px 2px 7px;
  border: 1px solid #d8dcef;
  border-radius: 7px;
  color: #31395f;
  background: #fff;
  font: inherit;
  font-weight: 700;
}

.broker-model-controls select:focus-visible {
  border-color: #6847d9;
  outline: 2px solid rgb(104 71 217 / 18%);
  outline-offset: 1px;
}

#broker-model-select {
  width: 152px;
  max-width: 152px;
}

#broker-reasoning-select {
  width: 190px;
  max-width: 190px;
}

@media (max-width: 560px) {
  .thread-rename-controls,
  .thread-archive-row,
  .message-actions-buttons {
    grid-template-columns: minmax(0, 1fr);
  }

  .thread-archive-row .compact-button {
    justify-self: start;
  }
}
/* Customer settings use the existing authenticated shell/dialog, not browser-local knowledge. */
.customer-editor { display: grid; gap: 16px; }
.customer-editor label { display: grid; gap: 6px; }
.customer-editor textarea, .customer-editor input:not([type="checkbox"]) { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid var(--border, #d7d5e5); border-radius: 9px; font: inherit; }
.customer-editor textarea { resize: vertical; min-height: 130px; }
.customer-editor .customer-check-label { display: flex; align-items: center; gap: 8px; }
.customer-notification { display: flex; flex-direction: column; gap: 5px; width: 100%; text-align: left; padding: 12px; margin-bottom: 8px; border: 1px solid #dedbea; border-radius: 9px; background: white; color: inherit; cursor: pointer; }
.customer-notification small { color: #696986; }
.knowledge-actions button { flex-shrink: 0; }
.camera-preview { width: 100%; max-height: 320px; object-fit: contain; background: #111; }
.speech-preview { min-height: 1.5em; color: var(--ink-muted); }
