:root {
  --app-bg: #f3f4f8;
  --panel: #ffffff;
  --panel-alt: #f8f9fc;
  --line: #d9dde8;
  --line-strong: #c6cdda;
  --text: #182033;
  --muted: #6d7587;
  --blue: #1f56d8;
  --blue-strong: #1745b7;
  --green: #4ea56b;
  --green-bg: #dcf5dd;
  --shadow: 0 18px 40px rgba(25, 34, 55, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --sans: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", "Menlo", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: auto;
  background:
    radial-gradient(circle at top left, rgba(127, 164, 245, 0.16), transparent 24%),
    linear-gradient(180deg, #eef1f7, var(--app-bg));
  color: var(--text);
  font-family: var(--sans);
}

.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto minmax(720px, 1fr);
  gap: 14px;
  padding: 14px;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.title-cluster,
.header-actions,
.sheet-toolbar,
.toolbar-group,
.field-row,
.card-head,
.column-card-top,
.column-card-actions,
.inspector-tabs,
.detail-enrichment-top,
.snapshot-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.title-cluster {
  gap: 14px;
}

.title-cluster > div {
  min-width: 0;
}

#app-header-title,
#sheet-title-chip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app-header-title {
  max-width: min(44vw, 520px);
}

#sheet-title-chip {
  max-width: min(42vw, 360px);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d2638, #354158);
  color: white;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.header-kicker,
.card-kicker,
.header-label,
.stat-label,
.cell-subtle,
.kv-key {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.cell-subtle.is-error {
  color: #a2493e;
}

.hero-copy,
.marketing-footnote {
  color: var(--muted);
  line-height: 1.5;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-account {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}

.header-account-button {
  min-width: 0;
  max-width: min(38vw, 280px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-modal {
  display: grid;
  gap: 14px;
}

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

button {
  border: 0;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.primary-button,
.ghost-button,
.status-pill,
.toolbar-chip,
.type-badge,
.citation-pill {
  border-radius: 12px;
  padding: 10px 14px;
}

.primary-button {
  background: linear-gradient(180deg, #2f67eb, var(--blue));
  color: white;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 18px rgba(31, 86, 216, 0.22);
}

.primary-button:hover {
  background: linear-gradient(180deg, #255ee3, var(--blue-strong));
}

.ghost-button {
  background: var(--panel-alt);
  color: var(--text);
  border: 1px solid var(--line);
}

.ghost-button:hover {
  background: #f0f3fa;
}

.accent-button {
  background: rgba(127, 164, 245, 0.18);
  color: #355ab0;
}

.upload-button {
  position: relative;
  overflow: hidden;
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.status-pill {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
}

.status-pill.is-good {
  border-color: #c9eac7;
  background: var(--green-bg);
  color: #2f7d49;
}

.status-pill.cost-pill.has-spend {
  border-color: rgba(127, 164, 245, 0.32);
  background: rgba(127, 164, 245, 0.12);
  color: #3559ad;
}

.status-pill.muted {
  opacity: 0.92;
}

.trial-pill.has-limit {
  border-color: rgba(127, 164, 245, 0.32);
  background: rgba(127, 164, 245, 0.12);
  color: #3559ad;
}

.workspace-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 14px;
}

.discovery-bar {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(320px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.discovery-copy {
  display: grid;
  gap: 4px;
}

.prompt-shell {
  display: block;
}

.prompt-shell input {
  height: 46px;
}

.discovery-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.marketing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.marketing-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.marketing-card-wide {
  grid-column: span 2;
}

.marketing-list,
.plan-list,
.modal-step-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--text);
  line-height: 1.45;
}

.marketing-list.ordered,
.modal-step-list {
  padding-left: 22px;
}

.prompt-library,
.plan-preview,
.modal-plan-grid,
.usage-grid {
  display: grid;
  gap: 12px;
}

.prompt-library {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.plan-preview,
.modal-plan-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.prompt-card,
.plan-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-alt);
}

.prompt-card p,
.plan-card p {
  color: var(--muted);
  line-height: 1.45;
}

.prompt-card-title,
.plan-card-title {
  font-size: 1rem;
  font-weight: 600;
}

.plan-card-price {
  font-size: 1.45rem;
  font-weight: 700;
}

.plan-card.is-featured {
  border-color: rgba(127, 164, 245, 0.45);
  background: linear-gradient(180deg, rgba(127, 164, 245, 0.12), rgba(255, 255, 255, 0.92));
}

.plan-card.is-selected {
  box-shadow: inset 0 0 0 1px rgba(127, 164, 245, 0.38);
}

.prompt-card-actions,
.plan-card-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.usage-summary-note {
  color: var(--muted);
  font-size: 0.84rem;
}

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

.sheet-pane,
.inspector {
  min-width: 0;
  min-height: 0;
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.sheet-pane {
  grid-template-rows: auto minmax(0, 1fr);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.sheet-toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: flex-start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 3;
}

.toolbar-chip {
  background: #eef2fb;
  color: #3858a2;
  font-size: 0.84rem;
}

.toolbar-actions {
  flex: 0 1 auto;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar-group {
  min-width: 0;
}

.toolbar-group:first-child {
  flex: 1 1 320px;
}

.toolbar-button {
  padding: 9px 12px;
}

.toolbar-summary {
  color: var(--muted);
  font-size: 0.88rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-surface {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(250, 251, 254, 0.8), rgba(245, 247, 252, 0.66));
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.sheet-scroll {
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: auto;
}

.sheet-grid {
  width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
}

.sheet-grid th,
.sheet-grid td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  background: white;
}

.sheet-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8f9fd;
}

.row-number-head,
.row-number {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 52px;
  min-width: 52px;
  text-align: center;
  background: #f6f8fc;
}

.sheet-row.is-selected td,
.sheet-row.is-selected .row-number {
  background: #f4f8ff;
}

.sheet-row:focus-within td,
.sheet-row:focus-within .row-number {
  background: #f4f8ff;
}

.sheet-header {
  min-width: 180px;
}

.sheet-header.is-enrichment .header-meta {
  color: #3358ab;
}

.header-label {
  margin-top: 4px;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 600;
}

.sheet-cell {
  min-width: 180px;
}

.sheet-header-editor,
.sheet-editor {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  background: transparent;
  color: var(--text);
  min-height: 34px;
}

.sheet-header-editor {
  margin-top: 4px;
  font-weight: 600;
  font-size: 0.94rem;
}

.sheet-header-editor:focus,
.sheet-editor:focus {
  outline: none;
  border-color: #99b6f7;
  background: white;
  box-shadow: 0 0 0 3px rgba(127, 164, 245, 0.18);
}

.entity-pill {
  display: inline-flex;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(127, 164, 245, 0.18);
  color: #3659a8;
  font-size: 0.72rem;
}

.sheet-cell.is-entity-cell .cell-value {
  font-weight: 600;
}

.sheet-cell.is-input-cell {
  padding: 6px;
}

.sheet-cell.is-input-cell.is-entity-cell .sheet-editor {
  font-weight: 600;
}

.entity-editor-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entity-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #edf1f7;
  color: #5f6676;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.entity-editor-input {
  flex: 1;
}

.sheet-cell.is-enrichment-cell {
  background: #fcfcfe;
}

.sheet-cell.is-enrichment-cell.is-filled .cell-value {
  color: var(--text);
}

.sheet-cell.is-enrichment-cell.is-empty .cell-value,
.empty-card,
.detail-copy {
  color: var(--muted);
}

.summary-copy {
  color: var(--text);
  line-height: 1.5;
}

.summary-copy.is-error {
  color: #9f3a2d;
}

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

.summary-mini-card {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-alt);
}

.summary-mini-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.summary-mini-card strong {
  display: block;
  margin-top: 4px;
}

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

.summary-link {
  color: #3559ad;
  text-decoration: none;
  word-break: break-word;
}

.summary-link:hover {
  text-decoration: underline;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-root.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 32, 51, 0.4);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 30px 70px rgba(15, 22, 39, 0.24);
}

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

.modal-body {
  display: grid;
  gap: 16px;
}

.modal-copy {
  color: var(--text);
  line-height: 1.55;
}

.modal-note {
  color: var(--muted);
  font-size: 0.88rem;
}

.banner-note {
  padding: 12px 14px;
  border: 1px solid rgba(127, 164, 245, 0.28);
  border-radius: 14px;
  background: rgba(127, 164, 245, 0.12);
  color: #2b4686;
  line-height: 1.5;
}

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

.detail-issue {
  padding: 10px 12px;
  border: 1px solid rgba(162, 73, 62, 0.18);
  border-radius: 12px;
  background: rgba(162, 73, 62, 0.06);
  color: #8e3f36;
  line-height: 1.45;
}

.cost-summary,
.cost-breakdown-list {
  display: grid;
  gap: 12px;
}

.cost-meta-row,
.cost-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cost-meta-row {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
}

.cost-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-alt);
}

.cost-line span {
  color: var(--muted);
  font-size: 0.84rem;
}

.cell-value {
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

.cell-subtle {
  margin-top: 8px;
}

.placeholder-copy {
  color: var(--muted);
  text-align: center;
  padding: 22px 10px;
}

.sheet-footer {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.sheet-footer-button {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 10px 14px;
  background: #fafbfe;
  color: #3559ad;
}

.sheet-footer-button:hover {
  background: #f0f4ff;
}

.sheet-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(248, 250, 254, 0.9);
  z-index: 4;
}

.sheet-empty.hidden {
  display: none;
}

.loading-state {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.loading-bar {
  width: 180px;
  height: 12px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(127, 164, 245, 0.2), rgba(127, 164, 245, 0.85), rgba(127, 164, 245, 0.2));
  background-size: 200% 100%;
  animation: loading 1.2s linear infinite;
}

.inspector {
  grid-template-rows: auto 1fr;
  position: relative;
  z-index: 4;
  overflow: hidden;
}

.inspector-tabs {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}

.tab-button {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}

.tab-button.is-active {
  background: white;
  color: var(--text);
  border-color: var(--line);
  box-shadow: 0 2px 8px rgba(25, 34, 55, 0.06);
}

.tab-panel {
  display: none;
  overflow: auto;
  padding: 14px;
}

.tab-panel.is-active {
  display: grid;
  align-content: start;
  gap: 14px;
}

.sidebar-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.card-head {
  justify-content: space-between;
  align-items: flex-start;
}

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

.stat-card {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-alt);
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 0.84rem;
}

.field-row {
  align-items: stretch;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 11px 12px;
  background: white;
  color: var(--text);
}

textarea {
  min-height: 148px;
  resize: vertical;
  line-height: 1.5;
}

#csv-input,
.column-instruction {
  font-family: var(--mono);
  font-size: 0.86rem;
}

.columns-list,
.details-view,
.enrichment-detail-list,
.citation-list,
.subpage-list,
.kv-list {
  display: grid;
  gap: 12px;
}

.column-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-alt);
}

.column-card-top {
  align-items: flex-start;
}

.column-card-top .field {
  flex: 1;
}

.column-card-actions {
  justify-content: flex-end;
}

.kv-row {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-alt);
}

.kv-value,
.detail-value {
  font-size: 0.98rem;
  line-height: 1.5;
}

.detail-link,
.subpage-card,
.citation-pill {
  text-decoration: none;
}

.detail-link {
  color: #3559ad;
  word-break: break-word;
}

.snapshot-card,
.detail-enrichment-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-alt);
}

.snapshot-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
}

.detail-enrichment-top {
  align-items: flex-start;
  justify-content: space-between;
}

.type-badge {
  background: rgba(127, 164, 245, 0.18);
  color: #3559ad;
  font-size: 0.76rem;
}

.detail-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.citation-list {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.citation-pill {
  display: block;
  border: 1px solid var(--line);
  background: white;
  color: #3559ad;
  font-size: 0.83rem;
}

.subpage-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--panel-alt);
}

.subpage-card span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

@keyframes loading {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-rows: auto auto auto auto;
  }

  .discovery-bar,
  .marketing-grid,
  .workspace-body {
    grid-template-columns: 1fr;
  }

  .sheet-pane,
  .inspector {
    min-height: 620px;
  }
}

@media (max-width: 760px) {
  .workspace-header,
  .title-cluster,
  .header-actions,
  .header-account,
  .discovery-bar,
  .discovery-actions,
  .field-row,
  .column-card-top,
  .modal-head {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    width: 100%;
  }

  .discovery-bar {
    display: grid;
  }

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

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

  .sheet-grid {
    min-width: 760px;
  }

  .marketing-card-wide {
    grid-column: auto;
  }
}

.workspace {
  grid-template-rows: auto auto minmax(720px, 1fr);
  gap: 16px;
  padding: 18px;
}

.workspace-header {
  padding: 16px 18px;
}

.header-actions {
  align-items: center;
}

.discovery-bar {
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  padding: 18px;
}

.discovery-copy {
  gap: 6px;
}

.search-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.prompt-shell input {
  height: 58px;
  padding-inline: 16px;
  font-size: 1.02rem;
}

.search-status-row,
.search-suggestion-row,
.status-stack,
.placeholder-actions,
.cell-link-row,
.summary-action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.search-suggestion-row {
  gap: 12px;
}

.search-suggestion-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.prompt-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.prompt-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: white;
  color: #3559ad;
  font-size: 0.84rem;
}

.prompt-chip:hover {
  background: #eef4ff;
  border-color: rgba(127, 164, 245, 0.45);
}

.workspace-body {
  grid-template-columns: minmax(0, 1fr) 370px;
  align-items: stretch;
}

.sheet-toolbar {
  align-items: center;
}

.toolbar-summary {
  white-space: normal;
}

.sheet-grid th,
.sheet-grid td {
  padding: 14px 16px;
}

.sheet-grid thead th {
  background: #f7f8fc;
}

.sheet-header,
.sheet-cell {
  min-width: 190px;
}

.sheet-cell.is-input-cell {
  padding: 8px;
}

.sheet-editor,
.sheet-header-editor {
  min-height: 40px;
}

.sheet-empty {
  place-items: stretch;
  padding: 24px;
  background: rgba(248, 250, 254, 0.94);
}

.empty-state-card {
  max-width: 620px;
  display: grid;
  gap: 14px;
  align-content: center;
  justify-items: flex-start;
  margin: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 12px 28px rgba(25, 34, 55, 0.08);
}

.placeholder-copy {
  display: grid;
  gap: 12px;
  justify-items: flex-start;
  padding: 32px 16px;
  text-align: left;
}

.placeholder-copy p {
  color: var(--muted);
}

.cell-link-pill {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  background: white;
  color: #3559ad;
  font-size: 0.78rem;
}

.cell-link-pill:hover {
  background: #eef4ff;
}

.inspector-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tab-button {
  min-width: 0;
}

.sidebar-card,
.sidebar-disclosure {
  padding: 16px;
}

.sidebar-disclosure {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.sidebar-disclosure summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

.sidebar-disclosure summary::-webkit-details-marker {
  display: none;
}

.disclosure-body {
  margin-top: 14px;
}

.panel-action-stack {
  display: grid;
  gap: 10px;
}

.summary-action-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--panel-alt);
  color: #3559ad;
  font-size: 0.8rem;
}

.compact-note {
  font-size: 0.9rem;
}

.column-card {
  padding: 0;
  background: var(--panel);
  overflow: hidden;
}

.column-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
  background: var(--panel-alt);
}

.column-summary::-webkit-details-marker {
  display: none;
}

.column-summary-title {
  font-size: 0.96rem;
  font-weight: 600;
}

.column-summary-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.column-card-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.column-card-top {
  padding-top: 2px;
}

.search-brief-copy {
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-rows: auto auto auto;
  }

  .workspace-body {
    grid-template-columns: 1fr;
  }

  .sheet-pane,
  .inspector {
    min-height: 620px;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 12px;
  }

  .workspace-header,
  .title-cluster,
  .header-actions,
  .search-status-row,
  .search-suggestion-row,
  .field-row,
  .column-card-top,
  .modal-head,
  .status-stack {
    flex-direction: column;
    align-items: stretch;
  }

  .search-control-row,
  .inspector-tabs {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

:root {
  --line: rgba(27, 39, 68, 0.09);
  --line-strong: rgba(27, 39, 68, 0.16);
  --shadow: 0 20px 48px rgba(25, 34, 55, 0.07);
  --radius-md: 18px;
  --radius-sm: 14px;
}

.header-actions {
  gap: 16px;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.discovery-copy h2 {
  font-size: 1.25rem;
}

.prompt-shell {
  display: grid;
  gap: 10px;
}

.prompt-label {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}

.prompt-shell textarea {
  min-height: 96px;
  padding: 16px;
  border-radius: 18px;
  resize: none;
  font-size: 1.02rem;
  line-height: 1.5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.prompt-shell textarea:focus {
  outline: none;
  border-color: #99b6f7;
  box-shadow: 0 0 0 4px rgba(127, 164, 245, 0.14);
}

.prompt-example {
  color: var(--muted);
  font-size: 0.84rem;
}

.search-control-row {
  align-items: end;
}

.search-status-row {
  justify-content: flex-start;
}

.search-status-row .status-pill {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.workspace-body {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.sheet-toolbar {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.toolbar-chip {
  padding: 8px 12px;
  border-radius: 999px;
}

.toolbar-group {
  gap: 14px;
}

.toolbar-actions {
  align-items: center;
}

.sheet-add-menu {
  position: relative;
}

.sheet-add-menu summary {
  list-style: none;
}

.sheet-add-menu summary::-webkit-details-marker {
  display: none;
}

.sheet-add-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 10;
  min-width: 148px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 16px 32px rgba(25, 34, 55, 0.12);
}

.sheet-add-action {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel-alt);
  color: var(--text);
}

.sheet-add-action:hover {
  background: #eef4ff;
}

.sheet-surface {
  background: linear-gradient(180deg, rgba(250, 251, 254, 0.92), rgba(245, 247, 252, 0.78));
}

.sheet-grid th,
.sheet-grid td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sheet-grid thead th {
  box-shadow: inset 0 -1px 0 var(--line);
}

.sheet-row.is-selected td,
.sheet-row.is-selected .row-number,
.sheet-row:focus-within td,
.sheet-row:focus-within .row-number {
  background: #f6f9ff;
}

.inspector {
  box-shadow: 0 14px 32px rgba(25, 34, 55, 0.06);
}

.sidebar-card,
.sidebar-disclosure,
.modal-card {
  border-color: var(--line);
}

.loading-state {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 14px 28px rgba(25, 34, 55, 0.06);
}

.loading-step-list {
  display: grid;
  gap: 9px;
  justify-items: flex-start;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.loading-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
}

.empty-state-card .primary-button {
  min-width: 180px;
}

@media (max-width: 760px) {
  .action-group {
    width: 100%;
  }

  .header-divider {
    display: none;
  }

  .sheet-add-menu-panel {
    left: 0;
    right: auto;
  }
}

.hidden {
  display: none !important;
}

.app-shell {
  grid-template-rows: auto minmax(0, 1fr);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  max-width: none;
  margin: 0;
  backdrop-filter: blur(18px);
}

.header-actions-home,
.header-actions-dashboard,
.header-actions-workspace {
  margin-left: auto;
}

.home-view,
.dashboard-view,
.workspace-view {
  min-height: 0;
  display: grid;
  gap: 18px;
}

.workspace-view.is-discovering .workspace-discovery-bar {
  display: none;
}

.home-view {
  width: min(100%, 880px);
  margin: 0 auto;
  align-content: start;
}

.dashboard-view {
  width: min(100%, 1180px);
  margin: 0 auto;
  align-content: start;
}

.home-hero,
.library-section {
  display: grid;
  gap: 14px;
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.dashboard-shell {
  min-height: 280px;
}

.home-hero {
  align-content: start;
  background: rgba(255, 255, 255, 0.97);
}

.home-title-block {
  display: grid;
  gap: 4px;
}

.home-hero h2 {
  font-size: 1.75rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.home-hero .hero-copy {
  max-width: none;
  font-size: 0.98rem;
}

.home-search-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfe;
}

.home-search-shell:focus-within {
  border-color: rgba(31, 86, 216, 0.26);
  box-shadow: 0 0 0 4px rgba(31, 86, 216, 0.08);
}

.home-prompt-shell textarea {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1.45;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.home-prompt-shell textarea:focus {
  box-shadow: none;
}

.hero-search-button {
  min-width: 108px;
  min-height: 48px;
  border-radius: 12px;
  padding-inline: 18px;
}

.home-example-block {
  display: grid;
  gap: 8px;
}

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

.home-template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.home-template-grid .prompt-chip {
  min-width: 0;
}

.list-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: var(--panel-alt);
  box-shadow: inset 0 0 0 1px var(--line);
}

.empty-list-card {
  min-height: 180px;
  align-content: center;
}

.list-card-top,
.list-card-actions,
.list-card-meta,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.list-card-top {
  align-items: flex-start;
}

.list-card-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86rem;
}

.list-card-query-label {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.list-card-query {
  line-height: 1.5;
}

.empty-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.recent-search-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.recent-search-chip {
  padding: 12px 14px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
}

.recent-search-chip:hover {
  background: #eef4ff;
}

.workspace-discovery-bar {
  padding: 18px;
}

.workspace-body {
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
}

.inspector-tabs {
  padding: 14px 16px 12px;
  gap: 10px;
}

.tab-button {
  padding: 13px 14px;
}

.tab-panel {
  padding: 18px;
}

.sidebar-card,
.sidebar-disclosure {
  gap: 16px;
  padding: 18px;
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 12px;
}

.summary-mini-card {
  min-width: 0;
  padding: 12px 14px;
}

.summary-link-list {
  gap: 10px;
}

.summary-link {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .home-search-shell,
  .workspace-body {
    grid-template-columns: 1fr;
  }

  .home-template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .home-hero,
  .library-section {
    padding: 20px 22px;
    border-radius: 18px;
  }

  .home-search-shell,
  .home-hero h2 {
    max-width: none;
  }

  .home-search-shell,
  .workspace-body,
  .inspector-tabs {
    grid-template-columns: 1fr;
  }

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

  .list-card-top,
  .list-card-actions,
  .list-card-meta,
  .section-head,
  .empty-list-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.app-shell.is-home {
  grid-template-rows: auto 1fr;
  gap: 0;
  padding: 0;
  background:
    radial-gradient(circle at 18% 30%, rgba(77, 120, 255, 0.62), transparent 24%),
    radial-gradient(circle at 82% 28%, rgba(92, 132, 255, 0.56), transparent 22%),
    radial-gradient(circle at 50% 76%, rgba(248, 77, 177, 0.74), transparent 32%),
    radial-gradient(circle at 50% 100%, rgba(255, 112, 47, 0.68), transparent 20%),
    linear-gradient(180deg, #090d16 0%, #12203a 24%, #4b75f7 48%, #ef56bc 82%, #ff682f 100%);
}

.app-header.is-home {
  position: relative;
  top: auto;
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 18px 24px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-header.is-home h1 {
  color: white;
}

.app-header.is-home .header-kicker,
.app-header.is-home #docs-button,
.app-header.is-home #home-pricing-button {
  display: none;
}

.app-header.is-home .brand-mark {
  background: linear-gradient(135deg, #ff8b40, #ff57bb 44%, #6481ff);
}

.app-header.is-home .ghost-button {
  background: rgba(15, 18, 28, 0.28);
  border-color: rgba(255, 255, 255, 0.16);
  color: white;
}

.app-header.is-home .ghost-button:hover {
  background: rgba(15, 18, 28, 0.44);
}

.app-header.is-home .primary-button {
  background: white;
  color: #111827;
  box-shadow: none;
}

.app-header.is-home .primary-button:hover {
  background: #f4f6fb;
  color: #111827;
}

.app-shell.is-home .home-view {
  width: 100%;
  min-height: calc(100vh - 78px);
  margin: 0;
  gap: 22px;
  padding: 8px 24px 48px;
  justify-items: center;
}

.app-shell.is-home .home-hero {
  width: min(100%, 980px);
  min-height: calc(100vh - 120px);
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px 28px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.app-shell.is-home .home-title-block {
  justify-items: center;
  gap: 0;
  margin-bottom: 20px;
}

.app-shell.is-home .home-hero h2 {
  width: max-content;
  max-width: none;
  margin: 0 auto;
  text-align: center;
  font-size: clamp(2.8rem, 6.6vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: white;
}

.app-shell.is-home .home-hero .hero-copy {
  max-width: 720px;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.78);
}

.app-shell.is-home .home-search-shell {
  width: min(100%, 800px);
  grid-template-columns: 1fr;
  gap: 0;
  padding: 20px 22px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  background: rgba(20, 22, 29, 0.92);
  box-shadow:
    0 28px 72px rgba(7, 9, 17, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.app-shell.is-home .home-search-shell:focus-within {
  border-color: rgba(130, 166, 255, 0.46);
  box-shadow:
    0 28px 72px rgba(7, 9, 17, 0.38),
    0 0 0 4px rgba(95, 132, 255, 0.12);
}

.app-shell.is-home .home-prompt-shell {
  width: 100%;
}

.app-shell.is-home .home-prompt-shell textarea {
  min-height: 116px;
  padding: 0;
  border: none;
  background: transparent;
  color: white;
  font-size: 1.12rem;
  line-height: 1.5;
}

.app-shell.is-home .home-prompt-shell textarea::placeholder {
  color: rgba(255, 255, 255, 0.56);
}

.app-shell.is-home .home-search-shell-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.app-shell.is-home .hero-search-button {
  min-width: 132px;
  min-height: 50px;
  border-radius: 999px;
  padding-inline: 20px;
  background: white;
  color: #111827;
  box-shadow: none;
}

.app-shell.is-home .hero-search-button:hover {
  background: #f4f6fb;
  color: #111827;
}

.app-shell.is-home .home-example-block {
  width: min(100%, 800px);
  justify-items: center;
  gap: 10px;
}

.app-shell.is-home .home-template-grid {
  grid-template-columns: repeat(4, max-content);
  justify-content: center;
  gap: 8px;
}

.app-shell.is-home .home-template-grid .prompt-chip {
  background: rgba(19, 24, 35, 0.24);
  border-color: rgba(255, 255, 255, 0.16);
  color: white;
  backdrop-filter: blur(10px);
}

.app-shell.is-home .home-template-grid .prompt-chip:hover {
  background: rgba(19, 24, 35, 0.4);
  border-color: rgba(255, 255, 255, 0.24);
}

.app-shell.is-home .library-section {
  width: min(100%, 1100px);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(15, 19, 28, 0.54);
  box-shadow: 0 18px 48px rgba(8, 10, 18, 0.18);
  backdrop-filter: blur(20px);
}

.app-shell.is-home .library-section h2,
.app-shell.is-home .library-section h3,
.app-shell.is-home .recent-search-chip,
.app-shell.is-home .section-head {
  color: white;
}

.app-shell.is-home .library-section .card-kicker,
.app-shell.is-home .library-section .detail-copy,
.app-shell.is-home .list-card-meta,
.app-shell.is-home .list-card-query-label {
  color: rgba(255, 255, 255, 0.68);
}

.app-shell.is-home .list-card,
.app-shell.is-home .recent-search-chip {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.app-shell.is-home .recent-search-chip:hover,
.app-shell.is-home .list-card .ghost-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.app-shell.is-home .library-section .ghost-button {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: white;
}

.app-shell.is-home .type-badge {
  background: rgba(108, 129, 255, 0.22);
  color: #e3ebff;
}

@media (max-width: 900px) {
  .app-shell.is-home .home-hero {
    min-height: auto;
    padding: 20px 18px 12px;
  }

  .app-shell.is-home .home-hero h2 {
    font-size: clamp(2.8rem, 12vw, 4rem);
  }

  .app-shell.is-home .home-search-shell,
  .app-shell.is-home .home-example-block {
    width: 100%;
  }

  .app-shell.is-home .home-search-hint {
    flex-direction: column;
    align-items: stretch;
  }

  .app-shell.is-home .hero-search-button {
    width: 100%;
  }

  .app-shell.is-home .home-template-grid {
    grid-template-columns: repeat(2, minmax(0, max-content));
  }
}

@media (max-width: 640px) {
  .app-header.is-home {
    padding: 16px;
  }

  .app-shell.is-home .home-view {
    padding: 8px 16px 28px;
  }

  .app-shell.is-home .home-search-shell {
    padding: 18px 18px 14px;
    border-radius: 24px;
  }

  .app-shell.is-home .home-template-grid {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
}

.app-shell:not(.is-home) {
  gap: 16px;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(31, 86, 216, 0.08), transparent 22%),
    linear-gradient(180deg, #eef2f8 0%, #e8edf5 100%);
}

.app-shell:not(.is-home) .app-header,
.app-shell:not(.is-home) .workspace-view {
  width: min(100%, 1600px);
  margin: 0 auto;
}

.app-shell:not(.is-home) .dashboard-view {
  width: 100%;
  margin: 0;
}

.app-shell:not(.is-home) .app-header {
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(24, 32, 51, 0.05);
}

.app-shell.is-workspace .app-header {
  padding: 10px 14px;
  min-height: 78px;
}

.app-shell:not(.is-home) .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.app-shell:not(.is-home) .title-cluster {
  gap: 12px;
}

.app-shell:not(.is-home) #app-header-title {
  max-width: min(42vw, 560px);
}

.app-shell.is-workspace .workspace-view {
  gap: 10px;
}

.workspace-header-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
}

.workspace-title-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.workspace-breadcrumb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.workspace-breadcrumb-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.workspace-breadcrumb-button:hover,
.workspace-title-trigger:hover,
.workspace-link-button:hover {
  background: transparent;
  color: var(--text);
}

.workspace-breadcrumb-current,
.workspace-title-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-title-row {
  min-width: 0;
}

.workspace-title-trigger {
  max-width: min(54vw, 760px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
}

.workspace-title-input {
  width: min(54vw, 760px);
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: white;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
}

.workspace-shell-mark {
  flex-shrink: 0;
}

.workspace-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 300px);
  gap: 12px;
  align-items: start;
}

.workspace-action-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  min-width: 0;
}

.workspace-action-panel {
  display: flex;
  justify-content: flex-end;
}

.workspace-primary-actions {
  justify-content: flex-end;
  gap: 8px;
}

.workspace-secondary-button {
  min-height: 36px;
}

.workspace-secondary-button.is-active {
  border-color: #b7cbbf;
  background: #f3f8f4;
  color: #285b4f;
}

.live-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 118px;
  padding: 8px 12px;
  border-radius: 10px;
}

.live-toggle-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.live-toggle-icon {
  color: #8f867a;
  font-size: 13px;
  line-height: 1;
}

.live-toggle-label {
  font-size: 13px;
  font-weight: 600;
}

.live-toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #d5cfc3;
}

.live-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fffdf9;
  box-shadow: 0 1px 2px rgba(18, 24, 38, 0.18);
  transition: transform 120ms ease, background 120ms ease;
}

.live-toggle-button.is-active .live-toggle-icon {
  color: #8b6a11;
}

.live-toggle-button.is-active .live-toggle-switch {
  background: #20252d;
}

.live-toggle-button.is-active .live-toggle-thumb {
  transform: translateX(14px);
  background: #ffffff;
}

.live-table-summary {
  color: #285b4f;
}

.workspace-link-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 2px 8px 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.workspace-link-icon {
  font-size: 11px;
}

.workspace-view {
  width: 100%;
  margin: 0 auto;
}

.workspace-body {
  min-height: calc(100vh - 186px);
  grid-template-columns: minmax(0, 1fr) minmax(280px, 300px);
  gap: 12px;
  align-items: stretch;
}

.sheet-pane,
.inspector {
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(24, 32, 51, 0.035);
  overflow: hidden;
}

.inspector {
  overflow: visible;
}

.sheet-pane {
  display: block;
}

.sheet-toolbar {
  padding: 10px 14px;
  background: rgba(252, 253, 255, 0.96);
}

#sheet-title-chip {
  max-width: none;
  padding: 3px 8px;
  border: 1px solid rgba(31, 86, 216, 0.12);
  background: rgba(31, 86, 216, 0.06);
  color: #2450b3;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.toolbar-summary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.sheet-surface {
  min-height: calc(100vh - 238px);
  background: rgba(255, 255, 255, 0.96);
}

.sheet-scroll {
  height: 100%;
}

.sheet-grid {
  font-size: 13px;
}

.sheet-grid th,
.sheet-grid td {
  padding: 6px 12px;
  border-right-color: transparent;
  border-bottom: 1px solid rgba(15, 23, 42, 0.045);
}

.sheet-grid thead th {
  background: rgba(249, 250, 252, 0.9);
  box-shadow: none;
}

.sheet-grid tbody tr:nth-child(even) td,
.sheet-grid tbody tr:nth-child(even) .row-number {
  background: rgba(15, 23, 42, 0.018);
}

.sheet-grid tbody .sheet-row {
  height: 40px;
}

.sheet-grid tbody td,
.sheet-grid tbody th {
  vertical-align: middle;
}

.sheet-row.is-selected td,
.sheet-row.is-selected .row-number,
.sheet-row:focus-within td,
.sheet-row:focus-within .row-number {
  background: rgba(31, 86, 216, 0.055);
}

.row-number-head,
.row-number {
  width: 38px;
  min-width: 38px;
  padding: 6px 8px;
  color: #98a2b3;
  font-size: 11px;
}

.sheet-header,
.sheet-cell {
  min-width: 164px;
}

.header-meta,
.header-label,
.sheet-header-editor {
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.header-meta {
  color: #98a2b3;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-label {
  margin-top: 2px;
  color: #475467;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sheet-header-editor,
.sheet-editor {
  min-height: 22px;
  padding: 1px 4px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.2;
}

.sheet-header-editor {
  margin-top: 2px;
  color: #667085;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.sheet-cell.is-input-cell {
  padding: 3px 6px;
}

.sheet-cell.is-enrichment-cell {
  background: transparent;
}

.sheet-grid tbody .sheet-cell,
.sheet-grid tbody .sheet-editor,
.sheet-grid tbody .cell-value {
  white-space: nowrap;
}

.sheet-grid tbody .sheet-cell {
  overflow: hidden;
}

.cell-value {
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-cell.is-entity-cell .cell-value,
.sheet-cell.is-input-cell.is-entity-cell .sheet-editor {
  font-weight: 500;
}

.cell-subtle {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.25;
}

.sheet-grid tbody .cell-subtle,
.sheet-grid tbody .cell-link-row {
  display: none;
}

.entity-pill,
.cell-link-pill {
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.2;
}

.entity-pill {
  margin-top: 6px;
  background: rgba(31, 86, 216, 0.07);
  color: #5370b7;
}

.cell-link-pill {
  border-color: rgba(15, 23, 42, 0.07);
  background: rgba(255, 255, 255, 0.9);
}

.sheet-footer {
  padding: 6px 0;
}

.sheet-footer-button {
  padding: 7px 10px;
  font-size: 12px;
}

.sheet-empty {
  place-items: stretch;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(247, 249, 253, 0.92), rgba(240, 244, 250, 0.94));
}

.empty-state-card {
  max-width: 560px;
  margin: auto;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(24, 32, 51, 0.04);
}

.sheet-loading-state {
  display: grid;
  gap: 20px;
  align-content: start;
  min-height: 100%;
}

.sheet-loading-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.loading-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf3ff;
  color: #2450b3;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sheet-loading-steps {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.sheet-loading-steps .loading-step {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.sheet-loading-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.045);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
}

.sheet-loading-row {
  display: grid;
  grid-template-columns: 32px repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sheet-loading-cell {
  height: 12px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      rgba(207, 219, 246, 0.54),
      rgba(144, 173, 243, 0.92),
      rgba(207, 219, 246, 0.54)
    );
  background-size: 220% 100%;
  animation: loading 1.2s linear infinite;
}

.sheet-loading-cell.is-row-number {
  width: 22px;
}

.sheet-loading-row.is-header .sheet-loading-cell {
  height: 18px;
  border-radius: 6px;
}

.sheet-message {
  max-width: 520px;
  display: grid;
  gap: 10px;
  align-content: center;
  margin: auto;
  padding: 22px 24px;
  border: 1px solid #e6ccd0;
  border-radius: 22px;
  background: #fff6f7;
  color: #8e3040;
}

.inspector {
  grid-template-rows: auto auto;
  align-content: start;
}

.inspector-tabs {
  padding: 7px;
  background: rgba(249, 250, 252, 0.96);
}

.tab-button {
  min-width: 0;
  padding: 8px 9px;
  font-size: 12px;
  font-weight: 600;
}

.tab-panel {
  padding: 10px;
}

.search-control-card {
  gap: 12px;
}

.search-criteria-field textarea {
  min-height: 104px;
  resize: none;
  font-size: 13px;
  line-height: 1.35;
}

.search-panel-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.inspector-suggestion-row {
  display: grid;
  gap: 10px;
}

.inspector-suggestion-row .prompt-library {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workspace-view.is-discovering .sheet-add-menu {
  display: none;
}

.inspector .sidebar-card,
.inspector .sidebar-disclosure {
  gap: 12px;
  padding: 12px;
  border-color: rgba(15, 23, 42, 0.05);
  border-radius: 14px;
}

.inspector .card-kicker,
.inspector .field span,
.inspector .summary-mini-card span,
.inspector .status-pill,
.inspector .detail-copy,
.inspector .kv-key {
  font-size: 11px;
}

.inspector h2,
.inspector h3 {
  font-size: 15px;
}

.inspector input,
.inspector select,
.inspector textarea {
  min-height: 32px;
  padding: 7px 9px;
  border-color: rgba(15, 23, 42, 0.07);
  border-radius: 10px;
  font-size: 13px;
}

.inspector .primary-button,
.inspector .ghost-button,
.inspector .status-pill {
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.prompt-chip {
  padding: 4px 8px;
  font-size: 11px;
}

.summary-mini-card,
.stat-card,
.cost-card {
  padding: 8px 10px;
  border-color: rgba(15, 23, 42, 0.045);
}

.summary-grid {
  gap: 8px;
}

.summary-mini-card strong,
.stat-card strong {
  margin-top: 2px;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .workspace-action-row,
  .workspace-body {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .workspace-action-panel {
    justify-content: flex-start;
  }

  .sheet-surface {
    min-height: 520px;
  }
}

@media (max-width: 760px) {
  .app-shell:not(.is-home) {
    padding: 12px;
  }

  .app-shell:not(.is-home) .app-header {
    padding: 14px;
    border-radius: 20px;
  }

  .workspace-header-copy,
  .workspace-breadcrumb-row,
  .workspace-action-meta,
  .workspace-primary-actions,
  .search-panel-actions {
    align-items: stretch;
  }

  .workspace-title-trigger,
  .workspace-title-input {
    width: 100%;
    max-width: 100%;
    font-size: 1.2rem;
  }

  .workspace-action-row {
    grid-template-columns: 1fr;
  }

  .workspace-action-meta,
  .workspace-primary-actions {
    flex-direction: column;
  }

  .workspace-action-panel {
    justify-content: stretch;
  }

  .workspace-link-button {
    justify-content: flex-start;
    padding-inline: 0;
  }

  .sheet-toolbar,
  .sheet-loading-head,
  .search-panel-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sheet-loading-steps {
    grid-template-columns: 1fr;
  }

  .sheet-loading-row {
    grid-template-columns: 36px repeat(3, minmax(0, 1fr));
  }

  .sheet-grid th,
  .sheet-grid td {
    padding: 7px 10px;
  }
}

:root {
  --app-bg: #f5f3ee;
  --panel: #ffffff;
  --panel-alt: #faf8f3;
  --line: #dfdbd2;
  --line-strong: #cbc4b8;
  --text: #1f2328;
  --muted: #6e695f;
  --blue: #1f2328;
  --blue-strong: #14181d;
  --green: #2f6f5f;
  --green-bg: #e7f1ec;
  --shadow: 0 2px 10px rgba(18, 24, 38, 0.05);
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

body,
.app-shell,
.app-shell.is-home,
.app-shell:not(.is-home) {
  background: var(--app-bg);
}

body {
  color: var(--text);
}

.workspace,
.app-shell.is-home,
.app-shell:not(.is-home) {
  gap: 12px;
  padding: 0 20px 20px;
}

.workspace-header,
.app-header,
.app-header.is-home,
.app-shell:not(.is-home) .app-header {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 14px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--app-bg);
  box-shadow: none;
  backdrop-filter: none;
}

.header-kicker,
.card-kicker {
  display: none;
}

.title-cluster {
  gap: 10px;
}

.brand-mark,
.app-shell.is-home .brand-mark,
.app-shell:not(.is-home) .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #1f2328;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.app-header.is-home h1 {
  color: var(--text);
}

h1 {
  font-size: 1.05rem;
  font-weight: 600;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
}

h3 {
  font-size: 0.92rem;
  font-weight: 600;
}

.primary-button,
.ghost-button,
.status-pill,
.toolbar-chip,
.type-badge,
.citation-pill,
.entity-pill,
.cell-link-pill {
  border-radius: 8px;
  box-shadow: none;
}

.primary-button {
  border: 1px solid #1f2328;
  background: #1f2328;
  color: #ffffff;
}

.primary-button:hover {
  background: #14181d;
  border-color: #14181d;
}

.ghost-button {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
}

.ghost-button:hover {
  background: var(--panel-alt);
}

.app-header.is-home .ghost-button {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}

.app-header.is-home .ghost-button:hover {
  background: var(--panel-alt);
}

.app-header.is-home .primary-button {
  border-color: #1f2328;
  background: #1f2328;
  color: #ffffff;
}

.app-header.is-home .primary-button:hover {
  background: #14181d;
  border-color: #14181d;
  color: #ffffff;
}

.status-pill,
.type-badge,
.toolbar-chip,
.entity-pill,
.citation-pill,
.cell-link-pill {
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 11px;
}

.status-pill.is-good {
  border-color: #bcd5ca;
  background: var(--green-bg);
  color: #285b4f;
}

.home-view {
  width: min(100%, 1600px);
  margin: 0 auto;
  gap: 16px;
}

.dashboard-view {
  width: 100%;
  margin: 0;
  gap: 16px;
}

.app-shell.is-home .home-view {
  width: min(100%, 1080px);
  min-height: auto;
  margin: 0 auto;
  gap: 16px;
  padding: 0;
  justify-items: stretch;
  align-content: start;
}

.dashboard-shell {
  width: 100%;
}

.list-library-grid {
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.workspace-view {
  width: min(100%, 1600px);
  margin: 0 auto;
  gap: 8px;
}

.home-hero,
.library-section,
.app-shell.is-home .home-hero,
.app-shell.is-home .library-section {
  width: 100%;
  min-height: auto;
  justify-items: stretch;
  align-content: start;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
  text-align: left;
}

.home-title-block {
  display: grid;
  gap: 8px;
  margin: 0;
}

.app-shell.is-home .home-title-block {
  justify-items: start;
  gap: 8px;
  margin: 0;
}

.home-title-block p,
.detail-copy,
.summary-copy,
.list-card-meta,
.list-card-query,
.search-suggestion-label,
.workspace-breadcrumb-row,
.toolbar-summary,
.placeholder-copy p {
  color: var(--muted);
}

.home-hero h2,
.app-shell.is-home .home-hero h2 {
  width: auto;
  max-width: none;
  margin: 0;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: left;
}

.home-search-shell,
.app-shell.is-home .home-search-shell {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-alt);
  box-shadow: none;
}

.home-search-shell:focus-within,
.app-shell.is-home .home-search-shell:focus-within {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 2px rgba(31, 35, 40, 0.06);
}

.home-prompt-shell textarea,
.app-shell.is-home .home-prompt-shell textarea {
  min-height: 88px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

.home-prompt-shell textarea::placeholder,
.app-shell.is-home .home-prompt-shell textarea::placeholder {
  color: #8b8478;
}

.home-search-shell-footer,
.app-shell.is-home .home-search-shell-footer {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  margin: 0;
}

.hero-search-button,
.app-shell.is-home .hero-search-button {
  min-width: 112px;
  min-height: 40px;
  border-radius: 8px;
  padding-inline: 16px;
  background: #1f2328;
  color: #ffffff;
}

.hero-search-button:hover,
.app-shell.is-home .hero-search-button:hover {
  background: #14181d;
  color: #ffffff;
}

.home-example-block,
.app-shell.is-home .home-example-block {
  width: 100%;
  gap: 8px;
  justify-items: stretch;
}

.home-template-grid,
.app-shell.is-home .home-template-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  justify-content: stretch;
  gap: 8px;
}

.prompt-chip,
.app-shell.is-home .home-template-grid .prompt-chip {
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  text-align: left;
}

.prompt-chip:hover,
.app-shell.is-home .home-template-grid .prompt-chip:hover {
  border-color: var(--line-strong);
  background: var(--panel-alt);
}

.app-shell.is-home .library-section h2,
.app-shell.is-home .library-section h3,
.app-shell.is-home .recent-search-chip,
.app-shell.is-home .section-head {
  color: var(--text);
}

.app-shell.is-home .library-section .detail-copy,
.app-shell.is-home .list-card-meta,
.app-shell.is-home .list-card-query-label {
  color: var(--muted);
}

.section-head,
.list-card-top,
.list-card-actions,
.list-card-meta,
.workspace-action-meta,
.card-head {
  gap: 10px;
}

.library-section,
.list-card,
.sidebar-card,
.sidebar-disclosure,
.column-card,
.summary-mini-card,
.stat-card,
.cost-card,
.snapshot-card,
.detail-enrichment-card,
.subpage-card,
.kv-row,
.empty-state-card,
.loading-state,
.sheet-loading-preview,
.sheet-loading-steps .loading-step,
.modal-card,
.sheet-message {
  border-radius: 10px;
  box-shadow: none;
}

.list-card,
.sidebar-card,
.sidebar-disclosure,
.column-card,
.summary-mini-card,
.stat-card,
.cost-card,
.snapshot-card,
.detail-enrichment-card,
.subpage-card,
.kv-row,
.empty-state-card,
.loading-state,
.sheet-loading-preview {
  border: 1px solid var(--line);
  background: var(--panel);
}

.list-card {
  gap: 12px;
  padding: 14px;
}

.list-card-interactive {
  position: relative;
  align-content: start;
  cursor: pointer;
}

.list-card-interactive:hover {
  border-color: var(--line-strong);
  background: #fcfaf6;
}

.list-card-interactive:focus-visible {
  outline: none;
  border-color: #aaa193;
  box-shadow: 0 0 0 2px rgba(31, 35, 40, 0.08);
}

.list-card-heading {
  min-width: 0;
}

.list-card-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.list-card-menu-toggle {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.list-card-menu-toggle:hover,
.list-card-menu-toggle[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

.list-card-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 8;
  min-width: 168px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(18, 24, 38, 0.08);
}

.list-card-menu-item {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.list-card-menu-item:hover {
  background: var(--panel-alt);
}

.list-card-menu-item.is-danger {
  color: #8a4350;
}

.list-card-menu-item.is-danger:hover {
  background: #fcf4f5;
}

.type-badge-live {
  border-color: #b7cbbf;
  background: #f3f8f4;
  color: #285b4f;
}

.list-card-query-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.list-card-query {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.workspace-title-stack {
  gap: 4px;
}

.workspace-breadcrumb-button,
.workspace-link-button {
  color: var(--muted);
}

.workspace-title-trigger,
.workspace-title-input {
  font-size: 1.35rem;
}

.workspace-title-input {
  padding: 4px 6px;
  border-color: var(--line);
  border-radius: 8px;
}

.workspace-action-row {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 300px);
  gap: 10px;
  align-items: end;
  position: relative;
  z-index: 2;
}

.workspace-primary-actions {
  gap: 8px;
}

.workspace-link-button {
  padding: 8px 2px;
  font-size: 12px;
  font-weight: 500;
}

.workspace-link-button:hover {
  color: var(--text);
}

.sheet-pane,
.inspector {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}

.sheet-pane {
  position: relative;
  z-index: 1;
}

.workspace-body {
  min-height: calc(100vh - 176px);
  grid-template-columns: minmax(0, 1fr) minmax(280px, 300px);
  gap: 10px;
}

.sheet-toolbar {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

#sheet-title-chip,
.toolbar-chip {
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.sheet-add-menu-panel {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(18, 24, 38, 0.08);
}

.sheet-add-action {
  border-radius: 6px;
  background: var(--panel);
}

.sheet-add-action:hover {
  background: var(--panel-alt);
}

.sheet-surface {
  min-height: calc(100vh - 226px);
  background: var(--panel);
}

.sheet-grid {
  font-size: 13px;
}

.sheet-grid th,
.sheet-grid td {
  padding: 7px 12px;
  border-right-color: transparent;
  border-bottom: 1px solid #ece7de;
  background: #ffffff;
}

.sheet-grid thead th,
.row-number-head,
.row-number {
  background: #faf8f3;
}

.sheet-grid tbody tr:nth-child(even) td,
.sheet-grid tbody tr:nth-child(even) .row-number {
  background: #ffffff;
}

.sheet-row:hover td,
.sheet-row:hover .row-number {
  background: #faf6ee;
}

.sheet-row.is-selected td,
.sheet-row.is-selected .row-number,
.sheet-row:focus-within td,
.sheet-row:focus-within .row-number {
  background: #f2ede2;
}

.row-number-head,
.row-number {
  color: #91897d;
}

.header-meta,
.header-label {
  color: #7d7568;
  letter-spacing: 0.03em;
}

.header-label {
  text-transform: none;
}

.sheet-header-editor {
  color: var(--text);
  font-weight: 600;
}

.sheet-header-editor:focus,
.sheet-editor:focus,
.prompt-shell textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #bdb5a8;
  box-shadow: 0 0 0 2px rgba(31, 35, 40, 0.08);
}

.sheet-empty {
  padding: 16px;
  background: rgba(245, 243, 238, 0.88);
}

.empty-state-card {
  max-width: 520px;
  padding: 18px;
}

.sheet-loading-state {
  gap: 16px;
}

.sheet-loading-head {
  align-items: flex-start;
}

.loading-status-pill {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.sheet-loading-steps {
  grid-template-columns: 1fr;
  gap: 8px;
}

.sheet-loading-steps .loading-step {
  padding: 10px 12px;
  border: 0;
  background: transparent;
}

.loading-step-dot {
  background: #6e695f;
}

.sheet-loading-preview {
  gap: 8px;
  padding: 10px;
}

.sheet-loading-cell {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, #ebe5d9, #d8cfc0, #ebe5d9);
}

.sheet-loading-row.is-header .sheet-loading-cell {
  height: 16px;
  border-radius: 4px;
}

.sheet-message {
  border: 1px solid #e4cfd0;
  background: #fcf4f5;
  color: #8a4350;
}

.inspector {
  grid-template-rows: auto auto;
  align-content: start;
}

.inspector-tabs {
  display: flex;
  gap: 16px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.tab-button {
  flex: 0 0 auto;
  min-width: 0;
  padding: 12px 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.tab-button.is-active {
  border-color: var(--text);
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.tab-panel {
  overflow: visible;
  padding: 8px;
}

.search-control-card {
  gap: 8px;
}

.search-brief-block {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.inspector-suggestion-row {
  gap: 6px;
}

.inspector .sidebar-card,
.inspector .sidebar-disclosure {
  gap: 10px;
  padding: 10px;
  border-color: var(--line);
  border-radius: 8px;
}

.inspector h2,
.inspector h3 {
  font-size: 14px;
  line-height: 1.3;
}

input,
select,
textarea,
.inspector input,
.inspector select,
.inspector textarea {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  box-shadow: none;
}

textarea,
.inspector textarea,
.search-criteria-field textarea {
  min-height: 84px;
  line-height: 1.4;
}

.field span,
.inspector .field span,
.inspector .summary-mini-card span,
.inspector .status-pill,
.inspector .detail-copy,
.inspector .kv-key {
  font-size: 12px;
}

.summary-mini-card,
.stat-card,
.cost-card {
  padding: 7px 9px;
  background: var(--panel-alt);
}

.summary-mini-card strong,
.stat-card strong {
  font-size: 13px;
}

.search-brief-copy {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.compact-summary-links {
  gap: 6px;
}

.details-view {
  gap: 8px;
}

.detail-disclosure {
  padding: 0;
  gap: 0;
}

.detail-disclosure summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.detail-disclosure summary span {
  color: var(--muted);
  font-size: 11px;
}

.detail-disclosure summary strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.detail-disclosure .disclosure-body {
  display: grid;
  gap: 10px;
  margin-top: 0;
  padding: 0 12px 12px;
}

.detail-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inspector .summary-link {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-link,
.detail-link,
.citation-pill,
.cell-link-pill {
  color: #4a5e57;
}

.modal-backdrop {
  background: rgba(31, 35, 40, 0.28);
  backdrop-filter: none;
}

.modal-card {
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(18, 24, 38, 0.08);
}

.create-table-modal {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
}

.create-table-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-alt);
}

.create-table-section-head {
  display: grid;
  gap: 6px;
}

.create-table-section-head h3 {
  font-size: 15px;
}

.create-table-actions {
  justify-content: flex-start;
}

.create-table-dropzone {
  display: grid;
  gap: 12px;
  align-content: start;
  justify-items: start;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.create-table-dropzone:hover,
.create-table-dropzone.is-dragover {
  border-color: #aaa193;
  background: #fcfaf6;
}

.create-table-dropzone:focus-visible {
  outline: none;
  border-color: #aaa193;
  box-shadow: 0 0 0 2px rgba(31, 35, 40, 0.08);
}

.create-table-dropzone-copy {
  display: grid;
  gap: 4px;
}

.create-table-dropzone-copy strong {
  font-size: 14px;
}

.create-table-dropzone-copy span,
.create-table-upload-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.create-table-upload-status[data-tone="error"] {
  color: #8a4350;
}

.create-table-footer {
  justify-content: flex-end;
}

.rename-table-modal {
  display: grid;
  gap: 12px;
}

.live-table-modal {
  display: grid;
  gap: 14px;
}

.live-table-switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-alt);
}

.live-table-switch-card.is-active {
  border-color: #ccc3b3;
  background: #f8f5ee;
}

.live-table-switch-copy {
  display: grid;
  gap: 6px;
}

.live-table-switch-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.live-table-switch-icon {
  color: #8b6a11;
  font-size: 14px;
  line-height: 1;
}

.live-table-switch-title strong {
  font-size: 14px;
}

.live-table-switch-track {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #d5cfc3;
}

.live-table-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fffdf9;
  box-shadow: 0 1px 2px rgba(18, 24, 38, 0.18);
}

.live-table-switch-card.is-active .live-table-switch-track {
  background: #20252d;
}

.live-table-switch-card.is-active .live-table-switch-thumb {
  transform: translateX(16px);
  background: #ffffff;
}

.live-table-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.live-table-status-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
}

.live-table-status-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.live-table-status-row span {
  color: var(--muted);
  font-size: 12px;
}

.live-table-status-row strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.live-table-actions {
  justify-content: flex-end;
}

.destructive-button {
  border-color: #8a4350;
  background: #8a4350;
}

.destructive-button:hover {
  border-color: #723746;
  background: #723746;
}

.inspector {
  border-color: #d8d1c3;
  border-radius: 10px;
  background: #fffdf9;
  box-shadow: none;
}

.inspector-tabs {
  gap: 14px;
  padding: 0 16px;
  background: transparent;
}

.tab-button {
  padding: 13px 0 11px;
  color: #746c60;
  font-size: 13px;
  font-weight: 500;
}

.tab-button.is-active {
  border-color: #1f2328;
  color: #1f2328;
  font-weight: 600;
}

.tab-panel {
  padding: 14px 16px 16px;
}

.row-panel-header {
  display: grid;
  gap: 4px;
}

.inspector .sidebar-card,
.inspector .sidebar-disclosure {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.search-control-card {
  gap: 12px;
}

.search-brief-block {
  gap: 10px;
  padding-top: 8px;
}

.rail-section-label,
.search-suggestion-label {
  color: #746c60;
  font-size: 11px;
  font-weight: 600;
}

.inspector .card-head {
  align-items: baseline;
  gap: 12px;
}

.inspector h2,
.inspector h3 {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
}

#trial-pill,
.inspector .status-pill {
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 6px;
  border-color: #ddd3c3;
  background: #f5f1e8;
  color: #655d51;
  font-size: 12px;
}

.inspector .field span,
.inspector .summary-mini-card span,
.inspector .detail-copy,
.inspector .kv-key {
  color: #746c60;
  font-size: 11px;
}

.inspector input,
.inspector select,
.inspector textarea {
  min-height: 36px;
  padding: 10px 11px;
  border-color: #d8d1c3;
  border-radius: 6px;
  background: #ffffff;
}

.search-criteria-field textarea {
  min-height: 96px;
}

.inspector .primary-button,
.inspector .ghost-button {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.inspector .primary-button {
  background: #1f2328;
  box-shadow: none;
}

.inspector .primary-button:hover {
  background: #161a1e;
}

.inspector .ghost-button {
  border-color: #d8d1c3;
  background: #ffffff;
}

.inspector .ghost-button:hover {
  background: #f8f5ef;
}

.inspector .prompt-library {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.inspector .prompt-chip {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 10px;
  border-radius: 6px;
  border-color: #d8d1c3;
  background: #ffffff;
  color: #423d34;
  font-size: 13px;
}

.inspector .prompt-chip:hover {
  border-color: #cbc1b0;
  background: #f7f3ec;
  color: #1f2328;
}

.inspector .empty-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.inspector .summary-copy,
.inspector .detail-copy {
  color: #5d564a;
  font-size: 13px;
  line-height: 1.45;
}

.row-empty-state {
  padding: 4px 0 0;
  color: #746c60;
}

.row-detail-section + .row-detail-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e5ded1;
}

.row-detail-list {
  gap: 0;
}

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

.simple-link-row {
  color: #3f4c45;
  text-decoration: none;
}

.simple-link-row:hover {
  color: #1f2328;
  text-decoration: underline;
}

.inspector .summary-grid,
.inspector .stat-grid {
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid #e5ded1;
}

.inspector .summary-mini-card,
.inspector .stat-card,
.inspector .cost-card {
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid #e5ded1;
  border-radius: 0;
  background: transparent;
}

.inspector .summary-mini-card strong,
.inspector .stat-card strong {
  margin-top: 2px;
  font-size: 13px;
}

.inspector .cost-summary,
.inspector .cost-breakdown-list,
.inspector .kv-list,
.inspector .citation-list,
.inspector .subpage-list,
.inspector .enrichment-detail-list {
  gap: 0;
}

.inspector .cost-meta-row,
.inspector .cost-line {
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e5ded1;
}

.inspector .banner-note {
  padding: 10px 0 0;
  border: 0;
  border-top: 1px solid #e5ded1;
  border-radius: 0;
  background: transparent;
  color: #746c60;
}

.inspector .kv-row,
.inspector .snapshot-card,
.inspector .detail-enrichment-card,
.inspector .subpage-card {
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid #e5ded1;
  border-radius: 0;
  background: transparent;
}

.inspector .type-badge {
  padding: 3px 6px;
  border-radius: 6px;
  background: #f5f1e8;
  color: #655d51;
  font-size: 10px;
}

.inspector .summary-link,
.inspector .detail-link,
.inspector .citation-pill {
  color: #3f4c45;
}

.inspector .citation-pill {
  padding: 7px 10px;
  border-radius: 6px;
  border-color: #d8d1c3;
  background: #ffffff;
}

.inspector .citation-pill:hover,
.inspector .detail-link:hover,
.inspector .summary-link:hover {
  background: transparent;
  color: #1f2328;
}

@media (max-width: 1180px) {
  .workspace {
    padding-inline: 16px;
  }

  .home-search-shell,
  .workspace-action-row,
  .workspace-body {
    grid-template-columns: 1fr;
  }

  .workspace-action-panel {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 0 12px 12px;
  }

  .workspace-header,
  .app-header,
  .app-header.is-home,
  .app-shell:not(.is-home) .app-header {
    padding: 12px 0 10px;
  }

  .home-hero,
  .library-section,
  .app-shell.is-home .home-hero,
  .app-shell.is-home .library-section {
    padding: 16px;
  }

  .home-template-grid,
  .app-shell.is-home .home-template-grid {
    grid-template-columns: 1fr;
  }

  .create-table-modal {
    grid-template-columns: 1fr;
  }

  .live-table-settings-grid {
    grid-template-columns: 1fr;
  }

  .live-table-switch-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-header-copy,
  .workspace-breadcrumb-row,
  .workspace-action-meta,
  .workspace-primary-actions,
  .search-panel-actions {
    align-items: stretch;
  }

  .workspace-action-meta,
  .workspace-primary-actions {
    flex-direction: column;
  }

  .home-search-shell,
  .app-shell.is-home .home-search-shell {
    grid-template-columns: 1fr;
  }

  .workspace-title-trigger,
  .workspace-title-input {
    width: 100%;
    max-width: 100%;
    font-size: 1.15rem;
  }

  .workspace-link-button {
    justify-content: flex-start;
    padding-inline: 0;
  }

  .inspector-tabs {
    gap: 12px;
    overflow-x: auto;
  }

  .sheet-surface {
    min-height: 440px;
  }
}

.embed-action-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
}

.embed-send-button {
  min-height: 36px;
}

.embed-status {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

.embed-status[data-tone="working"] {
  color: #355ab0;
}

.embed-status[data-tone="success"] {
  color: #285b4f;
}

.embed-status[data-tone="error"] {
  color: #a2493e;
}

body.embed-mode #save-workspace,
body.embed-mode #export-button {
  display: none;
}

body.embed-mode .workspace {
  padding: 0;
}

body.embed-mode .workspace-header {
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0 0 18px 18px;
}

body.embed-mode .home-view,
body.embed-mode .dashboard-view,
body.embed-mode .workspace-view {
  width: 100%;
}

body.embed-mode .home-hero,
body.embed-mode .library-section {
  border-radius: 18px 18px 0 0;
}

body.embed-surface-mode {
  background: transparent;
  --shadow: none;
  --embed-head-bg: color-mix(in oklab, var(--panel-alt) 82%, var(--panel) 18%);
  --embed-index-bg: color-mix(in oklab, var(--panel-alt) 52%, var(--panel) 48%);
  --embed-row-alt: color-mix(in oklab, var(--panel-alt) 34%, var(--panel) 66%);
  --embed-row-hover: color-mix(in oklab, var(--surface-hover, var(--panel-alt)) 58%, var(--panel) 42%);
  --embed-row-selected: color-mix(in oklab, var(--accent-soft, var(--panel-alt)) 70%, var(--panel) 30%);
  --embed-focus: color-mix(in oklab, var(--blue) 34%, transparent);
  --embed-avatar-bg: color-mix(in oklab, var(--accent-soft, var(--panel-alt)) 72%, var(--panel) 28%);
  --embed-avatar-text: color-mix(in oklab, var(--text) 72%, var(--muted) 28%);
}

body.embed-surface-mode[data-embed-theme="dark"] {
  color-scheme: dark;
}

body.embed-surface-mode:not([data-embed-theme="dark"]) {
  color-scheme: light;
}

body.embed-surface-mode .workspace {
  min-height: 0;
  padding: 0;
  gap: 0;
}

body.embed-surface-mode .workspace-header,
body.embed-surface-mode .workspace-action-row,
body.embed-surface-mode .inspector-tabs,
body.embed-surface-mode .search-panel-actions {
  display: none !important;
}

body.embed-surface-mode .workspace-view {
  width: 100%;
  margin: 0;
}

body.embed-surface-mode .workspace-body {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

body.embed-surface-mode .sheet-pane,
body.embed-surface-mode .inspector {
  border: 0;
  border-radius: 0;
  background: var(--panel);
  box-shadow: none;
}

body.embed-surface-mode .inspector {
  display: none;
}

body.embed-surface-mode .sheet-pane {
  border-right: 0;
}

body.embed-surface-mode .sheet-surface,
body.embed-surface-mode .sheet-scroll,
body.embed-surface-mode .sheet-empty {
  background: var(--panel);
}

body.embed-surface-mode .sheet-grid thead th {
  background: var(--embed-head-bg);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

body.embed-surface-mode .sheet-grid td,
body.embed-surface-mode .sheet-grid th,
body.embed-surface-mode .sheet-grid tr {
  border-color: var(--line);
}

body.embed-surface-mode .sheet-grid td,
body.embed-surface-mode .sheet-grid .sheet-cell,
body.embed-surface-mode .sheet-grid .sheet-header {
  color: var(--text);
  background: var(--panel);
}

body.embed-surface-mode .sheet-grid th,
body.embed-surface-mode .sheet-grid td {
  padding: 12px 14px;
}

body.embed-surface-mode .row-number-head,
body.embed-surface-mode .row-number {
  background: var(--embed-index-bg);
  color: var(--muted);
}

body.embed-surface-mode .sheet-grid tbody tr:nth-child(even) td,
body.embed-surface-mode .sheet-grid tbody tr:nth-child(even) .row-number {
  background: var(--embed-row-alt);
}

body.embed-surface-mode .sheet-grid tbody .sheet-row:hover td,
body.embed-surface-mode .sheet-grid tbody .sheet-row:hover .row-number {
  background: var(--embed-row-hover);
}

body.embed-surface-mode .sheet-row.is-selected td,
body.embed-surface-mode .sheet-row.is-selected .row-number,
body.embed-surface-mode .sheet-row:focus-within td,
body.embed-surface-mode .sheet-row:focus-within .row-number {
  background: var(--embed-row-selected);
}

body.embed-surface-mode .header-meta,
body.embed-surface-mode .entity-pill {
  display: none;
}

body.embed-surface-mode .header-label {
  margin-top: 0;
  font-size: 0.86rem;
  font-weight: 600;
}

body.embed-surface-mode .sheet-header {
  min-width: 190px;
}

body.embed-surface-mode .sheet-cell {
  min-width: 190px;
}

body.embed-surface-mode .sheet-cell.is-input-cell {
  padding: 10px 14px;
}

body.embed-surface-mode .sheet-cell.is-enrichment-cell {
  background: var(--panel);
}

body.embed-surface-mode .cell-subtle,
body.embed-surface-mode .cell-link-row {
  display: none;
}

body.embed-surface-mode .sheet-editor,
body.embed-surface-mode .sheet-header-editor {
  padding: 4px 0;
  min-height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.embed-surface-mode .sheet-editor,
body.embed-surface-mode .sheet-header-editor,
body.embed-surface-mode input,
body.embed-surface-mode select,
body.embed-surface-mode textarea {
  border-color: var(--line);
  background: var(--panel-alt);
  color: var(--text);
}

body.embed-surface-mode .sheet-editor:focus,
body.embed-surface-mode .sheet-header-editor:focus {
  background: transparent;
  box-shadow: inset 0 -2px 0 var(--embed-focus);
}

body.embed-surface-mode .empty-state-card,
body.embed-surface-mode .column-card,
body.embed-surface-mode .snapshot-card,
body.embed-surface-mode .detail-enrichment-card,
body.embed-surface-mode .subpage-card,
body.embed-surface-mode .kv-row,
body.embed-surface-mode .citation-pill,
body.embed-surface-mode .cell-link-pill {
  border-color: var(--line);
  background: var(--panel-alt);
  color: var(--text);
  box-shadow: none;
}

body.embed-surface-mode .placeholder-copy p,
body.embed-surface-mode .summary-copy,
body.embed-surface-mode .detail-copy,
body.embed-surface-mode .field span,
body.embed-surface-mode .kv-key,
body.embed-surface-mode .snapshot-meta,
body.embed-surface-mode .search-suggestion-label {
  color: var(--muted);
}

body.embed-surface-mode .inspector .sidebar-card,
body.embed-surface-mode .inspector .sidebar-disclosure {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

body.embed-surface-mode .inspector .ghost-button,
body.embed-surface-mode .prompt-chip {
  border-color: var(--line);
  background: var(--panel-alt);
  color: var(--text);
}

body.embed-surface-mode .sheet-loading-state.is-quiet {
  gap: 0;
}

body.embed-surface-mode .sheet-loading-state.is-quiet .sheet-loading-preview {
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.embed-surface-mode .placeholder-copy.is-quiet {
  padding: 20px 0;
}

body.embed-surface-mode .placeholder-copy.is-quiet strong {
  display: none;
}

body.embed-surface-mode .placeholder-copy.is-quiet p {
  margin: 0;
}

body.embed-surface-mode .inspector .ghost-button:hover,
body.embed-surface-mode .prompt-chip:hover,
body.embed-surface-mode .cell-link-pill:hover,
body.embed-surface-mode .citation-pill:hover,
body.embed-surface-mode .detail-link:hover,
body.embed-surface-mode .summary-link:hover {
  background: var(--surface-hover, var(--panel-alt));
}

body.embed-surface-mode .inspector .primary-button {
  background: var(--blue);
  color: var(--accent-foreground, var(--panel));
}

body.embed-surface-mode .inspector .primary-button:hover {
  background: var(--blue-strong);
}

body.embed-surface-mode .live-table-summary,
body.embed-surface-mode .embed-status[data-tone="success"] {
  color: var(--green);
}

body.embed-surface-mode .embed-status[data-tone="working"] {
  color: var(--blue);
}

body.embed-surface-mode .embed-status[data-tone="error"] {
  color: var(--danger, #ff9c92);
}

body.embed-surface-mode .inspector {
  padding: 0;
}

body.embed-surface-mode .inspector .sidebar-card,
body.embed-surface-mode .inspector .sidebar-disclosure {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 18px 18px 16px;
}

body.embed-surface-mode .inspector h2,
body.embed-surface-mode .inspector h3 {
  font-size: 0.9rem;
  font-weight: 600;
}

body.embed-surface-mode .inspector input,
body.embed-surface-mode .inspector select,
body.embed-surface-mode .inspector textarea {
  border-radius: 10px;
}

body.embed-surface-mode .entity-avatar {
  background: var(--embed-avatar-bg);
  color: var(--embed-avatar-text);
}

@media (max-width: 760px) {
  .embed-action-group {
    align-items: stretch;
  }

  .embed-status {
    max-width: none;
    text-align: left;
  }

  body.embed-surface-mode .workspace-body {
    grid-template-columns: 1fr;
  }
}

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.site-footer-copy {
  display: grid;
  gap: 6px;
  max-width: 480px;
}

.site-footer-copy strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.site-footer-copy p {
  color: var(--muted);
  line-height: 1.5;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.site-footer-links a,
.legal-nav a,
.legal-home-link {
  color: var(--text);
  text-decoration: none;
}

.site-footer-links a:hover,
.legal-nav a:hover,
.legal-home-link:hover {
  text-decoration: underline;
}

.legal-body {
  min-height: 100vh;
}

.legal-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 18px;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.legal-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #1d2638;
  color: white;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
}

.legal-page {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  display: grid;
  gap: 24px;
}

.legal-page header,
.legal-section,
.contact-grid {
  display: grid;
  gap: 12px;
}

.legal-page header p,
.legal-section p,
.legal-section li,
.contact-card p,
.contact-card li {
  color: var(--muted);
  line-height: 1.6;
}

.legal-page ul,
.contact-card ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.contact-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.contact-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-alt);
}

.legal-note {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f4f6fb;
  color: var(--muted);
}

@media (max-width: 760px) {
  .site-footer,
  .legal-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer-links {
    justify-content: flex-start;
  }
}
