/* SWELL内で全幅表示しつつ、テーマの装飾からクイズUIを隔離します。 */
.uav-tbt-plugin-mount {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  background: #E6F7FF;
}
.uav-tbt-fixed-page,
.uav-tbt-fixed-page *,
.uav-tbt-fixed-page *::before,
.uav-tbt-fixed-page *::after {
  box-sizing: border-box;
}
.uav-tbt-fixed-page {
  --uav-bg: #E6F7FF;
  --uav-surface: #ffffff;
  --uav-line: #dce6f3;
  --uav-line-strong: #bcd2ed;
  --uav-text: #0f172a;
  --uav-muted: #64748b;
  --uav-blue: #0b63d8;
  --uav-blue-dark: #064aaa;
  --uav-blue-soft: #E6F7FF;
  --uav-green: #15803d;
  --uav-green-soft: #e9f9ef;
  --uav-red: #dc2626;
  --uav-red-soft: #fff0f0;
  --uav-shadow: 0 12px 30px rgba(15, 23, 42, .08);
  --uav-radius: 8px;
  width: 100vw;
  max-width: none;
  margin: 0 calc(50% - 50vw);
  overflow-x: clip;
  color: var(--uav-text);
  background: var(--uav-bg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
.uav-tbt-fixed-page button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  font: inherit;
  cursor: pointer;
  text-transform: none;
}
.uav-tbt-fixed-page :where(h1, h2, h3, p, ul, li, dl, dt, dd) {
  margin-block-start: 0;
  margin-block-end: 0;
}
.uav-tbt-fixed-page :where(h1, h2, h3) {
  clear: none;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-decoration: none;
}
.uav-tbt-fixed-page :where(h1, h2, h3)::before,
.uav-tbt-fixed-page :where(h1, h2, h3)::after {
  content: none;
  display: none;
}
.uav-page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  min-height: 82px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--uav-line-strong);
  border-radius: var(--uav-radius) var(--uav-radius) 0 0;
  backdrop-filter: blur(18px);
}
.uav-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  color: inherit;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
}
.uav-brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 42px;
  color: var(--uav-blue);
  background: var(--uav-blue-soft);
  border: 1px solid #cce3ff;
  border-radius: var(--uav-radius);
}
.uav-brand svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.uav-brand strong,
.uav-brand small {
  display: block;
}
.uav-brand strong {
  color: #0b4fae;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.25;
}
.uav-brand small {
  color: #334155;
  font-weight: 700;
}
.uav-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 24px;
  align-items: stretch;
  padding: 32px;
  background: var(--uav-surface);
  border-right: 1px solid var(--uav-line);
  border-bottom: 1px solid var(--uav-line);
  border-left: 1px solid var(--uav-line);
  box-shadow: var(--uav-shadow);
}
.uav-eyebrow,
.uav-source-badge {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  color: var(--uav-blue);
  background: var(--uav-blue-soft);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}
.uav-hero h1 {
  margin: 14px 0 12px;
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1.08;
}
.uav-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--uav-muted);
  font-size: 16px;
  line-height: 1.8;
}
.uav-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.uav-hero-actions button.is-active {
  color: #fff;
  background: var(--uav-blue);
  border-color: var(--uav-blue);
  box-shadow: 0 10px 24px rgba(11, 99, 216, .22);
}
.uav-hero-actions button.is-active:hover {
  background: var(--uav-blue-dark);
}
.uav-first-only-notice {
  max-width: 860px;
  margin: 14px 0 0 !important;
  padding: 12px 14px;
  color: #7c2d12 !important;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: var(--uav-radius);
  font-size: 14px !important;
  font-weight: 700;
  line-height: 1.7 !important;
}
.uav-first-only-notice strong {
  color: #9a3412;
}
.uav-primary,
.uav-secondary,
.uav-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--uav-radius);
  font-weight: 900;
}
.uav-primary {
  color: #fff;
  background: var(--uav-blue);
  border: 1px solid var(--uav-blue);
  box-shadow: 0 10px 24px rgba(11, 99, 216, .22);
}
.uav-primary:hover {
  background: var(--uav-blue-dark);
}
.uav-primary:disabled {
  opacity: .45;
  box-shadow: none;
}
.uav-secondary,
.uav-ghost {
  color: var(--uav-blue);
  background: var(--uav-surface);
  border: 1px solid var(--uav-line-strong);
}
.uav-hero-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 22px;
  background: #E6F7FF;
  border: 1px solid var(--uav-line);
  border-radius: var(--uav-radius);
}
.uav-ring {
  --uav-ring-value: 0%;
  display: grid;
  place-items: center;
  width: 92px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--uav-blue) var(--uav-ring-value), #dfe6ef 0);
}
.uav-ring::before {
  content: "";
  grid-area: 1 / 1;
  width: 66%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--uav-surface);
}
.uav-ring span {
  position: relative;
  grid-area: 1 / 1;
  color: var(--uav-blue);
  font-size: 22px;
  font-weight: 900;
}
.uav-hero-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}
.uav-hero-card div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--uav-line);
}
.uav-hero-card div:first-child {
  padding-top: 0;
  border-top: 0;
}
.uav-hero-card dt,
.uav-hero-card dd {
  margin: 0;
  font-weight: 900;
}
.uav-hero-card dt {
  color: var(--uav-muted);
}
.uav-hero-card dd {
  color: var(--uav-blue);
}
.uav-study-shell {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
  padding: 26px 28px 18px;
  background: var(--uav-bg);
  border-right: 1px solid var(--uav-line);
  border-bottom: 1px solid var(--uav-line);
  border-left: 1px solid var(--uav-line);
}
.uav-chapter-rail,
.uav-side-panel {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 12px;
}
.uav-chapter-rail,
.uav-side-panel section,
.uav-review-link,
.uav-question-card,
.uav-progress-card,
.uav-chapter-card {
  background: var(--uav-surface);
  border: 1px solid var(--uav-line);
  border-radius: var(--uav-radius);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}
.uav-chapter-rail {
  padding: 18px;
}
.uav-rail-title {
  font-weight: 900;
}
.uav-chapter-rail button {
  width: 100%;
  padding: 12px 13px;
  color: #334155;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--uav-radius);
  font-weight: 800;
}
.uav-chapter-rail button.is-active {
  color: var(--uav-blue);
  background: var(--uav-blue-soft);
  border-color: #bad8ff;
}
.uav-main-panel {
  min-width: 0;
}
.uav-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}
.uav-counter {
  color: #0f172a;
  font-weight: 900;
}
.uav-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 36px;
  padding: 6px 12px;
  color: #0f172a;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  font-weight: 900;
}
.uav-timer[hidden] {
  display: none;
}
.uav-timer.is-warning {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}
.uav-timer.is-finished {
  color: #334155;
  background: #f1f5f9;
  border-color: #d9e2ef;
}
.uav-question-card {
  padding: 24px;
}
.uav-question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.uav-question-meta span,
.uav-tag {
  display: inline-flex;
  padding: 6px 10px;
  color: var(--uav-blue);
  background: var(--uav-blue-soft);
  border: 1px solid #cfe4ff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}
.uav-question-card h2 {
  margin: 0 0 12px;
  font-size: 22px;
}
.uav-question-text {
  margin: 0 0 22px;
  font-size: clamp(18px, 2.3vw, 22px);
  font-weight: 900;
  line-height: 1.65;
}
.uav-choice-list {
  display: grid;
  gap: 12px;
}
.uav-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 14px 16px;
  color: var(--uav-text);
  text-align: left;
  background: #fff;
  border: 1px solid var(--uav-line);
  border-radius: var(--uav-radius);
  font-weight: 900;
  line-height: 1.5;
}
.uav-choice:not(:disabled):hover {
  border-color: #89b9f5;
  background: #E6F7FF;
}
.uav-choice-letter,
.uav-mini-letter {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #d9e2ef;
  border-radius: var(--uav-radius);
  font-weight: 900;
}
.uav-choice.is-correct {
  color: #14532d;
  background: var(--uav-green-soft);
  border-color: #65a979;
}
.uav-choice.is-correct .uav-choice-letter,
.uav-mini-letter.is-correct {
  color: var(--uav-green);
  background: #c9f3d6;
  border-color: #b4e6c4;
}
.uav-choice.is-incorrect {
  color: #7f1d1d;
  background: var(--uav-red-soft);
  border-color: #f87171;
}
.uav-choice.is-incorrect .uav-choice-letter {
  color: var(--uav-red);
  background: #fee2e2;
  border-color: #fecaca;
}
.uav-choice.is-muted {
  opacity: .64;
}
.uav-answer {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid #b9e7c6;
  border-radius: var(--uav-radius);
  background: var(--uav-green-soft);
}
.uav-answer.is-incorrect {
  border-color: #fecaca;
  background: var(--uav-red-soft);
}
.uav-answer-title {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 19px;
  font-weight: 900;
}
.uav-answer-title strong {
  color: var(--uav-green);
}
.uav-answer.is-incorrect .uav-answer-title strong {
  color: var(--uav-red);
}
.uav-answer p {
  margin: 0;
  line-height: 1.75;
  font-weight: 700;
}
.uav-answer h3 {
  margin: 0;
  font-size: 16px;
}
.uav-answer ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.uav-answer li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  line-height: 1.6;
}
.uav-mini-letter {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 13px;
}
.uav-source-line {
  color: #334155;
  font-size: 14px;
  font-weight: 900;
}
.uav-card-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}
.uav-card-actions-next {
  justify-content: flex-end;
}
.uav-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--uav-line);
}
.uav-side-panel section,
.uav-review-link,
.uav-exam-link {
  display: grid;
  gap: 6px;
  padding: 20px;
  text-align: left;
}
.uav-side-panel span,
.uav-side-panel small {
  color: var(--uav-muted);
  font-weight: 800;
}
.uav-side-panel strong {
  color: var(--uav-blue);
  font-size: 30px;
  line-height: 1.1;
}
.uav-review-link {
  color: var(--uav-red);
  border-color: #fecaca;
  font-weight: 900;
}
.uav-review-link strong {
  color: var(--uav-red);
  font-size: 24px;
}
.uav-exam-link {
  color: var(--uav-blue);
  background: #ffffff;
  border: 1px solid #bad8ff;
  border-radius: var(--uav-radius);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
  font-weight: 900;
}
.uav-exam-link strong {
  color: var(--uav-blue);
  font-size: 22px;
}
.uav-progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.uav-progress-card {
  padding: 20px;
}
.uav-progress-card span,
.uav-progress-card small {
  display: block;
  color: var(--uav-muted);
  font-weight: 800;
}
.uav-progress-card strong {
  display: block;
  margin: 7px 0;
  color: var(--uav-blue);
  font-size: 30px;
}
.uav-chapter-list {
  display: grid;
  gap: 12px;
}
.uav-chapter-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 18px;
}
.uav-chapter-card h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.uav-chapter-card p {
  margin: 0;
  color: var(--uav-muted);
  font-weight: 700;
}
.uav-empty {
  padding: 32px;
  text-align: center;
}
.uav-empty h2 {
  margin: 0 0 10px;
}
.uav-empty p {
  color: var(--uav-muted);
}
@media (max-width: 1180px) {
  .uav-page-header,
  .uav-hero,
  .uav-study-shell {
    grid-template-columns: 1fr;
  }
  .uav-chapter-rail,
  .uav-side-panel {
    position: static;
  }
  .uav-chapter-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .uav-rail-title {
    grid-column: 1 / -1;
  }
  .uav-side-panel,
  .uav-progress-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .uav-page-header,
  .uav-hero {
    padding: 16px 14px;
  }
  .uav-study-shell {
    padding: 16px 14px 16px;
  }
  .uav-brand {
    gap: 10px;
  }
  .uav-brand-mark {
    width: 46px;
    height: 38px;
  }
  .uav-brand strong {
    font-size: 16px;
  }
  .uav-brand small {
    font-size: 12px;
  }
  .uav-question-card,
  .uav-progress-card,
  .uav-chapter-card {
    padding: 18px;
  }
  .uav-side-panel,
  .uav-progress-grid,
  .uav-chapter-rail,
  .uav-hero-card {
    grid-template-columns: 1fr;
  }
  .uav-toolbar,
  .uav-card-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .uav-primary,
  .uav-secondary,
  .uav-ghost {
    width: 100%;
  }
  .uav-choice {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 72px;
  }
  .uav-choice span:last-child {
    grid-column: 2;
  }
  .uav-chapter-card {
    grid-template-columns: 1fr;
  }
}


/* SP only: show the next button inside the correct/incorrect answer panel. */
@media (max-width: 760px) {
  .uav-mobile-answer-next {
    display: inline-flex;
    width: 100%;
    margin-top: 12px;
  }
  .uav-question-card.is-answered .uav-card-actions-next {
    display: none;
  }
}
@media (min-width: 761px) {
  .uav-mobile-answer-next {
    display: none !important;
  }
}

/* SWELL/theme interference guard: keep this quiz UI independent from article heading/button styles. */
.uav-tbt-fixed-page.uav-tbt-fixed-page {
  isolation: isolate;
  text-align: left !important;
}
.uav-tbt-fixed-page.uav-tbt-fixed-page :where(header, nav, main, aside, section, article, div, p, h1, h2, h3, ul, li, dl, dt, dd, span, strong, small, button) {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: 0 !important;
}
.uav-tbt-fixed-page.uav-tbt-fixed-page :where(h1, h2, h3) {
  border: 0 !important;
  border-left: 0 !important;
  border-bottom: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  text-decoration: none !important;
}
.uav-tbt-fixed-page.uav-tbt-fixed-page :where(h1, h2, h3)::before,
.uav-tbt-fixed-page.uav-tbt-fixed-page :where(h1, h2, h3)::after {
  content: none !important;
  display: none !important;
}
.uav-tbt-fixed-page.uav-tbt-fixed-page .uav-hero h1 {
  margin: 14px 0 12px !important;
  color: var(--uav-text) !important;
  font-size: clamp(30px, 4.4vw, 54px) !important;
  font-weight: 900 !important;
  line-height: 1.08 !important;
}
.uav-tbt-fixed-page.uav-tbt-fixed-page .uav-question-card h2,
.uav-tbt-fixed-page.uav-tbt-fixed-page .uav-chapter-card h2,
.uav-tbt-fixed-page.uav-tbt-fixed-page .uav-empty h2 {
  margin: 0 0 12px !important;
  color: var(--uav-text) !important;
  font-size: 22px !important;
  font-weight: 900 !important;
  line-height: 1.35 !important;
}
.uav-tbt-fixed-page.uav-tbt-fixed-page .uav-chapter-card h2 {
  margin: 0 0 4px !important;
  font-size: 18px !important;
}
.uav-tbt-fixed-page.uav-tbt-fixed-page .uav-exam-link {
  background: #ffffff !important;
  border: 1px solid #bad8ff !important;
}

.uav-tbt-fixed-page.uav-tbt-fixed-page :where(button, .uav-primary, .uav-secondary, .uav-ghost, .uav-choice, .uav-review-link) {
  text-decoration: none !important;
  transform: none;
}
.uav-tbt-fixed-page.uav-tbt-fixed-page button::before,
.uav-tbt-fixed-page.uav-tbt-fixed-page button::after {
  content: none !important;
  display: none !important;
}
