:root {
  color-scheme: light;

  /* AWS brand (shared) */
  --aws-orange: #ff9900;
  --aws-squid: #232f3e;
  --aws-squid-light: #37475a;
  --aws-green: #1d8102;
  --aws-red: #d13212;

  /* Theme tokens — light (default) */
  --bg: #f2f3f3;
  --surface: #ffffff;
  --text: #16191f;
  --text-muted: #545b64;
  --border: #d5dbdb;
  --aws-blue: #0073bb;
  --heading-accent: #232f3e;
  --on-brand: #ffffff;
  --btn-primary-fg: #16191f;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --drawer-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  --overlay: rgba(0, 0, 0, 0.4);
  --cert-active-bg: #fff8e7;
  --toggle-knob: #ffffff;
  --option-hover-bg: #f7fbfd;
  --option-selected-bg: #eef6fb;
  --option-correct-bg: #e8f5e6;
  --option-incorrect-bg: #fdf0ee;
  --results-pass-bg: #e8f5e6;
  --results-fail-bg: #fdf0ee;

  --radius: 8px;
  --font: "Amazon Ember", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --header-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #0f1419;
    --surface: #1b232d;
    --text: #e8eaed;
    --text-muted: #9aa5b1;
    --border: #3d4d5c;
    --aws-blue: #5eb3ff;
    --heading-accent: #d5dbe1;
    --on-brand: #ffffff;
    --btn-primary-fg: #16191f;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
    --drawer-shadow: 4px 0 28px rgba(0, 0, 0, 0.55);
    --overlay: rgba(0, 0, 0, 0.65);
    --cert-active-bg: #3d3420;
    --toggle-knob: #f0f2f4;
    --option-hover-bg: #24303d;
    --option-selected-bg: #2a3a4d;
    --option-correct-bg: #1e3320;
    --option-incorrect-bg: #3a2220;
    --results-pass-bg: #1a2e1c;
    --results-fail-bg: #331f1c;
  }
}

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

html {
  background: var(--bg);
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--aws-orange);
}

.hidden {
  display: none !important;
}

.init-error {
  padding: 2rem 1.5rem;
  max-width: 36rem;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.init-error h2 {
  margin: 0 0 0.75rem;
  color: var(--aws-red);
}

.init-error-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  word-break: break-all;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
  padding: 0 1rem;
  background: var(--aws-squid);
  color: var(--on-brand);
  box-shadow: var(--shadow);
}

.menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.menu-btn span {
  display: block;
  height: 2px;
  background: var(--on-brand);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.menu-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-btn[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-title {
  flex: 1;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  padding: 0.35rem 0.75rem;
  background: var(--aws-squid-light);
  border-radius: var(--radius);
}

.timer.warning {
  background: var(--aws-red);
}

/* Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(320px, 90vw);
  height: 100%;
  z-index: 201;
  background: var(--surface);
  box-shadow: var(--drawer-shadow);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.25rem 1rem;
  background: var(--aws-squid);
  color: var(--on-brand);
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.drawer-section {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.drawer-section h3 {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.drawer-cert-group {
  margin-bottom: 0.5rem;
}

.drawer-cert-group summary {
  padding: 0.5rem 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

.drawer-cert-group summary::-webkit-details-marker {
  display: none;
}

.drawer-cert-group summary::before {
  content: "▸ ";
  color: var(--aws-orange);
}

.drawer-cert-group[open] summary::before {
  content: "▾ ";
}

.drawer-placeholder {
  margin: 0.35rem 0 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  border-left: 3px solid var(--border);
}

.drawer-section-exams .drawer-nested {
  margin-top: 0.25rem;
  padding: 0.5rem 0 0.5rem 0.85rem;
  border-left: 3px solid var(--aws-orange);
  background: var(--bg);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.drawer-section-exams .exam-list {
  margin: 0;
}

.exam-list-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.exam-list-empty code {
  font-size: 0.8rem;
}

.cert-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cert-list li {
  margin-bottom: 0.35rem;
}

.cert-list button {
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
}

.cert-list button:hover {
  border-color: var(--aws-orange);
}

.cert-list button.active {
  border-color: var(--aws-orange);
  background: var(--cert-active-bg);
  font-weight: 600;
  color: var(--text);
}

.cert-list button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--toggle-knob);
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--aws-orange);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.drawer-actions {
  padding: 1rem;
}

/* Main */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.view {
  animation: fadeIn 0.25s ease;
}

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

/* App landing */
.landing-hero {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.landing-hero h2 {
  margin: 0 0 0.75rem;
  font-size: 1.65rem;
  line-height: 1.3;
}

.landing-lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.landing-quick-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.landing-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  color: var(--text);
  font-family: inherit;
}

.landing-tile-action:hover {
  border-color: var(--aws-orange);
  transform: translateY(-2px);
}

.landing-tile-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.landing-tile-label {
  font-weight: 700;
  font-size: 1rem;
}

.landing-tile-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.browse-header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.browse-lead {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.browse-search-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.browse-search-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.browse-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.browse-search-input:focus {
  outline: 2px solid var(--aws-orange);
  outline-offset: 1px;
  border-color: var(--aws-orange);
}

.browse-no-results {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.landing-section {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.landing-section h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.landing-count {
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.landing-hint {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.landing-cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
}

.landing-cert-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.landing-cert-tile:hover {
  border-color: var(--aws-orange);
  background: var(--cert-active-bg);
}

.landing-cert-tile-level {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--aws-orange);
}

.landing-cert-tile-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

.landing-cert-tile-code {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.landing-cert-tile-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.landing-howto .landing-steps {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  line-height: 1.55;
}

.landing-howto .landing-steps li {
  margin-bottom: 0.65rem;
}

.landing-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cert-breadcrumb {
  margin-bottom: 0.75rem;
}

.btn-text-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--aws-blue);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-text-link:hover {
  text-decoration: underline;
}

.cert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.cert-acronym-callout {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  border-left: 4px solid var(--aws-orange);
  box-shadow: var(--shadow);
}

.cert-acronym-callout h3 {
  margin: 0 0 0.5rem;
}

.cert-acronym-callout p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Acronym study */
.acronym-root {
  margin-top: 1rem;
}

.acronym-intro p {
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 0.85rem;
}

.acronym-intro-meta {
  color: var(--text);
  font-size: 0.95rem;
}

.acronym-mode-label {
  display: block;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.acronym-mode-select {
  display: block;
  width: 100%;
  max-width: 280px;
  margin-top: 0.35rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.acronym-quiz {
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.acronym-progress {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.acronym-prompt-label {
  margin: 1rem 0 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.acronym-prompt {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--heading-accent);
}

.acronym-hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.acronym-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.acronym-option {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.acronym-option:hover:not(:disabled) {
  border-color: var(--aws-orange);
}

.acronym-option:disabled {
  cursor: default;
}

.acronym-option.correct {
  border-color: var(--aws-green);
  background: color-mix(in srgb, var(--aws-green) 12%, var(--bg));
}

.acronym-option.incorrect {
  border-color: var(--aws-red);
  background: color-mix(in srgb, var(--aws-red) 10%, var(--bg));
}

.acronym-feedback {
  margin: 1rem 0 0.75rem;
  font-size: 0.95rem;
}

.acronym-results {
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  text-align: center;
}

.acronym-score {
  font-size: 1.35rem;
  font-weight: 700;
}

/* Cert practice home */
.hero {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.hero h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.hero .cert-code {
  color: var(--aws-orange);
  font-weight: 600;
}

.hero p {
  margin: 0.5rem 0 1.5rem;
  color: var(--text-muted);
}

.exam-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.meta-card {
  min-width: 120px;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: var(--radius);
}

.meta-card strong {
  display: block;
  font-size: 1.25rem;
  color: var(--heading-accent);
}

.meta-card span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--aws-orange);
  color: var(--btn-primary-fg);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  background: var(--aws-squid);
  color: var(--on-brand);
}

.btn-secondary:hover {
  filter: brightness(1.15);
}

.btn-outline {
  background: transparent;
  color: var(--aws-blue);
  border: 1px solid var(--aws-blue);
}

.domain-overview {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.domain-overview h3 {
  margin-top: 0;
}

.domain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.domain-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.domain-list li:last-child {
  border-bottom: none;
}

/* Exam */
.exam-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--aws-orange);
  transition: width 0.3s;
}

.question-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.question-type {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.question-text {
  font-size: 1.05rem;
  margin: 0 0 1.25rem;
}

.options {
  list-style: none;
  margin: 0;
  padding: 0;
}

.options li {
  margin-bottom: 0.5rem;
}

.option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.option-label:hover {
  border-color: var(--aws-blue);
  background: var(--option-hover-bg);
}

.option-label input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.option-label.selected {
  border-color: var(--aws-blue);
  background: var(--option-selected-bg);
}

.option-label.correct {
  border-color: var(--aws-green);
  background: var(--option-correct-bg);
}

.option-label.incorrect {
  border-color: var(--aws-red);
  background: var(--option-incorrect-bg);
}

.feedback-panel {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--bg);
  border-left: 4px solid var(--aws-blue);
}

.feedback-panel.correct-fb {
  border-left-color: var(--aws-green);
}

.feedback-panel.incorrect-fb {
  border-left-color: var(--aws-red);
}

.feedback-panel h4 {
  margin: 0 0 0.5rem;
}

.doc-links {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.doc-links a {
  color: var(--aws-blue);
  font-size: 0.9rem;
}

.exam-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  gap: 1rem;
}

.question-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
}

.q-dot {
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
}

.q-dot.answered {
  background: var(--aws-squid-light);
  color: var(--on-brand);
  border-color: var(--aws-squid-light);
}

.q-dot.correct {
  background: var(--aws-green);
  color: var(--on-brand);
  border-color: var(--aws-green);
}

.q-dot.incorrect {
  background: var(--aws-red);
  color: var(--on-brand);
  border-color: var(--aws-red);
}

.q-dot.current {
  border-color: var(--aws-orange);
  box-shadow: 0 0 0 2px var(--aws-orange);
}

/* Results */
.results-header {
  text-align: center;
  padding: 2rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.results-header.pass {
  background: var(--results-pass-bg);
  border: 2px solid var(--aws-green);
}

.results-header.fail {
  background: var(--results-fail-bg);
  border: 2px solid var(--aws-red);
}

.results-header h2 {
  margin: 0 0 0.5rem;
}

.score-display {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.domain-results {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.domain-bar-row {
  margin-bottom: 1rem;
}

.domain-bar-row header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.domain-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.domain-bar-fill {
  height: 100%;
  background: var(--aws-orange);
}

.domain-bar-fill.weak {
  background: var(--aws-red);
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Study plan */
.study-plan {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.study-domain {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.study-domain:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.study-domain h4 {
  margin: 0 0 0.5rem;
  color: var(--heading-accent);
}

.resource-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.resource-list a {
  color: var(--aws-blue);
}

.disclaimer {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius);
}

footer.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Ads — hidden during exam via .hidden on #ad-slot */
.page-shell {
  max-width: 900px;
  margin: 0 auto;
}

.page-shell.layout-side-ad {
  max-width: none;
}

@media (min-width: 1024px) {
  .page-shell.layout-side-ad {
    display: grid;
    grid-template-columns: minmax(0, 900px) 140px;
    gap: 1rem;
    justify-content: center;
    align-items: start;
    padding: 0 1rem;
  }

  .page-shell.layout-side-ad .ad-slot--side {
    position: sticky;
    top: calc(var(--header-h) + 0.75rem);
  }
}

.ad-slot {
  margin: 0 auto 1rem;
  padding: 0.5rem 1rem;
  max-width: 900px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.ad-slot--bottom {
  width: 100%;
}

.ad-slot--side {
  min-height: 250px;
}

.page-shell.layout-side-ad .ad-slot--side .ad-container {
  min-height: 250px;
}

.ad-slot-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.ad-container {
  min-height: 50px;
  max-height: 90px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-slot--side .ad-container {
  max-height: 600px;
  min-height: 250px;
}

.ad-container .adsbygoogle {
  display: block;
  width: 100%;
  max-width: 728px;
  margin: 0 auto;
}

.ad-custom-link {
  font-size: 0.85rem;
  color: var(--aws-blue);
  text-decoration: none;
  line-height: 1.35;
}

.ad-custom-link:hover {
  text-decoration: underline;
}

/* Storage notice */
.storage-notice {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  background: var(--cert-active-bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.storage-notice p {
  margin: 0;
  flex: 1;
}

.storage-notice-dismiss {
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
}

/* Drawer navigation */
.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.drawer-nav-btn {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.drawer-nav-btn:hover {
  border-color: var(--aws-orange);
  background: var(--cert-active-bg);
}

.drawer-details {
  padding: 0;
}

.drawer-details summary {
  padding: 1rem;
  cursor: pointer;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  list-style: none;
}

.drawer-details summary::-webkit-details-marker {
  display: none;
}

.drawer-details summary::after {
  content: " ▾";
  float: right;
}

.drawer-details[open] summary::after {
  content: " ▴";
}

.drawer-details-body {
  padding: 0 1rem 1rem;
}

/* Home progress teaser */
.progress-teaser {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.progress-teaser h3 {
  margin: 0 0 0.5rem;
}

.progress-teaser-summary {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Progress dashboard */
.dashboard-header {
  margin-bottom: 1.25rem;
}

.dashboard-cert-filter,
.data-cert-filter-label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.dashboard-cert-filter-label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.dashboard-cert-select,
.data-cert-select {
  width: 100%;
  max-width: 100%;
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}

.dashboard-header h2 {
  margin: 0 0 0.25rem;
}

.dashboard-root {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dashboard-empty {
  color: var(--text-muted);
  line-height: 1.5;
}

.dash-section {
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dash-section h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.dash-hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.dash-subhead {
  margin: 1rem 0 0.5rem;
  font-size: 0.9rem;
}

.dash-trend {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.dash-trend--up {
  color: var(--aws-green);
}

.dash-trend--down {
  color: var(--aws-red);
}

.dash-trend--neutral {
  color: var(--text-muted);
}

.dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.75rem;
}

.dash-stat {
  text-align: center;
  padding: 0.65rem 0.5rem;
  background: var(--bg);
  border-radius: var(--radius);
}

.dash-stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--aws-squid);
}

.dash-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.dash-chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.35rem;
  height: 160px;
  padding: 0.5rem 0 1.75rem;
}

.dash-pass-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px dashed var(--aws-orange);
  pointer-events: none;
  opacity: 0.7;
}

.dash-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}

.dash-bar {
  width: 100%;
  max-width: 2.5rem;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.2s;
}

.dash-bar--pass {
  background: var(--aws-green);
}

.dash-bar--fail {
  background: var(--aws-red);
}

.dash-bar-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  white-space: nowrap;
}

.dash-domain-trends {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-domain-trends li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.dash-domain-name {
  flex: 1;
  min-width: 12rem;
}

.dash-domain-delta--up {
  color: var(--aws-green);
}

.dash-domain-delta--down {
  color: var(--aws-red);
}

.dash-domain-delta--flat {
  color: var(--text-muted);
}

.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 700px) {
  .dash-two-col {
    grid-template-columns: 1fr;
  }
}

.dash-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.dash-list--compact {
  font-size: 0.8rem;
}

.dash-flags {
  margin: 1rem 0 0;
  font-size: 0.95rem;
}

.dash-time-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-time-list li {
  display: grid;
  grid-template-columns: 6rem 1fr 4.5rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.85rem;
}

.dash-time-bar-wrap {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.dash-time-bar {
  display: block;
  height: 100%;
  background: var(--aws-blue);
  border-radius: 4px;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.dash-history-table {
  margin-top: 0.5rem;
}

/* History panel (legacy) */
.history-panel {
  margin-top: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.history-panel-toggle {
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.history-panel:not(.is-open) .history-panel-body {
  display: none;
}

.history-panel-body {
  padding: 0 1rem 1rem;
}

.history-empty {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.history-table th,
.history-table td {
  padding: 0.5rem 0.35rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.history-pass {
  color: var(--aws-green);
  font-weight: 600;
}

.history-fail {
  color: var(--aws-red);
  font-weight: 600;
}

.history-domains {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-delete {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.history-delete:hover {
  color: var(--aws-red);
}

.history-drill-note {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

.results-trend {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.domain-weak-badge {
  color: var(--aws-orange);
  font-weight: 600;
  font-size: 0.85em;
}

/* Drawer data panel */
.drawer-hint,
.drawer-subhead {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.drawer-subhead {
  margin-top: 0.75rem;
}

.data-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-block {
  width: 100%;
}

.import-label {
  display: block;
  text-align: center;
  cursor: pointer;
}

.btn-text {
  display: block;
  width: 100%;
  margin-bottom: 0.35rem;
  padding: 0.4rem 0;
  border: none;
  background: none;
  color: var(--aws-blue);
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-text-danger {
  color: var(--aws-red);
}

/* Exam bookmarks */
.question-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.question-card-header .question-type {
  margin: 0;
}

.btn-bookmark {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}

.btn-bookmark.is-active {
  border-color: var(--aws-orange);
  color: var(--aws-orange);
  background: var(--cert-active-bg);
}

.q-dot.bookmarked {
  box-shadow: inset 0 0 0 2px var(--aws-orange);
}

.review-question {
  margin-bottom: 1.25rem;
}

.review-badge {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

@media (max-width: 600px) {
  .exam-nav {
    flex-direction: column;
  }

  .exam-nav .btn {
    width: 100%;
  }

  .history-table {
    font-size: 0.75rem;
  }
}
