.isost-test {
  max-width: 920px;
  margin: 0 auto;
  color: #1f2937;
  font-family: inherit;
}

.isost-panel,
.isost-box {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 24px;
  background: #ffffff;
}

.isost-hidden {
  display: none !important;
}

/* The Speaking Test uses the Learner System's saved-language control without
 * loading the Learner System's complete frontend stylesheet. */
.isost-test .isols-language-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 0 0 18px;
}

.isost-test .isols-language-selector label {
  display: grid;
  gap: 5px;
  margin: 0;
}

.isost-test .isols-language-selector__heading {
  font-weight: 700;
  line-height: 1.4;
}

.isost-test .isols-language-selector select {
  min-width: 170px;
  min-height: 42px;
  border: 1px solid #9ca3af;
  border-radius: 6px;
  padding: 8px 34px 8px 10px;
  background: #ffffff;
  color: #1f2937;
  font: inherit;
}

.isost-test .isols-language-selector select:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

.isost-test .isols-language-selector noscript {
  display: block;
}

.isost-test .isols-language-selector .isols-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  background: #0f766e;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

/* This stylesheet is enqueued only by a Speaking Test shortcode, so the
 * public-site TranslatePress switcher remains untouched elsewhere. */
.trp-language-switcher.trp-floating-switcher,
#trp-floater-ls {
  display: none !important;
}

.isost-instructions {
  margin: 16px 0 20px;
  padding-left: 22px;
}

.isost-instructions li {
  margin: 7px 0;
}

.isost-confirmations {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
}

.isost-confirmations h3 {
  margin: 0 0 4px;
  color: #0f172a;
  font-size: 18px;
}

.isost-confirmations label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #1f2937;
  font-weight: 700;
  line-height: 1.45;
}

.isost-confirmations input {
  margin-top: 4px;
}

.isost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  background: #0f766e;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.isost-button:hover,
.isost-button:focus {
  color: #ffffff;
  background: #115e59;
}

.isost-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.isost-button-secondary {
  background: #334155;
}

.isost-test-bar {
  position: relative;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 12px 14px;
  background: #eef2ff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.isost-test-bar-main {
  display: grid;
  gap: 5px;
  min-width: 220px;
}

body.admin-bar .isost-test-bar {
  top: 44px;
}

.isost-test-bar strong {
  color: #111827;
  font-size: 18px;
}

.isost-floating-timer {
  position: fixed;
  top: 48px;
  right: 16px;
  z-index: 9999;
  display: grid;
  gap: 2px;
  min-width: 180px;
  border: 1px solid #0f766e;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  color: #111827;
}

body.admin-bar .isost-floating-timer {
  top: 64px;
}

.isost-floating-timer span {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.isost-floating-timer strong {
  color: #0f766e;
  font-size: 24px;
  line-height: 1;
}

.isost-finish-practice {
  white-space: normal;
  text-align: center;
}

.isost-floating-finish {
  margin-top: 5px;
  border: 0;
  border-radius: 6px;
  padding: 7px 9px;
  background: #334155;
  color: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.isost-floating-finish:hover,
.isost-floating-finish:focus {
  background: #1e293b;
  color: #ffffff;
}

/* One persistent practice finish/review action; real-test presentation is unchanged. */
.isost-test[data-mode="sample"] [data-screen="test"] {
  padding-bottom: 160px;
}

.isost-test[data-mode="sample"] .isost-floating-timer,
body.admin-bar .isost-test[data-mode="sample"] .isost-floating-timer {
  top: auto;
  bottom: 16px;
  max-width: min(320px, calc(100vw - 48px));
  box-sizing: border-box;
}

.isost-test[data-mode="sample"] .isost-floating-finish {
  min-height: 44px;
  white-space: normal;
  font-size: 14px;
  line-height: 1.4;
}

.isost-topic {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.isost-test-bar + .isost-accordion,
.isost-floating-timer + .isost-accordion {
  clear: both;
  margin-top: 8px;
}

.isost-topic-toggle {
  width: 100%;
  border: 0;
  padding: 18px 20px;
  background: #e0f2fe;
  color: #0f3f5e;
  text-align: left;
  font: inherit;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
}

.isost-topic-toggle:hover,
.isost-topic-toggle:focus {
  background: #bae6fd;
  color: #0c4a6e;
}

.isost-topic-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.isost-question {
  display: grid;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
}

.isost-question p {
  margin: 0;
}

.isost-question-text {
  color: #111827;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.45;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
}

.isost-question-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.isost-question-note {
  color: #475569;
  font-weight: 700;
}

.isost-error {
  color: #b91c1c;
  font-weight: 800;
}

.isost-player {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
}

.isost-player audio {
  width: 100%;
}

[data-isost-result-message] {
  white-space: pre-line;
}

@media (max-width: 640px) {
  .isost-panel,
  .isost-box {
    padding: 18px;
  }

  .isost-test-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .isost-test-bar-main,
  .isost-finish-practice {
    width: 100%;
  }

  .isost-floating-timer {
    top: auto;
    right: 12px;
    bottom: 16px;
    min-width: 150px;
    padding: 9px 11px;
  }

  body.admin-bar .isost-floating-timer {
    top: auto;
    bottom: 16px;
  }

  .isost-floating-timer strong {
    font-size: 22px;
  }

  .isost-topic-toggle {
    padding: 16px;
    font-size: 23px;
  }
}

/* Shared practice/real interface styling; no state or positioning changes. */
.isost-panel,
.isost-box,
.isost-topic {
  border-color: #e2e8f0;
  border-radius: 12px;
}

.isost-panel > h2,
.isost-box > h2 {
  margin: 0 0 16px;
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
}

.isost-panel > h3,
.isost-confirmations h3 {
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  color: #0f172a;
}

.isost-instructions,
.isost-panel > p,
.isost-confirmations label {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: #334155;
}

.isost-confirmations,
.isost-test-bar {
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: none;
}

.isost-topic-toggle {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  padding: 16px;
  background: #f8fafc;
  color: #0f172a;
}

.isost-topic-toggle:hover,
.isost-topic-toggle:focus {
  background: #f0fdfa;
  color: #115e59;
}

.isost-question {
  border: 0;
  border-radius: 0;
  padding: 12px 0;
  gap: 12px;
}

.isost-question + .isost-question {
  border-top: 1px solid #e2e8f0;
}

.isost-question-text {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.6;
  color: #334155;
  border: 0;
  padding-bottom: 0;
}

.isost-question-note,
.isost-test-bar-main > span {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.6;
  color: #475569;
}

.isost-test-bar strong {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: #334155;
}

.isost-test-bar strong,
.isost-floating-timer strong {
  font-variant-numeric: tabular-nums;
}

.isost-floating-timer {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.isost-floating-timer span {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  text-transform: none;
}

.isost-floating-timer strong {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.2;
}

.isost-button,
.isost-floating-finish,
.isost-test[data-mode="sample"] .isost-floating-finish {
  box-sizing: border-box;
  min-height: 44px;
  max-width: 100%;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
}

.isost-button.isost-button-secondary,
.isost-floating-finish,
.isost-test[data-mode="sample"] .isost-floating-finish {
  background: #f8fafc;
  border-color: #64748b;
  color: #334155;
}

.isost-button.isost-button-secondary:hover,
.isost-button.isost-button-secondary:focus,
.isost-floating-finish:hover,
.isost-floating-finish:focus,
.isost-test[data-mode="sample"] .isost-floating-finish:hover,
.isost-test[data-mode="sample"] .isost-floating-finish:focus {
  background: #e2e8f0;
  color: #0f172a;
}

.isost-test .isost-error {
  color: #b91c1c;
  font-weight: 600;
}

.isost-test :is(button, a, input, select, audio):focus-visible {
  outline: 3px solid #0f766e;
  outline-offset: 3px;
}

.isost-test-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.isost-question-saved {
  background: #f0fdfa;
}

.isost-finish-dialog {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.64);
}

.isost-finish-dialog.isost-hidden {
  display: none;
}

.isost-finish-dialog-card {
  width: min(100%, 560px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.isost-finish-dialog-card h3 {
  margin-top: 0;
}

.isost-finish-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* Topic containers clip overflow: draw their button focus indicator inside. */
.isost-topic-toggle:focus-visible {
  outline-offset: -3px;
}

@media (max-width: 640px) {
  .isost-panel > h2,
  .isost-box > h2 {
    font-size: 1.375rem;
  }

  .isost-topic-toggle {
    font-size: 1.125rem;
  }
}
