/*
 * Eclipse · Operación interna — mismo sistema visual que el portal de clientes de Eclipse-Web
 * (app/globals.css + components/portal/portal.css): fondo dawn con una sola luz arriba a la
 * derecha, un momento serif por página, readouts en mono, PhaseGlyph para las etapas y
 * ámbar solo donde hay que actuar.
 */

@font-face { font-family: "Geist"; src: url("./assets/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("./assets/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("./assets/fonts/InstrumentSerif-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("./assets/fonts/InstrumentSerif-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --void: #05050a;
  --corona: #f5b942;
  --flare: #ffe8b0;
  --dawn: #f4efe6;
  --ink: #111114;
  --corona-deep: #8a5a00; /* 5.2:1 sobre dawn */
  --mist-ink: #5b5866; /* 6.0:1 sobre dawn */
  --late: #9b3731;

  --fg: var(--ink);
  --fg-muted: var(--mist-ink);
  --accent: var(--corona-deep);
  --line: rgb(17 17 20 / 0.12);
  --line-strong: rgb(17 17 20 / 0.22);
  --surface: rgb(255 255 255 / 0.62);
  --surface-strong: rgb(255 255 255 / 0.9);
  --focus: var(--corona-deep);

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --header-h: 64px;
  --gutter: 16px;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
@media (min-width: 768px) {
  :root { --gutter: 32px; --header-h: 72px; }
}

/* ---- Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--dawn); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100dvh; font-family: var(--font-sans); color: var(--fg); background: var(--dawn);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overflow-x: clip;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
svg { display: block; }
::selection { background: var(--corona); color: var(--void); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.skip-link {
  position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-160%);
  padding: 12px 18px; border-radius: 999px; background: var(--corona); color: var(--void); font-weight: 500;
}
.skip-link:focus { transform: none; }

.container-x { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---- Lenguaje de instrumento -------------------------------------------------- */
.display { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.02em; line-height: 0.98; }
.display em { font-style: italic; color: var(--accent); }
.label {
  font-family: var(--font-mono); font-size: 0.6875rem; line-height: 1rem; font-weight: 450;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted);
}
.readout { font-family: var(--font-mono); font-variant-numeric: tabular-nums slashed-zero; letter-spacing: -0.02em; }
.ticks {
  --tick: 10px; --tick-c: var(--line-strong); --tick-g: linear-gradient(var(--tick-c), var(--tick-c));
  background-image: var(--tick-g), var(--tick-g), var(--tick-g), var(--tick-g), var(--tick-g), var(--tick-g), var(--tick-g), var(--tick-g);
  background-repeat: no-repeat;
  background-size: var(--tick) 1px, 1px var(--tick), var(--tick) 1px, 1px var(--tick), var(--tick) 1px, 1px var(--tick), var(--tick) 1px, 1px var(--tick);
  background-position: top left, top left, top right, top right, bottom left, bottom left, bottom right, bottom right;
}
.badge-demo {
  display: inline-flex; align-items: center; gap: 0.35rem; height: 1.5rem; padding: 0 0.6rem; border-radius: 999px;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--void); background: var(--corona);
}

/* ---- Botones ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 48px; padding: 0 1.5rem;
  border-radius: 999px; border: 1px solid transparent; font-weight: 500; font-size: 0.975rem; line-height: 1; white-space: nowrap;
  transition: transform 0.25s var(--ease-expo), box-shadow 0.35s var(--ease-expo), background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--corona); color: var(--void); box-shadow: 0 10px 40px -14px rgb(245 185 66 / 0.7); }
.btn-primary:hover { box-shadow: 0 0 0 6px rgb(245 185 66 / 0.14), 0 14px 48px -12px rgb(245 185 66 / 0.85); }
.btn-ghost { border-color: var(--line-strong); color: var(--fg); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); background: var(--surface); }
.btn-ink { background: var(--ink); color: var(--dawn); }
.btn-ink:hover { background: #000; }
.btn-danger { border-color: rgb(155 55 49 / 0.4); color: var(--late); background: transparent; }
.btn-danger:hover { border-color: var(--late); background: rgb(155 55 49 / 0.06); }
.btn-sm { min-height: 44px; padding: 0 1.1rem; font-size: 0.9rem; }
.btn-open svg { transition: transform 0.25s var(--ease-expo); }
.btn-open:hover svg { transform: translateX(3px); }

.pt-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 0.9375rem; font-weight: 500; color: var(--fg);
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.pt-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.pt-link svg { width: 16px; height: 16px; flex: none; }
.pt-link-danger { color: var(--late); }

/* ---- Header ----------------------------------------------------------------- */
.pt-header {
  position: fixed; inset: 0 0 auto; z-index: 50; background: rgb(244 239 230 / 0.82); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
}
.pt-header-row { display: flex; align-items: center; gap: 8px; height: var(--header-h); }
.pt-brand { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-left: -4px; padding: 0 4px; border-radius: 999px; }
.pt-brand svg { color: var(--accent); }
.pt-brand-name { font-size: 0.8rem; font-weight: 500; letter-spacing: 0.32em; }
.pt-brand-label {
  display: none; align-items: center; gap: 0.75rem; margin-left: 4px; font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted); white-space: nowrap;
}
.pt-brand-label::before { content: ""; width: 1px; height: 18px; background: var(--line-strong); }
@media (min-width: 640px) { .pt-brand-label { display: inline-flex; } }
.pt-nav { margin-left: auto; }
.pt-nav ul { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.hdr-link {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding-inline: 0.75rem; border-radius: 999px;
  font-size: 0.875rem; color: var(--fg-muted); white-space: nowrap; transition: color 0.2s ease;
}
.hdr-link:hover, .hdr-link[aria-current="page"] { color: var(--fg); }
.hdr-link[aria-current="page"]::after { content: ""; position: absolute; left: 0.75rem; right: 0.75rem; bottom: 8px; height: 1px; background: var(--fg); }
.hdr-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-family: var(--font-mono); font-size: 0.625rem;
  line-height: 18px; text-align: center; color: var(--ink); background: var(--corona);
}
.hdr-rule { flex: none; width: 1px; height: 20px; margin-inline: 6px; background: var(--line-strong); }
.pt-tools { display: flex; align-items: center; }
/* Teléfonos: la navegación pasa a una segunda fila con scroll horizontal propio. */
@media (max-width: 899.98px) {
  .pt-nav-desktop { display: none; }
  .pt-header-row { height: 56px; }
  .pt-nav-row { border-top: 1px solid var(--line); }
  .pt-nav { margin: 0; overflow-x: auto; scrollbar-width: none; }
  .pt-nav::-webkit-scrollbar { display: none; }
  .pt-nav ul { padding-inline: calc(var(--gutter) - 0.75rem); }
  .pt-tools { margin-left: auto; }
  :root { --header-h: 101px; }
}
@media (min-width: 900px) {
  .pt-nav-row { display: none; }
}

/* ---- Marco ------------------------------------------------------------------ */
.pt-main { position: relative; isolation: isolate; min-height: 100dvh; padding-top: var(--header-h); padding-bottom: 64px; }
.pt-light {
  position: absolute; inset: 0 0 auto; height: min(90vh, 760px); z-index: -1; pointer-events: none;
  background: radial-gradient(58% 62% at 92% 0%, rgb(255 232 176 / 0.72), transparent 70%), radial-gradient(26% 30% at 96% 0%, rgb(245 185 66 / 0.14), transparent 70%);
}
.pt-notice { border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 0.45); }
.pt-notice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-block: 8px; }
.pt-notice-text { flex: 1 1 18rem; margin: 0; font-size: 0.8125rem; line-height: 1.45; color: var(--fg-muted); }
.pt-notice .pt-link { min-height: 36px; font-size: 0.8125rem; }
.pt-page { padding-top: 12px; }
@media (min-width: 768px) { .pt-page { padding-top: 20px; } }

.pt-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; }
.pt-crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.pt-crumbs li + li::before { content: "/"; margin-inline: 8px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--line-strong); }
.pt-crumb {
  display: inline-flex; align-items: center; min-height: 44px; font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg-muted); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px;
}
a.pt-crumb:hover { color: var(--fg); text-decoration-color: currentColor; }
@media (max-width: 639px) {
  .pt-crumbs[data-trail="long"] li:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.pt-crumb-current { color: var(--fg); }

.pt-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.pt-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 18px 0 0; }
.pt-hello { margin: 12px 0 0; font-size: clamp(3rem, 12vw, 7.5rem); line-height: 0.9; }
.pt-title { margin: 12px 0 0; font-size: clamp(2.6rem, 9vw, 5.5rem); line-height: 0.92; }
.pt-company { max-width: 46rem; margin: 14px 0 0; font-size: 1rem; line-height: 1.55; color: var(--fg-muted); }
.pt-company strong { font-weight: 500; color: var(--fg); }

.pt-h2 { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
@media (min-width: 768px) { .pt-h2 { font-size: 1.25rem; } }
.pt-h3 { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.3; }
.pt-fine { margin: 0; font-size: 0.8125rem; line-height: 1.5; color: var(--fg-muted); }
.pt-date { font-family: var(--font-mono); font-variant-numeric: tabular-nums slashed-zero; letter-spacing: -0.01em; white-space: nowrap; }
.pt-code { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.06em; color: var(--fg-muted); }
.pt-meta { display: block; margin-top: 4px; font-size: 0.8125rem; line-height: 1.45; color: var(--fg-muted); }

/* ---- Tags ------------------------------------------------------------------- */
.pt-tag {
  display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-strong);
  font-size: 0.75rem; font-weight: 500; line-height: 1.2; white-space: nowrap; color: var(--fg);
}
.pt-tag-turn { border-color: transparent; background: var(--corona); color: var(--ink); }
.pt-tag-out { border-style: dashed; color: var(--fg-muted); }
.pt-tag-attn { border-color: rgb(138 90 0 / 0.5); background: rgb(255 255 255 / 0.7); }
.pt-tag-attn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--corona); box-shadow: 0 0 0 2px rgb(245 185 66 / 0.25); }
.pt-tag-late { border-color: rgb(155 55 49 / 0.45); color: var(--late); background: rgb(255 255 255 / 0.7); }
.pt-tag-late::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--late); }
.pt-tag-ok { color: var(--fg-muted); }

/* ---- Etapa (PhaseGlyph + texto) -------------------------------------------- */
.pt-stage { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 0.9375rem; line-height: 1.3; }
.pt-stage-glyph { flex: none; color: var(--accent); }
.pt-stage[data-muted] .pt-stage-glyph { color: var(--fg-muted); }
.pt-stage[data-stage="support"] .pt-stage-glyph { color: var(--fg); }
.pt-stage-pos { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--fg-muted); }
.pt-stage[data-layout="stack"] { align-items: flex-start; }
.pt-stage[data-layout="stack"] .pt-stage-glyph { margin-top: 15px; }
.pt-stage[data-layout="stack"] .pt-stage-pos { display: block; font-size: 0.6875rem; }
.pt-stage[data-layout="stack"] .pt-stage-sep { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.pt-stage[data-layout="stack"] .pt-stage-name { display: block; font-weight: 500; }
.pt-stage-meaning { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--fg-muted); }

/* ---- Ledger (resumen) ------------------------------------------------------- */
.pt-overview { display: grid; margin: 32px 0 0; border-top: 1px solid var(--fg); border-bottom: 1px solid var(--line); }
.pt-overview > div { display: grid; align-content: start; gap: 8px; padding: 16px 0; }
.pt-overview > div + div { border-top: 1px solid var(--line); }
@media (min-width: 900px) {
  .pt-overview { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
  .pt-overview > div { padding: 18px 24px 22px 0; }
  .pt-overview > div + div { border-top: 0; border-left: 1px solid var(--line); padding-left: 24px; }
}
@media (min-width: 560px) and (max-width: 899.98px) {
  .pt-overview[data-grid] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-overview[data-grid] > div:nth-child(even) { border-left: 1px solid var(--line); padding-left: 20px; }
  .pt-overview[data-grid] > div:nth-child(2) { border-top: 0; }
}
.pt-overview dt { font-family: var(--font-mono); font-size: 0.6875rem; line-height: 1rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
.pt-overview dd { display: grid; gap: 6px; margin: 0; font-size: 0.9375rem; line-height: 1.45; }
.pt-big { font-family: var(--font-mono); font-variant-numeric: tabular-nums slashed-zero; font-size: 1.75rem; letter-spacing: -0.03em; line-height: 1.05; }
.pt-big small { font-size: 0.55em; color: var(--fg-muted); letter-spacing: -0.01em; }
.pt-big[data-key] { color: var(--accent); }
.pt-overview-strong { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.pt-overview .pt-tag { justify-self: start; }
.pt-overview a { font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.pt-overview a:hover { color: var(--accent); text-decoration-color: currentColor; }

/* Medidor: una línea fina con el ritmo esperado como marca. */
.pt-meter { position: relative; height: 3px; margin: 4px 0 2px; background: var(--line); }
.pt-meter-fill { position: absolute; inset: 0 auto 0 0; background: var(--fg); }
.pt-meter[data-tone="accent"] .pt-meter-fill { background: var(--corona); }
.pt-meter-mark { position: absolute; top: -5px; width: 1px; height: 13px; background: var(--accent); }

/* ---- Listas tipo tabla (filas en escritorio, tarjetas en teléfono) ----------- */
.pt-list { margin-top: 48px; }
.pt-list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.pt-list-title { display: flex; align-items: baseline; gap: 12px; }
.pt-count { font-family: var(--font-mono); font-size: 0.75rem; color: var(--fg-muted); }
.pt-rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--fg); }
.pt-rows-head { display: none; }
.pt-row {
  position: relative; display: grid; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line);
  transition: background-color 0.2s ease;
}
.pt-row[data-turn] { box-shadow: inset 2px 0 0 var(--corona); padding-left: 12px; }
.pt-row[data-late] { box-shadow: inset 2px 0 0 var(--late); padding-left: 12px; }
.pt-row-name { font-size: 1rem; font-weight: 600; line-height: 1.35; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; }
a.pt-row-name:hover { text-decoration-color: currentColor; }
.pt-row-end { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pt-cell-label { display: block; margin-bottom: 2px; }
@media (min-width: 1024px) {
  .pt-rows-head, .pt-row { grid-template-columns: var(--cols); gap: 16px; align-items: start; }
  .pt-rows-head { display: grid; padding: 0 10px 10px; border-bottom: 1px solid var(--fg); }
  .pt-rows { border-top: 0; }
  .pt-row { padding: 18px 10px; }
  .pt-row:hover { background: rgb(255 255 255 / 0.45); }
  .pt-row[data-turn], .pt-row[data-late] { padding-left: 10px; }
  .pt-row-end { justify-content: flex-end; }
  .pt-cell-label { display: none; }
}

/* ---- Segmentado (filtros) --------------------------------------------------- */
.pt-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 28px; }
.pt-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 22px; background: rgb(17 17 20 / 0.06); }
.pt-seg button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 500; color: var(--fg-muted); transition: background-color 0.2s ease, color 0.2s ease;
}
.pt-seg button:hover { color: var(--fg); }
.pt-seg button[aria-pressed="true"] { background: var(--surface-strong); color: var(--fg); box-shadow: 0 1px 2px rgb(17 17 20 / 0.12); }
.pt-seg .pt-count { font-size: 0.6875rem; }
.pt-search {
  flex: 1 1 14rem; min-height: 44px; max-width: 22rem; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgb(255 255 255 / 0.7); font-size: 0.9rem;
}
.pt-search:focus-visible { outline-offset: 2px; }
.pt-select {
  min-height: 44px; padding: 0 36px 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 0.875rem;
  background: rgb(255 255 255 / 0.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b5866' stroke-width='1.6'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
  appearance: none;
}

/* ---- Detalle: etapa actual + cajas laterales -------------------------------- */
.pt-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 18px 0 0; font-size: 0.875rem; color: var(--fg-muted); }
.pt-detail-code { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; color: var(--fg); }
.pt-top { display: grid; gap: 14px; margin-top: 32px; }
@media (min-width: 1024px) { .pt-top { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; gap: 20px; margin-top: 40px; } }
.pt-current {
  --tick: 12px; --tick-c: rgb(17 17 20 / 0.42);
  display: grid; gap: 18px; padding: 20px 18px 22px; border: 1px solid var(--line); border-radius: 4px; background-color: rgb(255 255 255 / 0.6);
}
@media (min-width: 640px) { .pt-current { grid-template-columns: auto minmax(0, 1fr); gap: 24px; padding: 26px 26px 28px; } }
.pt-dial { display: flex; align-items: center; gap: 14px; color: var(--accent); }
@media (min-width: 640px) { .pt-dial { flex-direction: column; gap: 10px; padding-right: 24px; border-right: 1px solid var(--line); } }
.pt-current[data-muted] .pt-dial { color: var(--fg-muted); }
.pt-dial-pos { margin: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums slashed-zero; font-size: 1.75rem; letter-spacing: -0.03em; line-height: 1; color: var(--fg); }
.pt-dial-pos span { font-size: 0.6em; color: var(--fg-muted); }
.pt-current-name { margin: 8px 0 0; font-size: 1.625rem; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
@media (min-width: 768px) { .pt-current-name { font-size: 2rem; } }
.pt-current-short { margin: 6px 0 0; font-size: 0.875rem; color: var(--fg-muted); }
.pt-current-note { margin: 14px 0 0; font-size: 1rem; line-height: 1.55; }
.pt-current .pt-dl { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (min-width: 768px) { .pt-current .pt-dl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.pt-current .pt-actions { margin-top: 18px; }

.pt-dl { display: grid; gap: 14px; margin: 0; }
.pt-dl > div { display: grid; align-content: start; gap: 4px; }
.pt-dl dt { font-family: var(--font-mono); font-size: 0.6875rem; line-height: 1rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
.pt-dl dd { margin: 0; font-size: 0.9375rem; line-height: 1.5; }

.pt-pause { margin-top: 16px; padding: 14px 16px; border-left: 3px solid var(--fg); background: rgb(17 17 20 / 0.04); }
.pt-pause-title { margin: 0; font-weight: 600; }
.pt-pause p { margin: 6px 0 0; font-size: 0.9375rem; line-height: 1.5; }

.pt-side { display: grid; gap: 14px; align-content: start; }
@media (min-width: 640px) and (max-width: 1023px) { .pt-side { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pt-box { padding: 18px 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: rgb(255 255 255 / 0.55); }
@media (min-width: 768px) { .pt-box { padding: 22px 22px 24px; } }
.pt-box[data-turn] {
  border-color: rgb(138 90 0 / 0.4);
  background: radial-gradient(120% 90% at 100% 0%, rgb(255 232 176 / 0.55), transparent 60%), rgb(255 255 255 / 0.6);
}
.pt-box[data-late] { border-color: rgb(155 55 49 / 0.35); }
.pt-box-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.pt-box-title { margin: 10px 0 0; font-size: 1.125rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.pt-box-text { margin: 8px 0 0; font-size: 0.9375rem; line-height: 1.5; }
.pt-box .pt-fine { margin-top: 10px; }
.pt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pt-actions .btn { flex: 1 1 auto; }

/* Lista de control (cierre interno después de la entrega). */
.pt-checklist { margin: 14px 0 0; padding: 0; list-style: none; }
.pt-checklist li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9375rem; line-height: 1.45; }
.pt-checklist li:last-child { border-bottom: 0; }
.pt-checklist svg { width: 16px; height: 16px; margin-top: 2px; color: var(--fg); }
.pt-checklist li[data-done="false"] { color: var(--fg-muted); }
.pt-checklist li[data-done="false"] svg { color: var(--line-strong); }

/* ---- Cronograma: cinco etapas en un eje ------------------------------------ */
.pt-timeline { margin-top: 48px; }
@media (min-width: 1024px) { .pt-timeline { margin-top: 64px; } }
.pt-rail { display: grid; margin: 18px 0 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .pt-rail { grid-template-columns: repeat(var(--steps, 5), minmax(0, 1fr)); } }
.pt-rail-step { position: relative; display: grid; align-content: start; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 14px; padding-bottom: 22px; }
.pt-rail-step::before { content: ""; position: absolute; left: 13.5px; top: 30px; bottom: 2px; width: 1px; background: var(--line-strong); }
.pt-rail-step:last-child::before { display: none; }
.pt-rail-step[data-status="done"]::before { width: 2px; left: 13px; background: var(--fg); }
.pt-rail-step[data-status="current"]::before, .pt-rail-step[data-status="paused"]::before { background: repeating-linear-gradient(180deg, var(--line-strong) 0 4px, transparent 4px 8px); }
@media (min-width: 900px) {
  .pt-rail-step { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 0 20px 0 0; }
  .pt-rail-step::before { left: 34px; right: 6px; top: 13.5px; bottom: auto; width: auto; height: 1px; }
  .pt-rail-step[data-status="done"]::before { left: 34px; top: 13px; width: auto; height: 2px; }
  .pt-rail-step[data-status="current"]::before, .pt-rail-step[data-status="paused"]::before { background: repeating-linear-gradient(90deg, var(--line-strong) 0 4px, transparent 4px 8px); }
}
.pt-rail-mark { grid-row: span 3; color: var(--fg-muted); }
@media (min-width: 900px) { .pt-rail-mark { grid-row: auto; margin-bottom: 8px; } }
.pt-rail-step[data-status="done"] .pt-rail-mark { color: var(--fg); }
.pt-rail-step[data-status="current"] .pt-rail-mark { color: var(--accent); }
.pt-rail-step[data-status="current"] .pt-rail-mark svg { border-radius: 50%; box-shadow: 0 0 0 4px rgb(245 185 66 / 0.28), 0 0 18px rgb(245 185 66 / 0.55); }
.pt-rail-n { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.08em; color: var(--fg-muted); }
.pt-rail-name { font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.pt-rail-step[data-status="pending"] .pt-rail-name { font-weight: 500; }
.pt-rail-status { font-size: 0.8125rem; line-height: 1.45; color: var(--fg-muted); }
.pt-rail-status strong { font-weight: 600; color: var(--fg); }
.pt-rail-step[data-status="current"] .pt-rail-status strong { color: var(--accent); }
.pt-timeline > .pt-fine { margin-top: 14px; }

/* ---- Pestañas + bitácora + datos ------------------------------------------- */
.pt-bottom { display: grid; gap: 40px; margin-top: 48px; }
@media (min-width: 1024px) { .pt-bottom { grid-template-columns: minmax(0, 1fr) 20rem; gap: 48px; align-items: start; margin-top: 64px; } }
.pt-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 4px; }
.pt-tablist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pt-tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.9rem; font-weight: 500; color: var(--fg-muted); transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.pt-tab:hover { border-color: var(--line-strong); color: var(--fg); }
.pt-tab[aria-selected="true"] { border-color: var(--fg); background: var(--fg); color: var(--dawn); }
.pt-tab-count { font-family: var(--font-mono); font-size: 0.75rem; opacity: 0.75; }
.pt-tabpanel { padding-top: 24px; }

.pt-log { margin: 0; padding: 0; list-style: none; }
.pt-log-item { position: relative; display: grid; gap: 6px; padding: 0 0 26px 22px; }
.pt-log-item::before { content: ""; position: absolute; left: 3px; top: 8px; bottom: -2px; width: 1px; background: var(--line-strong); }
.pt-log-item:last-child::before { display: none; }
.pt-log-item::after { content: ""; position: absolute; left: 0; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--dawn); border: 1px solid var(--fg); }
.pt-log-item[data-change]::after { background: var(--fg); }
@media (min-width: 768px) {
  .pt-log-item { grid-template-columns: 8.5rem minmax(0, 1fr); column-gap: 24px; padding-left: 0; }
  .pt-log-item::before { left: calc(8.5rem + 3px); }
  .pt-log-item::after { left: 8.5rem; }
  .pt-log-body { padding-left: 22px; }
}
.pt-log-date { font-size: 0.8125rem; color: var(--fg-muted); }
.pt-log-change { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 6px; font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-muted); }
.pt-log-change b { font-weight: 500; color: var(--fg); }
.pt-log-title { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.35; }
.pt-log-text { margin: 4px 0 0; font-size: 0.9375rem; line-height: 1.55; }
.pt-log-author { margin: 8px 0 0; font-size: 0.8125rem; color: var(--fg-muted); }

.pt-facts { padding-top: 14px; border-top: 1px solid var(--fg); }
.pt-facts .pt-dl { gap: 0; margin-top: 10px; }
.pt-facts .pt-dl > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.pt-facts .pt-dl dd { font-size: 0.9375rem; }
.pt-facts .pt-fine { margin-top: 4px; }

.pt-ledger { margin: 0; padding: 0; list-style: none; }
.pt-ledger li { display: flex; align-items: baseline; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 0.9375rem; }
.pt-ledger li:last-child { border-bottom: 0; }
.pt-leader { flex: 1 1 auto; min-width: 1.25rem; align-self: baseline; border-bottom: 1px dotted var(--line-strong); }
.pt-ledger .readout { white-space: nowrap; }
.pt-ledger [data-off] { opacity: 0.5; }

/* ---- Tarjetas (lotes) ------------------------------------------------------- */
.pt-cards { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .pt-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pt-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: rgb(255 255 255 / 0.6); }
.pt-card[data-turn] { border-color: rgb(138 90 0 / 0.45); }
.pt-card[data-late] { border-color: rgb(155 55 49 / 0.35); }
.pt-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.pt-card-title { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.pt-card .pt-rail { margin-top: 4px; --steps: 3; }
.pt-card .pt-rail-step { padding-bottom: 14px; }
@media (min-width: 900px) { .pt-card .pt-rail-step { padding-bottom: 0; } }
.pt-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--fg-muted); }
.pt-stats b { font-family: var(--font-mono); font-weight: 500; color: var(--fg); }
.pt-report { display: grid; gap: 8px; margin: 0; padding: 14px 16px; border-left: 3px solid var(--fg); background: rgb(17 17 20 / 0.04); list-style: none; font-size: 0.9rem; line-height: 1.5; }
.pt-report b { font-weight: 600; }

/* ---- Vacío ------------------------------------------------------------------ */
.pt-empty { display: grid; justify-items: start; gap: 10px; padding: 32px 0 8px; border-top: 1px solid var(--fg); }
.pt-empty-title { margin: 0; font-size: 1.375rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
.pt-empty-body { max-width: 36rem; margin: 0; font-size: 1rem; line-height: 1.55; color: var(--fg-muted); }

/* ---- Diálogos --------------------------------------------------------------- */
.modal {
  width: min(560px, calc(100vw - 24px)); max-height: min(90dvh, 820px); overflow: auto; padding: 0; border: 1px solid var(--line-strong);
  border-radius: 4px; color: var(--fg); background-color: #fbf8f2; box-shadow: 0 30px 90px rgb(17 17 20 / 0.28);
}
.modal.ticks { --tick: 12px; --tick-c: rgb(17 17 20 / 0.42); }
.modal::backdrop { background: rgb(17 17 20 / 0.42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal-content { padding: 24px 22px 22px; }
@media (min-width: 640px) { .modal-content { padding: 30px 30px 26px; } }
.modal-title { margin: 8px 0 0; font-family: var(--font-serif); font-weight: 400; font-size: 2.1rem; line-height: 1; letter-spacing: -0.02em; }
.modal-text { margin: 10px 0 0; font-size: 0.9375rem; line-height: 1.5; color: var(--fg-muted); }
.pt-form { display: grid; gap: 14px; margin-top: 20px; }
.pt-form-row { display: grid; gap: 14px; }
@media (min-width: 560px) { .pt-form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pt-field { display: grid; gap: 6px; }
.pt-field label { font-size: 0.875rem; font-weight: 500; }
.pt-input {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 14px; background: #fff;
  font-size: 1rem; transition: border-color 0.2s ease;
}
.pt-input:hover { border-color: rgb(17 17 20 / 0.36); }
textarea.pt-input { min-height: 96px; resize: vertical; line-height: 1.45; }
select.pt-input {
  appearance: none; padding-right: 40px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b5866' stroke-width='1.6'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
}
.modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.pt-data-actions { display: grid; gap: 8px; margin-top: 20px; }
.pt-file { position: relative; overflow: hidden; }
.pt-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---- Avisos ----------------------------------------------------------------- */
.toast-region { position: fixed; z-index: 60; right: 16px; bottom: 16px; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--ink); color: var(--dawn);
  box-shadow: 0 14px 40px rgb(17 17 20 / 0.28); font-size: 0.9rem; line-height: 1.45;
}
.toast::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--corona); }
.toast.warning::before { background: #ff8f7a; }

@media (prefers-reduced-motion: no-preference) {
  .pt-page { animation: pt-fade 0.35s ease both; }
  .toast { animation: pt-fade 0.25s ease both; }
}
@keyframes pt-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
