/* Ciclo S&OP (planning/web/sop_views.py). Prefix sop-. Every number is a
 * Flutter logical px from lib/presentation/screens/parameters/. The side
 * panel wears Plan de demanda's SidePanelShell classes (psp-*, sp-*). */

.page.sop-page { padding: 20px 28px 40px 14px; }
.sop-cq { container-type: inline-size; }
.sop-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.sop-micro { font-size: 11px; font-weight: 600; letter-spacing: .3px; color: var(--muted); }
.sop-fig20 { font-size: 20px; font-weight: 700; line-height: 1.15; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.sop-fig16 { font-size: 16px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.sop-t-ok { color: var(--success); } .sop-t-warn { color: var(--warning); } .sop-t-err { color: var(--error); }
.sop-t-muted { color: var(--muted); } .sop-t-pri { color: var(--primary); } .sop-t-t2 { color: var(--text-2); }
.sop-ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Top bar: the view switch and the overdue chip ───────────────────── */
.sop-actions { display: flex; align-items: center; gap: 10px; }
.sop-tabs { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--hover); border: 1px solid var(--border); }
.sop-tabs button { padding: 7px 12px; border-radius: 6px; border: 1px solid transparent; font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: background-color 120ms linear, color 120ms linear; }
.sop-tabs button.is-on { background: var(--surface); border-color: var(--border); box-shadow: 0 1px 2px var(--shadow); color: var(--text); font-weight: 600; }

/* ── Small pieces (sop_ui.dart) ──────────────────────────────────────── */
.sop-chip { --c: var(--muted); display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 9px; border-radius: 20px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.sop-chip i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.sop-chip span { overflow: hidden; text-overflow: ellipsis; }
.sop-c-ok { --c: var(--success); } .sop-c-warn { --c: var(--warning); } .sop-c-pri { --c: var(--primary); }
.sop-c-t2 { --c: var(--text-2); } .sop-c-muted { --c: var(--muted); }
.sop-av { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface-light) 50%, transparent); font-size: 9px; font-weight: 600; letter-spacing: 0; color: var(--text-2); }
.sop-soon { flex: none; padding: 3px 8px; border-radius: 20px; border: 1px solid var(--border); font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sop-own-name { min-width: 0; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sop-own-name.is-none { color: var(--muted); }
.sop-cardhead { display: flex; align-items: center; gap: 8px; }
.sop-cardhead b { flex: 1; font-size: 14px; font-weight: 700; }
.sop-foot { max-width: 900px; margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12.5px; line-height: 1.5; color: var(--muted); }

/* ── Layout: the table, and its side card when there is room ─────────── */
.sop-split { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.sop-scroll-x { min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.sop-ptable { min-width: 900px; }
.sop-split-proc { margin-top: 0; }
@container (min-width: 1100px) {
  .sop-split-proc { flex-direction: row; align-items: flex-start; }
  .sop-split-proc > .sop-scroll-x { flex: 1; }
  .sop-side-320 { width: 320px; flex: none; }
}

/* ── Ciclo actual (sop_current_view.dart) ────────────────────────────── */
.sop-kpis { display: grid; grid-template-columns: repeat(4, 1fr); }
.sop-kpi { padding: 14px 18px 16px; min-width: 0; }
.sop-kpi + .sop-kpi { border-left: 1px solid var(--border); }
.sop-kpi .sop-micro { margin-bottom: 8px; }
@container (max-width: 639.98px) {
  .sop-kpis { grid-template-columns: 1fr 1fr; }
  .sop-kpi:nth-child(3) { border-left: 0; }
  .sop-kpi:nth-child(n + 3) { border-top: 1px solid var(--border); }
}
.sop-crow { display: flex; align-items: center; padding: 14px 18px 14px 14px; }
/* The state's bar runs down the whole row card: the row, the reopen
   question and the comment thread (folded or open) under it. */
.sop-crow-wrap { border-left: 3px solid transparent; }
.sop-crow + .sop-crow, .sop-crow-wrap + .sop-crow-wrap { border-top: 1px solid var(--border); }
.sop-reopen { margin: 0 18px 12px 46px; }
.sop-reopen .sop-in { width: 240px; max-width: 100%; }
.sop-edge-ok { border-left-color: color-mix(in srgb, var(--success) 80%, transparent); }
.sop-edge-warn { border-left-color: color-mix(in srgb, var(--warning) 80%, transparent); }
.sop-edge-err { border-left-color: color-mix(in srgb, var(--error) 80%, transparent); }
.sop-n { flex: none; width: 26px; }
.sop-stage { flex: 1; min-width: 0; }
.sop-stage b { display: block; font-size: 13.5px; font-weight: 600; }
.sop-stage b.is-ahead { color: var(--text-2); }
.sop-stage small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.sop-stage small.sop-ell { display: block; }
.sop-stage small.sop-signote { -webkit-line-clamp: 1; font-style: italic; color: var(--text-2); cursor: pointer; }
.sop-stage small.sop-signote.is-open { -webkit-line-clamp: unset; }
.sop-signote-who { font-style: normal; font-weight: 600; }
.sop-col-team { flex: none; width: 124px; margin-left: 12px; }
.sop-col-own { flex: none; width: 170px; display: flex; align-items: center; gap: 8px; }
.sop-col-when { flex: none; width: 110px; text-align: right; font-size: 12px; font-weight: 500; color: var(--muted); }
.sop-col-state { flex: none; width: 92px; text-align: right; font-size: 12.5px; font-weight: 600; }

.sop-last { padding: 16px 18px 18px; }
.sop-last-month { margin-top: 4px; font-size: 12px; color: var(--muted); }
.sop-last-figs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 16px 0 18px; }
.sop-last-figs .sop-micro { margin-bottom: 4px; }
.sop-quote { margin: 10px 0 0; padding-left: 14px; border-left: 2px solid color-mix(in srgb, var(--muted) 50%, transparent); font-size: 13px; line-height: 1.55; color: var(--text); }
.sop-signer { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.sop-signer span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sop-learned { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12.5px; line-height: 1.5; color: var(--text-2); }

.sop-off-wrap { min-height: calc(100dvh / var(--zoom) - var(--topbar-h) - 70px); display: grid; place-items: center; }
.sop-off { width: 100%; max-width: 560px; padding: 24px; }
.sop-off h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 0; }
.sop-off p { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.sop-filled { margin-top: 16px; height: 40px; padding: 0 24px; border-radius: 20px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 500; }
.sop-filled:hover { background: color-mix(in srgb, var(--primary) 92%, #000); }
.sop-filled[disabled] { opacity: .5; }

/* ── Proceso (sop_process_view.dart) ─────────────────────────────────── */
.sop-enable { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--border); }
.sop-enable b { flex: 1; font-size: 13px; font-weight: 600; }
.sop-switch { flex: none; position: relative; margin: 4px; width: 52px; height: 32px; border-radius: 16px; border: 2px solid var(--muted); background: var(--surface-light); transition: background-color 120ms linear, border-color 120ms linear; }
.sop-switch i { position: absolute; top: 6px; left: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: all 120ms var(--ease-out-cubic); }
.sop-switch.is-on { background: color-mix(in srgb, var(--primary) 46%, var(--card)); border-color: var(--primary); }
.sop-switch.is-on i { left: 22px; top: 2px; width: 24px; height: 24px; background: var(--primary); }
.sop-switch[disabled] { opacity: .6; }
.sop-phead { display: flex; align-items: center; padding: 12px 18px 10px; }
.sop-pc-team { flex: none; width: 124px; }
.sop-pc-own { flex: none; width: 210px; }
.sop-pc-due { flex: none; width: 112px; display: flex; justify-content: center; text-align: center; }
.sop-pc-par { flex: none; width: 130px; display: flex; align-items: center; justify-content: flex-end; gap: 4px; text-align: right; color: var(--muted); }
.sop-pc-par span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.sop-prow { display: flex; align-items: center; padding: 13px 18px; border-top: 1px solid var(--border); cursor: pointer; transition: background-color 80ms linear; outline: none; }
.sop-prow:hover, .sop-prow:focus-visible { background: var(--hover); }
.sop-prow .sop-pc-team { margin-left: 12px; }
.sop-pick { position: relative; display: inline-block; max-width: 196px; }
.sop-pick-field { display: inline-flex; align-items: center; gap: 8px; max-width: 196px; height: 34px; padding: 0 6px 0 8px; border-radius: 8px; border: 1px solid var(--border); text-align: left; }
.sop-pick-field .sop-own-name { color: var(--text); }
.sop-pick-field .sop-own-name.is-none { color: var(--muted); }
.sop-pick-caret { flex: none; margin-left: -4px; color: var(--muted); }
.sop-menu { position: absolute; z-index: 30; top: calc(100% + 2px); left: 0; min-width: 220px; padding: 8px 0; border-radius: 8px; border: 1px solid var(--border); background: var(--card); box-shadow: var(--menu-shadow); }
.sop-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 12px; font-size: 13px; text-align: left; white-space: nowrap; }
.sop-menu-item span:last-child { overflow: hidden; text-overflow: ellipsis; }
.sop-menu-item:hover { background: var(--hover); }
.sop-menu-item.is-none { color: var(--muted); }
.sop-menu-sep { height: 1px; margin: 7.5px 0; background: var(--border); }
.sop-step { display: inline-flex; align-items: center; }
.sop-step button { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border); color: var(--text-2); }
.sop-step button:hover { background: var(--hover); }
.sop-step button[disabled] { opacity: .38; cursor: default; background: none; }
.sop-step b { width: 34px; text-align: center; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

.sop-catalog { padding: 16px 18px 8px; }
.sop-cat-sub { margin: 8px 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.sop-cat-row { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); }
.sop-cat-row > span:first-child { flex: 1; font-size: 13px; color: var(--text-2); }

/* ── Historial (sop_history_view.dart) ───────────────────────────────── */
.sop-hist-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 12.5px; color: var(--muted); }
.sop-hcard + .sop-hcard { margin-top: 12px; }
.sop-hhead { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px 20px 16px 14px; text-align: left; transition: background-color 80ms linear; }
.sop-hhead:hover { background: var(--hover); }
.sop-htitle { flex: none; display: inline-flex; align-items: center; gap: 8px; }
.sop-htitle b { font-size: 15.5px; font-weight: 700; margin-right: 4px; }
.sop-hcaret { display: grid; color: var(--muted); transition: transform 120ms var(--ease-out-cubic); }
.sop-hcaret.is-open { transform: rotate(90deg); }
.sop-hmeta { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sop-hfigs { flex: none; display: flex; gap: 28px; margin-left: 4px; }
.sop-hfigs > span { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.sop-hbody { border-top: 1px solid var(--border); padding-bottom: 6px; }
.sop-hdec { padding: 16px 22px 20px; }
.sop-hnote { position: relative; display: flex; align-items: center; padding: 12px 22px; }
.sop-hnote::before { content: ""; position: absolute; top: 0; left: 22px; right: 0; border-top: 1px solid var(--border); }
.sop-hnote b { flex: none; width: 220px; font-size: 13px; font-weight: 600; }
.sop-hnote-t { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-2); }
.sop-hnote-team { flex: none; width: 130px; margin-left: 12px; }
.sop-hnote-day { flex: none; width: 60px; text-align: right; font-size: 12px; font-weight: 500; color: var(--muted); }
@container (max-width: 759.98px) {
  .sop-hhead { flex-wrap: wrap; }
  .sop-hmeta { flex-basis: 100%; }
  .sop-hfigs { margin-left: 0; }
  .sop-hfigs > span { align-items: flex-start; }
}
@container (max-width: 699.98px) {
  .sop-hnote { flex-wrap: wrap; gap: 4px 10px; }
  .sop-hnote b, .sop-hnote-t { width: 100%; flex-basis: 100%; }
  .sop-hnote-team { margin-left: 0; width: auto; }
}

/* ── The stage panel (stage_params_panel.dart in SidePanelShell) ─────── */
.sop-eyebrow { margin-bottom: 3px; font-size: 9.5px; font-weight: 600; letter-spacing: 1.1px; color: var(--muted); }
.psp.no-anim { transition: none; }
.sop-spc { background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.sop-spc + .sop-spc, .sop-pbody > form + .sop-spc { margin-top: 12px; }
.sop-spc-title { display: flex; align-items: center; gap: 16px; padding: 11px 14px 10px; border-bottom: 1px solid var(--border); }
.sop-spc-title b { flex: 1; font-size: 13px; font-weight: 700; }
.sop-spc-title span { flex: none; font-size: 10.5px; color: var(--muted); }
.sop-spc-title.is-stacked { flex-direction: column; align-items: flex-start; gap: 3px; }
.sop-spc-title.is-stacked span { flex: initial; font-size: 11.5px; line-height: 1.4; }
.sop-spc-body { padding: 12px 14px 13px; }
.sop-help { margin: 7px 0 0 2px; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.sop-pre { white-space: pre-line; }
.sop-err { margin: 8px 0 0; font-size: 11.5px; line-height: 1.4; color: var(--error); }
.sop-cost { margin: 8px 0 0; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.sop-note { margin: 10px 0 0; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.sop-gap16 { height: 16px; }
.sop-frow { display: flex; align-items: flex-start; gap: 12px; }
.sop-grow { flex: 1; min-width: 0; }
.sop-field { position: relative; display: flex; align-items: center; height: 40px; border: 1px solid var(--border); border-radius: 10px; background: color-mix(in srgb, var(--surface-light) 40%, transparent); transition: border-color 100ms linear; }
.sop-field:focus-within { border: 2px solid var(--primary); }
.sop-field.is-err { border-color: var(--error); }
.sop-flabel { position: absolute; z-index: 1; left: 15px; top: -8px; padding: 0 3px; max-width: calc(100% - 18px); font-size: 12px; line-height: 14px; color: var(--text-2); background: linear-gradient(var(--field-under, var(--card)) 62%, transparent 62%); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.sop-field:focus-within .sop-flabel { color: var(--primary); left: 14px; top: -9px; }
.sop-field.is-err .sop-flabel { color: var(--error); }
.sop-field input, .sop-field select { flex: 1; min-width: 0; height: 100%; padding: 0 18px; border: 0; outline: 0; background: transparent; font-size: 14px; color: var(--text); }
.sop-field:focus-within input, .sop-field:focus-within select { padding: 0 17px; }
.sop-field input { font-size: 16px; }
.sop-select select { appearance: none; -webkit-appearance: none; padding-right: 48px; cursor: pointer; }
.sop-select select option { background: var(--card); color: var(--text); }
.sop-fcaret { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.sop-fsuffix { flex: none; padding-right: 18px; font-size: 16px; font-style: italic; color: var(--muted); white-space: nowrap; }
.sop-from { margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.sop-check { display: flex; align-items: center; gap: 16px; min-height: 40px; cursor: pointer; font-size: 13px; }
.sop-check input { flex: none; width: 18px; height: 18px; margin: 0 11px; accent-color: var(--primary); cursor: pointer; }
.sop-hier { height: 480px; }
.sop-spin { display: inline-block; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; vertical-align: middle; animation: sopspin .8s linear infinite; }
@keyframes sopspin { to { transform: rotate(360deg); } }
.sop-pskel .sk { border-radius: 14px; }

/* ── Snackbar ────────────────────────────────────────────────────────── */
.sop-toast { position: fixed; z-index: var(--z-toast); left: 50%; bottom: 24px; transform: translateX(-50%); min-width: 288px; max-width: min(568px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 4px; background: #323232; color: #fff; font-size: 14px; line-height: 1.43; box-shadow: 0 3px 5px rgba(0, 0, 0, .2), 0 6px 10px rgba(0, 0, 0, .14); }
:root[data-theme="dark"] .sop-toast { background: #E6E1E5; color: #1C1B1F; }

/* ── Sessions: "Ver como", the plan bar, the setup and the steps editor ─ */
.sop-more { position: relative; }
.sop-more-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; color: var(--text-2); }
.sop-more-btn:hover, .sop-more-btn[aria-expanded="true"] { background: var(--hover); color: var(--text); }
.sop-more-btn.is-on { border-color: var(--border); color: var(--primary); }
.sop-more-menu { left: auto; right: 0; top: calc(100% + 4px); min-width: 240px; max-height: 360px; overflow-y: auto; }
.sop-more-title { padding: 4px 12px 6px; }
.sop-more-check { flex: none; display: grid; place-items: center; width: 16px; color: var(--primary); }
.sop-more-note { margin: 6px 0 0; padding: 8px 12px 2px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.sop-in { height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12.5px; min-width: 0; }
.sop-in:focus { outline: 2px solid color-mix(in srgb, var(--primary) 50%, transparent); outline-offset: -1px; }
.sop-preview { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 10px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); background: color-mix(in srgb, var(--primary) 7%, transparent); font-size: 12.5px; color: var(--text-2); }
.sop-preview span { flex: 1; min-width: 0; }
.sop-preview button { flex: none; font-size: 12.5px; font-weight: 600; color: var(--primary); }
.sop-outline { height: 32px; padding: 0 14px; border-radius: 16px; border: 1px solid var(--border); font-size: 12.5px; font-weight: 500; color: var(--text); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.sop-outline:hover { background: var(--hover); }
.sop-bar { padding: 16px 18px; overflow: visible; }
.sop-bar .sop-cardhead { flex-wrap: wrap; }
.sop-bar-note { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.sop-bar .sop-filled { margin-top: 12px; }
.sop-bar-warn { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--warning) 9%, transparent); font-size: 12.5px; color: var(--text-2); }
.sop-bar-warn span { flex: 1; min-width: 200px; }
.sop-bar-mine { margin-top: 14px; }
.sop-bpart { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border); }
.sop-bar-mine + .sop-bpart { border-top: 0; }
.sop-bpart .sop-stage { flex: 1; min-width: 220px; }
.sop-bstate { flex: none; font-size: 12.5px; font-weight: 600; }
.sop-stage small.sop-wait { color: var(--warning); }
.sop-stage small.sop-links { display: flex; flex-wrap: wrap; gap: 4px 14px; -webkit-line-clamp: unset; }
.sop-links a, .sop-linkbtn { color: var(--primary); font-size: 12px; font-weight: 500; text-decoration: none; }
.sop-links a:hover, .sop-linkbtn:hover { text-decoration: underline; }
.sop-links .sop-assign { color: var(--warning); }
.sop-hlink { display: block; color: inherit; text-decoration: none; }
.sop-hlink:hover .sop-hhead { background: var(--hover); }
.sop-dback { margin-bottom: 12px; }
.sop-dcard { padding: 16px 20px; }
.sop-dcard + .sop-dcard { margin-top: 12px; }
.sop-dgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.sop-dfact { font-size: 13px; line-height: 1.5; color: var(--text-2); }
.sop-dfact b { display: block; color: var(--text); font-size: 13.5px; }
.sop-dstep + .sop-dstep { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.sop-dstep-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sop-dstep-head b { font-size: 13.5px; }
.sop-dpart { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-top: 6px; font-size: 12.5px; color: var(--text-2); }
.sop-dpart > span:first-child { min-width: 180px; color: var(--text); }
.sop-dnote { font-style: italic; }
/* Historial's detail, compact (Lucas, 2026-10-14): one muted line per
   fact, one line per step, the rest behind small toggles. */
.sop-dhead .sop-dline { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.sop-dhead .sop-dline:first-of-type { margin-top: 8px; }
.sop-dsteps-l, .sop-dauto-l { list-style: none; margin: 6px 0 0; padding: 0; }
.sop-dsl + .sop-dsl { border-top: 1px solid var(--border); }
.sop-dsl summary { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 0; list-style: none; cursor: pointer; font-size: 13px; }
.sop-dsl summary::-webkit-details-marker { display: none; }
.sop-dsi { flex: none; display: grid; }
.sop-dsn { flex: 0 1 auto; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sop-dsl.is-auto .sop-dsn { color: var(--text-2); font-weight: 400; }
.sop-dsw { flex: 1 1 auto; min-width: 0; color: var(--text-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sop-dsd { flex: none; color: var(--muted); font-size: 12px; }
.sop-dtoggle { flex: none; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: 11px; line-height: 16px; }
.sop-dsl summary:hover .sop-dtoggle, .sop-dreg summary:hover .sop-dtoggle { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
details[open] > summary .sop-dtoggle { background: var(--hover); }
.sop-dsl details > .sop-dpart { margin: 0 0 6px 25px; }
.sop-dkind { align-items: center; }
.sop-dauto-l { margin: 0 0 8px 25px; }
.sop-dauto-l li { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12.5px; }
.sop-dauto-l li b { font-weight: 600; }
.sop-dreg summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; }
.sop-dreg summary::-webkit-details-marker { display: none; }
.sop-dreg summary b { flex: 1; font-size: 13.5px; }
.sop-dlog { list-style: none; margin: 8px 0 0; padding: 0; }
.sop-dlog li { display: flex; gap: 12px; padding: 8px 0; font-size: 12.5px; line-height: 1.45; }
.sop-dlog li + li { border-top: 1px solid var(--border); }
.sop-dlog .sop-dwhen { flex: none; width: 92px; color: var(--muted); }
.sop-bsubmit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sop-bsubmit .sop-in { width: 220px; max-width: 100%; }
.sop-bsubmit .sop-filled { margin-top: 0; height: 32px; padding: 0 16px; font-size: 13px; }
.sop-setup { padding: 16px 18px; margin-bottom: 16px; }
.sop-seg { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--hover); border: 1px solid var(--border); }
.sop-seg button { padding: 6px 12px; border-radius: 6px; border: 1px solid transparent; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.sop-seg button.is-on { background: var(--surface); border-color: var(--border); color: var(--text); font-weight: 600; }
.sop-seg button.is-default { border-style: dashed; }
.sop-confirm { margin: 4px 0 12px; padding: 12px 14px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--warning) 55%, transparent); background: color-mix(in srgb, var(--warning) 8%, transparent); font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.sop-confirm p { margin: 0; }
.sop-drift { margin: 0 0 10px; }
.sop-drift > p { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.sop-drift > p svg { flex: none; }
.sop-drift .sop-confirm { margin-top: 8px; }
.sop-confirm-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.sop-confirm-acts .sop-filled { margin-top: 0; height: 32px; padding: 0 16px; font-size: 13px; }
.sop-editor { padding: 16px 18px; overflow: visible; }
.sop-dirty { font-size: 11.5px; font-weight: 600; color: var(--warning); }
.sop-efs { margin: 0; padding: 0; border: 0; min-width: 0; }
.sop-eops { display: inline-flex; gap: 2px; }
.sop-eops button, .sop-eicon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--muted); }
.sop-eops button:hover, .sop-eicon:hover { background: var(--hover); color: var(--text); }
.sop-eops button[disabled] { opacity: .35; }
.sop-eassign { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.sop-eassign > select { width: 100%; }
/* Same column as the owner select, so both are the same width with or
   without the remove button beside it. */
.sop-eassign > .sop-scope { grid-column: 1; grid-row: 2; }
.sop-scope { position: relative; flex: 1; min-width: 200px; }
.sop-scope summary { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; cursor: pointer; list-style: none; }
.sop-scope summary::-webkit-details-marker { display: none; }
.sop-scope summary .sop-ell { flex: 1; min-width: 0; }
.sop-scope-menu { position: absolute; z-index: 20; top: 36px; left: 0; right: 0; max-height: 280px; overflow: auto; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); box-shadow: 0 8px 24px var(--shadow); }
.sop-scope-menu .sop-micro { margin: 8px 0 4px; }
.sop-scope-menu label { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12.5px; }
.sop-elink { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 12px; font-weight: 500; color: var(--primary); }
.sop-efoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border); }
.sop-efoot .sop-filled { margin-top: 0; }
.sop-hhead.is-static { flex-wrap: wrap; }
.sop-hhead.is-static:hover { background: none; }
@media (max-width: 640px) {
  .sop-bsubmit .sop-in { width: 100%; }
}

/* A tab's skeleton while its view loads (sop.js): the old body stays,
   hidden, until the new one swaps in or the request fails. */
.sop-body.sop-reloading > :not(.sop-skel-ov) { display: none; }
.sop-skel-ov { position: relative; display: flex; flex-direction: column; gap: 12px; }
.sop-skel-ov .sk { border-radius: 12px; }

/* ── Ciclo actual (Lucas, 2026-10-13): the strip, then the plan card and
   the steps' timeline, with the last cycle and the activity beside them
   (below them on a narrow screen). ─────────────────────────────────── */
.sop-kpis { position: relative; }
.sop-kbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--border) 70%, transparent); }
.sop-kbar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--primary) 85%, transparent); border-radius: 0 2px 2px 0; }
.sop-kbar-mark { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -3px; background: var(--warning); }
.sop-cur { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; margin-top: 16px; }
.sop-cur-main, .sop-cur-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@container (min-width: 1080px) {
  .sop-cur { grid-template-columns: minmax(0, 1fr) 320px; }
}
.sop-info { display: inline-grid; place-items: center; color: var(--muted); cursor: help; outline: none; }
.sop-info:hover, .sop-info:focus-visible { color: var(--text-2); }

/* The viewer's mark: "Tu parte", or "Te toca" when theirs can be signed now. */
.sop-mine { flex: none; display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); font-size: 10.5px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }

/* The timeline: one node per step, joined by a line. */
.sop-tl { overflow: visible; }
.sop-tl-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 0 18px; }
.sop-tl-head b { font-size: 14px; font-weight: 700; white-space: nowrap; }
.sop-tl-head > .sop-micro { white-space: nowrap; }
.sop-tl-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 6px 0 12px; border-radius: 15px; font-size: 12.5px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.sop-tl-toggle:hover { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.sop-tl-caret { transition: transform 220ms var(--ease-out-cubic); }
.sop-tl.is-open .sop-tl-caret { transform: rotate(180deg); }
.sop-tl-scroll { position: relative; overflow-x: auto; scrollbar-width: thin; padding: 8px 8px 12px; }
.sop-tl-track { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(124px, 1fr); }
.sop-tl-node { position: relative; min-width: 0; }
.sop-tl-node + .sop-tl-node::before { content: ""; position: absolute; z-index: 0; top: 23px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.sop-tl-node.is-done + .sop-tl-node::before { background: color-mix(in srgb, var(--success) 70%, transparent); }
.sop-tl-hit { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; height: 100%; padding: 8px 6px 10px; border-radius: 10px; border: 1px solid transparent; text-align: center; transition: background-color 100ms linear; }
.sop-tl-hit:hover { background: var(--hover); }
.sop-tl-hit:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: -2px; }
.sop-tl-dot { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 5px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--card); font-size: 12px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
/* Flat states: a 1.5px border and a solid fill, no halo. The step in course
   is the framed card around its node (is-current), never a glow. */
.sop-tl-node.is-done .sop-tl-dot { border-color: var(--success); background: var(--success); color: #fff; }
.sop-tl-node.is-now .sop-tl-dot { border-color: var(--warning); color: var(--warning); }
.sop-tl-node.is-overdue .sop-tl-dot { border-color: var(--error); background: var(--error); color: #fff; }
.sop-tl-node.is-scheduled .sop-tl-dot { border-style: dashed; color: var(--muted); }
.sop-tl-node.is-current .sop-tl-hit { background: color-mix(in srgb, var(--primary) 7%, transparent); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.sop-tl-label { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--text); }
.sop-tl-node.is-scheduled .sop-tl-label { color: var(--text-2); }
.sop-tl-kind { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font-size: 11px; font-weight: 500; color: var(--c); white-space: nowrap; }
.sop-tl-kind i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.sop-tl-meta { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin-top: 3px; }
.sop-tl-meta .sop-av { width: 22px; height: 22px; }
.sop-tl-state { font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.sop-tl-when { font-size: 11px; color: var(--muted); }
.sop-tl-hit .sop-mine { margin-top: 3px; }
.sop-cur-side .afeed-list { max-height: 520px; overflow-y: auto; scrollbar-width: thin; }

/* The detail: the timeline unfolds into the list of steps. */
.sop-tl-detail { display: grid; grid-template-rows: 0fr; }
.sop-tl.is-open .sop-tl-detail { grid-template-rows: 1fr; }
.sop-tl-inner { min-height: 0; overflow: hidden; opacity: 0; border-radius: 0 0 11px 11px; }
.sop-tl.is-open .sop-tl-inner { opacity: 1; border-top: 1px solid var(--border); }
.sop-tl.is-settled .sop-tl-detail { transition: grid-template-rows 320ms var(--ease-out-cubic); }
.sop-tl.is-settled .sop-tl-inner { transition: opacity 240ms linear; }
.sop-ctable { min-width: 760px; }
.sop-crow-wrap.is-mine { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.sop-crow-wrap.is-flash { animation: sop-flash 1.4s var(--ease-out-cubic); }
@keyframes sop-flash { from { background: color-mix(in srgb, var(--primary) 18%, transparent); } }
.sop-col-own { flex-wrap: wrap; row-gap: 4px; width: 190px; }
.sop-col-own .sop-own-name { max-width: 158px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.sop-col-own .sop-mine { margin-left: 32px; }
.sop-stage small.sop-mine-scope { -webkit-line-clamp: 1; color: var(--primary); font-weight: 500; }
@media (prefers-reduced-motion: reduce) {
  .sop-tl.is-settled .sop-tl-detail, .sop-tl.is-settled .sop-tl-inner, .sop-tl-caret { transition: none; }
  .sop-crow-wrap.is-flash { animation: none; }
}

/* ── Proceso: the setup in one row, one row per step, a drawer per step ── */
.sop-setup { padding: 14px 18px; margin-bottom: 16px; overflow: visible; }
.sop-setup-line { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.sop-setup-on { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 12px; }
.sop-setup-on .sop-switch { margin: 0; }
.sop-setup-freq { display: flex; align-items: center; gap: 8px; }
.sop-hint { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.sop-hint > svg { flex: none; color: var(--warning); }
.sop-editor .sop-cardhead b { flex: none; }
.sop-editor .sop-dirty { margin-left: auto; }
.sop-editor .sop-cat-sub { margin: 4px 0 0; }
.sop-plist { list-style: none; margin: 10px 0 14px; padding: 0; }
.sop-pstep { display: grid; grid-template-columns: 26px minmax(0, 1fr) 118px minmax(0, 200px) 92px auto; grid-template-areas: "n name kind own due acts"; align-items: center; gap: 4px 12px; margin: 0 -8px; padding: 9px 8px; border-top: 1px solid var(--border); border-radius: 8px; transition: background-color 120ms linear; }
/* The whole row opens its drawer (as Editar does); its own controls keep theirs. */
.sop-pstep[role="button"] { cursor: pointer; }
.sop-pstep:hover, .sop-pstep.is-editing { background: var(--hover); }
.sop-pstep:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: -2px; }
.sop-pstep > .sop-n { grid-area: n; }
.sop-pstep-name { grid-area: name; font-size: 13.5px; font-weight: 600; }
.sop-pstep-kind { grid-area: kind; min-width: 0; }
.sop-pstep-own { grid-area: own; display: flex; align-items: center; gap: 8px; min-width: 0; }
.sop-pstep-due { grid-area: due; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.sop-pstep-acts { grid-area: acts; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.sop-pstep-edit { height: 30px; }
@container (max-width: 760px) {
  .sop-pstep { grid-template-columns: 26px auto minmax(0, 1fr) auto; grid-template-areas: "n name name acts" ". kind own due"; }
}
@container (max-width: 480px) {
  .sop-pstep { grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "n name acts" ". kind kind" ". own due"; }
  .sop-pstep .sop-eops button { width: 26px; }
}
.sop-drawer .psp { --w: 520px; }
.sop-drawer .psp-body { margin: 0; border: 0; min-width: 0; }
.sop-dfield { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sop-dfield .sop-in { height: 36px; font-size: 13px; }
.sop-drow { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 12px; margin-top: 14px; }
.sop-dsec { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.sop-dsec > .sop-micro { margin-bottom: 2px; }
.sop-dparams .sop-pgroup { margin-top: 12px; }
.sop-pgroup + .sop-pgroup { padding-top: 12px; border-top: 1px dashed var(--border); }
.sop-pgroup-head { display: flex; align-items: center; gap: 6px; }
.sop-pgroup-head b { font-size: 13px; font-weight: 600; }
.sop-pgroup-head + .sop-frow, .sop-pgroup-head + .sop-field { margin-top: 14px; }
.sop-pline { margin: 2px 0 10px; font-size: 12px; line-height: 1.4; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sop-dparams .sop-frow { align-items: center; }
.sop-dparams .sop-frow .sop-pline { margin: 0; white-space: normal; }
.sop-dparams .sop-field { height: 38px; }
.sop-dparams .sop-err { margin: 6px 0 0 2px; }
.sop-dparams .sop-check { margin-top: 4px; }
.sop-drawer .psp-foot { justify-content: flex-end; }
.sop-drawer .psp-foot .sop-filled { margin-top: 0; height: 32px; padding: 0 16px; font-size: 13px; }

/* ── Proceso's setup (sop_setup.py): the checklist, the plan level beside
   the switch and the cadence, the empty owner, and "Armá tu ciclo". ──── */
.sop-proc-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.sop-proc-top > .sop-setup { margin-bottom: 0; }
@container (min-width: 980px) {
  .sop-proc-top { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: stretch; }
  .sop-proc-top-demo { grid-template-columns: minmax(0, 1fr); max-width: 720px; }
}
.sop-level { padding: 14px 18px 14px; overflow: visible; border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.sop-level.is-focus { animation: sop-flash 1.6s var(--ease-out-cubic); }
.sop-level-head { display: flex; align-items: center; gap: 6px; }
.sop-level-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.sop-level-name { font-size: 19px; font-weight: 700; letter-spacing: -.2px; line-height: 1.25; }
.sop-level-now { font-size: 12px; color: var(--muted); }
.sop-level-change { margin-left: auto; align-self: center; }
.sop-level-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.sop-level-edit .sop-in { height: 34px; min-width: 220px; font-size: 13px; }
.sop-level-edit .sop-filled { margin-top: 0; height: 32px; padding: 0 16px; font-size: 13px; }
.sop-level-line { margin: 8px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.sop-level-eg { margin: 4px 0 0; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sop-level-eg:empty { display: none; }
.sop-view { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; }
.sop-view-row { display: flex; align-items: baseline; gap: 6px 8px; flex-wrap: wrap; }
.sop-view-row b { font-weight: 600; }
.sop-view-change { margin-left: auto; }
.sop-view-edit { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.sop-view-part { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sop-view-edit .sop-in { height: 34px; min-width: 180px; font-size: 13px; }
.sop-view-edit .sop-filled { margin-top: 0; height: 32px; padding: 0 16px; font-size: 13px; }
.sop-view-rung { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.sop-view-rung input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.sop-view-follow { color: var(--text-2); }
.sop-level-ro { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--hover); }
.sop-level-ro b { font-size: 13px; font-weight: 600; }
.sop-level-ro .sop-linkbtn { margin-left: auto; }

.sop-check-strip { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 14px; border-radius: 10px; border: 1px dashed var(--border); font-size: 12.5px; }
.sop-check-strip > .sop-micro { margin-right: 4px; }
.sop-check-sep { color: var(--muted); }
.sop-check-item { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; font-weight: 500; }
.sop-check-item:hover span:last-child { text-decoration: underline; }
.sop-check-item.is-done { color: var(--text-2); }
.sop-check-box { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--muted); }
.sop-check-item.is-done .sop-check-box { border-color: var(--success); background: var(--success); color: #fff; }

.sop-pstep-own.is-empty { gap: 6px; }
.sop-av-empty { border-style: dashed; color: var(--muted); }
.sop-own-sep { color: var(--muted); }
.sop-pstep-own.is-empty .sop-linkbtn { font-size: 12.5px; }
.sop-wiz-link { flex: none; }
.sop-enable .sop-wiz-link { margin-left: 12px; }
.sop-off-acts { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.sop-off-acts .sop-filled { margin-top: 0; display: inline-flex; align-items: center; text-decoration: none; }
.sop-off-acts .sop-outline { height: 40px; padding: 0 18px; border-radius: 20px; }

/* The wizard: a dialog over the screen (54% scrim, as the app's others). */
.sop-wiz { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px 16px; }
.sop-wiz-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .54); }
.sop-wiz-box { position: relative; width: 760px; max-width: 100%; max-height: calc(100dvh / var(--zoom, 1) - 48px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 11px 15px -7px rgba(0, 0, 0, .2), 0 24px 38px 3px rgba(0, 0, 0, .14); }
.sop-wiz-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 6px; }
.sop-wiz-hcol { flex: 1; min-width: 0; }
.sop-wiz-hcol b { display: block; font-size: 17px; font-weight: 700; }
.sop-wiz-hcol p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.sop-wiz-steps { list-style: none; display: flex; gap: 6px 18px; flex-wrap: wrap; margin: 6px 0 0; padding: 8px 20px 12px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.sop-wiz-steps li { display: inline-flex; align-items: center; gap: 6px; }
.sop-wiz-steps li.is-on { color: var(--text); font-weight: 600; }
.sop-wiz-n { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border); font-size: 11px; font-weight: 700; }
.sop-wiz-steps li.is-on .sop-wiz-n { border-color: var(--primary); color: var(--primary); }
.sop-wiz-steps li.is-done .sop-wiz-n { border-color: var(--success); background: var(--success); color: #fff; }
.sop-wiz-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; }
.sop-wiz-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.sop-wiz-foot .sop-filled { margin-top: 0; height: 34px; padding: 0 18px; font-size: 13px; }
.sop-wiz-foot .sop-outline { height: 34px; }
.sop-wiz-tpls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .sop-wiz-tpls { grid-template-columns: minmax(0, 1fr); } }
.sop-wiz-tpl { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); cursor: pointer; transition: border-color 100ms linear, background-color 100ms linear; }
.sop-wiz-tpl:hover { background: var(--hover); }
.sop-wiz-tpl:has(input:checked) { border: 2px solid var(--primary); padding: 13px; background: color-mix(in srgb, var(--primary) 5%, var(--card)); }
.sop-wiz-tpl:has(input:focus-visible) { outline: 2px solid color-mix(in srgb, var(--primary) 50%, transparent); outline-offset: 2px; }
.sop-wiz-tpl input { position: absolute; opacity: 0; pointer-events: none; }
.sop-wiz-tpl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sop-wiz-tpl-head b { font-size: 14px; }
.sop-wiz-tpl-blurb { font-size: 12px; line-height: 1.4; color: var(--muted); }
.sop-wiz-mini { margin: 4px 0 0; padding: 0 0 0 18px; font-size: 12px; line-height: 1.7; color: var(--text-2); }
.sop-wiz-mini li.is-auto { color: var(--muted); }
.sop-wiz-mini li.is-human { color: var(--text); font-weight: 500; }
.sop-wiz-sec + .sop-wiz-sec { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.sop-wiz-note { margin: 4px 0 8px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.sop-wiz-level { height: 36px; min-width: 260px; font-size: 13px; }
.sop-wiz-owners { display: flex; flex-direction: column; gap: 8px; }
.sop-wiz-owner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); align-items: center; gap: 6px 12px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); }
.sop-wiz-owner .sop-in { height: 34px; width: 100%; font-size: 13px; }
.sop-wiz-owner-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sop-wiz-owner-l b { font-size: 13px; font-weight: 600; }
.sop-wiz-split { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.sop-wiz-cats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; padding: 4px 0 2px 24px; }
@media (max-width: 720px) { .sop-wiz-cats, .sop-wiz-owner { grid-template-columns: minmax(0, 1fr); } }
.sop-wiz-cat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 170px); align-items: center; gap: 8px; font-size: 12.5px; }
.sop-wiz-cat .sop-in { height: 30px; }
.sop-wiz-seg label { display: inline-flex; padding: 6px 12px; border-radius: 6px; border: 1px solid transparent; font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: pointer; }
.sop-wiz-seg label.is-on, .sop-wiz-seg label:has(input:checked) { background: var(--surface); border-color: var(--border); color: var(--text); font-weight: 600; }
.sop-wiz-seg input { position: absolute; opacity: 0; pointer-events: none; }
.sop-wiz-seg { margin-top: 6px; }
.sop-wiz-days { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin-top: 6px; }
@media (max-width: 720px) { .sop-wiz-days { grid-template-columns: minmax(0, 1fr); } }
.sop-wiz-day { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.sop-wiz-day-l { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.sop-wiz-day-l b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sop-wiz-day .sop-in { width: 64px; text-align: right; }
.sop-wiz-summary { margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--primary) 6%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); }
.sop-wiz-summary p { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--text); }
.sop-wiz-summary .sop-help { color: var(--muted); font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .sop-level.is-focus { animation: none; } }
/* Historial: a closed plan against what sold (sop_fva.py). */
.sop-fva-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 18px; margin: 4px 0 8px; }
.sop-fva-line > span { display: inline-flex; flex-direction: column; gap: 2px; }
.sop-fva-line b { font-size: 16px; }
.sop-fva-line .sop-fva-per { font-size: 11.5px; color: var(--muted); align-self: flex-end; }
.sop-fva-take { margin: 6px 0 10px; font-size: 13px; color: var(--text); }
.sop-fva-table { display: flex; flex-direction: column; font-size: 12.5px; }
.sop-fva-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) 0.8fr 1fr 1fr; gap: 10px; padding: 6px 4px; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); align-items: baseline; }
.sop-fva-row > span:nth-child(n+3) { text-align: right; }
.sop-fva-row.is-head { border-top: 0; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .02em; }
.sop-fva-row.is-base { color: var(--text-2); }
.sop-fva-none { grid-column: span 1; color: var(--muted); font-style: italic; text-align: right; white-space: nowrap; }
@media (max-width: 640px) { .sop-fva-row { grid-template-columns: minmax(0, 1.4fr) 0.8fr 1fr 1fr; } .sop-fva-row > span:nth-child(2) { display: none; } }
/* "Nombre: Ciclo S&OP ✎" in the "Correr el ciclo" card (_setup.html). */
.sop-setup-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; min-height: 32px; font-size: 13px; }
.sop-setup-nm { color: var(--text); font-weight: 500; }
.sop-pen { display: inline-flex; padding: 3px; border-radius: 6px; color: var(--muted); }
.sop-pen:hover { background: var(--hover); color: var(--text); }
.sop-setup-nform { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sop-setup-nform .sop-in { width: 240px; max-width: 100%; }
.sop-setup-nform .sop-filled { margin-top: 0; height: 32px; padding: 0 16px; font-size: 13px; }

/* ── Baseline de comparación (sop_baseline.py): the default, the slices,
   one add row. One column on a phone, 44px targets. ──────────────────── */
.sop-bl .sop-efs { border: 0; margin: 0; padding: 0; min-width: 0; }
.sop-bl > .sop-efs > .sop-field { max-width: 420px; }
.sop-bl-list { list-style: none; margin: 12px 0 0; padding: 0; }
.sop-bl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; align-items: center; gap: 4px 12px; min-height: 44px; border-top: 1px solid var(--border); }
.sop-bl-what { display: flex; flex-direction: column; min-width: 0; }
.sop-bl-what small { font-size: 11px; color: var(--muted); }
.sop-bl-what b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sop-bl-what em { font-size: 11px; font-style: normal; color: var(--warning); }
.sop-bl-row.is-gone b { color: var(--text-2); }
.sop-bl-method { font-size: 12.5px; color: var(--text-2); text-align: right; }
.sop-bl-x { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 22px; color: var(--muted); }
.sop-bl-x:hover { background: var(--hover); color: var(--text); }
.sop-bl-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: end; gap: 12px 10px; margin-top: 14px; }
.sop-bl-add .sop-field { min-width: 0; }
.sop-bl-addbtn { height: 38px; justify-self: start; }
@media (max-width: 600px) {
  .sop-bl-add { grid-template-columns: minmax(0, 1fr); }
  .sop-bl-addbtn { height: 44px; justify-self: stretch; justify-content: center; }
  .sop-bl-row { grid-template-columns: minmax(0, 1fr) 44px; }
  .sop-bl-method { grid-column: 1; grid-row: 2; text-align: left; padding-bottom: 8px; }
  .sop-bl-x { grid-column: 2; grid-row: 1 / span 2; }
}
