/* kit.css: the components of window.Kit (assets/js/kit.js, PLATFORM.md § 4.11). Loaded after app.css and built from
   its custom properties, so that a part of the kit next to .btn, .input, .card or .pill is one family with them.
   Class prefix: kit-. Sizes follow app.css: controls are 46 px high, touch targets 44 px below 768 px. */

/* ---------- 1. Switch ---------- */
.kit-toggle {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: .9375rem;
  line-height: 1.5;
}
/* the checkbox lies unseen over the track: a tap on the track is a tap on a real control, which a screen reader finds */
.kit-toggle input {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 44px;
  height: 26px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
/* #7C86A6 on white is 3.6 : 1: the switch that is off is still seen as a control */
.kit-toggle-track {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: #7C86A6;
  transition: background-color .15s var(--ease);
}
.kit-toggle-track::after {
  content: "";
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(18, 24, 74, .3);
  transition: transform .15s var(--ease);
}
.kit-toggle input:checked + .kit-toggle-track { background: var(--blue); }
.kit-toggle input:checked + .kit-toggle-track::after { transform: translateX(18px); }
[dir="rtl"] .kit-toggle input:checked + .kit-toggle-track::after { transform: translateX(-18px); }
.kit-toggle input:focus-visible + .kit-toggle-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.kit-toggle input:disabled { cursor: not-allowed; }
.kit-toggle input:disabled + .kit-toggle-track { opacity: .5; }
.kit-toggle input:disabled ~ .kit-toggle-text { cursor: not-allowed; }
.kit-toggle input:disabled ~ .kit-toggle-text .kit-toggle-label { color: var(--muted); }
/* the first line of the text sits level with the middle of the track */
.kit-toggle-text { min-width: 0; padding-top: 2px; }
.kit-toggle-label { display: block; font-weight: 700; color: var(--heading); overflow-wrap: anywhere; }
.kit-toggle-hint { display: block; max-width: var(--measure); color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
  .kit-toggle { min-height: 44px; }
}

/* ---------- 2. Switch of several positions ---------- */
/* the look of the language switch of the header: 38 px positions in a frame make the 46 px of an input */
.kit-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #FFFFFF;
}
.kit-seg-item {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.kit-seg-item > span { min-width: 0; }
.kit-seg-item svg { width: 18px; height: 18px; }
.kit-seg-item:hover { background: var(--blue-50); }
.kit-seg-item[aria-checked="true"] { background: var(--navy); color: #FFFFFF; }
.kit-seg[aria-disabled="true"] { background: var(--bg); }
.kit-seg[aria-disabled="true"] .kit-seg-item { color: var(--muted); cursor: not-allowed; }
.kit-seg[aria-disabled="true"] .kit-seg-item:hover { background: transparent; }
.kit-seg[aria-disabled="true"] .kit-seg-item[aria-checked="true"] { background: #6B7593; color: #FFFFFF; }
.kit-seg[aria-invalid="true"] { border-color: var(--red-700); box-shadow: 0 0 0 3px rgba(215, 38, 30, .12); }
@media (max-width: 767.98px) {
  .kit-seg-item { min-height: 44px; }
}

/* ---------- 3. Select with a search ---------- */
/* the arrow is the one of .select, so the two controls cannot be told apart until one of them is opened */
.kit-combo { position: relative; }
.kit-combo-input {
  padding-inline-end: 40px;
  background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%2312184A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 20px 20px no-repeat;
}
[dir="rtl"] .kit-combo-input { background-position: left 12px center; }
.kit-combo.is-clearable.has-value .kit-combo-input { padding-inline-end: 72px; }
.kit-combo-clear {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
  cursor: pointer;
}
.kit-combo-clear:hover { background: var(--blue-50); color: var(--blue); }
.kit-combo-clear svg { width: 16px; height: 16px; }
@media (max-width: 767.98px) {
  .kit-combo-clear { width: 40px; height: 44px; }
  .kit-combo.is-clearable.has-value .kit-combo-input { padding-inline-end: 80px; }
}

/* ---------- 4. Popups: the list of a combobox, a menu ---------- */
/* A fixed box that kit.js places next to its anchor. 200: above the sticky header (60) and the register bar of the
   landing (70), below the toasts (300). */
.kit-pop {
  position: fixed;
  z-index: 200;
  box-sizing: border-box;
  min-width: 12rem;
  max-width: calc(100vw - 16px);
  max-height: 20rem;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #FFFFFF;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  animation: kit-pop-down .12s var(--ease);
}
.kit-pop[data-side="up"] { animation-name: kit-pop-up; }
@keyframes kit-pop-down { from { opacity: 0; transform: translateY(-4px); } }
@keyframes kit-pop-up { from { opacity: 0; transform: translateY(4px); } }

.kit-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 12px;
  min-height: 40px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: .9375rem;
  line-height: 1.35;
  cursor: pointer;
}
.kit-option.is-active { background: var(--blue-50); color: var(--blue-800); }
.kit-option[aria-selected="true"] { font-weight: 700; color: var(--heading); }
.kit-option-label { flex: 1 1 8rem; min-width: 0; overflow-wrap: anywhere; }
.kit-option-hint { min-width: 0; color: var(--muted); font-size: .8125rem; font-weight: 500; overflow-wrap: anywhere; }
.kit-option-check { width: 18px; height: 18px; color: var(--blue); visibility: hidden; }
.kit-option[aria-selected="true"] .kit-option-check { visibility: visible; }
.kit-pop-empty { margin: 0; padding: 10px; color: var(--muted); font-size: .9375rem; }
@media (max-width: 767.98px) {
  .kit-option { min-height: 44px; }
}

.kit-menu { max-width: min(20rem, calc(100vw - 16px)); }
.kit-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: start;
  cursor: pointer;
}
.kit-menu-item > span { min-width: 0; overflow-wrap: anywhere; }
.kit-menu-item svg { width: 18px; height: 18px; color: var(--muted); }
/* the pointer and the arrows share one mark: the item that has the focus */
.kit-menu-item:focus { outline: none; background: var(--blue-50); color: var(--blue-800); }
.kit-menu-item:focus svg { color: var(--blue); }
.kit-menu-item:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.kit-menu-item.is-danger, .kit-menu-item.is-danger svg { color: var(--red-700); }
.kit-menu-item.is-danger:focus { background: var(--red-50); color: var(--red-700); }
.kit-menu-item[aria-disabled="true"], .kit-menu-item[aria-disabled="true"] svg { color: var(--muted-2); cursor: not-allowed; }
.kit-menu-item[aria-disabled="true"]:focus { background: var(--bg); color: var(--muted-2); }
.kit-menu-sep { height: 1px; margin: 5px 4px; background: var(--line); }
@media (max-width: 767.98px) {
  .kit-menu-item { min-height: 44px; }
}

/* ---------- 5. Labels typed by hand ---------- */
/* the frame is the one of .input; the text field inside it has none */
.kit-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #FFFFFF;
  cursor: text;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.kit-tags:hover { border-color: #A9B4CC; }
.kit-tags:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 96, 174, .2); }
.kit-tags:has(.kit-tags-input[aria-invalid="true"]) { border-color: var(--red-700); box-shadow: 0 0 0 3px rgba(215, 38, 30, .12); }
.kit-tags:has(.kit-tags-input:disabled) { background: var(--bg); cursor: not-allowed; }
.kit-tags-list { display: contents; }
.kit-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  min-height: 30px;
  margin: 0;
  padding-inline: 10px 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--navy);
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.3;
}
.kit-tag > span { min-width: 0; overflow-wrap: anywhere; }
.kit-tag-remove {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
/* 44 px to touch around a 26 px cross */
.kit-tag-remove::after { content: ""; position: absolute; inset: -9px; }
.kit-tag-remove:hover, .kit-tag-remove:focus-visible { background: #FFFFFF; color: var(--red-700); }
.kit-tag-remove:disabled { visibility: hidden; }
.kit-tag-remove svg { width: 14px; height: 14px; }
/* 16 px: iOS zooms the page in when a smaller field gets the focus */
.kit-tags-input {
  flex: 1 1 8rem;
  min-width: 6rem;
  height: 30px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
.kit-tags-input::placeholder { color: #8A91AD; }
.kit-tags-input:focus { outline: none; }
.kit-tags-input:disabled { cursor: not-allowed; }
.kit-tags-full { padding: 0 4px; color: var(--muted-2); font-size: .8125rem; }

/* ---------- 6. Languages of a text ---------- */
.kit-langs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #FFFFFF;
}
.kit-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: .8125rem;
  font-weight: 700;
  cursor: pointer;
}
.kit-lang:hover { background: var(--blue-50); }
.kit-lang[aria-selected="true"] { background: var(--navy); color: #FFFFFF; }
/* a full dot: the language has a text; a ring: it has none (the shape tells it, not the colour alone) */
.kit-lang-dot { flex: none; width: 8px; height: 8px; border: 1.5px solid #7C86A6; border-radius: 50%; }
.kit-lang[data-filled="true"] .kit-lang-dot { border-color: var(--green); background: var(--green); }
.kit-lang[aria-selected="true"] .kit-lang-dot { border-color: #C3CCEA; }
.kit-lang[aria-selected="true"][data-filled="true"] .kit-lang-dot { border-color: #8EE09A; background: #8EE09A; }
@media (max-width: 767.98px) {
  .kit-lang { min-height: 44px; }
}

/* ---------- 7. Drop zone ---------- */
.kit-drop { position: relative; min-width: 0; }
.kit-drop-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 132px;
  padding: 20px 16px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  background: #FBFCFE;
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.kit-drop-button > svg { width: 28px; height: 28px; margin-bottom: 4px; color: var(--blue); }
.kit-drop-button .spinner { display: none; width: 24px; height: 24px; margin: 2px 0 6px; color: var(--blue); }
.kit-drop-button:hover { border-color: var(--blue); background: var(--blue-50); }
.kit-drop.is-over .kit-drop-button { border-style: solid; border-color: var(--blue); background: var(--blue-50); }
.kit-drop-label { max-width: 100%; color: var(--heading); font-size: .9375rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.kit-drop-hint { max-width: 100%; color: var(--muted-2); font-size: .8125rem; line-height: 1.45; overflow-wrap: anywhere; }
.kit-drop-button:disabled { border-color: var(--line); background: var(--bg); cursor: not-allowed; }
.kit-drop-button:disabled > svg { color: var(--muted-2); }
.kit-drop-button:disabled .kit-drop-label { color: var(--muted); }
.kit-drop.is-busy .kit-drop-button { cursor: progress; }
.kit-drop.is-busy .kit-drop-button > svg { display: none; }
.kit-drop.is-busy .kit-drop-button .spinner { display: inline-block; }

/* ---------- 8. Logo or initials ---------- */
/* a rounded square: logos are seldom round, and object-fit: contain shows one whole */
.kit-avatar {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue-800);
  font-size: .9375rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .02em;
  -webkit-user-select: none;
  user-select: none;
}
.kit-avatar-sm { width: 32px; height: 32px; border-radius: 8px; font-size: .75rem; }
.kit-avatar-lg { width: 72px; height: 72px; border-radius: 14px; font-size: 1.375rem; }
.kit-avatar[data-tint="1"] { background: var(--green-50); color: var(--green-700); }
.kit-avatar[data-tint="2"] { background: var(--amber-50); color: var(--amber-800); }
.kit-avatar[data-tint="3"] { background: var(--gray-50); color: var(--navy); }
/* the logo lies over the initials and shows once it has loaded (.has-image); until then the initials do */
.kit-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; }
.kit-avatar.has-image { border: 1px solid var(--line); background: #FFFFFF; color: transparent; }
.kit-avatar.has-image img { opacity: 1; }

/* ---------- 9. One figure ---------- */
/* the tile of .stat (app.css) with room for an icon and a line under the figure */
.kit-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 12px; }
.kit-stat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  gap: 2px 12px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #FFFFFF;
}
.kit-stat-label { grid-column: 1; grid-row: 1; color: var(--muted); font-size: .8125rem; font-weight: 700; overflow-wrap: break-word; hyphens: auto; }
.kit-stat-icon { grid-column: 2; grid-row: 1 / span 2; width: 20px; height: 20px; color: var(--muted-2); }
.kit-stat-value { grid-column: 1; grid-row: 2; color: var(--heading); font-size: 1.6rem; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kit-stat-hint { grid-column: 1 / -1; grid-row: 3; color: var(--muted); font-size: .8125rem; line-height: 1.4; }
.kit-stat.tone-blue .kit-stat-value { color: var(--blue-800); }
.kit-stat.tone-green .kit-stat-value { color: var(--green-700); }
.kit-stat.tone-amber .kit-stat-value { color: var(--amber-800); }
.kit-stat.tone-red .kit-stat-value { color: var(--red-700); }
.kit-stat.tone-navy { border-color: var(--navy); background: var(--navy); }
.kit-stat.tone-navy .kit-stat-value { color: #FFFFFF; }
.kit-stat.tone-navy .kit-stat-label, .kit-stat.tone-navy .kit-stat-hint { color: #C3CCEA; }
.kit-stat.tone-navy .kit-stat-icon { color: #9CC4F0; }
/* phones: a tile becomes a row «label … figure», as the tiles of the organisers' panel do */
@media (max-width: 479.98px) {
  .kit-stat-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .kit-stat { align-items: center; padding: 10px 14px; border-radius: 12px; }
  .kit-stat-label { font-size: .875rem; }
  .kit-stat-icon { display: none; }
  .kit-stat-value { grid-column: 2; grid-row: 1; font-size: 1.25rem; }
  .kit-stat-hint { grid-row: 2; }
}

/* ---------- 10. Nothing here yet, content on its way ---------- */
.kit-empty .btn { margin-top: 4px; }
.kit-skeleton { min-width: 0; }
.kit-skeleton > .skeleton:last-child { margin-bottom: 0; }

/* ---------- 11. Tabs ---------- */
/* on a phone the row scrolls sideways; kit.js keeps the open tab in view */
.kit-tabs {
  display: flex;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}
.kit-tabs::-webkit-scrollbar { display: none; }
.kit-tab {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .9375rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.kit-tab::after {
  content: "";
  position: absolute;
  inset-inline: 12px;
  inset-block-end: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
}
.kit-tab:hover { color: var(--navy); }
/* a tab is a button that changes what is shown below it, or a link to another view of the section */
a.kit-tab { text-decoration: none; }
.kit-tab[aria-selected="true"], .kit-tab[aria-current="page"] { color: var(--heading); }
.kit-tab[aria-selected="true"]::after, .kit-tab[aria-current="page"]::after { background: var(--blue); }
/* inside the scrolling row an outer ring would be cut off */
.kit-tab:focus-visible { outline-offset: -3px; }
.kit-tab-badge {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--gray-50);
  color: var(--gray-700);
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.kit-tab[aria-selected="true"] .kit-tab-badge { background: var(--blue-50); color: var(--blue-800); }

/* ---------- 12. Table ---------- */
/* the frame and the cells are .table-wrap and .table of app.css */
.kit-table .is-center { text-align: center; }
.kit-table tr.is-clickable { cursor: pointer; }
.kit-table tbody tr.is-clickable:hover td { background: var(--blue-50); }
.kit-table tr.is-clickable:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.kit-table td.kit-table-empty { padding: 28px 16px; color: var(--muted); text-align: center; }
.kit-table tbody tr:hover td.kit-table-empty { background: transparent; }

/* ---------- 13. Pages of a list ---------- */
.kit-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.kit-pager-list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.kit-pager-list li { margin: 0; }
.kit-page {
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: .9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.kit-page:hover { border-color: var(--line-2); background: #FFFFFF; }
.kit-page[aria-current="page"] { border-color: var(--navy); background: var(--navy); color: #FFFFFF; }
.kit-pager-gap { min-width: 24px; color: var(--muted); text-align: center; }
.kit-pager-status { display: none; color: var(--muted); font-size: .9375rem; font-weight: 600; text-align: center; }
.kit-pager-arrow { min-height: 40px; }
[dir="rtl"] .kit-pager-arrow svg { transform: scaleX(-1); }
@media (max-width: 599.98px) {
  .kit-pager { justify-content: space-between; }
  .kit-pager-list { display: none; }
  .kit-pager-status { display: block; flex: 1 1 0; }
}

/* ---------- 14. Side panel ---------- */
/* the dialog of UI.modal docked to the end edge of the screen, as high as the screen */
dialog.modal.kit-drawer {
  width: min(30rem, 100%);
  max-width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  margin-inline-start: auto;
  border-radius: 0;
  border-start-start-radius: 18px;
  border-end-start-radius: 18px;
  animation: kit-drawer-in .18s var(--ease);
}
dialog.modal.kit-drawer.wide { width: min(46rem, 100%); }
[dir="rtl"] dialog.modal.kit-drawer { animation-name: kit-drawer-in-rtl; }
.kit-drawer .modal-body { flex: 1 1 auto; }
@keyframes kit-drawer-in { from { opacity: 0; transform: translateX(32px); } }
@keyframes kit-drawer-in-rtl { from { opacity: 0; transform: translateX(-32px); } }
@media (max-width: 599.98px) {
  dialog.modal.kit-drawer, dialog.modal.kit-drawer.wide { width: 100%; border-radius: 0; }
}

/* ---------- 15. Picture viewer ---------- */
dialog.kit-lightbox {
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #FFFFFF;
}
dialog.kit-lightbox::backdrop { background: rgba(10, 14, 48, .94); }
/* pan-y pinch-zoom: a sideways swipe turns the pages here, two fingers still zoom the picture */
.kit-lightbox-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 12px 76px;
  touch-action: pan-y pinch-zoom;
}
@media (min-width: 768px) {
  .kit-lightbox-stage { padding-inline: 72px; }
}
.kit-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  background: #FFFFFF;
  object-fit: contain;
  transition: opacity .15s var(--ease);
  -webkit-user-select: none;
  user-select: none;
}
.kit-lightbox-stage.is-loading .kit-lightbox-img { opacity: 0; }
.kit-lightbox-stage .spinner { position: absolute; display: none; width: 28px; height: 28px; }
.kit-lightbox-stage.is-loading .spinner { display: block; }
.kit-lightbox-failed { max-width: 24rem; margin: 0; color: #C3CCEA; text-align: center; }
.kit-lightbox-btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #FFFFFF;
  cursor: pointer;
  transition: background-color .15s var(--ease);
}
.kit-lightbox-btn:hover { background: rgba(255, 255, 255, .28); }
.kit-lightbox-btn svg { width: 22px; height: 22px; }
.kit-lightbox-close { inset-block-start: 8px; inset-inline-end: 8px; }
.kit-lightbox-prev, .kit-lightbox-next { inset-block-start: 50%; transform: translateY(-50%); }
.kit-lightbox-prev { inset-inline-start: 8px; }
.kit-lightbox-next { inset-inline-end: 8px; }
[dir="rtl"] .kit-lightbox-prev svg, [dir="rtl"] .kit-lightbox-next svg { transform: scaleX(-1); }
.kit-lightbox-bar {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  pointer-events: none;
}
.kit-lightbox-bar p { margin: 0; }
.kit-lightbox-bar p:empty { display: none; }
.kit-lightbox-caption { max-width: 46rem; font-size: .9375rem; font-weight: 600; overflow-wrap: anywhere; }
.kit-lightbox-count { color: #C3CCEA; font-size: .8125rem; font-variant-numeric: tabular-nums; }

/* ---------- 16. Lists that can be reordered ---------- */
/* touch-action: none — the finger on the handle carries the item, it does not scroll the page */
.kit-sort-handle { cursor: grab; touch-action: none; }
.kit-sortable-free > * { cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.kit-sort-drag { position: relative; z-index: 5; box-shadow: var(--shadow-lg); transition: none !important; }
html.kit-sorting, html.kit-sorting * { cursor: grabbing !important; -webkit-user-select: none !important; user-select: none !important; }

/* ---------- 17. The gallery of the studio (studio/kit-gallery.js) ---------- */
.kitg { display: grid; gap: 28px; min-width: 0; }
.kitg-lead { max-width: var(--measure); margin: 0; color: var(--text); }
.kitg-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.kitg-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FFFFFF;
  color: var(--navy);
  font-size: .875rem;
  font-weight: 700;
  text-decoration: none;
}
.kitg-nav a:hover { border-color: var(--blue-100); background: var(--blue-50); color: var(--blue-800); }
@media (max-width: 767.98px) {
  .kitg-nav a { min-height: 44px; }
}
.kitg-group { display: grid; gap: 16px; min-width: 0; }
.kitg-group > h2 { margin: 0; font-size: 1.35rem; }
.kitg-item { display: grid; gap: 16px; min-width: 0; scroll-margin-top: calc(var(--sticky-top) + 16px); }
.kitg-item:focus { outline: none; }
.kitg-head { display: grid; gap: 4px; min-width: 0; }
.kitg-head h3 { margin: 0; font-size: 1.0625rem; }
.kitg-head p { max-width: var(--measure); margin: 0; color: var(--muted); font-size: .9375rem; }
.kitg code {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: .8125rem;
  overflow-wrap: anywhere;
}
.kitg-head h3 code { font-size: 1rem; font-weight: 700; }
.kitg-sign { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--bg); color: var(--muted); line-height: 1.5; }
.kitg-stage { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.5rem), 1fr)); gap: 20px 24px; align-items: start; min-width: 0; }
.kitg-case { display: grid; gap: 8px; align-content: start; justify-items: start; min-width: 0; }
.kitg-case > * { min-width: 0; max-width: 100%; }
.kitg-case.is-wide { grid-column: 1 / -1; }
.kitg-case.is-fill { justify-items: stretch; }
.kitg-case-label { color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.kitg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.kitg-note { max-width: var(--measure); margin: 0; color: var(--muted); font-size: .875rem; }
/* what a control looks like with the focus of the keyboard, drawn without it */
.kitg-focus.input { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 96, 174, .2); }
.kitg-focus.btn { outline: 3px solid var(--focus); outline-offset: 2px; }
.kitg-list { display: grid; gap: 8px; width: 100%; margin: 0; padding: 0; list-style: none; }
.kitg-list li { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #FFFFFF; }
.kitg-list li > span { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.kitg-grip { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.kitg-grip:hover { background: var(--bg); color: var(--navy); }
.kitg-grip svg { width: 20px; height: 20px; }
@media (max-width: 767.98px) {
  .kitg-grip { width: 44px; height: 44px; }
}
.kitg-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; width: 100%; margin: 0; padding: 0; list-style: none; }
.kitg-tiles li { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #FFFFFF; }
.kitg-tiles img, .kitg-thumbs img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.kitg-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; width: 100%; }
.kitg-thumbs button { padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #FFFFFF; cursor: zoom-in; }
.kitg-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 8px; width: 100%; margin: 0; padding: 0; list-style: none; }
.kitg-icons li { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--navy); }
.kitg-icons svg { width: 24px; height: 24px; }
.kitg-icons code { min-width: 0; color: var(--muted); }
