/* Layout: "sala de control" — barra superior azul petróleo con navegación, proyectos como carriles de trabajo anchos,
   cada espacio abre con una banda petróleo de accesos y pestañas horizontales. En celular, navegación inferior. */
:root {
  --petrol: #101E2B;
  --petrol-2: #182B3C;
  --petrol-line: #26394B;
  --on-petrol: #F5F3EF;
  --on-petrol-muted: #9DAFBE;
  --accent: #FF7048;
  --on-accent: #101E2B;
  --bg: #F5F3EF;
  --surface: #FFFFFF;
  --surface-2: #ECE8E0;
  --line: #DCD6CB;
  --fg: #101E2B;
  --muted: #5D6772;
  --accent-ink: #B4421E;
  --focus: #FF7048;
  --ok: #1E7A54;   --ok-bg: #E0EFE6;
  --warn: #9C5710; --warn-bg: #F7E8D3;
  --bad: #B3261E;  --bad-bg: #F7DFDB;
  --info: #255D8A; --info-bg: #DFEAF3;
  --off: #6A717A;  --off-bg: #E8E5DF;
  --shadow: 0 1px 2px rgba(16, 30, 43, .06), 0 8px 24px rgba(16, 30, 43, .06);
  --f-display: "Unbounded", "Arial Black", Arial, sans-serif;
  --f-body: "Instrument Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --maxw: 1200px;
  --gut: max(16px, env(safe-area-inset-left, 0px));
  --gut-r: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --petrol-line: #2A4155;
    --bg: #0B1620; --surface: #122231; --surface-2: #192D3F; --line: #243A4E;
    --fg: #F5F3EF; --muted: #9AAAB8; --accent-ink: #FF8C69;
    --ok: #5BD3A1; --ok-bg: #12352A; --warn: #F2B266; --warn-bg: #3A2A14;
    --bad: #FF8F84; --bad-bg: #3E1C1A; --info: #8FC0EC; --info-bg: #17324A;
    --off: #A6AFB9; --off-bg: #1F3042;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --petrol-line: #2A4155;
  --bg: #0B1620; --surface: #122231; --surface-2: #192D3F; --line: #243A4E;
  --fg: #F5F3EF; --muted: #9AAAB8; --accent-ink: #FF8C69;
  --ok: #5BD3A1; --ok-bg: #12352A; --warn: #F2B266; --warn-bg: #3A2A14;
  --bad: #FF8F84; --bad-bg: #3E1C1A; --info: #8FC0EC; --info-bg: #17324A;
  --off: #A6AFB9; --off-bg: #1F3042;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.5; margin: 0; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--petrol); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.5rem, 3.2vw, 2.2rem); letter-spacing: -.02em; line-height: 1.1; }
h2 { font-family: var(--f-display); font-weight: 500; font-size: 1.02rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; }
.mono { font-family: var(--f-mono); font-size: .84em; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pend { color: var(--warn); font-style: italic; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-left: var(--gut); padding-right: var(--gut-r); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; min-height: 40px; }
.btn:hover { border-color: var(--fg); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.dark { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--fg); background: var(--surface-2); }
.btn.sm { padding: 5px 12px; min-height: 34px; font-size: .84rem; gap: 6px; }
.btn.icon { padding: 0; width: 36px; min-height: 36px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.linkbtn { border: 0; background: none; padding: 0; cursor: pointer; color: var(--accent-ink); font-weight: 600; text-align: left; }
.linkbtn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Chips de estado */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.info { color: var(--info); background: var(--info-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.bad { color: var(--bad); background: var(--bad-bg); }
.pill.off { color: var(--off); background: var(--off-bg); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .74rem; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag.example { outline: 1px dashed var(--muted); background: transparent; }

/* Patente: identificador del proyecto */
.plate { display: inline-grid; place-items: center; font-family: var(--f-mono); font-weight: 700; letter-spacing: .12em; font-size: .78rem; padding: 4px 8px 3px; border-radius: 5px; border: 1.5px solid currentColor; line-height: 1; white-space: nowrap; }
.plate::before { content: "WEPS"; font-size: .5rem; letter-spacing: .2em; opacity: .65; margin-bottom: 2px; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--bg); }
.login-side { background: var(--petrol); color: var(--on-petrol); padding: 48px max(32px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.login-side h1 { font-size: clamp(2rem, 5vw, 3.4rem); max-width: 12ch; }
.login-side h1 em { font-style: normal; color: var(--accent); }
.login-side p { color: var(--on-petrol-muted); max-width: 42ch; }
.lanes-deco { display: grid; gap: 10px; }
.lanes-deco span { height: 10px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--accent) 0 28px, transparent 28px 40px); opacity: .9; }
.lanes-deco span:nth-child(2) { opacity: .45; width: 72%; }
.lanes-deco span:nth-child(3) { opacity: .2; width: 46%; }
.login-main { display: grid; place-items: center; padding-block: 40px; padding-left: var(--gut); padding-right: var(--gut-r); }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 18px; }
.login-note { background: var(--warn-bg); border-radius: 10px; padding: 12px 14px; font-size: .88rem; }

/* Barra superior */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--petrol); color: var(--on-petrol); border-bottom: 1px solid var(--petrol-line); }
.top-in { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }
.mark b { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
.mark i { width: 12px; height: 22px; background: var(--accent); border-radius: 2px; transform: skewX(-14deg); display: block; }
.mark small { font-family: var(--f-mono); font-size: .66rem; color: var(--on-petrol-muted); letter-spacing: .08em; text-transform: uppercase; }
.topnav { display: flex; gap: 2px; }
.topnav button { border: 0; background: transparent; color: var(--on-petrol-muted); padding: 8px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; display: inline-flex; gap: 8px; align-items: center; position: relative; }
.topnav button:hover { color: var(--on-petrol); background: var(--petrol-2); }
.topnav button.active { color: var(--on-petrol); }
.topnav button.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -11px; height: 3px; background: var(--accent); border-radius: 3px 3px 0 0; }
.topnav .badge { font-family: var(--f-mono); font-size: .7rem; background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 0 6px; font-weight: 700; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.searchbtn { display: inline-flex; align-items: center; gap: 10px; background: var(--petrol-2); border: 1px solid var(--petrol-line); color: var(--on-petrol-muted); border-radius: 999px; padding: 6px 8px 6px 14px; cursor: pointer; min-height: 38px; }
.searchbtn kbd { font-family: var(--f-mono); font-size: .7rem; border: 1px solid var(--petrol-line); border-radius: 5px; padding: 1px 6px; }
.top .btn.ghost { color: var(--on-petrol-muted); }
.top .btn.ghost:hover { color: var(--on-petrol); background: var(--petrol-2); }
.ribbon { background: var(--warn-bg); font-size: .82rem; }
.ribbon .wrap { padding-block: 7px; display: flex; gap: 8px; align-items: baseline; }
.ribbon strong { color: var(--warn); white-space: nowrap; }

.bottomnav { display: none; }
main { padding-bottom: 72px; }

/* Bandas petróleo (inicio y espacio de proyecto) */
.band { background: var(--petrol); color: var(--on-petrol); border-bottom: 1px solid var(--petrol-line); }
.band .wrap { padding-block: 36px 30px; display: grid; gap: 22px; }
.band .eyebrow { color: var(--on-petrol-muted); }
.band p.lead { color: var(--on-petrol-muted); max-width: 60ch; }
.band .btn { background: transparent; color: var(--on-petrol); border-color: var(--petrol-line); }
.band .btn:hover { border-color: var(--on-petrol); }
.band .btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.band-row { display: flex; gap: 16px 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.overall { display: grid; gap: 8px; min-width: min(100%, 300px); }
.overall .bar { height: 8px; border-radius: 999px; background: var(--petrol-2); overflow: hidden; }
.overall .bar span { display: block; height: 100%; background: var(--accent); }
.overall .lbl { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: .76rem; color: var(--on-petrol-muted); gap: 12px; }

.page { padding-block: 28px; display: grid; gap: 32px; }
.sec { display: grid; gap: 14px; }
.sec-head { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }

/* Carriles de proyecto (inicio) */
.lanes { display: grid; gap: 12px; }
.lane { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; display: grid; grid-template-columns: minmax(200px, 1.1fr) minmax(220px, 1.2fr) auto; gap: 18px 28px; align-items: center; box-shadow: var(--shadow); }
.lane-id { display: flex; gap: 14px; align-items: center; min-width: 0; }
.lane-id .plate { color: var(--fg); }
.lane-id .t { display: grid; gap: 3px; min-width: 0; }
.lane-id h3 { font-family: var(--f-display); font-weight: 500; font-size: 1.12rem; overflow-wrap: anywhere; }
.lane-id .url { font-family: var(--f-mono); font-size: .76rem; color: var(--muted); overflow-wrap: anywhere; }
.gauge { display: grid; gap: 8px; min-width: 0; }
.segs { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.segs i { height: 10px; border-radius: 2px; background: var(--surface-2); display: block; }
.segs i.done { background: var(--accent); }
.segs i.na { background: repeating-linear-gradient(135deg, var(--line) 0 3px, transparent 3px 6px); }
.gauge .lbl { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; font-size: .84rem; }
.gauge .lbl b { font-family: var(--f-mono); font-weight: 600; }
.gauge .next { color: var(--muted); font-size: .84rem; }
.gauge .next strong { color: var(--fg); font-weight: 600; }
.lane-go { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.qlinks { display: flex; gap: 4px; }
.qlink { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--fg); text-decoration: none; cursor: pointer; padding: 0; }
.qlink:hover { border-color: var(--fg); }
.qlink.missing { border-style: dashed; color: var(--muted); background: transparent; }
.lane-add { border: 1.5px dashed var(--line); border-radius: 16px; background: transparent; padding: 16px; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; }
.lane-add:hover { color: var(--fg); border-color: var(--fg); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: grid; gap: 12px; min-width: 0; align-content: start; }
.empty { color: var(--muted); font-size: .9rem; padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }

/* Lista "qué falta" */
.todo { display: grid; }
.todo .r { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.todo .r:first-child { border-top: 0; }
.todo .r .t { display: grid; gap: 2px; min-width: 0; }
.todo .r .t span { font-size: .84rem; color: var(--muted); }
.todo .plate { color: var(--accent-ink); font-size: .7rem; }

/* Línea de tiempo de actividad */
.timeline { display: grid; position: relative; }
.timeline .ev { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 12px; padding: 8px 0; position: relative; }
.timeline .ev::before { content: ""; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.timeline .ev:first-child::before { top: 14px; }
.timeline .ev:last-child::before { bottom: calc(100% - 14px); }
.timeline .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); position: relative; z-index: 1; margin-top: 3px; }
.timeline .dot.k-step { border-color: var(--accent); background: var(--accent); }
.timeline .dot.k-version { border-color: var(--info); }
.timeline .dot.k-maint { border-color: var(--warn); }
.timeline .ev .t { display: grid; gap: 1px; min-width: 0; font-size: .9rem; overflow-wrap: anywhere; }
.timeline .ev .t span { font-size: .8rem; color: var(--muted); }
.timeline .when { font-family: var(--f-mono); font-size: .74rem; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.day { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 16px 0 4px 28px; }
.day:first-child { padding-top: 0; }

/* Espacio de proyecto */
.ws-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ws-head .plate { color: var(--accent); font-size: .9rem; }
.ws-head .t { display: grid; gap: 6px; min-width: 0; flex: 1; }
.ws-head .sub { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .86rem; color: var(--on-petrol-muted); }
.ws-head .sub .mono { color: var(--on-petrol-muted); }
.back { border: 0; background: none; color: var(--on-petrol-muted); cursor: pointer; padding: 0; font-size: .85rem; display: inline-flex; gap: 6px; align-items: center; }
.back:hover { color: var(--on-petrol); }
.launch { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.lb { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: var(--on-petrol); background: var(--petrol-2); border: 1px solid var(--petrol-line); cursor: pointer; text-align: left; min-height: 64px; }
.lb .ic { grid-row: span 2; width: 22px; height: 22px; color: var(--accent); }
.lb strong { font-size: .92rem; font-weight: 600; }
.lb span { font-size: .76rem; color: var(--on-petrol-muted); }
.lb:hover { border-color: var(--on-petrol-muted); }
.lb.missing { background: transparent; border-style: dashed; }
.lb.missing .ic { color: var(--on-petrol-muted); }
.lb.missing span { color: var(--accent); }

.wstabs { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: calc(env(safe-area-inset-top, 0px) + 61px); z-index: 10; }
.wstabs .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.wstabs .wrap::-webkit-scrollbar { display: none; }
.wstab { border: 0; background: none; padding: 14px 12px; cursor: pointer; color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; display: inline-flex; gap: 7px; align-items: center; }
.wstab:hover { color: var(--fg); }
.wstab.active { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.wstab .n { font-family: var(--f-mono); font-size: .7rem; color: var(--muted); }
.wstab.hl .n { color: var(--accent-ink); font-weight: 700; }

.intro { display: grid; gap: 4px; }
.intro p { color: var(--muted); max-width: 64ch; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input { max-width: 300px; }
.callout { display: flex; gap: 12px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; font-size: .9rem; background: var(--surface-2); }
.callout.warn { background: var(--warn-bg); }
.callout .ic { margin-top: 2px; }

/* Recorrido de organización */
.org { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; align-items: start; }
.stepper { display: grid; gap: 2px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 124px); }
.st { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.st:hover { background: var(--surface-2); }
.st.active { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
.st .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-mono); font-size: .76rem; font-weight: 700; border: 1.5px solid var(--line); color: var(--muted); }
.st.s-done .n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.st.s-na .n { border-style: dashed; }
.st .lab { font-size: .9rem; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.st .sl { font-size: .7rem; color: var(--muted); font-family: var(--f-mono); white-space: nowrap; }
.stepcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; display: grid; min-width: 0; }
.stepcard > * { padding: 20px 22px; }
.stepcard > * + * { border-top: 1px solid var(--line); }
.step-top { display: grid; gap: 10px; }
.step-top .eyebrow { color: var(--accent-ink); }
.step-top h2 { font-size: 1.3rem; }
.how { display: grid; gap: 10px; }
.how ol { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
.how li::marker { font-family: var(--f-mono); color: var(--accent-ink); font-weight: 700; }
.how .tip { font-size: .88rem; color: var(--muted); border-left: 3px solid var(--accent); padding-left: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; background: var(--surface-2); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .86rem; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.seg button.on.v-done { background: var(--accent); color: var(--on-accent); }
.datahint { font-size: .84rem; display: flex; gap: 8px; align-items: center; }
.datahint.yes { color: var(--ok); }
.datahint.no { color: var(--muted); }
.step-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.checks { display: grid; gap: 0; }
.checks .r { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.checks .r:first-child { border-top: 0; }
.mk { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.mk.y { background: var(--ok-bg); color: var(--ok); }
.mk.n { background: var(--warn-bg); color: var(--warn); }
.mk.na { background: var(--off-bg); color: var(--off); }
.mk .ic { width: 14px; height: 14px; }
.verdict { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 12px; }
.verdict.ok { background: var(--ok-bg); }
.verdict.no { background: var(--warn-bg); }
.verdict strong { font-family: var(--f-display); font-weight: 500; font-size: 1.05rem; }

/* Matriz global */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.matrix { border-collapse: collapse; width: 100%; min-width: 760px; }
.matrix th, .matrix td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.matrix tr:last-child td { border-bottom: 0; }
.matrix th { font-size: .74rem; font-weight: 600; color: var(--muted); vertical-align: bottom; }
.matrix th:first-child, .matrix td:first-child { text-align: left; padding-left: 16px; }
.matrix td:first-child { font-weight: 600; white-space: nowrap; }
.cell { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: transparent; cursor: pointer; display: inline-grid; place-items: center; padding: 0; }
.cell.done { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cell.na { background: repeating-linear-gradient(135deg, var(--line) 0 3px, transparent 3px 6px); }
.cell.pend { border-style: dashed; border-color: var(--warn); }
.cell .ic { width: 14px; height: 14px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend .cell { width: 18px; height: 18px; cursor: default; border-radius: 5px; }

/* Ciclo de modificación */
.cycle { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; counter-reset: c; }
.cy { counter-increment: c; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 8px; align-content: space-between; min-height: 150px; }
.cy::before { content: "0" counter(c); font-family: var(--f-mono); font-size: .74rem; color: var(--accent-ink); font-weight: 700; }
.cy strong { font-size: .95rem; }
.cy p { font-size: .82rem; color: var(--muted); }
.cy .btn { justify-self: start; }

/* Registros */
.items { display: grid; gap: 10px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; min-width: 0; }
.item-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.item-head .t { display: grid; gap: 5px; min-width: 0; }
.item-head h3 { overflow-wrap: anywhere; }
.item-head .acts { display: flex; gap: 2px; flex: none; }
.item .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--muted); }
.item.done h3 { text-decoration: line-through; color: var(--muted); }
.item.hit { text-align: left; cursor: pointer; gap: 2px; }
.item.hit:hover { border-color: var(--fg); }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 14px; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.kv a { color: var(--accent-ink); }
.prompt-box { background: var(--surface-2); border-radius: 10px; }
.prompt-box pre { margin: 0; padding: 12px 14px; font-family: var(--f-mono); font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9.5em; overflow: hidden; }
.prompt-box.open pre { max-height: none; }
.prompt-box .more { display: block; width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 6px; cursor: pointer; color: var(--muted); font-size: .8rem; }
.status-select { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 600; cursor: pointer; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: .86rem; font-weight: 500; }
.chip.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.table { border-collapse: collapse; width: 100%; min-width: 680px; font-size: .9rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table th { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.table td.r, .table th.r { text-align: right; font-variant-numeric: tabular-nums; }

.danger-zone { border: 1px solid var(--bad-bg); border-radius: 14px; padding: 16px 18px; display: flex; gap: 14px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.dropzone { border: 1.5px dashed var(--line); border-radius: 14px; padding: 20px; display: grid; place-items: center; gap: 6px; text-align: center; color: var(--muted); }
.integ { display: grid; }
.integ-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.integ-row:first-child { border-top: 0; }

/* Formularios */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: .85rem; font-weight: 600; }
.field .req { color: var(--bad); }
.field .help { font-size: .8rem; color: var(--muted); }
input[type="text"], input[type="url"], input[type="email"], input[type="date"], input[type="search"], input[type="password"], input[type="number"], select, textarea {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0;
}
textarea { resize: vertical; }
textarea.mono { font-family: var(--f-mono); font-size: .84rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[disabled] { background: var(--surface-2); color: var(--muted); }

/* Modal y buscador */
.overlay { position: fixed; inset: 0; background: rgba(8, 15, 22, .55); z-index: 50; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) var(--gut-r) max(16px, env(safe-area-inset-bottom, 0px)) var(--gut); }
.modal { background: var(--bg); border-radius: 18px; width: 100%; max-width: 640px; max-height: 100%; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); overflow: hidden; }
.modal.sm { max-width: 440px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; gap: 12px; background: var(--petrol); color: var(--on-petrol); }
.modal-head h2 { font-size: 1rem; }
.modal-head .btn.ghost { color: var(--on-petrol-muted); }
.modal-body { padding: 20px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.palette { align-items: start; }
.palette .modal { margin-top: 8vh; }
.pal-in { display: flex; gap: 10px; align-items: center; padding: 14px 18px; background: var(--petrol); color: var(--on-petrol); }
.pal-in input { background: transparent; border: 0; color: var(--on-petrol); font-size: 1.05rem; padding: 6px 0; }
.pal-in input:focus { outline: 0; }
.pal-res { max-height: 60vh; overflow-y: auto; padding: 10px; display: grid; gap: 4px; }
.pal-res .grp { padding: 10px 8px 4px; }
.pal-res button { border: 0; background: transparent; text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer; display: grid; gap: 1px; }
.pal-res button:hover, .pal-res button:focus-visible { background: var(--surface-2); }
.pal-res button span { font-size: .82rem; color: var(--muted); }

.toast { position: fixed; bottom: max(84px, calc(env(safe-area-inset-bottom, 0px) + 84px)); left: 50%; transform: translateX(-50%); background: var(--petrol); color: var(--on-petrol); padding: 10px 18px; border-radius: 999px; z-index: 60; font-size: .9rem; max-width: calc(100% - 32px); box-shadow: var(--shadow); border: 1px solid var(--petrol-line); }

@media (max-width: 1000px) {
  .lane { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lane-go { grid-column: 1 / -1; justify-content: space-between; }
  .org { grid-template-columns: minmax(0, 1fr); }
  .stepper { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: thin; }
  .st { grid-template-columns: 28px auto; flex: none; }
  .st .sl { display: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .topnav, .searchbtn .lbl, .searchbtn kbd, .top .newp .lbl { display: none; }
  .searchbtn { padding: 6px 10px; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--petrol); border-top: 1px solid var(--petrol-line); padding: 6px max(6px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); }
  .bottomnav button { border: 0; background: transparent; color: var(--on-petrol-muted); display: grid; justify-items: center; gap: 3px; font-size: .68rem; padding: 6px 2px; cursor: pointer; border-radius: 10px; position: relative; }
  .bottomnav button.active { color: var(--accent); }
  .bottomnav .badge { position: absolute; top: 2px; right: calc(50% - 20px); font-family: var(--f-mono); font-size: .6rem; background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 0 5px; font-weight: 700; }
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .wstabs { top: calc(env(safe-area-inset-top, 0px) + 61px); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-side { padding: 32px var(--gut-r) 28px var(--gut); }
  .band .wrap { padding-block: 26px 22px; }
  .lane { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .lane-go { justify-content: space-between; }
  .launch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .stepcard > * { padding: 16px; }
  .integ-row { grid-template-columns: auto minmax(0, 1fr); }
  .integ-row .pill { grid-column: 2; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ===================== Ajustes v4: imágenes protagonistas y menos texto ===================== */
.fine { font-size: .82rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fine .ic { width: 14px; height: 14px; }
.pre { white-space: pre-wrap; }
.ribbon { background: transparent; border-bottom: 1px solid var(--line); }
.ribbon .wrap { padding-block: 6px; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .04em; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.ribbon .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.mark.big b { font-size: clamp(2.6rem, 7vw, 4.4rem); }
.mark.big i { width: 20px; height: 40px; }
.login-card h2 { font-size: 1.5rem; }
.login-note { font-family: var(--f-mono); font-size: .74rem; padding: 8px 12px; }
.page { padding-block: 32px 40px; gap: 28px; }
.phead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.btn.missing { border-style: dashed; color: var(--muted); }

/* Arte del proyecto: imagen o diseño provisional */
.art { position: absolute; inset: 0; overflow: hidden; background: var(--petrol); }
.art img { width: 100%; height: 100%; display: block; }
.art.fit-cover img { object-fit: cover; }
.art.fit-contain { background: var(--petrol-2); }
.art.fit-contain img { object-fit: contain; padding: 10%; }
.ph-code { position: absolute; left: 7%; top: 8%; font-family: var(--f-display); font-weight: 700; font-size: clamp(3.2rem, 9vw, 6rem); line-height: .9; letter-spacing: -.02em; color: transparent; -webkit-text-stroke: 1.5px rgba(245, 243, 239, .38); }
.ph-0 { background: repeating-linear-gradient(-45deg, rgba(255, 112, 72, .95) 0 12px, transparent 12px 30px) right -10% bottom -10% / 62% 70% no-repeat, linear-gradient(160deg, #15283A, #101E2B 60%); }
.ph-1 { background: repeating-radial-gradient(circle at 92% 18%, rgba(255, 112, 72, .9) 0 2px, transparent 2px 22px), linear-gradient(200deg, #172C3F, #101E2B 55%); }
.ph-2 { background: radial-gradient(rgba(255, 112, 72, .85) 1.6px, transparent 2px) 0 0 / 18px 18px, linear-gradient(180deg, #101E2B 30%, rgba(16, 30, 43, .2)), #101E2B; background-blend-mode: normal; }
.ph-2 { background: linear-gradient(110deg, #101E2B 45%, transparent 75%), radial-gradient(rgba(255, 112, 72, .9) 1.6px, transparent 2px) 0 0 / 18px 18px, #101E2B; }
.ph-3 { background: repeating-linear-gradient(90deg, rgba(255, 112, 72, .9) 0 34px, transparent 34px 52px) left 0 bottom 22% / 100% 10px no-repeat, repeating-linear-gradient(90deg, rgba(255, 112, 72, .45) 0 34px, transparent 34px 52px) left 26px bottom 34% / 100% 6px no-repeat, linear-gradient(170deg, #182D40, #101E2B); }
.shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 18, 26, .35) 0%, transparent 30%, transparent 45%, rgba(10, 18, 26, .88) 100%); pointer-events: none; }
.thumb { position: relative; width: 40px; height: 40px; border-radius: 10px; overflow: hidden; flex: none; display: block; }
.thumb .ph-code { font-size: .95rem; left: 6px; top: 6px; -webkit-text-stroke: .8px rgba(245, 243, 239, .6); }
.thumb .art.fit-contain img { padding: 4px; }

/* Tarjetas de proyecto */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.pcard { background: var(--surface); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .2s ease, box-shadow .2s ease; }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(16, 30, 43, .08), 0 18px 40px rgba(16, 30, 43, .14); }
.pcard-media { position: relative; aspect-ratio: 4 / 3.4; max-width: 100%; color: #F5F3EF; }
.stretch { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; z-index: 1; }
.pcard-top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; gap: 6px; align-items: center; z-index: 2; pointer-events: none; }
.pcard-top > * { pointer-events: auto; }
.pill.glass { background: rgba(16, 30, 43, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.pill.glass.ok { color: #7EE2B6; } .pill.glass.warn { color: #FFC37E; } .pill.glass.info { color: #A9CFF2; } .pill.glass.off { color: #C9D2DA; } .pill.glass.bad { color: #FFA59C; }
.imgbtn { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(16, 30, 43, .55); color: #F5F3EF; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: .85; }
.imgbtn:hover { background: var(--accent); color: var(--on-accent); opacity: 1; }
.pcard-title { position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 2; display: grid; gap: 4px; pointer-events: none; }
.pcard-title h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.4rem, 2.6vw, 1.8rem); letter-spacing: -.02em; line-height: 1.05; color: #F5F3EF; overflow-wrap: anywhere; }
.pcard-title .mono { color: rgba(245, 243, 239, .72); font-size: .76rem; overflow-wrap: anywhere; }
.pcard-body { padding: 16px 18px 18px; display: grid; gap: 14px; }
.org-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: .78rem; color: var(--muted); }
.org-line .segs i { height: 6px; }
.pcard-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.qlink { width: 36px; height: 36px; }

/* Listas compactas */
.todo .r { grid-template-columns: auto minmax(0, 1fr) auto; }
.todo .r .t strong { font-weight: 600; font-size: .92rem; }
.checks .r .t { display: grid; gap: 1px; min-width: 0; }
.checks .r .t span { font-size: .8rem; color: var(--muted); }
.mrow { border: 0; background: none; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--fg); }
.mrow:hover { color: var(--accent-ink); }
.mrow .thumb { width: 32px; height: 32px; border-radius: 8px; }
.filter { max-width: 180px; padding: 7px 12px !important; border-radius: 999px !important; }

/* Portada del proyecto */
.cover { position: relative; height: clamp(260px, 36vw, 400px); color: #F5F3EF; overflow: hidden; }
.cover .shade { background: linear-gradient(180deg, rgba(10, 18, 26, .55) 0%, transparent 28%, transparent 40%, rgba(10, 18, 26, .92) 100%); }
.cover-in { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding-block: 18px 24px; }
.cover-top { display: flex; justify-content: space-between; gap: 10px; }
.glassbtn { display: inline-flex; gap: 8px; align-items: center; border: 0; border-radius: 999px; padding: 8px 14px; background: rgba(16, 30, 43, .55); color: #F5F3EF; cursor: pointer; font-weight: 600; font-size: .86rem; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.glassbtn:hover { background: rgba(16, 30, 43, .8); }
.cover-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.cover-bottom .t { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.cover-bottom h1 { font-size: clamp(2rem, 6vw, 3.6rem); color: #F5F3EF; overflow-wrap: anywhere; }
.cover-bottom .mono { color: rgba(245, 243, 239, .75); font-size: .8rem; }
.cover-org { display: grid; grid-template-columns: 180px auto; gap: 10px; align-items: center; font-size: .8rem; color: rgba(245, 243, 239, .8); }
.cover-org .segs i { background: rgba(245, 243, 239, .2); }
.cover-org .segs i.done { background: var(--accent); }
.launchbar { background: var(--petrol); border-bottom: 1px solid var(--petrol-line); }
.launchbar .wrap { display: flex; gap: 8px; overflow-x: auto; padding-block: 12px; scrollbar-width: none; }
.launchbar .wrap::-webkit-scrollbar { display: none; }
.lp { display: inline-flex; gap: 8px; align-items: center; flex: none; padding: 9px 16px; border-radius: 999px; background: var(--petrol-2); border: 1px solid var(--petrol-line); color: var(--on-petrol); text-decoration: none; font-weight: 600; font-size: .88rem; cursor: pointer; }
.lp .ic { color: var(--accent); width: 17px; height: 17px; }
.lp:hover { border-color: var(--on-petrol-muted); }
.lp.missing { background: transparent; border-style: dashed; color: var(--on-petrol-muted); }
.lp.missing .ic { color: var(--on-petrol-muted); }
.lp.missing::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.wstabs { top: calc(env(safe-area-inset-top, 0px) + 61px); }

/* Organizar */
.step-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.step-title > div { display: grid; gap: 4px; }
.step-body { display: grid; gap: 14px; }
details.help { padding: 0 !important; }
details.help summary { list-style: none; cursor: pointer; display: flex; gap: 8px; align-items: center; padding: 14px 22px; font-weight: 600; font-size: .9rem; color: var(--accent-ink); }
details.help summary::-webkit-details-marker { display: none; }
details.help summary::after { content: "+"; margin-left: auto; font-family: var(--f-mono); font-size: 1.1rem; color: var(--muted); }
details.help[open] summary::after { content: "–"; }
details.help .help-in { padding: 0 22px 18px; display: grid; gap: 10px; }
details.help ol { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
details.help li::marker { font-family: var(--f-mono); color: var(--accent-ink); font-weight: 700; }
details.help .tip { font-size: .86rem; color: var(--muted); border-left: 3px solid var(--accent); padding-left: 12px; }
details.help.box { border-radius: 14px; }
.verdict { padding: 14px 16px; }
.verdict .ic { flex: none; }

/* Ciclo de trabajo compacto */
.cycle { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.cy { min-height: 0; padding: 14px; gap: 10px; align-content: start; }
.cy::before { content: none; }
.cy-n { font-family: var(--f-mono); font-size: .72rem; color: var(--accent-ink); font-weight: 700; }
.cy .btn { justify-self: stretch; }

/* Editor de imagen */
.imgedit { display: grid; gap: 14px; }
.imgprev { position: relative; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; max-width: 100%; }
.drop { display: grid; justify-items: center; gap: 4px; padding: 18px; border: 1.5px dashed var(--line); border-radius: 14px; cursor: pointer; text-align: center; color: var(--muted); font-size: .84rem; }
.drop strong { color: var(--fg); font-size: .95rem; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--surface); }
.drop.busy { opacity: .6; pointer-events: none; }
.imgopts { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 40px; }

@media (max-width: 1000px) {
  .cycle { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .page { padding-block: 22px 32px; }
  .pgrid { gap: 16px; }
  .pcard-media { aspect-ratio: 16 / 11; }
  .cover { height: 250px; }
  .cover-org { grid-template-columns: 140px auto; }
  .glassbtn span { display: none; }
  .glassbtn { padding: 9px; }
  .cycle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .imgbtn { opacity: 1; }
}
@media (hover: none) { .pcard:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) { .pcard { transition: none; } }

/* Modo nube */
.login-msg { color: var(--bad); font-size: .86rem; min-height: 1.2em; margin: 0; }
.login-msg:empty { display: none; }
#forgot { justify-self: center; font-size: .86rem; }
#sync::before { content: none; }
#sync[data-st="saving"] { color: var(--warn); }
#sync[data-st="error"] { color: var(--bad); font-weight: 600; }
body.cloud .ribbon .dot { background: var(--ok); }
