:root {
  color-scheme: dark;
  --bg: #0c0f14;
  --body-bg:
    radial-gradient(circle at top left, rgba(98, 213, 162, 0.14), transparent 32rem),
    linear-gradient(135deg, #0c0f14 0%, #121722 55%, #151214 100%);
  --panel: #141922;
  --panel-strong: #192231;
  --panel-glass: rgba(20, 25, 34, 0.86);
  --modal-bg: rgba(20, 25, 34, 0.97);
  --backdrop: rgba(3, 6, 12, 0.62);
  --button-bg: #202a39;
  --button-hover: #263346;
  --input-bg: #101620;
  --track-bg: #252d3b;
  --surface-border: rgba(255, 255, 255, 0.08);
  --text: #eef3f8;
  --muted: #9aa8b8;
  --line: #293344;
  --accent: #62d5a2;
  --accent-strong: #22b978;
  --danger: #ff6b7b;
  --danger-strong: #e8475f;
  --warn: #f0be5a;
  --focus: #8bc9ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --body-bg:
    radial-gradient(circle at top left, rgba(34, 185, 120, 0.13), transparent 32rem),
    linear-gradient(135deg, #f7fafc 0%, #edf3f8 58%, #f8f4ef 100%);
  --panel: #ffffff;
  --panel-strong: #f4f7fb;
  --panel-glass: rgba(255, 255, 255, 0.88);
  --modal-bg: rgba(255, 255, 255, 0.98);
  --backdrop: rgba(22, 30, 42, 0.28);
  --button-bg: #eef3f8;
  --button-hover: #e3ebf4;
  --input-bg: #ffffff;
  --track-bg: #dce5ef;
  --surface-border: rgba(20, 31, 45, 0.1);
  --text: #142033;
  --muted: #5e6d7e;
  --line: #ccd8e4;
  --accent: #1fa873;
  --accent-strong: #16885d;
  --danger: #d9344f;
  --danger-strong: #b82740;
  --warn: #a86a08;
  --focus: #236fac;
  --shadow: 0 18px 48px rgba(30, 45, 68, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--body-bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.app-shell {
  width: min(980px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  align-content: baseline;
  gap: 18px;
}

.progress-panel,
.quiz-panel,
.previous-panel {
  border: 1px solid var(--surface-border);
  background: var(--panel-glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.settings-button {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--button-bg);
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.settings-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-button:hover,
.settings-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(139, 201, 255, 0.7);
  outline: none;
  background: var(--button-hover);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: start end;
  padding: 78px 18px 18px;
  background: var(--backdrop);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none;
}

.settings-modal {
  width: min(420px, calc(100vw - 36px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: var(--modal-bg);
  box-shadow: var(--shadow);
  padding: 14px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 800;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--button-bg);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.segmented-control {
  min-height: 42px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.segmented-control button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  transition: background 160ms ease, color 160ms ease;
}

.segmented-control[aria-label="Cevaplama biçimi"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segmented-control button:hover,
.segmented-control button:focus-visible {
  color: var(--text);
  outline: none;
  background: var(--button-bg);
}

.segmented-control button.active {
  color: #07100c;
  background: var(--accent);
  font-weight: 800;
}

.toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-strong);
  user-select: none;
  justify-content: center;
}

.select-row,
.number-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-strong);
}

.select-row span,
.number-row span {
  font-weight: 800;
}

.select-row select,
.number-row select {
  min-width: 0;
  min-height: 32px;
  border: 1px solid #344052;
  border-radius: 6px;
  color: var(--text);
  background: var(--input-bg);
  outline: none;
}

.select-row select[multiple] {
  min-height: 168px;
  padding: 4px;
}

.select-row small {
  grid-column: 1 / -1;
  margin-top: -5px;
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 0.72rem;
}

.select-row select:focus,
.number-row select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(139, 201, 255, 0.12);
}

.saved-sessions {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.saved-title {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.saved-list {
  display: grid;
  gap: 6px;
}

.saved-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.saved-session-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  background: var(--input-bg);
}

.saved-session-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.82rem;
}

.saved-delete {
  border: 0;
  padding: 0;
  color: #ffb3b3;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
}

.saved-delete:hover,
.saved-delete:focus-visible {
  color: #ffd2d2;
  outline: none;
  text-decoration: underline;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.ghost-button,
.file-button,
.answer-form button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--button-bg);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.ghost-button {
  padding: 0 14px;
  width: 100%;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  width: 100%;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ghost-button:hover,
.file-button:hover,
.answer-form button:hover {
  transform: translateY(-1px);
  border-color: rgba(139, 201, 255, 0.7);
  background: var(--button-hover);
}

.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.progress-panel {
  padding: 14px 16px;
  border-radius: 8px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

#scoreText {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pool-group {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pool-link {
  border: 0;
  padding: 0;
  color: var(--focus);
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
}

.pool-link:hover,
.pool-link:focus-visible {
  outline: none;
  text-decoration: underline;
}

.pool-link[hidden] {
  display: none;
}

.score-link {
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
}

.score-link:not(:disabled):hover,
.score-link:not(:disabled):focus-visible {
  color: var(--focus);
  outline: none;
  text-decoration: underline;
}

.score-link:disabled {
  cursor: default;
  opacity: 0.55;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track-bg);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #8bc9ff);
  transition: width 320ms ease;
}

.quiz-panel {
  position: relative;
  padding: clamp(18px, 4vw, 34px);
  padding-bottom: clamp(62px, 7vw, 72px);
  border-radius: 8px;
}

.skip-button {
  position: absolute;
  right: clamp(18px, 4vw, 34px);
  bottom: 18px;
  min-height: 34px;
  border: 0;
  padding: 0 4px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 700;
}

.skip-button:not(:disabled):hover,
.skip-button:not(:disabled):focus-visible {
  color: var(--danger);
  outline: none;
  text-decoration: underline;
}

.skip-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.completion-panel {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(30px, 7vw, 64px);
  border-radius: 8px;
  text-align: center;
}

.completion-panel[hidden] {
  display: none;
}

.completion-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #07100c;
  background: var(--accent);
  font-size: 1.8rem;
  font-weight: 900;
}

.completion-panel h2,
.completion-panel p {
  margin: 0;
}

.completion-panel p {
  max-width: 650px;
  color: var(--muted);
  line-height: 1.6;
}

.completion-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.completion-actions button {
  min-height: 42px;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--text);
  background: var(--button-bg);
  font: inherit;
}

.completion-actions button:hover,
.completion-actions button:focus-visible {
  border-color: var(--focus);
  outline: none;
  background: var(--button-hover);
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #07100c;
  background: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.badge.muted {
  color: var(--text);
  background: var(--button-bg);
}

.prompt-area {
  min-height: 142px;
  display: grid;
  align-content: center;
  justify-items: center;
  margin-bottom: 26px;
  text-align: center;
}

#promptText {
  margin: 0;
  max-width: 100%;
  font-size: clamp(2rem, 6vw, 4.8rem);
  line-height: 1.04;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}

.wrong-list-mark {
  display: inline-block;
  position: relative;
  top: -0.72em;
  margin-left: 0.16em;
  font-size: 0.32em;
  line-height: 1;
  vertical-align: baseline;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(var(--option-columns, 5), minmax(0, 1fr));
  gap: 10px;
}

.options-grid[hidden],
.answer-form[hidden] {
  display: none;
}

.option-button {
  display: grid;
  place-items: center;
  min-height: 88px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-strong);
  text-align: center;
  line-height: 1.25;
  overflow-wrap: anywhere;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.option-button:focus-visible {
  transform: translateY(-2px);
  border-color: var(--focus);
  outline: none;
  box-shadow: 0 12px 28px rgba(139, 201, 255, 0.12);
}

@media (hover: hover) and (pointer: fine) {
  .option-button:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--focus);
    box-shadow: 0 12px 28px rgba(139, 201, 255, 0.12);
  }
}

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

.option-button.correct {
  border-color: rgba(98, 213, 162, 0.95);
  background: rgba(34, 185, 120, 0.2);
  animation: correctPulse 520ms ease;
}

.option-button.wrong {
  border-color: rgba(255, 107, 123, 0.95);
  background: rgba(232, 71, 95, 0.18);
  animation: wrongShake 360ms ease;
}

.answer-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 14px;
}

.typing-hint-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.typing-hint-panel[hidden] {
  display: none;
}

.typing-hint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.answer-form .hint-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  background: var(--button-bg);
}

.answer-form .hint-button:not(:disabled):hover,
.answer-form .hint-button:not(:disabled):focus-visible {
  border-color: var(--focus);
  outline: none;
  background: var(--button-hover);
}

.answer-form .hint-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.typing-mask {
  min-height: 42px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: clamp(1.35rem, 4vw, 2.1rem);
  font-weight: 900;
  letter-spacing: 0;
}

.mask-char {
  min-width: 0.72em;
  min-height: 1.16em;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  line-height: 1;
}

.mask-char.separator {
  min-width: 0.28em;
}

.answer-form .mask-letter {
  min-height: 1.16em;
  border: 1px solid transparent;
  padding: 0;
  color: var(--text);
  background: rgba(139, 201, 255, 0.08);
  font: inherit;
}

.answer-form .mask-letter:not(:disabled):hover,
.answer-form .mask-letter:not(:disabled):focus-visible {
  border-color: var(--focus);
  outline: none;
  transform: none;
  background: rgba(139, 201, 255, 0.16);
}

.answer-form input {
  min-height: 48px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: var(--input-bg);
  outline: none;
}

.answer-form input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(139, 201, 255, 0.12);
}

.answer-form button {
  padding: 0 18px;
}

.example-text,
.synonyms-text,
.feedback-text {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.example-text {
  font-style: italic;
}

.synonyms-text {
  margin-top: 2px;
}

.feedback-text.correct-text {
  color: var(--accent);
}

.feedback-text.wrong-text {
  color: var(--danger);
}

.previous-panel {
  position: relative;
  overflow: visible;
  display: grid;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  opacity: 0.78;
  background: color-mix(in srgb, var(--panel-glass) 45%, transparent);
  box-shadow: none;
  backdrop-filter: blur(8px);
  transition: opacity 180ms ease, background 180ms ease, border-color 180ms ease;
}

.previous-panel:focus-within {
  opacity: 1;
  background: var(--panel-glass);
  border-color: var(--surface-border);
}

.previous-panel[hidden] {
  display: none;
}

.previous-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}

.previous-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.previous-toggle {
  position: relative;
  width: 28px;
  height: 24px;
  text-transform: none;
}

.previous-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.previous-panel.expanded .previous-toggle svg {
  transform: rotate(180deg);
}

.previous-latest,
.previous-list {
  display: grid;
  gap: 6px;
}

.previous-list {
  position: absolute;
  z-index: 18;
  top: 100%;
  left: 0;
  right: 0;
  max-height: min(420px, calc(100vh - 160px));
  overflow: auto;
  display: none;
  padding: 8px 12px;
  border: 1px solid var(--surface-border);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--modal-bg);
  box-shadow: var(--shadow);
}

.previous-panel.expanded .previous-list {
  display: grid;
  gap: 6px;
}

.previous-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 38px;
  padding: 6px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.previous-status {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1;
}

.previous-detail-tooltip {
  position: absolute;
  z-index: 30;
  left: -7px;
  bottom: calc(100% + 9px);
  width: min(420px, calc(100vw - 64px));
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--text);
  background: var(--modal-bg);
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.previous-detail-tooltip::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 100%;
  border: 7px solid transparent;
  border-top-color: var(--surface-border);
}

.previous-status:hover .previous-detail-tooltip,
.previous-status:focus-visible .previous-detail-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.previous-status:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.previous-tooltip-section {
  display: grid;
  gap: 2px;
}

.previous-tooltip-section strong {
  color: var(--accent);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.previous-status.correct {
  color: var(--accent);
}

.previous-status.wrong {
  color: var(--danger);
}

.previous-row:first-child {
  border-top: 0;
}

.previous-list-note {
  padding-top: 7px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  color: var(--muted);
  font-size: 0.76rem;
  text-align: right;
}

.previous-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
}

.previous-row:hover .previous-copy,
.previous-row:focus-within .previous-copy {
  white-space: nowrap;
}

.previous-prompt,
.previous-answer {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.previous-row:hover .previous-prompt,
.previous-row:hover .previous-answer,
.previous-row:focus-within .previous-prompt,
.previous-row:focus-within .previous-answer {
  overflow: hidden;
  white-space: nowrap;
}

.previous-prompt {
  color: var(--text);
  font-weight: 800;
}

.previous-answer {
  color: var(--accent);
}

.previous-meta {
  flex: 0 0 auto;
  display: inline;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.previous-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.previous-state-text {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.text-link {
  border: 0;
  padding: 0;
  color: var(--focus);
  background: transparent;
  font-size: 0.78rem;
  white-space: nowrap;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--accent);
  outline: none;
  text-decoration: underline;
}

.text-link:disabled {
  cursor: default;
  opacity: 0.48;
  text-decoration: none;
}

body.flash-correct .quiz-panel {
  animation: panelCorrect 520ms ease;
}

body.flash-wrong .quiz-panel {
  animation: panelWrong 520ms ease;
}

@keyframes correctPulse {
  0% { box-shadow: 0 0 0 0 rgba(98, 213, 162, 0.35); }
  100% { box-shadow: 0 0 0 16px rgba(98, 213, 162, 0); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@keyframes panelCorrect {
  0% { border-color: rgba(98, 213, 162, 0.9); }
  100% { border-color: rgba(255, 255, 255, 0.08); }
}

@keyframes panelWrong {
  0% { border-color: rgba(255, 107, 123, 0.9); }
  100% { border-color: rgba(255, 255, 255, 0.08); }
}

@media (max-width: 800px) {
  .app-shell {
    width: min(100% - 20px, 640px);
    padding: 10px 0;
    align-content: start;
  }

  .toolbar,
  .toggle,
  .select-row,
  .number-row,
  .file-button,
  .ghost-button {
    width: 100%;
  }

  .settings-button {
    top: 12px;
    right: 12px;
  }

  .modal-backdrop {
    place-items: start center;
    padding: 68px 10px 10px;
  }

  .settings-modal {
    width: min(100%, 420px);
  }

  .ghost-button {
    flex: 1;
  }

  .progress-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .prompt-area {
    min-height: 118px;
    margin-bottom: 20px;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .option-button {
    min-height: 62px;
  }

  .answer-form {
    grid-template-columns: 1fr;
  }

  .previous-panel {
    gap: 8px;
  }

  .previous-list {
    max-height: min(360px, calc(100vh - 130px));
  }

  .previous-row {
    grid-template-columns: auto 1fr;
    gap: 7px;
  }

  .previous-actions {
    grid-column: 2;
  }

  .text-link {
    justify-self: end;
  }

  .previous-actions {
    justify-self: end;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
