/* Tasecode Website — Tase Design System Stylesheet
 * Lightweight, zero-dependency, high-contrast, dark + light native.
 */

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

html {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: var(--ambient-glow);
  background-repeat: no-repeat;
  background-size: 100% 420px;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-text);
  text-decoration: none;
  transition: color var(--t-state) var(--ease);
}

a:hover {
  color: var(--accent-hover);
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

code,
pre,
kbd,
.mono {
  font-family: var(--font-mono);
}

.tnum {
  font-variant-numeric: tabular-nums;
}

/* Always-visible keyboard focus ring (2px accent, 2px offset) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip link for keyboard accessibility */
.skip-link {
  position: fixed;
  top: -100px;
  left: var(--s-4);
  z-index: 200;
  background: var(--accent-strong);
  color: var(--on-accent);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
}

.skip-link:focus {
  top: var(--s-3);
}

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

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

.container-narrow {
  width: 100%;
  max-width: var(--col-w);
  margin: 0 auto;
}

/* Translucent Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--header-h);
  background: var(--bar-solid);
  border-bottom: 1px solid var(--hairline);
}

@supports (backdrop-filter: blur(12px)) {
  .site-header {
    background: var(--bar-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
}

.header-inner {
  height: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.header-wide .header-inner {
  max-width: 1400px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
}

.brand-tag {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  padding: 2px 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  background: var(--raised);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 var(--s-3);
  border-radius: var(--r-8);
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  transition: color var(--t-state) var(--ease), background-color var(--t-state) var(--ease);
}

.nav-link:hover {
  color: var(--text);
  background: var(--hover);
}

.nav-link[aria-current="page"] {
  color: var(--text);
  background: var(--selected);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 32px;
  padding: 0 var(--s-3);
  border-radius: var(--r-8);
  border: 1px solid var(--hairline);
  background: var(--sunken);
  color: var(--muted);
  font-size: 13px;
  transition: border-color var(--t-state) var(--ease), color var(--t-state) var(--ease), background-color var(--t-state) var(--ease);
}

.search-trigger:hover {
  border-color: var(--border);
  color: var(--text);
  background: var(--raised);
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--r-4);
  border: 1px solid var(--hairline);
  background: var(--raised);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-8);
  border: 1px solid var(--hairline);
  background: var(--raised);
  color: var(--muted);
  transition: border-color var(--t-state) var(--ease), color var(--t-state) var(--ease), background-color var(--t-state) var(--ease);
}

.icon-btn:hover {
  border-color: var(--border);
  color: var(--text);
  background: var(--hover);
}

.mobile-menu-btn {
  display: none;
}

/* Buttons (Tase spec: at most one filled button per section/sheet) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 36px;
  padding: 0 var(--s-4);
  border-radius: var(--r-full);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--t-state) var(--ease), border-color var(--t-state) var(--ease), color var(--t-state) var(--ease);
}

.btn-sm {
  height: 32px;
  padding: 0 var(--s-3);
  font-size: 13px;
}

.btn-primary {
  background: var(--accent-strong);
  color: var(--on-accent);
  border-color: transparent;
}

.btn-primary:hover {
  background: var(--accent-strong-hover);
  color: var(--on-accent);
}

.btn-secondary {
  background: var(--raised);
  background-image: var(--sheen);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--hover);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--hover);
  color: var(--text);
}

.btn-danger-confirm {
  background: var(--danger);
  color: var(--on-accent);
  border-color: transparent;
}

.btn-danger-confirm:hover {
  filter: brightness(1.08);
}

/* Status Indicator (One shared component everywhere, fixed 16px slot) */
.status-slot {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  display: inline-block;
}

.dot-live {
  background: var(--live);
  box-shadow: 0 0 0 3px var(--live-soft);
}

.dot-warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
  animation: pulse-warn 2.2s ease-in-out infinite;
}

.dot-danger {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.dot-idle {
  background: var(--faint);
}

.ring-working {
  width: 12px;
  height: 12px;
  border-radius: var(--r-full);
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

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

@keyframes pulse-warn {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.48;
  }
}

/* Cards & Grouped Containers */
.card {
  background-color: var(--raised);
  background-image: var(--sheen);
  border: 1px solid var(--hairline);
  border-radius: var(--r-12);
  box-shadow: var(--shadow-card);
}

.card-flat {
  background-color: var(--raised);
  background-image: var(--sheen);
  border: 1px solid var(--hairline);
  border-radius: var(--r-8);
}

.card-warn {
  border-color: var(--warn);
}

.card-danger {
  border-color: var(--danger);
}

.section-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 var(--s-3) 0;
  letter-spacing: 0.01em;
}

.section-header {
  max-width: 680px;
  margin-bottom: var(--s-8);
}

.section-header h2 {
  margin: 0 0 var(--s-3) 0;
  font-size: 26px;
  line-height: 1.24;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-header p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

/* Sections */
.band {
  padding: var(--s-16) 0;
}

.band-tight {
  padding: var(--s-12) 0;
}

.band-divider {
  border-top: 1px solid var(--hairline);
}

/* Hero */
.hero {
  position: relative;
  padding: 56px 0 20px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--hairline) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 18%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 18%, #000 10%, transparent 75%);
  pointer-events: none;
  opacity: 0.7;
}

.hero > .container {
  position: relative;
}

.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
  flex-wrap: wrap;
}

.section-head-row h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

.feature-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-8);
  background: var(--sunken);
  border: 1px solid var(--hairline);
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--t-state) var(--ease), background-color var(--t-state) var(--ease);
}

.feature-card:hover .feature-icon {
  border-color: rgba(124, 134, 255, 0.35);
  background: var(--accent-soft);
}

/* Scroll reveal (pure class transition, zero inline styles) */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}

.js-reveal [data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.hero-top {
  max-width: 740px;
  margin: 0 auto var(--s-8);
  text-align: center;
}

.hero h1 {
  margin: 0 0 var(--s-4);
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-lead {
  margin: 0 auto var(--s-6);
  max-width: 640px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
}

.hero-meta {
  margin-top: var(--s-4);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-4);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1-5);
}

/* ============================================================
 * INTERACTIVE SHOWCASE: REAL DESKTOP APP (tase app) & TUI (tase)
 * Matches apps/gui + crates/desktop/* and apps/tui/src/ui/
 * ============================================================ */
.showcase-switch-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: var(--s-4);
}

.showcase-frame {
  position: relative;
  display: none;
  border-radius: var(--r-14);
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow-overlay), 0 0 0 1px rgba(124, 134, 255, 0.08);
  overflow: hidden;
}

.showcase-frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.55;
  pointer-events: none;
  z-index: 2;
}

.showcase-frame.is-active {
  display: block;
  animation: frame-in 220ms var(--ease);
}

@keyframes frame-in {
  from {
    opacity: 0.4;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Desktop App Shell: full-height left sidebar + right pane */
.tapp-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 540px;
}

.tapp-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tapp-brand-row {
  height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}

.tapp-mode-switch {
  margin: 2px 8px 6px;
  padding: 2px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  border-radius: var(--r-8);
  border: 1px solid var(--hairline);
  background: transparent;
}

.tapp-mode-btn {
  height: 28px;
  border: 0;
  border-radius: var(--r-6);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  transition: background-color var(--t-state) var(--ease), color var(--t-state) var(--ease);
}

.tapp-mode-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.tapp-mode-btn.is-active {
  background: var(--selected);
  color: var(--text);
}

.tapp-actions {
  padding: 2px 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tapp-action-split {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tapp-action-row {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--r-8);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
}

.tapp-action-row.is-muted {
  color: var(--muted);
  font-weight: 400;
}

.tapp-action-row svg {
  color: var(--muted);
  flex-shrink: 0;
}

.tapp-action-key {
  margin-left: auto;
  font-size: 11px;
  color: var(--faint);
  font-weight: 400;
}

.tapp-action-vdiv {
  width: 1px;
  height: 14px;
  background: var(--hairline);
  flex-shrink: 0;
}

.tapp-action-pill {
  height: 30px;
  padding: 0 8px;
  border-radius: var(--r-8);
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
  flex-shrink: 0;
}

.tapp-side-scroll {
  flex: 1;
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.tapp-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--faint);
}

.tapp-sec-head-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tapp-count-pill {
  font-size: 10.5px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--r-full);
  background: var(--warn-soft);
  color: var(--warn-text);
}

.tapp-proj-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 3px;
  font-size: 11.5px;
  color: var(--muted);
}

.tapp-proj-branch {
  font-size: 10.5px;
  color: var(--faint);
}

.tapp-row {
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--r-8);
  background: transparent;
  color: var(--muted);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color var(--t-state) var(--ease), color var(--t-state) var(--ease);
}

.tapp-row:hover {
  background: var(--hover);
  color: var(--text);
}

.tapp-row.is-active {
  background: var(--selected);
  color: var(--text);
}

.tapp-row-body {
  min-width: 0;
  flex: 1;
}

.tapp-row-title {
  display: block;
  font-size: 12.5px;
  line-height: 1.3;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tapp-row.is-active .tapp-row-title {
  color: var(--text);
  font-weight: 500;
}

.tapp-row-meta {
  display: block;
  font-size: 11px;
  line-height: 1.3;
  color: var(--faint);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tapp-bot-avatar {
  width: 20px;
  height: 20px;
  border-radius: var(--r-6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 600;
  flex-shrink: 0;
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--border);
}

.tapp-bot-avatar.is-auditor {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: rgba(124, 134, 255, 0.25);
}

.tapp-bot-avatar.is-release {
  background: var(--warn-soft);
  color: var(--warn-text);
  border-color: rgba(245, 158, 11, 0.25);
}

.tapp-side-footer {
  height: 38px;
  padding: 0 12px;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--faint);
  flex-shrink: 0;
}

/* Right Main Column */
.tapp-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.tapp-header {
  height: 44px;
  padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.tapp-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tapp-header-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tapp-folder-chip {
  font-size: 11.5px;
  color: var(--muted);
  padding: 2px 7px;
  border-radius: var(--r-6);
  background: var(--raised);
  border: 1px solid var(--hairline);
  white-space: nowrap;
  flex-shrink: 0;
}

.tapp-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
}

.tapp-review-btn {
  height: 26px;
  padding: 0 8px;
  border-radius: var(--r-6);
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  transition: background-color var(--t-state) var(--ease), border-color var(--t-state) var(--ease), color var(--t-state) var(--ease);
}

.tapp-review-btn:hover,
.tapp-review-btn.is-open {
  background: var(--hover);
  border-color: var(--border);
  color: var(--text);
}

.tapp-review-badge {
  font-size: 11px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: var(--r-4);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 500;
}

.tapp-meter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.tapp-meter-track {
  width: 28px;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--raised);
  overflow: hidden;
}

.tapp-meter-fill {
  display: block;
  width: 31%;
  height: 100%;
  background: var(--accent);
}

.tapp-header-icon {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.tapp-win-ctrls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--hairline);
  color: var(--faint);
  font-size: 12px;
}

/* Workspace Body (chat + optional slide-in Review pane) */
.tapp-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

.tapp-workspace.has-review {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
}

.tapp-chat-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 24px 16px;
  gap: 14px;
}

.tapp-view {
  display: none;
  flex-direction: column;
  gap: 12px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  min-width: 0;
}

.tapp-view.is-active {
  display: flex;
}

/* Authentic quiet tool line (no box around it, matches conv-dark.png) */
.tapp-tool-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.tapp-tool-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.tapp-tool-name {
  color: var(--text);
  font-weight: 500;
}

.tapp-tool-arg {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tapp-tool-allow {
  color: var(--faint);
  font-size: 11.5px;
  flex-shrink: 0;
}

/* Authentic assistant prose & code block */
.tapp-prose {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}

.tapp-prose code {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: var(--r-4);
  background: var(--raised);
  border: 1px solid var(--hairline);
}

.tapp-code-card {
  position: relative;
  border-radius: var(--r-10);
  border: 1px solid var(--hairline);
  background: var(--sunken);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--text);
}

.tapp-code-card pre {
  margin: 0;
}

.syn-kw { color: var(--accent-text); }
.syn-str { color: var(--live-text); }
.syn-ty { color: var(--info); }
.syn-cm { color: var(--faint); }

.tapp-bullets {
  margin: 0;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.tapp-bullets li {
  margin-bottom: 3px;
}

.tapp-bullets code {
  font-size: 11.5px;
  padding: 1px 4px;
  border-radius: var(--r-4);
  background: var(--raised);
  color: var(--text);
}

/* Authentic "2 files changed" card (matches conv-dark.png) */
.tapp-changes-card {
  border-radius: var(--r-10);
  border: 1px solid var(--hairline);
  background: var(--sunken);
  overflow: hidden;
}

.tapp-changes-head {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--hairline);
  font-size: 12.5px;
}

.tapp-changes-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 500;
}

.tapp-changes-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tapp-mini-btn {
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-6);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.tapp-mini-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.tapp-mini-btn.is-primary {
  background: var(--accent-strong);
  color: var(--on-accent);
  border-radius: var(--r-full);
}

.tapp-mini-btn.is-primary:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.tapp-change-row {
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  border-bottom: 1px solid var(--hairline);
}

.tapp-change-row:last-child {
  border-bottom: 0;
}

.tapp-flag-m { color: var(--warn-text); margin-right: 8px; }
.tapp-flag-a { color: var(--live-text); margin-right: 8px; }

/* Authentic Satellite Delegation Card (Binary mode, matches phasepair-auto-dark.png) */
.tapp-sat-card {
  border-radius: var(--r-10);
  border: 1px solid var(--hairline);
  background: var(--sunken);
  overflow: hidden;
  font-size: 12.5px;
}

.tapp-sat-head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tapp-sat-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
}

.tapp-workspace.has-review .tapp-code-card {
  font-size: 11px;
  padding: 10px 12px;
}

/* Authentic Crew Overview (matches project-overview.png) */
.tapp-crew-strip {
  padding: 0 0 10px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.tapp-crew-tab {
  padding: 4px 8px;
  border-radius: var(--r-6);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tapp-crew-tab.is-active {
  background: var(--hover);
  color: var(--text);
  font-weight: 500;
}

.tapp-req-card {
  border-radius: var(--r-10);
  border: 1px solid var(--hairline);
  background: var(--sunken);
  overflow: hidden;
}

.tapp-req-head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}

.tapp-req-row {
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  font-size: 12.5px;
}

.tapp-req-row:last-child {
  border-bottom: 0;
}

.tapp-req-id {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
}

.tapp-req-sub {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* Authentic Composer Box (matches conv-dark.png) */
.tapp-composer {
  max-width: 680px;
  width: 100%;
  margin: auto auto 0;
  border-radius: var(--r-12);
  border: 1px solid var(--hairline);
  background: var(--raised);
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tapp-composer-placeholder {
  font-size: 13.5px;
  color: var(--muted);
}

.tapp-composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--faint);
}

.tapp-composer-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.tapp-composer-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.tapp-send-circle {
  width: 24px;
  height: 24px;
  border-radius: var(--r-full);
  background: var(--hover);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* Authentic Slide-In Review Diff Panel (matches review-dark.png) */
.tapp-review-pane {
  display: none;
  border-left: 1px solid var(--hairline);
  background: var(--bg);
  flex-direction: column;
  min-width: 0;
}

.tapp-workspace.has-review .tapp-review-pane {
  display: flex;
}

.tapp-review-head {
  height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}

.tapp-review-body {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.65;
  overflow-x: auto;
}

.tapp-diff-file {
  padding: 7px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.tapp-diff-hunk {
  padding: 3px 12px;
  color: var(--faint);
  border-bottom: 1px solid var(--hairline);
}

.tapp-diff-line {
  display: grid;
  grid-template-columns: 28px 28px 16px 1fr;
  padding: 0 10px 0 6px;
  white-space: pre;
}

.tapp-diff-line .ln {
  color: var(--faint);
  text-align: right;
  padding-right: 6px;
  user-select: none;
}

.tapp-diff-line .sg {
  text-align: center;
  user-select: none;
}

.tapp-diff-line.add {
  background: var(--diff-add);
}

.tapp-diff-line.add .sg {
  color: var(--live-text);
}

.tapp-diff-line.del {
  background: var(--diff-del);
}

.tapp-diff-line.del .sg {
  color: var(--danger-text);
}

.tapp-review-foot {
  height: 30px;
  padding: 0 12px;
  border-top: 1px solid var(--hairline);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--faint);
}

/* ============================================================
 * AUTHENTIC TERMINAL UI (tase) — Matches apps/tui/src/ui/mod.rs
 * ============================================================ */
.tui-shell {
  font-family: var(--font-mono);
  background: var(--surface);
  color: var(--text);
  min-height: 540px;
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
  line-height: 1.55;
}

.tui-status-top {
  padding: 8px 14px;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  flex-wrap: wrap;
}

.tui-top-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.tui-top-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.tui-brand {
  color: var(--accent-text);
  font-weight: 600;
}

.tui-sep {
  color: var(--faint);
}

.tui-modebar {
  padding: 6px 14px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.tui-tab-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--r-4);
}

.tui-tab-btn:hover {
  color: var(--text);
  background: var(--hover);
}

.tui-tab-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.tui-body {
  flex: 1;
  padding: 18px 24px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tui-view {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.tui-view.is-active {
  display: flex;
}

.tui-prompt-line {
  color: var(--text);
}

.tui-prompt-glyph {
  color: var(--accent-text);
  margin-right: 6px;
}

.tui-tool-line {
  color: var(--muted);
}

.tui-code-box {
  border-left: 2px solid var(--border);
  padding: 4px 0 4px 12px;
  margin: 2px 0;
  overflow-x: auto;
}

.tui-code-box pre {
  margin: 0;
}

.tui-composer-wrap {
  padding: 0 24px 10px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}

.tui-composer-box {
  border: 1px solid var(--border);
  border-radius: var(--r-8);
  padding: 9px 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tui-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 2px;
}

.tui-hints-bar {
  padding: 7px 14px;
  border-top: 1px solid var(--hairline);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  color: var(--faint);
  flex-wrap: wrap;
}

.tui-hints-bar strong {
  color: var(--muted);
  font-weight: 500;
}

/* Attached Surface Strip beneath App Frame */
.surface-bar {
  margin-top: var(--s-4);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: var(--r-14);
  border: 1px solid var(--hairline);
  background: var(--surface);
  overflow: hidden;
}

.surface-item {
  min-width: 0;
  padding: 16px 20px;
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.surface-item:last-child {
  border-right: 0;
}

.surface-cmd {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-text);
}

.surface-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

/* Unified Section Rhythm (no jarring full-width dividers) */
.section-block {
  padding: 16px 0 16px;
}

.section-last {
  padding-bottom: 64px;
}

/* Unified Architectural Bento Grid (single 1px hairline lattice) */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--r-14);
  overflow: hidden;
}

.bento-cell {
  min-width: 0;
  background: var(--surface);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text);
  position: relative;
  transition: background-color var(--t-state) var(--ease);
}

.bento-cell:hover {
  background: var(--raised);
  color: var(--text);
}

.bento-span-4 {
  grid-column: span 4;
}

.bento-span-2 {
  grid-column: span 2;
}

.bento-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.bento-cell h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}

.bento-arrow {
  color: var(--faint);
  font-size: 14px;
  transition: transform var(--t-state) var(--ease), color var(--t-state) var(--ease);
}

.bento-cell:hover .bento-arrow {
  color: var(--accent-text);
  transform: translateX(3px);
}

.bento-cell p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 520px;
}

.bento-visual {
  margin-top: auto;
  padding-top: 10px;
}

/* Bento Mini-Visuals */
.provider-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.provider-pills span {
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: var(--r-6);
  background: var(--bg);
  border: 1px solid var(--hairline);
  color: var(--muted);
}

.provider-pills span.is-accent {
  background: var(--accent-soft);
  border-color: rgba(124, 134, 255, 0.25);
  color: var(--accent-text);
}

.route-pair {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
}

.route-node {
  padding: 5px 9px;
  border-radius: var(--r-6);
  background: var(--bg);
  border: 1px solid var(--hairline);
  color: var(--muted);
}

.route-node.is-core {
  border-color: rgba(124, 134, 255, 0.35);
  color: var(--text);
}

.route-link {
  color: var(--accent-text);
}

.lane-stack {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
}

.lane-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 5px 10px;
  border-radius: var(--r-6);
  background: var(--bg);
  border: 1px solid var(--hairline);
  color: var(--text);
}

.lane-meta {
  margin-left: auto;
  color: var(--faint);
}

.bot-host-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
}

.lane-tag {
  padding: 1px 6px;
  border-radius: var(--r-4);
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 11px;
}

/* Segmented Controls & Tabs */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: var(--r-8);
  background: var(--sunken);
  border: 1px solid var(--hairline);
}

.seg-btn {
  height: 28px;
  padding: 0 var(--s-3);
  border-radius: var(--r-6);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  transition: background-color var(--t-state) var(--ease), color var(--t-state) var(--ease);
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn[aria-selected="true"] {
  background: var(--hover);
  color: var(--text);
  font-weight: 500;
}

/* Code Wells */
.code-well {
  border-radius: var(--r-10);
  border: 1px solid var(--hairline);
  background: var(--sunken);
  overflow: hidden;
  margin: var(--s-4) 0;
}

.code-well-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid var(--hairline);
  background: var(--raised);
  font-size: 12px;
  color: var(--muted);
}

.code-well pre {
  margin: 0;
  padding: var(--s-4);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

.copy-btn {
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-6);
  border: 1px solid var(--hairline);
  background: var(--sunken);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
  transition: border-color var(--t-state) var(--ease), color var(--t-state) var(--ease), background-color var(--t-state) var(--ease);
}

.copy-btn:hover {
  border-color: var(--border);
  color: var(--text);
  background: var(--hover);
}

.copy-btn.is-copied {
  border-color: var(--live);
  color: var(--live-text);
}

/* Unified Install & Docs Split Panel */
.install-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  border-radius: var(--r-14);
  border: 1px solid var(--hairline);
  background: var(--surface);
  overflow: hidden;
}

.install-panel-main {
  min-width: 0;
  padding: 24px;
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
}

.install-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--faint);
  line-height: 1.5;
}

.install-foot code {
  color: var(--muted);
}

.install-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-2);
}

.install-panel-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text);
}

.repo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  background: var(--warn-soft);
  color: var(--warn-text);
  font-size: 11.5px;
  font-weight: 500;
}

.install-pane {
  display: none;
}

.install-pane.is-active {
  display: block;
}

.install-note {
  margin: var(--s-2) 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

.install-panel-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dock-row {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 13px 20px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  text-align: left;
  color: var(--text);
  transition: background-color var(--t-state) var(--ease);
}

.dock-row:last-child {
  border-bottom: 0;
}

.dock-row:hover {
  background: var(--hover);
  color: var(--text);
}

.row-title {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.row-hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.row-trail {
  font-size: 13px;
  color: var(--faint);
  flex-shrink: 0;
  transition: color var(--t-state) var(--ease);
}

.dock-row:hover .row-trail {
  color: var(--accent-text);
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--hairline);
  background: var(--surface);
  padding: var(--s-8) 0;
  font-size: 13px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--text);
}

/* ============================================================
 * DOCS HUB LAYOUT (docs.html)
 * 280px Sidebar + 740px Reading Column + 220px On-Page TOC
 * ============================================================ */
.docs-shell {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) 220px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--hairline);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.docs-filter-wrap {
  position: relative;
}

.docs-filter-input {
  width: 100%;
  height: 32px;
  padding: 0 30px 0 10px;
  border-radius: var(--r-6);
  border: 1px solid var(--hairline);
  background: var(--sunken);
  color: var(--text);
  font-size: 13px;
}

.docs-filter-input::placeholder {
  color: var(--faint);
}

.docs-filter-input:focus {
  border-color: var(--accent);
  outline: none;
}

.docs-filter-clear {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: var(--r-4);
  background: transparent;
  color: var(--muted);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.docs-filter-clear.is-visible {
  display: inline-flex;
}

.docs-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-nav-group-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  padding: var(--s-1) var(--s-2);
  margin-bottom: 2px;
}

.docs-nav-btn {
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: var(--r-8);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  transition: background-color var(--t-state) var(--ease), color var(--t-state) var(--ease);
}

.docs-nav-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.docs-nav-btn[aria-current="true"] {
  background: var(--selected);
  color: var(--text);
  font-weight: 500;
}

.docs-search-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.docs-search-hit {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r-8);
  border: 1px solid var(--hairline);
  background: var(--raised);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.docs-search-hit:hover {
  border-color: var(--accent);
  background: var(--hover);
}

.docs-search-hit-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.docs-search-hit-snippet {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.docs-search-hit mark,
.palette-hit mark {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-radius: 3px;
  padding: 0 2px;
}

/* Main Docs Article */
.docs-main {
  padding: var(--s-8) var(--s-8) var(--s-16);
  min-width: 0;
}

.docs-article {
  max-width: var(--col-w);
  margin: 0 auto;
}

.docs-mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--hairline);
}

.docs-breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: var(--s-3);
}

.docs-article h1 {
  margin: 0 0 var(--s-3);
  font-size: 28px;
  line-height: 1.22;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.docs-lead {
  margin: 0 0 var(--s-6);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
}

.docs-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  padding-bottom: var(--s-6);
  margin-bottom: var(--s-6);
  border-bottom: 1px solid var(--hairline);
}

.tag-pill {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--r-6);
  background: var(--raised);
  border: 1px solid var(--hairline);
  color: var(--muted);
}

.docs-body h2 {
  margin: var(--s-8) 0 var(--s-3);
  padding-top: var(--s-2);
  font-size: 19px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.docs-body h3 {
  margin: var(--s-6) 0 var(--s-2);
  font-size: 15.5px;
  line-height: 1.35;
  font-weight: 500;
}

.anchor-link {
  opacity: 0;
  color: var(--faint);
  font-size: 14px;
  transition: opacity var(--t-state) var(--ease), color var(--t-state) var(--ease);
}

.docs-body h2:hover .anchor-link,
.anchor-link:focus-visible {
  opacity: 1;
  color: var(--accent-text);
}

.docs-body p {
  margin: 0 0 var(--s-4);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}

.docs-body ul,
.docs-body ol {
  margin: 0 0 var(--s-4);
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}

.docs-body li {
  margin-bottom: 6px;
}

.docs-body code:not(pre code) {
  font-size: 13px;
  padding: 1px 6px;
  border-radius: var(--r-4);
  background: var(--sunken);
  border: 1px solid var(--hairline);
  color: var(--text);
}

.docs-callout {
  padding: var(--s-4);
  border-radius: var(--r-10);
  border: 1px solid var(--hairline);
  background: var(--raised);
  margin: var(--s-4) 0;
  font-size: 14px;
  line-height: 1.55;
}

.docs-callout.is-warn {
  border-color: var(--warn);
  background: var(--warn-soft);
}

.docs-callout.is-info {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.docs-callout strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

.docs-table-wrap {
  overflow-x: auto;
  margin: var(--s-4) 0;
  border-radius: var(--r-10);
  border: 1px solid var(--hairline);
  background: var(--raised);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.docs-table th {
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  color: var(--muted);
  font-weight: 500;
  font-size: 12.5px;
}

.docs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  line-height: 1.5;
}

.docs-table tr:last-child td {
  border-bottom: 0;
}

.docs-pager {
  margin-top: var(--s-12);
  padding-top: var(--s-6);
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}

.pager-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s-4);
  border-radius: var(--r-10);
  border: 1px solid var(--hairline);
  background-color: var(--raised);
  background-image: var(--sheen);
  text-align: left;
  transition: border-color var(--t-state) var(--ease), background-color var(--t-state) var(--ease);
}

.pager-btn:hover {
  border-color: var(--accent);
  background-color: var(--hover);
}

.pager-btn.is-next {
  text-align: right;
  align-items: flex-end;
}

.pager-dir {
  font-size: 12px;
  color: var(--muted);
}

.pager-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* Right TOC */
.docs-toc {
  position: sticky;
  top: var(--header-h);
  padding: var(--s-8) var(--s-4) var(--s-8) 0;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.docs-toc-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  margin: 0 0 var(--s-3);
}

.docs-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--hairline);
}

.docs-toc-link {
  display: block;
  padding: 5px 0 5px 12px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
  transition: color var(--t-state) var(--ease), border-color var(--t-state) var(--ease);
}

.docs-toc-link:hover {
  color: var(--text);
}

.docs-toc-link.is-active {
  color: var(--accent-text);
  border-left-color: var(--accent);
}

.section-flash {
  animation: highlight-flash 1.4s ease;
}

@keyframes highlight-flash {
  0% {
    background-color: var(--accent-soft);
    border-radius: var(--r-6);
  }
  100% {
    background-color: transparent;
  }
}

/* ============================================================
 * FLOATING COMMAND SEARCH PALETTE (Ctrl+K / Cmd+K)
 * ============================================================ */
.palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--scrim);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh var(--s-4) var(--s-6);
}

.palette-backdrop.is-open {
  display: flex;
}

.palette-sheet {
  width: 100%;
  max-width: 600px;
  border-radius: var(--r-14);
  border: 1px solid var(--hairline);
  background: var(--overlay);
  box-shadow: var(--shadow-overlay);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 76vh;
}

.palette-header {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
}

.palette-input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 15px;
  color: var(--text);
  outline: none;
}

.palette-input::placeholder {
  color: var(--faint);
}

.palette-list {
  padding: var(--s-2);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.palette-hit {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-10);
  border: 0;
  background: transparent;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.palette-hit:hover,
.palette-hit.is-active {
  background: var(--accent-soft);
}

.palette-hit-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
}

.palette-hit-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  min-width: 0;
}

.palette-hit-cat {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 44%;
  flex-shrink: 0;
}

.palette-hit-snippet {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}

.palette-empty {
  padding: var(--s-8) var(--s-4);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.palette-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--hairline);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* Filter input on CLI reference */
.inline-filter {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-8);
  border: 1px solid var(--hairline);
  background: var(--sunken);
  color: var(--text);
  font-size: 14px;
  margin-bottom: var(--s-4);
}

.inline-filter:focus {
  border-color: var(--accent);
  outline: none;
}

/* Toast (quiet copy feedback, zero layout shift) */
.toast {
  position: fixed;
  bottom: var(--s-6);
  right: var(--s-6);
  z-index: 160;
  padding: 8px 14px;
  border-radius: var(--r-8);
  border: 1px solid var(--hairline);
  background: var(--overlay);
  color: var(--text);
  box-shadow: var(--shadow-overlay);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity var(--t-exit) var(--ease), transform var(--t-exit) var(--ease);
}

.toast.is-open {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 1140px) {
  .docs-shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .docs-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .surface-bar,
  .bento-grid,
  .install-panel {
    grid-template-columns: 1fr;
  }
  .bento-span-4,
  .bento-span-2 {
    grid-column: span 1;
  }
  .surface-item {
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }
  .surface-item:last-child {
    border-bottom: 0;
  }
  .install-panel-main {
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }
  .tapp-shell {
    grid-template-columns: 1fr;
  }
  .tapp-sidebar {
    display: none;
  }
  .tapp-workspace.has-review {
    grid-template-columns: 1fr;
  }
  .tapp-review-pane {
    border-left: 0;
    border-top: 1px solid var(--hairline);
  }
  .tapp-win-ctrls,
  .tapp-header-icon {
    display: none;
  }
}

@media (max-width: 780px) {
  .container,
  .header-inner {
    padding: 0 var(--s-4);
  }
  .site-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--hairline);
    padding: var(--s-3) var(--s-4);
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-overlay);
  }
  .site-nav.is-open {
    display: flex;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .search-trigger .search-label,
  .search-trigger .kbd {
    display: none;
  }
  .docs-shell {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    height: auto;
    z-index: 90;
    border-right: 0;
  }
  .docs-sidebar.is-open {
    display: flex;
  }
  .docs-main {
    padding: var(--s-6) var(--s-4) var(--s-12);
  }
  .docs-mobile-bar {
    display: flex;
  }
  .docs-pager {
    grid-template-columns: 1fr;
  }
  .tapp-chat-col,
  .tui-body,
  .tui-composer-wrap {
    padding-left: var(--s-4);
    padding-right: var(--s-4);
  }
  .tapp-folder-chip,
  .tapp-meter {
    display: none;
  }
  .tapp-composer-foot {
    flex-wrap: wrap;
  }
  .tapp-changes-head {
    flex-wrap: wrap;
  }
}

/* Utility helpers (zero inline styles for strict style-src 'self' CSP) */
.flex-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.flex-row-md {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flex-wrap-gap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.flex-wrap-sm {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.pad-14 {
  padding: 14px;
}

.mb-4 {
  margin-bottom: 4px;
}

.mb-6 {
  margin-bottom: 6px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mt-16 {
  margin-top: 16px;
}

.text-live {
  color: var(--live-text);
}

.text-danger {
  color: var(--danger-text);
}

.text-warn {
  color: var(--warn-text);
}

.text-muted-sm {
  font-size: 13px;
  color: var(--muted);
}

.text-title-sm {
  font-size: 14px;
  font-weight: 500;
}

.is-hidden {
  display: none !important;
}

.error-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-16) var(--s-6);
}

.error-card {
  max-width: 520px;
  width: 100%;
  padding: var(--s-8);
  text-align: center;
}

.error-card h1 {
  margin: var(--s-4) 0 var(--s-2);
  font-size: 26px;
  font-weight: 500;
}

.error-card p {
  margin: 0 0 var(--s-6);
  color: var(--muted);
  font-size: 15px;
}

/* Reduced motion: turn off all animations & transitions */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
