/* v2.15 — Botones de información (ⓘ) y «Cómo usar» */

/* ── ⓘ ─────────────────────────────────────────────────────────────── */
.hlp-label, .hlp-title { display: flex; align-items: center; gap: 6px; }
.hlp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hlp-btn {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent);
  font: 700 12px/1 Georgia, 'Times New Roman', serif; font-style: italic;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; position: relative; vertical-align: middle;
  transition: background .15s, color .15s, transform .15s;
}
/* zona táctil cómoda sin agrandar el dibujo */
.hlp-btn::after { content: ''; position: absolute; inset: -10px; }
.hlp-btn:hover, .hlp-btn[aria-expanded="true"] { background: var(--accent); color: var(--on-accent); transform: scale(1.08); }
.hlp-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hlp-pop {
  position: fixed; z-index: 10050; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.22);
  padding: 12px 14px 14px; font-size: 13.5px; line-height: 1.5;
  max-height: min(70vh, 520px); overflow: auto; animation: hlpIn .16s ease-out;
}
.hlp-pop:focus { outline: none; }
.hlp-sheet { left: 8px !important; right: 8px; bottom: 8px; top: auto !important; width: auto !important; max-height: 65vh; }
@keyframes hlpIn { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
.hlp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.hlp-head strong { flex: 1; font-size: 14.5px; }
.hlp-icon { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center; font: italic 700 13px Georgia, serif; }
.hlp-x { border: 0; background: transparent; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.hlp-x:hover { background: var(--bg-alt); }
.hlp-body p { margin: 0 0 8px; }
.hlp-body ul { margin: 0 0 8px 18px; padding: 0; }
.hlp-body li { margin-bottom: 4px; }
.hlp-ej { background: var(--bg-alt); border-left: 3px solid var(--accent); padding: 7px 10px; border-radius: 6px; font-size: 13px; }

/* ── Menú principal: acceso a «Cómo usar» ──────────────────────────── */
.cm-howto {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 640px; margin: 4px auto 10px;
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--accent); cursor: pointer; text-align: left;
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface));
  color: var(--text);
}
.cm-howto b { display: block; font-size: 15px; }
.cm-howto small { color: var(--text-muted); font-size: 12px; }
.cm-howto-ic { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center; font-size: 15px; animation: htPulse 2.4s ease-in-out infinite; }
@keyframes htPulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }

/* ── Página «Cómo usar» ───────────────────────────────────────────── */
.ht-lead { color: var(--text-muted); margin: 4px 0 0; font-size: 14px; }
.ht-wrap { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 16px; align-items: start; }
.ht-chapters { display: flex; flex-direction: column; gap: 6px; }
.ht-chip { display: flex; gap: 10px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; }
.ht-chip:hover { border-color: var(--accent); }
.ht-chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.ht-chip-ic { font-size: 20px; width: 28px; text-align: center; }
.ht-chip-t { display: flex; flex-direction: column; min-width: 0; }
.ht-chip-t b { font-size: 13px; }
.ht-chip-t small { color: var(--text-muted); font-size: 11.5px; }

.ht-player { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; min-width: 0; outline: none; }
.ht-player:fullscreen { display: flex; flex-direction: column; justify-content: center; padding: 20px; }
.ht-stage { position: relative; width: 100%; overflow: hidden; border-radius: 10px;
  background: radial-gradient(120% 140% at 0% 0%, #e9eef8 0%, #d6deec 55%, #c6d0e2 100%); }
.ht-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; font-family: system-ui, 'Segoe UI', Arial, sans-serif; color: #1d2433; }
.ht-screen { position: absolute; inset: 0; padding: 14px; }
.ht-instant, .ht-instant * { transition: none !important; animation: none !important; }

.ht-captionbar { display: flex; gap: 10px; align-items: flex-start; padding: 12px 4px 6px; min-height: 64px; }
.ht-stepno { flex: 0 0 auto; font: 700 12px/1 system-ui; background: var(--accent); color: var(--on-accent); padding: 5px 8px; border-radius: 99px; margin-top: 2px; }
.ht-caption { font-size: 15.5px; line-height: 1.5; color: var(--text); }
.ht-progress { display: flex; gap: 4px; padding: 4px; }
.ht-seg { flex: 1; height: 7px; border-radius: 99px; border: 0; background: var(--bg-alt); cursor: pointer; padding: 0; position: relative; }
.ht-seg::after { content: ''; position: absolute; inset: -8px 0; }
.ht-seg.done { background: color-mix(in srgb, var(--accent) 55%, var(--bg-alt)); }
.ht-seg.cur { background: var(--accent); }
.ht-controls { display: flex; gap: 6px; align-items: center; padding: 6px 4px 2px; }
.ht-ctl { min-width: 42px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 16px; cursor: pointer; }
.ht-ctl:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ht-ctl:disabled { opacity: .4; cursor: default; }
.ht-play { background: var(--accent); color: var(--on-accent); border-color: var(--accent); min-width: 54px; }
.ht-play:hover:not(:disabled) { color: var(--on-accent); filter: brightness(1.08); }
.ht-speed { font-size: 13px; font-weight: 700; }
.ht-end { display: none; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 4px 2px; font-weight: 600; color: var(--success, #15803d); }
.ht-end.on { display: flex; }

/* intro de capítulo */
.ht-intro { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, #0f2a4a, #1c5a8a); color: #fff; opacity: 0; pointer-events: none; transition: opacity .35s; text-align: center; padding: 16px; }
.ht-intro.on { opacity: 1; }
.ht-intro-ic { font-size: 44px; transform: scale(.6); transition: transform .5s cubic-bezier(.2,1.4,.4,1); }
.ht-intro.on .ht-intro-ic { transform: scale(1); }
.ht-intro-t { font: 700 clamp(18px, 3.4vw, 28px)/1.2 system-ui; transform: translateY(12px); opacity: 0; transition: all .45s .12s; }
.ht-intro-s { font-size: clamp(12px, 2vw, 15px); opacity: 0; transform: translateY(10px); transition: all .45s .25s; color: #cfe0f5; }
.ht-intro.on .ht-intro-t, .ht-intro.on .ht-intro-s { opacity: 1; transform: none; }

/* cursor, anillo, ondas, avisos */
.ht-cursor { position: absolute; left: 0; top: 0; z-index: 25; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.ht-cursor svg { display: block; transition: transform .12s; transform-origin: 4px 2px; }
.ht-cursor.down svg { transform: scale(.82); }
.ht-ring { position: absolute; z-index: 20; border-radius: 10px; border: 2.5px solid #f5a524; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 9999px rgba(15, 25, 45, .32); transition: all .4s cubic-bezier(.4,0,.2,1); }
.ht-ring.on { opacity: 1; }
.ht-ripple { position: absolute; z-index: 24; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid #f5a524;
  pointer-events: none; animation: htRip .6s ease-out forwards; }
@keyframes htRip { to { transform: scale(5); opacity: 0; } }
.ht-toast { position: absolute; z-index: 26; right: 16px; bottom: 16px; background: #15803d; color: #fff; font: 600 13px system-ui;
  padding: 9px 14px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.25); transform: translateY(20px); opacity: 0; transition: all .3s; }
.ht-toast.on { transform: none; opacity: 1; }

/* maqueta de la app */
.ht-win { position: absolute; inset: 12px; background: #f6f8fb; border-radius: 10px; overflow: hidden; box-shadow: 0 18px 40px rgba(20,35,60,.28); display: flex; flex-direction: column; }
.ht-bar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: #fff; border-bottom: 1px solid #e3e8f0; font-size: 13px; }
.ht-logo { width: 22px; height: 22px; border-radius: 6px; background: #1c5a8a; color: #fff; font: 700 10px/22px system-ui; text-align: center; }
.ht-crumb { color: #6b7587; }
.ht-main { flex: 1; display: flex; min-height: 0; }
.ht-side { width: 150px; background: #0f2034; color: #c9d4e3; padding: 8px 6px; font-size: 10.5px; display: flex; flex-direction: column; gap: 2px; }
.ht-side-g { color: #7f8ea5; font-size: 9px; letter-spacing: .4px; text-transform: uppercase; margin-top: 6px; }
.ht-side-i { padding: 4px 6px; border-radius: 5px; }
.ht-side-i.on { background: #1c3a5c; color: #fff; }
.ht-body { flex: 1; padding: 12px 14px; overflow: hidden; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; position: relative; }
.ht-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ht-h h3 { margin: 0; font-size: 17px; }
.ht-row { display: flex; gap: 6px; align-items: flex-end; flex-wrap: wrap; }
.ht-btn { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 6px; font: 600 11.5px system-ui; border: 1px solid #d5dbe5; background: #fff; color: #4a5568; white-space: nowrap; transition: transform .12s, filter .12s; }
.ht-primary { background: #1c5a8a; border-color: #1c5a8a; color: #fff; }
.ht-secondary { background: #fff; border-color: #1c5a8a; color: #1c5a8a; }
.ht-success { background: #15803d; border-color: #15803d; color: #fff; }
.ht-danger { background: #c0392b; border-color: #c0392b; color: #fff; }
.ht-pressed { transform: scale(.94); filter: brightness(.9); }
.ht-field { flex: 1 1 140px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ht-label { font-size: 10.5px; color: #6b7587; font-weight: 600; }
.ht-input { height: 28px; border: 1px solid #cfd6e1; border-radius: 6px; background: #fff; display: flex; align-items: center; padding: 0 8px; font-size: 12px; overflow: hidden; white-space: nowrap; }
.ht-select::after { content: '▾'; margin-left: auto; color: #8a94a6; }
.ht-mono { font-family: ui-monospace, Consolas, monospace; }
.ht-caret { width: 1.5px; height: 14px; background: #1c5a8a; margin-left: 1px; opacity: 0; }
.ht-typing { border-color: #1c5a8a; box-shadow: 0 0 0 3px rgba(28,90,138,.15); }
.ht-typing .ht-caret { opacity: 1; animation: htBlink .8s steps(1) infinite; }
@keyframes htBlink { 50% { opacity: 0; } }
.ht-table { background: #fff; border: 1px solid #e3e8f0; border-radius: 8px; overflow: hidden; }
.ht-tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; align-items: center; padding: 6px 10px; border-top: 1px solid #eef1f6; font-size: 11.5px; }
.ht-tr > :nth-child(2) { grid-column: span 2; }
.ht-th { background: #f3f6fa; border-top: 0; font-weight: 700; color: #6b7587; font-size: 10.5px; }
.ht-tag { display: inline-block; padding: 1px 7px; border-radius: 99px; font: 600 10px/16px system-ui; background: #dbeafe; color: #1e40af; width: max-content; }
.ht-orange { background: #fef3c7; color: #92400e; } .ht-purple { background: #ede9fe; color: #5b21b6; } .ht-gray { background: #eef1f5; color: #4a5568; }
.ht-tag.ht-green { background: #d1fae5; color: #065f46; }
.ht-ov { position: absolute; inset: 0; z-index: 10; background: rgba(15,25,45,.38); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .3s; }
.ht-ov.on { opacity: 1; }
.ht-ov2 { background: rgba(15,25,45,.25); z-index: 12; }
.ht-modal { width: 78%; max-height: 90%; background: #fff; border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.3); display: flex; flex-direction: column;
  transform: translateY(18px) scale(.97); transition: transform .35s cubic-bezier(.2,.9,.3,1.1); overflow: hidden; }
.ht-ov.on .ht-modal { transform: none; }
.ht-mhead { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid #eef1f6; font-size: 13.5px; }
.ht-x { color: #8a94a6; }
.ht-mbody { padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; font-size: 12px; }
.ht-mbody p { margin: 0; }
.ht-mfoot { padding: 8px 14px; border-top: 1px solid #eef1f6; }
.ht-mfoot > .ht-row { justify-content: flex-end; }
.ht-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ht-warn { color: #b91c1c; font-weight: 600; }
.ht-casc { display: flex; gap: 8px; align-items: center; background: #fef3c7; color: #78350f; padding: 7px 9px; border-radius: 6px; font-weight: 600; }
.ht-chk { width: 15px; height: 15px; border: 1.5px solid #92400e; border-radius: 3px; background: #fff; display: inline-flex; align-items: center; justify-content: center; }
.ht-chk.on::after { content: '✓'; font-size: 12px; color: #92400e; font-weight: 800; }
.ht-sec, .ht-sub { font-size: 10.5px; font-weight: 700; color: #6b7587; letter-spacing: .4px; }
.ht-comps { display: flex; flex-direction: column; gap: 4px; min-height: 30px; }
.ht-comp { display: flex; gap: 7px; align-items: center; padding: 5px 8px; border: 1px solid #e3e8f0; border-radius: 6px; font-size: 11px; animation: htSlide .35s ease-out; }
.ht-comp .ht-btn { padding: 2px 7px; font-size: 10.5px; }
.ht-n { color: #8a94a6; width: 12px; }
.ht-f { color: #1c5a8a; }
@keyframes htSlide { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.ht-hidden { display: none !important; }

/* menú clásico */
.ht-cm-head { display: flex; justify-content: space-between; font-weight: 700; color: #1c5a8a; }
.ht-menu { display: flex; flex-direction: column; gap: 3px; background: #fff; border: 1px solid #e3e8f0; border-radius: 8px; padding: 6px; }
.ht-mi { display: flex; gap: 8px; padding: 4px 8px; border-radius: 6px; font-size: 12px; transition: background .2s; }
.ht-mi b { color: #1c5a8a; width: 18px; }
.ht-mi i { margin-left: auto; color: #a0aabb; font-style: normal; }
.ht-mi.on, .ht-mi.ht-pressed { background: #1c5a8a; color: #fff; }
.ht-mi.on b, .ht-mi.ht-pressed b { color: #fff; }
.ht-keys { font-size: 11px; color: #6b7587; }
.ht-keys kbd { border: 1px solid #cfd6e1; border-radius: 4px; padding: 0 4px; background: #fff; font-size: 10px; }

/* presupuesto */
.ht-card { background: #fff; border: 1px solid #e3e8f0; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.ht-items { display: flex; flex-direction: column; gap: 4px; }
.ht-empty { color: #8a94a6; font-size: 11.5px; padding: 6px; text-align: center; }
.ht-it { display: flex; gap: 8px; align-items: center; padding: 5px 7px; border: 1px solid #eef1f6; border-radius: 6px; font-size: 11.5px; animation: htSlide .35s ease-out; }
.ht-it > span { flex: 1; }
.ht-tot { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 2px 18px; font-size: 12px; }
.ht-tot b { text-align: right; font-family: ui-monospace, Consolas, monospace; }
.ht-two { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; }
.ht-x2 { padding-bottom: 6px; color: #8a94a6; }
.ht-price { font: 800 22px system-ui; color: #1c5a8a; }
.ht-mats { display: flex; flex-direction: column; gap: 4px; }
.ht-mat { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 5px 7px; border: 1px solid #eef1f6; border-radius: 6px; font-size: 10.5px; animation: htSlide .35s ease-out; }
.ht-mat b { grid-column: 1 / -1; font-size: 11px; }
.ht-docs { display: flex; gap: 8px; }
.ht-doc { flex: 1; border: 1px solid #d5dbe5; border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.ht-doc.on { border-color: #1c5a8a; background: #eef5fb; }

/* fórmula */
.ht-fx { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; }
.ht-fx-win { position: relative; width: 300px; height: 240px; border: 7px solid #8899ad; background: linear-gradient(135deg, #e5f1fb, #cfe3f4); border-radius: 4px; display: flex; }
.ht-fx-sash { flex: 1; border: 4px solid #a9b6c6; margin: 6px; background: rgba(255,255,255,.35); }
.ht-fx-w { position: absolute; bottom: -30px; left: 0; right: 0; text-align: center; font: 700 13px system-ui; color: #1c5a8a; }
.ht-fx-h { position: absolute; right: -96px; top: 50%; font: 700 13px system-ui; color: #1c5a8a; transform: translateY(-50%); }
.ht-fx-piece { height: 18px; width: 0; background: #f5a524; border-radius: 3px; display: flex; align-items: center; justify-content: center;
  font: 700 11px system-ui; color: #4a2c00; transition: all .7s cubic-bezier(.4,0,.2,1); opacity: 0; white-space: nowrap; }
.ht-fx-piece.on { opacity: 1; }
.ht-fx-piece.v { width: 120px !important; height: 18px; background: #7c9cbf; color: #fff; }
.ht-fx-piece.g { width: 150px !important; height: 34px; background: #9fd0f0; color: #0f3554; }
.ht-fx-eq { font: 600 12.5px system-ui; color: #4a5568; background: #fff; padding: 7px 12px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.08); text-align: center; }
.ht-fx-calc { font: 800 22px ui-monospace, Consolas, monospace; color: #1c5a8a; min-height: 28px; }

/* notas: dibujo a mano */
.ht-canvas { background: #fff; border: 1px solid #e3e8f0; border-radius: 10px; height: 210px; }
.ht-canvas svg { width: 100%; height: 100%; }
.ht-canvas path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ht-ink { stroke: #d93025; stroke-width: 3.5; stroke-dasharray: 1400; stroke-dashoffset: 1400; }
.draw .ht-ink { animation: htDraw 1.6s ease-in-out forwards; }
@keyframes htDraw { to { stroke-dashoffset: 0; } }
.ht-clean { stroke: #2563eb; stroke-width: 4; opacity: 0; transition: opacity .6s; }
.clean .ht-clean { opacity: .9; }
.clean .ht-ink { opacity: .25; transition: opacity .6s; }
.ht-prev { min-height: 40px; font: 700 13px system-ui; color: #1c5a8a; opacity: 0; transform: translateY(6px); transition: all .4s; }
.ht-prev.on { opacity: 1; transform: none; }

/* más funciones */
.ht-more-wrap { position: absolute; inset: 0; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.ht-more-wrap h3 { margin: 0; font-size: 20px; color: #0f2a4a; }
.ht-more { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.ht-mcard { background: #fff; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #4a5568;
  box-shadow: 0 6px 16px rgba(20,35,60,.12); opacity: 0; transform: translateY(16px) scale(.96); transition: all .45s cubic-bezier(.2,.9,.3,1.2); }
.ht-mcard.on { opacity: 1; transform: none; }
.ht-mcard b { color: #0f2a4a; font-size: 12px; }
.ht-mi-ic { font-size: 22px; }

@media (max-width: 860px) {
  .ht-wrap { grid-template-columns: 1fr; }
  .ht-chapters { flex-direction: row; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
  .ht-chip { flex: 0 0 210px; scroll-snap-align: start; }
}
@media (max-width: 520px) {
  .ht-caption { font-size: 14.5px; }
  .ht-ctl { min-width: 40px; }
  .ht-player { padding: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .cm-howto-ic { animation: none; }
  .ht-layer *, .ht-intro, .ht-intro * { transition: none !important; animation: none !important; }
  .ht-ink { stroke-dashoffset: 0; }
}
