/* CCNA sample pages — touch-friendly (phones / tablets; point-and-tap) */
html {
  -webkit-text-size-adjust: 100%;
}

/* Site logo — bank pages: top right; guest samples override to top left (no link) */
.site-logo-corner {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 12000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(11, 16, 32, 0.55);
  border: 1px solid #2d3b5a;
  padding: 6px;
  backdrop-filter: blur(4px);
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}
.site-logo-corner img {
  display: block;
  width: 52px;
  height: 52px;
}
.site-logo-corner:focus-visible {
  outline: 2px solid #4f84d8;
  outline-offset: 3px;
}

body {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.12);
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

pre,
code,
.terminal,
.scrollback-area,
#scrollback {
  max-width: 100%;
}

/* Multiple-choice / select rows: ~48px minimum tap height (WCAG 2.5.5) */
.choice {
  min-height: 48px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 14px 16px;
}

.choice input {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

/* CLI-style answers: control bar on top, console spans full card width */
.choice.mono.cli-router-choice {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  min-height: 48px;
}

.choice.mono.cli-router-choice .cli-router-choice-controls {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
}

.choice.mono.cli-router-choice pre.cli-router-console {
  display: block;
  width: 100%;
  box-sizing: border-box;
  align-self: stretch;
}

.question-nav .nav-link,
.question-nav .nav-check,
.actions button,
.home-link,
.next-link {
  min-height: 48px;
  padding: 12px 18px;
  box-sizing: border-box;
  touch-action: manipulation;
}

.answer-actions {
  width: 100%;
}

.answer-actions .nav-check {
  align-self: flex-start;
  flex: 0 0 auto !important;
  width: auto !important;
  min-height: 48px;
  padding: 12px 18px;
  box-sizing: border-box;
  touch-action: manipulation;
}

.answer-side-actions .nav-show-answer {
  flex: 0 0 auto !important;
  width: auto !important;
  min-height: 48px;
  padding: 12px 18px;
  box-sizing: border-box;
  touch-action: manipulation;
}

.review-mark-box {
  min-height: 48px;
  min-width: 48px;
  touch-action: manipulation;
}

.review-mark-box input {
  width: 22px !important;
  height: 22px !important;
}

  .question-nav .nav-link,
  .next-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  /* CCNA bank + guest sample + drag-and-drop — light question shell */
  body.ccna-question-ui,
  body.ccna-static-sample,
  body.ccna-sample-guest-ui,
  body.ccna-dnd-ui {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
    background: #ffffff !important;
    color: #1a3d6e;
    position: relative;
  }
  body.ccna-question-ui .question-shell,
  body.ccna-static-sample .question-shell,
  body.ccna-dnd-ui .question-shell {
    width: min(900px, 100%);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    z-index: 1;
  }
  body.ccna-question-ui .question-shell .site-logo-corner,
  body.ccna-dnd-ui .question-shell .site-logo-corner {
    position: static !important;
    top: auto !important;
    right: auto !important;
    align-self: flex-end;
    margin: 0 0 2rem;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    backdrop-filter: none !important;
  }
  body.ccna-static-sample .site-logo-corner,
  body.ccna-sample-guest-ui .site-logo-corner,
  body.bcc-sample-experience .site-logo-corner {
    display: inline-flex !important;
    position: fixed !important;
    top: max(12px, env(safe-area-inset-top, 0px)) !important;
    left: max(12px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    align-self: auto !important;
    margin: 0 !important;
    pointer-events: none !important;
    cursor: default !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    backdrop-filter: none !important;
  }
  body.ccna-static-sample .question-shell .site-logo-corner,
  body.ccna-sample-guest-ui .question-shell .site-logo-corner,
  body.bcc-sample-experience .question-shell .site-logo-corner {
    position: fixed !important;
  }
  body.ccna-question-ui .page-logo-watermark,
  body.ccna-static-sample .page-logo-watermark,
  body.ccna-dnd-ui .page-logo-watermark {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  body.ccna-question-ui .page-logo-watermark img,
  body.ccna-static-sample .page-logo-watermark img,
  body.ccna-dnd-ui .page-logo-watermark img {
    width: min(85vw, 720px);
    max-height: 85vh;
    height: auto;
    object-fit: contain;
    opacity: 0.16;
  }
  body.ccna-question-ui .card,
  body.ccna-question-ui main.card,
  body.ccna-static-sample .card,
  body.ccna-static-sample main.card,
  body.ccna-dnd-ui .card,
  body.ccna-dnd-ui main.card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #1a3d6e;
  }
  body.ccna-question-ui h1,
  body.ccna-static-sample h1,
  body.ccna-sample-guest-ui h1,
  body.ccna-dnd-ui h1 {
    color: #1a3d6e;
  }
  /* Text on white / transparent question shell (matches SEC+ #1a3d6e) */
  body.ccna-question-ui .stem-after-exhibit,
  body.ccna-question-ui .stem-after-exhibit-list,
  body.ccna-question-ui .stem-after-exhibit-list li,
  body.ccna-question-ui .stem-after-exhibit-tail,
  body.ccna-question-ui .exhibit-ref,
  body.ccna-question-ui .exhibit-ref-spaced,
  body.ccna-question-ui .exhibit-section-caption,
  body.ccna-static-sample .stem-after-exhibit,
  body.ccna-static-sample .stem-after-exhibit-list,
  body.ccna-static-sample .stem-after-exhibit-list li,
  body.ccna-static-sample .stem-after-exhibit-tail,
  body.ccna-static-sample .exhibit-ref,
  body.ccna-static-sample .exhibit-ref-spaced,
  body.ccna-static-sample .exhibit-section-caption,
  body.ccna-sample-guest-ui .stem-after-exhibit,
  body.ccna-sample-guest-ui .stem-after-exhibit-list,
  body.ccna-sample-guest-ui .stem-after-exhibit-list li,
  body.ccna-sample-guest-ui .stem-after-exhibit-tail,
  body.ccna-sample-guest-ui .exhibit-ref,
  body.ccna-sample-guest-ui .exhibit-ref-spaced,
  body.ccna-sample-guest-ui .exhibit-section-caption {
    color: #1a3d6e;
  }
  body.ccna-question-ui .choice,
  body.ccna-static-sample .choice {
    background: #254b8a;
    border-color: #3d6dbb;
    color: #e6edf3;
  }
  body.ccna-question-ui .answer.correct,
  body.ccna-static-sample .answer.correct,
  body.ccna-question-ui #answerBox.answer.correct,
  body.ccna-static-sample #answerBox.answer.correct {
    color: #ffffff;
  }
  body.ccna-question-ui .answer.incorrect,
  body.ccna-static-sample .answer.incorrect,
  body.ccna-question-ui #answerBox.answer.incorrect,
  body.ccna-static-sample #answerBox.answer.incorrect {
    color: #fecaca;
  }
  body.ccna-question-ui .ccna-practice-progress,
  body.ccna-question-ui .question-topic-meta,
  body.ccna-static-sample .ccna-practice-progress,
  body.ccna-static-sample .question-topic-meta {
    color: #1a3d6e;
  }
  body.ccna-question-ui .review-mark-box,
  body.ccna-static-sample .review-mark-box {
    background: transparent !important;
    border: 1px solid #3d6dbb;
    color: #1a3d6e;
  }
  body.ccna-question-ui .review-mark-box input,
  body.ccna-static-sample .review-mark-box input {
    accent-color: #1a3d6e;
  }
  body.ccna-question-ui .review-mark-box.is-flagged,
  body.ccna-static-sample .review-mark-box.is-flagged {
    background: transparent !important;
    border-color: #3d6dbb;
    color: #1a3d6e;
  }
  nav.sim-nav.ccna-sample-sim-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(11, 16, 32, 0.94);
    border-top: 1px solid #2d3b5a;
    backdrop-filter: blur(10px);
  }
  nav.sim-nav.ccna-sample-sim-nav .sim-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #254b8a;
    border: 1px solid #3d6dbb;
    color: #e6edf3;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 700;
    min-width: 5.5rem;
    min-height: 48px;
    text-align: center;
    box-sizing: border-box;
    touch-action: manipulation;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
  }
  nav.sim-nav.ccna-sample-sim-nav .sim-nav-btn:hover {
    filter: brightness(1.08);
  }
  nav.sim-nav.ccna-sample-sim-nav .sim-nav-home {
    background: #1a3d6e;
  }
  nav.sim-nav.ccna-sample-sim-nav .sim-nav-btn--disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
  }

  /* Drag-and-drop: short touch hint above the exercise (phones / tablets) */
.dragdrop-touch-hint {
  display: none;
  margin: 0 0 8px;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #1a3d6e;
  font-weight: 400;
}

@media (max-width: 900px), ((hover: none) and (pointer: coarse)) {
  .dragdrop-touch-hint {
    display: block;
  }
}

/* Drag-and-drop exercise */
body.dragdrop-exercise .token {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 14px 14px;
  box-sizing: border-box;
  width: 100%;
  touch-action: manipulation;
  cursor: pointer;
}

body.dragdrop-exercise .token.is-picked {
  outline: 3px solid #4d89ff;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(77, 137, 255, 0.35);
}

body.dragdrop-exercise .drop-slot,
body.dragdrop-exercise .slot {
  box-sizing: border-box;
  touch-action: manipulation;
  cursor: pointer;
}

body.dragdrop-exercise .match-row .drop-slot,
body.dragdrop-exercise .match-row .slot,
body.dragdrop-exercise .row .drop-slot,
body.dragdrop-exercise .category-box .drop-slot {
  min-height: 48px;
  height: auto;
  padding: 8px 10px;
}

body.dragdrop-exercise pre .drop-slot,
body.dragdrop-exercise pre .slot,
body.dragdrop-exercise .code .drop-slot,
body.dragdrop-exercise .code .slot {
  min-height: 1.35em;
  padding: 2px 6px;
}

body.dragdrop-exercise button,
body.dragdrop-exercise .home-link {
  min-height: 48px;
  padding: 12px 18px;
  box-sizing: border-box;
  touch-action: manipulation;
}

body.dragdrop-exercise .panel h2 {
  user-select: none;
}

/* Shared small-screen layout fixes for customer-facing practice, DnD, and labs. */
@media (max-width: 760px) {
  body {
    padding-left: max(10px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(10px, env(safe-area-inset-right, 0px)) !important;
  }

  .card,
  main.card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  .question-nav,
  .question-nav-links,
  .actions,
  .controls,
  .device-links,
  .helper-file-wrap {
    align-items: stretch !important;
    gap: 8px !important;
  }

  .question-nav .nav-link,
  .question-nav .nav-check,
  .actions button,
  .controls button,
  .device-link,
  .home-link,
  .next-link,
  .sim-nav-btn {
    min-height: 48px !important;
    flex: 1 1 140px !important;
    padding: 12px 14px !important;
    box-sizing: border-box !important;
    white-space: normal !important;
  }

  .answer-actions .nav-check,
  .answer-side-actions .nav-show-answer {
    align-self: flex-start !important;
    flex: 0 0 auto !important;
    width: auto !important;
  }


  .site-logo-corner img {
    width: 44px !important;
    height: 44px !important;
  }

  body.dragdrop-exercise .layout,
  body.dragdrop-exercise .category-grid,
  .cli-grid,
  .reviews-grid,
  .sample-preview-grid {
    grid-template-columns: 1fr !important;
  }

  body.dragdrop-exercise .panel {
    padding: 10px !important;
    min-width: 0 !important;
  }

  body.dragdrop-exercise .bank {
    gap: 8px !important;
  }

  body.dragdrop-exercise .drop-slot {
    min-height: 76px !important;
  }

  .sim-nav {
    overflow-x: auto !important;
    justify-content: flex-start !important;
    -webkit-overflow-scrolling: touch;
  }

  .diagram-wrap,
  figure.exhibit-photo,
  .topology-scrape {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .device-pick {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px 12px !important;
  }

  .device-pick label {
    margin-left: 0 !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  .cli-modal-dialog {
    width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    border-radius: 12px !important;
  }

  .cli-modal-header {
    cursor: default !important;
    touch-action: manipulation !important;
  }

  .cli-modal-body {
    padding: 8px !important;
  }

  .terminal {
    min-height: min(46dvh, 320px) !important;
    font-size: 0.82rem !important;
  }

  .scrollback-area,
  #scrollback,
  #pc3Scrollback {
    max-height: min(38dvh, 300px) !important;
  }

  .input-row {
    gap: 6px !important;
  }

  .cmdline,
  .cmdline-input,
  #cmdline,
  .terminal input[type="text"],
  .cli-modal-dialog input[type="text"] {
    min-height: 44px !important;
    font-size: 16px !important;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: clamp(1rem, 5vw, 1.25rem) !important;
  }

  .choice,
  body.dragdrop-exercise .token {
    font-size: 0.95rem !important;
  }

  body.dragdrop-exercise .drop-slot {
    min-height: 68px !important;
  }

  .cli-modal-footer .controls,
  .controls,
  .actions,
  .device-links,
  .helper-file-wrap {
    flex-direction: column !important;
  }

  .question-nav .nav-link,
  .question-nav .nav-check,
  .actions button,
  .controls button,
  .device-link,
  .sim-nav-btn {
    width: 100% !important;
  }

  .answer-actions .nav-check,
  .answer-side-actions .nav-show-answer {
    width: auto !important;
  }
}
