:root {
  --surface-base: #0A0B0E;
  --surface-surface: #12141A;
  --surface-elevated: #1B1E27;
  --border-hairline: rgba(240, 242, 245, 0.14);
  --border-subtle: rgba(240, 242, 245, 0.07);
  --glow-ambient: radial-gradient(600px 220px at 50% 0%, rgba(43, 99, 230, 0.10), transparent 70%);
  --ink-primary: #F0F2F5;
  --ink-secondary: #A6ABB8;
  --signal-action-fill: #2B63E6;
  --signal-action-text: #5B8DEF;
  --signal-alert: #E0705F;
  --status-pass-text: #5FBF8A;
  --status-pass-fill: rgba(95, 191, 138, 0.12);
  --status-warn-text: #D9A441;
  --status-warn-fill: rgba(217, 164, 65, 0.12);
  --status-fail-text: #E0705F;
  --status-fail-fill: rgba(224, 112, 95, 0.12);
  --status-unknown-text: #A6ABB8;
  --status-unknown-fill: rgba(166, 171, 184, 0.12);
  --segment-pass: rgba(95, 191, 138, 0.30);
  --segment-warn: rgba(217, 164, 65, 0.30);
  --segment-fail: rgba(224, 112, 95, 0.30);
  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-flagship: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

[data-theme="light"] {
  --surface-base: #E9EBEE;
  --surface-surface: #F7F8FA;
  --surface-elevated: #FFFFFF;
  --border-hairline: rgba(20, 20, 20, 0.14);
  --border-subtle: rgba(20, 20, 20, 0.07);
  --glow-ambient: radial-gradient(600px 220px at 50% 0%, rgba(0, 85, 255, 0.06), transparent 70%);
  --ink-primary: #141414;
  --ink-secondary: #595959;
  --signal-action-fill: #0055FF;
  --signal-action-text: #0047D6;
  --signal-alert: #B3261E;
  --status-pass-text: #1E7A4C;
  --status-pass-fill: rgba(30, 122, 76, 0.08);
  --status-warn-text: #8A6100;
  --status-warn-fill: rgba(138, 97, 0, 0.08);
  --status-fail-text: #B3261E;
  --status-fail-fill: rgba(179, 38, 30, 0.08);
  --status-unknown-text: #595959;
  --status-unknown-fill: rgba(89, 89, 89, 0.08);
  --segment-pass: rgba(30, 122, 76, 0.30);
  --segment-warn: rgba(138, 97, 0, 0.30);
  --segment-fail: rgba(179, 38, 30, 0.30);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* The hidden attribute must win over author display rules. Without this,
   author display declarations on .skeleton-group, .row-footer, .show-more
   and .no-source override the UA [hidden] styling, so skeletons, row
   footers, Show more buttons and the "No source" fallback stay visible
   when they must be hidden. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  background-color: var(--surface-base);
  color: var(--ink-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 180ms var(--ease-flagship), color 180ms var(--ease-flagship);
}

/* Theme change fades color only, 180 ms, on the main surfaces. */
.app-header,
.control-card,
.inspector-group,
.limits-block,
.about-section,
.page-footer {
  transition: background-color 180ms var(--ease-flagship), color 180ms var(--ease-flagship);
}

::selection {
  background-color: var(--signal-action-text);
  color: #FFFFFF;
}

h1, h2, h3, .verdict-word {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

button {
  font-family: var(--font-ui);
  cursor: pointer;
  transition: transform 160ms var(--ease-out), opacity 180ms var(--ease-flagship), background-color 180ms var(--ease-flagship), border-color 180ms var(--ease-flagship), color 180ms var(--ease-flagship);
}

button:active {
  transform: scale(0.97);
}

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

:focus-visible {
  outline: 2px solid var(--signal-action-text);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

/* Header */

.app-header {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 16px auto;
  background-color: var(--surface-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  padding: 12px 16px;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  order: 1;
  min-width: 0;
}

.brand-mark {
  color: var(--signal-action-text);
  flex-shrink: 0;
}

.brand-name {
  font-size: 20px;
  line-height: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-tagline {
  order: 3;
  flex: 1 1 140px;
  min-width: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.health-badge {
  order: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  background-color: var(--surface-surface);
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: var(--status-unknown-text);
}

.health-badge[data-state="healthy"] .health-dot {
  background-color: var(--status-pass-text);
}

.health-badge[data-state="healthy"] .health-text {
  color: var(--status-pass-text);
}

.health-badge[data-state="degraded"] .health-dot {
  background-color: var(--status-warn-text);
}

.health-badge[data-state="degraded"] .health-text {
  color: var(--status-warn-text);
}

.health-badge[data-state="unreachable"] .health-dot {
  background-color: var(--status-fail-text);
}

.health-badge[data-state="unreachable"] .health-text {
  color: var(--status-fail-text);
}

.health-badge[data-state="checking"] .health-dot {
  animation: dot-pulse 1200ms var(--ease-in-out) infinite;
}

.health-badge[data-state="checking"] .health-text {
  color: var(--status-unknown-text);
}

@keyframes dot-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

#theme-toggle {
  order: 2;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--surface-surface);
  color: var(--ink-primary);
  border: 1px solid var(--border-hairline);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
  min-height: 44px;
  min-width: 44px;
  flex-shrink: 0;
}

.theme-icon {
  flex-shrink: 0;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

/* Workspace grid */

.workspace {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "controls"
    "verdict"
    "inspector"
    "limits"
    "about";
  gap: 16px;
  flex: 1;
}

/* Grid items must be allowed to shrink below their min-content size.
   Without min-width 0, the 1fr track resolves to minmax(auto, 1fr) and
   the widest min-content descendant (an inspector row footer with a
   no-break source host plus timestamp) stretches the single-column
   track past the viewport at 360px, which made the whole page 449px
   wide after a run. The shrink chain inside rows already carries
   min-width 0 plus ellipsis on the source host. */
.workspace > * {
  min-width: 0;
}

/* Control card */

.control-card {
  grid-area: controls;
  background-color: var(--surface-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
}

.field-label {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--ink-primary);
}

.input-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#program-url {
  width: 100%;
  background-color: var(--surface-base);
  border: 1px solid var(--border-hairline);
  color: var(--ink-primary);
  padding: 12px 14px;
  border-radius: 10px;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 20px;
  min-height: 44px;
  transition: border-color 180ms var(--ease-flagship), background-color 180ms var(--ease-flagship), color 180ms var(--ease-flagship);
}

#program-url:focus {
  border-color: var(--signal-action-text);
}

#program-url.error {
  border: 1px solid var(--signal-alert);
}

#program-url.valid {
  border: 1px solid var(--status-pass-text);
}

#program-url:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.field-message {
  font-size: 13px;
  line-height: 18px;
  min-height: 18px;
  color: var(--ink-secondary);
}

.field-message.error {
  color: var(--signal-alert);
}

.field-message.valid {
  color: var(--status-pass-text);
}

#verify-btn {
  background-color: var(--signal-action-fill);
  color: #FFFFFF;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  min-height: 44px;
}

.duration-note {
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-secondary);
}

.examples-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.examples-label {
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-secondary);
}

.example-chip {
  background-color: var(--surface-base);
  color: var(--ink-primary);
  border: 1px solid var(--border-hairline);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.run-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

#status-line {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
  overflow-wrap: break-word;
}

.run-feed {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.run-feed li {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
  overflow-wrap: break-word;
}

.error-banner {
  background-color: var(--status-fail-fill);
  border: 1px solid var(--signal-alert);
  padding: 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--signal-alert);
}

#retry-btn {
  align-self: flex-start;
  background-color: var(--signal-alert);
  color: #FFFFFF;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  min-height: 44px;
}

/* Verdict area */

.verdict-area {
  grid-area: verdict;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.verdict-stamp {
  background-color: var(--surface-elevated);
  background-image: var(--glow-ambient);
  background-repeat: no-repeat;
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 200ms var(--ease-flagship), opacity 200ms var(--ease-out), background-color 180ms var(--ease-flagship), color 180ms var(--ease-flagship);
}

.verdict-stamp.verdict-flash {
  opacity: 0.6;
}

#verdict-stamp[data-verdict="GRIND"] {
  border: 2px solid var(--status-pass-text);
}

#verdict-stamp[data-verdict="GRIND"] .verdict-word {
  color: var(--status-pass-text);
}

#verdict-stamp[data-verdict="CAUTION"] {
  border: 2px solid var(--status-warn-text);
}

#verdict-stamp[data-verdict="CAUTION"] .verdict-word {
  color: var(--status-warn-text);
}

#verdict-stamp[data-verdict="SKIP"] {
  border: 2px solid var(--status-fail-text);
}

#verdict-stamp[data-verdict="SKIP"] .verdict-word {
  color: var(--status-fail-text);
}

.stamp-label {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.stamp-content {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.verdict-word {
  font-size: 28px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

.score-display {
  font-family: var(--font-mono);
  font-size: 24px;
  line-height: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
  white-space: nowrap;
}

.verdict-meaning {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-secondary);
}

.threshold-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.threshold-placeholder {
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-secondary);
}

.threshold-track {
  position: relative;
  margin-top: 10px;
}

.threshold-segments {
  display: flex;
  gap: 2px;
  height: 8px;
}

.threshold-segment {
  display: block;
  height: 8px;
  border-radius: 4px;
}

.segment-skip {
  flex: 0 0 calc(34% - 1.36px);
  background-color: var(--segment-fail);
  border: 1px solid var(--status-fail-text);
}

.segment-caution {
  flex: 0 0 calc(33% - 1.32px);
  background-color: var(--segment-warn);
  border: 1px solid var(--status-warn-text);
}

.segment-grind {
  flex: 0 0 calc(33% - 1.32px);
  background-color: var(--segment-pass);
  border: 1px solid var(--status-pass-text);
}

.threshold-marker {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 12px;
  background-color: var(--ink-primary);
  transform: translateX(-50%);
}

.threshold-marker::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-primary);
}

.threshold-labels {
  display: flex;
  gap: 4px;
}

.threshold-label {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
}

.label-skip {
  flex: 0 0 calc(34% - 2.72px);
  text-align: left;
}

.label-caution {
  flex: 0 0 calc(33% - 2.64px);
  text-align: center;
}

.label-grind {
  flex: 0 0 calc(33% - 2.64px);
  text-align: right;
}

.ai-note {
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-secondary);
  overflow-wrap: break-word;
}

/* Rendered AI explanation (allowlisted Markdown, see markdown.js). */
.ai-note p {
  margin: 0 0 8px;
}

.ai-note p:last-child {
  margin-bottom: 0;
}

.ai-note ul,
.ai-note ol {
  margin: 0 0 8px 20px;
}

.ai-note li {
  margin-bottom: 2px;
}

.ai-note code {
  font-family: var(--font-mono);
  font-size: 12px;
  background-color: var(--surface-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 4px;
}

.ai-note pre {
  margin: 0 0 8px;
  padding: 10px 12px;
  background-color: var(--surface-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow-x: auto;
}

.ai-note pre code {
  background: none;
  border: none;
  padding: 0;
}

.ai-note a {
  color: var(--signal-action-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: break-word;
}

.ai-note table {
  display: block;
  margin: 0 0 8px;
  border-collapse: collapse;
  overflow-x: auto;
  max-width: 100%;
}

.ai-note th,
.ai-note td {
  padding: 6px 10px;
  border: 1px solid var(--border-hairline);
  text-align: left;
  vertical-align: top;
}

.ai-note th {
  color: var(--ink-primary);
  background-color: var(--surface-surface);
}

.ai-attribution {
  font-size: 12px;
  line-height: 16px;
  color: var(--ink-secondary);
  overflow-wrap: break-word;
}

.empty-state {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-secondary);
}

/* Inspector */

.inspector {
  grid-area: inspector;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inspector-group {
  background-color: var(--surface-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  padding: 20px;
  min-width: 0;
}

.group-title {
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.group-line {
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-secondary);
  margin-top: 4px;
}

.group-rows {
  margin-top: 8px;
}

.inspector-row {
  padding: 16px 0;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

.inspector-row:first-child {
  border-top: none;
}

.inspector-row.row-entering {
  opacity: 0;
  transform: translateY(4px);
}

.row-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pill[data-status="pass"] {
  color: var(--status-pass-text);
  background-color: var(--status-pass-fill);
}

.status-pill[data-status="pass"] .pill-dot {
  background-color: var(--status-pass-text);
}

.status-pill[data-status="warn"] {
  color: var(--status-warn-text);
  background-color: var(--status-warn-fill);
}

.status-pill[data-status="warn"] .pill-dot {
  background-color: var(--status-warn-text);
}

.status-pill[data-status="fail"] {
  color: var(--status-fail-text);
  background-color: var(--status-fail-fill);
}

.status-pill[data-status="fail"] .pill-dot {
  background-color: var(--status-fail-text);
}

.status-pill[data-status="unknown"],
.status-pill[data-status="queued"] {
  color: var(--status-unknown-text);
  background-color: var(--status-unknown-fill);
}

.status-pill[data-status="unknown"] .pill-dot,
.status-pill[data-status="queued"] .pill-dot {
  background-color: var(--status-unknown-text);
}

.row-title {
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

.show-more {
  background: none;
  border: none;
  padding: 0 4px;
  color: var(--signal-action-text);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.row-evidence {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-secondary);
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: opacity 200ms var(--ease-out);
}

.row-evidence.expanded {
  display: block;
}

.row-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

.evidence-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--signal-action-text);
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

.link-host {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.no-source {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--ink-secondary);
  flex: 1;
  min-width: 0;
}

.row-time {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.skeleton-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}

/* Skeleton rows reuse the inspector row layout, with grey blocks standing
   in for the pill, title, evidence, and footer, so a skeleton row is the
   same height as a result row by construction. Block heights come from the
   matching real content: pill 20px, title 22px, evidence two lines 40px,
   source link 44px, timestamp 16px. */
.skeleton-row {
  opacity: 0.55;
  animation: skeleton-pulse 1200ms var(--ease-in-out) infinite;
}

.skeleton-block {
  display: block;
  background-color: var(--border-hairline);
  border-radius: 4px;
}

.skeleton-pill {
  width: 72px;
  height: 20px;
  border-radius: 999px;
  flex-shrink: 0;
}

.skeleton-title {
  flex: 1;
  height: 22px;
  min-width: 0;
}

.skeleton-evidence {
  height: 40px;
}

.skeleton-link {
  flex: 1;
  height: 44px;
  min-width: 0;
}

.skeleton-time {
  width: 64px;
  height: 16px;
  flex-shrink: 0;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* Limits and About */

.limits-block {
  grid-area: limits;
  background-color: var(--surface-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.limits-summary,
.limits-full {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-secondary);
}

#limits-toggle {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  color: var(--signal-action-text);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.about-section {
  grid-area: about;
  background-color: var(--surface-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-section p {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-secondary);
}

/* Footer */

.page-footer {
  width: 100%;
  max-width: 1400px;
  margin: 16px auto 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--ink-secondary);
  padding: 4px 0;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 0;
  color: var(--signal-action-text);
  text-decoration: none;
}

.footer-nav {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

/* Toast */

.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: calc(100% - 32px);
  max-width: 360px;
  background-color: var(--surface-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), background-color 180ms var(--ease-flagship), color 180ms var(--ease-flagship);
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast:not(.visible) {
  transition: opacity 150ms var(--ease-out);
}

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: var(--status-pass-text);
}

.toast.error .toast-dot {
  background-color: var(--status-fail-text);
}

.toast-message {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

#toast-close {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-secondary);
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Hover only on devices that really hover */

@media (hover: hover) and (pointer: fine) {
  #verify-btn:hover:not(:disabled) {
    opacity: 0.9;
  }

  .example-chip:hover:not(:disabled),
  #theme-toggle:hover:not(:disabled) {
    border-color: var(--signal-action-text);
  }

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

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

  #limits-toggle:hover {
    text-decoration: underline;
  }

  .show-more:hover {
    text-decoration: underline;
  }
}

/* Desktop layout */

@media (min-width: 900px) {
  .app-header {
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .header-inner {
    flex-wrap: nowrap;
  }

  .brand-tagline {
    order: 2;
    flex: 1 1 auto;
  }

  .health-badge {
    order: 3;
  }

  #theme-toggle {
    order: 4;
    margin-left: 0;
  }

  .workspace {
    grid-template-columns: 360px 1fr;
    grid-template-areas:
      "controls verdict"
      "controls inspector"
      "controls inspector"
      "limits   limits"
      "about    about";
  }

  .control-card {
    position: sticky;
    top: 92px;
  }

  .verdict-word {
    font-size: 32px;
    line-height: 36px;
  }

  .toast {
    left: auto;
    right: 16px;
    transform: translateY(8px);
    width: auto;
  }

  .toast.visible {
    transform: translateY(0);
  }
}

/* Reduced motion: position movement off, state meaning kept */

@media (prefers-reduced-motion: reduce) {
  .skeleton-row {
    animation: none;
    opacity: 0.7;
  }

  .health-badge[data-state="checking"] .health-dot {
    animation: none;
    opacity: 0.7;
  }

  .inspector-row {
    transform: none !important;
    transition: opacity 180ms var(--ease-out);
    transition-delay: 0ms !important;
  }

  .inspector-row.row-entering {
    opacity: 1;
    transform: none;
  }

  .verdict-stamp {
    transition: opacity 180ms var(--ease-out), border-color 180ms var(--ease-flagship), background-color 180ms var(--ease-flagship), color 180ms var(--ease-flagship);
  }

  .toast {
    transform: translateX(-50%);
    transition: opacity 180ms var(--ease-out), background-color 180ms var(--ease-flagship), color 180ms var(--ease-flagship);
  }

  .toast:not(.visible) {
    transition: opacity 180ms var(--ease-out);
  }

  .toast.visible {
    transform: translateX(-50%);
  }

  button:active {
    transform: none;
  }

  button {
    transition: opacity 180ms var(--ease-out), background-color 180ms var(--ease-flagship), border-color 180ms var(--ease-flagship), color 180ms var(--ease-flagship);
  }
}

@media (prefers-reduced-motion: reduce) and (min-width: 900px) {
  .toast {
    transform: none;
  }

  .toast.visible {
    transform: none;
  }
}
