/* Generador SCORM — interfaz de trabajo */
:root {
  --ink: #000000;
  --ink-2: #555555;
  --ink-3: #8A8A8A;
  --line: #D6D6D6;
  --field: #B8B8B8;
  --bg: #F2F2F2;
  --paper: #FFFFFF;
  --red: #C8102E;
  --red-dark: #9E0B22;
  --ok: #1D6B35;
  --font: "Archivo", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--ink); }
h1, h2, h3 { font-stretch: 85%; line-height: 1.15; margin: 0; }
h1 { font-size: 30px; font-weight: 750; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* Barra superior */
.topbar { height: 52px; display: flex; align-items: center; gap: 18px; padding: 0 20px; background: #000; color: #fff; position: sticky; top: 0; z-index: 20; }
.app-name { color: #fff; font-weight: 750; font-stretch: 85%; font-size: 17px; text-decoration: none; }
.project .app-name::before { content: "‹ "; }
.topbar-title { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #D0D0D0; }
.topbar-link { margin-left: auto; color: #fff; font-size: 14px; }
.save-state { font-size: 13px; color: #A8A8A8; white-space: nowrap; }
.save-state.error { color: #FF8A99; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 4px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); font: 600 15px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover:not(:disabled) { background: #EAEAEA; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--red-dark); border-color: var(--red-dark); }
.btn.ghost { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 3px; padding: 0 8px; }
.btn.ghost:hover:not(:disabled) { background: rgba(0,0,0,.06); }
.btn.small { height: 32px; padding: 0 12px; font-size: 14px; }
.btn.icon { width: 32px; height: 32px; padding: 0; font-size: 16px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.danger { color: var(--red); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Campos */
label, .label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 6px; }
input[type=text], input[type=number], input:not([type]), select, textarea {
  width: 100%; font: 15px/1.45 var(--font); color: var(--ink); background: var(--paper);
  border: 1px solid var(--field); border-radius: 3px; padding: 9px 11px;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
input[type=color] { width: 56px; height: 40px; padding: 2px; border: 1px solid var(--field); border-radius: 3px; background: #fff; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--ink); }
.help { font-size: 13px; color: var(--ink-2); margin-top: 5px; }
.field { margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px; }
.err { color: var(--red); font-size: 14px; margin: 10px 0; }

/* Inicio */
.home { max-width: 920px; margin: 0 auto; padding: 40px 24px 80px; }
.home h1 { margin-bottom: 28px; }
.new-form { background: var(--paper); border-left: 6px solid var(--red); padding: 22px 24px; margin-bottom: 36px; }
.inline { display: flex; gap: 10px; }
.inline input { flex: 1; }
.list { width: 100%; border-collapse: collapse; background: var(--paper); }
.list th { text-align: left; font-size: 13px; font-weight: 650; color: var(--ink-2); padding: 12px 16px; border-bottom: 1.5px solid var(--ink); }
.list td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list td a { font-weight: 650; text-decoration: none; }
.list td a:hover { text-decoration: underline; }
.list .end { text-align: right; }
.empty { background: var(--paper); padding: 28px; color: var(--ink-2); max-width: 64ch; }

/* Login */
.login { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-box { background: var(--paper); width: 100%; max-width: 400px; padding: 36px 32px; border-top: 6px solid var(--red); }
.login-box h1 { margin-bottom: 8px; }
.login-box p { color: var(--ink-2); margin-bottom: 26px; }
.login-box input { margin-bottom: 18px; }
.login-box .btn { width: 100%; }

/* Proyecto: estructura general */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: calc(100vh - 52px); }
.rail { background: var(--paper); border-right: 1px solid var(--line); padding: 20px 0; position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto; }
.rail ol { list-style: none; margin: 0; padding: 0; }
.step { width: 100%; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; padding: 12px 20px; background: none; border: 0; text-align: left; font: inherit; cursor: pointer; color: var(--ink); }
.step:hover { background: var(--bg); }
.step .num { width: 28px; height: 28px; border: 1.5px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.step.done .num { background: var(--bg); }
.step[aria-current="step"] { box-shadow: inset 4px 0 0 var(--red); }
.step[aria-current="step"] .num { background: var(--ink); color: #fff; }
.step .t { font-weight: 650; display: block; line-height: 1.3; margin-top: 3px; }
.step .s { font-size: 13px; color: var(--ink-2); display: block; }
.main { padding: 32px 40px 96px; min-width: 0; }
.view { max-width: 1060px; }
.view-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.view-head p { color: var(--ink-2); margin-top: 6px; max-width: 70ch; }
.panel { background: var(--paper); padding: 24px 26px; margin-bottom: 20px; }
.panel > h2 { margin-bottom: 16px; }
.lead { color: var(--ink-2); max-width: 70ch; margin-bottom: 18px; }
.warn { border-left: 5px solid var(--red); background: var(--paper); padding: 14px 18px; margin-bottom: 18px; }
.count { font-size: 13px; color: var(--ink-3); text-align: right; margin-top: 4px; }

/* Estructura */
.olist { list-style: none; margin: 0 0 16px; padding: 0; background: var(--paper); }
.orow { display: grid; grid-template-columns: 36px 170px 1fr auto; gap: 12px; align-items: start; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.orow .n { font-weight: 700; padding-top: 9px; font-variant-numeric: tabular-nums; }
.orow .txt { display: grid; gap: 6px; }
.orow .txt textarea { min-height: 44px; font-size: 14px; color: var(--ink-2); }
.orow .ops { display: flex; gap: 4px; padding-top: 4px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.tag::before { content: ""; width: 9px; height: 9px; border: 1.5px solid var(--ink); }
.tag.on::before { background: var(--ink); }
.tag.warn-dot::before { border-color: var(--red); background: var(--red); }

/* Contenido: editor de diapositivas */
.editor { display: grid; grid-template-columns: 270px 1fr; gap: 20px; align-items: start; }
.slist { background: var(--paper); position: sticky; top: 72px; max-height: calc(100vh - 92px); overflow-y: auto; }
.sbtn { width: 100%; display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 11px 14px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; font: inherit; cursor: pointer; }
.sbtn:hover { background: var(--bg); }
.sbtn.cur { box-shadow: inset 4px 0 0 var(--red); background: #FAFAFA; }
.sbtn .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.sbtn .t { display: block; font-weight: 600; line-height: 1.3; }
.sbtn .m { display: flex; gap: 10px; margin-top: 4px; }
.sbtn .tag { font-size: 12px; }
.sedit .panel { margin-bottom: 14px; }
.sedit-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sedit-head .lay { width: 190px; }
.irow { display: grid; grid-template-columns: 26px 200px 1fr 32px; gap: 10px; align-items: start; margin-bottom: 10px; }
.irow .n { padding-top: 9px; font-weight: 700; }
.irow.noh { grid-template-columns: 26px 1fr 32px; }
.orow-q { display: grid; grid-template-columns: 30px 1fr 32px; gap: 10px; align-items: center; margin-bottom: 8px; }
.orow-q input[type=radio] { width: 18px; height: 18px; accent-color: var(--ok); }
.seg { border: 1px solid var(--line); padding: 14px; margin-bottom: 10px; }
.seg-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.seg-top .label { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.chips .help { margin: 0 6px 0 0; }
.chip { height: 28px; padding: 0 10px; border: 1px solid var(--field); border-radius: 14px; background: #fff; font: 13px/1 var(--font); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.taken { color: var(--ink-3); border-style: dashed; }
.seg audio { width: 100%; height: 36px; margin-top: 10px; }
.imgbox { display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: start; }
.thumb { aspect-ratio: 16 / 10; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; color: var(--ink-3); font-size: 13px; text-align: center; padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.svg img { object-fit: contain; background: #fff; }
.credit { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.meta-line { font-size: 13px; color: var(--ink-2); }

/* Imágenes y voz */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 16px; }
.mcard { font: 13px/1.4 var(--font); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: var(--ink); }
.mcard:hover b { text-decoration: underline; }
.mcard .thumb { margin-bottom: 6px; }
.mcard b { display: block; font-weight: 600; line-height: 1.3; }
.stats { display: flex; flex-wrap: wrap; gap: 28px; margin: 4px 0 18px; }
.stat b { display: block; font-size: 26px; font-stretch: 85%; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--ink-2); }
.checklist { list-style: none; margin: 0 0 20px; padding: 0; }
.checklist li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.checklist li::before { content: ""; flex: none; width: 10px; height: 10px; margin-top: 6px; background: var(--ink); }
.checklist li.pending::before { background: var(--red); }
.download { border: 1.5px solid var(--ink); padding: 16px 18px; margin-top: 16px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* Progreso de tareas */
.job { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 20px; z-index: 50; }
.job-box { background: var(--paper); width: 100%; max-width: 540px; padding: 26px 28px; border-top: 6px solid var(--red); }
.job-box h2 { margin-bottom: 16px; }
.job-bar { height: 6px; background: var(--bg); }
#jobFill { height: 100%; width: 0; background: var(--red); transition: width .3s ease; }
.job-now { margin: 12px 0; font-size: 14px; color: var(--ink-2); min-height: 21px; }
.job-log { list-style: none; margin: 0 0 16px; padding: 0; max-height: 180px; overflow-y: auto; font-size: 13px; }
.job-log li { padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--red); }
.job-actions { display: flex; justify-content: flex-end; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; padding: 0; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .rail ol { display: flex; }
  .step { grid-template-columns: 28px auto; padding: 10px 14px; white-space: nowrap; }
  .step .s { display: none; }
  .main { padding: 22px 16px 80px; }
  .editor, .imgbox, .grid2, .grid3 { grid-template-columns: 1fr; }
  .slist { position: static; max-height: 260px; }
  .orow { grid-template-columns: 28px 1fr; }
  .orow .ops { grid-column: 2; }
  .irow { grid-template-columns: 22px 1fr 32px; }
  .irow .h { grid-column: 2; }
  .inline { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
