/* ═══════════════════════════════════════════════════════════════
   Exam Tools Hero — civic-premium theme (EPSO exact)
   runner.css usa html{font-size:50%} → 1rem = 8px
   Aquí aplicamos font-size:8px en el contenedor para igualar
   ═══════════════════════════════════════════════════════════════ */

/* ── Contenedor raíz ────────────────────────────────────────────── */
.hero-exam-tools {
  font-size: 8px;
  display: flex;
  flex-direction: column;
  width: 320px;
  background: #273d59;
  border-radius: 1.9rem;
  overflow: hidden;
  box-shadow: 0 1.4rem 3.2rem rgba(13,34,72,0.18);
}

/* ── Tabs ───────────────────────────────────────────────────────── */
.hero-exam-tools .hero-tools-tabs {
  display: flex;
  gap: 0;
  background: #273d59;
  border-radius: 1.9rem 1.9rem 0 0;
  overflow: hidden;
  font-size: 13px;
}
.hero-exam-tools .hero-tab {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: background .15s, color .15s;
}
.hero-exam-tools .hero-tab.is-active {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
}
.hero-exam-tools .hero-tab:hover:not(.is-active) {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
}

/* ── Panel toggle ───────────────────────────────────────────────── */
.hero-exam-tools .hero-tool-panel { display: none; }
.hero-exam-tools .hero-tool-panel.is-active { display: flex; flex-direction: column; }

/* ══════════════════════════════════════════════════════════════════
   MODAL CONTAINER & HEADER — civic-premium
   ══════════════════════════════════════════════════════════════════ */

.hero-exam-tools .contents {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  border: none;
  border-radius: 0 0 1.9rem 1.9rem;
  background: linear-gradient(
    180deg,
    transparent 0,
    transparent 6.5rem,
    rgba(255,255,255,0.96) 6.5rem,
    rgba(241,246,255,0.88) 100%
  );
  overflow: hidden;
}

.hero-exam-tools .header {
  cursor: default;
  display: flex;
  align-items: center;
  height: 6.5rem;
  padding: 0 0.5rem;
  gap: 1rem;
  background: transparent; /* modal bg (#273d59) shows through */
  color: #ffffff;
  flex-shrink: 0;
}

.hero-exam-tools .title-container {
  flex: 1 1 auto;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 2rem;
  pointer-events: none;
  letter-spacing: .04em;
}

.hero-exam-tools .action-container-start,
.hero-exam-tools .action-container-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  min-width: 5.5rem;
}
.hero-exam-tools .action-container-end { justify-content: flex-end; }

.hero-exam-tools .icon-bar-btn {
  width: 3.2rem;
  height: 3.2rem;
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  border-radius: 4px;
  display: grid;
  place-items: center;
  padding: 0;
}
.hero-exam-tools .icon-bar-btn:hover:not(:disabled) {
  background: rgba(255,255,255,.15);
}
.hero-exam-tools .icon-bar-btn:disabled { opacity: .35; }
.hero-exam-tools .icon-bar-btn svg {
  width: 2rem;
  height: 2rem;
}

.hero-exam-tools .content {
  position: relative;
  flex: 1 1 auto;
  background: transparent;
  border-top: none;
  overflow: hidden;
  display: flex;
}

/* ══════════════════════════════════════════════════════════════════
   SCRATCHPAD — civic-premium
   ══════════════════════════════════════════════════════════════════ */

.hero-exam-tools .scratchpad-container {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 438px;
  touch-action: none;
}

.hero-exam-tools .scratchpad-tools {
  list-style: none;
  margin: 0;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 5rem;
  border-right: 0.125rem solid rgba(39,61,89,0.15);
  background: rgba(255,255,255,0.96);
  flex-shrink: 0;
}
.hero-exam-tools .scratchpad-tools li { position: relative; }

.hero-exam-tools .icon-bar-btn.scratchpad-tool-btn {
  color: #273d59;
  width: 3.2rem;
  height: 3.2rem;
}
.hero-exam-tools .icon-bar-btn.scratchpad-tool-btn:hover {
  background: rgba(39,61,89,0.1);
  color: #273d59;
}
.hero-exam-tools .icon-bar-btn.scratchpad-tool-btn.active {
  outline: 2px solid #273d59;
  outline-offset: 2px;
}

.hero-exam-tools .tools-options {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  display: none;
  flex-direction: row;
  gap: 0.5rem;
  position: absolute;
  left: calc(100% + 0.5rem);
  top: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  border: 0.125rem solid rgba(39,61,89,0.2);
  border-radius: 0.5rem;
  z-index: 3;
}
.hero-exam-tools .scratchpad-tools li:hover > .tools-options { display: flex; }

.hero-exam-tools .scratchpad-canvas-wrap {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  position: relative;
  background: #ffffff;
}

#hero-scratchpad-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #ffffff;
  cursor: crosshair;
}

/* ══════════════════════════════════════════════════════════════════
   CALCULATOR — civic-premium
   ══════════════════════════════════════════════════════════════════ */

.hero-exam-tools .calculator {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  gap: 0;
}

.hero-exam-tools .calculator .screen {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: none;
  border-radius: 0;
  padding: 0.75rem 1rem;
  height: 124px;
  min-height: 124px;
  background: #ffffff;
  gap: 0;
  flex: 0 0 auto;
}

.hero-exam-tools .calculator .expression {
  color: rgba(13,21,38,0.58);
  font-size: 1.75rem;
  min-height: 2.4rem;
  text-align: right;
  font-family: monospace;
  padding: 0; margin: 0;
}

.hero-exam-tools .calculator .result {
  font-size: 4rem;
  font-weight: 700;
  color: #273d59;
  background: transparent;
  padding: 0;
  min-height: 3.2rem;
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  font-family: monospace;
  line-height: 1.1;
}
.hero-exam-tools .calculator .result span {
  display: block;
  width: 100%;
  text-align: right;
}

.hero-exam-tools .calculator .keyboard {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(var(--grid-rows-count), auto);
  gap: 0;
  flex: 0 0 auto;
  background: #ffffff;
}

.hero-exam-tools .calculator .key {
  border: none;
  border-radius: 0;
  background: #ffffff;
  color: #121212;
  font-size: 2rem;
  font-weight: 400;
  cursor: pointer;
  margin: 0;
  aspect-ratio: 1;
  transition: filter .1s;
  box-shadow: none;
}
.hero-exam-tools .calculator .key:hover { filter: brightness(.92); }
.hero-exam-tools .calculator .key[data-command="execute"] {
  aspect-ratio: auto;
  border-bottom-right-radius: 1.9rem;
}

.hero-exam-tools .calculator .key.operator,
.hero-exam-tools .calculator .key[data-command="execute"] {
  background: #273d59;
  color: #ffffff;
}
.hero-exam-tools .calculator .key.digit {
  background: #f0f4fa;
  color: #121212;
}
.hero-exam-tools .calculator .key.command,
.hero-exam-tools .calculator .key.function {
  background: #e8eef5;
  color: #273d59;
}

.hero-exam-tools .calculator .key[data-param="NUM0"] {
  border-bottom-left-radius: 1.9rem;
}

/* ── Badge ─────────────────────────────────────────────────────── */
.hero-tools-badge {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 14px;
}
