:root {
  color-scheme: dark;
  --bg: #090b0e;
  --bg-2: #111315;
  --panel: rgba(22, 23, 25, 0.76);
  --panel-strong: rgba(24, 25, 27, 0.92);
  --panel-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f4f7fb;
  --muted: rgba(229, 235, 242, 0.68);
  --faint: rgba(229, 235, 242, 0.42);
  --accent: #d8e8ff;
  --accent-2: #f0f4f8;
  --danger: #ffc0c0;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
  --glass-blur: blur(24px) saturate(150%);
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --viewport-safe-height: 100svh;
  --font-body: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Playfair Display", ui-serif, Georgia, "Times New Roman", serif;
  font-family: var(--font-body);
}

@supports (height: 100dvh) {
  :root {
    --viewport-safe-height: 100dvh;
  }
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  background: var(--bg);
  color: var(--text);
}

@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 100vw;
  min-height: var(--viewport-safe-height);
  overflow: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  isolation: isolate;
  touch-action: pan-y;
  background:
    radial-gradient(circle at 80% -10%, rgba(255, 255, 255, 0.07), transparent 34%),
    linear-gradient(155deg, #08090b 0%, #121416 52%, #07080a 100%);
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.34;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 76%);
}

.chat-workspace {
  position: relative;
  min-height: var(--viewport-safe-height);
  max-height: var(--viewport-safe-height);
  width: min(100%, 1040px);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left));
  overflow-x: clip;
  z-index: 1;
}

.workspace-header {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 22px;
  background: rgba(12, 13, 15, 0.74);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  will-change: transform, opacity;
  transition:
    transform var(--wm-motion-duration-standard) var(--wm-motion-ease-standard),
    opacity var(--wm-motion-duration-standard) var(--wm-motion-ease-standard),
    background-color var(--wm-motion-duration-standard) var(--wm-motion-ease-standard);
}

.header-title {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-family: var(--font-body);
  font-weight: 700;
  margin-bottom: 0;
  font-size: clamp(1.02rem, 2vw, 1.28rem);
  line-height: 1;
}

.status-strip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.86rem;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(236, 241, 246, 0.9);
  box-shadow: 0 0 18px rgba(236, 241, 246, 0.42);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  font-size: 1.2rem;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(255, 255, 255, 0.045);
}

.message-stream {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: var(--viewport-safe-height);
  overflow-y: auto;
  overflow-x: clip;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: calc(132px + env(safe-area-inset-top)) 0 calc(190px + env(safe-area-inset-bottom));
  scroll-padding-top: calc(132px + env(safe-area-inset-top));
  scroll-padding-bottom: calc(190px + env(safe-area-inset-bottom));
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.message {
  max-width: min(760px, 100%);
  min-width: 0;
  opacity: 0;
  transform: translateY(var(--wm-motion-slide-medium));
  overflow-wrap: anywhere;
  transition:
    opacity var(--wm-motion-duration-standard) var(--wm-motion-ease-enter),
    transform var(--wm-motion-duration-standard) var(--wm-motion-ease-enter);
}

.message.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.assistant-message {
  align-self: flex-start;
  padding: clamp(14px, 3vw, 22px) 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.assistant-message.intro-message {
  padding-top: clamp(4px, 2vw, 16px);
}

.assistant-message h2 {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 18px;
  font-size: clamp(2rem, 8vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.assistant-message p {
  color: var(--muted);
  font-weight: 400;
  font-size: clamp(1.05rem, 2.6vw, 1.38rem);
  line-height: 1.56;
}

.message-kicker {
  margin-bottom: 12px;
  color: var(--accent) !important;
  font-size: 0.72rem !important;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.user-message {
  align-self: flex-end;
  width: fit-content;
  max-width: min(640px, 88%);
  padding: 16px 18px;
  border: 1px solid rgba(216, 232, 255, 0.10);
  border-radius: 20px;
  background: rgba(216, 232, 255, 0.075);
  color: var(--text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.system-message {
  align-self: center;
  width: fit-content;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--faint);
  font-size: 0.84rem;
}

.render-actions,
.prompt-row {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin-top: 18px;
}

.artifact-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
  cursor: pointer;
}

.artifact-action:hover,
.artifact-action:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
}

.artifact-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  color: rgba(225, 236, 248, 0.92);
  background: transparent;
}

.artifact-action strong,
.artifact-action small {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.artifact-action strong,
.prompt-row button,
.composer-tool,
.composer-send,
.tray-item,
.recent-item strong {
  font-weight: 600;
}

.artifact-action small {
  margin-top: 4px;
  color: var(--faint);
}

.spreadsheet-picker-actions {
  gap: 8px;
}

.prompt-row {
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
}

.prompt-row button {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.026);
  color: var(--text);
  cursor: pointer;
}

.assistant-composer {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: calc(100vw - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right)));
  z-index: 4;
  padding-top: 6px;
  isolation: isolate;
  will-change: transform, opacity;
  transition:
    transform var(--wm-motion-duration-standard) var(--wm-motion-ease-standard),
    opacity var(--wm-motion-duration-standard) var(--wm-motion-ease-standard);
}

.assistant-composer::before {
  content: "";
  position: absolute;
  inset: -86px -2px -18px;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(9, 11, 14, 0), rgba(9, 11, 14, 0.86) 34%, rgba(9, 11, 14, 0.99) 100%);
}

.composer-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  min-width: 0;
  min-height: 132px;
  padding: 16px 68px 16px 16px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(18, 19, 21, 0.995), rgba(5, 6, 8, 0.992));
  backdrop-filter: blur(34px) saturate(112%);
  box-shadow:
    0 28px 96px rgba(0, 0, 0, 0.66),
    0 10px 34px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
  transition:
    transform var(--wm-motion-duration-fast) var(--wm-motion-ease-standard),
    border-color var(--wm-motion-duration-fast) var(--wm-motion-ease-standard),
    background-color var(--wm-motion-duration-fast) var(--wm-motion-ease-standard);
}

.composer-row:focus-within {
  border-color: rgba(244, 247, 251, 0.35);
  transform: translateY(-2px);
}

.source-inbox-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  width: calc(100% - 24px);
  margin: 8px auto 0;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 16px;
  background: rgba(7, 8, 10, 0.72);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(18px) saturate(115%);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    border-color var(--wm-motion-duration-fast) var(--wm-motion-ease-standard),
    transform var(--wm-motion-duration-fast) var(--wm-motion-ease-standard),
    background var(--wm-motion-duration-fast) var(--wm-motion-ease-standard);
}

.source-inbox-status:hover,
.source-inbox-status:focus-visible {
  border-color: rgba(244, 247, 251, 0.16);
  background: rgba(12, 14, 17, 0.86);
  transform: translateY(-1px);
  outline: none;
}

.source-inbox-status span {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.source-inbox-status strong {
  color: rgba(244, 247, 251, 0.86);
  font-size: 0.84rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-inbox-status small {
  grid-column: 1 / -1;
  color: rgba(229, 235, 242, 0.45);
  font-size: 0.76rem;
  line-height: 1.35;
}

.composer-row textarea {
  width: 100%;
  min-height: 82px;
  max-height: 190px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.5;
}

.composer-row textarea::placeholder {
  color: rgba(229, 235, 242, 0.34);
}

.composer-tool,
.composer-send {
  display: grid;
  place-items: center;
  border: 0;
  cursor: pointer;
}

.composer-tool {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
}

.composer-send {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(244, 247, 251, 0.9);
  color: #071018;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.3);
}

.side-tray {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  width: min(70vw, 370px);
  max-width: calc(100vw - env(safe-area-inset-right));
  max-height: var(--viewport-safe-height);
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(18, 18, 19, 0.965);
  backdrop-filter: blur(26px) saturate(120%);
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.36);
  transform: translate3d(0, 0, 0);
  clip-path: inset(0 100% 0 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  contain: layout paint;
  touch-action: pan-y;
  transition:
    clip-path var(--wm-motion-duration-standard) var(--wm-motion-ease-standard),
    opacity var(--wm-motion-duration-standard) var(--wm-motion-ease-standard),
    visibility 0s linear var(--wm-motion-duration-standard);
}

.app-shell.tray-open .side-tray {
  transform: translate3d(0, 0, 0);
  clip-path: inset(0 0 0 0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    clip-path var(--wm-motion-duration-standard) var(--wm-motion-ease-standard),
    opacity var(--wm-motion-duration-standard) var(--wm-motion-ease-standard),
    visibility 0s linear 0s;
}

.tray-scrim {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgba(0, 0, 0, 0.16);
  backdrop-filter: none;
  opacity: 0;
  pointer-events: none;
  touch-action: none;
  transition:
    opacity var(--wm-motion-duration-standard) var(--wm-motion-ease-standard),
    backdrop-filter var(--wm-motion-duration-standard) var(--wm-motion-ease-standard);
}

.app-shell.tray-open .tray-scrim {
  opacity: 1;
  pointer-events: auto;
}

.tray-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tray-top h2 {
  font-family: var(--font-body);
  font-weight: 700;
  margin: 0;
  font-size: 1.35rem;
}

.tray-nav,
.tray-section {
  display: grid;
  gap: 8px;
  padding-top: 18px;
}

.tray-nav {
  flex: 0 0 auto;
}

.tray-activity {
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.tray-activity-list {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  overflow-x: clip;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding-right: 6px;
  padding-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.tray-item,
.recent-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.tray-item {
  padding: 0 10px;
}

.tray-item.is-active,
.tray-item:hover,
.recent-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.tray-label {
  margin: 8px 0 4px;
  color: var(--faint);
  font-size: 0.78rem;
}

.recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 54px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  background: rgba(255, 255, 255, 0.014);
  overflow: hidden;
}

.recent-item strong,
.recent-item span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item span {
  margin-top: 3px;
  color: var(--faint);
  font-size: 0.74rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item strong {
  font-size: 0.86rem;
  line-height: 1.18;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: block;
  padding: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(22px) saturate(130%);
  opacity: 0;
  pointer-events: none;
  overscroll-behavior: contain;
  touch-action: pan-y;
  transition: opacity var(--wm-motion-duration-standard) var(--wm-motion-ease-standard);
}

.artifact-layer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.artifact-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: var(--viewport-safe-height);
  max-height: var(--viewport-safe-height);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 76% 2%, rgba(216, 232, 255, 0.08), transparent 34%),
    linear-gradient(155deg, rgba(10, 12, 15, 0.98), rgba(16, 19, 23, 0.98));
  box-shadow: var(--shadow);
  transform: translateY(10px);
  transition: transform var(--wm-motion-duration-standard) var(--wm-motion-ease-standard);
}

.artifact-layer.is-open .artifact-panel {
  transform: translateY(0);
}

.artifact-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: calc(18px + env(safe-area-inset-top)) clamp(20px, 4vw, 54px) 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 15, 0.72);
  backdrop-filter: var(--glass-blur);
}

.artifact-header h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.85rem);
}

.artifact-body {
  min-height: 0;
  overflow-y: auto;
  overflow-x: clip;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: 24px clamp(20px, 4vw, 54px) calc(34px + env(safe-area-inset-bottom));
}

.artifact-body > * {
  width: min(100%, 1040px);
  max-width: 100%;
  min-width: 0;
  margin-left: auto;
  margin-right: auto;
}

.artifact-panel[data-visual-contract="spreadsheet"] {
  background: #f4f7fb;
  color: #162230;
}

.artifact-panel[data-visual-contract="spreadsheet"] .artifact-header {
  border-bottom-color: rgba(22, 34, 48, 0.12);
  background: #f0f5f9;
  backdrop-filter: none;
  color: #162230;
}

.artifact-panel[data-visual-contract="spreadsheet"] .eyebrow,
.artifact-panel[data-visual-contract="spreadsheet"] .icon-button {
  color: rgba(22, 34, 48, 0.68);
}

.artifact-panel[data-visual-contract="sourceMap"] {
  background:
    linear-gradient(160deg, rgba(7, 15, 18, 0.99), rgba(14, 28, 31, 0.99));
}

.artifact-panel[data-visual-contract="receipt"] {
  background:
    linear-gradient(160deg, rgba(8, 11, 12, 0.99), rgba(13, 20, 18, 0.99));
}

.artifact-panel[data-visual-contract="checklist"] {
  background:
    linear-gradient(150deg, rgba(18, 18, 16, 0.99), rgba(29, 31, 28, 0.99));
}

.artifact-body[data-visual-contract="spreadsheet"] > * {
  width: 100%;
  max-width: none;
  height: 100%;
}

.artifact-body[data-visual-contract="spreadsheet"] {
  background: #f4f7fb;
}

.dashboard-stage {
  display: grid;
  gap: 18px;
  max-width: 100%;
  min-width: 0;
}

.dashboard-stage > *,
.dashboard-hero > * {
  max-width: 100%;
  min-width: 0;
}

.dashboard-hero,
.dashboard-panel,
.dashboard-metric {
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: clamp(20px, 4vw, 32px);
}

.dashboard-hero h3,
.dashboard-panel h4 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.02;
}

.dashboard-hero h3 {
  max-width: 780px;
  font-size: clamp(2rem, 6vw, 4.6rem);
  overflow-wrap: break-word;
}

.dashboard-hero p:not(.state-label) {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 2vw, 1.12rem);
  line-height: 1.55;
}

.dashboard-status-strip,
.spreadsheet-toolbar,
.source-trust-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.status-chip,
.answerability-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(244, 247, 251, 0.8);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-chip[data-tone="positive"],
.answerability-badge[data-answerable="true"] {
  border-color: rgba(148, 230, 190, 0.26);
  color: #9ce9c1;
}

.status-chip[data-tone="warning"] {
  border-color: rgba(244, 203, 117, 0.3);
  color: #f4cf86;
}

.status-chip[data-tone="critical"],
.answerability-badge[data-answerable="false"] {
  border-color: rgba(245, 135, 123, 0.28);
  color: #f29b90;
}

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

.dashboard-metric {
  min-height: 126px;
  padding: 16px;
}

.dashboard-metric span,
.dashboard-stack span,
.proof-card span,
.process-meta-row span,
.receipt-stamp span {
  display: block;
  color: var(--faint);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dashboard-metric strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.8rem, 5vw, 3.1rem);
  line-height: 0.9;
}

.dashboard-metric small,
.dashboard-validation-list small,
.dashboard-timeline-row small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 12px;
}

.dashboard-panel {
  min-width: 0;
  padding: 18px;
}

.dashboard-panel-wide {
  grid-row: span 2;
}

.dashboard-panel-header,
.source-list-header {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
  min-width: 0;
}

.source-list-header > * {
  min-width: 0;
}

.source-list-header .status-chip {
  max-width: 100%;
  justify-content: center;
  line-height: 1.2;
  white-space: normal;
}

.dashboard-timeline {
  display: grid;
  gap: 0;
  margin-top: 16px;
}

.dashboard-timeline-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 13px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.dashboard-timeline-row > span:first-child {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.dashboard-stack,
.dashboard-validation-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.dashboard-stack > div,
.dashboard-validation-list > div {
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.dashboard-stack strong {
  display: block;
  margin-top: 4px;
  font-size: 1.35rem;
}

.spreadsheet-shell {
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f7fafc;
  color: #182331;
  box-shadow: none;
}

.spreadsheet-shell button {
  font: inherit;
}

.spreadsheet-appbar,
.sheet-menu,
.spreadsheet-toolbar,
.spreadsheet-formula-bar,
.sheet-tab-strip,
.sheet-statusbar {
  max-width: 100%;
  min-width: 0;
  border-bottom: 1px solid rgba(24, 35, 49, 0.12);
}

.spreadsheet-appbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px 14px;
  background: #e8eef5;
}

.sheet-file {
  min-width: 0;
}

.sheet-file strong,
.sheet-file span {
  display: block;
}

.sheet-file strong {
  overflow: hidden;
  color: #101923;
  font-size: 0.98rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-file span {
  margin-top: 2px;
  overflow: hidden;
  color: rgba(24, 35, 49, 0.56);
  font-size: 0.72rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-app-actions,
.sheet-menu,
.spreadsheet-toolbar,
.sheet-tool-group,
.sheet-tab-strip,
.sheet-statusbar {
  display: flex;
  align-items: center;
}

.sheet-app-actions,
.sheet-menu,
.spreadsheet-toolbar,
.sheet-tool-group {
  gap: 6px;
}

.sheet-menu {
  min-height: 34px;
  padding: 0 10px;
  overflow-x: auto;
  background: #f9fbfd;
  scrollbar-width: none;
}

.sheet-menu::-webkit-scrollbar,
.spreadsheet-toolbar::-webkit-scrollbar,
.sheet-tab-strip::-webkit-scrollbar {
  display: none;
}

.sheet-menu button,
.spreadsheet-toolbar button,
.sheet-app-actions button,
.sheet-tab {
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: rgba(24, 35, 49, 0.72);
  font-size: 0.78rem;
  font-weight: 700;
}

.sheet-menu button {
  padding: 0 8px;
}

.spreadsheet-toolbar {
  min-height: 42px;
  gap: 10px;
  padding: 6px 10px;
  overflow-x: auto;
  background: #eef4f8;
  scrollbar-width: none;
}

.sheet-tool-group {
  flex: 0 0 auto;
  padding-right: 10px;
  border-right: 1px solid rgba(24, 35, 49, 0.12);
}

.sheet-tool-group:last-child {
  border-right: 0;
}

.spreadsheet-toolbar button,
.sheet-app-actions button {
  padding: 0 9px;
  border-color: rgba(24, 35, 49, 0.12);
  background: #fff;
  box-shadow: 0 1px 0 rgba(24, 35, 49, 0.04);
}

.spreadsheet-toolbar button:not(:disabled):hover,
.sheet-app-actions button:not(:disabled):hover {
  border-color: rgba(31, 111, 235, 0.34);
  color: #1659a0;
}

.spreadsheet-toolbar button:disabled,
.sheet-app-actions button:disabled,
.sheet-menu button:disabled,
.sheet-tab:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.spreadsheet-formula-bar {
  display: grid;
  grid-template-columns: 76px 34px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 7px 10px;
  background: #f7fafc;
}

.sheet-name-box,
.sheet-fx,
.sheet-formula-input {
  min-height: 30px;
  border: 1px solid rgba(24, 35, 49, 0.14);
  border-radius: 4px;
  background: #fff;
}

.sheet-name-box,
.sheet-fx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(24, 35, 49, 0.7);
  font-size: 0.78rem;
  font-weight: 800;
}

.sheet-fx {
  color: rgba(24, 35, 49, 0.44);
  font-style: italic;
}

.sheet-formula-input {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid rgba(24, 35, 49, 0.14);
  color: #162230;
  font: 0.82rem/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input.sheet-formula-input {
  width: 100%;
  outline: 0;
}

.sheet-feedback {
  display: grid;
  gap: 2px;
  min-height: 38px;
  align-content: center;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(24, 35, 49, 0.1);
  background: #fff;
  color: rgba(24, 35, 49, 0.68);
  font-size: 0.74rem;
  line-height: 1.25;
}

.sheet-feedback strong {
  color: #132033;
}

.sheet-feedback span,
.sheet-feedback small {
  display: block;
}

.sheet-feedback code {
  color: #185ea8;
  font: inherit;
  font-weight: 800;
}

.spreadsheet-grid {
  display: grid;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(90deg, rgba(24, 35, 49, 0.07) 1px, transparent 1px) 0 0 / 48px 100%;
  scrollbar-color: rgba(24, 35, 49, 0.25) transparent;
}

.sheet-column-header,
.spreadsheet-row {
  display: grid;
  grid-template-columns: 48px 190px 150px 132px 170px 360px 180px;
  min-width: 1230px;
}

.sheet-column-header {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 36px;
}

.sheet-corner,
.sheet-column,
.sheet-row-header,
.sheet-cell {
  min-width: 0;
  border-right: 1px solid rgba(24, 35, 49, 0.12);
  border-bottom: 1px solid rgba(24, 35, 49, 0.1);
}

.sheet-corner,
.sheet-column {
  background: #e7eef5;
}

.sheet-corner {
  position: sticky;
  left: 0;
  z-index: 7;
}

.sheet-column {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1px;
  min-height: 36px;
  color: rgba(24, 35, 49, 0.68);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sheet-column span {
  line-height: 1;
}

.sheet-column small {
  max-width: 100%;
  overflow: hidden;
  color: rgba(24, 35, 49, 0.46);
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spreadsheet-row {
  min-height: 38px;
  background: #fff;
}

.spreadsheet-row:hover .sheet-cell,
.spreadsheet-row:hover .sheet-row-header {
  background: #f6faff;
}

.sheet-row-empty .sheet-cell {
  color: transparent;
}

.sheet-row-header {
  position: sticky;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 9px;
  background: #edf3f8;
  color: rgba(24, 35, 49, 0.48);
  font-size: 0.72rem;
  font-weight: 800;
}

.sheet-cell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 9px;
  overflow: hidden;
  background: #fff;
  color: rgba(24, 35, 49, 0.78);
  font-size: 0.82rem;
  line-height: 1.35;
}

.sheet-cell[contenteditable="true"] {
  cursor: text;
  outline: 0;
}

.sheet-cell[contenteditable="true"]:focus {
  background: #fff;
}

.sheet-cell-text {
  color: #172433;
  font-weight: 800;
}

.sheet-cell-long {
  align-items: flex-start;
  padding-top: 8px;
  white-space: normal;
}

.sheet-cell span:not(.sheet-pill) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-cell.is-selected {
  z-index: 2;
  overflow: visible;
  box-shadow:
    inset 0 0 0 2px #1f6feb,
    0 0 0 1px rgba(31, 111, 235, 0.18);
}

.sheet-cell.is-selected::after {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 8px;
  height: 8px;
  border: 1px solid #fff;
  border-radius: 2px;
  background: #1f6feb;
  content: "";
}

.sheet-fill-handle {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 8px;
  height: 8px;
  border: 1px solid #fff;
  border-radius: 2px;
  background: #1f6feb;
}

.sheet-pill {
  display: inline-flex;
  max-width: 100%;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(31, 111, 235, 0.22);
  border-radius: 999px;
  background: #f3f8ff;
  color: #185ea8;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sheet-tab-strip {
  min-height: 38px;
  gap: 4px;
  padding: 0 10px;
  overflow-x: auto;
  background: #eef4f8;
  scrollbar-width: none;
}

.sheet-tab {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 0 12px;
  border-color: rgba(24, 35, 49, 0.12);
  border-bottom-color: transparent;
  border-radius: 8px 8px 0 0;
  background: #dfe8f0;
}

.sheet-tab.is-active {
  background: #fff;
  color: #102033;
}

.sheet-tab-add {
  min-width: 34px;
  padding: 0;
}

.sheet-statusbar {
  min-height: 28px;
  gap: 14px;
  padding: 0 10px;
  overflow: hidden;
  background: #f9fbfd;
  color: rgba(24, 35, 49, 0.58);
  font-size: 0.72rem;
  font-weight: 700;
}

.sheet-statusbar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-governance,
.receipt-proof,
.checklist-runner {
  display: grid;
  gap: 16px;
  max-width: 100%;
  min-width: 0;
}

.source-governance > *,
.receipt-proof > *,
.checklist-runner > *,
.source-governance-hero > *,
.receipt-proof-header > *,
.checklist-header > * {
  max-width: 100%;
  min-width: 0;
}

.source-governance-hero,
.receipt-proof-header,
.checklist-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.source-governance-hero h3,
.receipt-proof-header h3,
.checklist-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 0.98;
  overflow-wrap: break-word;
}

.source-governance-hero p:not(.state-label),
.receipt-proof-header p:not(.state-label),
.checklist-header p:not(.state-label) {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.source-governance-summary,
.receipt-stamp,
.checklist-progress {
  width: 100%;
  min-width: min(100%, 230px);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.source-governance-summary strong,
.receipt-stamp strong,
.checklist-progress strong {
  display: block;
  font-size: clamp(1.7rem, 5vw, 2.9rem);
  line-height: 1;
}

.source-governance-summary span,
.source-governance-summary small,
.receipt-stamp span,
.receipt-stamp small,
.checklist-progress span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.source-status-board,
.proof-grid,
.process-meta-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.source-status-column,
.proof-card,
.process-meta-row > div {
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.source-status-column strong,
.proof-card strong,
.process-meta-row strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 1.45rem;
}

.source-status-column small,
.proof-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ingestion-matrix,
.source-governance-list,
.validation-command-board,
.proof-timeline {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.ingestion-matrix-title h4,
.source-list-header h4,
.proof-timeline h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.ingestion-matrix-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.ingestion-matrix-grid > div {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.ingestion-matrix-grid span,
.ingestion-matrix-grid strong {
  display: block;
}

.ingestion-matrix-grid span {
  min-height: 34px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.ingestion-matrix-grid strong {
  margin-top: 8px;
  font-size: 1.2rem;
}

.source-card-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.source-governance-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.14);
}

.source-governance-card strong,
.source-governance-card span,
.source-governance-card small {
  display: block;
}

.source-governance-card span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.4;
}

.source-governance-card small {
  margin-top: 7px;
  color: var(--faint);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.receipt-proof {
  color: rgba(232, 244, 236, 0.92);
}

.receipt-proof .state-label,
.receipt-proof code {
  color: #9ce9c1;
}

.validation-command-list,
.proof-timeline > div:last-child {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.validation-command-list > div,
.proof-timeline-row {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid rgba(156, 233, 193, 0.12);
}

.validation-command-list code,
.proof-timeline-row small,
.proof-timeline-row strong {
  overflow-wrap: anywhere;
}

.validation-command-list span,
.proof-timeline-row span,
.proof-timeline-row small {
  color: rgba(232, 244, 236, 0.62);
  line-height: 1.35;
}

.checklist-runner {
  color: rgba(246, 247, 241, 0.92);
}

.process-meta-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.check-step {
  display: grid;
  grid-template-columns: 36px 24px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.check-index {
  color: var(--faint);
  font-weight: 900;
}

.check-box {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(244, 203, 117, 0.44);
  border-radius: 6px;
  background: rgba(244, 203, 117, 0.08);
}

.check-step strong,
.check-step p,
.check-step small {
  display: block;
}

.check-step p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.check-step small {
  margin-top: 7px;
  color: var(--faint);
  font-weight: 800;
}

.checklist-warning {
  display: grid;
  gap: 6px;
  padding: 15px;
  border: 1px solid rgba(244, 203, 117, 0.18);
  border-radius: 10px;
  background: rgba(244, 203, 117, 0.07);
}

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

.artifact-card {
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
}

.artifact-card strong,
.artifact-card span {
  display: block;
}

.artifact-card span {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

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

.artifact-list li {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

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

.state-panel {
  min-height: 136px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.028));
}

.state-panel-wide {
  grid-column: 1 / -1;
}

.state-label {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.state-panel h3,
.state-section h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 4vw, 2.2rem);
  line-height: 1.05;
}

.state-panel p,
.state-section p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.state-panel strong,
.state-panel span {
  display: block;
}

.state-panel strong {
  font-size: 1.02rem;
}

.state-panel span {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.state-section {
  max-width: 100%;
  min-width: 0;
  margin-top: 22px;
}

.artifact-body > .state-section:first-child {
  margin-top: 0;
}

.state-list {
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.state-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.058);
}

.state-row > * {
  max-width: 100%;
  min-width: 0;
}

.artifact-directory-row {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.artifact-directory-row:hover,
.artifact-directory-row:focus-visible {
  background: rgba(255, 255, 255, 0.04);
}

.state-row strong,
.state-row span {
  display: block;
}

.state-row strong {
  font-size: 0.98rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.state-row span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.state-meta {
  display: block;
  margin-top: 6px;
  color: var(--faint);
  font-size: 0.76rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.state-row em {
  color: var(--accent);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.document-note {
  color: var(--faint) !important;
  font-size: 0.92rem;
}

.source-inbox-actions {
  margin-top: 16px;
}

.inline-artifact-link {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 32px;
  align-items: center;
  margin-top: 10px;
  padding: 0 10px;
  border: 1px solid rgba(216, 232, 255, 0.14);
  border-radius: 8px;
  background: rgba(216, 232, 255, 0.06);
  color: rgba(244, 247, 251, 0.86);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.inline-artifact-link:hover,
.inline-artifact-link:focus-visible {
  border-color: rgba(216, 232, 255, 0.26);
  background: rgba(216, 232, 255, 0.1);
}

.storage-map {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.storage-map > div {
  padding: 13px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.storage-map > div:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.storage-map strong,
.storage-map span {
  display: block;
}

.storage-map strong {
  color: var(--text);
  font-size: 0.92rem;
}

.storage-map span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.storage-map code {
  color: rgba(244, 247, 251, 0.82);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

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

.doc-preview {
  max-height: 180px;
  margin: 12px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  color: rgba(244, 247, 251, 0.76);
  font: 0.8rem/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.html-canvas-stage {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.html-canvas-stage-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(14px, 4vw, 28px);
  align-items: end;
  margin-bottom: 18px;
}

.html-canvas-stage-top h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 4.4rem);
  font-weight: 600;
  line-height: 0.98;
}

.html-canvas-stage-top p:not(.state-label) {
  max-width: 640px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 2vw, 1.2rem);
  line-height: 1.55;
}

.renderer-status {
  min-width: min(100%, 330px);
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.renderer-status span,
.renderer-status strong,
.renderer-status small {
  display: block;
}

.renderer-status span {
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.renderer-status strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.25;
}

.renderer-status small {
  margin-top: 5px;
  color: var(--faint);
  font-size: 0.74rem;
  line-height: 1.35;
}

.renderer-status[data-renderer-mode="native"] {
  border-color: rgba(196, 255, 214, 0.16);
}

.renderer-status[data-renderer-mode="fallback"],
.renderer-status[data-renderer-mode="error"] {
  border-color: rgba(255, 226, 179, 0.18);
}

.html-canvas-frame {
  position: relative;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 28px;
  background:
    radial-gradient(circle at 82% 10%, rgba(244, 247, 251, 0.08), transparent 32%),
    linear-gradient(150deg, rgba(246, 248, 250, 0.94), rgba(229, 234, 239, 0.88));
  color: #131820;
  box-shadow:
    0 32px 110px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.html-canvas-surface {
  display: block;
  width: 100%;
  min-height: 940px;
  background: transparent;
}

.html-canvas-surface.is-native-unavailable,
.html-canvas-surface.is-native-error {
  display: none;
}

.html-canvas-fallback {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.diagnosis-document {
  width: min(100%, 840px);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 58px);
  color: #131820;
  font-family: var(--font-body);
}

.diagnosis-document-header {
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(19, 24, 32, 0.13);
}

.diagnosis-document-header p {
  margin: 0 0 10px;
  color: rgba(19, 24, 32, 0.58);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.diagnosis-document h4 {
  max-width: 720px;
  margin: 0;
  color: #0b1118;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.7rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 0.96;
}

.diagnosis-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 22px;
  color: rgba(19, 24, 32, 0.65);
  font-size: 0.78rem;
  font-weight: 700;
}

.diagnosis-status-row span {
  padding-right: 14px;
  border-right: 1px solid rgba(19, 24, 32, 0.18);
}

.diagnosis-status-row span:last-child {
  border-right: 0;
}

.diagnosis-document section {
  max-width: 100%;
  min-width: 0;
  padding: 24px 0;
  border-bottom: 1px solid rgba(19, 24, 32, 0.1);
}

.diagnosis-document h5 {
  margin: 0 0 10px;
  color: #0b1118;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.diagnosis-document p,
.diagnosis-document li,
.diagnosis-document td,
.diagnosis-document th {
  color: rgba(19, 24, 32, 0.75);
  font-size: clamp(0.98rem, 2vw, 1.08rem);
  line-height: 1.62;
}

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

.diagnosis-command-grid span {
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid rgba(19, 24, 32, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.48);
  color: rgba(19, 24, 32, 0.76);
  font-weight: 700;
}

.diagnosis-callout {
  margin-top: 18px;
  padding: 22px !important;
  border: 1px solid rgba(19, 24, 32, 0.12) !important;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.46);
}

.diagnosis-checklist {
  display: grid;
  gap: 8px;
  padding-left: 1.2rem;
}

.diagnosis-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
}

.diagnosis-table th,
.diagnosis-table td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(19, 24, 32, 0.1);
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.diagnosis-table th {
  color: rgba(19, 24, 32, 0.58);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.diagnosis-document footer {
  padding-top: 22px;
}

.diagnosis-document footer p {
  color: rgba(19, 24, 32, 0.5);
  font-size: 0.78rem;
}

.chrome-receded .workspace-header {
  transform: translateY(calc(-100% - 32px));
  opacity: 0;
  pointer-events: none;
}

.chrome-receded .assistant-composer {
  transform: translateY(calc(100% + 20px));
  opacity: 0;
  pointer-events: none;
}

@media (min-width: 1080px) {
  .chat-workspace {
    width: min(100%, 1120px);
  }

  .workspace-header,
  .assistant-composer {
    left: 92px;
    right: 92px;
  }
}

@media (max-width: 720px) {
  .chat-workspace {
    width: 100%;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  .workspace-header {
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .assistant-composer {
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
  }

  .status-strip {
    display: none;
  }

  .html-canvas-stage-top {
    grid-template-columns: minmax(0, 1fr);
  }

  .renderer-status {
    min-width: 0;
  }

  .html-canvas-frame {
    border-radius: 20px;
  }

  .diagnosis-document {
    padding: 24px 20px;
  }

  .diagnosis-command-grid {
    grid-template-columns: 1fr 1fr;
  }

  .assistant-message {
    border-radius: 24px;
  }

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

  .dashboard-hero,
  .source-governance-hero,
  .receipt-proof-header,
  .checklist-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-metric-grid,
  .dashboard-grid,
  .source-status-board,
  .proof-grid,
  .process-meta-row {
    grid-template-columns: 1fr;
  }

  .dashboard-panel-wide {
    grid-row: auto;
  }

  .dashboard-timeline-row,
  .source-governance-card,
  .validation-command-list > div,
  .proof-timeline-row,
  .check-step {
    grid-template-columns: 1fr;
  }

  .source-trust-stack,
  .dashboard-status-strip {
    align-items: flex-start;
  }

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

  .state-board {
    grid-template-columns: 1fr;
  }

  .state-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .state-row em {
    justify-self: start;
    white-space: normal;
  }

  .artifact-body[data-visual-contract="spreadsheet"] {
    padding: 0;
  }

  .spreadsheet-appbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .sheet-app-actions {
    justify-content: flex-start;
    overflow-x: auto;
  }

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

  .spreadsheet-formula-bar {
    grid-template-columns: 62px 30px minmax(260px, 1fr);
    overflow-x: auto;
  }

  .sheet-column-header,
  .spreadsheet-row {
    grid-template-columns: 44px 170px 132px 118px 152px 310px 150px;
    min-width: 1076px;
  }

  .sheet-cell,
  .sheet-row-header {
    min-height: 36px;
  }

  .sheet-statusbar {
    gap: 10px;
  }

  .artifact-panel {
    width: 100%;
    height: var(--viewport-safe-height);
    max-height: var(--viewport-safe-height);
    border-radius: 0;
  }
}
