/* ============================================================
   Enciende y Grafica — hoja de estilo
   Dirección visual: cuaderno de papel milimetrado + serigrafía
   de instrumento. Azul de trazo Y1 como único acento.
   ============================================================ */

:root {
  /* Superficies y tinta (tema claro) */
  --paper:      #FBFAF7;
  --paper-2:    #FFFFFF;
  --paper-sunk: #F2F1EC;
  --grid:       #DFE8F1;
  --line:       #E2E0D9;
  --ink:        #16202B;
  --ink-soft:   #3A4855;
  --muted:      #5C6B7A;

  /* Acento: el verde fosforito de la serigrafía del teclado.
     --acc es el fosforito puro (rellenos grandes); --plot es la
     versión legible para texto y bordes sobre papel. */
  --acc:        #A3E635;
  --acc-ink:    #1B2E05;
  --plot:       #5F8F12;
  --plot-weak:  #F2FADF;
  --plot-line:  #D3EBA4;

  /* Serigrafía de teclas: azul 2nd, verde ALPHA (detalle real del teclado) */
  --silk-2nd:   #2E6FE0;
  --silk-alpha: #2E7D4F;

  /* Semánticos */
  --warm:       #B4522E;

  /* LCD: es un objeto físico, conserva su color en ambos temas */
  --lcd:        #C9D6C4;
  --lcd-dim:    #B4C3AE;
  --lcd-ink:    #172114;
  --lcd-ghost:  #8FA189;
  --shell:      #2B3440;
  --shell-2:    #1D242D;

  /* Tipografía */
  --display: "Geist", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --body: "Geist", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  /* la monoespaciada solo dibuja la calculadora: pantalla LCD y teclas */
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Métrica */
  --col: 38rem;
  --r-s: 6px;
  --r-m: 10px;
  --r-l: 16px;
  --r-card: 26px;

  /* material translúcido: superficies que dejan pasar la rejilla del fondo */
  --glass:      color-mix(in srgb, var(--paper-2) 64%, transparent);
  --glass-hi:   color-mix(in srgb, var(--paper-2) 84%, transparent);
  --glass-line: color-mix(in srgb, var(--ink) 9%, transparent);
  --blur:       saturate(180%) blur(20px);
  --lift:       0 1px 2px rgba(16, 24, 32, .03), 0 12px 32px -14px rgba(16, 24, 32, .16);
  --lift-hi:    0 1px 2px rgba(16, 24, 32, .04), 0 18px 40px -16px rgba(16, 24, 32, .22);
  --shadow-key: 0 1.5px 0 var(--line), 0 2px 4px rgba(22, 32, 43, .07);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #0E1620;
    --paper-2:    #141F2B;
    --paper-sunk: #0A121A;
    --grid:       #1B2A39;
    --line:       #22303E;
    --ink:        #E7EEF6;
    --ink-soft:   #C2CFDC;
    --muted:      #8A9BAC;
    --plot:       #6BA4FF;
    --plot-weak:  #142438;
    --plot-line:  #23436E;
    --silk-2nd:   #79AEFF;
    --silk-alpha: #64C08C;
    --warm:       #E0835F;
    --lcd:        #B9C7B4;
    --lcd-dim:    #A4B39E;
    --lcd-ink:    #141C12;
    --lcd-ghost:  #7C8E77;
    --shell:      #202932;
    --shell-2:    #151C24;
    --shadow-key: 0 1.5px 0 #0A121A, 0 2px 5px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  --paper:      #0E1620;
  --paper-2:    #141F2B;
  --paper-sunk: #0A121A;
  --grid:       #1B2A39;
  --line:       #22303E;
  --ink:        #E7EEF6;
  --ink-soft:   #C2CFDC;
  --muted:      #8A9BAC;
  --plot:       #6BA4FF;
  --plot-weak:  #142438;
  --plot-line:  #23436E;
  --silk-2nd:   #79AEFF;
  --silk-alpha: #64C08C;
  --warm:       #E0835F;
  --lcd:        #B9C7B4;
  --lcd-dim:    #A4B39E;
  --lcd-ink:    #141C12;
  --lcd-ghost:  #7C8E77;
  --shell:      #202932;
  --shell-2:    #151C24;
  --shadow-key: 0 1.5px 0 #0A121A, 0 2px 5px rgba(0, 0, 0, .35);
}

/* ---------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  min-height: 100%;
  background-color: var(--paper);
  /* Papel milimetrado: la rejilla de 22px es el fondo del cuaderno */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
}

body {
  margin: 0;
  min-height: 100dvh;
  /* columna: el contenido crece y la navegación cae al fondo de la pantalla */
  display: flex;
  flex-direction: column;
  background: transparent;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-synthesis-weight: none;
}

img, svg { max-width: 100%; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; text-wrap: balance; margin: 0; letter-spacing: -.016em; }

p { margin: 0; }

a { color: var(--plot); }

:focus-visible {
  outline: 2.5px solid var(--plot);
  outline-offset: 3px;
  border-radius: 3px;
}

.is-hidden { display: none !important; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------- idioma */

.topline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  margin-bottom: .9rem;
}

/* las tres rayitas se quedan pegadas a la izquierda aunque no haya X */
.topline .menu-btn { margin-inline-end: auto; }

.topline-right { display: flex; align-items: center; gap: .5rem; }

/* botones redondos de la barra superior */
.round-btn {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: var(--ink);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .12s;
}
.round-btn svg { width: 1.2rem; height: 1.2rem; }
.round-btn:hover { color: var(--plot); background: var(--glass-hi); }
.round-btn:active { transform: scale(.96); }

.lang {
  display: inline-flex;
  gap: .18rem;
  padding: .18rem;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
}

.lang-btn {
  font-family: var(--display);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .02em;
  padding: .36rem .78rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-on { background: var(--acc); color: var(--acc-ink); }

/* ---------------------------------------------------------- screens */

#main { width: 100%; max-width: var(--col); margin-inline: auto; padding: 1.6rem 1.15rem 2rem; flex: 1; }

.screen { display: none; }
.screen.is-on { display: block; animation: rise .32s cubic-bezier(.2,.7,.3,1) both; }

@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .6rem;
}

.display-xl { font-size: clamp(1.85rem, 7.5vw, 2.6rem); line-height: 1.07; }
.display-l  { font-size: clamp(1.55rem, 6vw, 2.05rem); line-height: 1.12; }

.lede { color: var(--ink-soft); margin-top: .85rem; max-width: 34ch; font-size: 1.0625rem; }

/* ---------------------------------------------------------- portada */

.home { text-align: center; padding-top: clamp(.5rem, 5vh, 3rem); }
.home-title { max-width: 15ch; margin-inline: auto; }
.home-lede { margin-inline: auto; }

.home-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  margin-top: 2.1rem;
}
.btn-big { font-size: 1.06rem; padding: 1rem 2.4rem; }

/* variante A: acceso secundario al convertidor */

.home-tool {
  display: flex;
  align-items: center;
  gap: .85rem;
  width: 100%;
  max-width: 23rem;
  margin: 2.8rem auto 0;
  padding: .85rem 1rem;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  transition: border-color .18s, transform .12s;
}
.home-tool:hover { border-color: var(--plot-line); }
.home-tool:active { transform: translateY(1px); }

.home-tool-txt { display: flex; flex-direction: column; min-width: 0; }
.home-tool-t { font-family: var(--display); font-weight: 600; font-size: .96rem; line-height: 1.3; }
.home-tool-s { font-size: .84rem; line-height: 1.35; color: var(--muted); }
.home-tool-go { margin-left: auto; flex: none; font-family: var(--mono); color: var(--muted); }

/* botones del menú principal */

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  margin-top: 2.3rem;
}

.btn-big {
  font-size: 1.04rem;
  padding: 1.05rem 1.5rem;
  gap: .85rem;
}

/* anchos fijos: el secundario, un punto más estrecho que el principal */
.actions .btn-big { min-width: 15.75rem; max-width: 100%; }
.home .actions .btn-quiet.btn-big { width: 14.25rem; min-width: 0; }

/* iconos a pelo: ni fondo, ni borde, ni círculo */
.btn-go,
.btn-ico { display: inline-flex; flex: none; }
.btn-go svg { width: 1.15rem; height: 1.15rem; }
.btn-ico svg { width: 1.3rem; height: 1.3rem; }
.btn-go-back svg { transform: rotate(180deg); }

.quiet-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  margin-top: 1.4rem;
}
.quiet-links .btn {
  display: inline;                 /* si fuese flex, el gap partiría el subrayado */
  padding: .4rem .5rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 0;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--muted) 38%, transparent);
}
.quiet-links .btn:hover { color: var(--ink); text-decoration-color: currentColor; }

.cta-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }

.btn {
  font-family: var(--display);
  font-weight: 600;
  font-size: .97rem;
  padding: .82rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  transition: transform .12s, background-color .18s, border-color .18s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--acc);
  color: var(--acc-ink);
  box-shadow: 0 1px 2px rgba(16, 24, 32, .04), 0 10px 24px -12px color-mix(in srgb, var(--plot) 70%, transparent);
}
.btn-primary:hover { background: color-mix(in srgb, var(--acc) 88%, #000); }

.btn-ghost,
.btn-quiet {
  color: var(--ink-soft);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-color: var(--glass-line);
}
.btn-ghost:hover,
.btn-quiet:hover { background: var(--glass-hi); color: var(--ink); }
.btn-quiet { color: var(--ink); font-size: .92rem; padding: .7rem 1.15rem; }

/* ---------------------------------------------------------- paso */

.step-title { font-size: clamp(1.6rem, 6.2vw, 2.05rem); line-height: 1.12; }
.step-body { color: var(--ink-soft); margin-top: .8rem; max-width: 36ch; }
.step-body b { font-family: var(--mono); font-weight: 600; font-size: .92em; color: var(--ink); }

/* El truco: anotación al margen, como en un cuaderno */
.tip {
  display: flex;
  gap: .85rem;
  margin-top: 2.1rem;
  padding: .1rem 0;
}
.tip-l {
  font-family: var(--display);
  font-size: .82rem;
  font-weight: 600;
  color: var(--plot);
  flex: none;
  padding-top: .12rem;
}
.tip-t { font-size: .95rem; color: var(--ink-soft); }

/* ---------------------------------------------------------- acciones del paso
   Los controles que hay que tocar, en orden. Sustituyen a la pantalla. */

.acts {
  display: grid;
  margin-top: 2rem;
}

/* Apuntes sobre la hoja: sin cajas, solo el reglado */
.act {
  display: grid;
  grid-template-columns: 3.6rem 1fr;
  align-items: center;
  gap: 1.2rem;
  padding: 1.25rem .2rem;
}

.act-art { display: grid; place-items: center; }

.act-txt { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.act-ord {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.act-lab { font-family: var(--display); font-weight: 600; font-size: 1rem; line-height: 1.25; color: var(--ink); }
.act-sub { font-size: .88rem; color: var(--muted); line-height: 1.4; }

/* Nota al pie de una acción, marcada con asterisco */
.act-note {
  display: flex;
  gap: .4rem;
  margin-top: .5rem;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--plot);
}
.act-note::before { content: "*"; flex: none; }

/* Las teclas usan la misma pastilla que el interruptor (.sw),
   con el nombre dentro del pulsador verde. */

/* Interruptor lateral: pastilla alargada con el pulsador abajo, encendido */
.sw {
  width: 2.7rem;
  height: 1.45rem;
  padding: .18rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: flex-end;    /* pulsador a la derecha: encendido */
}

/* variante vertical: el interruptor del lateral, con la pestaña abajo */
.sw.vert {
  width: 1.45rem;
  height: 2.7rem;
  flex-direction: column;
}

.sw i {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--acc);
}

/* ---------------------------------------------------------- el aparato */

.device { margin-top: 1.4rem; }

.device-screen {
  background: linear-gradient(var(--shell), var(--shell-2));
  border-radius: var(--r-l);
  padding: .7rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 18px rgba(22,32,43,.16);
}

.lcd {
  background: var(--lcd);
  border-radius: var(--r-s);
  min-height: 10.5rem;
  padding: .6rem .7rem;
  font-family: var(--mono);
  font-size: .85rem;
  line-height: 1.45;
  color: var(--lcd-ink);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), inset 0 2px 7px rgba(0,0,0,.14);
  transition: background-color .25s;
}
.lcd[data-off="true"] { background: var(--lcd-dim); color: transparent; }

.lcd-line { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.lcd-line.right { text-align: right; }
.lcd-line.ghost { color: var(--lcd-ghost); }
.lcd-line.inv { background: var(--lcd-ink); color: var(--lcd); display: inline-block; padding: 0 .2em; }

.caret {
  display: inline-block;
  width: .58em; height: 1.05em;
  background: var(--lcd-ink);
  vertical-align: -.18em;
  animation: blink 1.06s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.lcd-graph { display: block; width: 100%; height: 9.3rem; }
.lcd-status {
  position: absolute;
  left: .7rem; right: .7rem; bottom: .45rem;
  font-size: .76rem;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}

.lcd-table { width: 100%; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
.lcd-table th, .lcd-table td { text-align: right; padding: .07rem .4rem; }
.lcd-table th { font-weight: 500; border-bottom: 1px solid var(--lcd-ink); }
.lcd-table tr.hl td { background: var(--lcd-ink); color: var(--lcd); }

.device-caption {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .04em;
  color: var(--muted);
  margin-top: .55rem;
  text-align: center;
}

/* secuencia de teclas */

.keys-block { margin-top: 1rem; }

.keys-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .55rem;
}
.keys-label {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted);
}
.replay {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .04em;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink-soft);
  border-radius: var(--r-s);
  padding: .28rem .55rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.replay:hover { border-color: var(--plot-line); color: var(--plot); }

.keys { display: flex; flex-wrap: wrap; align-items: stretch; gap: .38rem; }

.key {
  --key-face: var(--paper-2);
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 2.7rem;
  padding: .3rem .42rem .32rem;
  background: var(--key-face);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-key);
  font-family: var(--mono);
  transition: transform .13s, background-color .13s, border-color .13s, box-shadow .13s;
}
.key-main { font-size: .78rem; font-weight: 500; line-height: 1.25; color: var(--ink); white-space: nowrap; }
.key-second {
  font-size: .56rem;
  line-height: 1;
  letter-spacing: .02em;
  color: var(--silk-2nd);
  margin-bottom: .16rem;
  white-space: nowrap;
}
.key[data-silk="alpha"] .key-second { color: var(--silk-alpha); }
.key-sm { min-width: 0; transform: translateY(-1px); }

.key.is-lit {
  background: var(--plot);
  border-color: var(--plot);
  box-shadow: 0 0 0 4px var(--plot-weak), 0 2px 4px rgba(31,95,214,.3);
  transform: translateY(1.5px);
}
.key.is-lit .key-main { color: #fff; }
.key.is-lit .key-second { color: color-mix(in srgb, #fff 72%, var(--plot)); }

.key.is-used { border-color: var(--plot-line); background: var(--plot-weak); }
.key.is-used .key-main { color: var(--plot); }

.key-arrow { color: var(--muted); align-self: center; font-size: .8rem; padding-inline: .05rem; }

/* ---------------------------------------------------------- cierre */

/* ---------------------------------------------------------- reseña */

.hint-card {
  margin-top: 1.6rem;
  padding: 1.25rem 1.35rem;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-card);
}
.hint-title {
  font-family: var(--display);
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .75rem;
}
.hint-list { margin: 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.hint-list li {
  position: relative;
  padding-left: 1.1rem;
  font-size: .94rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
/* viñeta propia: un punto del verde de la marca, alineado con la primera línea */
.hint-list li::before {
  content: "";
  position: absolute;
  left: .1rem;
  top: .58em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--plot);
}

.fineprint { font-size: .82rem; color: var(--muted); margin-top: .9rem; line-height: 1.5; }

.form { display: grid; gap: .9rem; margin-top: 1.4rem; }
.field { display: grid; gap: .32rem; }
.field-l { font-family: var(--display); font-size: .88rem; font-weight: 600; color: var(--ink); }
.opt { font-weight: 400; color: var(--muted); }
.field select, .field input, .field textarea {
  font: inherit;
  font-size: 16px;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--paper-2);
  color: var(--ink);
  width: 100%;
  resize: vertical;
}
.field select:focus, .field input:focus, .field textarea:focus { border-color: var(--plot); outline: none; box-shadow: 0 0 0 3px var(--plot-weak); }
.field textarea::placeholder, .field input::placeholder { color: var(--muted); opacity: .75; }

.sent-note {
  margin-top: 1rem;
  padding: .9rem 1rem;
  border-radius: var(--r-m);
  background: var(--plot-weak);
  border: 1px solid var(--plot-line);
  font-size: .95rem;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------- nav inferior */

.stepnav {
  position: sticky;
  bottom: 0;
  width: 100%;
  max-width: var(--col);
  margin: auto auto 0;              /* empujada al fondo de la pantalla */
  padding: 1.15rem 1.15rem calc(1.4rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 74%, transparent);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  border-top: 1px solid var(--line);
}
.stepnav[hidden] { display: none; }

.nav-btn {
  font-family: var(--display);
  font-weight: 600;
  font-size: .95rem;
  padding: .6rem .1rem;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  transition: color .18s;
}
.nav-btn:hover:not(:disabled) { color: var(--ink); }
.nav-btn:disabled { opacity: .3; cursor: default; }

.nav-btn-primary {
  background: var(--acc);
  color: var(--acc-ink);
  padding: .7rem 1.35rem;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(16, 24, 32, .04), 0 10px 24px -12px color-mix(in srgb, var(--plot) 70%, transparent);
}
.nav-btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--acc) 88%, #000); color: var(--acc-ink); }

.nav-count { font-family: var(--display); font-size: .85rem; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); }
.nav-sep { opacity: .5; margin-inline: .12em; }

/* ---------------------------------------------------------- responsive */

@media (min-width: 46rem) {
  :root { --col: 44rem; }
  #main { padding-top: 2.4rem; }
  .lcd { min-height: 12rem; }
  .lcd-graph { height: 10.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .caret { animation: none; }
}

/* ---------------------------------------------------------- pantalla y teclas */

/* Mini pantalla: dos líneas, como la de la calculadora */
.lcdbox {
  margin-top: 1.7rem;
  padding: 1rem 1.15rem 1.1rem;
  background: var(--lcd);
  border-radius: var(--r-m);
  font-family: var(--mono);
  color: var(--lcd-ink);
  display: grid;
  gap: .3rem;
}
.lcd-expr { font-size: 1rem; letter-spacing: .04em; opacity: .7; }
.lcd-res {
  font-size: 2rem;
  line-height: 1.1;
  text-align: right;
  font-variant-numeric: tabular-nums;
  animation: lcdIn .45s .35s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes lcdIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Tecla: misma receta que el botón Siguiente */
.ky {
  display: inline-grid;
  place-items: center;
  min-width: 2.15rem;
  padding: .42rem .7rem;
  background: var(--acc);
  color: var(--acc-ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: .92rem;
  line-height: 1;
}

/* Secuencia de teclas */
.seq { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.seq-l {
  font-family: var(--display);
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.8rem 0 .7rem;
}

@media (prefers-reduced-motion: reduce) { .lcd-res { animation: none; } }

/* ---------------------------------------------------------- menú lateral */

.drawer-veil {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--ink) 20%, transparent);
  animation: veil-in .3s cubic-bezier(.16,1,.3,1) both;
}
@keyframes veil-in { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  z-index: 41;
  inset-block: 0;
  inset-inline-start: 0;
  width: min(19.5rem, 86vw);
  display: flex;
  flex-direction: column;
  padding: 1.55rem 1.6rem calc(1.6rem + env(safe-area-inset-bottom));
  background: var(--paper);
  border-inline-end: 1px solid var(--line);
  animation: drawer-in .34s cubic-bezier(.16,1,.3,1) both;
}
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: none; } }

/* la X ocupa el sitio de las tres rayitas que la abrieron */
.drawer-x {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  margin: -.3rem 0 0 -.45rem;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color .18s;
}
.drawer-x svg { width: 1.05rem; height: 1.05rem; }
.drawer-x:hover { color: var(--ink); }

/* lista: solo texto y filetes, sin cajas ni iconos */
.drawer-nav { display: flex; flex-direction: column; margin-top: 2.4rem; }

.drawer-link {
  display: block;
  width: 100%;
  padding: 1.05rem 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.02rem;
  line-height: 1.3;
  letter-spacing: -.011em;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: color .18s;
}
.drawer-link:first-child { border-top: 1px solid var(--line); }
.drawer-link:hover { color: var(--plot); }

.drawer-foot {
  margin-top: auto;
  padding: 1.05rem 0 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: .9rem;
  letter-spacing: -.006em;
  color: var(--muted);
  text-align: left;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: color .18s;
}
.drawer-foot:hover { color: var(--ink); }

/* ---------------------------------------------------------- tacto de app */

/* nada de seleccionar texto al tocar un control */
.btn,
.round-btn,
.nav-btn,
.lang-btn,
.drawer-link,
.drawer-foot { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }

@media (prefers-reduced-motion: reduce) {
  .btn, .round-btn { transition: none; }
}
