/*
 * Desarrollo Comercial 0.3.5
 * TALIA KES 2 Bokeh Glass — full-canvas, light-first, dark-safe, host-resilient.
 * Core owns the shell. This file styles only the module workspace.
 */

:root {
  --te-canvas: var(--kes-canvas, #ffffff);
  --te-surface: var(--kes-surface, #ffffff);
  --te-surface-raised: var(--kes-surface-raised, var(--kes-raised, #fcfbff));
  --te-surface-soft: var(--kes-surface-soft, #f8f6fc);
  --te-text: var(--kes-text, #171322);
  --te-text-strong: var(--kes-text-strong, #100d1b);
  --te-muted: var(--kes-text-muted, #6f687b);
  --te-subtle: var(--kes-text-subtle, #918a9d);
  --te-line: var(--kes-border, var(--kes-line, rgba(62, 39, 82, .13)));
  --te-line-soft: rgba(75, 53, 93, .075);
  --te-primary: var(--kes-color-primary, var(--kes-accent, #7c3aed));
  --te-magenta: var(--kes-color-accent, var(--kes-accent-secondary, #e40086));
  --te-violet: var(--kes-color-violet, #6d28d9);
  --te-cyan: var(--kes-color-info, #0ea5e9);
  --te-teal: var(--kes-color-success, #0f9f8d);
  --te-orange: var(--kes-color-warning, #f59e0b);
  --te-danger: var(--kes-color-danger, #dc3657);
  --te-success: var(--kes-color-success, #158764);
  --te-on-accent: var(--kes-on-accent, #ffffff);
  --te-primary-soft: color-mix(in srgb, var(--te-primary) 9%, #ffffff);
  --te-magenta-soft: color-mix(in srgb, var(--te-magenta) 8%, #ffffff);
  --te-radius-2xs: 8px;
  --te-radius-xs: 10px;
  --te-radius-sm: 13px;
  --te-radius-md: 16px;
  --te-radius-lg: 20px;
  --te-radius-xl: 26px;
  --te-shadow-xs: 0 1px 2px rgba(35, 20, 48, .035);
  --te-shadow-sm: 0 8px 22px rgba(45, 26, 61, .055);
  --te-shadow-md: 0 16px 42px rgba(45, 26, 61, .075);
  --te-shadow-accent: 0 12px 28px color-mix(in srgb, var(--te-primary) 22%, transparent);
  --te-ease: cubic-bezier(.2, .75, .25, 1);
  --te-content-padding: clamp(16px, 1.8vw, 32px);
  /* Core/Theme publish these variables for the occupied mobile dock. */
  --te-core-nav-offset: var(--krn-mobile-occupied-bottom, var(--krn-mobile-dock-total, 0px));
}

html[data-theme="dark"],
body[data-theme="dark"],
body.kes-dark,
.dark-mode,
[data-kes-theme="dark"] {
  --te-canvas: var(--kes-canvas, #100c16);
  --te-surface: var(--kes-surface, #17121f);
  --te-surface-raised: var(--kes-surface-raised, var(--kes-raised, #21192c));
  --te-surface-soft: var(--kes-surface-soft, #1b1525);
  --te-text: var(--kes-text, #f7f3fb);
  --te-text-strong: var(--kes-text-strong, #ffffff);
  --te-muted: var(--kes-text-muted, #bcb3c8);
  --te-subtle: var(--kes-text-subtle, #8f879a);
  --te-line: rgba(255, 255, 255, .105);
  --te-line-soft: rgba(255, 255, 255, .065);
  --te-primary-soft: color-mix(in srgb, var(--te-primary) 16%, var(--te-surface));
  --te-magenta-soft: color-mix(in srgb, var(--te-magenta) 14%, var(--te-surface));
  --te-shadow-xs: 0 1px 2px rgba(0, 0, 0, .18);
  --te-shadow-sm: 0 10px 28px rgba(0, 0, 0, .22);
  --te-shadow-md: 0 20px 54px rgba(0, 0, 0, .3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --te-canvas: var(--kes-canvas, #100c16);
    --te-surface: var(--kes-surface, #17121f);
    --te-surface-raised: var(--kes-surface-raised, var(--kes-raised, #21192c));
    --te-surface-soft: var(--kes-surface-soft, #1b1525);
    --te-text: var(--kes-text, #f7f3fb);
    --te-text-strong: var(--kes-text-strong, #ffffff);
    --te-muted: var(--kes-text-muted, #bcb3c8);
    --te-subtle: var(--kes-text-subtle, #8f879a);
    --te-line: rgba(255, 255, 255, .105);
    --te-line-soft: rgba(255, 255, 255, .065);
    --te-primary-soft: color-mix(in srgb, var(--te-primary) 16%, var(--te-surface));
    --te-magenta-soft: color-mix(in srgb, var(--te-magenta) 14%, var(--te-surface));
    --te-shadow-xs: 0 1px 2px rgba(0, 0, 0, .18);
    --te-shadow-sm: 0 10px 28px rgba(0, 0, 0, .22);
    --te-shadow-md: 0 20px 54px rgba(0, 0, 0, .3);
  }
}

/* Core-neutral module reset */
.te-app,
.te-app *,
.te-app *::before,
.te-app *::after { box-sizing: border-box; }

.te-app {
  width: 100%;
  max-width: none;
  min-width: 0;
  color: var(--te-text);
  background: var(--te-canvas);
  font-family: inherit;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  container: te-module / inline-size;
}

.te-app a { color: inherit; }
.te-app button,
.te-app input,
.te-app select,
.te-app textarea { font: inherit; }
.te-app button { -webkit-tap-highlight-color: transparent; }
.te-app [hidden] { display: none !important; }

/* Full workspace: no internal max-width and no decorative side gutters. */
.te-shell {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: none !important;
  min-width: 0;
  min-height: 70vh;
  margin: 0 !important;
  padding: clamp(18px, 1.7vw, 30px) var(--te-content-padding) clamp(34px, 3vw, 52px);
  overflow: clip;
  background:
    radial-gradient(620px 300px at 11% -8%, color-mix(in srgb, var(--te-primary) 7%, transparent), transparent 69%),
    radial-gradient(560px 300px at 92% -6%, color-mix(in srgb, var(--te-magenta) 6%, transparent), transparent 70%),
    var(--te-canvas);
}

.te-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: 0;
  opacity: .34;
  background-image:
    linear-gradient(color-mix(in srgb, var(--te-primary) 2.4%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--te-primary) 2.4%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .25), transparent 360px);
}

/* Intrinsic-size guard: no grid/flex child may widen Core's canvas. */
.te-shell > *,
.te-capture-flow > *,
.te-flow-stage > *,
.te-capture-step > *,
.te-context-grid > *,
.te-context-extras > *,
.te-dynamic-grid > *,
.te-confirm-grid > * {
  min-width: 0;
  max-width: 100%;
}


/* Header */
.te-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(18px, 3vw, 42px);
  margin: 0 0 20px;
  padding: 2px 2px 0;
}

.te-hero-copy { min-width: 0; max-width: 900px; }
.te-eyebrow {
  margin: 0;
  color: var(--te-primary);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.te-hero h1 {
  margin: 7px 0 0;
  color: var(--te-text-strong);
  font-size: clamp(31px, 3vw, 46px);
  font-weight: 680;
  letter-spacing: -.045em;
  line-height: 1.02;
}

.te-subtitle,
.te-note {
  color: var(--te-muted);
  line-height: 1.55;
}
.te-subtitle { max-width: 850px; margin: 10px 0 0; font-size: 14px; }
.te-note { margin: 6px 0 0; font-size: 12px; }

.te-hero-actions,
.te-form-actions,
.te-actions,
.te-review-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.te-hero-actions { justify-content: flex-end; padding-top: 9px; }
.te-form-actions { justify-content: flex-end; }

/* Buttons */
.te-button {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  max-width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--te-line);
  border-radius: 12px;
  background: var(--te-surface);
  color: var(--te-text);
  box-shadow: var(--te-shadow-xs);
  text-decoration: none;
  font-size: 13px;
  font-weight: 660;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .16s var(--te-ease), box-shadow .16s var(--te-ease), border-color .16s ease, background-color .16s ease;
}
.te-button svg { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.te-button:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--te-primary) 25%, var(--te-line)); box-shadow: var(--te-shadow-sm); }
.te-button:active { transform: translateY(0); }
.te-button:disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }
.te-button.te-primary,
.te-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--te-magenta), var(--te-primary) 56%, color-mix(in srgb, var(--te-primary) 80%, #335cff));
  color: var(--te-on-accent);
  box-shadow: var(--te-shadow-accent);
}
.te-button.te-primary:hover,
.te-primary:hover { box-shadow: 0 16px 34px color-mix(in srgb, var(--te-primary) 27%, transparent); }
.te-secondary { background: color-mix(in srgb, var(--te-surface) 92%, transparent); }
.te-success { color: var(--te-success); border-color: color-mix(in srgb, var(--te-success) 33%, var(--te-line)); }
.te-danger { color: var(--te-danger); border-color: color-mix(in srgb, var(--te-danger) 33%, var(--te-line)); }

.te-button:focus-visible,
.te-app input:focus-visible,
.te-app select:focus-visible,
.te-app textarea:focus-visible,
.te-view-link:focus-visible,
.te-family-chip:focus-visible,
.te-saved-deck:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--te-primary) 30%, transparent);
  outline-offset: 2px;
}

/* Module navigation — glass is intentionally limited to navigation/floating UI. */
.te-view-nav {
  position: relative;
  top: auto;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  min-height: 50px;
  margin: 0 0 18px;
  padding: 5px 7px;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--te-line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--te-surface) 88%, transparent);
  box-shadow: 0 10px 30px rgba(43, 23, 59, .035);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}
.te-view-nav::-webkit-scrollbar { display: none; }
.te-view-link {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 10px;
  color: var(--te-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 620;
  white-space: nowrap;
  transition: color .16s ease, background-color .16s ease;
}
.te-view-link:hover { color: var(--te-text); background: var(--te-surface-soft); }
.te-view-link.is-active { color: var(--te-primary); background: var(--te-primary-soft); }
.te-view-link.is-active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -5px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--te-magenta), var(--te-primary));
}

/* Shared surfaces */
.te-panel {
  min-width: 0;
  margin: 16px 0;
  padding: clamp(16px, 1.45vw, 23px);
  border: 1px solid var(--te-line);
  border-radius: var(--te-radius-lg);
  background: var(--te-surface);
  box-shadow: var(--te-shadow-sm);
}
.te-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.te-section-head > div:first-child { min-width: 0; }
.te-section-head h2,
.te-panel h2 {
  margin: 3px 0 0;
  color: var(--te-text-strong);
  font-size: clamp(18px, 1.5vw, 23px);
  font-weight: 670;
  letter-spacing: -.026em;
  line-height: 1.16;
}
.te-section-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.te-section-title h2 { margin: 0; }
.te-section-title .te-eyebrow { font-size: 9px; margin-bottom: 2px; }
.te-section-icon,
.te-kpi-icon,
.te-empty-icon,
.te-family-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--te-primary);
  border: 1px solid color-mix(in srgb, var(--te-primary) 12%, var(--te-line));
  background: linear-gradient(145deg, color-mix(in srgb, var(--te-primary) 13%, var(--te-surface)), color-mix(in srgb, var(--te-magenta) 8%, var(--te-surface)));
}
.te-section-icon { width: 32px; height: 32px; border-radius: 10px; }
.te-section-icon svg,
.te-kpi-icon svg,
.te-empty-icon svg,
.te-family-icon svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.te-inline-link { color: var(--te-primary); text-decoration: none; font-size: 12px; font-weight: 680; }
.te-inline-link:hover { color: var(--te-magenta); }
.te-arrow-link { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

/* Status */
.te-status {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--te-line);
  border-radius: 12px;
  background: var(--te-surface-raised);
  color: var(--te-text);
  font-size: 13px;
}
.te-status[data-kind="error"] { color: var(--te-danger); border-color: color-mix(in srgb, var(--te-danger) 35%, var(--te-line)); background: color-mix(in srgb, var(--te-danger) 6%, var(--te-surface)); }
.te-status[data-kind="success"] { color: var(--te-success); border-color: color-mix(in srgb, var(--te-success) 35%, var(--te-line)); background: color-mix(in srgb, var(--te-success) 6%, var(--te-surface)); }
.te-access { padding: 24px; border: 1px solid var(--te-line); border-radius: 17px; background: var(--te-surface); }
.te-access p { color: var(--te-muted); }

/* Form controls and filter bar */
.te-filterbar {
  margin: 0 0 14px;
  padding: 13px 14px;
  border: 1px solid var(--te-line);
  border-radius: var(--te-radius-md);
  background: var(--te-surface);
  box-shadow: var(--te-shadow-xs);
}
.te-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(145px, .8fr)) minmax(230px, 1.25fr);
  gap: 12px;
  align-items: end;
  margin: 0;
}
.te-filters:has([data-filter="from"]) { grid-template-columns: repeat(5, minmax(130px, .72fr)) minmax(220px, 1.15fr); }
.te-grow { min-width: 0; }
.te-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.te-span-2 { grid-column: span 2; }
.te-app label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--te-muted);
  font-size: 12px;
  font-weight: 620;
}
.te-app input,
.te-app select,
.te-app textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--te-line);
  border-radius: 11px;
  background: var(--te-surface);
  color: var(--te-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .36);
  font-size: 13px;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.te-app textarea { min-height: 98px; resize: vertical; }
.te-app input::placeholder,
.te-app textarea::placeholder { color: color-mix(in srgb, var(--te-muted) 70%, transparent); }
.te-app input:hover,
.te-app select:hover,
.te-app textarea:hover { border-color: color-mix(in srgb, var(--te-primary) 24%, var(--te-line)); }
.te-app input:disabled,
.te-app select:disabled,
.te-app textarea:disabled { opacity: .66; background: var(--te-surface-soft); cursor: not-allowed; }
.te-required-hint { color: var(--te-subtle); font-size: 10px; font-weight: 520; letter-spacing: .02em; }

/* KPI row */
.te-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}
.te-kpi {
  position: relative;
  min-width: 0;
  min-height: 122px;
  padding: 16px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid var(--te-line);
  border-radius: var(--te-radius-md);
  background: var(--te-surface);
  box-shadow: var(--te-shadow-sm);
  transition: transform .16s var(--te-ease), box-shadow .16s var(--te-ease), border-color .16s ease;
}
.te-kpi::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  height: 18px;
  opacity: .45;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--te-primary) 5%, transparent));
  clip-path: polygon(0 78%, 12% 42%, 25% 70%, 40% 25%, 56% 58%, 70% 20%, 86% 50%, 100% 10%, 100% 100%, 0 100%);
}
.te-kpi:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--te-primary) 20%, var(--te-line)); box-shadow: var(--te-shadow-md); }
.te-kpi-icon { width: 38px; height: 38px; border-radius: 12px; }
.te-kpi-copy { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.te-kpi-copy > span { color: var(--te-muted); font-size: 11px; line-height: 1.2; }
.te-kpi-copy strong { margin: 6px 0 3px; color: var(--te-text-strong); font-size: clamp(27px, 2.1vw, 35px); font-weight: 650; letter-spacing: -.04em; line-height: 1; }
.te-kpi-copy small { color: var(--te-subtle); font-size: 10px; line-height: 1.25; }
.te-kpi-spark { position: absolute; inset: auto 12px 8px 12px; height: 24px; opacity: .55; }
.te-kpi-1 .te-kpi-icon { color: var(--te-magenta); }
.te-kpi-2 .te-kpi-icon { color: var(--te-orange); }
.te-kpi-3 .te-kpi-icon { color: var(--te-cyan); }
.te-kpi-4 .te-kpi-icon { color: var(--te-teal); }
.te-kpi-5 .te-kpi-icon { color: var(--te-violet); }
.te-skeleton { background: linear-gradient(90deg, var(--te-surface), var(--te-surface-raised), var(--te-surface)); background-size: 220% 100%; animation: te-shimmer 1.25s infinite linear; }
@keyframes te-shimmer { to { background-position: -220% 0; } }

/* Activity matrix */
.te-catalog-dashboard { margin: 0 0 16px; }
.te-catalog-counts {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--te-line);
  border-radius: 999px;
  background: var(--te-surface-soft);
  color: var(--te-muted);
  font-size: 11px;
  white-space: nowrap;
}
.te-family-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.te-family-card {
  --te-family-color: var(--te-primary);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 250px;
  padding: 15px;
  border: 1px solid var(--te-line);
  border-radius: var(--te-radius-md);
  background:
    radial-gradient(220px 110px at 6% 0%, color-mix(in srgb, var(--te-family-color) 9%, transparent), transparent 73%),
    var(--te-surface);
  box-shadow: var(--te-shadow-xs);
  transition: transform .17s var(--te-ease), box-shadow .17s var(--te-ease), border-color .17s ease;
}
.te-family-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--te-family-color) 32%, var(--te-line)); box-shadow: var(--te-shadow-sm); }
.te-family-card[data-tone="magenta"] { --te-family-color: var(--te-magenta); }
.te-family-card[data-tone="orange"] { --te-family-color: var(--te-orange); }
.te-family-card[data-tone="blue"] { --te-family-color: #2979f2; }
.te-family-card[data-tone="teal"] { --te-family-color: var(--te-teal); }
.te-family-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 13px; }
.te-family-icon { width: 38px; height: 38px; border-radius: 12px; color: var(--te-family-color); border-color: color-mix(in srgb, var(--te-family-color) 14%, var(--te-line)); background: color-mix(in srgb, var(--te-family-color) 10%, var(--te-surface)); }
.te-family-head h3 { margin: 0; color: var(--te-text-strong); font-size: 13px; font-weight: 690; line-height: 1.25; }
.te-family-count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 9px; background: color-mix(in srgb, var(--te-family-color) 12%, var(--te-surface)); color: var(--te-family-color); font-size: 11px; font-weight: 760; }
.te-family-chips { display: flex; align-content: flex-start; align-items: flex-start; gap: 6px; flex-wrap: wrap; flex: 1; }
.te-family-chip {
  appearance: none;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--te-line);
  border-radius: 999px;
  background: var(--te-surface-soft);
  color: var(--te-text);
  font-size: 10px;
  font-weight: 570;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.te-family-chip:hover { transform: translateY(-1px); color: var(--te-family-color); border-color: color-mix(in srgb, var(--te-family-color) 34%, var(--te-line)); background: color-mix(in srgb, var(--te-family-color) 7%, var(--te-surface)); }
.te-family-open { display: inline-flex; align-items: center; gap: 5px; margin-top: 13px; color: var(--te-family-color); text-decoration: none; font-size: 11px; font-weight: 680; }

/* Dashboard composition */
.te-dashboard-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, .58fr);
  gap: 16px;
  align-items: stretch;
}
.te-dashboard-lower > .te-panel,
.te-dashboard-side > .te-panel { margin: 0; }
.te-dashboard-side { display: grid; grid-template-rows: auto auto; gap: 16px; }
.te-recent-panel { min-width: 0; }
.te-dashboard-cards,
.te-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.te-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--te-line);
  border-radius: 15px;
  background: var(--te-surface);
  box-shadow: var(--te-shadow-xs);
  transition: transform .16s var(--te-ease), box-shadow .16s var(--te-ease), border-color .16s ease;
}
.te-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--te-primary) 20%, var(--te-line)); box-shadow: var(--te-shadow-sm); }
.te-card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--te-surface-soft); }
.te-card-media img,
.te-review-media img,
.te-preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.te-media-placeholder { width: 100%; height: 100%; min-height: 120px; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--te-primary) 13%, transparent), transparent 34%), linear-gradient(145deg, var(--te-surface-soft), var(--te-surface)); }
.te-card-category { position: absolute; left: 9px; top: 9px; z-index: 2; display: inline-flex; max-width: calc(100% - 18px); padding: 5px 8px; border-radius: 999px; background: color-mix(in srgb, var(--te-primary) 88%, transparent); color: #fff; box-shadow: 0 4px 15px rgba(30, 15, 45, .22); font-size: 9px; font-weight: 700; line-height: 1.1; backdrop-filter: blur(7px); }
.te-card-body { padding: 12px 13px 13px; }
.te-card-body h3 { margin: 8px 0 6px; color: var(--te-text-strong); font-size: 14px; font-weight: 680; line-height: 1.25; }
.te-card-body p { margin: 0; color: var(--te-muted); font-size: 11px; }
.te-card-meta,
.te-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--te-muted); font-size: 10px; }
.te-card-footer { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--te-line-soft); }
.te-media-count { display: inline-flex; align-items: center; gap: 4px; }
.te-badge { display: inline-flex; align-items: center; max-width: 100%; padding: 5px 8px; border-radius: 999px; background: var(--te-surface-soft); color: var(--te-muted); font-size: 10px; font-weight: 650; white-space: nowrap; }
.te-badge[data-status="validated"] { color: var(--te-success); background: color-mix(in srgb, var(--te-success) 9%, transparent); }
.te-badge[data-status="rejected"],
.te-badge[data-status="needs_correction"] { color: var(--te-danger); background: color-mix(in srgb, var(--te-danger) 9%, transparent); }
.te-badge[data-status="pending_review"] { color: #9a6300; background: color-mix(in srgb, var(--te-orange) 12%, transparent); }

/* Empty state */
.te-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 156px;
  padding: 28px;
  border: 1px dashed var(--te-line);
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--te-primary) 2%, var(--te-surface)), var(--te-surface));
  color: var(--te-muted);
  text-align: center;
}
.te-empty strong { color: var(--te-text-strong); font-size: 14px; }
.te-empty p { max-width: 520px; margin: 0; color: var(--te-muted); font-size: 12px; }
.te-empty-icon { width: 52px; height: 52px; border-radius: 17px; margin-bottom: 3px; }
.te-empty-icon svg { width: 25px; height: 25px; }
.te-empty-dashboard { grid-column: 1 / -1; min-height: 242px; border: 0; }
.te-empty-cta { margin-top: 4px; }

/* Distribution and presenter CTA */
.te-dist-row { display: grid; grid-template-columns: minmax(92px, .72fr) minmax(90px, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--te-line-soft); }
.te-dist-row:last-child { border-bottom: 0; }
.te-dist-row > span:first-child { min-width: 0; overflow: hidden; color: var(--te-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.te-dist-row strong { color: var(--te-text-strong); font-size: 11px; }
.te-dist-track { position: relative; height: 7px; overflow: hidden; border-radius: 999px; background: var(--te-surface-soft); }
.te-dist-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--te-magenta), var(--te-primary)); }
.te-presenter-card { position: relative; overflow: hidden; background: radial-gradient(260px 150px at 100% 0%, color-mix(in srgb, var(--te-primary) 13%, transparent), transparent 72%), var(--te-surface); }
.te-presenter-card::after { content: ""; position: absolute; width: 140px; height: 140px; right: -45px; bottom: -50px; border-radius: 38px; border: 18px solid color-mix(in srgb, var(--te-primary) 8%, transparent); transform: rotate(-12deg); pointer-events: none; }
.te-presenter-visual { display: flex; justify-content: flex-end; margin-top: 14px; position: relative; z-index: 1; }

/* Capture + dynamic forms */
.te-form { display: grid; gap: 16px; }
.te-base-fields { margin: 0; }
.te-dynamic-panel { margin: 0; border-color: color-mix(in srgb, var(--te-primary) 20%, var(--te-line)); }
.te-schema-badge { display: inline-flex; align-items: center; min-height: 29px; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--te-primary) 18%, var(--te-line)); border-radius: 999px; background: var(--te-primary-soft); color: var(--te-primary); font-size: 10px; font-weight: 700; white-space: nowrap; }
.te-dynamic-section { padding: 16px; border: 1px solid var(--te-line); border-radius: 15px; background: var(--te-surface-raised); }
.te-dynamic-section + .te-dynamic-section { margin-top: 12px; }
.te-dynamic-section > header { margin-bottom: 13px; }
.te-dynamic-section h3 { margin: 0; color: var(--te-text-strong); font-size: 15px; font-weight: 680; }
.te-dynamic-section p { margin: 4px 0 0; color: var(--te-muted); font-size: 11px; }
.te-dynamic-section > legend { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; margin: 0 0 13px; padding: 0; color: inherit; }
.te-dynamic-section > legend > span { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--te-primary-soft); color: var(--te-primary); font-size: 11px; font-weight: 760; }
.te-dynamic-section > legend strong { display: block; color: var(--te-text-strong); font-size: 14px; }
.te-dynamic-section > legend small { display: block; margin-top: 3px; color: var(--te-muted); font-size: 10px; line-height: 1.35; }
.te-dynamic-field { min-width: 0; }
.te-dynamic-field[hidden] { display: none !important; }
.te-field-help { display: block; color: var(--te-subtle); font-size: 10px; font-weight: 500; line-height: 1.35; }
.te-radio-grid,
.te-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.te-radio-grid label,
.te-check-grid label { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 42px; padding: 9px 10px; border: 1px solid var(--te-line); border-radius: 11px; background: var(--te-surface); color: var(--te-text); font-size: 12px; cursor: pointer; }
.te-radio-grid input,
.te-check-grid input { width: 16px; min-height: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--te-primary); box-shadow: none; }
.te-radio-grid label:has(input:checked),
.te-check-grid label:has(input:checked) { border-color: color-mix(in srgb, var(--te-primary) 36%, var(--te-line)); background: var(--te-primary-soft); }
.te-requirement-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.te-requirement-chips > span { display: inline-flex; align-items: center; gap: 5px; min-height: 29px; padding: 5px 9px; border: 1px solid var(--te-line); border-radius: 999px; background: var(--te-surface-soft); color: var(--te-muted); font-size: 10px; }
.te-evidence-inputs { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 16px; }
.te-media-box,
.te-location-box { display: grid; align-content: start; gap: 13px; min-width: 0; padding: 18px; border: 1px solid var(--te-line); border-radius: var(--te-radius-md); background: var(--te-surface); box-shadow: var(--te-shadow-xs); }
.te-media-box { grid-template-columns: minmax(0, 1fr) auto; }
.te-media-box > div:first-child,
.te-location-box > div:first-child { min-width: 0; }
.te-media-box [data-role="photo-preview"] { grid-column: 1 / -1; }
.te-file { position: relative; display: inline-flex !important; }
.te-file input { position: absolute; width: 1px; height: 1px; min-height: 1px; opacity: 0; pointer-events: none; }
.te-file span { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 14px; border: 1px solid var(--te-line); border-radius: 11px; background: var(--te-surface-raised); color: var(--te-text); font-size: 12px; font-weight: 670; cursor: pointer; }
.te-preview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.te-preview-grid figure { position: relative; margin: 0; aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid var(--te-line); border-radius: 12px; background: var(--te-surface-soft); }
.te-preview-grid img { width: 100%; height: 100%; display: block; object-fit: cover; }
.te-preview-grid figcaption { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 4px 6px; overflow: hidden; border-radius: 7px; background: rgba(18, 12, 27, .72); color: #fff; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; backdrop-filter: blur(8px); }
.te-location-box { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.te-location-box [data-role="gps-status"] { color: var(--te-muted); font-size: 12px; }
.te-location-box [data-role="gps-status"][data-kind="success"] { color: var(--te-success); }
.te-location-box [data-role="gps-status"][data-kind="error"] { color: var(--te-danger); }

/* Person picker */
.te-person-picker { position: relative; }
.te-person-results { position: absolute; z-index: 45; top: calc(100% + 6px); left: 0; right: 0; max-height: 270px; overflow: auto; padding: 6px; border: 1px solid var(--te-line); border-radius: 13px; background: color-mix(in srgb, var(--te-surface) 92%, transparent); box-shadow: var(--te-shadow-md); backdrop-filter: blur(18px) saturate(125%); -webkit-backdrop-filter: blur(18px) saturate(125%); }
.te-person-results button { width: 100%; display: grid; gap: 3px; padding: 10px; border: 0; border-radius: 9px; background: transparent; color: var(--te-text); text-align: left; cursor: pointer; }
.te-person-results button:hover,
.te-person-results button:focus { background: var(--te-surface-soft); }
.te-person-results span,
.te-person-empty { color: var(--te-muted); font-size: 11px; }
.te-person-empty { padding: 10px; }

/* Tables */
.te-table-wrap { width: 100%; overflow: auto; border: 1px solid var(--te-line); border-radius: 14px; background: var(--te-surface); }
.te-table { width: 100%; border-collapse: collapse; background: var(--te-surface); }
.te-table th,
.te-table td { padding: 13px 12px; border-bottom: 1px solid var(--te-line-soft); color: var(--te-text); text-align: left; vertical-align: top; font-size: 12px; }
.te-table th { position: static; background: var(--te-surface-raised); color: var(--te-muted); font-size: 10px; font-weight: 720; letter-spacing: .055em; text-transform: uppercase; white-space: nowrap; }
.te-table tr:last-child td { border-bottom: 0; }
.te-table tbody tr:hover td { background: color-mix(in srgb, var(--te-primary) 2.5%, var(--te-surface)); }
.te-table td small { display: block; margin-top: 4px; color: var(--te-muted); }
.te-answer-details { max-width: 440px; }
.te-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.te-pagination span { color: var(--te-muted); font-size: 11px; }

/* Review */
.te-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.te-review-card { min-width: 0; overflow: hidden; display: grid; grid-template-columns: minmax(170px, .72fr) minmax(0, 1.28fr); border: 1px solid var(--te-line); border-radius: var(--te-radius-md); background: var(--te-surface); box-shadow: var(--te-shadow-xs); }
.te-review-media { min-height: 270px; background: var(--te-surface-soft); }
.te-review-media > a,
.te-review-media .te-media-placeholder { display: block; width: 100%; height: 100%; }
.te-review-body { display: grid; align-content: start; gap: 11px; min-width: 0; padding: 17px; }
.te-review-body h3 { margin: 0; color: var(--te-text-strong); font-size: 16px; }
.te-review-body > p { margin: 0; color: var(--te-muted); font-size: 12px; }
.te-review-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.te-review-meta div { min-width: 0; padding: 9px; border: 1px solid var(--te-line); border-radius: 10px; background: var(--te-surface-raised); }
.te-review-meta dt { margin-bottom: 3px; color: var(--te-muted); font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }
.te-review-meta dd { margin: 0; overflow: hidden; color: var(--te-text); font-size: 12px; text-overflow: ellipsis; }
.te-review-comments { padding: 10px 11px; border-radius: 10px; background: var(--te-surface-soft); color: var(--te-muted); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.te-review-actions .te-button { flex: 1 1 120px; }

/* Map */
.te-map { position: relative; width: 100%; height: min(65vh, 680px); min-height: 400px; overflow: hidden; border: 1px solid var(--te-line); border-radius: var(--te-radius-md); background: var(--te-surface-soft); }
.te-map-empty { height: 100%; display: grid; place-items: center; padding: 24px; color: var(--te-muted); text-align: center; }
.te-spatial-fallback { position: relative; width: 100%; height: 100%; background: radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--te-primary) 13%, transparent), transparent 28%), linear-gradient(135deg, var(--te-surface-soft), var(--te-surface)); }
.te-map-note { position: absolute; z-index: 3; left: 14px; right: 14px; top: 14px; padding: 9px 11px; border: 1px solid var(--te-line); border-radius: 11px; background: color-mix(in srgb, var(--te-surface) 87%, transparent); color: var(--te-muted); box-shadow: var(--te-shadow-sm); font-size: 11px; backdrop-filter: blur(14px); }
.te-map-dot { position: absolute; width: 18px; height: 18px; transform: translate(-50%, -50%); border: 4px solid var(--te-surface); border-radius: 50%; background: linear-gradient(135deg, var(--te-magenta), var(--te-primary)); box-shadow: 0 5px 16px rgba(66, 33, 95, .3); cursor: pointer; }
.te-map-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 13px; }
.te-map-list article { display: grid; gap: 4px; min-width: 0; padding: 12px; border: 1px solid var(--te-line); border-radius: 13px; background: var(--te-surface); }
.te-map-list strong { overflow: hidden; color: var(--te-text-strong); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.te-map-list span,
.te-map-list small { color: var(--te-muted); font-size: 10px; }

/* Reports */
.te-report-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr); gap: 16px; }
.te-report-grid > .te-panel { margin: 0; }
.te-bar-chart { display: grid; gap: 10px; }
.te-bar-row { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(100px, 1fr) auto; align-items: center; gap: 10px; }
.te-bar-row > span { min-width: 0; overflow: hidden; color: var(--te-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.te-bar-row > i { display: block; height: 9px; overflow: hidden; border-radius: 999px; background: var(--te-surface-soft); }
.te-bar-row > i::after { content: ""; display: block; width: var(--te-value, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--te-magenta), var(--te-primary)); }
.te-bar-row > strong { color: var(--te-text-strong); font-size: 11px; }
.te-funnel { display: grid; gap: 9px; }
.te-funnel > div { position: relative; min-height: 45px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; overflow: hidden; border: 1px solid var(--te-line); border-radius: 11px; background: var(--te-surface-raised); }
.te-funnel > div::before { content: ""; position: absolute; z-index: 0; inset: 0 auto 0 0; width: var(--te-funnel-width, 0%); background: color-mix(in srgb, var(--te-primary) 7%, transparent); }
.te-funnel span,
.te-funnel strong { position: relative; z-index: 1; }
.te-funnel span { color: var(--te-muted); font-size: 11px; }
.te-funnel strong { color: var(--te-text-strong); font-size: 14px; }

/* Catalog inspector */
.te-catalog-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(330px, .5fr); gap: 16px; align-items: start; }
.te-catalog-layout .te-panel { margin-top: 0; }
.te-family-grid-catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.te-schema-inspector { position: static; min-height: 460px; }
.te-schema-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--te-line-soft); }
.te-schema-head h2 { margin: 3px 0 0; font-size: 20px; }
.te-schema-footer { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 0; }
.te-schema-footer span { display: inline-flex; padding: 5px 8px; border: 1px solid var(--te-line); border-radius: 999px; background: var(--te-surface-soft); color: var(--te-muted); font-size: 9px; }
.te-schema-section { padding: 14px 0; border-bottom: 1px solid var(--te-line-soft); }
.te-schema-section:last-child { border-bottom: 0; }
.te-schema-section h3 { margin: 0 0 9px; color: var(--te-text-strong); font-size: 13px; }
.te-schema-section ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.te-schema-section li { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid var(--te-line); border-radius: 10px; background: var(--te-surface-raised); }
.te-schema-section li strong { color: var(--te-text); font-size: 11px; }
.te-schema-section li small { color: var(--te-muted); font-size: 9px; }

/* Presentation builder */
.te-presentation-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 16px; align-items: start; }
.te-presentation-main { min-width: 0; }
.te-presentation-main > .te-panel:first-child { margin-top: 0; }
.te-presentation-library { position: static; margin-top: 0; min-height: 320px; }
.te-presentation-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.te-slide-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.te-slide-option-card { min-width: 0; overflow: hidden; border: 1px solid var(--te-line); border-radius: 14px; background: var(--te-surface-raised); transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
.te-slide-option-card:has(input[type="checkbox"]:checked) { border-color: color-mix(in srgb, var(--te-primary) 34%, var(--te-line)); background: color-mix(in srgb, var(--te-primary-soft) 68%, var(--te-surface)); box-shadow: var(--te-shadow-xs); }
.te-slide-option-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px 11px; }
.te-slide-toggle { display: grid; grid-template-columns: 18px 35px minmax(0, 1fr); align-items: center; gap: 9px; min-width: 0; color: var(--te-text); cursor: pointer; }
.te-slide-toggle input { width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; accent-color: var(--te-primary); box-shadow: none; }
.te-slide-option-index { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--te-surface); color: var(--te-primary); font-size: 10px; font-weight: 760; }
.te-slide-toggle strong { display: block; overflow: hidden; color: var(--te-text-strong); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.te-slide-toggle small { display: block; margin-top: 2px; color: var(--te-muted); font-size: 9px; line-height: 1.35; }
.te-slide-order { display: inline-flex; gap: 4px; }
.te-slide-order button { width: 30px; height: 30px; padding: 0; border: 1px solid var(--te-line); border-radius: 9px; background: var(--te-surface); color: var(--te-primary); cursor: pointer; }
.te-slide-order button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--te-primary) 35%, var(--te-line)); background: var(--te-primary-soft); }
.te-slide-order button:disabled { opacity: .35; cursor: not-allowed; }
.te-slide-option-editor { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 8px; padding: 0 11px 11px; border-top: 1px solid var(--te-line-soft); }
.te-slide-option-editor label { display: grid; gap: 5px; min-width: 0; padding-top: 9px; }
.te-slide-option-editor label > span { color: var(--te-muted); font-size: 9px; letter-spacing: .035em; text-transform: uppercase; }
.te-slide-option-editor input,
.te-slide-option-editor textarea { min-height: 36px; padding: 8px 9px; font-size: 11px; }
.te-slide-option-editor textarea { min-height: 58px; }
.te-saved-deck { width: 100%; display: grid; gap: 4px; padding: 11px; border: 1px solid var(--te-line); border-radius: 11px; background: var(--te-surface-raised); color: var(--te-text); text-align: left; cursor: pointer; }
.te-saved-deck + .te-saved-deck { margin-top: 8px; }
.te-saved-deck:hover { border-color: color-mix(in srgb, var(--te-primary) 25%, var(--te-line)); background: var(--te-primary-soft); }
.te-saved-deck strong { font-size: 12px; }
.te-saved-deck span { color: var(--te-muted); font-size: 9px; }

/* Presentation deck */
.te-deck-preview { margin-top: 18px; padding: 14px; border: 1px solid var(--te-line); border-radius: var(--te-radius-xl); background: #0d0913; box-shadow: var(--te-shadow-md); color: #fff; }
.te-deck-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 3px 4px 14px; }
.te-deck-toolbar h2 { margin: 3px 0 0; color: #fff; font-size: 18px; }
.te-deck-toolbar > div:last-child { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.te-deck-toolbar .te-button { border-color: rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .075); color: #fff; box-shadow: none; }
.te-deck-toolbar .te-deck-close { border-color: rgba(255, 103, 173, .28); background: rgba(255, 67, 153, .12); }
.te-deck-toolbar [data-role="slide-position"] { min-width: 54px; color: rgba(255, 255, 255, .68); font-size: 11px; text-align: center; }
.te-slide-stage { min-height: 0; }
.te-slide {
  --te-slide-ink: #161020;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 440px;
  overflow: hidden;
  padding: clamp(34px, 4.5vw, 78px);
  border-radius: 18px;
  background:
    radial-gradient(480px 270px at 10% 0%, color-mix(in srgb, var(--te-primary) 13%, transparent), transparent 72%),
    radial-gradient(420px 260px at 98% 98%, color-mix(in srgb, var(--te-magenta) 10%, transparent), transparent 72%),
    #ffffff;
  color: var(--te-slide-ink);
}
.te-slide::before { content: "DESARROLLO COMERCIAL"; position: absolute; top: 24px; left: clamp(34px, 4.5vw, 78px); color: var(--te-primary); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.te-slide::after { content: "REGIÓN SUR · TOTALPLAY"; position: absolute; right: clamp(34px, 4.5vw, 78px); bottom: 22px; color: #837a8c; font-size: 8px; font-weight: 650; letter-spacing: .1em; }
.te-slide-body { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; }
.te-slide h1,
.te-slide h2 { color: var(--te-slide-ink); letter-spacing: -.04em; line-height: 1.04; }
.te-slide h1 { margin: auto 0 14px; max-width: 850px; font-size: clamp(38px, 5.1vw, 74px); }
.te-slide h2 { margin: 7px 0 22px; font-size: clamp(29px, 3.8vw, 54px); }
.te-slide p { color: #6b6275; }
.te-slide-note { margin-top: auto; max-width: 760px; padding-top: 18px; color: #736a7d; font-size: 13px; }
.te-cover-layout { height: 100%; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(220px, .8fr); align-items: center; gap: 36px; }
.te-cover-mark { justify-self: end; width: min(280px, 26vw); aspect-ratio: 1; border-radius: 34%; background: linear-gradient(145deg, var(--te-magenta), var(--te-primary)); box-shadow: 0 30px 80px color-mix(in srgb, var(--te-primary) 30%, transparent); transform: rotate(-7deg); position: relative; }
.te-cover-mark > strong,
.te-cover-mark > span { position: absolute; z-index: 2; left: 50%; width: 76%; transform: translateX(-50%) rotate(7deg); color: #fff; text-align: center; }
.te-cover-mark > strong { top: 31%; font-size: clamp(28px, 3.7vw, 56px); letter-spacing: -.045em; line-height: .86; }
.te-cover-mark > span { bottom: 18%; font-size: 10px; font-weight: 720; letter-spacing: .075em; text-transform: uppercase; }
.te-cover-mark::before,
.te-cover-mark::after { content: ""; position: absolute; inset: 20%; border: 3px solid rgba(255, 255, 255, .8); border-radius: 22%; }
.te-cover-mark::after { inset: 34%; border-width: 2px; }
.te-insight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.te-insight-grid article,
.te-slide-metric-list article { padding: 17px; border: 1px solid rgba(75, 51, 94, .12); border-radius: 15px; background: rgba(255, 255, 255, .78); box-shadow: 0 10px 30px rgba(55, 31, 72, .055); }
.te-insight-grid span,
.te-slide-metric-list span { color: #756c80; font-size: 10px; }
.te-insight-grid strong,
.te-slide-metric-list strong { display: block; margin-top: 6px; color: var(--te-slide-ink); font-size: clamp(27px, 3vw, 43px); line-height: 1; }
.te-big-insight { max-width: 850px; margin: auto 0; font-size: clamp(32px, 4.2vw, 64px); font-weight: 700; letter-spacing: -.045em; line-height: 1.08; }
.te-slide-bars { display: grid; gap: 12px; }
.te-slide-bars .te-bar-row { grid-template-columns: 180px minmax(100px, 1fr) 70px; }
.te-slide-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.te-slide-table th,
.te-slide-table td { padding: 11px 10px; border-bottom: 1px solid rgba(75, 51, 94, .12); text-align: left; }
.te-slide-table th { color: #756c80; font-size: 9px; letter-spacing: .055em; text-transform: uppercase; }
.te-slide-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; height: 70%; }
.te-slide-gallery figure { position: relative; margin: 0; overflow: hidden; border-radius: 16px; background: #f1edf5; }
.te-slide-gallery img { width: 100%; height: 100%; display: block; object-fit: cover; }
.te-slide-gallery figcaption { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 8px 9px; border-radius: 9px; background: rgba(17, 10, 26, .72); color: #fff; font-size: 9px; backdrop-filter: blur(8px); }
.te-slide-map { position: relative; height: 72%; overflow: hidden; border-radius: 17px; background: linear-gradient(145deg, #f4f0f8, #fff); }
.te-slide-map .te-map-dot { border-color: #fff; }
.te-quality-slide { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: center; gap: 40px; }
.te-quality-slide .te-donut { width: 210px; height: 210px; }
.te-quality-slide .te-donut::before { background: #fff; }
.te-findings-slide { display: grid; gap: 13px; }
.te-findings-slide article { padding: 16px 18px; border-left: 4px solid var(--te-primary); border-radius: 0 14px 14px 0; background: rgba(124, 58, 237, .055); }
.te-findings-slide strong { display: block; color: var(--te-slide-ink); font-size: 15px; }
.te-findings-slide p { margin: 5px 0 0; font-size: 12px; }
.te-actions-slide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.te-actions-slide article { min-height: 175px; padding: 20px; border: 1px solid rgba(75, 51, 94, .12); border-radius: 16px; background: #fff; }
.te-actions-slide b { display: inline-grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; background: var(--te-primary-soft); color: var(--te-primary); }
.te-actions-slide h3 { margin: 14px 0 7px; color: var(--te-slide-ink); font-size: 16px; }
.te-actions-slide p { margin: 0; font-size: 11px; }

/* Runtime slide markup */
.te-slide > header { position: relative; z-index: 2; margin-bottom: 18px; }
.te-slide > header > span { color: var(--te-primary); font-size: 9px; font-weight: 780; letter-spacing: .11em; text-transform: uppercase; }
.te-slide > header h2 { margin: 7px 0 0; }
.te-slide > header p { margin: 7px 0 0; font-size: 13px; }
.te-slide > footer { position: absolute; z-index: 2; left: clamp(34px, 4.5vw, 78px); right: clamp(34px, 4.5vw, 78px); bottom: 20px; display: flex; justify-content: space-between; gap: 18px; color: #847b8d; font-size: 9px; }
.te-slide-bars { display: grid; gap: 12px; }
.te-slide-bars > div { display: grid; grid-template-columns: minmax(145px, .72fr) minmax(120px, 1fr) 58px; align-items: center; gap: 12px; }
.te-slide-bars > div > span { min-width: 0; overflow: hidden; color: #6f6679; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.te-slide-bars > div > i { display: block; height: 12px; border-radius: 999px; background: linear-gradient(90deg, var(--te-magenta), var(--te-primary)); box-shadow: 0 6px 18px color-mix(in srgb, var(--te-primary) 18%, transparent); }
.te-slide-bars > div > strong { color: var(--te-slide-ink); font-size: 13px; text-align: right; }
.te-slide-table table { width: 100%; border-collapse: collapse; }
.te-slide-metric-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.te-slide-metric-list small { display: block; margin-top: 6px; color: #92899b; font-size: 9px; }
.te-slide-gallery article { position: relative; min-width: 0; overflow: hidden; border-radius: 16px; background: #f1edf5; }
.te-slide-gallery article img,
.te-slide-gallery article .te-media-placeholder { width: 100%; height: 100%; min-height: 130px; display: block; object-fit: cover; }
.te-slide-gallery article > div { position: absolute; left: 8px; right: 8px; bottom: 8px; display: grid; gap: 2px; padding: 8px 9px; border-radius: 9px; background: rgba(17, 10, 26, .72); color: #fff; backdrop-filter: blur(8px); }
.te-slide-gallery article > div strong { font-size: 10px; }
.te-slide-gallery article > div span { color: rgba(255,255,255,.76); font-size: 8px; }
.te-slide-map { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 18px; }
.te-slide-map .te-spatial-fallback { min-height: 280px; overflow: hidden; border: 1px solid rgba(75, 51, 94, .1); border-radius: 16px; background: radial-gradient(circle at 20% 15%, rgba(124,58,237,.13), transparent 29%), linear-gradient(145deg, #f4f0f8, #fff); }
.te-slide-map .te-spatial-fallback i { position: absolute; width: 16px; height: 16px; transform: translate(-50%,-50%); border: 4px solid #fff; border-radius: 50%; background: linear-gradient(135deg, var(--te-magenta), var(--te-primary)); box-shadow: 0 5px 14px rgba(66,33,95,.25); }
.te-slide-map aside { display: flex; flex-direction: column; justify-content: center; padding: 20px; border: 1px solid rgba(75, 51, 94, .1); border-radius: 16px; background: rgba(255,255,255,.8); }
.te-slide-map aside strong { color: var(--te-slide-ink); font-size: 52px; line-height: 1; }
.te-slide-map aside span { margin-top: 7px; color: #756c80; font-size: 12px; }
.te-slide-map aside p { margin: 16px 0 0; font-size: 11px; line-height: 1.45; }
.te-quality-slide dl { display: grid; gap: 8px; margin: 0; }
.te-quality-slide dl > div { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid rgba(75,51,94,.1); }
.te-quality-slide dt { color: #756c80; font-size: 12px; }
.te-quality-slide dd { margin: 0; color: var(--te-slide-ink); font-size: 15px; }
.te-findings-slide article > span { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: rgba(124,58,237,.09); color: var(--te-primary); font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.te-findings-slide h3 { margin: 8px 0 4px; color: var(--te-slide-ink); font-size: 16px; }
.te-actions-slide article > span { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: var(--te-primary-soft); color: var(--te-primary); font-size: 9px; text-transform: uppercase; }
.te-actions-slide article > p { min-height: 48px; margin: 13px 0; color: var(--te-slide-ink); font-size: 14px; line-height: 1.35; }
.te-actions-slide dl { display: grid; gap: 7px; margin: 0; }
.te-actions-slide dl > div { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 8px; }
.te-actions-slide dt { color: #857c8e; font-size: 9px; text-transform: uppercase; }
.te-actions-slide dd { margin: 0; color: #4e4658; font-size: 10px; }

.te-deck-preview:fullscreen { width: 100vw; height: 100vh; margin: 0; padding: 12px; border: 0; border-radius: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); background: #07050a; }
.te-deck-preview:fullscreen .te-slide-stage { display: grid; place-items: center; min-height: 0; }
.te-deck-preview:fullscreen .te-slide { width: min(100%, calc((100vh - 100px) * 16 / 9)); max-height: calc(100vh - 100px); min-height: 0; }

/* Responsive */
@media (max-width: 1480px) {
  .te-family-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .te-family-card { min-height: 226px; }
  .te-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .te-filters:has([data-filter="from"]) { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}

@media (max-width: 1180px) {
  .te-dashboard-lower,
  .te-report-grid,
  .te-catalog-layout,
  .te-presentation-layout { grid-template-columns: 1fr; }
  .te-dashboard-side { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
  .te-presentation-library,
  .te-schema-inspector { position: static; min-height: 0; }
  .te-family-grid-catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .te-review-grid { grid-template-columns: 1fr; }
  .te-map-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .te-filters,
  .te-filters:has([data-filter="from"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-family-grid,
  .te-family-grid-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-dashboard-cards,
  .te-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-evidence-inputs { grid-template-columns: 1fr; }
  .te-map-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-slide { min-height: 390px; }
}

@media (max-width: 760px) {
  :root { --te-content-padding: 14px; }
  .te-shell { padding-top: 15px; }
  .te-hero { flex-direction: column; align-items: stretch; gap: 14px; }
  .te-hero-actions { width: 100%; padding-top: 0; justify-content: flex-start; }
  .te-hero-actions .te-button { flex: 1 1 180px; }
  .te-view-nav { position: relative; top: auto; margin-inline: 0; }
  .te-grid-2,
  .te-presentation-filters { grid-template-columns: 1fr; }
  .te-span-2 { grid-column: auto; }
  .te-kpis { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .te-kpi { flex: 0 0 176px; scroll-snap-align: start; }
  .te-family-grid,
  .te-family-grid-catalog { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .te-family-card { flex: 0 0 min(85vw, 340px); min-height: 230px; scroll-snap-align: center; }
  .te-dashboard-lower { display: block; }
  .te-dashboard-side { display: grid; grid-template-columns: 1fr; margin-top: 16px; }
  .te-dashboard-cards,
  .te-card-grid { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .te-card { flex: 0 0 min(82vw, 320px); scroll-snap-align: center; }
  .te-media-box,
  .te-location-box { grid-template-columns: 1fr; }
  .te-file,
  .te-file span,
  .te-location-box .te-button { width: 100%; }
  .te-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-table { min-width: 760px; }
  .te-review-card { grid-template-columns: 1fr; }
  .te-review-media { min-height: 220px; max-height: 360px; }
  .te-review-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-slide-options { grid-template-columns: 1fr; }
  .te-deck-toolbar { align-items: flex-start; flex-direction: column; }
  .te-slide { min-height: 360px; padding: 34px 28px; }
  .te-slide::before { left: 28px; top: 17px; }
  .te-slide::after { right: 28px; bottom: 15px; }
  .te-cover-layout,
  .te-quality-slide { grid-template-columns: 1fr; }
  .te-cover-mark { display: none; }
  .te-insight-grid,
  .te-actions-slide { grid-template-columns: 1fr; }
  .te-slide-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-slide-gallery article:nth-child(n+5) { display: none; }
}

@media (max-width: 560px) {
  .te-hero h1 { font-size: 33px; }
  .te-hero-actions { display: grid; grid-template-columns: 1fr; }
  .te-hero-actions .te-button { width: 100%; }
  .te-filters,
  .te-filters:has([data-filter="from"]) { grid-template-columns: 1fr; }
  .te-section-head { flex-direction: column; align-items: stretch; }
  .te-section-head .te-button { width: 100%; }
  .te-radio-grid,
  .te-check-grid { grid-template-columns: 1fr; }
  .te-review-meta { grid-template-columns: 1fr; }
  .te-review-actions { display: grid; grid-template-columns: 1fr; }
  .te-review-actions .te-button { width: 100%; }
  .te-map-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .te-map-list article { flex: 0 0 82vw; scroll-snap-align: center; }
  .te-slide { min-height: 320px; padding: 30px 22px; }
  .te-slide::before { left: 22px; }
  .te-slide::after { right: 22px; }
  .te-slide-gallery { grid-template-columns: 1fr 1fr; height: 65%; }
  .te-slide-gallery article:nth-child(n+3) { display: none; }
}

@media print {
  body * { visibility: hidden !important; }
  .te-deck-preview,
  .te-deck-preview * { visibility: visible !important; }
  .te-deck-preview { position: absolute; inset: 0; margin: 0; padding: 0; border: 0; background: #fff; box-shadow: none; }
  .te-deck-toolbar { display: none !important; }
  .te-slide-stage { display: block !important; }
  .te-slide { break-after: page; page-break-after: always; width: 100%; min-height: 0; aspect-ratio: 16 / 9; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .te-app *,
  .te-app *::before,
  .te-app *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* --------------------------------------------------------------------------
 * v0.3.1 · Captura guiada / PDV catalog
 * Capture is intentionally a decision flow, not a traditional stacked form.
 * ----------------------------------------------------------------------- */
.te-capture-flow { max-width: 1440px; margin: 0 auto; padding-bottom: 28px; }
.te-capture-context {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--te-line); border-radius: 16px;
  background: color-mix(in srgb, var(--te-surface) 92%, transparent); box-shadow: var(--te-shadow-xs);
}
.te-context-person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.te-avatar-dot,.te-context-icon { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; color: var(--te-primary); background: linear-gradient(145deg,var(--te-primary-soft),var(--te-magenta-soft)); border: 1px solid color-mix(in srgb,var(--te-primary) 13%,var(--te-line)); }
.te-avatar-dot svg,.te-context-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.te-context-person div { min-width: 0; }
.te-context-person small,.te-context-person span { display: block; color: var(--te-muted); font-size: 10px; }
.te-context-person strong { display: block; max-width: 480px; overflow: hidden; color: var(--te-text-strong); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.te-context-pills { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.te-context-pills > span { display: inline-flex; align-items: center; min-height: 30px; padding: 6px 10px; border-radius: 999px; background: var(--te-surface-soft); color: var(--te-muted); font-size: 10px; font-weight: 680; }

.te-flow-steps {
  position: sticky; top: 8px; z-index: 22; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px;
  margin: 0 0 16px; padding: 6px; overflow: hidden; border: 1px solid var(--te-line); border-radius: 18px;
  background: color-mix(in srgb,var(--te-surface) 89%,transparent); box-shadow: 0 12px 34px rgba(42,23,59,.06);
  backdrop-filter: blur(18px) saturate(135%); -webkit-backdrop-filter: blur(18px) saturate(135%);
}
.te-flow-steps button { position: relative; display: grid; grid-template-columns: 30px minmax(0,1fr); grid-template-rows: auto auto; align-items: center; column-gap: 8px; min-width: 0; min-height: 52px; padding: 8px 10px; border: 0; border-radius: 13px; background: transparent; color: var(--te-muted); text-align: left; cursor: pointer; }
.te-flow-steps button b { grid-row: 1 / 3; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--te-line); border-radius: 10px; background: var(--te-surface); color: var(--te-subtle); font-size: 11px; transition: .18s ease; }
.te-flow-steps button span { overflow: hidden; color: inherit; font-size: 11px; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }
.te-flow-steps button small { overflow: hidden; color: var(--te-subtle); font-size: 8px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.te-flow-steps button.is-active { color: var(--te-primary); background: linear-gradient(145deg,var(--te-primary-soft),color-mix(in srgb,var(--te-magenta) 5%,var(--te-surface))); }
.te-flow-steps button.is-active b { border-color: transparent; background: linear-gradient(135deg,var(--te-magenta),var(--te-primary)); color: #fff; box-shadow: var(--te-shadow-accent); }
.te-flow-steps button.is-done b { border-color: color-mix(in srgb,var(--te-success) 25%,var(--te-line)); background: color-mix(in srgb,var(--te-success) 10%,var(--te-surface)); color: var(--te-success); }
.te-flow-stage { min-height: 430px; }
.te-capture-step { min-height: 410px; padding: clamp(18px,2vw,30px); border: 1px solid var(--te-line); border-radius: 22px; background: var(--te-surface); box-shadow: var(--te-shadow-sm); animation: teStepIn .22s var(--te-ease); }
@keyframes teStepIn { from { opacity: .25; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.te-step-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.te-step-head h2 { margin: 4px 0 4px; color: var(--te-text-strong); font-size: clamp(24px,2.2vw,34px); font-weight: 690; letter-spacing: -.035em; line-height: 1.05; }
.te-step-head p:not(.te-eyebrow) { max-width: 760px; margin: 0; color: var(--te-muted); font-size: 13px; }
.te-step-badge,.te-schema-badge { display: inline-flex; align-items: center; min-height: 30px; padding: 6px 10px; border: 1px solid color-mix(in srgb,var(--te-primary) 15%,var(--te-line)); border-radius: 999px; background: var(--te-primary-soft); color: var(--te-primary); font-size: 9px; font-weight: 760; white-space: nowrap; }

.te-choice-section { margin-top: 20px; }
.te-choice-section > h3,.te-inline-heading h3 { margin: 0 0 10px; color: var(--te-text-strong); font-size: 13px; font-weight: 730; }
.te-choice-section > p,.te-inline-heading p { margin: -5px 0 10px; color: var(--te-muted); font-size: 10px; }
.te-activity-choice-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.te-activity-choice { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 78px; padding: 12px; border: 1px solid var(--te-line); border-radius: 16px; background: var(--te-surface); color: var(--te-text); text-align: left; cursor: pointer; transition: transform .16s var(--te-ease),border-color .16s ease,box-shadow .16s ease,background .16s ease; }
.te-activity-choice:hover { transform: translateY(-2px); border-color: color-mix(in srgb,var(--te-primary) 25%,var(--te-line)); box-shadow: var(--te-shadow-sm); }
.te-activity-choice.is-selected { border-color: color-mix(in srgb,var(--te-primary) 35%,var(--te-line)); background: linear-gradient(145deg,var(--te-primary-soft),var(--te-surface)); box-shadow: var(--te-shadow-accent); }
.te-activity-choice-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(135deg,var(--te-magenta),var(--te-primary)); color: #fff; }
.te-activity-choice[data-tone="orange"] .te-activity-choice-icon { background: linear-gradient(135deg,#ffb11a,#f06b18); }
.te-activity-choice[data-tone="blue"] .te-activity-choice-icon { background: linear-gradient(135deg,#3f8cff,#5b5ff6); }
.te-activity-choice[data-tone="teal"] .te-activity-choice-icon { background: linear-gradient(135deg,#26c9b6,#069987); }
.te-activity-choice-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.te-activity-choice strong,.te-variation-choice strong { display: block; color: var(--te-text-strong); font-size: 12px; line-height: 1.18; }
.te-activity-choice small,.te-variation-choice small { display: block; margin-top: 4px; color: var(--te-muted); font-size: 9px; line-height: 1.3; }
.te-activity-choice i { color: var(--te-primary); font-style: normal; }
.te-variation-choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.te-variation-choice { min-width: 145px; max-width: 280px; flex: 1 1 175px; padding: 11px 12px; border: 1px solid var(--te-line); border-radius: 13px; background: var(--te-surface); text-align: left; cursor: pointer; transition: .15s ease; }
.te-variation-choice:hover,.te-variation-choice.is-selected { border-color: color-mix(in srgb,var(--te-primary) 32%,var(--te-line)); background: var(--te-primary-soft); box-shadow: var(--te-shadow-xs); }
.te-variation-choice.is-selected strong { color: var(--te-primary); }

.te-context-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.te-context-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px; border: 1px solid var(--te-line); border-radius: 16px; background: var(--te-surface-soft); }
.te-context-card div { min-width: 0; }
.te-context-card small { display: block; color: var(--te-subtle); font-size: 9px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.te-context-card strong { display: block; margin-top: 3px; color: var(--te-text-strong); font-size: 14px; }
.te-context-card p { margin: 3px 0 0; color: var(--te-muted); font-size: 9px; }
.te-inline-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.te-inline-choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.te-choice-pill,.te-soft-choice { min-height: 38px; padding: 8px 12px; border: 1px solid var(--te-line); border-radius: 999px; background: var(--te-surface); color: var(--te-text); font-size: 11px; font-weight: 680; cursor: pointer; }
.te-choice-pill:hover,.te-choice-pill.is-selected { border-color: color-mix(in srgb,var(--te-primary) 30%,var(--te-line)); background: var(--te-primary-soft); color: var(--te-primary); }
.te-soft-choice small { color: var(--te-subtle); font-weight: 550; }
.te-search-box { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 12px; border: 1px solid var(--te-line); border-radius: 13px; background: var(--te-surface); }
.te-search-box:focus-within { border-color: color-mix(in srgb,var(--te-primary) 35%,var(--te-line)); box-shadow: 0 0 0 3px color-mix(in srgb,var(--te-primary) 9%,transparent); }
.te-search-box svg { width: 17px; height: 17px; fill: none; stroke: var(--te-subtle); stroke-width: 1.8; }
.te-search-box input { min-height: 40px; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.te-pdv-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.te-pdv-choice { display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 9px; min-height: 64px; padding: 9px 10px; border: 1px solid var(--te-line); border-radius: 14px; background: var(--te-surface); text-align: left; cursor: pointer; }
.te-pdv-choice:hover,.te-pdv-choice.is-selected { border-color: color-mix(in srgb,var(--te-primary) 33%,var(--te-line)); background: var(--te-primary-soft); box-shadow: var(--te-shadow-xs); }
.te-pdv-choice strong { overflow: hidden; color: var(--te-text-strong); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.te-pdv-choice small { grid-column: 2; margin-top: -5px; overflow: hidden; color: var(--te-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.te-pdv-mark { grid-row: 1 / 3; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(145deg,var(--te-primary-soft),var(--te-magenta-soft)); color: var(--te-primary); font-size: 9px; font-weight: 800; }
.te-pdv-neutral .te-pdv-mark { background: var(--te-surface-soft); color: var(--te-muted); }
.te-pdv-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 94px; padding: 16px; border: 1px dashed var(--te-line); border-radius: 14px; color: var(--te-muted); text-align: center; font-size: 10px; }
.te-pdv-empty strong { color: var(--te-text-strong); font-size: 11px; }
.te-free-reference { margin-top: 10px; }
.te-context-extras { display: grid; grid-template-columns: minmax(260px,.8fr) minmax(0,1.2fr); gap: 12px; margin-top: 18px; }
.te-date-card { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px !important; padding: 11px 12px; border: 1px solid var(--te-line); border-radius: 14px; background: var(--te-surface-soft); }
.te-date-card > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--te-primary-soft); color: var(--te-primary); }
.te-date-card svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.te-date-card div { min-width: 0; width: 100%; }
.te-date-card small { color: var(--te-subtle); font-size: 9px; }
.te-date-card input { min-height: 30px !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.te-optional-person { position: relative; }
.te-optional-person > button { width: 100%; min-height: 58px; border-radius: 14px; text-align: left; }
.te-optional-person [data-role="person-panel"] { position: relative; margin-top: 8px; }

.te-dynamic-tabs { display: flex; gap: 7px; margin: 0 0 14px; padding-bottom: 3px; overflow-x: auto; scrollbar-width: none; }
.te-dynamic-tabs::-webkit-scrollbar { display: none; }
.te-dynamic-tabs button { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; min-height: 38px; padding: 7px 11px; border: 1px solid var(--te-line); border-radius: 999px; background: var(--te-surface); color: var(--te-muted); font-size: 10px; font-weight: 680; cursor: pointer; }
.te-dynamic-tabs button b { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--te-surface-soft); color: var(--te-subtle); font-size: 8px; }
.te-dynamic-tabs button.is-active { border-color: color-mix(in srgb,var(--te-primary) 28%,var(--te-line)); background: var(--te-primary-soft); color: var(--te-primary); }
.te-dynamic-tabs button.is-active b { background: linear-gradient(135deg,var(--te-magenta),var(--te-primary)); color: #fff; }
.te-dynamic-section { margin: 0; padding: 0; border: 0; }
.te-dynamic-section legend { width: 100%; margin: 0 0 14px; padding: 0; }
.te-dynamic-section legend strong { color: var(--te-text-strong); font-size: 15px; }
.te-dynamic-section legend small { display: block; margin-top: 3px; color: var(--te-muted); font-size: 10px; }
.te-dynamic-grid { gap: 10px; }
.te-dynamic-field { padding: 12px; border: 1px solid var(--te-line); border-radius: 14px; background: var(--te-surface-soft); }
.te-dynamic-field > span { color: var(--te-text-strong); font-size: 11px; font-weight: 700; }
.te-dynamic-field > span b { color: var(--te-magenta); }
.te-dynamic-field input:not([type="hidden"]),.te-dynamic-field textarea { margin-top: 2px; background: var(--te-surface); }
.te-dynamic-choice-grid { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.te-dynamic-choice-grid button { min-height: 36px; padding: 7px 11px; border: 1px solid var(--te-line); border-radius: 999px; background: var(--te-surface); color: var(--te-text); font-size: 10px; font-weight: 650; cursor: pointer; }
.te-dynamic-choice-grid button:hover,.te-dynamic-choice-grid button.is-selected { border-color: color-mix(in srgb,var(--te-primary) 34%,var(--te-line)); background: linear-gradient(145deg,var(--te-primary-soft),var(--te-magenta-soft)); color: var(--te-primary); }
.te-choice-checks { display: flex !important; flex-wrap: wrap; gap: 7px; }
.te-choice-checks label { flex: 0 0 auto !important; min-height: 36px; padding: 7px 11px; border: 1px solid var(--te-line); border-radius: 999px; background: var(--te-surface); cursor: pointer; }
.te-choice-checks label.is-selected { border-color: color-mix(in srgb,var(--te-primary) 34%,var(--te-line)); background: var(--te-primary-soft); color: var(--te-primary); }
.te-choice-checks input { position: absolute; opacity: 0; pointer-events: none; }
.te-fixed-value { margin-top: 4px; padding: 9px 10px; border-radius: 10px; background: var(--te-surface); }
.te-fixed-value strong { display: block; color: var(--te-text-strong); }
.te-fixed-value span { color: var(--te-muted); font-size: 8px; }

.te-confirm-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.te-confirm-item { min-height: 84px; padding: 13px; border: 1px solid var(--te-line); border-radius: 15px; background: var(--te-surface-soft); text-align: left; cursor: pointer; }
.te-confirm-item span { display: block; color: var(--te-subtle); font-size: 8px; font-weight: 720; letter-spacing: .06em; text-transform: uppercase; }
.te-confirm-item strong { display: block; margin-top: 5px; color: var(--te-text-strong); font-size: 12px; line-height: 1.25; }
.te-confirm-item i { display: block; margin-top: 8px; color: var(--te-primary); font-size: 8px; font-style: normal; font-weight: 700; }
.te-comments-card { margin-top: 12px; padding: 13px; border: 1px solid var(--te-line); border-radius: 15px; background: var(--te-surface); }
.te-comments-card small { color: var(--te-subtle); font-weight: 500; }
.te-confirm-message { display: flex; align-items: flex-start; gap: 11px; margin-top: 12px; padding: 13px; border: 1px solid color-mix(in srgb,var(--te-success) 20%,var(--te-line)); border-radius: 15px; background: color-mix(in srgb,var(--te-success) 6%,var(--te-surface)); }
.te-confirm-message > span { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--te-success); color: #fff; }
.te-confirm-message svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.te-confirm-message strong { color: var(--te-text-strong); font-size: 11px; }
.te-confirm-message p { margin: 3px 0 0; color: var(--te-muted); font-size: 9px; }
.te-flow-actions { position: sticky; bottom: 12px; z-index: 24; display: grid; grid-template-columns: minmax(120px,auto) 1fr minmax(140px,auto); align-items: center; gap: 10px; margin: 14px 0 0; padding: 8px; border: 1px solid var(--te-line); border-radius: 17px; background: color-mix(in srgb,var(--te-surface) 92%,transparent); box-shadow: 0 16px 42px rgba(43,23,59,.11); backdrop-filter: blur(20px) saturate(135%); -webkit-backdrop-filter: blur(20px) saturate(135%); }
.te-flow-actions [data-role="step-position"] { color: var(--te-muted); font-size: 10px; font-weight: 650; text-align: center; }
.te-flow-actions .te-primary { justify-self: end; min-width: 150px; }
.te-flow-back { justify-self: start; }

/* PDV administration */
.te-pdv-admin { display: grid; gap: 14px; }
.te-pdv-import-grid { display: grid; grid-template-columns: minmax(240px,1fr) auto; align-items: center; gap: 10px; }
.te-pdv-import-grid p { grid-column: 1 / -1; margin: 0; color: var(--te-muted); font-size: 10px; }
.te-file-wide { width: 100%; }
.te-pdv-manual { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; align-items: end; }
.te-pdv-manual-district { grid-column: span 2; }
.te-pdv-manual-district > span { display: block; margin-bottom: 6px; color: var(--te-muted); font-size: 10px; font-weight: 650; }
.te-search-inline { width: min(340px,100%); }
.te-pdv-admin-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.te-pdv-admin-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; min-width: 0; padding: 11px; border: 1px solid var(--te-line); border-radius: 14px; background: var(--te-surface-soft); }
.te-pdv-admin-row > div { min-width: 0; }
.te-pdv-admin-row strong,.te-pdv-admin-row span,.te-pdv-admin-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-pdv-admin-row strong { color: var(--te-text-strong); font-size: 11px; }
.te-pdv-admin-row span { color: var(--te-muted); font-size: 9px; }
.te-pdv-admin-row small { color: var(--te-subtle); font-size: 8px; }
.te-pdv-admin-row > div:last-child { text-align: right; }
.te-pdv-admin-row > div:last-child b { display: block; color: var(--te-primary); font-size: 8px; }

@media (max-width: 1180px) {
  .te-activity-choice-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .te-pdv-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .te-pdv-admin-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .te-capture-flow { padding-bottom: 118px; }
  .te-capture-context { align-items: flex-start; flex-direction: column; }
  .te-context-pills { justify-content: flex-start; }
  .te-flow-steps { top: 6px; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 16px; }
  .te-flow-steps button { flex: 0 0 116px; grid-template-columns: 27px minmax(0,1fr); min-height: 48px; padding: 7px 8px; scroll-snap-align: start; }
  .te-flow-steps button b { width: 27px; height: 27px; }
  .te-flow-steps button small { display: none; }
  .te-capture-step { min-height: 0; padding: 16px 14px; border-radius: 18px; }
  .te-step-head { flex-direction: column; gap: 8px; }
  .te-step-head h2 { font-size: 26px; }
  .te-activity-choice-grid { display: flex; overflow-x: auto; gap: 8px; padding: 0 1px 5px; scroll-snap-type: x mandatory; }
  .te-activity-choice { flex: 0 0 min(78vw,270px); min-height: 72px; scroll-snap-align: start; }
  .te-variation-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .te-variation-choice { min-width: 0; max-width: none; min-height: 58px; }
  .te-context-grid,.te-context-extras,.te-confirm-grid { grid-template-columns: 1fr; }
  .te-pdv-options { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 5px; scroll-snap-type: x mandatory; }
  .te-pdv-choice { flex: 0 0 min(72vw,250px); scroll-snap-align: start; }
  .te-dynamic-grid { grid-template-columns: 1fr; }
  .te-dynamic-field.te-span-2 { grid-column: auto; }
  .te-flow-actions { bottom: calc(92px + env(safe-area-inset-bottom,0px)); grid-template-columns: auto 1fr auto; margin-bottom: 6px; }
  .te-flow-actions [data-role="step-position"] { font-size: 9px; }
  .te-flow-actions .te-button { min-width: 0; padding-inline: 12px; }
  .te-flow-actions .te-primary { min-width: 0; }
  .te-pdv-import-grid,.te-pdv-manual,.te-pdv-admin-list { grid-template-columns: 1fr; }
  .te-pdv-manual-district { grid-column: auto; }
}
@media (max-width: 480px) {
  .te-variation-choice-grid { grid-template-columns: 1fr; }
  .te-flow-actions { grid-template-columns: auto 1fr auto; border-radius: 16px; }
  .te-flow-actions .te-button { font-size: 11px; }
}

/* Capture view gets a compact app-like header; the flow itself is the navigation. */
.te-app[data-view="capture"] .te-hero { margin-bottom: 12px; }
.te-app[data-view="capture"] .te-hero h1 { font-size: clamp(28px,2.5vw,38px); }
.te-app[data-view="capture"] .te-subtitle { max-width: 720px; }
@media (max-width: 760px) {
  .te-app[data-view="capture"] .te-hero { gap: 4px; margin-bottom: 8px; }
  .te-app[data-view="capture"] .te-hero-actions { display: none; }
  .te-app[data-view="capture"] .te-hero h1 { margin-top: 4px; font-size: 27px; }
  .te-app[data-view="capture"] .te-subtitle { margin-top: 6px; font-size: 11px; }
  .te-app[data-view="capture"] .te-view-nav { display: none; }
  .te-app[data-view="capture"] .te-shell { padding-inline: 10px; }
}

/* --------------------------------------------------------------------------
 * v0.3.3 · Visual density / responsive capture rail
 * Goal: the first useful decision must be visible without wasting half of the
 * viewport on chrome. No fixed overlays: the rail stays inside Core's canvas.
 * ----------------------------------------------------------------------- */
.te-capture-flow {
  --te-flow-progress: 0%;
  width: 100%;
  max-width: none;
  min-width: 0;
  padding-bottom: calc(18px + var(--te-core-nav-offset));
}

.te-flow-rail {
  position: sticky;
  top: 6px;
  z-index: 24;
  display: grid;
  grid-template-areas: "back steps forward";
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin: 0 0 10px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid var(--te-line);
  border-radius: 17px;
  background: color-mix(in srgb, var(--te-surface) 92%, transparent);
  box-shadow: 0 10px 30px rgba(42, 23, 59, .07);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.te-flow-back { grid-area: back; }
.te-flow-steps { grid-area: steps; }
.te-flow-forward { grid-area: forward; }

.te-flow-rail::after {
  content: "";
  position: absolute;
  left: 6px;
  bottom: 0;
  width: var(--te-flow-progress);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--te-magenta), var(--te-primary));
  transition: width .22s var(--te-ease);
}

.te-flow-steps {
  position: relative;
  top: auto;
  z-index: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.te-flow-steps button {
  min-height: 44px;
  padding: 5px 7px;
  border-radius: 11px;
}

.te-flow-steps button b {
  width: 26px;
  height: 26px;
  border-radius: 9px;
}

.te-flow-steps button span { font-size: 10px; }
.te-flow-steps button small { font-size: 7px; }

.te-flow-arrow {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--te-line);
  border-radius: 11px;
  background: var(--te-surface);
  color: var(--te-text);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.te-flow-arrow span { font-size: 17px; line-height: 1; }
.te-flow-arrow em,
.te-flow-forward em { font-style: normal; }

.te-flow-forward {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 7px;
}
.te-flow-forward > span {
  color: var(--te-muted);
  font-size: 9px;
  font-weight: 720;
  white-space: nowrap;
}
.te-flow-forward .te-button {
  min-height: 42px;
  width: clamp(118px, 13vw, 190px);
  min-width: 118px;
  max-width: 190px;
  padding: 9px 13px;
}

.te-flow-stage { min-height: 0; }
.te-capture-step {
  min-height: 0;
  padding: clamp(16px, 1.6vw, 24px);
  border-radius: 18px;
  box-shadow: var(--te-shadow-xs);
  scroll-margin-top: 82px;
}
.te-step-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 14px;
}
.te-step-head h2 { font-size: clamp(23px, 2vw, 31px); }
.te-step-head p:not(.te-eyebrow) { font-size: 12px; line-height: 1.4; }
.te-step-badge,
.te-schema-badge { min-height: 27px; padding: 5px 9px; }

.te-choice-section { margin-top: 13px; }
.te-choice-section > h3,
.te-inline-heading h3 { margin-bottom: 7px; }
.te-inline-heading { align-items: center; }
.te-inline-action {
  appearance: none;
  flex: 0 0 auto;
  min-height: 31px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--te-primary) 18%, var(--te-line));
  border-radius: 999px;
  background: var(--te-primary-soft);
  color: var(--te-primary);
  font-size: 9px;
  font-weight: 730;
  cursor: pointer;
}

.te-activity-choice-grid.has-selection .te-activity-choice.is-selected i::before {
  content: "✓";
}
.te-activity-choice-grid.has-selection .te-activity-choice.is-selected i { font-size: 0; }
.te-activity-choice-grid.has-selection .te-activity-choice.is-selected i::before { font-size: 13px; }

.te-variation-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 7px;
}
.te-variation-choice {
  min-width: 0;
  max-width: none;
  min-height: 52px;
  padding: 9px 10px;
}
.te-variation-choice small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.te-context-grid { gap: 9px; }
.te-context-card { padding: 11px; border-radius: 14px; }
.te-context-card .te-context-icon { width: 34px; height: 34px; border-radius: 10px; }
.te-context-card strong { font-size: 12px; }
.te-context-extras {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.te-pdv-options {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 7px;
}
.te-pdv-choice { min-height: 58px; }

.te-dynamic-tabs { margin-bottom: 10px; }
.te-dynamic-field { padding: 10px; }
.te-dynamic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.te-dynamic-field.te-span-2 { grid-column: 1 / -1; }
.te-dynamic-choice-grid button,
.te-choice-checks label { min-height: 34px; padding: 6px 10px; }

.te-confirm-grid {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 8px;
}
.te-confirm-item { min-height: 74px; padding: 11px; }

.te-app[data-view="capture"] .te-shell {
  padding-top: clamp(10px, 1vw, 16px);
  background:
    radial-gradient(520px 240px at 8% -5%, color-mix(in srgb, var(--te-primary) 5%, transparent), transparent 72%),
    radial-gradient(480px 220px at 92% -4%, color-mix(in srgb, var(--te-magenta) 4%, transparent), transparent 74%),
    var(--te-canvas);
}
.te-app[data-view="capture"] .te-shell::after { display: none; }
.te-app[data-view="capture"] .te-hero {
  align-items: center;
  margin-bottom: 8px;
}
.te-app[data-view="capture"] .te-hero h1 {
  margin-top: 4px;
  font-size: clamp(27px, 2.25vw, 35px);
}
.te-app[data-view="capture"] .te-subtitle {
  max-width: 760px;
  margin-top: 5px;
  font-size: 11px;
}
.te-app[data-view="capture"] .te-capture-context {
  min-height: 54px;
  margin-bottom: 8px;
  padding: 8px 10px;
}

@media (max-width: 760px) {
  .te-app[data-view="capture"] {
    --te-core-nav-offset: var(--krn-mobile-occupied-bottom, var(--krn-mobile-dock-total, 92px));
  }
  .te-app[data-view="capture"] .te-shell {
    padding: 8px 8px calc(18px + var(--te-core-nav-offset) + env(safe-area-inset-bottom, 0px));
  }
  .te-app[data-view="capture"] .te-hero {
    display: block;
    margin-bottom: 7px;
    padding-inline: 2px;
  }
  .te-app[data-view="capture"] .te-eyebrow { font-size: 9px; }
  .te-app[data-view="capture"] .te-hero h1 {
    margin-top: 2px;
    font-size: clamp(23px, 6vw, 28px);
    line-height: 1.02;
  }
  .te-app[data-view="capture"] .te-subtitle {
    display: -webkit-box;
    max-width: none;
    margin-top: 4px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.32;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .te-capture-context {
    align-items: center;
    flex-direction: row;
    min-height: 48px;
    gap: 8px;
  }
  .te-avatar-dot { width: 32px; height: 32px; border-radius: 10px; }
  .te-avatar-dot svg { width: 16px; height: 16px; }
  .te-context-person { gap: 8px; }
  .te-context-person strong { font-size: 11px; }
  .te-context-person small,
  .te-context-person span { font-size: 8px; }
  .te-context-pills {
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    min-width: 0;
  }
  .te-context-pills > span {
    min-height: 25px;
    max-width: 46%;
    padding: 4px 7px;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .te-flow-rail {
    top: 4px;
    grid-template-areas: "back steps forward";
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 4px;
    margin-bottom: 7px;
    padding: 4px;
    border-radius: 14px;
  }
  .te-flow-arrow {
    width: 36px;
    min-height: 36px;
    padding: 0;
  }
  .te-flow-arrow em { display: none; }
  .te-flow-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    overflow: visible;
  }
  .te-flow-steps button {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    grid-template-rows: auto;
    min-height: 36px;
    padding: 3px 4px;
    column-gap: 4px;
  }
  .te-flow-steps button b {
    grid-row: auto;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    font-size: 9px;
  }
  .te-flow-steps button span { font-size: 8px; }
  .te-flow-steps button small { display: none; }
  .te-flow-forward { grid-template-columns: auto; gap: 0; }
  .te-flow-forward > span { display: none; }
  .te-flow-forward .te-button {
    min-width: 88px;
    min-height: 36px;
    padding: 7px 10px;
    font-size: 10px;
  }

  .te-capture-step {
    padding: 12px;
    border-radius: 15px;
    box-shadow: none;
    scroll-margin-top: 62px;
  }
  .te-step-head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 9px;
  }
  .te-step-head h2 { margin-top: 2px; font-size: 21px; }
  .te-step-head p:not(.te-eyebrow) {
    display: -webkit-box;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.32;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .te-step-badge,
  .te-schema-badge {
    min-height: 24px;
    padding: 4px 7px;
    font-size: 7px;
  }

  .te-choice-section { margin-top: 9px; }
  .te-choice-section > h3,
  .te-inline-heading h3 { margin-bottom: 5px; font-size: 11px; }
  .te-choice-section > p,
  .te-inline-heading p { margin-bottom: 7px; font-size: 8px; }

  .te-activity-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 0;
    overflow: visible;
  }
  .te-activity-choice {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    min-height: 60px;
    padding: 8px;
    border-radius: 13px;
    scroll-snap-align: none;
  }
  .te-activity-choice-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
  .te-activity-choice-icon svg { width: 17px; height: 17px; }
  .te-activity-choice strong { font-size: 10px; }
  .te-activity-choice small { margin-top: 2px; font-size: 7px; }
  .te-activity-choice-grid.has-selection .te-activity-choice:not(.is-selected) { display: none; }
  .te-activity-choice-grid.has-selection .te-activity-choice.is-selected {
    grid-column: 1 / -1;
    min-height: 52px;
  }

  .te-variation-section { margin-top: 8px; }
  .te-variation-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .te-variation-choice {
    min-height: 47px;
    padding: 8px;
    border-radius: 11px;
  }
  .te-variation-choice strong { font-size: 10px; }
  .te-variation-choice small {
    margin-top: 2px;
    font-size: 7px;
    -webkit-line-clamp: 1;
  }

  .te-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .te-context-card { gap: 7px; padding: 8px; }
  .te-context-card .te-context-icon { width: 30px; height: 30px; }
  .te-context-card small { font-size: 7px; }
  .te-context-card strong { font-size: 10px; }
  .te-context-card p { display: none; }

  .te-pdv-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(250px, 34vh);
    gap: 6px;
    padding: 0 2px 2px 0;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: none;
  }
  .te-pdv-choice {
    min-height: 54px;
    padding: 7px;
    scroll-snap-align: none;
  }
  .te-pdv-choice strong { font-size: 9px; }
  .te-pdv-choice small { font-size: 7px; }
  .te-pdv-mark { width: 30px; height: 30px; }

  .te-context-extras {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 7px;
    margin-top: 9px;
  }
  .te-date-card { padding: 8px; }
  .te-optional-person > button { min-height: 48px; }

  .te-dynamic-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 7px;
  }
  .te-dynamic-field.te-span-2 { grid-column: 1 / -1; }
  .te-dynamic-field { padding: 9px; border-radius: 11px; }
  .te-dynamic-field > span { font-size: 9px; }
  .te-field-help { font-size: 7px; }
  .te-dynamic-tabs button { min-height: 33px; padding: 5px 8px; font-size: 8px; }
  .te-dynamic-tabs button b { width: 18px; height: 18px; }

  .te-confirm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .te-confirm-item { min-height: 67px; padding: 9px; }
  .te-comments-card,
  .te-confirm-message { margin-top: 8px; padding: 10px; }

  .te-flow-actions { display: none !important; }
}

@media (max-width: 480px) {
  .te-context-pills > span:last-child { display: none; }
  .te-context-pills > span { max-width: 100%; }
  .te-flow-steps button {
    grid-template-columns: 1fr;
    grid-template-rows: 22px auto;
    place-items: center;
    min-height: 40px;
    padding: 3px 1px 2px;
    row-gap: 1px;
  }
  .te-flow-steps button b { grid-row: 1; }
  .te-flow-steps button span {
    display: block;
    width: 100%;
    overflow: hidden;
    font-size: clamp(6px, 1.8vw, 7px);
    line-height: 1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .te-flow-forward .te-button { min-width: 38px; width: 38px; padding: 0; }
  .te-flow-forward .te-button em { display: none; }
  .te-flow-forward .te-button svg { width: 16px; height: 16px; }
  .te-activity-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-activity-choice { grid-template-columns: 31px minmax(0, 1fr); }
  .te-activity-choice i { display: none; }
  .te-activity-choice-icon { width: 31px; height: 31px; }
  .te-variation-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-inline-action { padding-inline: 8px; font-size: 7px; }
  .te-context-extras { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .te-activity-choice-grid,
  .te-variation-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-context-grid,
  .te-pdv-options,
  .te-confirm-grid { grid-template-columns: 1fr; }
  .te-activity-choice { grid-template-columns: 28px minmax(0, 1fr); padding: 7px; }
  .te-activity-choice-icon { width: 28px; height: 28px; }
  .te-activity-choice strong { font-size: 9px; }
  .te-activity-choice-grid.has-selection .te-activity-choice.is-selected { grid-column: 1 / -1; }
  .te-step-badge { display: none; }
}

/* Capture status and density refinements. */
.te-context-pills > span[data-state="ready"] {
  background: color-mix(in srgb, var(--te-success) 9%, var(--te-surface));
  color: color-mix(in srgb, var(--te-success) 86%, var(--te-text));
}
.te-context-pills > span[data-state="pending"] {
  background: color-mix(in srgb, var(--te-orange) 10%, var(--te-surface));
  color: color-mix(in srgb, var(--te-orange) 72%, var(--te-text));
}
.te-flow-forward { min-width: 0; justify-self: end; }
.te-flow-forward .te-button { justify-self: end; }
.te-flow-steps button,
.te-activity-choice,
.te-variation-choice,
.te-pdv-choice { max-width: 100%; }

@media (min-width: 521px) and (max-width: 760px) {
  .te-activity-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .te-activity-choice-grid.has-selection .te-activity-choice.is-selected { grid-column: 1 / -1; }
}

/* v0.3.3 specificity guard: WordPress/Core resets button typography with `font: inherit`. */
.te-app .te-flow-arrow {
  font-size: 11px;
  line-height: 1;
}
.te-app .te-inline-action {
  font-size: 9px;
  line-height: 1;
}
.te-app .te-choice-pill,
.te-app .te-soft-choice {
  font-size: 11px;
  line-height: 1.2;
}
@media (max-width: 480px) {
  .te-app .te-inline-action { font-size: 8px; }
}


/* --------------------------------------------------------------------------
 * v0.3.4 · Host collision shield + narrow-web integrity
 *
 * The 0.3.3 rules were correct in the isolated harness, but some Core/theme
 * combinations retained older flex/min-height declarations. These scoped
 * rules are intentionally final and stronger: no horizontal mystery cards,
 * no 400px empty stage, and no dependency on container-query support alone.
 * ----------------------------------------------------------------------- */
.te-app[data-view="capture"] .te-flow-stage {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
}

.te-app[data-view="capture"] .te-capture-step {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  align-content: start !important;
  justify-content: start !important;
}

.te-app[data-view="capture"] .te-step-head {
  margin-bottom: 12px !important;
}

.te-app[data-view="capture"] .te-step-head + .te-choice-section {
  margin-top: 0 !important;
}

.te-app[data-view="capture"] .te-choice-section {
  width: 100% !important;
  min-width: 0 !important;
}

.te-app[data-view="capture"] .te-activity-choice-grid,
.te-app[data-view="capture"] .te-variation-choice-grid,
.te-app[data-view="capture"] .te-pdv-options {
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
  overscroll-behavior: auto !important;
  scroll-snap-type: none !important;
}

.te-app[data-view="capture"] .te-activity-choice,
.te-app[data-view="capture"] .te-variation-choice,
.te-app[data-view="capture"] .te-pdv-choice {
  min-width: 0 !important;
  max-width: 100% !important;
  width: auto !important;
  flex: none !important;
  scroll-snap-align: none !important;
}

/* Fallback by viewport for Safari/embedded shells that do not honor the
 * module container query during their first layout pass. */
@media (max-width: 760px) {
  .te-app[data-view="capture"] .te-flow-stage,
  .te-app[data-view="capture"] .te-capture-step {
    min-height: 0 !important;
    height: auto !important;
  }

  .te-app[data-view="capture"] .te-activity-choice-grid,
  .te-app[data-view="capture"] .te-variation-choice-grid,
  .te-app[data-view="capture"] .te-pdv-options {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .te-app[data-view="capture"] .te-activity-choice {
    display: grid !important;
    grid-template-columns: 36px minmax(0, 1fr) !important;
    min-height: 66px !important;
    padding: 8px 9px !important;
  }

  .te-app[data-view="capture"] .te-activity-choice > i {
    display: none !important;
  }

  .te-app[data-view="capture"] .te-variation-choice {
    display: block !important;
    min-height: 44px !important;
    padding: 8px 9px !important;
  }

  .te-app[data-view="capture"] .te-pdv-choice {
    display: grid !important;
    grid-template-columns: 31px minmax(0, 1fr) !important;
    min-height: 56px !important;
    padding: 7px 8px !important;
  }

  .te-app[data-view="capture"] .te-step-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: start !important;
    gap: 8px !important;
    padding-bottom: 10px !important;
  }

  .te-app[data-view="capture"] .te-step-head > div {
    min-width: 0 !important;
  }

  .te-app[data-view="capture"] .te-choice-section > h3 {
    margin-bottom: 8px !important;
  }
}

@media (max-width: 390px) {
  .te-app[data-view="capture"] .te-activity-choice-grid,
  .te-app[data-view="capture"] .te-variation-choice-grid,
  .te-app[data-view="capture"] .te-pdv-options {
    gap: 7px !important;
  }

  .te-app[data-view="capture"] .te-activity-choice {
    grid-template-columns: 32px minmax(0, 1fr) !important;
    min-height: 62px !important;
    padding: 7px !important;
  }

  .te-app[data-view="capture"] .te-activity-choice-icon {
    width: 32px !important;
    height: 32px !important;
  }
}

/* Rendering performance: off-screen report/catalog sections do not block the
 * first capture decision. Safari ignores unsupported properties safely. */
.te-app:not([data-view="capture"]) .te-panel,
.te-app:not([data-view="capture"]) .te-dashboard-lower,
.te-app:not([data-view="capture"]) .te-catalog-dashboard {
  content-visibility: auto;
  contain-intrinsic-size: 1px 420px;
}

/* --------------------------------------------------------------------------
 * v0.3.4 · Actual module-width responsive contract
 *
 * Core can place this module in a 500–800px split canvas while the outer
 * browser remains 1440px wide. JavaScript adds te-layout-* from the measured
 * module width, so these rules are deterministic in Safari, drawers and web.
 * ----------------------------------------------------------------------- */
.te-app[data-view="capture"] .te-shell {
  min-height: 0 !important;
  overflow: visible !important;
}
.te-app[data-view="capture"] .te-capture-flow {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
}
.te-app[data-view="capture"] .te-flow-stage,
.te-app[data-view="capture"] .te-capture-step,
.te-app[data-view="capture"] .te-choice-section,
.te-app[data-view="capture"] [data-role="activity-options"],
.te-app[data-view="capture"] [data-role="variation-options"],
.te-app[data-view="capture"] [data-role="pdv-options"] {
  min-width: 0 !important;
  max-width: 100% !important;
}

/* Wide module canvas, regardless of the outer viewport. */
.te-app.te-layout-wide[data-view="capture"] .te-activity-choice-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}
.te-app.te-layout-wide[data-view="capture"] .te-pdv-options {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

/* Medium canvas: three balanced columns, never a clipped carousel. */
.te-app.te-layout-medium[data-view="capture"] .te-activity-choice-grid,
.te-app.te-layout-medium[data-view="capture"] .te-pdv-options {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  overflow: visible !important;
  scroll-snap-type: none !important;
}
.te-app.te-layout-medium[data-view="capture"] .te-variation-choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* Split desktop and mobile canvas: two columns and a two-row action rail. */
.te-app.te-layout-compact[data-view="capture"] .te-flow-rail {
  grid-template-areas:
    "steps steps"
    "back forward" !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  gap: 4px 7px !important;
  padding: 5px !important;
  overflow: visible !important;
}
.te-app.te-layout-compact[data-view="capture"] .te-flow-steps {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  width: 100% !important;
  overflow: visible !important;
}
.te-app.te-layout-compact[data-view="capture"] .te-flow-back {
  width: auto !important;
  min-width: 42px !important;
  padding-inline: 10px !important;
  justify-self: start !important;
}
.te-app.te-layout-compact[data-view="capture"] .te-flow-forward {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  min-width: 0 !important;
  justify-self: stretch !important;
}
.te-app.te-layout-compact[data-view="capture"] .te-flow-forward .te-button {
  width: auto !important;
  min-width: 118px !important;
  max-width: none !important;
  padding-inline: 14px !important;
}
.te-app.te-layout-compact[data-view="capture"] .te-flow-forward .te-button em {
  display: inline !important;
}
.te-app.te-layout-compact[data-view="capture"] .te-activity-choice-grid,
.te-app.te-layout-compact[data-view="capture"] .te-variation-choice-grid,
.te-app.te-layout-compact[data-view="capture"] .te-pdv-options {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  scroll-snap-type: none !important;
}
.te-app.te-layout-compact[data-view="capture"] .te-activity-choice:last-child:nth-child(odd),
.te-app.te-layout-compact[data-view="capture"] .te-pdv-empty {
  grid-column: 1 / -1 !important;
}
.te-app.te-layout-compact[data-view="capture"] .te-activity-choice-grid.has-selection .te-activity-choice.is-selected {
  grid-column: 1 / -1 !important;
}
.te-app.te-layout-compact[data-view="capture"] .te-activity-choice,
.te-app.te-layout-compact[data-view="capture"] .te-variation-choice,
.te-app.te-layout-compact[data-view="capture"] .te-pdv-choice {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex-basis: auto !important;
  overflow: hidden !important;
  scroll-snap-align: none !important;
}
.te-app.te-layout-compact[data-view="capture"] .te-capture-step {
  padding: 12px !important;
}
.te-app.te-layout-compact[data-view="capture"] .te-step-head {
  margin-bottom: 9px !important;
  padding-bottom: 0 !important;
}
.te-app.te-layout-compact[data-view="capture"] .te-choice-section {
  margin-top: 9px !important;
}

/* Small phones retain text on the primary action and never hide the next step. */
.te-app.te-layout-narrow[data-view="capture"] .te-flow-forward .te-button {
  min-width: 112px !important;
  min-height: 38px !important;
}
.te-app.te-layout-narrow[data-view="capture"] .te-flow-forward .te-button em {
  display: inline !important;
}
.te-app.te-layout-narrow[data-view="capture"] .te-flow-back em {
  display: none !important;
}
.te-app.te-layout-narrow[data-view="capture"] .te-flow-steps button {
  grid-template-columns: 1fr !important;
  grid-template-rows: 22px auto !important;
  place-items: center !important;
  min-height: 40px !important;
  padding: 3px 1px 2px !important;
}
.te-app.te-layout-narrow[data-view="capture"] .te-flow-steps button b {
  grid-row: 1 !important;
}
.te-app.te-layout-narrow[data-view="capture"] .te-flow-steps button span {
  display: block !important;
  width: 100% !important;
  font-size: 7px !important;
  line-height: 1 !important;
  text-align: center !important;
}

/* Homogeneous card text: Core/Theme may otherwise force nowrap/min-content. */
.te-app[data-view="capture"] .te-activity-choice > span,
.te-app[data-view="capture"] .te-variation-choice,
.te-app[data-view="capture"] .te-pdv-choice {
  min-width: 0 !important;
}
.te-app[data-view="capture"] .te-activity-choice strong,
.te-app[data-view="capture"] .te-activity-choice small,
.te-app[data-view="capture"] .te-variation-choice strong,
.te-app[data-view="capture"] .te-variation-choice small,
.te-app[data-view="capture"] .te-pdv-choice strong,
.te-app[data-view="capture"] .te-pdv-choice small {
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
}
.te-app[data-view="capture"] .te-activity-choice strong,
.te-app[data-view="capture"] .te-variation-choice strong {
  white-space: normal !important;
}

/* Visible product identity inside saved/presented decks. */
.te-slide::before { content: "DESARROLLO COMERCIAL"; }


/* v0.3.4 · Container-native fallback. Core can expose a narrow module inside a
 * wide browser window; these rules react to the module itself before JS runs. */
.te-choice-loading {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.te-choice-loading > span {
  display: block;
  min-height: 64px;
  border: 1px solid var(--te-line-soft);
  border-radius: 13px;
  background: linear-gradient(100deg, var(--te-surface-soft) 20%, color-mix(in srgb, var(--te-primary) 7%, var(--te-surface)) 42%, var(--te-surface-soft) 64%);
  background-size: 220% 100%;
  animation: teSkeleton 1.25s linear infinite;
}
@container te-module (max-width: 820px) {
  .te-app[data-view="capture"] .te-hero { margin-bottom: 8px; }
  .te-app[data-view="capture"] .te-view-nav { display: none; }
  .te-app[data-view="capture"] .te-capture-context { margin-bottom: 8px; }
  .te-app[data-view="capture"] .te-flow-stage,
  .te-app[data-view="capture"] .te-capture-step { min-height: 0 !important; height: auto !important; }
  .te-app[data-view="capture"] .te-activity-choice-grid,
  .te-app[data-view="capture"] .te-variation-choice-grid,
  .te-app[data-view="capture"] .te-pdv-options {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 0 !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
  }
  .te-app[data-view="capture"] .te-activity-choice:last-child:nth-child(odd),
  .te-app[data-view="capture"] .te-pdv-empty { grid-column: 1 / -1; }
  .te-app[data-view="capture"] .te-capture-step { padding: 12px !important; }
  .te-app[data-view="capture"] .te-step-head { margin-bottom: 9px !important; }
  .te-app[data-view="capture"] .te-choice-section { margin-top: 9px !important; }
  .te-choice-loading { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container te-module (max-width: 520px) {
  .te-app[data-view="capture"] .te-shell { padding-inline: 10px; }
  .te-app[data-view="capture"] .te-hero h1 { font-size: clamp(25px, 8vw, 32px); }
  .te-app[data-view="capture"] .te-subtitle { font-size: 11px; }
  .te-app[data-view="capture"] .te-capture-context { padding: 8px 10px; }
  .te-app[data-view="capture"] .te-step-head > div > p:last-child { font-size: 9px; }
}
@container te-module (max-width: 360px) {
  .te-app[data-view="capture"] .te-activity-choice-grid,
  .te-app[data-view="capture"] .te-variation-choice-grid { grid-template-columns: 1fr !important; }
  .te-choice-loading { grid-template-columns: 1fr; }
}

/* Hidden flow phases must remain out of layout even under the host-collision shield. */
.te-app[data-view="capture"] .te-capture-step[hidden] { display: none !important; }


/* --------------------------------------------------------------------------
 * v0.3.5 · KES Adaptive Canvas
 *
 * The module is now an app fitted to Core's real canvas, not a long document.
 * The shell never scrolls horizontally. Header/navigation stay in place and
 * only the workspace (or the current capture phase) scrolls vertically when
 * the available height is insufficient.
 * ----------------------------------------------------------------------- */
.te-app[data-kes-layout="adaptive-canvas"] {
  min-height: 0 !important;
  overflow: hidden !important;
}

.te-app[data-kes-layout="adaptive-canvas"][data-adaptive-canvas="ready"] {
  height: var(--kes-app-height) !important;
  max-height: var(--kes-app-height) !important;
}

.te-app[data-kes-layout="adaptive-canvas"] .te-shell {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  gap: var(--kes-app-gap, 10px) !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  padding: var(--kes-app-padding-block, 10px) var(--kes-app-padding-inline, 14px) !important;
  overflow: hidden !important;
}

.te-app[data-kes-layout="adaptive-canvas"] .te-hero,
.te-app[data-kes-layout="adaptive-canvas"] .te-view-nav,
.te-app[data-kes-layout="adaptive-canvas"] .te-status,
.te-app[data-kes-layout="adaptive-canvas"] .te-workspace {
  min-width: 0;
  max-width: 100%;
  margin-top: 0;
  margin-bottom: 0;
}

.te-app[data-kes-layout="adaptive-canvas"] .te-hero {
  align-items: center;
  gap: 14px;
  padding: 0 2px;
}

.te-app[data-kes-layout="adaptive-canvas"] .te-hero h1 {
  font-size: clamp(26px, 2.45cqi, 40px);
}

.te-app[data-kes-layout="adaptive-canvas"] .te-subtitle {
  margin-top: 5px;
  font-size: clamp(10px, .88cqi, 13px);
}

.te-app[data-kes-layout="adaptive-canvas"] .te-view-nav {
  width: 100%;
  overflow-x: hidden;
  overscroll-behavior: none;
}

.te-app[data-kes-layout="adaptive-canvas"] .te-status:not([hidden]) {
  position: absolute;
  z-index: 80;
  top: calc(var(--kes-app-padding-block, 10px) + 4px);
  right: var(--kes-app-padding-inline, 14px);
  width: min(440px, calc(100% - 28px));
  margin: 0;
  box-shadow: var(--te-shadow-md);
}

.te-app[data-kes-layout="adaptive-canvas"] .te-workspace {
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto;
  padding: 0 2px 2px 0;
}

/* Capture owns its own internal scroll region. */
.te-app[data-kes-layout="adaptive-canvas"][data-view="capture"] .te-workspace {
  display: block;
  overflow: hidden !important;
  padding: 0;
}

.te-app[data-kes-layout="adaptive-canvas"][data-view="capture"] .te-capture-flow {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  gap: 8px;
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.te-app[data-kes-layout="adaptive-canvas"][data-view="capture"] .te-capture-context,
.te-app[data-kes-layout="adaptive-canvas"][data-view="capture"] .te-flow-rail {
  position: relative !important;
  top: auto !important;
  margin: 0 !important;
}

.te-app[data-kes-layout="adaptive-canvas"][data-view="capture"] .te-flow-stage {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

.te-app[data-kes-layout="adaptive-canvas"][data-view="capture"] .te-capture-step {
  width: 100% !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-height: 100% !important;
  margin: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.te-app[data-kes-layout="adaptive-canvas"][data-view="capture"] .te-capture-step[hidden] {
  display: none !important;
}

.te-app[data-kes-layout="adaptive-canvas"][data-view="capture"] .te-capture-step::-webkit-scrollbar {
  width: 6px;
}

.te-app[data-kes-layout="adaptive-canvas"][data-view="capture"] .te-capture-step::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--te-primary) 18%, transparent);
}

/* Height-aware density: do not shrink blindly; remove secondary chrome first. */
.te-app[data-kes-density="compact"] .te-hero {
  gap: 10px;
}
.te-app[data-kes-density="compact"] .te-hero h1 {
  margin-top: 2px;
  font-size: clamp(25px, 2.2cqi, 34px);
}
.te-app[data-kes-density="compact"] .te-subtitle {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.te-app[data-kes-density="compact"] .te-view-nav {
  min-height: 36px;
  padding-block: 3px;
}
.te-app[data-kes-density="compact"] .te-view-link {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 10px;
}

.te-app[data-kes-density="dense"] .te-hero-actions {
  gap: 6px;
  padding-top: 0;
}
.te-app[data-kes-density="dense"] .te-hero-actions .te-button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 10px;
}
.te-app[data-kes-density="dense"] .te-hero h1 {
  margin-top: 1px;
  font-size: clamp(23px, 7cqi, 30px);
}
.te-app[data-kes-density="dense"] .te-subtitle {
  display: none;
}
.te-app[data-kes-density="dense"] .te-capture-context {
  min-height: 42px;
  padding: 6px 8px;
}
.te-app[data-kes-density="dense"] .te-flow-rail {
  padding: 3px !important;
}
.te-app[data-kes-density="dense"] .te-flow-steps button {
  min-height: 36px;
  padding-block: 3px;
}
.te-app[data-kes-density="dense"] .te-capture-step {
  padding: 10px !important;
}

/* No primary carousel / no page sliding: visual modules reflow into grids. */
@container te-module (max-width: 760px) {
  .te-app[data-kes-layout="adaptive-canvas"] .te-kpis,
  .te-app[data-kes-layout="adaptive-canvas"] .te-family-grid-catalog,
  .te-app[data-kes-layout="adaptive-canvas"] .te-card-grid,
  .te-app[data-kes-layout="adaptive-canvas"] .te-map-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 0 !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
  }

  .te-app[data-kes-layout="adaptive-canvas"] .te-kpi,
  .te-app[data-kes-layout="adaptive-canvas"] .te-family-card,
  .te-app[data-kes-layout="adaptive-canvas"] .te-card,
  .te-app[data-kes-layout="adaptive-canvas"] .te-map-list article {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: none !important;
    scroll-snap-align: none !important;
  }

  .te-app[data-kes-layout="adaptive-canvas"] .te-view-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    padding: 4px;
    overflow: hidden;
  }
  .te-app[data-kes-layout="adaptive-canvas"] .te-view-link {
    justify-content: center;
    min-width: 0;
    padding-inline: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@container te-module (max-width: 520px) {
  .te-app[data-kes-layout="adaptive-canvas"] .te-hero-actions {
    display: none;
  }
  .te-app[data-kes-layout="adaptive-canvas"] .te-view-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .te-app[data-kes-layout="adaptive-canvas"]:not([data-view="capture"]) .te-hero {
    margin-bottom: 0;
  }
  .te-app[data-kes-layout="adaptive-canvas"] .te-kpis,
  .te-app[data-kes-layout="adaptive-canvas"] .te-family-grid-catalog,
  .te-app[data-kes-layout="adaptive-canvas"] .te-card-grid,
  .te-app[data-kes-layout="adaptive-canvas"] .te-map-list {
    grid-template-columns: 1fr !important;
  }
}

/* Tables and maps remain contained inside the application; they never widen it. */
.te-app[data-kes-layout="adaptive-canvas"] .te-table-wrap,
.te-app[data-kes-layout="adaptive-canvas"] .te-map,
.te-app[data-kes-layout="adaptive-canvas"] .te-deck-preview {
  max-width: 100%;
  overscroll-behavior: contain;
}

.te-app[data-kes-layout="adaptive-canvas"] .te-map {
  height: clamp(320px, 100%, 680px);
  min-height: min(380px, 100%);
}

/* Presentation/fullscreen and print explicitly escape the application lock. */
.te-app[data-kes-layout="adaptive-canvas"] .te-deck-preview:fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  overflow: hidden;
}

@media print {
  .te-app[data-kes-layout="adaptive-canvas"],
  .te-app[data-kes-layout="adaptive-canvas"] .te-shell,
  .te-app[data-kes-layout="adaptive-canvas"] .te-workspace,
  .te-app[data-kes-layout="adaptive-canvas"] .te-capture-flow,
  .te-app[data-kes-layout="adaptive-canvas"] .te-flow-stage,
  .te-app[data-kes-layout="adaptive-canvas"] .te-capture-step {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
}
