:root {
  color-scheme: dark;
  --paper: #101312;
  --panel: #181d1c;
  --panel-strong: #202725;
  --ink: #edf5f1;
  --muted: #9daaa5;
  --line: #303a37;
  --teal: #39c7b8;
  --teal-soft: rgba(57, 199, 184, 0.16);
  --coral: #ff806e;
  --coral-soft: rgba(255, 128, 110, 0.15);
  --yellow: #f4c65f;
  --yellow-soft: rgba(244, 198, 95, 0.18);
  --green: #62d691;
  --green-soft: rgba(98, 214, 145, 0.16);
  --blue: #7ea8ff;
  --blue-soft: rgba(126, 168, 255, 0.18);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

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

html.custom-list-snap {
  scroll-snap-type: y proximity;
  scroll-padding-block-start: 14px;
}

body.custom-list-snap {
  scroll-snap-type: y proximity;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.app-shell.mathstars-admin-shell {
  width: min(1800px, calc(100% - 16px));
  max-width: none;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-right: 52px;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-home {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.brand-home:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
  border-radius: 8px;
}

.brand-art {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.8rem;
  line-height: 1.05;
}

.topbar-logout {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-strong);
}

.topbar-logout:disabled {
  opacity: 0.55;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.26rem;
}

h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.stat-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stat-pill {
  min-width: 104px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.stat-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.stat-pill strong {
  font-size: 1.08rem;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  font-weight: 800;
  white-space: nowrap;
}

.tab-button.is-active {
  color: #061211;
  border-color: var(--teal);
  background: var(--teal);
}

.main {
  min-height: 600px;
}

.login-screen {
  min-height: min(560px, calc(100vh - 150px));
  display: grid;
  place-items: center;
}

.login-card {
  width: min(100%, 420px);
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.field-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.field-label.compact-field {
  margin-right: -4px;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.login-error {
  margin: 0;
  color: var(--coral);
  font-weight: 800;
}

.login-alert {
  margin: 0;
  box-shadow: none;
}

.grid {
  display: grid;
  gap: 16px;
}

.home-screen {
  display: grid;
  gap: 16px;
}

.simple-home {
  min-height: min(520px, calc(100vh - 150px));
  align-content: center;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 118px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: left;
  text-decoration: none;
}

.home-card.primary-card {
  color: #061211;
  border-color: var(--teal);
  background: var(--teal);
}

.home-card.game-card {
  border-color: rgba(244, 198, 95, 0.55);
  background: linear-gradient(135deg, rgba(244, 198, 95, 0.24), var(--panel));
}

.home-card.game-card .home-icon {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.home-card.custom-card {
  border-color: rgba(45, 212, 191, 0.45);
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.18), var(--panel));
}

.home-card.custom-card .home-icon {
  color: var(--teal);
  background: var(--teal-soft);
}

.generation-meta {
  margin-top: 4px;
  color: var(--yellow);
}

.home-card:disabled {
  opacity: 0.58;
  filter: saturate(0.75);
}

.home-card strong,
.home-card small {
  display: block;
}

.home-card strong {
  font-size: 1.06rem;
  line-height: 1.18;
}

.simple-home .home-card strong {
  font-size: 1.18rem;
}

.home-card small {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.35;
}

.home-card.primary-card small {
  color: rgba(6, 18, 17, 0.78);
}

.home-icon {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  color: var(--teal);
  background: var(--teal-soft);
}

.primary-card .home-icon {
  color: #061211;
  background: rgba(255, 255, 255, 0.3);
}

.dashboard-grid {
  grid-template-columns: minmax(280px, 360px) 1fr;
  align-items: start;
}

.two-column {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-body {
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin-bottom: 0;
}

.custom-category-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.custom-category-actions {
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
}

.custom-prompt-toggle {
  grid-column: 1 / -1;
  width: 100%;
}

.custom-category-menu {
  display: flex;
  justify-content: flex-end;
  align-self: flex-start;
}

.custom-title-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.custom-title-row h2 {
  margin-bottom: 0;
}

.custom-title-edit {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border-radius: 5px;
  border-color: transparent;
}

.custom-title-edit .icon {
  width: 11px;
  height: 11px;
}

.custom-name-popover {
  display: grid;
  gap: 9px;
  width: min(100%, 420px);
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(46, 211, 194, 0.36);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.custom-name-cancel {
  justify-self: start;
}

.custom-create-card {
  display: grid;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.custom-create-card h2 {
  margin-bottom: 0;
}

.custom-create-next {
  justify-self: end;
}

.custom-option-grid,
.custom-subject-grid {
  display: grid;
  gap: 10px;
}

.custom-option-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.custom-subject-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.custom-option-button,
.custom-subject-button {
  display: grid;
  gap: 5px;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  text-align: left;
  font: inherit;
  font-weight: 850;
}

.custom-option-button span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.32;
}

.custom-option-button:hover,
.custom-subject-button:hover,
.custom-option-button.is-selected {
  border-color: var(--teal);
  background: rgba(46, 211, 194, 0.11);
}

.custom-prompt-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(5, 8, 7, 0.9);
  backdrop-filter: blur(12px);
}

.custom-prompt-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  width: min(980px, 100%);
  height: min(100%, 980px);
  margin: 0 auto;
}

.custom-prompt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.custom-prompt-head h2 {
  margin-bottom: 0;
}

.custom-prompt-fullscreen {
  min-height: 0;
  height: 100%;
  resize: none;
}

.custom-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.page-back {
  display: flex;
  justify-content: flex-start;
}

.mission-hero {
  display: grid;
  gap: 16px;
}

.progress-shell {
  height: 14px;
  border-radius: 999px;
  background: #27302e;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--green));
  transition: width 180ms ease;
}

.mission-count {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.mission-count strong {
  font-size: 2rem;
  line-height: 1;
}

.muted {
  color: var(--muted);
}

.subject-list {
  display: grid;
  gap: 9px;
}

.subject-row,
.level-row,
.set-row,
.mistake-row,
.reward-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.subject-meta,
.level-meta {
  display: grid;
  gap: 5px;
}

.api-log-row {
  align-items: start;
}

.api-log-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.api-log-error {
  color: var(--coral);
  overflow-wrap: anywhere;
}

.set-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.custom-category-list,
.custom-set-list,
.custom-import-box {
  display: grid;
  gap: 10px;
}

.custom-category-list {
  margin-top: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.custom-import-box {
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.custom-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.custom-json-input {
  min-height: 230px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
}

.custom-prompt-input {
  min-height: 360px;
  font-family: -apple-system-body, ui-sans-serif, -apple-system, "system-ui", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, "sans-serif";
  font-size: 0.96rem;
}

.custom-question-list {
  display: grid;
  gap: 16px;
}

.custom-list-question {
  display: grid;
  gap: 14px;
  scroll-snap-align: start;
  scroll-margin-block-start: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.custom-list-question-head {
  display: grid;
  gap: 8px;
}

.custom-list-question h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.custom-list-options {
  display: grid;
  gap: 8px;
}

.custom-list-helper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-list-option {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.custom-list-option:disabled {
  cursor: default;
  opacity: 1;
}

.custom-list-option:not(:disabled):hover {
  border-color: rgba(45, 212, 191, 0.55);
  background: rgba(45, 212, 191, 0.08);
}

.custom-list-option strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 8px;
  color: var(--teal);
  background: var(--teal-soft);
}

.custom-list-option.is-correct {
  border-color: rgba(74, 222, 128, 0.65);
  background: var(--green-soft);
}

.custom-list-option.is-wrong {
  border-color: rgba(255, 127, 112, 0.65);
  background: var(--coral-soft);
}

.helper-button.is-active {
  border-color: rgba(45, 212, 191, 0.75);
  background: rgba(45, 212, 191, 0.12);
}

.custom-list-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.custom-list-box h4 {
  margin: 0;
  font-size: 0.98rem;
}

.custom-list-box p {
  margin: 0;
}

.custom-list-word-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.subject-name,
.level-name,
.reward-name {
  font-weight: 850;
}

.subject-track,
.level-track {
  height: 8px;
  border-radius: 999px;
  background: #27302e;
  overflow: hidden;
}

.subject-track span,
.level-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--yellow);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--yellow);
  background: var(--yellow-soft);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.badge.teal {
  color: var(--teal);
  background: var(--teal-soft);
}

.badge.coral {
  color: var(--coral);
  background: var(--coral-soft);
}

.badge.green {
  color: var(--green);
  background: var(--green-soft);
}

.action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.left-actions {
  justify-content: flex-start;
}

.mathstars-command-center {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(126, 168, 255, 0.16);
  border-radius: 12px;
  background: #0b1120;
  box-shadow: var(--shadow);
}

.mathstars-admin-shell .mathstars-command-center {
  padding: 16px;
}

.mathstars-admin-nav,
.mathstars-monitor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mathstars-eyebrow,
.mathstars-kpi-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8ea3c7;
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mathstars-admin-nav h2,
.mathstars-monitor-head h3,
.mathstars-settings-content h3 {
  margin: 0;
}

.mathstars-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mathstars-live-pill,
.mathstars-activity-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid rgba(57, 199, 184, 0.32);
  border-radius: 999px;
  color: #a7f3d0;
  background: rgba(20, 184, 166, 0.12);
  font-size: 0.78rem;
  font-weight: 850;
}

.mathstars-live-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 12px rgba(98, 214, 145, 0.75);
}

.mathstars-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.mathstars-kpi-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-height: 128px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: #111827;
}

.mathstars-kpi-card > div:first-child {
  min-width: 0;
}

.mathstars-kpi-card strong {
  display: block;
  margin: 6px 0 3px;
  font-size: 1.65rem;
  line-height: 1;
  overflow-wrap: anywhere;
}

.mathstars-kpi-card .small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.mathstars-kpi-card.teal strong,
.mathstars-sparkline.teal span {
  color: var(--teal);
  background: var(--teal);
}

.mathstars-kpi-card.green strong,
.mathstars-sparkline.green span {
  color: var(--green);
  background: var(--green);
}

.mathstars-kpi-card.blue strong,
.mathstars-sparkline.blue span {
  color: var(--blue);
  background: var(--blue);
}

.mathstars-kpi-card.yellow strong,
.mathstars-sparkline.yellow span {
  color: var(--yellow);
  background: var(--yellow);
}

.mathstars-kpi-card.coral strong,
.mathstars-sparkline.coral span {
  color: var(--coral);
  background: var(--coral);
}

.mathstars-kpi-side {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.mathstars-sparkline {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 3px;
  height: 38px;
  min-width: 48px;
  margin-left: auto;
  order: 2;
}

.mathstars-sparkline span {
  width: 5px;
  border-radius: 999px 999px 0 0;
  opacity: 0.82;
}

.mathstars-trend {
  min-width: 0;
  max-width: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: left;
}

.mathstars-table-shell {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: #111827;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mathstars-kid-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
}

.mathstars-kid-table th,
.mathstars-kid-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
  vertical-align: middle;
}

.mathstars-kid-table th {
  color: #8ea3c7;
  background: #0f172a;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mathstars-kid-table tbody tr:last-child td {
  border-bottom: 0;
}

.mathstars-kid-table tbody tr.needs-attention {
  background: rgba(255, 128, 110, 0.05);
}

.mathstars-kid-table tbody tr:hover {
  background: rgba(126, 168, 255, 0.04);
}

.mathstars-kid-identity {
  display: grid;
  gap: 6px;
  min-width: 170px;
}

.mathstars-table-value {
  display: block;
  min-width: 44px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.1;
  white-space: nowrap;
}

.mathstars-table-value.bad {
  color: var(--coral);
}

.mathstars-table-value.ok {
  color: var(--blue);
}

.mathstars-table-value.good {
  color: var(--green);
}

.mathstars-wallet-metric {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  white-space: nowrap;
}

.mathstars-wallet-metric .mathstars-token {
  width: 24px;
  height: 24px;
}

.mathstars-wallet-metric strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mathstars-mini-metric {
  display: grid;
  gap: 5px;
  min-width: 72px;
}

.mathstars-mini-metric strong {
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
}

.mathstars-mini-metric > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.mathstars-mini-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.mathstars-mini-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.mathstars-mini-metric.bad strong {
  color: var(--coral);
}

.mathstars-mini-metric.ok strong {
  color: var(--blue);
}

.mathstars-mini-metric.good strong {
  color: var(--green);
}

.mathstars-mini-metric.bad .mathstars-mini-track span {
  background: var(--coral);
}

.mathstars-mini-metric.ok .mathstars-mini-track span {
  background: var(--blue);
}

.mathstars-mini-metric.good .mathstars-mini-track span {
  background: var(--green);
}

.mathstars-actions-cell {
  width: 1%;
}

.mathstars-child-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mathstars-warning {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-left: 4px;
  border-radius: 999px;
  color: var(--coral);
  background: var(--coral-soft);
}

.action-menu {
  position: relative;
}

.action-menu summary {
  list-style: none;
}

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

.action-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  color: var(--ink);
  background: #0f172a;
  cursor: pointer;
}

.action-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 8;
  display: grid;
  gap: 6px;
  min-width: 210px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: #0f172a;
  box-shadow: var(--shadow);
}

.action-menu-item {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.action-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.action-menu-item.danger {
  color: var(--coral);
}

.mathstars-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.26));
}

.mathstars-token-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.mathstars-settings-drawer {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: #111827;
}

.mathstars-settings-drawer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

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

.mathstars-settings-content {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

.mathstars-settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mathstars-prize-table {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.mathstars-prize-header,
.mathstars-prize-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.mathstars-prize-header {
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.compact-empty {
  padding: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-strong);
  font-weight: 850;
  text-decoration: none;
}

.button.icon-only {
  width: 42px;
  padding: 0;
}

.button.primary {
  color: #061211;
  border-color: var(--teal);
  background: var(--teal);
}

.button.secondary {
  color: #081220;
  border-color: var(--blue);
  background: var(--blue);
}

.button.danger {
  color: #1b0907;
  border-color: var(--coral);
  background: var(--coral);
}

.button:disabled,
.option-button:disabled,
.helper-button:disabled {
  opacity: 0.55;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.question-panel {
  display: grid;
  gap: 16px;
}

.practice-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.practice-layout {
  display: grid;
  gap: 16px;
}

.browse-swipe-zone {
  display: grid;
  gap: 16px;
  touch-action: pan-y;
}

.correct-confirmation {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: min(460px, calc(100vh - 170px));
  padding: 42px 20px;
  border: 1px solid rgba(98, 214, 145, 0.42);
  border-radius: 8px;
  background:
    radial-gradient(circle at top, rgba(98, 214, 145, 0.16), transparent 44%),
    var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
  align-content: center;
}

.confirm-mark {
  display: inline-grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border-radius: 999px;
  color: #061211;
  background: var(--green);
  box-shadow: 0 0 0 10px var(--green-soft);
}

.confirm-mark .icon {
  width: 34px;
  height: 34px;
}

.correct-confirmation h2 {
  margin-bottom: 8px;
  font-size: 1.9rem;
}

.confirm-next {
  margin: 6px 0 0;
  color: var(--green);
  font-weight: 850;
}

.question-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.question-title {
  margin: 0;
  font-size: 1.24rem;
  line-height: 1.35;
}

mjx-container {
  color: inherit;
  font-size: 1.05em;
}

.option-button mjx-container {
  margin: 0 1px;
}

.passage {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--ink);
  line-height: 1.55;
}

.passage p {
  margin: 0;
}

.question-visual {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(126, 168, 255, 0.28);
  border-radius: 8px;
  background: rgba(126, 168, 255, 0.08);
}

.question-visual figcaption {
  display: grid;
  gap: 3px;
  color: var(--muted);
}

.question-visual figcaption strong {
  color: var(--ink);
}

.visual-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.visual-table {
  width: 100%;
  border-collapse: collapse;
}

.visual-table td {
  padding: 9px 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel-strong);
  font-weight: 750;
}

.bar-model {
  display: flex;
  min-height: 74px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bar-segment {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 64px;
  padding: 9px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--teal-soft);
}

.bar-segment:last-child {
  border-right: 0;
}

.bar-segment span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.bar-segment strong {
  color: var(--ink);
}

.number-line {
  position: relative;
  min-height: 92px;
  margin: 8px 8px 0;
}

.number-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 36px;
  height: 3px;
  border-radius: 999px;
  background: var(--blue);
}

.number-point {
  position: absolute;
  top: 26px;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 78px;
  transform: translateX(-50%);
  text-align: center;
}

.number-point i {
  width: 22px;
  height: 22px;
  border: 3px solid var(--blue);
  border-radius: 999px;
  background: var(--panel);
}

.number-point strong {
  font-size: 0.86rem;
}

.number-point em {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: normal;
}

.tree-visual {
  display: grid;
  gap: 10px;
}

.tree-level {
  display: grid;
  grid-template-columns: minmax(56px, auto) 1fr;
  gap: 10px;
  align-items: center;
}

.tree-root,
.tree-branches span,
.visual-labels span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  font-weight: 800;
}

.tree-branches,
.visual-labels {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grid-area-visual,
.cuboid-visual {
  display: grid;
  gap: 12px;
}

.grid-shape {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  gap: 4px;
}

.grid-shape span {
  width: 34px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-strong);
}

.grid-shape span.is-filled {
  background: var(--green-soft);
}

.cuboid-box {
  position: relative;
  width: 150px;
  height: 82px;
  border: 2px solid var(--blue);
  background: rgba(126, 168, 255, 0.12);
}

.cuboid-box::before {
  content: "";
  position: absolute;
  left: 24px;
  top: -22px;
  width: 150px;
  height: 82px;
  border: 2px solid rgba(126, 168, 255, 0.7);
  background: rgba(126, 168, 255, 0.05);
}

.cuboid-box span {
  position: absolute;
  inset: 0;
}

.cuboid-box span::before,
.cuboid-box span::after {
  content: "";
  position: absolute;
  width: 32px;
  height: 2px;
  background: rgba(126, 168, 255, 0.8);
  transform: rotate(-42deg);
}

.cuboid-box span::before {
  right: -24px;
  top: -12px;
}

.cuboid-box span::after {
  right: -24px;
  bottom: 10px;
}

.graph-visual {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: stretch;
}

.graph-y-ticks {
  position: relative;
  min-height: 190px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.graph-y-ticks span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  white-space: nowrap;
}

.graph-plot {
  position: relative;
  min-height: 190px;
  border-left: 3px solid var(--blue);
  border-bottom: 3px solid var(--blue);
  background:
    linear-gradient(to bottom, rgba(126, 168, 255, 0.16) 1px, transparent 1px) 0 0 / 100% 50%,
    rgba(126, 168, 255, 0.04);
  overflow: visible;
}

.graph-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.graph-line polyline {
  fill: none;
  stroke: var(--yellow);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.graph-point {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--yellow);
  transform: translate(-50%, 50%);
  box-shadow: 0 0 0 4px rgba(255, 205, 86, 0.16);
}

.graph-point strong,
.graph-point em {
  position: absolute;
  left: 50%;
  min-width: 56px;
  font-size: 0.72rem;
  font-style: normal;
  transform: translateX(-50%);
  text-align: center;
  line-height: 1.15;
}

.graph-point strong {
  bottom: 18px;
  color: var(--text);
  font-weight: 900;
}

.graph-point em {
  top: 18px;
  color: var(--muted);
  font-weight: 800;
}

.graph-data-table {
  grid-column: 1 / -1;
  overflow-x: auto;
}

.graph-data-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.graph-data-table td {
  padding: 7px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.graph-data-table tr:first-child td,
.graph-data-table td:first-child {
  color: var(--text);
  background: var(--panel-strong);
}

.definition-word {
  display: inline;
  padding: 0 1px;
  border: 0;
  border-bottom: 1px dotted #87610e;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  cursor: pointer;
}

.definition-word:hover,
.definition-word:focus-visible {
  color: var(--yellow);
  outline: none;
}

.definition-word.is-static {
  cursor: inherit;
}

.definition-word.is-static:hover {
  color: inherit;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(4, 8, 18, 0.72);
  cursor: pointer;
}

.word-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: grid;
  align-content: start;
  gap: 14px;
  width: min(430px, 88vw);
  height: 100dvh;
  padding: 18px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -28px 0 80px rgba(0, 0, 0, 0.45);
}

.drawer-head {
  position: sticky;
  top: -18px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -18px -18px 0;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 24, 39, 0.96);
}

.drawer-head h3 {
  margin: 2px 0 0;
}

.drawer-word-grid {
  padding-bottom: 12px;
}

.helper-tools {
  display: grid;
  gap: 10px;
}

.helper-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.helper-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-strong);
  font-weight: 850;
}

.helper-button {
  padding: 0 12px;
}

.icon-button {
  width: 36px;
  padding: 0;
}

.helper-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.helper-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.helper-panel-head h3 {
  margin: 0;
}

.word-grid,
.support-grid {
  display: grid;
  gap: 10px;
}

.word-card,
.support-card {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.word-card {
  scroll-margin-block: 90px;
}

.word-card.is-active {
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2);
}

.word-card p,
.support-card p {
  margin-bottom: 0;
}

.word-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.word-translation {
  color: var(--yellow);
  font-weight: 800;
}

.helper-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.options {
  display: grid;
  gap: 10px;
}

.option-button {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  text-align: left;
}

.option-button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--teal);
  background: var(--teal-soft);
}

.option-button.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.option-button.is-correct {
  border-color: var(--green);
  background: var(--green-soft);
}

.option-button.is-wrong {
  border-color: var(--coral);
  background: var(--coral-soft);
}

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

.feedback.success {
  border-color: #bcdcc9;
  background: var(--green-soft);
}

.feedback.warning {
  border-color: #f0c6bd;
  background: var(--coral-soft);
}

.feedback strong {
  font-size: 1rem;
}

.textarea,
.input,
.select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-strong);
}

.textarea {
  min-height: 130px;
  padding: 12px;
  resize: vertical;
  line-height: 1.45;
}

.input,
.select {
  padding: 0 11px;
}

.input.compact-input {
  width: 96px;
  flex: 0 0 96px;
  text-align: center;
  font-weight: 850;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.empty-state {
  display: grid;
  gap: 12px;
  place-items: start;
  padding: 24px;
  border: 1px dashed #43504c;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.mistake-list,
.reward-list,
.level-list,
.set-list {
  display: grid;
  gap: 10px;
}

.set-row,
.mistake-row {
  grid-template-columns: 1fr auto;
}

.set-detail,
.mistake-detail {
  display: grid;
  gap: 5px;
}

.small {
  font-size: 0.84rem;
}

.code-box {
  width: 100%;
  min-height: 210px;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1f252b;
  color: #f6f8f6;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.validation-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.validation-list li {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 750;
}

.validation-list li.fail {
  background: var(--coral-soft);
  color: var(--coral);
}

.status-alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  width: min(760px, 100%);
  margin: 0 auto 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.status-alert p {
  margin: 4px 0 0;
  color: var(--muted);
}

.error-alert {
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.11);
}

.error-alert strong {
  color: var(--coral);
}

.confirm-alert {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 8, 7, 0.76);
  backdrop-filter: blur(10px);
}

.confirm-dialog {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  width: min(520px, 100%);
  padding: 18px;
  border: 1px solid rgba(244, 198, 95, 0.45);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.danger-confirm .confirm-dialog {
  border-color: rgba(255, 128, 110, 0.45);
  background: linear-gradient(180deg, rgba(255, 128, 110, 0.12), rgba(19, 28, 24, 0.98));
}

.confirm-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: var(--yellow);
  background: var(--yellow-soft);
}

.danger-confirm .confirm-alert-icon {
  color: var(--coral);
  background: var(--coral-soft);
}

.confirm-alert-copy {
  display: grid;
  gap: 8px;
  flex: 1 1 220px;
  min-width: 0;
  padding-right: 34px;
}

.confirm-alert-copy p {
  margin: 0;
  color: var(--muted);
}

.confirm-alert-field {
  display: grid;
  gap: 6px;
  max-width: 420px;
}

.confirm-alert-error {
  color: var(--coral);
  font-weight: 850;
}

.confirm-alert-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(360px, calc(100% - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #101312;
  background: #edf5f1;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 22px, 680px);
    padding-top: 12px;
  }

  .app-shell.mathstars-admin-shell {
    width: calc(100% - 12px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: row;
  }

  .section-head {
    flex-direction: column;
  }

  .stat-strip {
    justify-content: stretch;
  }

  .stat-pill {
    flex: 1 1 94px;
  }

  .dashboard-grid,
  .two-column,
  .form-grid,
  .mathstars-settings-grid,
  .home-grid {
    grid-template-columns: 1fr;
  }

  .mathstars-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .custom-inline-form {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .custom-option-grid,
  .custom-subject-grid {
    grid-template-columns: 1fr;
  }

  .question-head {
    flex-direction: column;
  }

  .brand-art {
    width: 58px;
    height: 58px;
  }

  h1 {
    font-size: 1.52rem;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 16px, 480px);
  }

  .app-shell.mathstars-admin-shell {
    width: 100%;
    padding: 8px 6px 28px;
  }

  .panel-body {
    padding: 14px;
  }

  .subject-row,
  .level-row,
  .set-row,
  .mistake-row,
  .reward-row,
  .mathstars-prize-row {
    grid-template-columns: 1fr;
  }

  .mathstars-command-center {
    gap: 12px;
    padding: 10px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .mathstars-admin-shell .mathstars-command-center {
    padding: 10px 6px;
  }

  .mathstars-table-shell {
    border-radius: 8px;
  }

  .mathstars-kid-table th,
  .mathstars-kid-table td {
    padding: 10px 8px;
  }

  .mathstars-admin-nav,
  .mathstars-monitor-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mathstars-kpi-strip {
    grid-template-columns: 1fr;
  }

  .action-menu-list {
    left: 0;
    right: auto;
  }

  .button,
  .tab-button {
    min-height: 40px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .tab-button {
    padding: 0 8px;
    white-space: normal;
  }

  .home-card {
    min-height: 94px;
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 14px;
  }

  .home-icon {
    width: 40px;
    height: 40px;
  }

  .action-bar .button {
    flex: 1 1 100%;
  }

  .action-bar .button.icon-only {
    flex: 0 0 42px;
  }

  .custom-category-head {
    align-items: flex-start;
  }

  .custom-prompt-overlay {
    padding: 0;
  }

  .custom-prompt-dialog {
    width: 100%;
    height: 100dvh;
  }

  .custom-prompt-head,
  .custom-prompt-actions {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .custom-prompt-actions .button {
    flex: 1 1 100%;
  }

  .custom-category-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    margin-left: auto;
  }

  .custom-category-actions .button {
    flex: 0 0 auto;
  }

  .custom-set-list .set-row .action-bar {
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .custom-set-list .set-row .action-bar .button {
    flex: 0 0 42px;
    width: 42px;
    min-height: 42px;
    padding: 0;
  }

  .custom-set-list .set-row .action-bar .mobile-action-label {
    display: none;
  }

  .confirm-alert {
    align-items: stretch;
    justify-items: stretch;
    padding: 0;
  }

  .confirm-dialog {
    width: 100%;
    min-height: 100%;
    align-content: start;
    border: 0;
    border-radius: 0;
    padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  }

  .confirm-alert-actions .button {
    flex: 1 1 140px;
  }

  .helper-button {
    flex: 1 1 120px;
  }

  .word-card-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
