html {
  color-scheme: light;
}
body {
  margin: 0;
  font-size: 14px;
}
img {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
:root {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* Layout: hero band (title + big % + "career barcode" of every course) → sticky toolbar with view switch → schematic graph canvas (cycle lanes, prerequisite wires) → detail drawer */
:root {
  --bg: #eceff5;
  --canvas: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #e7ebf3;
  --ink: #0e1424;
  --muted: #5a6378;
  --line: #d2d8e4;
  --grid: rgba(14, 20, 36, 0.085);
  --wire: #b4bccd;
  --accent: #4a3aff;
  --accent-ink: #ffffff;
  --accent-soft: #e8e6ff;
  --ok: #0b9468;
  --ok-soft: #d9f4e9;
  --cur: #0784b5;
  --cur-soft: #d6f0fa;
  --plan: #b87308;
  --plan-soft: #fceed3;
  --bad: #d4344a;
  --bad-soft: #fce2e5;
  --anc: #e08a00;
  --dim: 0.22;
  --shadow: 0 18px 40px -18px rgba(14, 20, 36, 0.35);
  --shadow-s:
    0 1px 2px rgba(14, 20, 36, 0.08), 0 2px 8px -2px rgba(14, 20, 36, 0.08);
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Geist", "Segoe UI", system-ui, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080b15;
    --canvas: #0b0f1c;
    --surface: #131929;
    --surface-2: #1a2134;
    --ink: #e9ecf6;
    --muted: #8c95ad;
    --line: #262e45;
    --grid: rgba(255, 255, 255, 0.07);
    --wire: #3a4462;
    --accent: #8d84ff;
    --accent-ink: #0b0f1c;
    --accent-soft: #25225a;
    --ok: #3dd69b;
    --ok-soft: #0e3226;
    --cur: #45c2f2;
    --cur-soft: #0c2c3c;
    --plan: #f5b940;
    --plan-soft: #382a0d;
    --bad: #ff7086;
    --bad-soft: #3c1820;
    --anc: #ffb547;
    --dim: 0.2;
    --shadow: 0 20px 44px -16px rgba(0, 0, 0, 0.75);
    --shadow-s:
      0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #080b15;
  --canvas: #0b0f1c;
  --surface: #131929;
  --surface-2: #1a2134;
  --ink: #e9ecf6;
  --muted: #8c95ad;
  --line: #262e45;
  --grid: rgba(255, 255, 255, 0.07);
  --wire: #3a4462;
  --accent: #8d84ff;
  --accent-ink: #0b0f1c;
  --accent-soft: #25225a;
  --ok: #3dd69b;
  --ok-soft: #0e3226;
  --cur: #45c2f2;
  --cur-soft: #0c2c3c;
  --plan: #f5b940;
  --plan-soft: #382a0d;
  --bad: #ff7086;
  --bad-soft: #3c1820;
  --anc: #ffb547;
  --dim: 0.2;
  --shadow: 0 20px 44px -16px rgba(0, 0, 0, 0.75);
  --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--bg);
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.wrap {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  max-width: 1600px;
  margin: 0 auto;
}
.mono {
  font-family: var(--f-mono);
}
.num {
  font-variant-numeric: tabular-nums;
}
.hint {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- hero ---------- */
.hero {
  padding-block: 22px 18px;
}
.hero-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.brand {
  flex: 1 1 300px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img {
  flex: none;
}
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand h1 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(28px, 4.2vw, 46px);
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 6px 0 0;
  text-wrap: balance;
}
.brand h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.save {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 11px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.save i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.save[data-s="ok"] i {
  background: var(--ok);
}
.save[data-s="busy"] i {
  background: var(--plan);
  animation: blink 1s infinite;
}
.save[data-s="local"] i {
  background: var(--plan);
}
.save[data-s="err"] i {
  background: var(--bad);
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 7px 12px;
  border-radius: 9px;
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.btn:hover {
  border-color: var(--accent);
}
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
}
.btn.danger {
  color: var(--bad);
}
.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.icon-btn {
  border: 0;
  background: transparent;
  padding: 6px;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.dash {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  min-width: 0;
}
.big {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.big .pct {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(52px, 7vw, 84px);
  line-height: 0.85;
  letter-spacing: -0.04em;
}
.big .pct small {
  font-size: 0.42em;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0;
}
.big .lbl {
  padding-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.big .lbl b {
  color: var(--ink);
  font-weight: 600;
}
.barcode {
  display: flex;
  gap: 6px;
  margin-top: 16px;
  min-width: 0;
}
.bc-grp {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.bc-row {
  display: flex;
  gap: 2px;
  height: 34px;
}
.bc {
  border: 0;
  padding: 0;
  border-radius: 3px;
  background: var(--surface-2);
  min-width: 3px;
  transition:
    transform 0.15s,
    filter 0.15s;
}
.bc:hover {
  transform: scaleY(1.12);
  filter: brightness(1.1);
}
.bc[data-st="aprobado"] {
  background: var(--ok);
}
.bc[data-st="cursando"] {
  background: var(--cur);
}
.bc[data-st="planificado"] {
  background: repeating-linear-gradient(
    135deg,
    var(--plan) 0 3px,
    var(--plan-soft) 3px 6px
  );
}
.bc[data-st="desaprobado"] {
  background: var(--bad);
}
.bc[data-st="pendiente"][data-av="1"] {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.bc-lbl {
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.kpi {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.kpi:nth-child(odd) {
  border-right: 1px solid var(--line);
}
.kpi:nth-last-child(-n + 2) {
  border-bottom: 0;
}
.kpi .k {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi .v {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.kpi .v small {
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}
.meter {
  height: 4px;
  border-radius: 9px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 6px;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--ok);
  border-radius: 9px;
  transition: width 0.5s;
}

.intro {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: var(--accent-soft);
  border-radius: 14px;
  padding: 12px 16px;
  margin-top: 14px;
}
.intro div {
  flex: 1 1 280px;
  min-width: 0;
}

/* next-up strip */
.next {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.next-h {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.next-h b {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.next-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 4px 6px;
  scroll-snap-type: x proximity;
}
.nx {
  flex: none;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  width: 220px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
  cursor: pointer;
  transition: transform 0.15s;
}
.nx:hover {
  transform: translateY(-2px);
}
.nx .r1 {
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
}
.nx b {
  font-size: 13px;
  line-height: 1.25;
}
.nx .acts {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}
.nx .acts button {
  border: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
}
.nx .acts button:hover {
  background: var(--accent);
  color: var(--accent-ink);
}
.nx[data-st="planificado"] {
  border-style: dashed;
  border-color: var(--plan);
  box-shadow: 0 0 0 4px var(--plan-soft);
}

/* minimap */
.mini {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-s);
  padding: 5px;
  cursor: crosshair;
}
.mini canvas {
  display: block;
  border-radius: 6px;
}

/* entrance + approval */
.stage.enter .node {
  animation: nin 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--d, 0) * 70ms);
}
.stage.enter .wire,
.stage.enter .wdot {
  animation: win 0.9s ease both;
  animation-delay: 0.45s;
}
@keyframes nin {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}
@keyframes win {
  from {
    opacity: 0;
  }
}
.node.pop::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  border: 2px solid var(--ok);
  animation: ring 0.7s ease-out forwards;
  pointer-events: none;
}
@keyframes ring {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.18);
  }
}

/* drawer head by status */
.drawer[data-st="aprobado"] .d-head {
  background: var(--ok-soft);
}
.drawer[data-st="cursando"] .d-head {
  background: var(--cur-soft);
}
.drawer[data-st="planificado"] .d-head {
  background: var(--plan-soft);
}
.drawer[data-st="desaprobado"] .d-head {
  background: var(--bad-soft);
}
.gbadge {
  flex: none;
  order: 2;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 2px solid var(--line);
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 23px;
  line-height: 1;
  text-align: center;
}
.gbadge small {
  display: block;
  font-family: var(--f-mono);
  font-size: 8.5px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0.06em;
}
.drawer[data-st="aprobado"] .gbadge {
  border-color: var(--ok);
  color: var(--ok);
}
.drawer[data-st="desaprobado"] .gbadge {
  border-color: var(--bad);
  color: var(--bad);
}
.drawer[data-st="cursando"] .gbadge {
  border-color: var(--cur);
  color: var(--cur);
}
.d-head #dClose {
  order: 3;
}

/* landing */
.noplan .bar,
.noplan #legend,
.noplan #summary,
.noplan #save {
  display: none;
}
.landing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding-block: 10px 40px;
}
.landing h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  text-wrap: balance;
}
.landing h2 em {
  font-style: normal;
  color: var(--accent);
}
.landing .lead {
  font-size: 16px;
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 22px;
}
.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: st;
}
.steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  counter-increment: st;
  max-width: 52ch;
}
.steps li::before {
  content: counter(st);
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
}
.steps b {
  display: block;
}
.steps span {
  color: var(--muted);
  font-size: 13px;
}
.dropzone {
  position: relative;
  border: 2px dashed var(--line);
  background: var(--surface);
  border-radius: 22px;
  padding: 34px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.15s;
  background-image: radial-gradient(var(--grid) 1.2px, transparent 1.3px);
  background-size: 20px 20px;
}
.dropzone.over {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  transform: scale(1.01);
}
.dropzone svg.art {
  width: min(320px, 100%);
  height: auto;
}
.dropzone .big-btn {
  font-size: 15px;
  padding: 11px 20px;
  border-radius: 12px;
}
.dropzone .st {
  font-size: 13px;
  color: var(--muted);
  min-height: 1.4em;
}
.dropzone .st.err {
  color: var(--bad);
}
.spin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: sp 0.8s linear infinite;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 6px;
}
@keyframes sp {
  to {
    transform: rotate(360deg);
  }
}
.foot-note {
  font-size: 12px;
  color: var(--muted);
  padding-block: 6px 30px;
  text-align: left;
}
.prev {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-block: 10px;
}
.prev div {
  display: flex;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.prev div span:first-child {
  font-family: var(--f-mono);
  width: 60px;
  flex: none;
  color: var(--muted);
}
.prev div span:last-child {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.prev .gh {
  background: var(--surface-2);
  font-weight: 600;
  position: sticky;
  top: 0;
}
.pstats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-block: 12px;
}
.pstats div {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px 10px;
}
.pstats b {
  font-family: var(--f-display);
  font-size: 22px;
  display: block;
  line-height: 1.1;
}
.pstats span {
  font-size: 11px;
  color: var(--muted);
}
@media (max-width: 820px) {
  .landing {
    grid-template-columns: 1fr;
  }
  .pstats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- toolbar ---------- */
.bar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar .wrap {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-block: 10px;
}
.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  padding: 3px;
  border-radius: 11px;
  overflow-x: auto;
  max-width: 100%;
}
.tab {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  display: inline-flex;
  gap: 7px;
  align-items: center;
}
.tab svg {
  width: 15px;
  height: 15px;
}
.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-s);
}
.search {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
}
.search input {
  border: 0;
  background: transparent;
  outline: 0;
  padding: 8px 0;
  width: 100%;
  min-width: 0;
}
.search:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.search-status {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.search kbd {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 5px;
}

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  padding-block: 12px 10px;
  align-items: center;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1.5px solid var(--line);
  background: var(--surface);
}
.legend .l-ok {
  background: var(--ok);
  border-color: var(--ok);
}
.legend .l-cur {
  background: var(--cur);
  border-color: var(--cur);
}
.legend .l-plan {
  border-style: dashed;
  border-color: var(--plan);
  background: var(--plan-soft);
}
.legend .l-bad {
  background: var(--bad);
  border-color: var(--bad);
}
.legend .l-av {
  border-color: var(--accent);
  border-width: 2px;
  background: var(--accent-soft);
}
.legend .l-lock {
  background: var(--surface-2);
  border-color: transparent;
}
.legend svg {
  width: 28px;
  height: 10px;
}
.legend .sep {
  width: 1px;
  height: 14px;
  background: var(--line);
}

/* ---------- graph ---------- */
.gwrap {
  position: relative;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 28px;
}
.gscroll {
  overflow: auto;
  cursor: grab;
  touch-action: pan-x pan-y;
  max-height: calc(100vh - 150px);
  min-height: 420px;
  background-image: radial-gradient(var(--grid) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
}
.gscroll.panning {
  cursor: grabbing;
  user-select: none;
}
.gsizer {
  position: relative;
}
.stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}
.stage svg.wires {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
}
.lane {
  position: absolute;
  top: 0;
  border-radius: 14px;
}
.lane:nth-child(even) {
  background: color-mix(in srgb, var(--surface-2) 45%, transparent);
}
.lane-h {
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  padding: 0 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.lane-h .t {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.lane-h b {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.lane-h span {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
}
.gctl {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 4px;
  box-shadow: var(--shadow-s);
  align-items: center;
}
.gctl button {
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.gctl button:hover {
  background: var(--surface-2);
}
.gctl button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--surface);
}
.gctl .z {
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--muted);
  min-width: 42px;
  text-align: center;
}
.gctl .div {
  width: 1px;
  height: 18px;
  background: var(--line);
}

.wire {
  fill: none;
  stroke: var(--wire);
  stroke-width: 1.6;
  transition:
    stroke 0.15s,
    opacity 0.15s,
    stroke-width 0.15s;
}
.wire.t-c8 {
  stroke-dasharray: 7 5;
}
.wire.t-sim {
  stroke-dasharray: 2 4;
  stroke-linecap: round;
}
.wire.t-csim {
  stroke-dasharray: 9 4 2 4;
}
.wire.ok {
  stroke: color-mix(in srgb, var(--ok) 70%, var(--wire));
}
.wdot {
  fill: var(--wire);
}
.wdot.ok {
  fill: color-mix(in srgb, var(--ok) 70%, var(--wire));
}
.tracing .wire,
.tracing .wdot {
  opacity: 0.12;
}
.tracing .wire.hl-a {
  opacity: 1;
  stroke: var(--anc);
  stroke-width: 2.6;
}
.tracing .wire.hl-d {
  opacity: 1;
  stroke: var(--accent);
  stroke-width: 2.6;
}
.tracing .wdot.hl-a {
  opacity: 1;
  fill: var(--anc);
}
.tracing .wdot.hl-d {
  opacity: 1;
  fill: var(--accent);
}
.wire.flow {
  animation: flow 1.2s linear infinite;
}
@keyframes flow {
  to {
    stroke-dashoffset: -24;
  }
}

.node {
  position: absolute;
  text-align: left;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 9px 32px 8px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: var(--shadow-s);
  transition:
    opacity 0.18s,
    transform 0.18s,
    box-shadow 0.18s,
    border-color 0.18s,
    background 0.18s;
  overflow: hidden;
}
.node:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  z-index: 2;
}
.node .r1 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.node .code {
  font-family: var(--f-mono);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.node .cr {
  margin-left: auto;
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
}
.node .nm {
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  line-height: 1.22;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.node .ft {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: auto;
  white-space: nowrap;
  overflow: hidden;
}
.node .gr {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 11.5px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
}
.node .quick {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  padding: 0;
  color: transparent;
  transition: all 0.15s;
}
.node .quick svg {
  width: 12px;
  height: 12px;
}
.node .quick:hover {
  border-color: var(--ok);
  color: var(--ok);
  transform: scale(1.12);
}
.node .prog {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--cur);
}
.node[data-st="aprobado"] {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 50%, transparent);
}
.node[data-st="aprobado"] .quick {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--surface);
}
.node[data-st="cursando"] {
  background: var(--cur-soft);
  border-color: var(--cur);
}
.node[data-st="planificado"] {
  background: var(--plan-soft);
  border-style: dashed;
  border-color: var(--plan);
}
.node[data-st="desaprobado"] {
  background: var(--bad-soft);
  border-color: var(--bad);
}
.node[data-st="aprobado"] {
  background: color-mix(in srgb, var(--ok) 28%, var(--surface));
  border-color: var(--ok);
  border-width: 2px;
  padding: 8.5px 31.5px 7.5px 10.5px;
}
.node[data-st="cursando"] {
  background: color-mix(in srgb, var(--cur) 20%, var(--surface));
}
.node[data-st="planificado"] {
  background: color-mix(in srgb, var(--plan) 16%, var(--surface));
}
.node[data-st="desaprobado"] {
  background: color-mix(in srgb, var(--bad) 18%, var(--surface));
}
.tag.ok {
  background: var(--ok);
  color: var(--surface);
}
.uni {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  text-align: left;
}
.uni select {
  appearance: auto;
}
.kinds {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.note {
  background: var(--plan-soft);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
  text-align: left;
}
.parts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-block: 6px 10px;
}
.part {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.part b {
  flex: 1 1 160px;
  min-width: 0;
}
.part .hint {
  flex: 1 1 120px;
}
.node[data-st="pendiente"][data-av="1"] {
  border-color: var(--accent);
  border-width: 2px;
  padding: 8.5px 31.5px 7.5px 10.5px;
  box-shadow:
    0 0 0 4px var(--accent-soft),
    var(--shadow-s);
}
.node[data-st="pendiente"][data-av="0"] {
  background: var(--surface-2);
  border-color: transparent;
  box-shadow: none;
}
.node[data-st="pendiente"][data-av="0"] .nm {
  color: var(--muted);
}
.node.ext {
  padding: 8px 11px;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  border-style: dashed;
  background: var(--surface);
}
.node.ext .box {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid var(--muted);
  display: grid;
  place-items: center;
  flex: none;
  color: transparent;
}
.node.ext .box svg {
  width: 11px;
  height: 11px;
}
.node.ext[data-ok="1"] {
  border-style: solid;
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 50%, transparent);
}
.node.ext[data-ok="1"] .box {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--surface);
}
.node.ext .nm {
  font-size: 12px;
}
.node.slot {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
  padding: 9px 11px;
}
.node.slot:hover {
  border-color: var(--accent);
}
.tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
}
.tag.av {
  background: var(--accent);
  color: var(--accent-ink);
}
.tag.cur {
  background: var(--cur);
  color: var(--surface);
}
.tag.plan {
  background: var(--plan);
  color: var(--surface);
}
.tag.bad {
  background: var(--bad);
  color: var(--surface);
}
.relmark {
  display: none;
  position: absolute;
  right: 34px;
  top: 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--surface);
}
.tracing .node {
  opacity: var(--dim);
}
.tracing .node.is-focus {
  opacity: 1;
  box-shadow:
    0 0 0 3px var(--ink),
    var(--shadow);
}
.tracing .node.anc {
  opacity: 1;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--anc) 70%, transparent),
    var(--shadow-s);
}
.tracing .node.desc {
  opacity: 1;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent),
    var(--shadow-s);
}
.tracing .node.direct .relmark {
  display: block;
}
.node.match-off {
  opacity: 0.12;
}
.node.match-on {
  box-shadow:
    0 0 0 3px var(--accent),
    var(--shadow);
}
.pop {
  animation: pop 0.55s ease;
}
@keyframes pop {
  35% {
    transform: scale(1.07);
  }
}

/* ---------- cards (ciclos + electivos) ---------- */
.board-scroll {
  overflow-x: auto;
  padding-bottom: 16px;
}
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 12px;
  min-width: min-content;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.col-h {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 2px 6px;
}
.col-h .t {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.col-h b {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 700;
}
.col-h span {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
}
.cards .node {
  position: relative;
  width: 100%;
  min-height: 84px;
}
.egroup {
  margin-bottom: 26px;
}
.egroup h2 {
  font-family: var(--f-display);
  font-size: 22px;
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.egroup p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.egrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 12.5px;
}
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
.empty {
  background: var(--surface);
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

/* ---------- drawer ---------- */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 20, 0.32);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.scrim.on {
  opacity: 1;
  pointer-events: auto;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(490px, 100%);
  background: var(--surface);
  z-index: 41;
  transform: translateX(102%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  border-left: 1px solid var(--line);
}
.drawer.on {
  transform: none;
}
.d-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.d-head .t {
  flex: 1;
  min-width: 0;
}
.d-head .code {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
}
.d-head h3 {
  font-family: var(--f-display);
  font-size: 24px;
  margin: 3px 0 5px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.d-head .sub {
  font-size: 12.5px;
  color: var(--muted);
}
.d-body {
  overflow-y: auto;
  padding: 16px 18px 34px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sec h4 {
  margin: 0 0 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 500;
}
.seg {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  background: var(--surface-2);
  padding: 3px;
  border-radius: 11px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 8px 2px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-s);
}
.seg button[data-v="aprobado"][aria-pressed="true"] {
  background: var(--ok);
  color: var(--surface);
}
.seg button[data-v="cursando"][aria-pressed="true"] {
  background: var(--cur);
  color: var(--surface);
}
.seg button[data-v="desaprobado"][aria-pressed="true"] {
  background: var(--bad);
  color: var(--surface);
}
.seg button[data-v="planificado"][aria-pressed="true"] {
  background: var(--plan);
  color: var(--surface);
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.field label {
  font-size: 12px;
  color: var(--muted);
}
.inp {
  border: 1px solid var(--line);
  background: var(--canvas);
  border-radius: 9px;
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
}
.inp:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
}
textarea.inp {
  min-height: 90px;
  resize: vertical;
}
.evals {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ev,
.ev-h {
  display: grid;
  grid-template-columns: 1fr 70px 70px 28px;
  gap: 6px;
  align-items: center;
}
.ev .inp {
  padding: 6px 8px;
}
.ev-h {
  font-size: 11px;
  color: var(--muted);
}
.calc {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.calc div {
  min-width: 0;
}
.calc .k {
  font-size: 11px;
  color: var(--muted);
}
.calc .v {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 22px;
}
.calc .msg {
  grid-column: 1/-1;
  font-size: 13px;
}
.calc .msg.good {
  color: var(--ok);
}
.calc .msg.bad {
  color: var(--bad);
}
.row-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.reqs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.req {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12.5px;
  text-align: left;
}
.req .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  flex: none;
  background: var(--surface-2);
  color: var(--muted);
}
.req.yes .dot {
  background: var(--ok);
  color: var(--surface);
}
.req.no .dot {
  background: var(--bad-soft);
  color: var(--bad);
}
.req small {
  color: var(--muted);
}
.req:hover {
  border-color: var(--accent);
}
.kv {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
}
.kv b {
  font-family: var(--f-mono);
}

/* ---------- modal + toasts ---------- */
.modal {
  width: min(580px, calc(100% - 32px));
  max-height: 90dvh;
  border-radius: 18px;
  overflow: auto;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.modal::backdrop {
  background: rgba(6, 9, 20, 0.55);
}
.modal .box {
  padding: 22px;
}
.modal h3 {
  font-family: var(--f-display);
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.015em;
}
.modal p {
  color: var(--muted);
  margin: 0 0 12px;
}
.account-modal {
  width: min(400px, calc(100% - 28px));
}
.account-modal .box {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px 18px 18px;
  text-align: center;
}
.account-modal h2 {
  margin: 0;
  font: 800 1.55rem/1.12 var(--f-display);
}
.account-modal p {
  margin: 0;
  overflow-wrap: anywhere;
}
.account-modal #googleButton {
  max-width: 100%;
}
.account-modal #googleButton:empty {
  display: none;
}
.account-modal .btn {
  min-height: 42px;
}
.account-close {
  position: absolute;
  inset: 8px 8px auto auto;
  width: 42px;
  height: 42px;
  font-size: 1.45rem;
  line-height: 1;
}
.account-modal #accountDetails {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 100%;
}
.account-modal .account-status {
  font-size: 13px;
}
.ext {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-block: 8px 16px;
}
.ext label {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ext label span {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
}
.foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 16px;
}
.toasts {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: min(480px, calc(100% - 32px));
}
.toast {
  background: var(--ink);
  color: var(--surface);
  padding: 11px 15px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: tin 0.25s ease;
}
@keyframes tin {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 860px) {
  .dash {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .drawer {
    top: auto;
    width: 100%;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    transform: translateY(102%);
    padding-right: 0;
    border-left: 0;
  }
  .board {
    grid-auto-columns: 78vw;
  }
  .hero-actions .lbl {
    display: none;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .seg {
    grid-template-columns: repeat(3, 1fr);
  }
  .gctl {
    left: 12px;
    right: 12px;
    justify-content: center;
    flex-wrap: wrap;
  }
  .gscroll {
    max-height: 72vh;
  }
  .search kbd {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.noplan .hero,
.noplan main,
.noplan .foot-note {
  max-width: 1200px;
}
.noplan .hero {
  padding-block: 28px 20px;
}
.noplan .hero-top {
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 19px;
  flex-wrap: nowrap;
}
.noplan .brand .eyebrow {
  display: none;
}
.noplan .brand h1 {
  font-size: 26px;
  margin: 0;
}
.noplan .brand h1 em {
  display: none;
}
.landing {
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 76px);
  padding-block: 34px 26px;
}
.landing h2 {
  font-size: clamp(38px, 5.5vw, 73px);
  line-height: 0.99;
  letter-spacing: -0.052em;
  text-wrap: initial;
  margin: 0 0 18px;
}
.landing .lead {
  margin-bottom: 24px;
  line-height: 1.55;
}
.landing .steps {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  gap: 16px;
}
.landing .steps li::before {
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--ink);
}
.landing .dropzone {
  align-items: stretch;
  text-align: left;
  gap: 14px;
  padding: clamp(17px, 3vw, 28px);
  border: 1px solid var(--line);
  background-image: none;
  box-shadow: var(--shadow-s);
}
.landing .dropzone.over {
  outline: 2px dashed var(--accent);
  outline-offset: -5px;
  transform: none;
}
.landing .uni {
  max-width: none;
  gap: 12px;
}
.landing .upload-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.landing .upload-options .btn {
  min-height: 44px;
  justify-content: center;
}
.landing .start-links {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  gap: 3px 10px;
  flex-wrap: wrap;
}
.landing .start-links .btn {
  padding-left: 0;
  color: var(--accent);
  min-height: 36px;
}
.landing .preview-map {
  margin: 0;
  background-color: var(--canvas);
  background-image: radial-gradient(var(--grid) 1px, transparent 1.1px);
  background-size: 13px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 8px 5px;
  text-align: center;
}
.landing .preview-map .art {
  width: min(270px, 100%);
  display: block;
  margin: auto;
}
.landing .preview-map figcaption {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.landing .upload-heading {
  font: 800 23px/1.1 var(--f-display);
  margin: 0;
  letter-spacing: -0.025em;
}
@media (max-width: 820px) {
  .landing {
    grid-template-columns: 1fr;
    align-items: start;
    padding-block: 14px 20px;
  }
  .landing h2 {
    max-width: 15ch;
  }
  .landing .steps {
    display: none;
  }
  .landing .lead {
    margin-bottom: 0;
  }
  .landing .preview-map .art {
    width: min(235px, 100%);
  }
}
@media (max-width: 420px) {
  .landing .upload-options .btn {
    flex: 1;
  }
  .bar .wrap {
    gap: 7px;
  }
  .tabs {
    width: 100%;
  }
  .tab {
    flex: 1;
    justify-content: center;
    padding-inline: 6px;
  }
  .tab svg {
    display: none;
  }
}
