/* =============================================================
   CORE C12 — Hoja de estilos principal
   Versión: 1.0
   Descripción: Layout completo, sin frameworks, sin lógica JS
   ============================================================= */


/* ─────────────────────────────────────────────
   VARIABLES GLOBALES
   ───────────────────────────────────────────── */

:root {
  /* Fondos */
  --bg-app:          #1A1A1A;
  --bg-display:      #0D0D0D;
  --bg-branding:     #111111;

  /* Botones */
  --bg-btn-digit:    #2A2A2A;
  --bg-btn-control:  #2E2018;
  --bg-btn-ac:       #3D1F1F;
  --bg-btn-special:  #1E1E1E;
  --bg-btn-equals:   #1A3A5C;

  /* Colores de acento */
  --color-iva:       #F5C518;
  --color-margin:    #E07000;

  /* Texto */
  --color-text:      #FFFFFF;
  --color-text-dim:  rgba(255, 255, 255, 0.60);
  --color-sep:       rgba(255, 255, 255, 0.10);

  /* Geometría */
  --gap-btn:         4px;
  --radius-btn:      6px;
  --radius-btn-sm:   5px;
  --radius-block:    8px;
  --pad-block:       8px;
  --pad-workspace:   6px;

  /* Tipografía */
  --font-ui:         -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-display:    'Courier New', 'Lucida Console', monospace;
}


/* ─────────────────────────────────────────────
   RESET Y BASE
   ───────────────────────────────────────────── */

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

html {
  height: 100%;
  height: -webkit-fill-available; /* iOS Safari: viewport real sin chrome */
  width: 100%;
}

body {
  height: 100%;
  min-height: -webkit-fill-available;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  font-family: var(--font-ui);
  color: var(--color-text);
  -webkit-text-size-adjust: 100%;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}


/* ─────────────────────────────────────────────
   CONTENEDOR PRINCIPAL
   ───────────────────────────────────────────── */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;  /* iOS 15.4+: dynamic viewport, excluye chrome del navegador */
  width: 100vw;
  overflow: hidden;
}


/* ─────────────────────────────────────────────
   BANDA 1 — BRANDING
   Altura: 6vh
   ───────────────────────────────────────────── */

.branding {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  height: 6vh;
  min-height: 20px;
  padding: 0 14px;
  background-color: var(--bg-branding);
  border-bottom: 1px solid var(--color-sep);
}

.branding__name {
  font-family: var(--font-ui);
  font-size: clamp(11px, 1.8vh, 15px);
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--color-text);
  text-transform: uppercase;
  flex-shrink: 0;
}

.branding__powered {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  flex: 0 1 auto;
  opacity: 0.96;
}

.branding__powered img {
  display: block;
  width: auto;
  height: clamp(24px, 4.2vh, 34px);
  max-width: clamp(190px, 42vw, 330px);
  object-fit: contain;
}


/* ─────────────────────────────────────────────
   BANDA 2 — DISPLAY PRINCIPAL
   Altura: 21vh (número + statusbar + detalle)
   ───────────────────────────────────────────── */

.display {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  flex-shrink: 0;
  height: clamp(96px, 23vh, 150px);
  min-height: 90px;
  padding: 7px 16px 9px;
  gap: 3px;
  background-color: var(--bg-display);
  border-bottom: 1px solid var(--color-sep);
}

/* Número principal */
.display__number {
  font-family: var(--font-display);
  font-size: clamp(40px, 7.1vh, 76px);
  font-weight: 300;
  color: var(--color-text);
  text-align: right;
  line-height: 0.95;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  flex-shrink: 0;
}

/* Fila: estado abreviado (izq) + selector decimales (der) */
.display__statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: clamp(18px, 2.6vh, 24px);
  flex-shrink: 0;
  margin-top: 5px;   /* separa el selector del número principal */
}

/* Estado abreviado — Línea 1 */
.display__status {
  font-family: var(--font-display);
  font-size: clamp(10px, 1.7vh, 13px);
  font-weight: 600;
  text-align: left;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: transparent;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  transition: color 150ms ease;
}

.display__status.is-visible {
  color: var(--color-iva);
}

/* Selector de decimales */
.display__decimals {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  margin-left: 8px;
}

.btn--decimal {
  width: 26px;
  height: 26px;
  padding: 0 5px;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.25);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 100ms ease, background-color 100ms ease, border-color 100ms ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
  outline: none;
}

.btn--decimal.is-active {
  background-color: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 1);
}

.btn--decimal:active {
  background-color: rgba(255, 255, 255, 0.10);
}

@media (hover: hover) {
  .btn--decimal:hover {
    background-color: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.55);
  }
  .btn--decimal.is-active:hover {
    background-color: rgba(255, 255, 255, 0.24);
    color: rgba(255, 255, 255, 1);
  }
}

/* Detalle de operación — Línea 2 */
.display__detail {
  font-family: var(--font-display);
  font-size: clamp(11px, 1.7vh, 14px);
  font-weight: 400;
  text-align: left;
  color: transparent;
  letter-spacing: 0;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  min-height: clamp(13px, 2vh, 17px);
  flex-shrink: 0;
  transition: color 150ms ease;
}

.display__detail.is-visible {
  color: rgba(255, 255, 255, 0.62);
}


/* ─────────────────────────────────────────────
   BANDA 3 — ÁREA DE TRABAJO
   Altura: flex restante (~78vh)
   ───────────────────────────────────────────── */

.workspace {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;              /* permite que flex-children no desborden */
  min-width: 0;
  padding: var(--pad-workspace);
  gap: var(--pad-workspace);
  overflow: hidden;
}


/* ─────────────────────────────────────────────
   COLUMNA IZQUIERDA — 38%
   Funciones especiales: IVA + Márgenes
   ───────────────────────────────────────────── */

.col-left {
  width: 38%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--pad-workspace);
  min-height: 0;
  min-width: 0;
}

/* Bloque genérico (IVA o Márgenes) */
.special-block {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: var(--radius-block);
  padding: var(--pad-block);
  padding-top: calc(var(--pad-block) + 6px);  /* espacio extra para la etiqueta */
}

.special-block--iva {
  border: 1px solid var(--color-iva);
}

.special-block--margin {
  border: 1px solid var(--color-margin);
}

/* Etiqueta flotante sobre el borde */
.special-block__label {
  position: absolute;
  top: -7px;
  left: 10px;
  font-family: var(--font-ui);
  font-size: clamp(8px, 1.2vh, 10px);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1;
  padding: 0 5px;
  background-color: var(--bg-app);   /* corta el borde visualmente */
}

.special-block--iva .special-block__label {
  color: var(--color-iva);
}

.special-block--margin .special-block__label {
  color: var(--color-margin);
}

/* Grid interior del bloque: 3 col × 2 filas */
.special-block__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, 1fr);
  gap: var(--gap-btn);
  flex: 1;
  min-height: 0;
  min-width: 0;
}


/* ─────────────────────────────────────────────
   COLUMNA DERECHA — 62%
   Calculadora base — Grid 4 col × 6 filas
   ───────────────────────────────────────────── */

.col-right {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  /*
    5 filas iguales (1fr) + fila = (1.2fr → 120% del base)
    Fila 1: C  AC  +/−  %
    Fila 2: 7  8   9    ÷
    Fila 3: 4  5   6    ×
    Fila 4: 1  2   3    −
    Fila 5: 0(×2)  .    +
    Fila 6: =  =   =    =  (span 4 cols)
  */
  grid-template-rows: repeat(5, 1fr) 1.2fr;
  gap: var(--gap-btn);
}

/* Botón 0: ocupa 2 columnas */
.btn--zero {
  grid-column: span 2;
}

/* Botón =: ocupa las 4 columnas de la fila 6 */
.btn--equals {
  grid-column: span 4;
}


/* ─────────────────────────────────────────────
   BOTONES — BASE COMÚN
   ───────────────────────────────────────────── */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  border-radius: var(--radius-btn);
  font-family: var(--font-ui);
  font-weight: 600;
  line-height: 1;
  color: var(--color-text);
  background-color: var(--bg-btn-digit);
  transition:
    background-color 60ms ease,
    transform       60ms ease,
    box-shadow      60ms ease;
  position: relative;
  overflow: hidden;
}

/* Efecto táctil rápido (sin delay perceptible) */
.btn:active {
  background-color: #444444;
  transform: scale(0.95);
}


/* ─────────────────────────────────────────────
   TIPOS DE BOTÓN — Calculadora base
   ───────────────────────────────────────────── */

/* Dígitos: 0–9 y punto decimal */
.btn--digit {
  background-color: var(--bg-btn-digit);
  font-size: clamp(16px, 3vh, 23px);
  font-weight: 650;
}

/* Operadores: ÷ × − + */
.btn--operator {
  background-color: var(--bg-btn-digit);
  font-size: clamp(19px, 3.5vh, 27px);
  font-weight: 600;
}

.btn--operator:active {
  background-color: #444444;
}

/* Control: C, AC, +/−, % */
.btn--control {
  background-color: var(--bg-btn-control);
  font-size: clamp(12px, 2.2vh, 17px);
  font-weight: 650;
  letter-spacing: 0.3px;
}

.btn--control:active {
  background-color: #4A3520;
}

/* AC: más saturado para indicar destructivo */
.btn--ac {
  background-color: var(--bg-btn-ac);
}

.btn--ac:active {
  background-color: #5A2A2A;
}

/* Botón = : dominante, color diferenciado */
.btn--equals {
  background-color: var(--bg-btn-equals);
  font-size: clamp(21px, 4vh, 32px);
  font-weight: 700;
  letter-spacing: 1.5px;
  border-radius: var(--radius-btn);
}

.btn--equals:active {
  background-color: #102840;
  transform: scale(0.97);
}


/* ─────────────────────────────────────────────
   TIPOS DE BOTÓN — Funciones especiales
   ───────────────────────────────────────────── */

/* Base común para IVA y Márgenes */
.btn--special {
  background-color: var(--bg-btn-special);
  font-size: clamp(11px, 1.9vh, 15px);
  font-weight: 600;
  border-radius: var(--radius-btn-sm);
  line-height: 1.1;
  text-align: center;
}

.btn--special:active {
  background-color: #2E2E2E;
  transform: scale(0.95);
}

/* Botones IVA */
.btn--iva {
  /* hereda de btn--special */
}

/* Botones Márgenes */
.btn--margin {
  /* hereda de btn--special */
}

/* Estado activo: último margen pulsado (JS añade .is-active) */
.btn--margin.is-active {
  background-color: #241200;
  border: 1px solid var(--color-margin);
  color: var(--color-margin);
}


/* ─────────────────────────────────────────────
   ESTADOS HOVER (escritorio / iPad con ratón)
   ───────────────────────────────────────────── */

@media (hover: hover) {
  .btn--digit:hover,
  .btn--operator:hover {
    background-color: #363636;
  }

  .btn--control:hover {
    background-color: #3E2D1E;
  }

  .btn--ac:hover {
    background-color: #4A2828;
  }

  .btn--equals:hover {
    background-color: #1F4570;
  }

  .btn--special:hover {
    background-color: #282828;
  }

  .btn--margin.is-active:hover {
    background-color: #301800;
  }
}


/* ─────────────────────────────────────────────
   AVISO PORTRAIT (orientación vertical)
   ───────────────────────────────────────────── */

.portrait-warning {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: #0D0D0D;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  padding: 32px;
}

.portrait-warning__icon {
  font-size: 52px;
  opacity: 0.5;
  animation: rotate-hint 2s ease-in-out infinite;
}

@keyframes rotate-hint {
  0%, 100% { transform: rotate(0deg);   }
  50%       { transform: rotate(90deg);  }
}

.portrait-warning__text {
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-dim);
  line-height: 1.7;
}


/* ─────────────────────────────────────────────
   RESPONSIVE — Móvil landscape (≤ 767px)
   Sin vh. Branding y display con px fijos.
   Workspace toma el espacio restante con flex.
   ───────────────────────────────────────────── */

@media (max-width: 767px) and (orientation: landscape) {
  :root {
    --gap-btn:       3px;
    --pad-block:     5px;
    --pad-workspace: 4px;
  }

  /* Safe area: notch y barra home en iPhone */
  .app {
    padding-left:   env(safe-area-inset-left,   0px);
    padding-right:  env(safe-area-inset-right,  0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Branding: altura fija mínima, sin vh */
  .branding {
    height: 26px;
    min-height: 26px;
    padding: 0 10px;
    gap: 8px;
  }

  .branding__name {
    font-size: 11px;
    letter-spacing: 1.5px;
  }

  .branding__powered {
    opacity: 0.94;
  }

  .branding__powered img {
    height: 23px;
    max-width: 205px;
  }

  /* Display: altura automática por contenido, sin vh */
  .display {
    height: auto;
    min-height: unset;
    padding: 5px 12px 6px;
    gap: 2px;
    flex-shrink: 0;
  }

  /* Número: tamaño fijo, no depende de vh */
  .display__number {
    font-size: 42px;
    letter-spacing: 0;
  }

  .display__statusbar {
    margin-top: 4px;
    min-height: 22px;
  }

  .display__status {
    font-size: 10px;
    letter-spacing: 1px;
  }

  .display__detail {
    font-size: 10px;
    min-height: 12px;
  }

  .btn--decimal {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }

  /* Botones especiales: texto más ajustado en pantalla pequeña */
  .btn--special {
    font-size: 11px;
  }

  /* Botones base: tamaño de fuente fijo */
  .btn--digit    { font-size: 18px; }
  .btn--operator { font-size: 21px; }
  .btn--control  { font-size: 13px; }
  .btn--equals   { font-size: 23px; }
}

/* Móvil landscape bajo: prioriza teclado táctil y evita compresión vertical */
@media (max-width: 767px) and (orientation: landscape) and (max-height: 380px) {
  :root {
    --gap-btn:       3px;
    --pad-block:     4px;
    --pad-workspace: 3px;
  }

  .branding {
    height: 24px;
    min-height: 24px;
  }

  .display {
    padding: 4px 10px 5px;
    gap: 1px;
  }

  .display__number {
    font-size: 38px;
  }

  .display__statusbar {
    min-height: 20px;
    margin-top: 2px;
  }

  .display__status {
    font-size: 9px;
  }

  .display__detail {
    font-size: 9px;
    min-height: 11px;
  }

  .btn--decimal {
    width: 20px;
    height: 20px;
    font-size: 9px;
  }

  .special-block {
    padding-top: calc(var(--pad-block) + 5px);
  }

  .special-block__label {
    top: -6px;
    font-size: 8px;
    letter-spacing: 1.5px;
  }

  .btn--special {
    font-size: 10px;
    line-height: 1.05;
  }

  .btn--digit    { font-size: 17px; }
  .btn--operator { font-size: 20px; }
  .btn--control  { font-size: 12px; }
  .btn--equals   { font-size: 22px; }
}

/* Móvil landscape alto: aprovecha aire adicional sin cambiar estructura */
@media (max-width: 767px) and (orientation: landscape) and (min-height: 430px) {
  :root {
    --gap-btn:       4px;
    --pad-block:     6px;
    --pad-workspace: 5px;
  }

  .display {
    padding: 6px 14px 7px;
  }

  .display__number {
    font-size: 46px;
  }

  .display__detail {
    font-size: 11px;
    min-height: 13px;
  }

  .btn--special {
    font-size: 12px;
  }
}

/* Portrait: app funcional en vertical, sin bloqueo de uso */
@media (orientation: portrait) {
  :root {
    --gap-btn:       5px;
    --pad-block:     8px;
    --pad-workspace: 8px;
  }

  .portrait-warning {
    display: none;
  }

  .app {
    display: flex;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top:    env(safe-area-inset-top,    0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .branding {
    height: 34px;
    min-height: 34px;
    padding: 0 12px;
    gap: 8px;
  }

  .branding__name {
    font-size: 12px;
    letter-spacing: 1.8px;
  }

  .branding__powered {
    opacity: 0.94;
  }

  .branding__powered img {
    height: 25px;
    max-width: 220px;
  }

  .display {
    height: clamp(116px, 18dvh, 145px);
    min-height: 112px;
    padding: 8px 14px 9px;
    gap: 3px;
  }

  .display__number {
    font-size: clamp(46px, 8.4dvh, 68px);
  }

  .display__statusbar {
    min-height: 23px;
    margin-top: 4px;
  }

  .display__status {
    font-size: 10px;
  }

  .display__detail {
    font-size: 11px;
    min-height: 13px;
  }

  .workspace {
    width: calc(100vw - (var(--pad-workspace) * 2));
    max-width: 100%;
    flex: 1 0 auto;
    flex-direction: column;
    overflow: visible;
  }

  .col-left {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    flex: 0 0 auto;
    gap: var(--pad-workspace);
  }

  .special-block,
  .special-block__grid {
    max-width: 100%;
  }

  .special-block {
    flex: 0 0 auto;
    min-height: 88px;
  }

  .special-block__label {
    font-size: 8px;
    letter-spacing: 1.7px;
  }

  .btn--special {
    font-size: 11px;
    line-height: 1.05;
  }

  .col-right {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    flex: 0 0 clamp(360px, 52dvh, 430px);
  }

  .btn--digit    { font-size: 22px; }
  .btn--operator { font-size: 25px; }
  .btn--control  { font-size: 14px; }
  .btn--equals   { font-size: 26px; }
}

/* Móvil portrait bajo: mantiene todo accesible con desplazamiento mínimo */
@media (max-width: 767px) and (orientation: portrait) {
  .workspace {
    width: 100vw;
    max-width: 100vw;
    padding-left: var(--pad-workspace);
    padding-right: var(--pad-workspace);
  }

  .col-left,
  .col-right {
    width: calc(100vw - (var(--pad-workspace) * 2));
    max-width: calc(100vw - (var(--pad-workspace) * 2));
  }

  .special-block__grid {
    grid-template-columns: repeat(3, calc((100vw - (var(--pad-workspace) * 2) - (var(--pad-block) * 2) - (var(--gap-btn) * 2) - 2px) / 3));
  }

  .col-right {
    grid-template-columns: repeat(4, calc((100vw - (var(--pad-workspace) * 2) - (var(--gap-btn) * 3)) / 4));
  }
}

/* Móvil portrait bajo: mantiene todo accesible con desplazamiento mínimo */
@media (max-width: 767px) and (orientation: portrait) and (max-height: 720px) {
  :root {
    --gap-btn:       4px;
    --pad-block:     6px;
    --pad-workspace: 6px;
  }

  .branding {
    height: 30px;
    min-height: 30px;
  }

  .display {
    height: 108px;
    min-height: 108px;
    padding: 6px 12px 7px;
  }

  .display__number {
    font-size: 42px;
  }

  .display__statusbar {
    min-height: 21px;
    margin-top: 2px;
  }

  .display__detail {
    font-size: 10px;
    min-height: 12px;
  }

  .special-block {
    min-height: 78px;
  }

  .btn--special {
    font-size: 10px;
  }

  .col-right {
    flex-basis: 340px;
  }

  .btn--digit    { font-size: 20px; }
  .btn--operator { font-size: 23px; }
  .btn--control  { font-size: 13px; }
  .btn--equals   { font-size: 24px; }
}

/* iPad portrait: módulos comerciales en paralelo y teclado más amplio */
@media (min-width: 768px) and (orientation: portrait) {
  :root {
    --gap-btn:       7px;
    --pad-block:     12px;
    --pad-workspace: 10px;
  }

  .branding {
    height: 44px;
    min-height: 44px;
    padding: 0 22px;
    gap: 14px;
  }

  .branding__powered img {
    height: 34px;
    max-width: 320px;
  }

  .display {
    height: clamp(145px, 17dvh, 180px);
    padding: 10px 24px 12px;
  }

  .display__number {
    font-size: clamp(64px, 7.6dvh, 82px);
  }

  .workspace {
    gap: 10px;
    padding: 10px;
  }

  .col-left {
    flex-direction: row;
    gap: 10px;
  }

  .special-block {
    flex: 1 1 0;
    min-height: 180px;
  }

  .special-block__label {
    font-size: 10px;
  }

  .btn--special {
    font-size: 15px;
  }

  .col-right {
    flex: 1 0 540px;
  }

  .btn--digit    { font-size: 28px; }
  .btn--operator { font-size: 32px; }
  .btn--control  { font-size: 18px; }
  .btn--equals   { font-size: 34px; }
}


/* ─────────────────────────────────────────────
   RESPONSIVE — iPad landscape (768px–1180px)
   ───────────────────────────────────────────── */

@media (min-width: 768px) and (orientation: landscape) {
  :root {
    --gap-btn:       6px;
    --pad-block:     12px;
    --pad-workspace: 8px;
  }

  .branding {
    padding: 0 20px;
  }

  .display {
    padding: 8px 22px 10px;
    gap: 3px;
  }
}

/* Mobile landscape ancho: separa el header de bordes/notch sin alterar la UI */
@media (min-width: 768px) and (max-height: 500px) and (orientation: landscape) {
  .branding {
    padding-left: calc(env(safe-area-inset-left, 0px) + 28px);
    padding-right: calc(env(safe-area-inset-right, 0px) + 28px);
  }
}

/* iPad landscape bajo / tablets compactas: protege la altura del teclado */
@media (min-width: 768px) and (max-width: 1180px) and (orientation: landscape) and (max-height: 700px) {
  .display {
    height: clamp(104px, 21vh, 132px);
    min-height: 96px;
    padding: 6px 20px 8px;
  }

  .display__number {
    font-size: clamp(42px, 6.4vh, 64px);
  }

  .display__statusbar {
    min-height: clamp(18px, 2.4vh, 22px);
  }

  .display__detail {
    font-size: clamp(11px, 1.6vh, 13px);
    min-height: clamp(13px, 1.8vh, 16px);
  }
}


/* ─────────────────────────────────────────────
   RESPONSIVE — Escritorio grande (> 1200px)
   Centra y limita el ancho para no distorsionar
   ───────────────────────────────────────────── */

@media (min-width: 1200px) {
  .app {
    max-width: 1280px;
    max-height: 800px;
    margin: auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  }

  body {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0A0A0A;
  }
}
