/*
 * TorqOS component + utility classes.
 *
 * Lifted verbatim from docs/design/bundle-2026-04-20/torqos.css so the Rails
 * app renders pixel-identical to the prototype. Tokens live in
 * app/assets/tailwind/application.css (@theme + :root variables). Edit here
 * only when the design bundle changes; then sync both files.
 *
 * Fonts are loaded from the layout head. CSS custom properties like
 * --torque-purple, --ink, --text come from :root in the Tailwind entry.
 *
 * Served by Propshaft. Included in app/views/layouts/application.html.erb
 * via stylesheet_link_tag "torqos".
 */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  line-height: 1.5;
}

::selection { background: rgba(70,245,31,0.25); color: var(--text-strong); }

h1,h2,h3,h4,h5 { font-family: var(--font-heading); font-weight: 700; color: var(--text-strong); letter-spacing: -0.01em; margin: 0; }

/* ───────── Reusable atoms ───────── */

/* Button */
.tq-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px;
  font-family: var(--font-body); font-weight: 500; font-size: 14px;
  border-radius: var(--r); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform .08s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.tq-btn:active { transform: translateY(1px); }
.tq-btn:focus-visible { outline: none; box-shadow: var(--focus); }

.tq-btn--primary { background: var(--torque-green); color: #071d02; font-weight: 600; }
.tq-btn--primary:hover { background: var(--torque-green-hover); box-shadow: var(--glow-green); }

.tq-btn--secondary { background: var(--torque-purple); color: var(--text-strong); }
.tq-btn--secondary:hover { background: color-mix(in oklab, var(--torque-purple) 85%, white); }

.tq-btn--ghost { background: transparent; color: var(--text); border-color: var(--ink-border); }
.tq-btn--ghost:hover { background: var(--ink-hover); border-color: var(--torque-purple); }

.tq-btn--danger { background: transparent; color: var(--danger); border-color: color-mix(in oklab, var(--danger) 35%, transparent); }
.tq-btn--danger:hover { background: var(--danger-soft); }

.tq-btn--sm { height: 30px; padding: 0 10px; font-size: 13px; }
.tq-btn--xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: var(--r-sm); }
.tq-btn--icon { width: 34px; padding: 0; }

/* Input / select */
.tq-input, .tq-select, .tq-textarea {
  width: 100%; display: block;
  height: 38px; padding: 0 12px;
  background: var(--ink-muted); color: var(--text);
  border: 1px solid var(--ink-border); border-radius: var(--r);
  font-family: var(--font-body); font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.tq-textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; line-height: 1.5; }
.tq-input:focus, .tq-select:focus, .tq-textarea:focus {
  outline: none; border-color: var(--torque-purple);
  box-shadow: 0 0 0 3px rgba(90, 64, 203, 0.22);
}
.tq-input::placeholder, .tq-textarea::placeholder { color: var(--text-dim); }
.tq-select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%239C93B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5l3 3 3-3'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.tq-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; letter-spacing: 0.02em; }
.tq-hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

/* Card */
.tq-card { background: var(--ink-card); border: 1px solid var(--ink-border); border-radius: var(--r-lg); }
.tq-card--raised { background: var(--ink-raised); box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 20px 40px -20px rgba(0,0,0,0.6); }

/* Badges / pills */
.tq-badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
.tq-badge--green { background: var(--success-soft); color: var(--torque-green); }
.tq-badge--purple { background: rgba(90,64,203,0.18); color: #BDA8FF; }
.tq-badge--violet { background: var(--info-soft); color: #D5BBFF; }
.tq-badge--warn { background: var(--warning-soft); color: var(--warning); }
.tq-badge--danger { background: var(--danger-soft); color: var(--danger); }
.tq-badge--neutral { background: hsl(258, 20%, 18%); color: var(--text-muted); }

.tq-dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }

/* Stage pill */
.tq-stage { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; background: hsl(258,25%,12%); border: 1px solid var(--ink-border); color: var(--text); }

/* Avatar */
.tq-avatar { width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--torque-purple); color: #fff; font-weight: 600; font-size: 12px; font-family: var(--font-heading); flex-shrink: 0; }
.tq-avatar--sm { width: 22px; height: 22px; font-size: 10px; }
.tq-avatar--lg { width: 40px; height: 40px; font-size: 14px; }

/* Checkbox */
.tq-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--ink-border); background: var(--ink-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: all .15s; }
.tq-check:hover { border-color: var(--torque-purple); }
.tq-check.checked { background: var(--torque-green); border-color: var(--torque-green); }
.tq-check.checked svg { color: #071d02; }

/* Divider */
.tq-divider { height: 1px; background: var(--ink-border-soft); }

/* Table */
.tq-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tq-table th { text-align: left; font-family: var(--font-heading); font-weight: 600; color: var(--text-dim); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 14px; border-bottom: 1px solid var(--ink-border); }
.tq-table td { padding: 12px 14px; border-bottom: 1px solid var(--ink-border-soft); vertical-align: middle; }
.tq-table tr:hover td { background: var(--ink-hover); }

/* Kanban card */
.tq-kanban-card {
  background: var(--ink-card); border: 1px solid var(--ink-border);
  border-radius: var(--r-lg); padding: 14px;
  cursor: grab; transition: border-color .15s, transform .12s;
  position: relative;
}
.tq-kanban-card:hover { border-color: color-mix(in oklab, var(--torque-purple) 60%, var(--ink-border)); }
.tq-kanban-card:active { cursor: grabbing; }
.tq-kanban-card.dragging { opacity: .4; transform: rotate(-1deg); }
.tq-kanban-card.is-stale::before { content:''; position: absolute; inset: -1px; border-radius: var(--r-lg); border: 1px solid var(--warning); pointer-events: none; opacity: .6; }

/* KPI */
.tq-kpi { background: var(--ink-card); border: 1px solid var(--ink-border); border-radius: var(--r-lg); padding: 18px 20px; position: relative; overflow: hidden; }
.tq-kpi__label { font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.tq-kpi__value { font-family: var(--font-heading); font-size: 32px; font-weight: 700; color: var(--text-strong); letter-spacing: -0.02em; margin-top: 8px; white-space: nowrap; }
.tq-kpi__delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; margin-top: 4px; white-space: nowrap; }
.tq-kpi__delta.up { color: var(--torque-green); }
.tq-kpi__delta.down { color: var(--danger); }

/* Sidebar nav */
.tq-nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r); color: var(--text-muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.tq-nav-item:hover { background: var(--ink-hover); color: var(--text); }
.tq-nav-item.active { background: rgba(90,64,203,0.18); color: var(--text-strong); }
.tq-nav-item.active .tq-nav-icon { color: var(--torque-violet); }
.tq-nav-icon { width: 18px; height: 18px; color: currentColor; flex-shrink: 0; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: hsl(258,25%,18%); border-radius: 10px; border: 2px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: hsl(258,25%,26%); }

/* Utils */
.tq-mono { font-family: var(--font-mono); font-feature-settings: 'tnum'; }
.tq-muted { color: var(--text-muted); }
.tq-dim { color: var(--text-dim); }

/* Inline links inside content (subdued, underlined on hover) */
.tq-link { color: var(--torque-violet); text-decoration: none; }
.tq-link:hover { text-decoration: underline; }

/* Back link above page titles — small, dim, with leading arrow */
.tq-back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13px; text-decoration: none; }
.tq-back-link::before { content: "←"; font-size: 14px; line-height: 1; }
.tq-back-link:hover { color: var(--text); }

/* Page title (used in <h1> at the top of CRUD/index/show pages).
   Tailwind preflight resets h1 to body size, so an explicit class
   keeps page titles at proper hierarchy across the app. */
.tq-page-title { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; }

/* ───────── Responsive layout ───────── */

/* Shell + sidebar (desktop + drawer on mobile) */
.tq-shell { display: flex; height: 100vh; background: var(--ink); position: relative; }
.tq-sidebar { width: 232px; background: var(--ink-raised); border-right: 1px solid var(--ink-border); display: flex; flex-direction: column; flex-shrink: 0; transition: transform .24s ease; }
.tq-sidebar-scrim { display: none; }
.tq-hamburger { display: none; }

@media (max-width: 1000px) {
  .tq-sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; transform: translateX(-100%); box-shadow: 20px 0 50px rgba(0,0,0,0.6); }
  .tq-sidebar.is-open { transform: translateX(0); }
  .tq-sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(3,2,8,0.6); backdrop-filter: blur(2px); z-index: 55; }
  .tq-hamburger { display: inline-flex; }
  .tq-header { padding: 12px 16px !important; }
  .tq-main-pad { padding: 16px !important; }
  .tq-grid-2 { grid-template-columns: 1fr !important; }
  .tq-grid-3 { grid-template-columns: 1fr !important; }
  .tq-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .tq-grid-5 { grid-template-columns: repeat(2, 1fr) !important; }
  .tq-drawer { width: 100vw !important; max-width: 100vw !important; }
  .tq-settings-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 640px) {
  .tq-header-search { display: none !important; }
  .tq-grid-4 { grid-template-columns: 1fr !important; }
  .tq-grid-5 { grid-template-columns: 1fr !important; }
  .tq-table th:nth-child(3), .tq-table td:nth-child(3),
  .tq-table th:nth-child(6), .tq-table td:nth-child(6),
  .tq-table th:nth-child(7), .tq-table td:nth-child(7),
  .tq-table th:nth-child(8), .tq-table td:nth-child(8) { display: none; }
  .tq-kpi__value { font-size: 26px !important; }
}
@media (max-width: 1400px) and (min-width: 1001px) {
  .tq-grid-5 { grid-template-columns: repeat(3, 1fr) !important; }
  .tq-drawer { width: 560px !important; }
}

/* ───────── Mobile-only UX (bottom tabs + cards + fullscreen sheet) ───────── */

.tq-mobile-only { display: none; }
.tq-desktop-only { display: flex; }

.tq-mobile-tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
  height: 64px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: color-mix(in oklab, var(--ink-raised) 92%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--ink-border);
  display: flex;
}
.tq-mobile-tab {
  flex: 1; background: transparent; border: none; color: var(--text-dim);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 11px; font-weight: 500; font-family: var(--font-body);
  cursor: pointer; padding: 8px 4px; position: relative;
  transition: color .15s;
}
.tq-mobile-tab.is-active { color: var(--torque-violet); }
.tq-mobile-tab.is-active::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px; background: var(--torque-violet); border-radius: 0 0 4px 4px;
}

.tq-mobile-header {
  position: sticky; top: 0; z-index: 30;
  padding: 14px 16px 12px;
  background: color-mix(in oklab, var(--ink) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ink-border-soft);
  display: flex; align-items: center; gap: 10px;
}
.tq-mobile-title { font-family: var(--font-heading); font-size: 22px; font-weight: 700; color: var(--text-strong); letter-spacing: -0.02em; line-height: 1.1; }
.tq-mobile-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.tq-mobile-scroll { padding: 16px; padding-bottom: 80px; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.tq-mobile-card {
  background: var(--ink-card); border: 1px solid var(--ink-border);
  border-radius: 14px; padding: 14px; position: relative;
  cursor: pointer; transition: border-color .15s, transform .1s;
}
.tq-mobile-card:active { transform: scale(0.99); border-color: var(--torque-purple); }
.tq-mobile-card-stale { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--warning); margin-bottom: 8px; }
.tq-mobile-card-company { font-family: var(--font-heading); font-size: 15px; font-weight: 700; color: var(--text-strong); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tq-mobile-card-contact { font-size: 12px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tq-mobile-kanban { display: flex; flex-direction: column; height: 100%; padding: 0 16px 80px; }
.tq-mobile-stage-nav { display: flex; align-items: center; gap: 10px; padding: 16px 0 10px; }
.tq-mobile-stage-label { font-family: var(--font-heading); font-size: 16px; font-weight: 700; color: var(--text-strong); }
.tq-mobile-dots { display: flex; gap: 4px; justify-content: center; padding-bottom: 14px; }
.tq-mobile-dot { width: 20px; height: 4px; border-radius: 2px; border: none; cursor: pointer; padding: 0; transition: background .2s; }
.tq-mobile-kanban-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; }
.tq-mobile-empty { padding: 40px 16px; text-align: center; color: var(--text-dim); font-size: 13px; border: 1px dashed var(--ink-border); border-radius: 12px; }

.tq-icon-round { width: 36px; height: 36px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--ink-muted); color: var(--text); border: 1px solid var(--ink-border); cursor: pointer; flex-shrink: 0; }
.tq-icon-round:disabled { opacity: 0.4; cursor: not-allowed; }

.tq-mobile-user { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--ink-card); border: 1px solid var(--ink-border); border-radius: 14px; margin-bottom: 20px; }
.tq-mobile-section-label { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; margin: 20px 0 8px; padding: 0 4px; }
.tq-mobile-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--ink-card); border: 1px solid var(--ink-border); border-radius: 12px; cursor: pointer; width: 100%; margin-bottom: 6px; }
.tq-mobile-row:active { background: var(--ink-hover); }
.tq-mobile-row-icon { width: 36px; height: 36px; border-radius: 10px; background: rgba(90,64,203,0.18); color: var(--torque-violet); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

.tq-mobile-sheet {
  position: fixed; inset: 0; z-index: 90;
  background: var(--ink);
  display: flex; flex-direction: column;
  animation: tq-sheet-up .24s ease-out;
}
@keyframes tq-sheet-up { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.tq-mobile-sheet-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--ink-border-soft); }
.tq-mobile-sheet-footer {
  padding: 12px 16px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  background: var(--ink-raised); border-top: 1px solid var(--ink-border);
  display: grid; grid-template-columns: auto 1fr; gap: 10px;
}
.tq-mobile-sheet-footer .tq-btn { height: 48px; font-size: 15px; }

.tq-mobile-stat-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.tq-mobile-stat { background: var(--ink-card); border: 1px solid var(--ink-border); border-radius: 12px; padding: 12px; }
.tq-mobile-stat-label { font-size: 10px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.tq-mobile-stat-value { font-family: var(--font-heading); font-size: 20px; font-weight: 700; color: var(--text-strong); margin-top: 6px; letter-spacing: -0.02em; }

.tq-mobile-action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tq-mobile-action {
  background: var(--ink-card); border: 1px solid var(--ink-border); border-radius: 12px;
  padding: 14px 6px; color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-body); font-size: 11px; font-weight: 500; cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.tq-mobile-action:active { transform: scale(0.95); border-color: var(--torque-violet); color: var(--torque-violet); }

/* Switch to mobile layout under 720px */
@media (max-width: 720px) {
  .tq-mobile-only { display: flex; }
  .tq-desktop-only { display: none !important; }
  .tq-shell { flex-direction: column; }
  body { font-size: 15px; }
}

/* ───────── TV Dashboard (presentation mode) ───────── */

.tq-tv {
  position: fixed; inset: 0; z-index: 80;
  background: radial-gradient(ellipse at top, hsl(258, 40%, 9%) 0%, var(--ink) 60%);
  display: flex; flex-direction: column;
  font-size: 18px;
  overflow: hidden;
}
.tq-tv-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 40px;
  border-bottom: 1px solid var(--ink-border-soft);
}
.tq-tv-brand { display: flex; align-items: center; gap: 14px; }
.tq-tv-logo { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--torque-purple), var(--torque-violet)); display: inline-flex; align-items: center; justify-content: center; color: white; }
.tq-tv-brand-name { font-family: var(--font-heading); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; color: var(--text-strong); }
.tq-tv-brand-sub { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.tq-tv-brand-sub::before { content:''; width: 8px; height: 8px; border-radius: 99px; background: var(--torque-green); box-shadow: 0 0 0 4px rgba(70,245,31,0.18); animation: tq-tv-pulse 2s ease-in-out infinite; }
@keyframes tq-tv-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.tq-tv-date { text-align: center; }
.tq-tv-time { font-family: var(--font-mono); font-size: 32px; font-weight: 600; color: var(--text-strong); letter-spacing: 0.02em; }
.tq-tv-date-text { font-size: 14px; color: var(--text-muted); text-transform: capitalize; }

.tq-tv-exit { background: transparent; border: 1px solid var(--ink-border); color: var(--text); padding: 10px 18px; border-radius: 10px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-family: var(--font-body); font-size: 14px; }
.tq-tv-exit:hover { border-color: var(--torque-purple); background: var(--ink-hover); }

.tq-tv-grid {
  flex: 1; display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 20px; padding: 24px 40px;
  min-height: 0;
}

.tq-tv-kpi {
  background: var(--ink-card); border: 1px solid var(--ink-border);
  border-radius: 20px; padding: 32px 36px; position: relative; overflow: hidden;
}
.tq-tv-kpi--hero { grid-column: span 1; background: linear-gradient(135deg, hsl(258, 35%, 11%), hsl(258, 40%, 8%)); border-color: rgba(90,64,203,0.35); }
.tq-tv-kpi-label { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.tq-tv-kpi-value { font-family: var(--font-heading); font-size: clamp(48px, 4.8vw, 88px); font-weight: 800; color: var(--text-strong); letter-spacing: -0.03em; margin: 14px 0 12px; line-height: 1; white-space: nowrap; }
.tq-tv-kpi-sub { font-size: 15px; color: var(--text-muted); }
.tq-tv-kpi-spark { position: absolute; right: -40px; bottom: -40px; width: 200px; height: 200px; border-radius: 50%; filter: blur(40px); pointer-events: none; }

.tq-tv-card { background: var(--ink-card); border: 1px solid var(--ink-border); border-radius: 20px; padding: 28px 32px; overflow: hidden; display: flex; flex-direction: column; }
.tq-tv-funnel { grid-column: span 2; }
.tq-tv-card-header { margin-bottom: 20px; }
.tq-tv-card-header h3 { font-size: 20px; }
.tq-tv-card-sub { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.tq-tv-funnel-rows { display: flex; flex-direction: column; gap: 14px; }
.tq-tv-funnel-row { display: grid; grid-template-columns: 160px 1fr 60px 180px; align-items: center; gap: 20px; }
.tq-tv-funnel-label { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: var(--text-strong); }
.tq-tv-funnel-dot { width: 12px; height: 12px; border-radius: 999px; }
.tq-tv-funnel-bar-wrap { height: 28px; background: var(--ink-muted); border-radius: 8px; overflow: hidden; }
.tq-tv-funnel-bar { height: 100%; border-radius: 8px; transition: width .6s ease; }
.tq-tv-funnel-count { font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--text-strong); text-align: right; }
.tq-tv-funnel-value { font-size: 16px; color: var(--text-muted); text-align: right; }

.tq-tv-spot { grid-column: span 1; background: linear-gradient(135deg, hsl(348, 35%, 12%), hsl(258, 35%, 10%)); border-color: rgba(255,77,109,0.3); }
.tq-tv-spot-content { animation: tq-tv-fade .5s ease; }
@keyframes tq-tv-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.tq-tv-spot-stage { margin-bottom: 14px; }
.tq-tv-spot-company { font-family: var(--font-heading); font-size: 28px; font-weight: 800; color: var(--text-strong); letter-spacing: -0.02em; line-height: 1.1; }
.tq-tv-spot-contact { font-size: 15px; color: var(--text-muted); margin-top: 6px; }
.tq-tv-spot-value { font-family: var(--font-heading); font-size: 36px; font-weight: 800; color: var(--torque-green); margin-top: 18px; letter-spacing: -0.02em; }
.tq-tv-spot-dots { display: flex; gap: 6px; margin-top: 18px; }
.tq-tv-spot-dot { width: 28px; height: 4px; border-radius: 2px; background: var(--ink-border); transition: background .3s; }
.tq-tv-spot-dot.is-active { background: var(--torque-green); }
.tq-tv-empty { font-size: 15px; color: var(--text-dim); }

.tq-tv-mini { background: var(--ink-card); border: 1px solid var(--ink-border); border-radius: 16px; padding: 20px 24px; display: flex; flex-direction: column; justify-content: center; }
.tq-tv-mini-value { font-family: var(--font-heading); font-size: 36px; font-weight: 800; color: var(--text-strong); letter-spacing: -0.02em; line-height: 1; }
.tq-tv-mini-label { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 8px; }

.tq-tv-ticker { display: flex; align-items: center; gap: 16px; padding: 14px 40px; border-top: 1px solid var(--ink-border-soft); background: hsl(258, 35%, 7%); overflow: hidden; }
.tq-tv-ticker-label { font-family: var(--font-heading); font-size: 11px; font-weight: 800; letter-spacing: 0.2em; color: var(--danger); padding: 4px 10px; border: 1px solid rgba(255,77,109,0.4); border-radius: 4px; flex-shrink: 0; }
.tq-tv-ticker-track { flex: 1; overflow: hidden; }
.tq-tv-ticker-inner { display: flex; gap: 40px; animation: tq-ticker-scroll 60s linear infinite; white-space: nowrap; }
.tq-tv-ticker-item { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
.tq-tv-ticker-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--torque-violet); }
@keyframes tq-ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Small TV viewports (e.g. reviewer screen, or as fallback) — still look big */
@media (max-width: 1400px) {
  .tq-tv-grid { grid-template-columns: 1fr 1fr; padding: 20px 24px; gap: 14px; }
  .tq-tv-funnel { grid-column: span 2; }
  .tq-tv-kpi--hero { grid-column: span 2; }
  .tq-tv-spot { grid-column: span 2; }
  .tq-tv-kpi-value { font-size: 56px; }
  .tq-tv-funnel-row { grid-template-columns: 120px 1fr 50px 120px; gap: 14px; }
}

/* Giant screens — TV dashboards (≥2400px wide) */
@media (min-width: 2400px) {
  :root { font-size: 18px; }
  body { font-size: 18px; }
  .tq-kpi { padding: 28px 32px; }
  .tq-kpi__value { font-size: 56px; }
  .tq-kpi__label { font-size: 15px; }
  .tq-card { border-radius: 18px; }
  h1 { font-size: 32px !important; }
  .tq-tv-scale h3 { font-size: 22px !important; }
  .tq-tv-scale .tq-mono { font-size: 16px; }
  .tq-btn { height: 44px; padding: 0 18px; font-size: 16px; }
  .tq-sidebar { width: 280px; }
  .tq-nav-item { font-size: 16px; padding: 10px 14px; }
}
@media (min-width: 3600px) {
  :root { font-size: 22px; }
  body { font-size: 22px; }
  .tq-kpi__value { font-size: 72px; }
  h1 { font-size: 42px !important; }
  .tq-sidebar { width: 340px; }
}
