/* The worksheets' title face, used on the story card and the diploma so they look like the workbooks. */
@font-face { font-family: "Handy Casual Condensed"; src: url(handy.ttf) format("truetype"); font-display: swap; }
/*
  Kit space. One light theme on purpose: it is the Zadaniaki online library's own palette
  (cool white, blue mist, ink blue, sky-blue controls, red only on buy buttons), painted explicitly.
  Every rule is scoped under #kts so the theme and this page never restyle each other.
*/
#kts {
  --ink: #2d3d54;
  --body: #404e65;
  --muted: #58697d;
  --blue: #56b0f2;
  --mist: #f4f9fd;
  --mist-strong: #eaf6fe;
  --line: #d9e7f2;
  --line-strong: #b7cad9;
  --white: #fdfefe;
  --green: #277a4a;
  --green-soft: #eaf7ef;
  --red: #fa2519;
  --shadow-cover: 0 6px 14px rgba(45, 61, 84, 0.08);
  --shadow-lift: 0 12px 26px rgba(45, 61, 84, 0.15);
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --gutter: 16px;
  --tabbar: 68px;
  color-scheme: light;
}
#kts [hidden] { display: none !important; }
#kts *, #kts *::before, #kts *::after { box-sizing: border-box; }
#kts, #kts { background: var(--white); }
#kts {
  margin: 0;
  color: var(--body);
  font: 400 18px/1.55 "Source Sans 3", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#kts h1, #kts h2, #kts h3 {
  margin: 0;
  color: var(--ink);
  font-family: "Bricolage Grotesque", Arial, sans-serif;
  font-weight: 700;
  text-wrap: balance;
}
#kts p { margin: 0; }
#kts h1, #kts h2, #kts h3 { padding: 0; text-align: left; text-transform: none; letter-spacing: normal; }
#kts img { max-width: 100%; display: block; }
#kts a { color: inherit; }
#kts button { font: inherit; color: inherit; }
#kts [tabindex="-1"]:focus { outline: none; }
#kts :where(button, a, input, select, summary):focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
#kts .num { font-variant-numeric: tabular-nums; }
#kts .nowrap { white-space: nowrap; }
#kts .icon { width: 22px; height: 22px; flex: 0 0 auto; object-fit: contain; }
#kts .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- page frame ---------- */
#kts .kwrap { width: 100%; max-width: calc(1240px + 2 * var(--gutter)); margin: 0 auto; padding-inline: var(--gutter); }
#kts .admin {
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}
#kts .kit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding-block: 22px 16px;
}
#kts .kit-head h1 { font-size: 30px; line-height: 1.08; letter-spacing: -0.02em; }
#kts .kit-head__meta { margin-top: 6px; color: var(--muted); font-size: 16px; font-weight: 600; }
#kts .save-btn { flex: 0 0 auto; }

/* tabs: top row on tablet and desktop, bottom bar on phones */
#kts .ktabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}
#kts .tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms var(--ease);
}
#kts .tab::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--blue);
  transform: scaleX(0);
  transition: transform 200ms var(--ease);
}
#kts .tab:hover { color: var(--ink); }
#kts .tab[aria-selected="true"] { color: var(--ink); }
#kts .tab[aria-selected="true"]::after { transform: scaleX(1); }
#kts .tab .icon { display: none; }
#kts .tab__short { display: none; }

#kts .main { padding-block: 24px 64px; }
#kts .panel { display: grid; gap: 40px; animation: kts-panel-in 200ms var(--ease); }
@keyframes kts-panel-in { from { opacity: 0; transform: translateY(4px); } }

/* ---------- buttons ---------- */
#kts .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}
#kts .btn .icon { width: 20px; height: 20px; }
#kts .btn--primary {
  background: var(--blue);
  color: var(--white);
  text-shadow: 0 1px 2px rgba(45, 61, 84, 0.28);
}
#kts .btn--primary:hover { box-shadow: 0 8px 20px rgba(86, 176, 242, 0.3); transform: translateY(-1px); }
#kts .btn--quiet { border-color: var(--line-strong); background: var(--white); color: var(--ink); }
#kts .btn--quiet:hover { border-color: var(--blue); background: var(--mist); }
#kts .btn--buy { background: var(--red); color: var(--white); }
#kts .btn--buy:hover { box-shadow: 0 8px 20px rgba(250, 37, 25, 0.24); transform: translateY(-1px); }
#kts .btn--done[aria-pressed="true"] { border-color: #72b78f; background: var(--green-soft); color: var(--green); }
#kts .btn--text {
  min-height: 44px;
  padding: 8px 2px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
#kts .btn--text:hover { color: var(--ink); }
#kts .btn--block { width: 100%; }

/* ---------- first-visit note ---------- */
#kts .lead { display: grid; gap: 12px; }
#kts .first-note {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  padding: 4px 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}
#kts .first-note > .icon { color: var(--muted); }
#kts .first-note p { flex: 1 1 200px; }
#kts .first-note .btn--text { min-height: 36px; padding-block: 4px; }
#kts.first-visit .save-btn { display: none; }

/* ---------- continue strip ---------- */
#kts .resume {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px 20px;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
  background: var(--mist);
}
#kts .resume__cover {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
#kts .resume__cover img, #kts .resume__covers img {
  width: 100%;
  aspect-ratio: 210 / 297;
  object-fit: cover;
  object-position: top;
  border: 4px solid var(--white);
  border-radius: 4px;
  box-shadow: 0 8px 18px rgba(45, 61, 84, 0.14);
}
#kts .resume h2 { font-size: 24px; line-height: 1.15; }
#kts .resume__sub { margin-top: 6px; font-size: 16px; }
#kts .resume__sub b { color: var(--ink); }
#kts .resume__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
#kts .resume__actions .btn--primary { flex: 1 1 auto; }

/* ---------- shelf ---------- */
#kts .shelf-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 8px 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
#kts .shelf-head h2 { font-size: clamp(26px, 2.8vw, 30px); line-height: 1.12; }
#kts .shelf-head p { margin-top: 6px; max-width: 60ch; color: var(--muted); font-size: 16px; }
#kts .shelf-head__count { color: var(--muted); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
#kts .sug-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  margin: -8px 0 22px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}
#kts .shelf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
#kts .wb { min-width: 0; }
#kts .wb__btn {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
#kts .wb__cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  box-shadow: var(--shadow-cover);
  transition: box-shadow 180ms var(--ease), transform 180ms var(--ease);
}
#kts .wb__cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
#kts .wb__btn:hover .wb__cover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
#kts .wb[data-sug="true"] .wb__cover { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink), var(--shadow-cover); }
#kts .tags {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#kts .tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 7px;
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
#kts .tag .icon { width: 15px; height: 15px; }
#kts .tag--done { background: var(--green); animation: kts-pop 220ms var(--ease); }
#kts .tag--sug { background: var(--ink); }
@keyframes kts-pop { from { opacity: 0; transform: scale(0.92); } }
#kts .wb__body { display: grid; gap: 4px; padding-top: 12px; }
#kts .wb__title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-family: "Bricolage Grotesque", Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
#kts .wb__title .num { margin-right: 6px; color: var(--muted); font-weight: 600; }
#kts .wb__meta { color: var(--muted); font-size: 16px; }
#kts .mark-open { color: var(--ink); font-weight: 700; }
#kts .mark-done { color: var(--green); font-weight: 700; }

/* ---------- next kit (plan tab), foot ---------- */
#kts .nextkit h2 { font-size: 24px; line-height: 1.15; }
#kts .nextkit p { margin-top: 6px; max-width: 58ch; font-size: 16px; }
#kts .mini-stack { position: relative; display: flex; }
#kts .mini-stack img {
  width: 66px;
  aspect-ratio: 210 / 297;
  object-fit: cover;
  object-position: top;
  border: 3px solid var(--white);
  border-radius: 3px;
  box-shadow: 0 6px 14px rgba(45, 61, 84, 0.14);
}
#kts .mini-stack img + img { margin-left: -22px; }
#kts .mini-stack img:nth-child(1) { transform: rotate(-5deg); }
#kts .mini-stack img:nth-child(3) { transform: rotate(5deg); }

#kts .nextkit {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px 36px;
  align-items: center;
  padding: 24px 20px;
  border-radius: 18px;
  background: var(--mist);
}
#kts .nextkit__covers { position: relative; height: 150px; }
#kts .nextkit__covers img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 92px;
  aspect-ratio: 210 / 297;
  object-fit: cover;
  object-position: top;
  border: 5px solid var(--white);
  border-radius: 4px;
  box-shadow: 0 10px 22px rgba(45, 61, 84, 0.16);
}
#kts .nextkit__covers img:nth-child(1) { z-index: 3; transform: translate(-50%, -50%) rotate(-2deg); }
#kts .nextkit__covers img:nth-child(2) { z-index: 2; transform: translate(-128%, -46%) rotate(-9deg); }
#kts .nextkit__covers img:nth-child(3) { z-index: 1; transform: translate(28%, -46%) rotate(8deg); }
#kts .nextkit__price { color: var(--ink); font-weight: 600; }
#kts .nextkit .btn { margin-top: 16px; }

/* ---------- the two asks above the workbook list: thin, one line each on wider screens ---------- */
#kts .asks { display: grid; gap: 10px; }
#kts .ask {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}
#kts .ask__art { display: flex; justify-content: center; }
#kts .ask__art > img {
  width: 40px;
  aspect-ratio: 210 / 297;
  object-fit: cover;
  object-position: top;
  border: 2px solid var(--white);
  border-radius: 3px;
  box-shadow: 0 4px 10px rgba(45, 61, 84, 0.14);
}
#kts .ask__art .mini-stack img { width: 32px; border-width: 2px; box-shadow: 0 4px 10px rgba(45, 61, 84, 0.14); }
#kts .ask__art .mini-stack img + img { margin-left: -22px; }
#kts .ask__icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: var(--mist); }
#kts .ask h2, #kts .ask h3 { font-size: 18px; line-height: 1.25; }
#kts .ask p { margin-top: 2px; color: var(--body); font-size: 16px; line-height: 1.45; }
#kts .ask p b { color: var(--ink); }
#kts .ask__act { grid-column: 2; }
#kts .ask__act .btn { min-height: 44px; padding: 9px 16px; }
#kts .ask__txt .btn--text { min-height: 36px; padding-block: 4px; white-space: normal; text-align: left; }

/* ---------- review form: inline above the ZIP, or in the bottom sheet ---------- */
#kts .rev { display: grid; gap: 12px; padding: 20px; border-radius: 18px; background: var(--mist); }
#kts .rev h2 { font-size: 22px; line-height: 1.2; }
#kts .rev__p { max-width: 58ch; font-size: 16px; }
#kts .rev--sheet { padding: 0; background: none; }
#kts .rev__body { display: grid; gap: 16px; }
#kts .rev__stars { display: grid; gap: 4px; justify-items: start; margin: 0; padding: 0; border: 0; }
#kts .rev__row { display: flex; gap: 2px; }
#kts .rev__star {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 10px;
  color: var(--line-strong);
  cursor: pointer;
  transition: color 160ms var(--ease), transform 160ms var(--ease);
}
/* the theme sizes every radio; keep the star's radio for keyboards and screen readers only */
#kts .rev__star input[type="radio"] { position: absolute; width: 1px; height: 1px; margin: 0; border: 0; opacity: 0; }
#kts .rev__star svg { width: 38px; height: 38px; fill: currentColor; }
#kts .rev__star:hover { transform: translateY(-1px); }
#kts .rev__star.is-on { color: #f39c4a; }
/* hovering a star previews the rating: it and every star before it light up */
#kts .rev__row:has(.rev__star:hover) .rev__star { color: #f6b77b; }
#kts .rev__row .rev__star:hover ~ .rev__star { color: var(--line-strong); }
#kts .rev__ends { display: flex; justify-content: space-between; width: 248px; padding: 0 4px; color: var(--muted); font-size: 16px; }
#kts .rev__chosen { margin: 2px 0 0; color: var(--ink); font-size: 16px; font-weight: 700; }
#kts .rev__star:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 1px; }
#kts .rev__more { display: grid; gap: 14px; max-width: 560px; }
#kts .rev__more .btn { justify-self: start; }
#kts .field { display: grid; gap: 6px; color: var(--ink); font-size: 16px; font-weight: 700; }
#kts .field textarea,
#kts .field input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--body);
  font: 400 16px/1.5 "Source Sans 3", Arial, sans-serif;
}
#kts .field textarea { resize: vertical; }
#kts .field input[type="file"] { color: var(--body); font: 400 16px/1.4 "Source Sans 3", Arial, sans-serif; }
#kts .field input[type="file"]::file-selector-button {
  min-height: 44px;
  margin-right: 12px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: 700 16px/1.2 "Source Sans 3", Arial, sans-serif;
  cursor: pointer;
}
#kts .field input[type="file"]::file-selector-button:hover { border-color: var(--blue); background: var(--mist); }
#kts .field :where(textarea, input):focus-visible { border-color: var(--blue); outline: 3px solid var(--ink); outline-offset: 2px; }
#kts .field__note { color: var(--muted); font-weight: 400; }

#kts .zip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
#kts .zip strong { display: block; color: var(--ink); font-size: 18px; }
#kts .zip span { color: var(--muted); font-size: 16px; }
#kts .keep {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  padding: 24px 22px;
  border-radius: 18px;
  background: var(--ink);
}
#kts .keep p {
  flex: 1 1 320px;
  color: var(--white);
  font-family: "Bricolage Grotesque", Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  text-wrap: pretty;
}
#kts .keep .btn { background: var(--white); color: var(--ink); }
#kts .keep .btn:hover { background: var(--mist); transform: translateY(-1px); }

/* ---------- plan ---------- */
#kts .plan { display: grid; gap: 40px; align-items: start; }
#kts .plan__side { display: grid; gap: 40px; }
#kts .plan h2 { font-size: clamp(26px, 2.8vw, 30px); line-height: 1.12; }
#kts .steps { display: grid; gap: 18px; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: step; }
#kts .steps li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 2px 14px;
  counter-increment: step;
}
#kts .steps li::before {
  content: counter(step);
  grid-row: span 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mist-strong);
  color: var(--ink);
  font-family: "Bricolage Grotesque", Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
}
#kts .steps strong { color: var(--ink); font-size: 18px; line-height: 36px; }
#kts .steps p { font-size: 16px; }
#kts .steps .btn { justify-self: start; margin-top: 10px; }

#kts .check { padding: 22px 20px; border: 1px solid var(--line); border-radius: 18px; }
#kts .check > p { margin-top: 10px; font-size: 16px; }
#kts .check > .btn { margin-top: 16px; }
#kts .enter { margin-top: 14px; border-top: 1px solid var(--line); }
#kts .enter > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
#kts .enter > summary::-webkit-details-marker { display: none; }
#kts .enter[open] .week__chev::before { transform: translateY(2px) rotate(225deg); }
#kts .check__tasks { margin: 4px 0 0; padding: 0; border: 0; min-width: 0; }
#kts .check__tasks legend { padding: 0; margin-bottom: 10px; color: var(--body); font-size: 16px; }
#kts .chips { display: grid; gap: 8px; }
#kts .chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--body);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
#kts .chip:hover { border-color: var(--blue); background: var(--mist); }
#kts .chip__box {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 6px;
  background: var(--mist-strong);
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
#kts .chip[aria-pressed="true"] { border-color: var(--ink); background: var(--mist); color: var(--ink); font-weight: 700; }
#kts .chip[aria-pressed="true"] .chip__box { background: var(--ink); color: var(--white); }
#kts .chip--none { justify-content: center; margin-top: 4px; }
#kts .chip--none[aria-pressed="true"] { border-color: #72b78f; background: var(--green-soft); color: var(--green); }
#kts .result { margin-top: 18px; padding: 18px; border-radius: 10px; background: var(--mist); }
#kts .result h3 { font-size: 20px; }
#kts .result > p { margin-top: 6px; font-size: 16px; }
#kts .result .rows { margin-top: 12px; }
#kts .result__foot { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; }
#kts .again { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 16px; }

#kts .rows { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
#kts .wbrow {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 60px;
  padding: 6px 10px 6px 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--white);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
#kts .wbrow:hover { border-color: var(--line-strong); }
#kts .wbrow img {
  width: 40px;
  aspect-ratio: 210 / 297;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line);
  border-radius: 3px;
}
#kts .row__t { color: var(--ink); font-size: 16px; font-weight: 700; line-height: 1.3; }
#kts .row__t .num { margin-right: 4px; color: var(--muted); font-weight: 600; }
#kts .row__m { display: block; color: var(--muted); font-size: 16px; font-weight: 400; }
#kts .row__s { color: var(--muted); }

#kts .weeks__list { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
#kts .week { border-bottom: 1px solid var(--line); }
#kts .week summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 32px;
  gap: 4px 14px;
  align-items: center;
  min-height: 72px;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
}
#kts .week summary::-webkit-details-marker { display: none; }
#kts .week__name { color: var(--ink); font-family: "Bricolage Grotesque", Arial, sans-serif; font-size: 20px; font-weight: 700; }
#kts .week__what {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#kts .week__state { display: flex; align-items: center; gap: 6px; }
#kts .now {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
}
#kts .dot { width: 12px; height: 12px; border: 2px solid var(--line-strong); border-radius: 50%; }
#kts .dot--open { border-color: var(--blue); background: var(--blue); }
#kts .dot--done { border-color: var(--green); background: var(--green); }
#kts .week__chev {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}
#kts .week__chev::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms var(--ease);
}
#kts .week[open] .week__chev::before { transform: translateY(2px) rotate(225deg); }
#kts .week__body { display: grid; gap: 14px; padding: 0 0 22px; }
#kts .week__body .rows { margin-inline: -6px; }
#kts .watch { font-size: 16px; }
#kts .watch b { color: var(--ink); }
#kts .wk-more { display: grid; gap: 6px; padding-top: 14px; border-top: 1px dashed var(--line); }
#kts .wk-more h3 { font-size: 18px; }
#kts .week__body > .btn { justify-self: start; }

/* ---------- workbook view: full screen on phones, side panel on desktop ---------- */
#kts .scrim {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(45, 61, 84, 0.32);
  opacity: 0;
  transition: opacity 220ms var(--ease);
}
#kts .scrim.is-on { opacity: 1; }
#kts .view {
  position: fixed;
  inset: 0;
  z-index: 1110;
  display: flex;
  flex-direction: column;
  background: var(--white);
  transform: translateX(100%);
  transition: transform 260ms var(--ease);
}
#kts .view.is-on { transform: none; }
#kts .view__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) var(--gutter) 8px;
  border-bottom: 1px solid var(--line);
}
#kts .view__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin-left: -8px;
  padding: 0 10px 0 4px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}
#kts .view__back:hover { background: var(--mist); }
#kts .view__pos { color: var(--muted); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
#kts .view__scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
#kts .view__inner { display: grid; gap: 22px; padding: 20px var(--gutter) 28px; }
#kts .view h2 { font-size: 24px; line-height: 1.2; }
#kts .view h2 .num { margin-right: 4px; color: var(--muted); font-weight: 600; }
#kts .view__meta { margin-top: 6px; color: var(--muted); font-size: 16px; }
#kts .view__meta a { color: var(--ink); font-weight: 700; }
#kts .view__state { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 16px; font-weight: 700; }
#kts .view__state .icon { width: 18px; height: 18px; }
#kts .note-sug {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--mist);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}
#kts .pages {
  display: flex;
  gap: 12px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 4px var(--gutter) 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  list-style: none;
}
#kts .pages li { flex: 0 0 auto; width: min(58vw, 230px); scroll-snap-align: start; }
#kts .pages img {
  width: 100%;
  aspect-ratio: 210 / 297;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  box-shadow: var(--shadow-cover);
}
#kts .pages span { display: block; margin-top: 6px; color: var(--muted); font-size: 16px; text-align: center; }
#kts .pages__more {
  display: grid;
  place-items: center;
  height: calc(100% - 30px);
  aspect-ratio: 210 / 297;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  font-size: 16px;
  text-align: center;
  padding: 12px;
}
#kts .err {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #f39c4a;
  border-radius: 10px;
  background: rgba(243, 156, 74, 0.08);
  color: var(--ink);
  font-size: 16px;
}
#kts .err strong { font-size: 18px; }
#kts .err div { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
#kts .notes h3 { font-size: 20px; }
#kts .notes dl { display: grid; gap: 14px; margin: 12px 0 0; }
#kts .notes dt { color: var(--ink); font-size: 16px; font-weight: 700; }
#kts .notes dd { margin: 2px 0 0; font-size: 18px; line-height: 1.5; }
#kts .notes__foot { margin-top: 14px; color: var(--muted); font-size: 16px; }
#kts .view__nav { display: flex; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
#kts .view__nav .btn { min-width: 0; }
#kts .view__actions {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 10px;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--white);
}
#kts .view__actions .btn { width: 100%; padding-inline: 10px; }
#kts .is-busy { cursor: progress; }

/* ---------- save-link sheet ---------- */
#kts .sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1120;
  display: grid;
  gap: 18px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 10px var(--gutter) calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 18px 18px 0 0;
  background: var(--white);
  box-shadow: 0 -12px 40px rgba(45, 61, 84, 0.2);
  transform: translateY(100%);
  transition: transform 260ms var(--ease);
}
#kts .sheet.is-on { transform: none; }
#kts .sheet__grip { justify-self: center; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); }
#kts .sheet h2 { font-size: 24px; }
#kts .sheet h3 { font-size: 18px; }
#kts .sheet p { font-size: 16px; }
#kts .sheet__intro { margin-top: 6px; }
#kts .linkbox { display: flex; gap: 8px; }
#kts .linkbox input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--mist);
  color: var(--ink);
  font: 600 16px/1.2 "Source Sans 3", Arial, sans-serif;
}
#kts .sheet__block { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
#kts .sheet__block .btn { justify-self: start; }
#kts .okmsg { color: var(--green); font-weight: 700; }

/* ---------- access page ---------- */
#kts .access { display: grid; gap: 28px; max-width: 640px; padding-block: 40px 80px; }
#kts .access h1 { font-size: 32px; line-height: 1.1; letter-spacing: -0.02em; }
#kts .access h2 { font-size: 24px; }
#kts .access > div > p { margin-top: 10px; }
#kts .access form { display: grid; gap: 8px; margin-top: 14px; }
#kts .access label { color: var(--ink); font-size: 16px; font-weight: 700; }
#kts .access input {
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--body);
  font: 400 18px/1.3 "Source Sans 3", Arial, sans-serif;
}
#kts .access input:focus { border-color: var(--blue); outline: 3px solid rgba(86, 176, 242, 0.28); outline-offset: 2px; }
#kts .access form .btn { justify-self: start; margin-top: 6px; }
#kts .access ul { margin: 10px 0 0; padding-left: 22px; }
#kts .access li + li { margin-top: 6px; }

/* ---------- toast ---------- */
#kts .toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1130;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(45, 61, 84, 0.25);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
  pointer-events: none;
}
#kts .toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- one-click cart ---------- */
#kts .fine { margin-top: 8px; color: var(--muted); font-size: 16px; }

/* ---------- share tab ---------- */
#kts .share { display: grid; gap: 28px; }
/* three tiles that act as tabs, so every way to share is visible on the first screen */
#kts .subtabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 720px; }
#kts .subtab {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 2px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--body);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
#kts .subtab:hover { border-color: var(--blue); background: var(--mist); }
#kts .subtab .icon { width: 24px; height: 24px; margin-bottom: 4px; color: var(--ink); }
#kts .subtab b { color: var(--ink); font-size: 16px; line-height: 1.2; }
#kts .subtab span { color: var(--muted); font-size: 16px; line-height: 1.25; }
#kts .subtab[aria-selected="true"] { border-color: var(--ink); background: var(--mist); box-shadow: inset 0 0 0 1px var(--ink); }
#kts .share-panel { animation: kts-panel-in 200ms var(--ease); }
/* the family's own discount code comes first */
#kts .codecard { display: grid; gap: 12px; max-width: 720px; padding: 20px; border-radius: 18px; background: var(--mist); }
#kts .codecard h2 { font-size: 22px; line-height: 1.2; }
#kts .codecard p { max-width: 58ch; font-size: 16px; }
#kts .coderow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
#kts .code {
  padding: 8px 16px;
  border: 2px dashed var(--ink);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font-family: "Bricolage Grotesque", Arial, sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  user-select: all;
}
#kts .namefield { display: grid; gap: 6px; max-width: 520px; }
#kts .namefield label { color: var(--ink); font-size: 18px; font-weight: 700; }
#kts .namefield input {
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--body);
  font: 400 18px/1.3 "Source Sans 3", Arial, sans-serif;
}
#kts .namefield input:focus, #kts .msgbox:focus { border-color: var(--blue); outline: 3px solid rgba(86, 176, 242, 0.28); outline-offset: 2px; }
#kts .hint { color: var(--muted); font-size: 16px; }
#kts .share-sec { display: grid; gap: 24px; align-items: start; }
#kts .share-sec h2 { font-size: clamp(26px, 2.8vw, 30px); line-height: 1.12; }
#kts .share-sec__lead { margin-top: 8px; max-width: 58ch; font-size: 16px; }
#kts .share-tools { display: grid; gap: 18px; align-content: start; }
#kts .seg { display: inline-flex; flex-wrap: wrap; justify-self: start; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--white); }
#kts .seg button {
  min-height: 42px;
  padding: 6px 14px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--body);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
#kts .seg button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
#kts .seg button:disabled { color: var(--line-strong); cursor: not-allowed; }
#kts .toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-size: 16px; font-weight: 600; cursor: pointer; }
#kts .toggle input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); }
#kts .btnrow { display: flex; flex-wrap: wrap; gap: 10px; }
#kts .refer { display: grid; gap: 16px; max-width: 720px; }
#kts .refer h2 { font-size: clamp(26px, 2.8vw, 30px); line-height: 1.12; }
#kts .refer__stat { color: var(--ink); font-size: 16px; font-weight: 700; }
#kts .refer__stat--none { color: var(--muted); font-weight: 600; }
#kts .msgbox {
  width: 100%;
  min-height: 116px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--body);
  font: 400 17px/1.45 "Source Sans 3", Arial, sans-serif;
  resize: vertical;
}
#kts .field-label { color: var(--ink); font-size: 16px; font-weight: 700; }

/* story card: rendered to a 1080 x 1920 PNG in a canvas; the page shows that image */
#kts .scaled { position: relative; width: min(100%, 340px); overflow: hidden; justify-self: center; }
#kts .scaled > * { position: absolute; top: 0; left: 0; transform: scale(var(--s, 0.8095)); transform-origin: 0 0; }
#kts .story-frame {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 9 / 16;
  justify-self: center;
  overflow: hidden;
  border-radius: 14px;
  background: var(--mist) center / cover no-repeat;
  box-shadow: 0 18px 40px rgba(45, 61, 84, 0.24);
}
#kts .story-frame > img { position: absolute; left: 4%; right: 4%; bottom: 10%; width: 92%; height: auto; }
#kts .story-frame__tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(45, 61, 84, 0.78);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
}
#kts .how { display: grid; gap: 6px; margin: 0; padding-left: 22px; font-size: 16px; }
#kts .how b { color: var(--ink); }

/* diploma: drawn at 420 x 594 (A4) and scaled */
#kts .dip-frame { width: min(100%, 340px); aspect-ratio: 210 / 297; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow-cover); }
#kts .dip { width: 420px; height: 594px; padding: 20px; background: var(--white); }
#kts .dip__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 26px 26px 22px;
  border: 8px solid var(--blue);
  border-radius: 18px;
  color: var(--ink);
  font-family: Livvic, "Source Sans 3", sans-serif;
  text-align: center;
}
#kts .dip__inner > img { width: 170px; height: auto; }
#kts .dip__title { margin-top: 14px; font-family: "Handy Casual Condensed", "Bricolage Grotesque", sans-serif; font-size: 84px; line-height: 0.9; letter-spacing: 0.02em; }
#kts .dip__name { width: 270px; min-height: 50px; margin-top: 16px; padding-bottom: 4px; border-bottom: 2px solid var(--ink); font-size: 34px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
#kts .dip__for { margin-top: 14px; font-size: 18px; font-weight: 500; }
#kts .dip__kit { margin-top: 4px; font-family: "Handy Casual Condensed", "Bricolage Grotesque", sans-serif; font-size: 38px; line-height: 1; }
#kts .dip__map { display: grid; grid-template-columns: repeat(10, 24px); gap: 6px 5px; margin-top: 18px; }
#kts .dip__map img { width: 24px; height: 34px; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: 2px; }
#kts .dip__stats { margin-top: 12px; font-size: 16px; font-weight: 500; }
#kts .dip__sign { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; width: 100%; margin-top: auto; font-size: 16px; font-weight: 500; }
#kts .dip__sign span { display: block; padding-top: 6px; border-top: 1.5px solid var(--ink); }

/* ---------- my kits ---------- */
#kts .kits { display: grid; gap: 44px; }
#kts .kits h2 { font-size: clamp(26px, 2.8vw, 30px); line-height: 1.12; }
#kts .kits__lead { margin-top: 6px; max-width: 60ch; color: var(--muted); font-size: 16px; }
/* one kit per row: the cover beside its text, the edition rows and the button under both. Two per row once a row is
   wide enough (Edvin, 2026-09-27: the narrow tiles squeezed each price under its edition). */
#kts .kitgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 36px 32px; margin: 18px 0 0; padding: 0; list-style: none; }
#kts .kit { display: grid; grid-template-columns: clamp(96px, 30%, 136px) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 14px 16px; min-width: 0; }
#kts .kit__cover { position: relative; align-self: start; aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--white); box-shadow: var(--shadow-cover); }
#kts .kit__cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
#kts .kit[data-next="true"] .kit__cover { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink), var(--shadow-cover); }
#kts .kit__body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
#kts .kit__body .tags { position: static; margin-bottom: 4px; }
#kts .kit__problem { color: var(--ink); font-family: "Bricolage Grotesque", Arial, sans-serif; font-size: 18px; font-weight: 700; line-height: 1.25; text-wrap: balance; }
#kts .kit__solution { color: var(--body); font-size: 16px; line-height: 1.4; }
#kts .kit__stage { margin-top: 2px; color: var(--muted); font-size: 16px; font-weight: 600; }
#kts .kit__meta { color: var(--muted); font-size: 16px; }
#kts .kit__buy { display: grid; grid-column: 1 / -1; align-content: end; gap: 10px; max-width: 480px; }
#kts .kit__act { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
#kts .kit__act .btn { width: 100%; padding-inline: 10px; }
#kts .kit__act .btn--text { justify-self: start; width: auto; white-space: normal; text-align: left; }
#kts .btn--incart { border-color: #72b78f; background: var(--green-soft); color: var(--green); }
#kts .acct { display: grid; gap: 12px; max-width: 720px; padding: 20px; border-radius: 18px; background: var(--mist); }
#kts .acct > h2, #kts .acct > h3 { font-size: 22px; line-height: 1.2; }
#kts .acct p { max-width: 60ch; font-size: 16px; }
#kts .acct .btn { justify-self: start; }
#kts .acct-line { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 16px; font-weight: 700; }
#kts .acct-line .icon { width: 20px; height: 20px; color: var(--green); }
#kts .acct-line a { margin-left: 6px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
#kts .kits-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
#kts .levels__body { display: grid; gap: 36px; padding-top: 24px; }
#kts .levels__body h3 { font-size: 22px; }
#kts .kits__off { margin-top: 8px; color: var(--green); font-size: 16px; font-weight: 700; }
/* each kit picks its edition like on the product page: 250 first, one line each with the price this family pays */
#kts .edrows { display: grid; gap: 8px; container-type: inline-size; }
#kts .edrow {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
#kts .edrow:hover { border-color: var(--blue); }
#kts .edrow[aria-checked="true"] { border-color: var(--blue); background: var(--mist); }
#kts .edrow__dot { display: grid; width: 18px; height: 18px; place-items: center; border: 1px solid #8797aa; border-radius: 50%; background: var(--white); }
#kts .edrow[aria-checked="true"] .edrow__dot { border-color: var(--blue); }
#kts .edrow[aria-checked="true"] .edrow__dot::after { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); content: ""; }
#kts .edrow__t { min-width: 0; }
#kts .edrow__p { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#kts .edrow__was { color: var(--muted); font-weight: 400; }
/* a very narrow row (never at the widths the kit library uses): the price goes under the label */
@container (max-width: 250px) {
  #kts .edrow { grid-template-columns: 18px minmax(0, 1fr); row-gap: 0; }
  #kts .edrow__dot { grid-row: span 2; }
  #kts .edrow__p { grid-column: 2; }
}


/* ---------- phones: bottom tab bar ---------- */
@media (max-width: 759px) {
  body.kt-kit-space-page { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  #kts .kit-head { padding-block: 18px 4px; }
  #kts .kit-head h1 { font-size: 28px; }
  #kts .save-btn { min-height: 44px; padding: 8px 12px; }
  #kts .save-btn span { display: none; }
  #kts .ktabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(253, 254, 254, 0.96);
    backdrop-filter: saturate(1.4) blur(12px);
  }
  #kts .tab { flex-direction: column; gap: 2px; min-height: 56px; padding: 4px 0; font-size: 16px; }
  #kts .tab .icon { display: block; width: 44px; height: 30px; padding: 3px 11px; border-radius: 999px; transition: background-color 200ms var(--ease); }
  #kts .tab::after { display: none; }
  #kts .tab[aria-selected="true"] .icon { background: var(--mist-strong); color: var(--ink); }
  #kts.view-open .ktabs { visibility: hidden; }
  #kts .tab__long { display: none; }
  #kts .tab__short { display: inline !important; }
  /* "Podziel się" is 75px at 16px: its column takes the 2px it needs instead of wrapping */
  #kts .tab span { white-space: nowrap; }
  #kts .toast { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 12px); }
  #kts.view-open .toast { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
  #kts .main { padding-block: 16px 40px; }
  #kts .panel, #kts .plan, #kts .plan__side { gap: 32px; }
}

/* ---------- tablet ---------- */
@media (min-width: 760px) {
  #kts .ask { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; padding: 12px 16px; }
  #kts .ask__art > img { width: 44px; }
  #kts .ask__art .mini-stack img { width: 38px; }
  #kts .ask__art .mini-stack img + img { margin-left: -24px; }
  #kts .ask__icon { width: 44px; height: 44px; }
  #kts .ask__act { grid-column: auto; }
  #kts { --gutter: 32px; }
  #kts .kit-head { padding-block: 32px 18px; }
  #kts .kit-head h1 { font-size: 40px; }
  #kts .shelf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 22px; }
  #kts .resume { grid-template-columns: 112px minmax(0, 1fr) auto; gap: 16px 28px; padding: 22px 28px; }
  #kts .resume__actions { grid-column: auto; }
  #kts .resume__actions .btn--primary { flex: 0 0 auto; }
  #kts .nextkit { grid-template-columns: 260px minmax(0, 1fr); padding: 30px 36px; }
  #kts .nextkit__covers { height: 190px; }
  #kts .nextkit__covers img { width: 112px; }
  #kts .keep { padding: 28px 34px; }
  #kts .chips { grid-template-columns: 1fr 1fr; }
  #kts .chip--none { grid-column: 1 / -1; }
  #kts .pages li { width: 200px; }
  #kts .sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(520px, calc(100% - 48px));
    padding: 28px 28px 26px;
    border-radius: 18px;
    opacity: 0;
    transform: translate(-50%, -46%);
    transition: transform 240ms var(--ease), opacity 200ms var(--ease);
  }
  #kts .sheet.is-on { opacity: 1; transform: translate(-50%, -50%); }
  #kts .sheet__grip { display: none; }
}
@media (min-width: 900px) {
  #kts .shelf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #kts .share-sec--story, #kts .share-sec--dip { grid-template-columns: auto minmax(0, 1fr); gap: 24px 48px; }
  #kts .share-sec--story > .share-head, #kts .share-sec--dip > .share-head { grid-column: 1 / -1; }
  #kts .story-frame { width: 320px; }
  #kts .dip-frame { width: 340px; }
}

/* ---------- desktop ---------- */
@media (min-width: 1000px) {
  #kts .view { left: auto; width: 540px; box-shadow: -18px 0 48px rgba(45, 61, 84, 0.16); }
  #kts .view__back { display: none; }
  #kts .view__x { display: inline-flex !important; }
  #kts .pages li { width: 168px; }
  #kts .plan { grid-template-columns: 380px minmax(0, 1fr); gap: 56px; }
  #kts .plan__side { position: sticky; top: 24px; }
  #kts .chips { grid-template-columns: 1fr; }
}
@media (min-width: 1180px) { #kts .shelf-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
#kts .view__x {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
#kts .view__x:hover { border-color: var(--blue); background: var(--mist); }

/* ---------- level kits: the three plans (radio rows, as the edition rows) ---------- */
#kts .plans { margin-bottom: 36px; }
#kts .plans > p { margin-top: 6px; max-width: 60ch; color: var(--muted); font-size: 16px; }
#kts .plans__list { display: grid; gap: 8px; margin-top: 16px; }
#kts .planopt {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--body);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
#kts .planopt:hover { border-color: var(--blue); }
#kts .planopt .edrow__dot { margin-top: 4px; }
#kts .planopt[aria-checked="true"] { border-color: var(--blue); background: var(--mist); }
#kts .planopt[aria-checked="true"] .edrow__dot { border-color: var(--blue); }
#kts .planopt[aria-checked="true"] .edrow__dot::after { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); content: ""; }
#kts .planopt__body { display: grid; gap: 4px; min-width: 0; }
#kts .planopt__name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--ink); font-size: 18px; font-weight: 700; line-height: 1.25; }
#kts .planopt__name .tag { font-size: 14px; }
#kts .planopt__text { font-size: 16px; line-height: 1.45; }
/* the whole-year plan's four etapy, under its option */
#kts .plans__parts { display: grid; gap: 6px; margin-left: 28px; }
#kts .planopt--part { padding-top: 10px; padding-bottom: 10px; }
#kts .planopt--part .planopt__name { font-size: 16px; }

@media (prefers-reduced-motion: reduce) {
  #kts *, #kts *::before, #kts *::after { animation: none !important; transition: none !important; }
}


/* ---------- production additions ---------- */
/* the page has its own title; the theme's page header goes, as on the online library pages */
body.kt-kit-space-page .main-header,
body.kt-kit-space-page .entry-header,
body.kt-kit-space-page .page-header,
body.kt-kit-space-page .entry-title { display: none !important; }
#kts .admin a { margin-left: 8px; color: var(--ink); }
#kts .admin a[aria-current="true"] { text-decoration: none; padding: 2px 8px; border-radius: 6px; background: var(--ink); color: var(--white); }
#kts .errmsg { color: #b3261e; font-size: 16px; font-weight: 700; }
#kts .plain { display: grid; gap: 4px; margin: 6px 0 0; padding-left: 20px; font-size: 16px; }
#kts .nextkit__covers { height: auto; display: flex; justify-content: center; }
#kts .nextkit__covers img { position: static; width: 150px; aspect-ratio: auto; transform: rotate(-2deg); }
#kts .nextkit .edrows { margin-top: 14px; max-width: 420px; }
#kts .nextkit .btn { margin-top: 12px; }
#kts .nextkit__price { margin-top: 8px; font-size: 18px; font-weight: 700; }
/* the cover sits in the flow here: the old centring shift moved it up and left over the block's edge */
#kts .nextkit__covers img:nth-child(1) { transform: rotate(-2deg); }
/* in the plan's main column on desktop the block is narrow: cover above the text (the 260px cover column left the
   text one word per line) */
@media (min-width: 1000px) {
  #kts .plan__main .nextkit { grid-template-columns: minmax(0, 1fr); padding: 26px 28px; }
  #kts .plan__main .nextkit__covers { justify-content: flex-start; }
  #kts .plan__main .nextkit__covers img { width: 120px; }
}
#kts .kit__cover a { display: block; height: 100%; }
/* theme leaks: dimmed focused buttons, upper-case definition terms */
#kts :is(button, a):is(:hover, :focus, :active) { opacity: 1; }
#kts dt { text-transform: none; letter-spacing: normal; }
#kts dd { margin-left: 0; }
/* the admin bar sits above fixed panels in admin preview */
body.admin-bar #kts .view { top: 32px; }
@media (max-width: 782px) { body.admin-bar #kts .view { top: 46px; } }

/* the diploma prints alone, full A4 */
@media print {
  @page { size: A4; margin: 0; }
  body.kts-print-dip * { visibility: hidden; }
  body.kts-print-dip #kts .dip, body.kts-print-dip #kts .dip * { visibility: visible; }
  body.kts-print-dip #kts .dip-frame { position: fixed; inset: 0; width: 210mm; border: 0; box-shadow: none; overflow: visible; }
  body.kts-print-dip #kts .scaled > .dip { position: fixed; top: 0; left: 0; transform: scale(1.89); transform-origin: 0 0; }
}

/* the week and level-check toggles use the generated chevron */
#kts .week__chev { border: 0; background: url(icons/chevron-down.webp) center / 28px no-repeat; transition: transform 160ms var(--ease); }
#kts .week__chev::before { content: none; }
#kts .week[open] .week__chev, #kts .enter[open] .week__chev { transform: rotate(180deg); }
#kts .week summary:hover .week__chev { transform: scale(1.08); }
#kts .week[open] summary:hover .week__chev { transform: rotate(180deg) scale(1.08); }

/* ---------- finding a workbook: search and topics, as in the online library ---------- */
#kts .finder { display: grid; gap: 12px; padding-bottom: 8px; }
#kts .finder__label { color: var(--ink); font-family: "Bricolage Grotesque", Arial, sans-serif; font-size: 20px; font-weight: 700; }
#kts .finder__search { position: relative; max-width: 640px; }
#kts .finder__search input {
  width: 100%;
  min-height: 50px;
  padding: 12px 100px 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--body);
  font: 400 18px/1.4 "Source Sans 3", Arial, sans-serif;
}
#kts .finder__search input:placeholder-shown { padding-right: 18px; }
#kts .finder__search input:focus { border-color: var(--blue); outline: 3px solid rgba(86, 176, 242, 0.28); outline-offset: 2px; }
#kts .finder__search button {
  position: absolute;
  top: 5px;
  right: 6px;
  min-height: 40px;
  padding: 7px 12px;
  border: 0;
  border-radius: 7px;
  background: var(--mist);
  color: var(--ink);
  font: 700 16px/1 "Source Sans 3", Arial, sans-serif;
  cursor: pointer;
}
#kts .finder__topics { display: flex; flex-wrap: wrap; gap: 8px; }
#kts .finder__topics button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 8px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--body);
  font: 700 16px/1.2 "Source Sans 3", Arial, sans-serif;
  cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}
#kts .finder__topics button:hover { background: var(--mist); }
#kts .finder__topics button[aria-pressed="true"] { border-color: var(--blue); background: var(--mist); color: var(--ink); }
#kts .finder__topics small {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--mist-strong);
  color: var(--muted);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
#kts .finder__count { color: var(--ink); font-size: 16px; font-weight: 700; }
#kts .finder__count:empty { display: none; }
@media (max-width: 759px) {
  #kts .finder__topics { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; scroll-snap-type: x proximity; }
  #kts .finder__topics button { flex: 0 0 auto; scroll-snap-align: start; }
}

/* ---------- the level check: its own block, results grouped by task with the workbooks under each ---------- */
#kts .resume__check { justify-self: start; margin-top: 4px; font-size: 16px; }
#kts .check { display: grid; gap: 18px; padding: 22px 20px; border: 0; border-radius: 18px; background: var(--mist); }
#kts .check__intro > p { margin-top: 10px; font-size: 16px; }
#kts .check__intro > .btn { margin-top: 16px; }
#kts .check__tasks legend { margin-bottom: 12px; font-size: 16px; }
#kts .check__tasks legend b { color: var(--ink); }
#kts .check .chip { background: var(--white); }
#kts .check .chip[aria-pressed="true"] { background: var(--mist-strong); }
#kts .check .result { margin-top: 0; padding: 20px; border-radius: 14px; background: var(--white); }
#kts .check__result:empty { display: none; }
#kts .check .again { margin-top: 0; }
#kts .rgroup { display: grid; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
#kts .rgroup__h { display: grid; gap: 2px; color: var(--ink); font-family: "Bricolage Grotesque", Arial, sans-serif; font-size: 18px; font-weight: 700; line-height: 1.3; }
#kts .rgroup__n { color: var(--muted); font-family: "Source Sans 3", Arial, sans-serif; font-size: 16px; font-weight: 700; }
#kts .shelf-grid--mini { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
#kts .rother { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
#kts .rother img { width: 72px; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 6px; }
#kts .rother__h { color: var(--ink); font-size: 16px; font-weight: 700; }
#kts .rother .plain { margin-top: 4px; }
#kts .rother .btn { margin-top: 10px; }
@media (min-width: 760px) {
  #kts .shelf-grid--mini { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #kts .check { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px 40px; padding: 28px 32px; }
  #kts .check__result, #kts .check .again { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  /* desktop: the check spans the plan above "Jak zacząć" and the weeks, so it is the first thing on the tab */
  #kts .plan > .check { grid-column: 1 / -1; grid-row: 1; }
  #kts .plan > .plan__side { grid-row: 2; }
  #kts .plan > .plan__main { grid-row: 2; }
  #kts .shelf-grid--mini { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
#kts .check .chips { grid-template-columns: 1fr; }
