/* Portal SEASI v2 · Swiss Midnight. Base component vocabulary shared by every v2 view.
   Prefix v2- keeps it isolated from portal.css (flag off). Mobile-first. */
:root {
  color-scheme: light;
  --v2-bg: var(--seasi-blanco-glaciar);
  --v2-surface: #ffffff;
  --v2-ink: var(--seasi-midnight-navy);
  --v2-ink-soft: #3f5366;
  --v2-muted: #5f7385;
  --v2-line: #dde4ea;
  --v2-line-strong: #c4d0da;
  --v2-dark: var(--seasi-azul-abisal);
  --v2-accent: #1f4f7a;
  --v2-accent-ink: #ffffff;
  --v2-focus: #3d7ab8;
  --v2-neutral-bg: #eef2f5; --v2-neutral-ink: #34495c;
  --v2-amber-bg: #fdf3dc; --v2-amber-ink: #7a5000; --v2-amber-line: #f0d48f;
  --v2-blue-bg: #e5f0fb; --v2-blue-ink: #174c80; --v2-blue-line: #b6d3f0;
  --v2-green-bg: #e3f4ea; --v2-green-ink: #1b6b3d; --v2-green-line: #a9dbbd;
  --v2-red-bg: #fbe9e8; --v2-red-ink: #9b2c24; --v2-red-line: #efb9b4;
  --v2-muted-bg: #f1f3f5; --v2-muted-ink: #6b7884;
  --v2-radius: 14px;
  --v2-radius-sm: 9px;
  --v2-shadow: 0 1px 2px rgba(8, 19, 38, .05), 0 6px 22px rgba(8, 19, 38, .06);
  --v2-shadow-hover: 0 2px 4px rgba(8, 19, 38, .07), 0 14px 34px rgba(8, 19, 38, .10);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--v2-bg); color: var(--v2-ink); font: 400 16px/1.55 var(--seasi-font-sans); }
img { max-width: 100%; height: auto; }
a { color: var(--v2-accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--v2-focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font: 500 clamp(28px, 4.2vw, 44px)/1.15 var(--seasi-font-display); letter-spacing: -.01em; margin-bottom: 10px; overflow-wrap: anywhere; }
h2 { font: 600 20px/1.3 var(--seasi-font-sans); margin-bottom: 12px; }
h3 { font: 600 16px/1.35 var(--seasi-font-sans); margin-bottom: 6px; }
.v2-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.v2-skip { position: absolute; left: 12px; top: -60px; background: var(--v2-surface); color: var(--v2-ink); padding: 10px 14px; border-radius: var(--v2-radius-sm); z-index: 10; }
.v2-skip:focus { top: 12px; }

/* Layout */
.v2-shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.v2-page { padding: 24px 0 96px; min-height: calc(100vh - 160px); }
.v2-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 24px; }
.v2-page-head p { color: var(--v2-ink-soft); margin-bottom: 0; max-width: 62ch; }
.v2-eyebrow { color: var(--v2-muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 6px; }
.v2-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.v2-section { margin-top: 32px; }
.v2-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.v2-section-head h2 { margin: 0; }
.v2-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--v2-muted); margin-bottom: 8px; }
.v2-crumbs a { color: inherit; }

/* Header + nav (collapses to <details> menu below 720px, no JS) */
.v2-header { background: var(--v2-dark); color: #fff; }
.v2-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.v2-brand img { display: block; width: 160px; }
.v2-menu { position: relative; }
.v2-menu-toggle { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--v2-radius-sm); border: 1px solid #2c3a4f; font-size: 20px; cursor: pointer; }
.v2-menu-toggle::-webkit-details-marker { display: none; }
.v2-nav { position: absolute; right: 0; top: 52px; z-index: 5; min-width: 230px; display: flex; flex-direction: column; background: var(--v2-dark); border: 1px solid #2c3a4f; border-radius: var(--v2-radius); padding: 8px; box-shadow: var(--v2-shadow); }
.v2-nav-link { display: block; padding: 11px 12px; border-radius: var(--v2-radius-sm); color: #c9d4df; text-decoration: none; font-size: 15px; font-weight: 600; background: none; border: 0; text-align: left; width: 100%; }
.v2-nav-link:hover { background: #142033; color: #fff; }
.v2-nav-link[aria-current] { color: #fff; background: #142033; }
.v2-nav-form { margin: 0; }
@media (min-width: 720px) {
  .v2-menu { display: none; }
  .v2-nav { position: static; flex-direction: row; align-items: center; gap: 4px; min-width: 0; background: none; border: 0; padding: 0; box-shadow: none; }
  .v2-nav-link { padding: 8px 12px; font-size: 14px; width: auto; }
  .v2-nav-link[aria-current] { box-shadow: inset 0 -2px 0 var(--seasi-platino-luminoso); background: none; border-radius: 0; }
}
@media (max-width: 719px) { .v2-nav--desktop { display: none; } }

/* Buttons */
.v2-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 15px; text-decoration: none; line-height: 1.2; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .15s; }
.v2-btn--primary { background: var(--v2-ink); color: #fff; }
.v2-btn--primary:hover { background: #0f2240; box-shadow: var(--v2-shadow); }
.v2-btn--secondary { background: var(--v2-surface); color: var(--v2-ink); border-color: var(--v2-line-strong); }
.v2-btn--secondary:hover { border-color: var(--v2-ink); }
.v2-btn--ghost { background: transparent; color: var(--v2-ink-soft); }
.v2-btn--ghost:hover { background: var(--v2-neutral-bg); }
.v2-btn--danger { background: var(--v2-surface); color: var(--v2-red-ink); border-color: var(--v2-red-line); }
.v2-btn--danger:hover { background: var(--v2-red-bg); }
.v2-btn--block { width: 100%; }
.v2-btn[disabled], .v2-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.v2-inline-form { display: inline; margin: 0; }

/* Cards */
.v2-card { background: var(--v2-surface); border: 1px solid var(--v2-line); border-radius: var(--v2-radius); padding: 20px; box-shadow: var(--v2-shadow); }
.v2-card--link { display: block; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s, border-color .15s; }
.v2-card--link:hover { box-shadow: var(--v2-shadow-hover); border-color: var(--v2-line-strong); transform: translateY(-1px); }
.v2-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.v2-grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .v2-grid--stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.v2-stat { display: flex; flex-direction: column; gap: 4px; }
.v2-stat-label { color: var(--v2-ink-soft); font-size: 14px; font-weight: 600; }
.v2-stat-value { font: 600 34px/1.1 var(--seasi-font-sans); }
.v2-stat-hint { color: var(--v2-muted); font-size: 14px; }

/* Status chips: always icon + text, never colour alone */
.v2-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.v2-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.v2-chip--neutral { background: var(--v2-neutral-bg); color: var(--v2-neutral-ink); border-color: var(--v2-line); }
.v2-chip--amber { background: var(--v2-amber-bg); color: var(--v2-amber-ink); border-color: var(--v2-amber-line); }
.v2-chip--blue { background: var(--v2-blue-bg); color: var(--v2-blue-ink); border-color: var(--v2-blue-line); }
.v2-chip--green { background: var(--v2-green-bg); color: var(--v2-green-ink); border-color: var(--v2-green-line); }
.v2-chip--muted { background: var(--v2-muted-bg); color: var(--v2-muted-ink); text-decoration: line-through; }

/* 4-step progress */
.v2-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; counter-reset: step; }
.v2-steps li { flex: 1; font-size: 12px; color: var(--v2-muted); }
.v2-steps li::before { content: ""; display: block; height: 4px; border-radius: 4px; background: var(--v2-line); margin-bottom: 6px; }
.v2-steps li[data-state="done"]::before, .v2-steps li[data-state="current"]::before { background: var(--v2-accent); }
.v2-steps li[data-state="current"] { color: var(--v2-ink); font-weight: 600; }

/* Forms: label above, full width */
.v2-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.v2-field label, .v2-label { font-weight: 600; font-size: 14px; }
.v2-field input[type="text"], .v2-field input[type="email"], .v2-field input[type="search"], .v2-field input:not([type]), .v2-field select, .v2-field textarea, .v2-input { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--v2-line-strong); border-radius: var(--v2-radius-sm); background: var(--v2-surface); }
.v2-field textarea { min-height: 110px; resize: vertical; }
.v2-field input:focus, .v2-field select:focus, .v2-field textarea:focus, .v2-input:focus { border-color: var(--v2-focus); outline: 3px solid rgba(61, 122, 184, .2); outline-offset: 0; }
.v2-hint { color: var(--v2-muted); font-size: 15px; line-height: 1.5; margin: 0; }
.v2-hint--warn { color: var(--v2-amber-ink); font-weight: 500; }
.v2-error { color: var(--v2-red-ink); font-size: 14px; font-weight: 600; margin: 0; }
.v2-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.v2-check input { width: 20px; height: 20px; margin-top: 1px; flex: none; }
.v2-radio-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); border: 0; padding: 0; margin: 0 0 16px; }
.v2-radio-card { position: relative; display: block; border: 1px solid var(--v2-line-strong); border-radius: var(--v2-radius-sm); padding: 14px 14px 14px 44px; background: var(--v2-surface); cursor: pointer; }
.v2-radio-card input { position: absolute; left: 14px; top: 16px; width: 18px; height: 18px; }
.v2-radio-card:has(input:checked) { border-color: var(--v2-ink); box-shadow: 0 0 0 1px var(--v2-ink); }
.v2-radio-card small { display: block; color: var(--v2-muted); }

/* Rows (lists of envelopes, tokens…) */
.v2-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.v2-row { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; }
.v2-row-side { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
@media (min-width: 720px) { .v2-row { grid-template-columns: auto 1fr auto; } .v2-row-side { grid-column: auto; justify-content: flex-end; } }
.v2-avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--v2-neutral-bg); color: var(--v2-ink-soft); font-weight: 700; font-size: 14px; }
.v2-row-title { font-weight: 600; margin: 0; overflow-wrap: anywhere; }
/* Touch targets in the list: the title link is the main tap area, so it gets a 44px hit area
   without inflating the text (UX audit, issue 10). */
.v2-row-title a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration-color: var(--v2-line-strong); text-underline-offset: 4px; }
.v2-row-title a:hover { text-decoration-color: var(--v2-accent); }
.v2-row-meta { color: var(--v2-muted); font-size: 14px; margin: 0; overflow-wrap: anywhere; }

/* Alerts, empty states, technical details, code */
.v2-alert { border-radius: var(--v2-radius-sm); padding: 12px 16px; border: 1px solid var(--v2-line); background: var(--v2-neutral-bg); margin-bottom: 16px; }
.v2-alert--amber { background: var(--v2-amber-bg); border-color: var(--v2-amber-line); color: var(--v2-amber-ink); }
.v2-alert--info { background: var(--v2-blue-bg); border-color: var(--v2-blue-line); color: var(--v2-blue-ink); }
.v2-alert--success { background: var(--v2-green-bg); border-color: var(--v2-green-line); color: var(--v2-green-ink); }
.v2-alert p:last-child { margin-bottom: 0; }
.v2-empty { text-align: center; padding: 40px 20px; border: 1px dashed var(--v2-line-strong); border-radius: var(--v2-radius); background: var(--v2-surface); }
.v2-empty p { color: var(--v2-ink-soft); max-width: 46ch; margin-inline: auto; }
.v2-tech { margin-top: 16px; border-top: 1px solid var(--v2-line); padding-top: 12px; }
.v2-tech summary { cursor: pointer; color: var(--v2-ink-soft); font-weight: 600; font-size: 14px; }
.v2-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; overflow-wrap: anywhere; }
.v2-code { position: relative; background: #0d1626; color: #e6edf5; border-radius: var(--v2-radius-sm); padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 12px; }
.v2-dl { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.v2-dl dt { color: var(--v2-muted); font-size: 14px; }
.v2-dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .v2-dl { grid-template-columns: 1fr; gap: 2px 0; } .v2-dl dt { margin-top: 8px; } .v2-dl dd { margin-bottom: 2px; } }

/* Dialog */
.v2-dialog { border: 0; border-radius: var(--v2-radius); padding: 24px; max-width: min(460px, calc(100% - 32px)); box-shadow: var(--v2-shadow-hover); position: fixed; z-index: 200; }
.v2-dialog::backdrop { background: rgba(6, 11, 23, .55); }
.v2-dialog-title { font: 600 18px/1.3 var(--seasi-font-sans); margin: 0 0 10px; }
.v2-btn--danger-solid { background: var(--v2-red-ink); color: #fff; border-color: var(--v2-red-ink); }
.v2-btn--danger-solid:hover { background: #82241d; box-shadow: var(--v2-shadow); }

.v2-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 24px 0 32px; color: var(--v2-muted); font-size: 13px; border-top: 1px solid var(--v2-line); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---- Portal v2 additions: org cards, filters, search, rows ---------------- */

.v2-row-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.v2-row-side time { color: var(--v2-muted); font-size: 13px; white-space: nowrap; }
.v2-row-side--col { flex-direction: column; align-items: flex-end; gap: 6px; }
.v2-btn--compact { min-height: 44px; padding: 8px 14px; font-size: 14px; }

.v2-org-card { display: flex; flex-direction: column; gap: 10px; min-height: 150px; }
.v2-org-name { font: 600 22px/1.25 var(--seasi-font-display); letter-spacing: .02em; }
.v2-org-go { margin-top: auto; color: var(--v2-accent); font-weight: 600; font-size: 14px; }

.v2-first-steps-list { counter-reset: firststep; list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 16px; text-align: left; }
.v2-first-steps-list li { counter-increment: firststep; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.v2-first-steps-list li::before { content: counter(firststep); display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--v2-ink); color: #fff; font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.v2-first-steps-list li span { color: var(--v2-ink-soft); font-size: 14px; }
.v2-first-steps-list .v2-btn { margin-top: 6px; }

.v2-engage-card { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 18px 22px; }
.v2-engage-card .v2-stat-value { font-size: 30px; }

.v2-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 12px; }
.v2-chip--filter { text-decoration: none; background: var(--v2-surface); color: var(--v2-ink-soft); border-color: var(--v2-line-strong); min-height: 44px; }
.v2-chip--filter:hover { border-color: var(--v2-ink); color: var(--v2-ink); }
.v2-chip--filter[aria-current] { background: var(--v2-ink); color: #fff; }
.v2-chip-count { font-weight: 400; opacity: .75; }

.v2-search { display: flex; gap: 8px; margin-bottom: 20px; }
.v2-search .v2-input { flex: 1; min-width: 0; }

.v2-legacy-link { margin-top: 24px; text-align: center; }

/* ---- Wizard: indicator, fieldsets, dropzone, fixed mobile bar ------------- */

.v2-wizard-indicator { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 16px; }
.v2-wizard-indicator li { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--v2-muted); padding: 8px 6px; border-radius: 999px; background: var(--v2-neutral-bg); }
.v2-wizard-indicator li[aria-current="step"] { background: var(--v2-ink); color: #fff; }
.v2-wizard-indicator li[data-state="done"] { background: var(--v2-green-bg); color: var(--v2-green-ink); }
.v2-wizard-indicator li[data-state="done"] .v2-wizard-n { background: var(--v2-green-line); color: var(--v2-green-ink); }
.v2-wizard-n { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(127, 145, 165, .25); font-size: 13px; font-weight: 700; flex: none; }
.v2-wizard-indicator li[aria-current="step"] .v2-wizard-n { background: rgba(255, 255, 255, .22); color: #fff; }

.v2-fieldset { border: 1px solid var(--v2-line); border-radius: var(--v2-radius); background: var(--v2-surface); padding: 18px 18px 6px; margin: 0 0 16px; box-shadow: var(--v2-shadow); }
.v2-fieldset legend { font-weight: 700; font-size: 15px; padding: 2px 10px; background: var(--v2-surface); border-radius: var(--v2-radius-sm); margin-bottom: 10px; }
.v2-wizard-step:focus { outline: none; }
.v2-wizard-step:focus-visible { outline: 3px solid var(--v2-focus); outline-offset: 3px; border-radius: var(--v2-radius); }
.v2-wizard-summary { margin-bottom: 16px; padding: 14px 16px; background: var(--v2-neutral-bg); border-radius: var(--v2-radius-sm); }

.v2-dropzone { position: relative; display: block; border: 2px dashed var(--v2-line-strong); border-radius: var(--v2-radius); padding: 30px 16px; text-align: center; transition: border-color .15s, background .15s; }
.v2-dropzone-label { display: block; font-weight: 700; cursor: pointer; }
.v2-dropzone .v2-hint { margin-top: 4px; }
.v2-dropzone-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.v2-dropzone--over, .v2-dropzone:focus-within { border-color: var(--v2-accent); background: var(--v2-blue-bg); }
.v2-dropzone-file { min-height: 20px; margin: 10px 0 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.v2-dropzone-file.is-error { color: var(--v2-red-ink); }

.v2-wizard-bar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.v2-wizard-bar .v2-btn { flex: 0 1 auto; }
.v2-page--wizard { padding-bottom: 48px; }
@media (max-width: 719px) {
  .v2-wizard-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; background: var(--v2-surface); border-top: 1px solid var(--v2-line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 24px rgba(8, 19, 38, .12); }
  .v2-wizard-bar .v2-btn { flex: 1; }
  .v2-page--wizard { padding-bottom: 128px; }
}

/* ---- Detail: layout, status header, timeline, technical details ----------- */

.v2-detail { display: grid; gap: 16px; }
.v2-detail-actions { display: flex; flex-direction: column; gap: 12px; }
.v2-detail-actions > .v2-card { display: flex; flex-direction: column; gap: 10px; }
.v2-detail-actions .v2-card > h2 { margin-bottom: 0; }
.v2-action-form { margin: 0; display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 900px) {
  .v2-detail { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .v2-detail-actions { position: sticky; top: 16px; }
}
/* Mobile: actions (copy link, WhatsApp) come before the PDF and the timeline (QA M2/A7). */
@media (max-width: 899px) { .v2-detail { display: flex; flex-direction: column; } .v2-detail-actions { order: -1; } }
.v2-detail-status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 14px; }
.v2-detail-status .v2-steps { flex: 1 1 230px; }
.v2-detail-who { display: flex; align-items: center; gap: 8px; }
.v2-alert--warn { background: var(--v2-red-bg); border-color: var(--v2-red-line); color: var(--v2-red-ink); }
.v2-alert--muted { background: var(--v2-muted-bg); color: var(--v2-muted-ink); }

.v2-timeline { list-style: none; margin: 6px 0 0; padding: 0; }
.v2-timeline-item { position: relative; padding: 0 0 14px 24px; }
.v2-timeline-item::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--v2-line); }
.v2-timeline-item:last-child { padding-bottom: 4px; }
.v2-timeline-item:last-child::before { display: none; }
.v2-timeline-dot { position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--v2-surface); border: 3px solid var(--v2-accent); }
.v2-timeline-item:last-child .v2-timeline-dot { border-color: var(--v2-green-ink); }
.v2-timeline-label { display: block; font-weight: 600; font-size: 14px; }
.v2-timeline-item time { color: var(--v2-muted); font-size: 13px; }

.v2-steps li[data-state="cancelled"] { text-decoration: line-through; color: var(--v2-muted); }
.v2-steps-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--v2-muted-bg); color: var(--v2-muted-ink); text-decoration: line-through; }

/* One-line flow under the page head: 1. Sube → 2. Léelo → 3. Envíalo → 4. Firma */
.v2-flow { color: var(--v2-ink-soft); font-size: 15px; margin: 2px 0 0; max-width: 62ch; }
.v2-flow span[aria-hidden] { color: var(--v2-muted); margin: 0 2px; }

/* Embedded document preview (detail page) */
.v2-doc-preview { margin-bottom: 16px; }
.v2-doc-preview .v2-pdf-frame { display: block; width: 100%; height: min(70vh, 980px); border: 1px solid var(--v2-line-strong); border-radius: var(--v2-radius-sm); background: #525659; }
.v2-doc-preview-actions { margin: 10px 0 0; }

.v2-draft-card { display: flex; flex-direction: column; gap: 6px; }
.v2-draft-card .v2-row-title { margin: 0; }
.v2-draft-card .v2-row-meta { margin: 0; }
.v2-draft-card > .v2-chip { align-self: flex-start; }

.v2-addon { border: 1px solid var(--v2-line); border-radius: var(--v2-radius-sm); padding: 12px 14px 0; margin: 0 0 16px; }
.v2-addon legend { font-weight: 700; font-size: 13px; color: var(--v2-ink-soft); padding: 0 6px; }

.v2-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---- Signer pages (no portal session, mobile-first, light) ---------------- */

.v2-sign-body { background: linear-gradient(180deg, var(--v2-bg) 0%, #e7edf3 100%); min-height: 100vh; }
.v2-sign { width: min(680px, calc(100% - 32px)); margin: 0 auto; padding: 20px 0 56px; display: flex; flex-direction: column; gap: 14px; }
.v2-sign-head { text-align: center; padding: 8px 0 4px; }
.v2-sign-head img { width: 150px; height: auto; }
.v2-sign-card { background: var(--v2-surface); border: 1px solid var(--v2-line); border-radius: var(--v2-radius); box-shadow: var(--v2-shadow); padding: 22px 20px 18px; }
.v2-sign-card--done { text-align: center; padding: 40px 24px 32px; }
.v2-sign-card h1 { font-size: clamp(22px, 4.5vw, 30px); }
.v2-sign-who { margin-bottom: 6px; }
.v2-sign-steps { list-style: none; margin: 18px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.v2-sign-step h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-bottom: 6px; }
.v2-sign-step .v2-wizard-n { background: var(--v2-ink); color: #fff; }
.v2-sign-step .v2-btn { margin-top: 8px; }
.v2-sign-consent { margin: 10px 0 14px; }
.v2-sign-legal { color: var(--v2-muted); font-size: 12px; line-height: 1.5; text-align: center; margin: 18px 0 0; }
.v2-done-mark { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--v2-green-bg); border: 2px solid var(--v2-green-line); color: var(--v2-green-ink); font-size: 30px; font-weight: 700; margin-bottom: 12px; }

/* ---- Print: internal preview only ------------------------------------------ */

@media print {
  .v2-header, .v2-footer, .v2-skip, .v2-no-print { display: none !important; }
  body { background: #fff; }
  .v2-card { border: 0; box-shadow: none; padding: 0; }
  .v2-page { min-height: auto; padding: 0; }
}

.v2-org-grid { list-style: none; padding: 0; margin: 0; }

/* Contract wizard (views/v2/contratos.ejs) */
.ct2-legal { margin-bottom: 20px; }
.ct2-stepper { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 0 0 24px; }
.ct2-stepper li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 999px; background: var(--v2-neutral-bg); color: var(--v2-muted); font-size: 14px; font-weight: 600; min-width: 0; }
.ct2-stepper li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct2-stepper li[data-state="current"] { background: var(--v2-ink); color: #fff; }
.ct2-stepper li[data-state="done"] { background: var(--v2-green-bg); color: var(--v2-green-ink); cursor: pointer; }
.ct2-num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, .25); font-size: 13px; }
.ct2-stepper li[data-state="todo"] .ct2-num { background: var(--v2-surface); }
@media (max-width: 719px) { .ct2-stepper li span:last-child { display: none; } .ct2-stepper li { justify-content: center; } .ct2-stepper li[data-state="current"] span:last-child { display: inline; } .ct2-stepper { grid-template-columns: auto auto auto auto; justify-content: start; } }
.ct2-layout { display: grid; gap: 24px; }
@media (min-width: 1000px) { .ct2-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.ct2-main { min-width: 0; }
.ct2-step h2 { font-size: 22px; }
.ct2-step h2:focus { outline: none; }
.ct2-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.ct2-card { display: flex; flex-direction: column; gap: 10px; text-align: left; cursor: pointer; font: inherit; color: inherit; width: 100%; }
.ct2-card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ct2-brand { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--v2-muted); }
.ct2-card-title { font-weight: 700; font-size: 17px; line-height: 1.3; }
.ct2-card-desc { color: var(--v2-ink-soft); font-size: 14px; flex: 1; }
.ct2-card-cta { color: var(--v2-accent); font-weight: 600; font-size: 14px; }
.ct2-fields { display: grid; gap: 0 18px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .ct2-fields { grid-template-columns: 1fr 1fr; } }
.ct2-fields .ct2-wide { grid-column: 1 / -1; }
.ct2-prestador { margin-top: 16px; }
.ct2-prestador summary { cursor: pointer; }
.ct2-prestador[open] summary { margin-bottom: 16px; }
.ct2-create { margin-top: 16px; }
.ct2-preview { margin-top: 16px; }
.ct2-preview > summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.ct2-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
@media (max-width: 719px) { .ct2-nav { position: sticky; bottom: 0; background: var(--v2-bg); padding: 12px 0; border-top: 1px solid var(--v2-line); } .ct2-nav .v2-btn { flex: 1; } }
.ct2-sticky { position: sticky; top: 16px; }
.ct2-aside-title { font-weight: 700; font-size: 18px; margin-bottom: 2px; }
.ct2-checklist { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 12px; }
.ct2-checklist li { display: flex; gap: 10px; align-items: flex-start; }
.ct2-check { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--v2-neutral-bg); color: var(--v2-muted); font-weight: 700; }
.ct2-checklist li[data-ok="true"] .ct2-check { background: var(--v2-green-bg); color: var(--v2-green-ink); }
.ct2-reset { margin-top: 12px; padding-inline: 0; }
@media (max-width: 999px) { .ct2-aside { order: 0; margin-top: 8px; } .ct2-sticky { position: static; } .ct2-checklist { flex-direction: row; flex-wrap: wrap; } }
.ct2-pdf { margin-top: 16px; }
.ct2-pdf-frame { width: 100%; height: min(80vh, 1100px); border: 1px solid var(--v2-line); border-radius: var(--v2-radius-sm); background: #525659; }

/* ---- QA portal round (2026-10-18): header, search, wizard, errors --------------- */

/* Active company chip in the header (M1): tells SEASI and MPC apart at a glance. */
.v2-org-chip { display: inline-flex; align-items: center; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 12px; border: 1px solid #2c3a4f; border-radius: 999px; color: #dbe6f2; background: #142033; font-size: 13px; font-weight: 600; }

/* Mobile menu: ☰ becomes ✕ and Cerrar sesión separates from the nav (BAJA). */
.v2-menu-ico--close { display: none; }
.v2-menu[open] .v2-menu-ico--open { display: none; }
.v2-menu[open] .v2-menu-ico--close { display: inline; }
@media (max-width: 719px) {
  .v2-nav--mobile .v2-nav-logout { border-top: 1px solid #2c3a4f; margin-top: 8px; padding-top: 4px; }
}

/* Search: visible label, short placeholder, stacked on narrow screens (M9). */
.v2-search { align-items: flex-end; }
.v2-search-field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.v2-search-label { color: var(--v2-muted); font-size: 14px; font-weight: 600; }
@media (max-width: 600px) { .v2-search { flex-wrap: wrap; } .v2-search .v2-btn { width: 100%; } }

/* Model wizard: reset link (M7), org note (M6), missing-fields box (M4), PDF link (M19). */
.ct2-reset-row { display: flex; justify-content: flex-end; }
.ct2-reset-link { background: none; border: 0; padding: 2px 0; color: var(--v2-red-ink); font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.ct2-reset-link:hover { color: #82241d; }
.ct2-org-note { margin: 0 0 14px; }
.ct2-missing-box p { margin: 0 0 4px; }
.ct2-missing-box details { margin-top: 6px; }
.ct2-missing-box summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.ct2-missing-box ul { margin: 8px 0 0; padding-left: 20px; }
.ct2-missing-box li { margin-bottom: 4px; }
.ct2-missing-box li[data-money="true"] > a { font-weight: 700; }
.ct2-pdf-actions { margin: 10px 0 0; }
.ct2-tech { margin-top: 16px; border-top: 1px solid var(--v2-line); padding-top: 12px; }
.ct2-tech summary { cursor: pointer; color: var(--v2-ink-soft); font-weight: 600; font-size: 14px; }
/* Review step: keep the sticky nav from covering the last content on mobile (A1). */
@media (max-width: 719px) { .ct2-main { padding-bottom: 24px; } .ct2-nav { margin-bottom: 12px; } }

/* Paper preview on phones: left-aligned text and tighter margins (M18). */
@media (max-width: 600px) {
  .ct2-preview .paper, .ct2-preview #paper { text-align: left; }
  .ct2-preview .paper-wrap { margin: 0; }
  .ct2-preview .paper { padding: 18px 16px; }
}

/* Home flow: visual mini-stepper instead of a run-on line (BAJA). */
.v2-flow-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 4px 0 8px; }
.v2-flow-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--v2-line); border-radius: 999px; background: var(--v2-surface); color: var(--v2-ink-soft); font-size: 14px; font-weight: 600; }
.v2-flow-steps li span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--v2-ink); color: #fff; font-size: 12px; }

/* Dropzone success state (BAJA): check mark and "Cambiar archivo". */
.v2-dropzone.is-ok { border-style: solid; border-color: var(--v2-green-line); background: var(--v2-green-bg); }
.dz-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .dz-desktop { display: none; } .dz-touch { display: inline; } }

/* Portal error page (BAJA): same shell as the rest of the portal when signed in. */
.v2-error-page { max-width: 720px; }
.v2-error-card { text-align: center; padding: 40px 24px; }
.v2-error-number { display: block; font: 600 56px/1 var(--seasi-font-display); color: var(--v2-line-strong); margin-bottom: 8px; }
.v2-error-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.v2-tech-download { font-weight: 600; }

@media (max-width: 719px) { .v2-brand img { width: 118px; } }

/* Next actions keep the portal's existing cards; no extra dashboard or JS is required. */
.v2-section-hint { color: var(--v2-muted); margin: -4px 0 16px; max-width: 70ch; }
.v2-row-main { min-width: 0; }
.v2-row-guidance { color: var(--v2-muted); font-size: 14px; line-height: 1.5; margin: 6px 0 0; max-width: 65ch; }
.v2-all-clear h2 { margin: 0 0 8px; }
.v2-all-clear p { color: var(--v2-muted); }
.v2-attention-filter, .v2-results, .v2-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.v2-attention-filter { margin: 4px 0 20px; }
.v2-results { justify-content: space-between; margin: 16px 0; font-size: 14px; }
.v2-results p { margin: 0; }
.v2-results a { min-height: 44px; display: inline-flex; align-items: center; }
.v2-pagination { justify-content: center; margin: 24px 0; }
@media (min-width: 720px) { .v2-row-side { max-width: 300px; } .v2-attention .v2-row-side { max-width: 230px; } }
@media (max-width: 719px) { .v2-attention .v2-section-head { align-items: flex-start; flex-direction: column; gap: 8px; } .v2-pagination .v2-btn { flex: 1; } }
.v2-filter-panel { border: 1px solid var(--v2-line); border-radius: var(--v2-radius-sm); padding: 0 16px; background: var(--v2-surface); }
.v2-filter-panel > summary { cursor: pointer; min-height: 52px; padding: 14px 0; font-weight: 600; overflow-wrap: anywhere; }
.v2-filter-panel[open] > summary { margin-bottom: 10px; }
.v2-filter-state { display: block; font-size: 13px; font-weight: 400; color: var(--v2-muted); margin: 4px 0 0 18px; }
.v2-filter-panel .v2-search { margin-bottom: 16px; }
