/* Portal New Self® — estilos del dummy aprobado (new-self-portal-iphone), copiados tal cual.
   Lo único añadido es el bloque «PORTAL REAL» del final: sin banda negra del dummy, + login, salir y panel. */
:root {
  --grafito: #2F2D2E;
  --tostado: #B7A38A;
  --arena-light: #F7F3EF;
  --arena-darker: #F1EDE9;
  --pastel-blue: #E8EEF2;
  --blue-dark: #657687;
  --blue-mid: #9FAFBE;
  --pastel-green: #DFE8B0;
  --green-dark: #526033;
  --pastel-tan: #EDE4D9;
  --border: #D8D0C8;
  --blue-text: var(--blue-dark);
  --tan-text: #77664F;
  --lima: var(--pastel-green);
  --white: #FFFFFF;
  --ink: var(--grafito);
  --ink-soft: rgba(47, 45, 46, .70);
  --plum: var(--grafito);
  --plum-2: var(--grafito);
  --rose: var(--blue-mid);
  --rose-dark: var(--blue-dark);
  --rose-soft: var(--pastel-blue);
  --sand: var(--arena-light);
  --paper: var(--arena-light);
  --line: rgba(101, 118, 135, .18);
  --line-dark: rgba(101, 118, 135, .32);
  --sage: var(--green-dark);
  --sage-soft: var(--pastel-green);
  --amber: var(--tan-text);
  --amber-soft: var(--pastel-tan);
  --blue: var(--blue-dark);
  --blue-soft: var(--pastel-blue);
  --danger: var(--grafito);
  --shadow: 0 18px 50px rgba(47, 45, 46, .12);
  --shadow-soft: 0 8px 24px rgba(47, 45, 46, .08);
  --radius: 20px;
  --radius-sm: 12px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { width: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  width: 100%;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; -webkit-appearance: none; appearance: none; touch-action: manipulation; }
input, textarea { -webkit-appearance: none; appearance: none; font-size: 16px; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(183, 163, 138, .55);
  outline-offset: 3px;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.08; }
h1 { font-size: clamp(2.1rem, 8vw, 4.25rem); letter-spacing: -.04em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.35rem); letter-spacing: -.025em; }
h3 { font-size: 1.28rem; }
small { color: var(--ink-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.demo-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--plum);
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 8px 30px rgba(47, 45, 46, .16);
}
.demo-bar-inner {
  max-width: 1280px;
  margin: auto;
  min-height: 62px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}
.demo-kicker { display: none; }
.demo-step { text-align: center; min-width: 0; }
.demo-step strong { display: block; font-size: .81rem; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-step span { color: rgba(255,255,255,.67); font-size: .72rem; }
.demo-controls { display: flex; gap: 5px; }
.demo-button {
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.23);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: var(--white);
  padding: 8px 12px;
  font-size: .8rem;
  font-weight: 700;
  transition: .2s ease;
}
.demo-button:hover { background: rgba(255,255,255,.15); }
.demo-button.icon { width: 42px; padding: 0; font-size: 1rem; }
.demo-button.secondary { display: none; }

#app { min-height: calc(100vh - 62px); }
.center-stage {
  min-height: calc(100vh - 62px);
  padding: 28px 16px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 15% 8%, rgba(232,238,242,.88), transparent 27rem),
    radial-gradient(circle at 92% 90%, rgba(223,232,176,.38), transparent 25rem),
    var(--paper);
}
.auth-card, .email-window, .welcome-card {
  width: min(100%, 690px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.email-top {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--arena-darker);
  border-bottom: 1px solid var(--line);
}
.window-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tostado); }
.email-body, .auth-body, .welcome-body { padding: clamp(28px, 7vw, 62px); }
.email-meta { color: var(--ink-soft); font-size: .88rem; margin-bottom: 34px; }
.brand-lockup { font-family: var(--serif); text-transform: uppercase; margin-bottom: 34px; }
.brand-lockup strong { display:block; letter-spacing:.18em; font-size:1.08rem; font-weight:400; }
.brand-lockup em, .portal-logo em { color: var(--blue-dark); font-style: normal; }
.brand-lockup span { display:block; margin-top:4px; color: var(--tostado); font: 700 .62rem/1.3 var(--sans); letter-spacing: .18em; }
.eyebrow { color: var(--tostado); text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 800; margin-bottom: 12px; }
.lead { color: var(--ink-soft); font-size: 1.08rem; max-width: 62ch; }

.btn {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 20px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 750;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grafito); color: var(--white); box-shadow: 0 8px 18px rgba(47,45,46,.18); }
.btn-primary:hover { background: var(--plum-2); }
.btn-rose { background: var(--rose-dark); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--ink); border-color: var(--line-dark); }
.btn-ghost { background: transparent; color: var(--plum); border-color: transparent; padding-inline: 10px; }
.btn-danger { background: var(--arena-darker); color: var(--danger); border-color: var(--tostado); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 24px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.form-group { margin: 18px 0; }
.form-group label { display: block; margin-bottom: 7px; font-size: .86rem; font-weight: 750; }
.input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line-dark);
  border-radius: 13px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--white);
}
.input-note { display: block; margin-top: 6px; font-size: .78rem; color: var(--ink-soft); }

.onboard-steps { display: flex; gap: 6px; margin: 18px 0 30px; }
.onboard-dot { height: 5px; flex: 1; border-radius: 9px; background: var(--arena-darker); }
.onboard-dot.active { background: var(--blue-mid); }
.onboard-icon { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--pastel-blue); color: var(--blue-dark); font-size: 1.35rem; margin-bottom: 25px; }

.portal {
  max-width: 1280px;
  margin: auto;
  min-height: calc(100vh - 62px);
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(47,45,46,.05);
}
.portal-header {
  position: sticky;
  top: 62px;
  z-index: 30;
  min-height: 72px;
  padding: 12px 16px;
  background: rgba(247,243,239,.96);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.portal-logo { font-family: var(--serif); font-size: 1.08rem; letter-spacing: .16em; }
.portal-logo span { display:block; margin-top:2px; color: var(--tostado); font:700 .58rem var(--sans); letter-spacing:.16em; }
.client-mini { display: flex; align-items: center; gap: 9px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--pastel-blue); color: var(--blue-dark); display: grid; place-items: center; font-size: .8rem; font-weight: 800; }
.client-mini div:last-child { display: none; }
.portal-grid { display: block; }
.sidebar { display: none; }
.content {
  padding: 24px 16px 112px;
  min-height: calc(100vh - 134px);
  background: linear-gradient(180deg, var(--arena-light) 0%, var(--arena-darker) 100%);
}
.content-inner { max-width: 860px; margin: auto; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: clamp(2rem, 8vw, 3.7rem); margin-bottom: 12px; }
.page-head .lead { margin-bottom: 0; }

.stage-pill, .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.stage-pill { color: var(--blue-dark); background: var(--pastel-blue); }
.status-pill.new { color: var(--blue-dark); background: var(--pastel-blue); }
.status-pill.done { color: var(--sage); background: var(--sage-soft); }
.status-pill.active { color: var(--blue); background: var(--blue-soft); }
.status-pill.pending { color: var(--amber); background: var(--amber-soft); }
.status-pill.locked { color: var(--ink-soft); background: var(--arena-darker); }

.priority-card {
  position: relative;
  padding: clamp(22px, 6vw, 38px);
  border-radius: var(--radius);
  color: var(--white);
  background: var(--plum);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  margin-bottom: 18px;
}
.priority-card::after {
  content: "";
  position: absolute;
  right: -35px;
  bottom: -65px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255,255,255,.035), 0 0 0 56px rgba(255,255,255,.025);
  pointer-events: none;
}
.priority-card .eyebrow { color: var(--tostado); }
.priority-card h2 { max-width: 640px; margin-bottom: 12px; }
.priority-card p { color: rgba(255,255,255,.74); max-width: 600px; }
.priority-card .btn { position: relative; z-index: 1; background: var(--white); color: var(--plum); margin-top: 7px; }

.card-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 18px 0; }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: 0 4px 14px rgba(47,45,46,.04);
}
.card.clickable { transition: .18s ease; }
.card.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); border-color: var(--tostado); }
button.card { width: 100%; color: inherit; text-align: left; font-weight: inherit; }
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.meta { color: var(--ink-soft); font-size: .84rem; }
.inline-link { color: var(--rose-dark); font-weight: 800; font-size: .87rem; }
.section { margin-top: 34px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2, .section-head h3 { margin: 0; }

.progress-panel { padding: 21px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--arena-darker); margin: 18px 0; }
.progress-line { height: 7px; border-radius: 99px; background: rgba(47,45,46,.12); overflow: hidden; margin: 12px 0 8px; }
.progress-line span { display: block; height: 100%; border-radius: inherit; background: var(--tostado); }
.stage-track { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 18px; }
.stage-step { padding-top: 12px; border-top: 3px solid var(--tostado); color: var(--ink-soft); font-size: .73rem; }
.stage-step strong { display: block; font-size: .77rem; color: inherit; }
.stage-step.complete { border-color: var(--sage); color: var(--sage); }
.stage-step.current { border-color: var(--blue-mid); color: var(--blue-dark); }

.mobile-nav {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 72px;
  padding: 6px max(6px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: repeat(7, minmax(74px, 1fr));
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(247,243,239,.97);
  border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 -10px 30px rgba(47,45,46,.08);
}
.nav-button {
  min-height: 56px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  gap: 0;
  padding: 5px 2px;
  font-size: .67rem;
  font-weight: 700;
}
.nav-button .nav-icon { font-size: 1rem; line-height: 1; }
.nav-button.active { color: var(--blue-dark); background: var(--pastel-blue); }
.nav-context { display: none; }

.list { display: grid; gap: 11px; }
.list-row {
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 15px;
  background: var(--white);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
}
button.list-row:hover { border-color: var(--tostado); box-shadow: var(--shadow-soft); }
.list-row.locked { color: var(--ink-soft); background: var(--arena-darker); }
.list-copy { min-width: 0; }
.list-copy strong { display: block; font-family: var(--serif); font-size: 1.08rem; line-height: 1.2; }
.list-copy span { display: block; color: var(--ink-soft); font-size: .81rem; margin-top: 4px; }

.detail-hero { padding: clamp(22px, 6vw, 38px); background: var(--arena-darker); border: 1px solid rgba(183,163,138,.45); border-radius: var(--radius); margin-bottom: 18px; }
.detail-hero h1 { margin: 10px 0 12px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-soft); font-size: .86rem; margin-top: 18px; }
.reading { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.reading-section { padding: 23px; border-bottom: 1px solid var(--line); }
.reading-section:last-child { border-bottom: 0; }
.reading-section h3 { margin-bottom: 10px; color: var(--plum); }
.reading-section p:last-child, .reading-section ul:last-child { margin-bottom: 0; }
.reading-section ul { padding-left: 20px; }
.quote { border-left: 3px solid var(--blue-mid); padding-left: 17px; color: var(--plum); font-family: var(--serif); font-size: 1.18rem; }

.resource-cover { color: var(--white); background: var(--grafito); border: 0; padding: clamp(25px, 7vw, 44px); border-radius: var(--radius); margin-bottom: 16px; }
.resource-cover .eyebrow, .resource-cover .meta { color: rgba(255,255,255,.72); }
.resource-cover h1 { margin-bottom: 12px; }
.resource-cover p { color: rgba(255,255,255,.78); max-width: 640px; }
.resource-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 24px; }
.resource-stat { padding: 13px; border-radius: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.13); }
.resource-stat strong { display: block; }
.resource-stat span { font-size: .75rem; color: rgba(255,255,255,.68); }
.day-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 18px 0; }
.day-dot { aspect-ratio: 1; border-radius: 9px; display: grid; place-items: center; background: var(--arena-darker); color: var(--ink-soft); font-size: .72rem; font-weight: 800; }
.day-dot.done { color: var(--green-dark); background: var(--pastel-green); }
.day-dot.today { color: var(--white); background: var(--grafito); box-shadow: 0 0 0 3px var(--tostado); }

.check-list { display: grid; gap: 9px; margin: 16px 0; }
.check-item { display: flex; gap: 10px; align-items: flex-start; }
.check-mark { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--sage-soft); color: var(--sage); display: grid; place-items: center; font-size: .72rem; font-weight: 900; }
.note-box { padding: 18px; border-radius: var(--radius-sm); background: var(--arena-darker); border: 1px solid rgba(183,163,138,.45); }
.notice { padding: 15px 17px; border-radius: 13px; background: var(--amber-soft); color: var(--grafito); border: 1px solid rgba(183,163,138,.55); margin: 14px 0; }
.success { background: var(--pastel-green); color: var(--green-dark); border-color: rgba(82,96,51,.30); }

.journey-map { display: grid; gap: 0; margin-top: 20px; }
.journey-node { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: stretch; }
.journey-rail { display: flex; flex-direction: column; align-items: center; }
.journey-dot { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--white); background: var(--blue-dark); font-size: .7rem; font-weight: 800; }
.journey-line { width: 1px; flex: 1; min-height: 22px; background: var(--line-dark); }
.journey-node:last-child .journey-line { display: none; }
.journey-card { margin-bottom: 10px; min-height: 64px; }
.journey-card button { width: 100%; min-height: 58px; text-align: left; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--white); }
.journey-card button:hover { border-color: var(--blue-mid); }

.flow { display: grid; gap: 8px; margin: 20px 0; }
.flow-node { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.flow-node.tag { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--blue-text); background: var(--pastel-blue); }
.flow-arrow { text-align: center; color: var(--blue-mid); font-size: 1.1rem; }
.code-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.code-tag { padding: 7px 9px; border-radius: 8px; background: var(--arena-darker); border: 1px solid var(--line); font: .73rem ui-monospace, SFMono-Regular, Menlo, monospace; }

.master-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(47,45,46,.5); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.master-scrim.open { opacity: 1; pointer-events: auto; }
.master-drawer {
  position: fixed;
  z-index: 90;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(92vw, 430px);
  transform: translateX(104%);
  transition: transform .24s ease;
  background: var(--paper);
  box-shadow: -20px 0 60px rgba(47,45,46,.20);
  display: flex;
  flex-direction: column;
}
.master-drawer.open { transform: translateX(0); }
.master-head { padding: 20px; color: var(--white); background: var(--plum); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.master-head h2 { font-size: 1.55rem; margin-bottom: 4px; }
.master-head p { margin: 0; color: rgba(255,255,255,.66); font-size: .8rem; }
.close-button { min-width: 44px; min-height: 44px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; color: var(--white); background: rgba(255,255,255,.07); font-size: 1.2rem; }
.master-list { overflow: auto; padding: 12px; }
.master-item { width: 100%; min-height: 52px; padding: 9px 10px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 8px; text-align: left; }
.master-item:hover { background: var(--arena-darker); }
.master-item.active { color: var(--rose-dark); background: var(--rose-soft); font-weight: 800; }
.master-number { font-size: .71rem; color: var(--ink-soft); }
.master-footer { padding: 12px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.modal-layer { position: fixed; inset: 0; z-index: 110; display: none; place-items: center; padding: 16px; background: rgba(47,45,46,.56); }
.modal-layer.open { display: grid; }
.modal { width: min(100%, 560px); max-height: 88vh; overflow: auto; background: var(--paper); border-radius: 22px; box-shadow: var(--shadow); }
.modal-head { padding: 20px 20px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h2 { font-size: 1.6rem; margin: 0; }
.modal-head .close-button { color: var(--ink); border-color: var(--line); background: var(--white); }
.modal-body { padding: 20px; }
.toast { position: fixed; z-index: 130; left: 50%; bottom: 90px; transform: translate(-50%, 20px); width: min(calc(100% - 32px), 480px); padding: 13px 16px; border-radius: 12px; color: var(--white); background: var(--plum); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; text-align: center; font-size: .86rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.completion-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--sage-soft); color: var(--sage); display: grid; place-items: center; font-size: 1.8rem; margin-bottom: 25px; }
.priority-list { counter-reset: priorities; display: grid; gap: 12px; }
.priority-item { counter-increment: priorities; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; padding: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.priority-item::before { content: counter(priorities); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--white); background: var(--blue-dark); font-family: var(--serif); }
.recommendation { border-left: 4px solid var(--blue-mid); }
.brand-word { font-style: italic; color: var(--tostado); }
.arrival-line { margin-bottom: 8px; font: italic clamp(1.25rem,4vw,1.65rem)/1.25 var(--serif); color: var(--tostado); }
.first-actions { display:grid; gap:12px; margin:18px 0 28px; counter-reset:firstactions; }
.first-action { counter-increment:firstactions; display:grid; grid-template-columns:42px 1fr; gap:14px; align-items:start; padding:20px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--white); }
.first-action::before { content:counter(firstactions); width:38px; height:38px; display:grid; place-items:center; border-radius:50%; background:var(--grafito); color:var(--white); font-family:var(--serif); font-size:1.15rem; }
.first-action.complete::before { content:"✓"; color:var(--green-dark); background:var(--pastel-green); font-family:var(--sans); }
.first-action h3 { margin:2px 0 6px; }
.first-action .btn { margin-top:12px; }
.video-card { position:relative; min-height:280px; display:grid; place-items:center; overflow:hidden; border-radius:var(--radius); color:var(--white); background:var(--grafito); text-align:center; padding:32px; }
.video-card::after { content:""; position:absolute; width:230px; height:230px; right:-80px; top:-90px; border-radius:50%; background:var(--pastel-blue); opacity:.18; }
.video-content { position:relative; z-index:1; max-width:480px; }
.play-button { width:72px; height:72px; margin:0 auto 20px; border:1px solid rgba(255,255,255,.45); border-radius:50%; color:var(--blue-dark); background:var(--pastel-blue); font-size:1.3rem; display:grid; place-items:center; }
.questionnaire-grid { display:grid; gap:18px; }
.questionnaire-grid textarea { min-height:110px; resize:vertical; }
.access-price { font:400 clamp(3rem,10vw,5.5rem)/1 var(--serif); letter-spacing:-.04em; }
.access-price span { font:600 .95rem var(--sans); letter-spacing:0; }
.checkin-tabs { display: flex; gap: 7px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; margin-bottom: 17px; }
.tab { white-space: nowrap; min-height: 42px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; background: var(--white); color: var(--ink); }
.tab.active { color: var(--white); background: var(--plum); border-color: var(--plum); }

@media (min-width: 720px) {
  .demo-bar-inner { padding-inline: 18px; grid-template-columns: 1fr auto 1fr; }
  .demo-kicker { display: block; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.75); }
  .demo-controls { justify-content: flex-end; }
  .demo-button.secondary { display: inline-flex; align-items: center; }
  .content { padding: 42px 38px 80px; }
  .portal-header { padding-inline: 28px; }
  .client-mini div:last-child { display: block; }
  .card-grid.two { grid-template-columns: repeat(2, 1fr); }
  .card-grid.three { grid-template-columns: repeat(3, 1fr); }
  .resource-stats { grid-template-columns: repeat(4, 1fr); }
  .toast { bottom: 28px; }
}

@media (min-width: 980px) {
  .portal-grid { display: grid; grid-template-columns: 245px 1fr; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 134px; align-self: start; height: calc(100vh - 134px); padding: 24px 16px; background: var(--arena-darker); border-right: 1px solid var(--line); overflow-y:auto; }
  .sidebar .nav-button { min-height: 61px; padding: 9px 11px; display: grid; grid-template-columns: 25px 1fr; text-align: left; place-items: center start; gap: 10px; font-size: .85rem; }
  .sidebar .nav-icon { font-size: 1rem; }
  .nav-context { display: block; grid-column: 2; margin-top: -4px; color: var(--ink-soft); font-size: .67rem; font-weight: 500; }
  .mobile-nav { display: none; }
  .content { min-height: calc(100vh - 134px); }
  .sidebar-progress { margin-top: auto; padding: 15px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
  .sidebar-progress strong { display: block; font-family: var(--serif); }
  .sidebar-progress span { font-size: .74rem; color: var(--ink-soft); }
}

/* Experiencia visual heredada del dummy original de clientas,
   reconstruida exclusivamente con el sistema de marca Dani Torres. */
body {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 9% 5%, rgba(255,255,255,.92), transparent 31rem),
    radial-gradient(circle at 92% 18%, rgba(232,238,242,.70), transparent 25rem),
    radial-gradient(circle at 82% 92%, rgba(223,232,176,.22), transparent 22rem),
    linear-gradient(rgba(47,45,46,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47,45,46,.014) 1px, transparent 1px);
  background-size: auto, auto, auto, 24px 24px, 24px 24px;
}
.demo-bar { min-height: 50px; box-shadow: 0 6px 22px rgba(47,45,46,.16); }
.demo-bar-inner { min-height: 50px; max-width: 1460px; padding-block: 6px; }
#app { min-height: calc(100vh - 50px); }
.portal {
  max-width: none;
  min-height: calc(100vh - 50px);
  background: transparent;
  box-shadow: none;
}
.portal-header {
  top: 50px;
  min-height: 78px;
  padding: 14px max(18px, calc((100vw - 1392px) / 2));
  background: rgba(247,243,239,.94);
  border-bottom-color: rgba(47,45,46,.08);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
}
.portal-logo { font-size: 1.22rem; line-height: 1; }
.portal-logo span { margin-top: 6px; font-size: .61rem; }
.avatar {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(183,163,138,.55);
  background: rgba(255,255,255,.78);
}
.portal-header-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255,255,255,.76);
  box-shadow: 0 7px 20px rgba(47,45,46,.06);
  font-size: .76rem;
  font-weight: 750;
  transition: transform .2s ease, background .25s ease, border-color .25s ease;
}
.theme-toggle:hover { transform: translateY(-1px); border-color: rgba(101,118,135,.38); }
.theme-toggle-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blue-dark);
  background: var(--pastel-blue);
  font-size: .92rem;
}
.theme-sun, .theme-label-dark { display: none; }
html[data-theme="dark"] .theme-moon,
html[data-theme="dark"] .theme-label-light { display: none; }
html[data-theme="dark"] .theme-sun { display: inline; }
html[data-theme="dark"] .theme-label-dark { display: inline; }
.portal-grid {
  width: min(100%, 1460px);
  margin: auto;
  padding: 34px 34px 76px;
  display: grid;
  grid-template-columns: 272px minmax(0,1fr);
  gap: 22px;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: 160px;
  align-self: start;
  height: auto;
  max-height: calc(100vh - 184px);
  display: flex;
  padding: 10px;
  overflow-y: auto;
  border: 1px solid rgba(47,45,46,.08);
  border-radius: 26px;
  background: rgba(255,255,255,.68);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.sidebar .nav-button {
  min-height: 62px;
  margin: 3px 0;
  padding: 10px 12px;
  grid-template-columns: 31px 1fr;
  place-items: center start;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 17px;
  font-size: .84rem;
  text-align: left;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.sidebar .nav-button:hover { transform: translateX(2px); border-color: var(--line); background: rgba(255,255,255,.88); }
.sidebar .nav-button.active {
  color: var(--grafito);
  border-color: rgba(183,163,138,.45);
  background: var(--white);
  box-shadow: 0 15px 36px -28px rgba(47,45,46,.7);
}
.sidebar .nav-button.active .nav-icon { color: var(--blue-dark); background: var(--pastel-blue); }
.sidebar .nav-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--arena-darker);
}
.nav-context { grid-column: 2; margin-top: -7px; font-size: .69rem; }
.sidebar-progress {
  margin: 12px 2px 2px;
  padding: 18px;
  color: var(--white);
  border: 0;
  border-radius: 19px;
  background: var(--grafito);
}
.sidebar-progress span { color: rgba(255,255,255,.67); }
.sidebar-progress .progress-line { background: rgba(255,255,255,.12); }
.content {
  min-width: 0;
  min-height: calc(100vh - 162px);
  padding: 0;
  background: transparent;
}
.content-inner { max-width: none; animation: pageArrive .34s ease both; }
@keyframes pageArrive { from { opacity: 0; transform: translateY(8px); } }
.page-head {
  position: relative;
  min-height: 236px;
  margin-bottom: 22px;
  padding: clamp(30px,5vw,48px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 31px;
  background: var(--arena-darker);
  box-shadow: var(--shadow);
}
.page-head::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: -82px;
  top: -110px;
  width: 310px;
  height: 310px;
  border: 52px solid rgba(255,255,255,.34);
  border-radius: 50%;
  pointer-events: none;
}
.page-head > * { position: relative; z-index: 1; }
.page-head h1 { max-width: 900px; margin: 12px 0; font-size: clamp(2.7rem,5vw,4.15rem); line-height: 1.02; }
.page-head .lead { margin: 18px 0 0; line-height: 1.75; }
.page-home .page-head, .page-welcome .page-head, .page-resources .page-head, .page-access-plan .page-head, .page-followup .page-head { background: var(--pastel-blue); }
.page-questionnaire .page-head, .page-progresses .page-head, .page-completion .page-head { background: var(--pastel-green); }
.page-sessions .page-head, .page-agreements .page-head, .page-continuity .page-head, .page-feedbacks .page-head, .page-recommendations .page-head, .page-post-home .page-head { background: var(--pastel-tan); }
.arrival-line { font-size: clamp(1.3rem,3vw,1.75rem); }
.card, .first-action, .progress-panel, .list-row {
  border-color: rgba(47,45,46,.08);
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.card { border-radius: 25px; padding: 26px; }
.card:has(.status-pill.done), .list-row:has(.status-pill.done) { border-color: rgba(82,96,51,.24); }
.card:has(.status-pill.active), .list-row:has(.status-pill.active) { border-color: rgba(101,118,135,.28); }
.card:has(.status-pill.pending), .list-row:has(.status-pill.pending) { border-color: rgba(119,102,79,.22); }
.first-action:nth-child(1) { background: linear-gradient(180deg, var(--pastel-blue) 0 7px, rgba(255,255,255,.86) 7px); }
.first-action:nth-child(2) { background: linear-gradient(180deg, var(--pastel-green) 0 7px, rgba(255,255,255,.86) 7px); }
.first-action:nth-child(3) { background: linear-gradient(180deg, var(--pastel-tan) 0 7px, rgba(255,255,255,.86) 7px); }
.card.clickable, button.list-row { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card.clickable:hover, button.list-row:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.first-actions { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.first-action {
  min-height: 278px;
  display: flex;
  flex-direction: column;
  padding: 25px;
  border-radius: 25px;
}
.first-action::before { margin-bottom: 24px; }
.first-action > div { display: flex; min-height: 188px; flex: 1; flex-direction: column; align-items: flex-start; }
.first-action .btn { margin-top: auto; }
.progress-panel { padding: 25px; border-radius: 25px; }
.stage-track { gap: 10px; }
.stage-step { padding: 14px 10px 0; }
.priority-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(30px,5vw,48px);
  border-radius: 29px;
  box-shadow: var(--shadow);
}
.priority-card::after { width: 310px; height: 310px; right: -82px; bottom: -164px; box-shadow: 0 0 0 48px rgba(255,255,255,.035), 0 0 0 92px rgba(255,255,255,.025); }
.priority-card h2 { font-size: clamp(2.2rem,4vw,3.3rem); }
.list { gap: 12px; }
.list-row { min-height: 88px; padding: 18px 20px; border-radius: 20px; }
.list-row.locked { background: rgba(236,231,226,.72); box-shadow: none; }
.detail-hero, .resource-cover {
  position: relative;
  overflow: hidden;
  padding: clamp(30px,5vw,48px);
  border: 0;
  border-radius: 29px;
  color: var(--white);
  background: var(--grafito);
  box-shadow: var(--shadow);
}
.detail-hero::after, .resource-cover::after {
  content: "";
  position: absolute;
  right: -92px;
  top: -118px;
  width: 300px;
  height: 300px;
  border: 50px solid rgba(255,255,255,.08);
  border-radius: 50%;
  pointer-events: none;
}
.detail-hero > *, .resource-cover > * { position: relative; z-index: 1; }
.detail-hero .lead, .detail-hero .detail-meta { color: rgba(255,255,255,.72); }
.detail-hero .eyebrow, .resource-cover .eyebrow { color: var(--tostado); }
.reading { border-radius: 28px; background: rgba(255,255,255,.84); box-shadow: var(--shadow-soft); }
.reading-section { padding: 28px 32px; }
.reading-section h3 { font-size: 1.65rem; }
.quote { border-left-color: var(--tostado); }
.resource-stats { gap: 12px; }
.resource-stat { padding: 16px; border-radius: 16px; }
.video-card { min-height: 390px; border-radius: 30px; box-shadow: var(--shadow); }
.video-card::after { width: 360px; height: 360px; right: -120px; top: -150px; }
.play-button { width: 82px; height: 82px; transition: transform .2s ease, box-shadow .2s ease; }
.play-button:hover { transform: scale(1.04); box-shadow: 0 0 0 12px rgba(232,238,242,.18); }
.questionnaire-grid { gap: 20px; }
.input { border-radius: 16px; background: rgba(255,255,255,.9); }
.day-dot { border-radius: 50%; }
.note-box, .notice { border-radius: 18px; }
.recommendation { border-left-width: 5px; border-left-color: var(--tostado); }
.completion-mark { width: 82px; height: 82px; }
.session-journey-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 18px; align-items: start; }
.session-journey-rail {
  position: sticky;
  top: 160px;
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(47,45,46,.08);
  border-radius: 24px;
  background: rgba(255,255,255,.64);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.session-journey-head { display: flex; justify-content: space-between; gap: 10px; padding: 6px 5px 8px; }
.session-journey-head span { color: var(--ink-soft); font-size: .76rem; }
.session-rail-item {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 17px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
button.session-rail-item:hover { border-color: var(--line); background: var(--white); }
.session-rail-item.active { border-color: rgba(183,163,138,.55); background: var(--white); box-shadow: 0 15px 36px -28px rgba(47,45,46,.7); }
.session-rail-item.locked { opacity: .55; }
.session-rail-number { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--arena-darker); font-size: .76rem; font-weight: 800; }
.session-rail-item.active .session-rail-number { color: var(--blue-dark); background: var(--pastel-blue); }
.session-rail-item.complete .session-rail-number { color: var(--green-dark); background: var(--pastel-green); }
.session-rail-item strong { display: block; font-size: .78rem; }
.session-rail-item small { display: block; margin-top: 3px; font-size: .68rem; }
.session-journey-main { min-width: 0; }
.session-journey-main > .detail-hero { margin-bottom: 18px; }
.btn { min-height: 46px; padding-inline: 19px; }
.btn-primary { background: var(--grafito); }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(47,45,46,.22); }
.btn-secondary:hover { border-color: var(--tostado); }

/* Dark mode New Self®: la misma paleta llevada a una experiencia nocturna cálida. */
html[data-theme="dark"] {
  color-scheme: dark;
  --arena-light: #232528;
  --arena-darker: #303236;
  --paper: #232528;
  --sand: #232528;
  --ink: #F7F3EF;
  --ink-soft: rgba(247,243,239,.70);
  --line: rgba(216,208,200,.16);
  --line-dark: rgba(216,208,200,.30);
  --tostado: #D6C3AA;
  --blue-dark: #CFDCE4;
  --green-dark: #DFE8B0;
  --tan-text: #EDE4D9;
  --sage: #DFE8B0;
  --amber: #EDE4D9;
  --blue: #CFDCE4;
  --shadow: 0 20px 56px rgba(0,0,0,.31);
  --shadow-soft: 0 10px 30px rgba(0,0,0,.22);
}
html[data-theme="dark"] body {
  background-color: #232528;
  background-image:
    radial-gradient(circle at 10% 4%, rgba(159,175,190,.13), transparent 30rem),
    radial-gradient(circle at 92% 18%, rgba(101,118,135,.14), transparent 25rem),
    radial-gradient(circle at 82% 92%, rgba(223,232,176,.06), transparent 22rem),
    linear-gradient(rgba(247,243,239,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247,243,239,.014) 1px, transparent 1px);
}
html[data-theme="dark"] .center-stage {
  background:
    radial-gradient(circle at 15% 8%, rgba(159,175,190,.15), transparent 27rem),
    radial-gradient(circle at 92% 90%, rgba(223,232,176,.07), transparent 25rem),
    #232528;
}
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .email-window,
html[data-theme="dark"] .welcome-card,
html[data-theme="dark"] .master-drawer,
html[data-theme="dark"] .modal { background: #303236; border-color: var(--line); }
html[data-theme="dark"] .email-top,
html[data-theme="dark"] .modal-head { background: #383A3D; }
html[data-theme="dark"] .portal-header {
  background: rgba(35,37,40,.95);
  border-bottom-color: rgba(216,208,200,.12);
}
html[data-theme="dark"] .theme-toggle {
  color: #F7F3EF;
  background: rgba(255,255,255,.055);
  border-color: rgba(216,208,200,.18);
  box-shadow: none;
}
html[data-theme="dark"] .theme-toggle:hover { background: rgba(255,255,255,.09); border-color: rgba(159,175,190,.42); }
html[data-theme="dark"] .theme-toggle-icon { color: #EDE4D9; background: rgba(183,163,138,.18); }
html[data-theme="dark"] .avatar { color: #E8EEF2; background: rgba(159,175,190,.15); border-color: rgba(159,175,190,.32); }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .session-journey-rail {
  background: rgba(48,50,54,.88);
  border-color: rgba(216,208,200,.12);
}
html[data-theme="dark"] .sidebar .nav-button:hover,
html[data-theme="dark"] button.session-rail-item:hover { background: rgba(255,255,255,.06); }
html[data-theme="dark"] .sidebar .nav-button.active,
html[data-theme="dark"] .session-rail-item.active {
  color: #F7F3EF;
  background: #3A3D40;
  border-color: rgba(159,175,190,.32);
  box-shadow: 0 15px 36px -28px rgba(0,0,0,.9);
}
html[data-theme="dark"] .sidebar .nav-icon,
html[data-theme="dark"] .session-rail-number { background: rgba(255,255,255,.065); }
html[data-theme="dark"] .sidebar .nav-button.active .nav-icon,
html[data-theme="dark"] .session-rail-item.active .session-rail-number {
  color: #CFDCE4;
  background: rgba(159,175,190,.18);
}
html[data-theme="dark"] .session-rail-item.complete .session-rail-number {
  color: #DFE8B0;
  background: rgba(223,232,176,.14);
}
html[data-theme="dark"] .mobile-nav {
  background: rgba(35,37,40,.97);
  border-top-color: rgba(216,208,200,.13);
  box-shadow: 0 -10px 30px rgba(0,0,0,.22);
}
html[data-theme="dark"] .nav-button.active { color: #E8EEF2; background: rgba(159,175,190,.14); }
html[data-theme="dark"] .page-head { color: #F7F3EF; border-color: rgba(255,255,255,.08); }
html[data-theme="dark"] .page-head::after { border-color: rgba(255,255,255,.07); }
html[data-theme="dark"] .page-head .lead { color: rgba(247,243,239,.76); }
html[data-theme="dark"] .page-home .page-head,
html[data-theme="dark"] .page-welcome .page-head,
html[data-theme="dark"] .page-resources .page-head,
html[data-theme="dark"] .page-access-plan .page-head,
html[data-theme="dark"] .page-followup .page-head { background: #34414A; }
html[data-theme="dark"] .page-questionnaire .page-head,
html[data-theme="dark"] .page-progresses .page-head,
html[data-theme="dark"] .page-completion .page-head { background: #3D4233; }
html[data-theme="dark"] .page-sessions .page-head,
html[data-theme="dark"] .page-agreements .page-head,
html[data-theme="dark"] .page-continuity .page-head,
html[data-theme="dark"] .page-feedbacks .page-head,
html[data-theme="dark"] .page-recommendations .page-head,
html[data-theme="dark"] .page-post-home .page-head { background: #403A34; }
html[data-theme="dark"] .card,
html[data-theme="dark"] .first-action,
html[data-theme="dark"] .progress-panel,
html[data-theme="dark"] .list-row,
html[data-theme="dark"] .reading,
html[data-theme="dark"] .flow-node,
html[data-theme="dark"] .priority-item {
  color: #F7F3EF;
  background: rgba(50,52,55,.96);
  border-color: rgba(216,208,200,.13);
  box-shadow: var(--shadow-soft);
}
html[data-theme="dark"] .card:has(.status-pill.done),
html[data-theme="dark"] .list-row:has(.status-pill.done) { border-color: rgba(223,232,176,.22); }
html[data-theme="dark"] .card:has(.status-pill.active),
html[data-theme="dark"] .list-row:has(.status-pill.active) { border-color: rgba(159,175,190,.28); }
html[data-theme="dark"] .card:has(.status-pill.pending),
html[data-theme="dark"] .list-row:has(.status-pill.pending) { border-color: rgba(237,228,217,.20); }
html[data-theme="dark"] .first-action:nth-child(1) { background: linear-gradient(180deg, #657687 0 7px, #323437 7px); }
html[data-theme="dark"] .first-action:nth-child(2) { background: linear-gradient(180deg, #78805A 0 7px, #323437 7px); }
html[data-theme="dark"] .first-action:nth-child(3) { background: linear-gradient(180deg, #8A7864 0 7px, #323437 7px); }
html[data-theme="dark"] .first-action::before,
html[data-theme="dark"] .priority-item::before,
html[data-theme="dark"] .journey-dot { color: #FFFFFF; background: #657687; }
html[data-theme="dark"] .first-action.complete::before,
html[data-theme="dark"] .check-mark,
html[data-theme="dark"] .completion-mark {
  color: #DFE8B0;
  background: rgba(223,232,176,.14);
}
html[data-theme="dark"] .stage-pill,
html[data-theme="dark"] .status-pill.active,
html[data-theme="dark"] .status-pill.new {
  color: #DCE6EC;
  background: rgba(159,175,190,.18);
}
html[data-theme="dark"] .status-pill.done {
  color: #DFE8B0;
  background: rgba(223,232,176,.14);
}
html[data-theme="dark"] .status-pill.pending {
  color: #EDE4D9;
  background: rgba(183,163,138,.18);
}
html[data-theme="dark"] .status-pill.locked { color: rgba(247,243,239,.62); background: rgba(255,255,255,.065); }
html[data-theme="dark"] .priority-card,
html[data-theme="dark"] .detail-hero,
html[data-theme="dark"] .resource-cover,
html[data-theme="dark"] .video-card,
html[data-theme="dark"] .sidebar-progress,
html[data-theme="dark"] .master-head,
html[data-theme="dark"] .toast { background: #1D2022; }
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-rose { color: #FFFFFF; background: #657687; }
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-rose:hover { background: #536674; }
html[data-theme="dark"] .btn-secondary { color: #F7F3EF; background: #393B3E; border-color: rgba(216,208,200,.25); }
html[data-theme="dark"] .btn-danger { color: #EDE4D9; background: rgba(183,163,138,.13); border-color: rgba(183,163,138,.35); }
html[data-theme="dark"] .btn-ghost { color: #CFDCE4; }
html[data-theme="dark"] .input { color: #F7F3EF; background: #35373A; border-color: rgba(216,208,200,.24); }
html[data-theme="dark"] .input::placeholder { color: rgba(247,243,239,.42); }
html[data-theme="dark"] .onboard-icon { color: #DCE6EC; background: rgba(159,175,190,.16); }
html[data-theme="dark"] .journey-card button,
html[data-theme="dark"] .tab { color: #F7F3EF; background: #35373A; border-color: rgba(216,208,200,.16); }
html[data-theme="dark"] .tab.active { color: #FFFFFF; background: #657687; border-color: #657687; }
html[data-theme="dark"] .flow-node.tag { color: #DCE6EC; background: rgba(159,175,190,.14); }
html[data-theme="dark"] .modal-head .close-button { color: #F7F3EF; background: rgba(255,255,255,.06); border-color: rgba(216,208,200,.18); }
html[data-theme="dark"] .list-row.locked,
html[data-theme="dark"] .day-dot,
html[data-theme="dark"] .code-tag { background: rgba(255,255,255,.045); }
html[data-theme="dark"] .day-dot.done { color: #DFE8B0; background: rgba(223,232,176,.14); }
html[data-theme="dark"] .note-box,
html[data-theme="dark"] .notice { color: #EDE4D9; background: rgba(183,163,138,.12); border-color: rgba(183,163,138,.25); }
html[data-theme="dark"] .success { color: #DFE8B0; background: rgba(223,232,176,.11); border-color: rgba(223,232,176,.23); }
html[data-theme="dark"] .progress-line { background: rgba(255,255,255,.11); }
html[data-theme="dark"] .progress-line span { background: #9FAFBE; }
html[data-theme="dark"] .master-item { border-bottom-color: rgba(216,208,200,.11); }
html[data-theme="dark"] .master-item.active { color: #DCE6EC; background: rgba(159,175,190,.14); }

@media (max-width: 1180px) {
  .portal-grid { grid-template-columns: 230px minmax(0,1fr); padding-inline: 22px; }
  .first-actions { grid-template-columns: 1fr; }
  .first-action { min-height: auto; display: grid; grid-template-columns: 42px 1fr; }
  .first-action::before { margin: 0; }
  .first-action > div { min-height: 0; }
  .first-action .btn { margin-top: 14px; }
  .session-journey-layout { grid-template-columns: 1fr; }
  .session-journey-rail { position: static; display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .session-journey-head { min-width: 140px; flex-direction: column; }
  .session-rail-item { min-width: 210px; }
}
@media (max-width: 979px) {
  .portal-grid { display: block; padding: 24px 18px 110px; }
  .sidebar { display: none; }
  .mobile-nav { display: grid; }
  .content { min-height: calc(100vh - 152px); }
  .page-head { min-height: 220px; padding: 34px 28px; }
  .page-head h1 { font-size: clamp(2.35rem,8vw,3.3rem); }
}
@media (max-width: 620px) {
  .portal-header { padding-inline: 16px; }
  .portal-logo { font-size: 1rem; }
  .portal-logo span { max-width: 235px; font-size: .53rem; line-height: 1.35; }
  .client-mini { display: none; }
  .portal-header-actions { gap: 7px; }
  .theme-toggle { width: 44px; padding: 7px; justify-content: center; }
  .theme-toggle-label { display: none !important; }
  .portal-grid { padding-inline: 14px; }
  .page-head { min-height: 220px; border-radius: 26px; }
  .page-head::after { right: -145px; top: -135px; }
  .card { padding: 21px; border-radius: 22px; }
  .priority-card, .detail-hero, .resource-cover { border-radius: 25px; }
  .reading-section { padding: 23px 21px; }
  .resource-stats { grid-template-columns: 1fr 1fr; }
  .video-card { min-height: 340px; padding: 25px 18px; }
  .first-action { padding: 20px; }
}

@supports (min-height: 100dvh) {
  #app, .portal, .center-stage { min-height: calc(100dvh - 50px); }
  .sidebar { max-height: calc(100dvh - 184px); }
  .content { min-height: calc(100dvh - 162px); }
  @media (max-width: 979px) {
    .content { min-height: calc(100dvh - 152px); }
    .portal-grid { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  }
}

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

/* ───────────── PORTAL REAL ─────────────
   La banda negra (.demo-bar) era solo para navegar el dummy: fuera, y con ella
   los 50px que todo lo demás le reservaba arriba. */
.demo-bar, .master-scrim, .master-drawer { display: none !important; }
#app, .portal, .center-stage { min-height: 100vh; }
.portal-header { top: 0; }
.sidebar { top: 110px; max-height: calc(100vh - 134px); }
.content { min-height: calc(100vh - 112px); }
@supports (min-height: 100dvh) {
  #app, .portal, .center-stage { min-height: 100dvh; }
  .sidebar { max-height: calc(100dvh - 134px); }
  .content { min-height: calc(100dvh - 112px); }
}
.header-link {
  min-height: 40px; padding: 0 14px; border: 1px solid var(--line-dark); border-radius: 999px;
  display: inline-flex; align-items: center; color: var(--ink); background: transparent;
  font-size: .78rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.header-link:hover { background: var(--white); }
.form-error { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--pastel-tan); color: var(--tan-text); font-size: .88rem; }
.form-error:empty { display: none; }
.pass-wrap { position: relative; }
.pass-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--ink-soft); font-size: .78rem; font-weight: 700; padding: 8px; }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--ink-soft); font-family: var(--serif); letter-spacing: .16em; }
.back-site { display: inline-block; margin-top: 18px; color: var(--ink-soft); font-size: .84rem; }
.answer { white-space: pre-wrap; }
@media (max-width: 560px) { .portal-header-actions .header-link.hide-sm { display: none; } }
.auth-body a, .modal-body a { color: var(--blue-dark); }
