:root {
  --name-red: #ff2d4a;
  --name-orange: #ff7a18;
  --bg: #7ec8ff;
  --ink: #021a3a;
  --muted: #006eff;
  --lime: #6eff00;
  --ice: #3d8fff;
  --paper: #ffffff;
  --stage-max: none;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  width: 100%;
  font-family: "Nunito", "Segoe UI", Arial, Helvetica, sans-serif;
  color: var(--ink);
  touch-action: manipulation;
  overscroll-behavior: none;
  background: linear-gradient(180deg, #7ec8ff 0%, #d6ecff 42%, #eaffc8 100%);
  user-select: none;
  -webkit-user-select: none;
}

body {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.hidden, [hidden] { display: none !important; }

#consentModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(ellipse at 50% 8%, rgba(61, 143, 255, 0.38), transparent 52%),
    #021a3a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  user-select: text;
}

.consent-panel {
  width: min(100%, 500px);
  max-height: min(92dvh, 860px);
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  padding: 0;
  border: 2px solid #006eff;
  text-align: center;
  box-shadow:
    0 0 0 4px rgba(110, 255, 0, 0.22),
    0 22px 56px rgba(2, 26, 58, 0.55);
}

.ad-hero {
  display: block;
  position: relative;
  line-height: 0;
  background: #021a3a;
  overflow: hidden;
}

.ad-hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 46%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 26, 58, 0) 0%, rgba(2, 26, 58, 0.72) 42%, #021a3a 100%);
}

.consent-panel > .ad-hero { border-radius: 22px 22px 0 0; }

.ad-hero-art {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: 0;
  vertical-align: bottom;
}

.consent-body { padding: 1.05rem 1.35rem 1.45rem; }

.consent-panel h2 {
  color: #021a3a;
  margin: 0 0 0.85rem;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.consent-panel p {
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}

.consent-panel .hint { font-size: 0.85rem; color: #64748b; }
.consent-panel a { color: #006eff; font-weight: 700; }

.consent-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.consent-accept {
  background: linear-gradient(135deg, #3d8fff, #006eff);
  color: #fff;
  padding: 0.85rem 1.6rem;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 4px 0 #0054c4;
}

.consent-accept:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #0054c4;
}

.consent-reject {
  background: #fff;
  color: #021a3a;
  padding: 0.85rem 1.6rem;
  border: 2px solid #d0d7e2;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

#adSplash {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background:
    radial-gradient(ellipse at 50% 8%, rgba(61, 143, 255, 0.38), transparent 52%),
    #021a3a;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

html.spw-consented:not(.spw-ad-done) #adSplash { display: flex; }
html.spw-consented #consentModal, #consentModal[hidden] { display: none !important; }

.ad-panel {
  position: relative;
  isolation: isolate;
  width: min(100%, 500px);
  max-height: min(92dvh, 860px);
  overflow: hidden;
  background: #fff;
  border-radius: 24px;
  border: 2px solid #006eff;
  text-align: center;
  box-shadow:
    0 0 0 4px rgba(110, 255, 0, 0.22),
    0 22px 56px rgba(2, 26, 58, 0.55);
}

.ad-panel .ad-hero { position: relative; z-index: 1; display: block; }

.ad-count {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 26, 58, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  pointer-events: none;
}

.ad-thanks {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  margin: 0;
  padding: 16px 16px 14px;
  color: #fff;
  font-size: 1.02rem;
  line-height: 1.35;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.ad-thanks strong { color: #fff; font-weight: 800; }

.ad-url {
  display: block;
  margin-top: 6px;
  color: #6eff00;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#toolContent {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none; width: 100%;
  height: 100dvh;
  height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(180deg, #d6ecff 0%, #f3ffe6 100%);
}

#toolContent::before {
  content: "";
  position: absolute;
  inset: -35%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 18%, rgba(110, 255, 0, 0.42), transparent 36%),
    radial-gradient(circle at 84% 16%, rgba(61, 143, 255, 0.5), transparent 34%),
    radial-gradient(circle at 78% 78%, rgba(110, 255, 0, 0.38), transparent 38%),
    radial-gradient(circle at 16% 82%, rgba(0, 110, 255, 0.28), transparent 34%);
}

/* Header (estilo SiluetPro / tools) */
.app-header {
  flex-shrink: 0;
  padding: 0.35rem 0.55rem 0.15rem;
}
.app-header-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  width: 100%;
  min-width: 0;
}
.brand-host {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  background: #fff;
  border-radius: 14px;
  padding: 6px 10px;
  border-bottom: 4px solid #c8e4ff;
  box-shadow: 0 4px 0 rgba(2, 26, 58, 0.08);
  flex-shrink: 1;
  justify-self: start;
  min-width: 0;
  max-width: min(38vw, 150px);
  box-sizing: border-box;
}
.brand-host img {
  height: clamp(22px, 6.2vw, 40px);
  width: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
}
.header-tool {
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  justify-self: center;
  grid-column: 2;
  overflow: hidden;
}
.hero-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
  line-height: 1.05;
  text-align: center;
  min-width: 0;
  max-width: 100%;
}
.brand-name {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: clamp(1.15rem, 4.4vw, 2.35rem);
  color: var(--name-red);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.brand-name span {
  color: var(--name-orange);
}
.hero-kicker {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.header-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  min-width: 0;
}
.help-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.15rem;
  padding: 0 0.85rem 0 0.55rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.82rem;
  color: #fff;
  background: linear-gradient(135deg, #ff2d4a 0%, #ff7a18 100%);
  box-shadow:
    0 3px 0 rgba(180, 40, 20, 0.35),
    0 8px 18px rgba(255, 45, 74, 0.28);
}
.share-app-btn {
  background: linear-gradient(135deg, #006EFF 0%, #3D8FFF 100%);
  box-shadow:
    0 3px 0 rgba(0, 70, 180, 0.35),
    0 8px 18px rgba(0, 110, 255, 0.28);
}
.share-app-btn:active {
  box-shadow:
    0 1px 0 rgba(0, 70, 180, 0.35),
    0 4px 10px rgba(0, 110, 255, 0.22);
}
.help-btn:hover {
  filter: brightness(1.06);
}
.help-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 0 rgba(180, 40, 20, 0.35),
    0 4px 10px rgba(255, 45, 74, 0.22);
}
.help-btn-ico {
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.95rem;
  line-height: 1;
}
.help-btn-ico svg {
  display: block;
}
.help-btn-label {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .app-header {
    padding: 0.28rem 0.4rem 0.1rem;
  }
  .app-header-bar {
    gap: 0.3rem;
    min-height: 2.35rem;
  }
  .brand-host {
    padding: 4px 7px;
    border-radius: 11px;
    border-bottom-width: 3px;
    max-width: min(32vw, 112px);
  }
  .brand-host img {
    height: clamp(18px, 5.2vw, 28px);
  }
  .hero-kicker {
    display: none;
  }
  .header-actions {
    gap: 0.28rem;
  }
  .help-btn-label {
    display: none;
  }
  .help-btn {
    width: 2.05rem;
    height: 2.05rem;
    padding: 0;
    justify-content: center;
  }
  .help-btn-ico {
    width: 100%;
    height: 100%;
    background: transparent;
  }
  .brand-name {
    font-size: clamp(1.05rem, 4.8vw, 1.55rem);
  }
}

@media (max-width: 400px) {
  .app-header-bar {
    gap: 0.22rem;
  }
  .brand-host {
    padding: 3px 5px;
    border-radius: 9px;
    border-bottom-width: 2px;
    max-width: min(28vw, 84px);
    box-shadow: 0 2px 0 rgba(2, 26, 58, 0.08);
  }
  .brand-host img {
    height: clamp(14px, 4.6vw, 20px);
  }
  .help-btn {
    width: 1.85rem;
    height: 1.85rem;
  }
  .header-actions {
    gap: 0.2rem;
  }
  .brand-name {
    font-size: clamp(0.95rem, 4.6vw, 1.25rem);
  }
}


.help-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
}
.help-modal[hidden] { display: none !important; }
.help-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  padding: 1.25rem 1.2rem 1.1rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
.help-panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
}
.help-lead {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}
.help-demo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  margin: 0 0 0.9rem;
  background: #f8fafc;
}
.help-steps {
  margin: 0 0 0.85rem;
  padding-left: 1.15rem;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.5;
}
.help-steps li { margin: 0.25rem 0; }
.help-note {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.help-note a { text-decoration: none; }
.help-close {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.help-ok {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--name-red), var(--name-orange));
}

/* compact header handled above */

/* Layout */

.stage {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(8px + var(--safe-t)) 12px calc(8px + var(--safe-b));
  gap: 8px;
}
/* .brand / .brand-lockup / .brand-title retired — header usa logo MiniApps + Inksolve */

.draw-panel {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.draw-head { display: none !important; }

.draw-chip {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(180deg, #5aa8ff, #006eff);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: 0 3px 0 #0054c4;
}

.draw-tip {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(2, 26, 58, 0.55);
}

.draw-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 220px;
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(0, 110, 255, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(0deg, rgba(0, 110, 255, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--paper);
  border: 3px solid #006eff;
  box-shadow:
    0 0 0 4px rgba(110, 255, 0, 0.28),
    0 14px 28px rgba(2, 26, 58, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  overflow: hidden;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.draw-stage::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 16px;
  border: 2px dashed rgba(0, 110, 255, 0.28);
  pointer-events: none;
  z-index: 1;
}

#lienzo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
  z-index: 2;
  background: transparent;
  user-select: none;
  -webkit-user-select: none;
}



#hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0 1.25rem;
  text-align: center;
  color: rgba(2, 26, 58, 0.32);
  font-size: clamp(1.35rem, 4.2vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  max-width: 85%;
}

#hint.is-gone { opacity: 0 !important; visibility: hidden; pointer-events: none; }

.overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  width: min(92%, 340px);
  text-align: center;
  padding: 1.1rem 1.15rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid #006eff;
  box-shadow:
    0 0 0 3px rgba(110, 255, 0, 0.2),
    0 16px 32px rgba(2, 26, 58, 0.18);
}

#resultado.overlay {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  top: 50% !important;
  /* shrink-wrap: ancho/alto al contenido; scroll solo si no cabe en viewport */
  width: max-content !important;
  min-width: 0 !important;
  max-width: calc(100% - 16px) !important;
  height: max-content !important;
  max-height: calc(100% - 16px) !important;
  transform: translate(-50%, -50%);
  padding: 1.1rem 1rem 1rem;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #e8eef8;
  background:
    radial-gradient(ellipse at 14% 0%, rgba(0, 110, 255, 0.26), transparent 58%),
    radial-gradient(ellipse at 88% 100%, rgba(110, 255, 0, 0.16), transparent 55%),
    linear-gradient(160deg, #071525 0%, #0a2038 50%, #071a24 100%);
  border: 1px solid rgba(0, 110, 255, 0.32);
  box-shadow:
    0 0 0 1px rgba(110, 255, 0, 0.1),
    0 0 28px rgba(0, 110, 255, 0.16),
    0 22px 48px rgba(2, 8, 24, 0.55);
  backdrop-filter: blur(8px);
  box-sizing: border-box;
}

#resultado.overlay {
  font-family: "Nunito", "Segoe UI", Arial, Helvetica, sans-serif;
}

#resultadoExpresion,
#resultadoFinal {
  font-family: "Nunito", "Segoe UI", Arial, Helvetica, sans-serif;
  line-height: 1.5;
  max-width: 100%;
  overflow-x: auto; /* ultimo recurso si la formula no cabe */
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  text-align: center;
  overscroll-behavior-x: contain;
}



html.inksolve-hold-cursor,
html.inksolve-hold-cursor * {
  cursor: none !important;
}


#cargando.overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
#cargando[hidden] { display: none !important; }
.btn-detener {
  margin-top: 0.25rem;
  border: 1px solid rgba(255, 45, 74, 0.65);
  background: rgba(255, 45, 74, 0.16);
  color: #fff;
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  font-weight: 800;
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255, 45, 74, 0.2);
}
.btn-detener:hover {
  background: rgba(255, 45, 74, 0.28);
  border-color: #ff2d4a;
}

/* === INKSOLVE_UI_CHROME === */

#selRect {
  position: absolute;
  z-index: 4;
  border: 2px dashed #006eff;
  background: rgba(0, 110, 255, 0.12);
  border-radius: 6px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(110, 255, 0, 0.35);
}
#selRect[hidden] { display: none !important; }

.anillo {
  position: fixed;
  left: 0;
  top: 0;
  width: 72px;
  height: 72px;
  margin: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  will-change: left, top;
}
.anillo.is-on { opacity: 1; visibility: visible; }
.anillo-svg {
  width: 72px;
  height: 72px;
  display: block;
  position: relative;
  z-index: 1;
  transform: rotate(-90deg);
}
.anillo-track {
  fill: rgba(8, 14, 28, 0.9);
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 5;
}
.anillo-value {
  fill: none;
  stroke: #6eff00;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 188.4;
  stroke-dashoffset: 188.4;
  transition: stroke-dashoffset 0.05s linear;
}
.anillo.modo-borrar .anillo-value { stroke: #ff2d4a; }
.anillo.modo-procesar .anillo-value { stroke: #6eff00; }
.anillo-ico {
  position: absolute;
  left: 0; top: 0;
  width: 72px; height: 72px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: #fff;
  pointer-events: none;
  z-index: 3;
}
.anillo-ico[hidden] { display: none !important; }
.anillo-ico svg {
  width: 28px; height: 28px; display: block;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.55));
}
.anillo.modo-borrar .anillo-ico,
.anillo.modo-procesar .anillo-ico { color: #fff; }

.dots {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: #006eff;
  animation: ink-dot 0.9s ease-in-out infinite;
}
.dots span:nth-child(2) { animation-delay: 0.15s; background: #3d8fff; }
.dots span:nth-child(3) { animation-delay: 0.3s; background: #6eff00; }
@keyframes ink-dot {
  0%, 80%, 100% { transform: scale(0.65); opacity: 0.45; }
  40% { transform: scale(1); opacity: 1; }
}

/* Dark floating toolbar — round icons; bottom (portrait) / side (landscape) */
.draw-panel { position: relative; }

.toolbar {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  align-content: center;
  gap: 6px;
  padding: 8px 10px;
  z-index: 6;
  max-width: 100%;
  box-sizing: border-box;
  background:
    linear-gradient(160deg, rgba(18, 28, 48, 0.94) 0%, rgba(10, 16, 30, 0.96) 100%);
  border: 1px solid rgba(110, 255, 0, 0.28);
  border-radius: 28px;
  box-shadow:
    0 0 0 1px rgba(0, 110, 255, 0.22),
    0 12px 28px rgba(2, 8, 24, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #e8eef8;
}

.toolbar.is-horizontal {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  top: auto;
  transform: none;
  flex-direction: row;
  flex-wrap: wrap;
  align-self: center;
  width: max-content;
  max-width: calc(100% - 16px);
  margin: 8px auto 0;
  border-radius: 28px;
  z-index: 40;
}

.toolbar.is-vertical {
  position: absolute;
  right: 8px;
  left: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-content: center;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  margin: 0;
  border-radius: 28px;
  max-height: calc(100% - 12px);
  width: max-content;
  max-width: none;
  box-sizing: border-box;
  overflow: visible;
  z-index: 40;
}
.toolbar.is-vertical .tb-group {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  max-width: none;
}
.toolbar.is-vertical .tb-sep {
  display: block;
  width: 22px;
  height: 1px;
}
.toolbar.is-vertical .size-wrap,
.toolbar.is-vertical .cam-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
}
/* Solo si JS marca que 1 columna no cabe */
.toolbar.is-vertical.is-two-col {
  display: grid;
  grid-template-columns: repeat(2, 42px);
  grid-auto-rows: 42px;
  gap: 6px;
  justify-content: center;
  justify-items: center;
  align-items: center;
  align-content: center;
}
.toolbar.is-vertical.is-two-col .tb-group {
  display: contents;
}
.toolbar.is-vertical.is-two-col .tb-sep {
  display: none;
}

.tb-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
}
/* tb-group en vertical: display:contents (arriba) */

.tb-sep {
  flex: 0 0 auto;
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 2px;
  flex: 0 0 auto;
}
.toolbar.is-vertical .tb-sep {
  width: 22px;
  height: 1px;
}

.tb-btn {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #e8eef8;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.tb-btn svg,
.tb-btn .tb-ico {
  width: 20px;
  height: 20px;
  display: block;
}
.tb-btn:hover:not(:disabled) {
  background: rgba(0, 110, 255, 0.28);
  border-color: rgba(0, 110, 255, 0.55);
}
.tb-btn:active:not(:disabled) { transform: scale(0.96); }
.tb-btn:disabled {
  opacity: 0.34;
  cursor: default;
}
.tb-btn.is-on {
  background: linear-gradient(180deg, #3d8fff, #006eff);
  border-color: rgba(110, 255, 0, 0.45);
  color: #fff;
  box-shadow:
    0 0 0 2px rgba(0, 110, 255, 0.25),
    0 0 16px rgba(0, 110, 255, 0.35);
}
.tb-btn.primary {
  background: linear-gradient(180deg, #9dff4a, #6eff00);
  border-color: rgba(110, 255, 0, 0.65);
  color: #123000;
  box-shadow: 0 0 16px rgba(110, 255, 0, 0.28);
}
.tb-btn.primary:hover:not(:disabled) {
  filter: brightness(1.05);
  background: linear-gradient(180deg, #9dff4a, #6eff00);
}
.tb-btn.accent {
  background: linear-gradient(180deg, #5aa8ff, #3d8fff);
  border-color: rgba(61, 143, 255, 0.65);
  color: #fff;
  box-shadow: 0 0 14px rgba(61, 143, 255, 0.28);
}
.tb-btn.procesando { cursor: progress; }
.tb-btn.procesando > svg,
.tb-btn.procesando > .tb-ico { visibility: hidden; }
.tb-btn .btn-spin {
  display: none;
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.tb-btn.primary .btn-spin {
  border-color: rgba(18, 48, 0, 0.25);
  border-top-color: #123000;
}
.tb-btn.procesando .btn-spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.tb-btn.size .dot {
  display: block;
  border-radius: 50%;
  background: currentColor;
}
.tb-btn.size .d2 { width: 6px; height: 6px; }
.tb-btn.size .d4 { width: 10px; height: 10px; }
.tb-btn.size .d8 { width: 14px; height: 14px; }
.tb-btn.size .d16 { width: 18px; height: 18px; }

html.layout-landscape .draw-stage { margin-right: 72px; }
html.layout-landscape:has(.toolbar.is-two-col) .draw-stage { margin-right: 120px; }
html.layout-portrait .draw-stage { margin-right: 0; margin-bottom: 0; }

.resultado-pasos {
  margin: 0.35rem 0 0.85rem;
  text-align: left;
  color: rgba(232, 238, 248, 0.92);
}
.resultado-pasos[hidden] { display: none !important; }
.resultado-pasos-title {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(110, 255, 0, 0.85);
}
#resultadoPasosLista {
  margin: 0;
  padding-left: 1.15rem;
  white-space: normal;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: left;
  line-height: 1.45;
}
#resultadoPasosLista li { margin: 0.35rem 0; }
#resultadoPasosLista .katex,
#resultadoPasosLista .katex-html,
#resultadoPasosLista .katex .base {
  white-space: nowrap !important;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #e8eef8;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-weight: 800;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(110, 255, 0, 0.45);
}

.foot-meta {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 0.55rem;
  padding: 2px 4px 0;
  min-width: 0;
  width: 100%;
}
.credit {
  margin: 0;
  grid-column: 2;
  justify-self: center;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(2, 26, 58, 0.7);
  font-weight: 600;
  line-height: 1.35;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25em 0.4em;
  min-width: 0;
  max-width: 100%;
}
.credit a {
  color: #006eff;
  text-decoration: none;
  font-weight: 800;
}
.foot-meta .credit-miniapps,
.help-note .credit-miniapps,
.credit-miniapps {
  display: inline-flex !important;
  align-items: center;
  background: #fff;
  border: 1px solid #d6e4f8;
  border-radius: 8px;
  padding: 2px 7px;
  vertical-align: middle;
  line-height: 0;
  max-width: 96px;
}
.foot-meta .credit-miniapps img,
.help-note .credit-miniapps img,
.credit-miniapps img {
  height: 16px !important;
  max-height: 16px !important;
  width: auto !important;
  max-width: 80px !important;
  display: block !important;
}
.app-ver {
  margin: 0;
  grid-column: 1;
  justify-self: start;
  white-space: nowrap;
  text-align: left;
  font-size: 0.65rem;
  color: rgba(2, 26, 58, 0.4);
  font-weight: 600;
  letter-spacing: 0.04em;
}

#resultadoExpresion {
  margin: 0 0 0.55rem;
  color: rgba(232, 238, 248, 0.85);
  font-size: 1.05rem;
  font-weight: 600;
  font-style: normal;
}
#resultadoExpresion .katex,
#resultadoExpresion .katex * {
  color: rgba(232, 238, 248, 0.92) !important;
}
#resultadoFinal {
  margin: 0 0 0.9rem;
  color: #6eff00;
  font-size: 1.35rem;
  font-weight: 800;
  text-shadow: 0 0 18px rgba(110, 255, 0, 0.45);
}
#resultadoFinal .katex,
#resultadoFinal .katex * {
  color: #6eff00 !important;
}
#resultado .katex,
#resultado .katex-display > .katex,
#resultado .katex-html,
#resultado .katex .base {
  white-space: nowrap !important;
}
#resultado .katex-display {
  display: block;
  margin: 0.35rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
}
#resultado .katex-display > .katex {
  display: inline-block;
  text-align: center;
}

#resultadoExpresion.is-plain,
#resultadoFinal.is-plain {
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif !important;
  font-style: normal !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
  word-spacing: 0.12em !important;
  white-space: pre-wrap !important;
  line-height: 1.5 !important;
  text-align: center;
}
#resultadoFinal.is-plain {
  color: #c8ff7a !important;
  text-shadow: none !important;
  font-size: clamp(1.05rem, 2.8vw, 1.25rem) !important;
}

@media (min-width: 520px) {
  body {
    padding: 12px;
    align-items: center;
  }
  #toolContent {
    height: min(calc(100dvh - 24px), 900px);
    max-height: calc(100dvh - 24px);
    border-radius: 28px;
    box-shadow:
      0 0 0 5px rgba(255, 255, 255, 0.65),
      0 22px 48px rgba(0, 84, 196, 0.16);
  }
}
@media (max-width: 420px), (max-height: 520px) {
  .tb-btn {
    width: 38px;
    height: 38px;
  }
  .tb-btn svg,
  .tb-btn .tb-ico {
    width: 18px;
    height: 18px;
  }
  .toolbar {
    gap: 5px;
    padding: 7px 8px;
  }
}

@media (max-width: 340px) {
  .tb-btn {
    width: 34px;
    height: 34px;
  }
  .tb-sep { display: none; }
}
/* === RESULTADO_MODAL_LAYOUT === */
#resultado.overlay:not([hidden]) {
  display: flex !important;
  flex-direction: column;
  align-items: center; /* NO stretch: evita que width:100% herede el ancho del stage */
  gap: 0;
  text-align: left;
}
.resultado-bloque,
.resultado-problema,
.resultado-solucion {
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
}
.resultado-acciones {
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  align-self: center;
}
#resultadoExpresion,
#resultadoFinal {
  width: max-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  overflow-x: visible;
  overflow-y: visible;
}
#resultadoExpresion.is-plain,
#resultadoFinal.is-plain {
  width: max-content;
  max-width: min(22rem, 100%);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap !important;
}
.resultado-bloque {
  padding: 0.35rem 0.15rem 0.85rem;
}
.resultado-problema {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 0.1rem;
  background: linear-gradient(180deg, rgba(0, 110, 255, 0.1), transparent 72%);
  border-radius: 12px 12px 0 0;
  padding: 0.25rem 0.4rem 0.95rem;
}
.resultado-solucion {
  padding: 0.9rem 0.4rem 0.45rem;
  background: linear-gradient(180deg, rgba(110, 255, 0, 0.07), transparent 68%);
  border-radius: 0 0 12px 12px;
}
.resultado-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(200, 220, 255, 0.72);
}
.resultado-solucion .resultado-label {
  color: rgba(200, 255, 150, 0.85);
}
#resultadoExpresion,
#resultadoFinal {
  text-align: center;
}
.resultado-acciones {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #e8eef8;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 800;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-modal:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(0, 110, 255, 0.55);
}
.btn-modal-primary {
  border-color: rgba(110, 255, 0, 0.4);
  background: rgba(110, 255, 0, 0.12);
}
.btn-modal-primary:hover {
  border-color: rgba(110, 255, 0, 0.65);
  background: rgba(110, 255, 0, 0.2);
}
.btn-modal.is-copied {
  border-color: rgba(110, 255, 0, 0.7);
  color: #c8ff7a;
}
@media (max-width: 380px) {
  .resultado-acciones {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* hidden must win over display:flex !important */
#resultado.overlay[hidden],
#resultado[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
/* === RESULTADO_SHRINKWRAP === */
#resultado.overlay.overlay {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  width: max-content !important;
  max-width: calc(100vw - 16px) !important;
  height: max-content !important;
  max-height: calc(100dvh - 16px) !important;
  margin: 0 !important;
  z-index: 80 !important;
}
#resultado .resultado-bloque,
#resultado .resultado-problema,
#resultado .resultado-solucion,
#resultado .resultado-pasos,
#resultado .resultado-acciones {
  width: max-content !important;
  max-width: 100% !important;
}
#resultado .resultado-label { width: max-content; max-width: 100%; }
#resultadoPasosLista { width: max-content; max-width: 100%; }


/* === FOTO_RECORTE === */
.foto-recorte-bar {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  background: rgba(7, 21, 37, 0.92);
  border: 1px solid rgba(0, 110, 255, 0.4);
  box-shadow: 0 12px 28px rgba(2, 8, 24, 0.45);
  color: #e8eef8;
  pointer-events: auto;
}
.foto-recorte-bar[hidden] { display: none !important; }
.foto-recorte-hint {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  color: rgba(232, 238, 248, 0.9);
}
.foto-recorte-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}
.btn-foto {
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
  color: #e8eef8;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-weight: 800;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
}
.btn-foto:disabled { opacity: 0.45; cursor: default; }
.btn-foto-primary {
  border-color: rgba(110, 255, 0, 0.45);
  background: rgba(110, 255, 0, 0.16);
  color: #c8ff7a;
}
.draw-panel { position: relative; }
html.modo-recorte-foto #hint { display: none !important; }
html.modo-recorte-foto .toolbar {
  display: none !important;
}
html.modo-recorte-foto.layout-landscape .draw-stage,
html.modo-recorte-foto.layout-landscape.layout-compact .draw-stage {
  margin-right: 0 !important;
}


/* Camera source menu */
.cam-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cam-menu {
  position: absolute;
  z-index: 90;
  min-width: 220px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(18, 24, 38, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.toolbar.is-horizontal .cam-menu {
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
}
.toolbar.is-vertical .cam-menu {
  top: 50%;
  right: calc(100% + 10px);
  left: auto;
  bottom: auto;
  transform: translateY(-50%);
}
.cam-menu[hidden] { display: none !important; }
.cam-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #e8eefc;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.cam-menu-item:hover,
.cam-menu-item:focus-visible {
  background: rgba(88, 166, 255, 0.18);
  outline: none;
}
.cam-menu-ico {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #9ecbff;
}
.cam-menu-ico svg {
  width: 20px;
  height: 20px;
  display: block;
}
.cam-menu-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cam-menu-txt strong {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
.cam-menu-txt small {
  font-size: 11px;
  opacity: 0.72;
  line-height: 1.2;
}

/* Webcam capture (PC / desktop) */
.webcam-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 12, 22, 0.72);
  backdrop-filter: blur(6px);
}
.webcam-overlay[hidden] { display: none !important; }
.webcam-card {
  width: min(520px, 100%);
  padding: 14px;
  border-radius: 16px;
  background: rgba(18, 24, 38, 0.98);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  color: #e8eefc;
}
.webcam-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}
.webcam-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1220;
  border: 1px solid rgba(255,255,255,0.08);
}
.webcam-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scaleX(-1);
}
.webcam-error {
  margin: 10px 0 0;
  color: #fca5a5;
  font-size: 13px;
}
.webcam-acciones {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
/* Resultado: grafica + tabulacion */
.resultado-grafica {
  margin-top: 10px;
  width: max-content;
  max-width: min(520px, 90vw);
}
.resultado-grafica[hidden] { display: none !important; }
.resultado-grafica img {
  display: block;
  width: auto;
  max-width: min(520px, 90vw);
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
}
.resultado-tabulacion {
  margin-top: 12px;
  width: max-content;
  max-width: min(520px, 90vw);
}
.resultado-tabulacion[hidden] { display: none !important; }
.resultado-tabulacion-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.8;
}
.resultado-tabulacion-wrap {
  overflow: auto;
  max-height: 220px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255,255,255,0.72);
}
.resultado-tabulacion table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.resultado-tabulacion th,
.resultado-tabulacion td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  text-align: right;
  white-space: nowrap;
}
.resultado-tabulacion th {
  position: sticky;
  top: 0;
  background: rgba(241, 245, 249, 0.95);
  font-weight: 700;
}
.resultado-tabulacion tbody tr:last-child td { border-bottom: 0; }

/* Brush size popup */
.size-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.size-menu {
  position: absolute;
  z-index: 95;
  min-width: 148px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(18, 24, 38, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.size-menu[hidden] { display: none !important; }
.toolbar.is-horizontal .size-menu {
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
}
.toolbar.is-vertical .size-menu {
  top: 50%;
  right: calc(100% + 10px);
  left: auto;
  bottom: auto;
  transform: translateY(-50%);
}
.size-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #e8eefc;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.size-menu-item:hover,
.size-menu-item:focus-visible {
  background: rgba(88, 166, 255, 0.18);
  outline: none;
}
.size-menu-item.is-on {
  background: rgba(110, 255, 0, 0.16);
}
.size-menu-item .dot {
  display: inline-block;
  border-radius: 50%;
  background: #e8eefc;
  flex-shrink: 0;
}
.size-menu-item .d2 { width: 6px; height: 6px; }
.size-menu-item .d4 { width: 10px; height: 10px; }
.size-menu-item .d8 { width: 14px; height: 14px; }
.size-menu-item .d16 { width: 18px; height: 18px; }
#brochaDot {
  display: inline-block;
  border-radius: 50%;
  background: currentColor;
}


/* Popups toolbar: .is-open gana a [hidden] { display:none !important } */
.cam-menu.is-open,
.size-menu.is-open {
  display: flex !important;
}
.toolbar {
  z-index: 40 !important;
}
.cam-menu,
.size-menu {
  z-index: 120 !important;
}


/* === PHONE LANDSCAPE: lienzo primero === */
html.layout-landscape.layout-compact .stage {
  padding: calc(4px + var(--safe-t)) 8px calc(4px + var(--safe-b));
  gap: 4px;
}
html.layout-landscape.layout-compact .app-header {
  padding: 0.1rem 0.2rem 0;
}
html.layout-landscape.layout-compact .app-header-bar {
  min-height: 2rem;
  gap: 0.3rem;
}
html.layout-landscape.layout-compact .brand-host {
  padding: 3px 7px;
  border-radius: 10px;
  border-bottom-width: 2px;
  box-shadow: 0 2px 0 rgba(2, 26, 58, 0.08);
}
html.layout-landscape.layout-compact .brand-host img {
  height: 22px;
}
html.layout-landscape.layout-compact .brand-name {
  font-size: 1.15rem;
}
html.layout-landscape.layout-compact .hero-kicker {
  display: none !important;
}
html.layout-landscape.layout-compact .header-actions {
  gap: 0.28rem;
}
html.layout-landscape.layout-compact .help-btn {
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  gap: 0;
  justify-content: center;
}
html.layout-landscape.layout-compact .help-btn-label {
  display: none !important;
}
html.layout-landscape.layout-compact .foot-meta {
  display: none !important;
}
html.layout-landscape.layout-compact .draw-panel {
  gap: 4px;
}
html.layout-landscape.layout-compact .draw-stage {
  margin-right: 64px;
  min-height: 0;
  border-width: 2px;
  border-radius: 16px;
  box-shadow:
    0 0 0 3px rgba(110, 255, 0, 0.22),
    0 8px 18px rgba(2, 26, 58, 0.12);
}
html.layout-landscape.layout-compact:has(.toolbar.is-two-col) .draw-stage {
  margin-right: 108px;
}
html.layout-landscape.layout-compact .toolbar.is-vertical {
  right: 4px;
  padding: 8px 6px;
  gap: 5px;
  width: max-content;
  max-width: none;
  max-height: calc(100% - 8px);
  border-radius: 22px;
  overflow: visible;
  box-sizing: border-box;
}
html.layout-landscape.layout-compact .toolbar.is-vertical .tb-btn {
  width: 36px;
  height: 36px;
}
html.layout-landscape.layout-compact .toolbar.is-vertical .tb-btn svg,
html.layout-landscape.layout-compact .toolbar.is-vertical .tb-btn .tb-ico {
  width: 17px;
  height: 17px;
}
html.layout-landscape.layout-compact .toolbar.is-vertical .size-wrap,
html.layout-landscape.layout-compact .toolbar.is-vertical .cam-wrap {
  width: 36px;
  height: 36px;
}
html.layout-landscape.layout-compact .toolbar.is-vertical.is-two-col {
  grid-template-columns: repeat(2, 36px);
  grid-auto-rows: 36px;
  gap: 5px;
}
html.layout-landscape.layout-compact .foto-recorte-bar {
  padding: 6px 8px;
  gap: 6px;
}
html.layout-landscape.layout-compact .foto-recorte-hint {
  font-size: 12px;
}
