:root {
  color-scheme: light;
  --ink: #20242a;
  --muted: #667085;
  --line: #d0d5dd;
  --page: #f4f6f8;
  --panel: #ffffff;
  --accent: #0f766e;
  --danger: #b42318;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--page);
  color: var(--ink);
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: flex-start;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 2;
}

main {
  margin: 0 auto;
  max-width: 1120px;
  padding: 24px 20px 48px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 750;
  gap: 6px;
  letter-spacing: 0;
  text-transform: uppercase;
}

input,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 40px;
  padding: 9px 11px;
  text-transform: none;
  width: 100%;
}

textarea {
  line-height: 1.45;
  min-height: 136px;
  resize: vertical;
}

button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
  min-height: 40px;
  padding: 0 14px;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.danger {
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.deck-title {
  margin: 0 auto 26px;
  max-width: 560px;
  text-align: center;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.slides-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

h1 {
  font-size: 22px;
  line-height: 1.1;
  margin: 0;
}

#slideCount {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.slides-form {
  display: grid;
  gap: 14px;
}

.add-slide-bottom {
  margin-top: 14px;
  width: 100%;
}

.slide-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 16px;
  scroll-margin-top: 140px;
  scroll-margin-bottom: 16px;
}

.slide-card-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.slide-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slide-number {
  font-size: 14px;
  font-weight: 800;
}

.language-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.language-grid.english-only {
  grid-template-columns: 1fr;
}

.language-grid [hidden] {
  display: none;
}

.language-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  text-transform: none;
}

.language-toggle input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
}

.busy {
  opacity: 0.65;
  pointer-events: none;
}

@media (max-width: 720px) {
  .topbar {
    align-items: stretch;
  }

  .deck-title {
    max-width: none;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button {
    flex: 1 1 130px;
  }

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