/* TCPC — кольори тут (світла тема, нижче — темна). Змінити відтінок: --accent, --soft */
:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #dde3ec;
  --text: #141a24;
  --muted: #5f6b7c;
  --accent: #2d5fa8;
  --accent-text: #ffffff;
  --soft: #e2ebf8;
  --soft-text: #1d3f72;
  --ok: #1d7a4b;
  --ok-bg: #e2f4ea;
  --bad: #a3322b;
  --bad-bg: #fae6e4;
  --warn: #8a5a00;
  --warn-bg: #fcf0d7;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1218;
    --card: #161c25;
    --line: #273142;
    --text: #e6ebf2;
    --muted: #96a2b4;
    --accent: #8db4f0;
    --accent-text: #0e1218;
    --soft: #1b2a42;
    --soft-text: #c9dbf7;
    --ok: #7fd1a4;
    --ok-bg: #15301f;
    --bad: #f0a39c;
    --bad-bg: #3a1d1a;
    --warn: #f0c56b;
    --warn-bg: #3a2e12;
  }
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  max-width: 760px;
  margin: 0 auto;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.08em;
}
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 140px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
h1 {
  font-size: 1.5rem;
  line-height: 1.2;
  margin: 4px 0 0;
}
h2 {
  font-size: 1.05rem;
  margin: 4px 0 0;
}
p {
  margin: 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
.num {
  font-variant-numeric: tabular-nums;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card.press {
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}
.card.press:hover {
  background: color-mix(in srgb, var(--soft) 40%, var(--card));
}
.hero {
  background: var(--soft);
  color: var(--soft-text);
  border-radius: 24px;
  padding: 18px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
}
.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.neutral {
  background: var(--line);
  color: var(--text);
}
.banner {
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: center;
}
/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 0 16px 2px;
}
.tabs button {
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 8px 16px;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  min-height: 40px;
}
.tabs button[aria-current='page'] {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}
.dot {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--bad);
  color: #fff;
  font-size: 0.72rem;
  line-height: 18px;
  text-align: center;
  margin-left: 6px;
  padding: 0 5px;
}
/* Buttons */
.btn {
  font: inherit;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 10px 18px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
}
.btn.primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding-left: 0;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.link {
  font: inherit;
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  align-self: flex-start;
}
/* Tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 560px) {
  .tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}
.tile b {
  display: block;
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
}
/* Lists */
ul.plain,
ol.plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.divided > li + li {
  border-top: 1px solid var(--line);
}
.item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 0;
}
.points {
  width: 2.2rem;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.box {
  background: color-mix(in srgb, var(--line) 45%, transparent);
  border-radius: 12px;
  padding: 10px 12px;
  white-space: pre-line;
}
.note {
  white-space: pre-line;
}
/* Taking a test — big targets for a thumb */
.q {
  gap: 12px;
}
.q-text {
  font-weight: 600;
  white-space: pre-line;
}
.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid color-mix(in srgb, var(--muted) 30%, transparent);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.choice[aria-checked='true'] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  font-weight: 600;
}
.mark {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 2px solid color-mix(in srgb, var(--muted) 60%, transparent);
  border-radius: 50%;
}
.mark.square {
  border-radius: 6px;
}
.choice[aria-checked='true'] .mark {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--card);
}
.choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.match-row {
  border: 2px solid color-mix(in srgb, var(--muted) 20%, transparent);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cat {
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 2px solid color-mix(in srgb, var(--muted) 30%, transparent);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}
.cat[aria-checked='true'] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  font-weight: 600;
}
.order-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid color-mix(in srgb, var(--muted) 30%, transparent);
  border-radius: 14px;
  padding: 6px 6px 6px 12px;
}
.order-row.set {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 6%, var(--card));
}
.order-row .n {
  width: 1.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--muted);
}
.arrows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.arrow {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.arrow:disabled {
  opacity: 0.35;
}
.sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sticky .btn {
  min-height: 52px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
/* Review */
.opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: 10px;
  padding: 4px 8px;
}
.opt.right {
  background: color-mix(in srgb, var(--ok-bg) 70%, transparent);
}
.opt.wrong {
  background: color-mix(in srgb, var(--bad-bg) 70%, transparent);
}
.icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.icon.ok-c {
  color: var(--ok);
}
.icon.bad-c {
  color: var(--bad);
}
.icon.mute-c {
  color: color-mix(in srgb, var(--muted) 50%, transparent);
}
/* Sheet (a dialog from the bottom on a phone) */
.sheet-bg {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10;
}
@media (min-width: 640px) {
  .sheet-bg {
    align-items: center;
  }
}
.sheet {
  background: var(--card);
  width: 100%;
  max-width: 620px;
  max-height: 90svh;
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
}
@media (min-width: 640px) {
  .sheet {
    border-radius: 22px;
  }
}
.sheet-head {
  padding: 18px 18px 8px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.sheet-body {
  padding: 0 18px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.x {
  border: none;
  background: var(--bg);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  flex: none;
  display: grid;
  place-items: center;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  font: inherit;
  border: none;
  cursor: pointer;
}
.error {
  background: var(--bad-bg);
  color: var(--bad);
  border-radius: 12px;
  padding: 10px 12px;
}
/* Small things in place */
.btn.ghost {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stack > .pill,
.card > .pill {
  align-self: flex-start;
}
