:root {
  --teal: #0E5A55; --teal-d: #0A4743; --teal-l: #DCE8DF; --lime: #B8A8E6; --lime-l: #F1EEFA; --plum: #1F2A2C;
  --ink: #23262b; --mute: #6b7280; --line: #e4e7ea; --bg: #F3EEE6; --red: #c2413b;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 'Inter', system-ui, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--teal-d); text-decoration: none; }
h1 { font-size: 26px; margin: 0 0 4px; color: var(--plum); letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 0 0 14px; color: var(--plum); }
.muted { color: var(--mute); }
.small { font-size: 12.5px; }
.grow { flex: 1; }
kbd { font: 11px/1 system-ui; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; background: #fff; }
input, textarea, select { font: inherit; color: inherit; }
input:not([type=checkbox]), textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-l); }
textarea { resize: vertical; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 16px; border-radius: 999px; font: 600 14px 'Inter', sans-serif; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--teal); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-d); }
.btn.primary:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: #fff; border-color: var(--line); }
.btn.danger { color: var(--red); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.big { padding: 12px 22px; font-size: 15px; width: 100%; justify-content: center; }
.icon { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; color: var(--mute); font-size: 15px; }
.icon:hover { background: var(--bg); color: var(--ink); }
.link { color: var(--teal-d); text-decoration: underline; cursor: pointer; }

/* Top */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 10px 28px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--plum); font-weight: 600; }
.brand .kb-logo { font-size: 26px; }
.brand span { border-left: 1px solid var(--line); padding-left: 12px; }
.top nav { display: flex; gap: 4px; }
.top nav a { padding: 7px 14px; border-radius: 999px; color: var(--mute); font-weight: 500; font-size: 14px; }
.top nav a.on { background: var(--teal-l); color: var(--teal-d); }
.saved { margin-left: auto; font-size: 13px; color: var(--mute); opacity: 0; transition: opacity .3s; }
.saved.on { opacity: 1; }
.saved.ok { color: var(--teal-d); }
.saved.bad { color: var(--red); }

.page { max-width: 1120px; margin: 0 auto; padding: 32px 28px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head p { margin: 0; max-width: 620px; }

/* Guías */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.guide-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.gc-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); height: 120px; place-items: center; }
.gc-thumbs img { width: 100%; height: 120px; object-fit: contain; background: #fff; }
.gc-thumbs .muted { grid-column: 1 / -1; font-size: 13px; }
.gc-body { padding: 14px 16px 16px; }
.gc-title { display: block; font-size: 18px; font-weight: 700; color: var(--plum); margin-bottom: 2px; }
.gc-actions { display: flex; gap: 6px; margin-top: 12px; }
.guide-card.new { border: 2px dashed var(--line); background: transparent; align-items: center; justify-content: center; min-height: 230px; font: 600 15px 'Inter'; color: var(--teal-d); cursor: pointer; gap: 6px; }
.guide-card.new span { font-size: 34px; font-weight: 300; }
.guide-card.new:hover { border-color: var(--teal); background: #fff; }

/* Editor */
.editor { max-width: 900px; }
.editor-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; }
.title-input { font-size: 30px !important; font-weight: 700; color: var(--plum); border-color: transparent !important; background: transparent !important; padding: 4px 8px !important; margin-left: -8px; box-shadow: none !important; }
.title-input:hover, .title-input:focus { background: #fff !important; border-color: var(--line) !important; }
.intro-input { border-color: transparent !important; background: transparent !important; margin: 0 0 18px -8px; padding: 6px 8px !important; }
.intro-input:hover, .intro-input:focus { background: #fff !important; border-color: var(--line) !important; }
.level { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 14px; margin-bottom: 16px; }
.level.sortable-ghost { opacity: .4; }
.lv-head { display: flex; align-items: center; gap: 10px; }
.lv-handle, .it-handle { cursor: grab; color: #b8bec5; font-size: 18px; user-select: none; padding: 0 2px; }
.lv-title { font-size: 18px; font-weight: 700; color: var(--teal-d); border-color: transparent !important; padding: 4px 8px !important; max-width: 320px; }
.lv-title:hover, .lv-title:focus { border-color: var(--line) !important; }
.lv-head .muted { margin-left: auto; }
.lv-instr { margin: 6px 0 10px; background: var(--lime-l) !important; border-color: transparent !important; font-size: 14px; min-height: 38px; }
.lv-instr:placeholder-shown { background: transparent !important; border: 1px dashed var(--line) !important; }
.items { list-style: none; margin: 0; padding: 0; min-height: 34px; }
.item { display: grid; grid-template-columns: 18px 24px 130px 1fr auto; gap: 12px; align-items: start; padding: 10px 6px; border-top: 1px solid var(--line); background: #fff; }
.item:first-child { border-top: 0; }
.item.sortable-ghost { background: var(--teal-l); opacity: .6; }
.item .it-handle { padding-top: 26px; }
.it-num { width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 24px; }
.it-thumb { display: flex; gap: 4px; height: 76px; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line); cursor: pointer; }
.it-thumb img { flex: 1; min-width: 0; height: 100%; object-fit: contain; }
.noimg { margin: auto; font-size: 11px; color: #aab0b6; }
.it-body strong { display: block; font-size: 14px; color: var(--plum); }
.it-body p { margin: 2px 0 6px; font-size: 13.5px; color: #3c4148; white-space: pre-line; }
.it-note { font-size: 13px !important; padding: 5px 10px !important; border-style: dashed !important; background: transparent !important; color: var(--teal-d); font-weight: 600; }
.it-note:not(:placeholder-shown) { border-style: solid !important; background: var(--teal-l) !important; border-color: transparent !important; }
.it-note::placeholder { font-weight: 400; color: #a4abb2; }
.it-actions { display: flex; flex-direction: column; }
.lv-foot { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 4px; }
.items:empty + .lv-foot { border-top: 0; }
.add-level { width: 100%; justify-content: center; border-style: dashed; border-width: 2px; border-radius: var(--r); padding: 14px; color: var(--teal-d); background: transparent; }

p.caution { color: #8a4b12 !important; background: #fff4e5; border-radius: 6px; padding: 4px 8px; font-size: 12.5px !important; }
.closing-label { display: block; margin-top: 22px; font-size: 13px; font-weight: 600; color: #3c4148; }
.closing-input { margin-top: 6px; font-weight: 400; font-size: 14px; }

/* Biblioteca */
.filters { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.filters input { max-width: 380px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font: 500 13px 'Inter'; cursor: pointer; color: var(--mute); }
.chip.on { background: var(--plum); border-color: var(--plum); color: #fff; }
.ex-grid, .pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.ex-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.ex-card:hover { border-color: var(--teal); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.ex-img { position: relative; height: 140px; display: flex; background: #fff; border-bottom: 1px solid var(--line); }
.ex-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.badge { position: absolute; right: 8px; bottom: 8px; background: var(--plum); color: #fff; border-radius: 999px; font-size: 11px; padding: 2px 8px; }
.ex-body { padding: 10px 12px 12px; }
.ex-body strong { display: block; font-size: 14px; color: var(--plum); }
.ex-body p { margin: 2px 0 4px; font-size: 12.5px; color: #4b5058; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.zone { display: inline-block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--teal-d); background: var(--teal-l); border-radius: 4px; padding: 1px 6px; margin-bottom: 4px; }
.check { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.15); color: transparent; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.ex-card.on { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal); }
.ex-card.on .check { background: var(--teal); color: #fff; }
.ex-card.already::after { content: 'Ya está en este nivel'; position: absolute; top: 8px; left: 8px; background: var(--lime); color: var(--plum); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }

/* Modales */
.modal { border: 0; border-radius: 18px; padding: 24px; width: min(560px, 94vw); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal.wide { width: min(1000px, 96vw); max-height: 88vh; display: none; flex-direction: column; }
.modal.wide[open] { display: flex; }
.modal::backdrop { background: rgba(35, 30, 45, .45); }
.modal label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 0; color: #3c4148; }
.modal label input, .modal label textarea { margin-top: 5px; font-weight: 400; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; align-items: center; }
.warn { margin: 10px 0 0; font-size: 13px; color: #9a6b00; }
.warn:empty { display: none; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 14px; text-align: center; transition: border-color .15s, background .15s; outline: none; }
.drop:focus, .drop.over { border-color: var(--teal); background: var(--teal-l); }
.drop-hint { font-size: 13px; color: var(--mute); padding: 18px 0; }
.drop.has .drop-hint { padding: 8px 0 0; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.thumb { position: relative; width: 140px; height: 100px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; cursor: grab; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; cursor: pointer; }
.thumb.loading { display: grid; place-items: center; font-size: 12px; color: var(--mute); background: var(--bg); }
.pick-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.pick-head h2 { margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-head input { max-width: 280px; }
.pick-head select { max-width: 190px; }
.pick-grid { overflow: auto; padding: 4px; margin: 0 -4px; flex: 1; }

/* Login */
body.login { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(160deg, var(--teal-l), var(--lime-l)); }
.login-card { background: #fff; padding: 36px 34px; border-radius: 20px; width: min(380px, 92vw); text-align: center; box-shadow: 0 20px 60px rgba(68,53,81,.12); }
.login-logo { font-size: 40px !important; margin-bottom: 14px; }
.login-card h1 { font-size: 22px; }
.login-card input { margin: 18px 0 12px; text-align: center; }
.err { color: var(--red); font-size: 13px; margin-bottom: 10px; }

@media (max-width: 720px) {
  .top { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .brand span { display: none; }
  .page { padding: 20px 14px 60px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .item { grid-template-columns: 16px 1fr auto; }
  .it-num { display: none; }
  .it-thumb { grid-column: 2; }
  .it-body { grid-column: 2; }
  .it-actions { grid-column: 3; grid-row: 1; flex-direction: row; }
  .editor-bar { flex-wrap: wrap; }
  .pick-head { flex-wrap: wrap; }
}

/* ---------- Cuestionarios ---------- */
.quiz-list { display: grid; gap: 12px; }
.quiz-row { display: flex; align-items: center; gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.quiz-row .qr-main { flex: 1; }
.quiz-row .gc-actions { margin: 0; }
.pub { font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--bg); color: var(--mute); }
.pub.on { background: var(--lime); color: var(--plum); }
.quiz-editor { max-width: 1040px; }
.howto { background: var(--teal-l); border-radius: 10px; padding: 10px 14px; margin: 0 0 18px; color: #36585e; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; margin-right: 6px; }
.switch input { display: none; }
.switch span { width: 38px; height: 22px; border-radius: 99px; background: #cfd5da; position: relative; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::after { left: 19px; }
.qsec { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 16px; border-top: 4px solid var(--teal); }
.qsec.sortable-ghost { opacity: .4; }
.qsec-head { display: flex; align-items: center; gap: 10px; }
.qsec-handle, .qq-handle, .o-handle { cursor: grab; color: #b8bec5; user-select: none; }
.qsec-k { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--teal); border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.qsec-title { font-size: 17px; font-weight: 700; color: var(--plum); border-color: transparent !important; }
.qsec-title:hover, .qsec-title:focus { border-color: var(--line) !important; }
.qsec-in { margin: 4px 0 8px 34px; }
.qqs { min-height: 40px; }
.qq { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fcfcfd; }
.qq.sortable-ghost { background: var(--teal-l); }
.qq-head { display: flex; align-items: center; gap: 8px; }
.qq-num { width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--plum); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.qq-text { font-weight: 600; }
.qq-type { width: 190px !important; flex: none; font-size: 13px; }
.qq-sub { display: flex; gap: 12px; align-items: center; margin: 6px 0 4px 54px; }
.qq-help { font-size: 13px !important; padding: 6px 10px !important; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; color: #3c4148; cursor: pointer; }
.qopts { list-style: none; margin: 6px 0 0 54px; padding: 0; }
.qopt { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.qopt select { width: auto !important; max-width: 200px; font-size: 12.5px; padding: 6px 8px !important; }
.o-bullet { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid #c3c9cf; }
.o-bullet.sq { border-radius: 4px; }
.o-label { font-size: 14px; padding: 6px 10px !important; min-width: 140px; }
.o-go.set, .qsec-next.set { border-color: var(--teal) !important; background: var(--teal-l) !important; color: var(--teal-d); font-weight: 600; }
.o-val { border: 1px solid var(--line); background: #fff; border-radius: 999px; font: 500 12px 'Inter'; padding: 5px 10px; cursor: pointer; white-space: nowrap; color: var(--mute); }
.o-val.on { background: #fde8e6; border-color: #f3b7b1; color: var(--red); font-weight: 600; }
.qopt.val .o-label { border-color: #f3b7b1 !important; }
.qq-addopt { margin-left: 46px; }
.qq-scale { margin: 8px 0 2px 54px; font-size: 13.5px; }
.qq-thr { width: 70px !important; display: inline-block; padding: 5px 8px !important; }
.qsec-foot { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.after { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #3c4148; }
.after select { width: auto !important; font-size: 13px; }
.qz-ends h3 { margin: 0 0 4px; color: var(--plum); font-size: 16px; }
.qz-ends label { display: block; font-size: 13px; font-weight: 600; margin-top: 10px; }
.qz-ends textarea { margin-top: 5px; font-weight: 400; }
.resp-list { display: grid; gap: 8px; }
.resp { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.resp summary { display: flex; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.resp summary::-webkit-details-marker { display: none; }
.r-date { width: 120px; }
.r-name { flex: 1; min-width: 180px; }
.tag { font-size: 11px; background: var(--bg); border-radius: 999px; padding: 2px 8px; color: var(--mute); }
.res { font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 4px 12px; }
.res.ok { background: var(--lime-l); color: var(--plum); }
.res.val { background: #fde8e6; color: var(--red); }
.r-body { padding: 0 16px 14px; }
.r-body table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.r-body td { border-top: 1px solid var(--line); padding: 6px 4px; vertical-align: top; }
.r-body td:first-child { color: var(--mute); width: 50%; }
.r-why { font-size: 13px; color: var(--red); margin: 10px 0 0; }
.r-actions { display: flex; gap: 6px; margin-top: 10px; }
@media (max-width: 900px) {
  .qopt { flex-wrap: wrap; }
  .qopts, .qq-sub, .qq-scale { margin-left: 0; }
  .qq-head { flex-wrap: wrap; }
  .qq-type { width: 100% !important; }
}

/* Cuestionario interno, «Otro», enunciado */
.pub.int, .res.int { background: #ece8f1; color: var(--plum); }
.qq-optfoot { display: flex; align-items: center; gap: 14px; margin-left: 46px; }
.qq-optfoot .qq-addopt { margin-left: 0; }
.qq-phrase { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px 54px; }
.qq-phrase span { font-size: 12px; font-weight: 600; color: var(--teal-d); white-space: nowrap; cursor: help; }
.qq-phr { font-size: 12.5px !important; padding: 5px 10px !important; background: #f8fbfb !important; }
.qz-mode { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; margin: 0 0 16px; display: grid; gap: 10px; }
.qz-mode label { display: block; font-size: 13px; font-weight: 600; }
.qz-mode select, .qz-mode textarea { margin-top: 5px; font-weight: 400; }
.qz-mode p { margin: 0; }
.rs-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rs-tools select { width: auto; max-width: 320px; }
.r-sentence { font-size: 15px; line-height: 1.55; background: var(--teal-l); border-radius: 10px; padding: 12px 14px; margin: 0 0 8px; }
.r-comp { font-size: 14px; margin: 0 0 8px; background: var(--lime-l); border-radius: 10px; padding: 8px 12px; }
.r-notes { display: block; font-size: 13px; font-weight: 600; margin: 4px 0 8px; }
.r-notes textarea { margin-top: 5px; font-weight: 400; resize: vertical; }
.r-raw { margin-top: 6px; }
.r-raw summary { cursor: pointer; padding: 0; display: block; }
@media (max-width: 900px) { .qq-phrase, .qq-optfoot { margin-left: 0; } }
.is-internal .o-guide, .is-internal .o-level, .is-internal .o-val, .is-internal .howto, .is-internal .qz-ends, .is-internal .qq-scale { display: none; }

/* Pacientes */
.pt-head { display: flex; gap: 16px; align-items: end; }
.pt-head .title-input { flex: 1; }
.pt-head label { font-size: 13px; font-weight: 600; width: 220px; }
.pt-link { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; margin: 10px 0 18px; }
.pt-link-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.pt-link-row input { flex: 1; font-size: 13px; }
.pt-h { margin-top: 10px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--teal-l); }
.tl { display: flex; gap: 18px; padding: 0 0 18px 18px; position: relative; }
.tl::before { content: ''; position: absolute; left: -9px; top: 4px; width: 15px; height: 15px; border-radius: 50%; background: var(--teal); border: 3px solid #fff; }
.tl-date { width: 120px; flex: none; font-size: 13px; color: var(--mute); }
.tag.now { display: inline-block; margin-top: 4px; background: var(--lime); color: var(--plum); font-weight: 600; }
.tl-body { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tl-notes { font-size: 13.5px; background: var(--teal-l); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.tl-levels { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: #3c4148; }
.tl-levels span { font-weight: 600; color: var(--plum); }

/* Taller de imágenes */
.img-progress { min-width: 180px; text-align: right; font-size: 14px; }
.img-progress span { display: block; height: 6px; background: var(--line); border-radius: 9px; margin-top: 6px; overflow: hidden; }
.img-progress i { display: block; height: 100%; background: var(--teal); }
.img-style { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; margin-bottom: 16px; }
.img-style summary { cursor: pointer; }
.img-style textarea { margin: 10px 0 6px; font-size: 13.5px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.img-card { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; outline: none; transition: border-color .15s, box-shadow .15s; }
.img-card:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-l); }
.img-card.over { border-color: var(--teal); border-style: dashed; background: var(--teal-l); }
.img-card.busy { opacity: .5; pointer-events: none; }
.img-card.done { border-color: #cfe7a0; }
.img-cur { height: 150px; display: flex; gap: 4px; padding: 6px; background: #fafbfb; border-bottom: 1px solid var(--line); position: relative; align-items: center; justify-content: center; }
.img-cur img { flex: 1; min-width: 0; height: 100%; object-fit: contain; }
.img-cur .aibadge { position: absolute; top: 8px; right: 8px; background: var(--lime); color: var(--plum); font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.img-body { padding: 10px 12px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.img-body p { margin: 2px 0 6px; color: #3c4148; }
.img-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.img-drop { font-size: 11.5px; color: var(--mute); text-align: center; border: 1.5px dashed var(--line); border-radius: 8px; padding: 6px; margin-top: 6px; }

/* ---------- El monito ---------- */
.img-modes { display: flex; gap: 6px; margin: -4px 0 14px; }
.mn-state { width: auto; }
.mn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.mn-card { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.mn-card.si { border-color: #cfe7a0; }
.mn-card.no { opacity: .72; }
.mn-card.busy { opacity: .5; pointer-events: none; }
.mn-pics { display: grid; grid-template-columns: 1fr 2.1fr; gap: 6px; padding: 6px; background: #fafbfb; border-bottom: 1px solid var(--line); height: 170px; }
.mn-now { position: relative; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 10px; overflow: hidden; }
.mn-now img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mn-now span { position: absolute; left: 6px; bottom: 6px; font-size: 10.5px; font-weight: 600; color: var(--mute); background: rgba(255,255,255,.9); border-radius: 6px; padding: 1px 6px; }
.mn-new { display: flex; align-items: center; justify-content: center; min-width: 0; }
.mn-ph { width: 100%; height: 100%; }
.mn-ph svg { width: 100%; height: 100%; display: block; }
.mn-info { padding: 10px 12px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.mn-info p { margin: 2px 0 6px; color: #3c4148; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mn-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.mn-ok { color: #4d7a17; font-weight: 600; font-size: 12.5px; }
.mn-bad { color: var(--mute); font-size: 12.5px; }
.mn-cta { margin-top: 10px; }

.modal.mn { width: min(1180px, 97vw); max-height: 96vh; padding: 18px 20px; display: none; flex-direction: column; }
.modal.mn[open] { display: flex; }
.mn-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mn-head h2 { margin: 0; }
.mn-head p { margin: 2px 0 0; max-width: 760px; }
.mn-body { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; margin-top: 10px; min-height: 0; flex: 1; }
.mn-stage { display: flex; flex-direction: column; min-height: 0; }
.mn-tabs { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.mn-tabs .chip:disabled { opacity: .4; cursor: default; }
.mn-svg { aspect-ratio: 1; max-height: 56vh; width: auto; margin: 0 auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.mn-svg svg { width: 100%; height: 100%; display: block; }
.mn-h { fill: #fff; stroke: var(--plum); stroke-width: 2.4; cursor: grab; }
.mn-h.far { stroke: #a99bb6; }
.mn-h:hover, .mn-h.on { fill: var(--lime); }
.mn-hint { text-align: center; margin: 6px 0 0; }
.mn-side { overflow: auto; max-height: 64vh; padding-right: 4px; font-size: 13px; }
.mn-side .mn-l { display: block; font-weight: 600; font-size: 12.5px; color: #3c4148; margin: 0 0 12px; }
.mn-side select { margin-top: 4px; font-weight: 400; }
.mn-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.mn-chips .chip { padding: 4px 10px; font-size: 12px; }
.mn-sl { display: flex !important; align-items: center; gap: 8px; margin: 6px 0 !important; font-weight: 400 !important; font-size: 12.5px !important; }
.mn-sl span { width: 128px; flex: none; }
.mn-sl input { flex: 1; padding: 0; }
.mn-side .chk { white-space: normal; margin: 4px 0 10px; }
.mn-prop { font-size: 12.5px; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.mn-prop select { width: auto; max-width: 170px; padding: 4px 8px; margin: 0; }
.mn-foot { display: flex; gap: 14px; align-items: flex-end; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.mn-prev { width: 260px; height: 122px; flex: none; }
.mn-prev svg { width: 100%; height: 100%; display: block; }
.mn-foot .modal-actions { flex: 1; margin-top: 0; }
@media (max-width: 860px) {
  .mn-body { grid-template-columns: 1fr; }
  .mn-side { max-height: none; }
  .mn-grid { grid-template-columns: 1fr; }
  .mn-prev { display: none; }
}
.mn-side input[type=range], .mn-side input[type=checkbox] { accent-color: var(--teal); }

.r-extra { background: var(--lime-l); border-radius: 10px; padding: 8px 12px; margin: 8px 0; font-size: 13.5px; }
.r-extra div { margin-top: 3px; }

/* Kinby: logo y títulos */
.kb-logo { display: inline-flex; align-items: center; gap: .3em; font: 700 24px/1 'Bricolage Grotesque', 'Inter', sans-serif; letter-spacing: -.035em; color: #0E5A55; white-space: nowrap; }
.kb-logo .kb-iso { width: 1.05em; height: 1.05em; flex: none; }
h1, h2, h3 { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; letter-spacing: -.02em; }
