/* Components. Three control heights only: 30 (s), 36 (m), 44 (l). */

/* ── Button ─────────────────────────────────────────── */
.btn {
  --h: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--h); padding: 0 14px; border-radius: 9px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 400; line-height: 1; white-space: nowrap; flex-shrink: 0;
  transition: background-color .12s ease-out, border-color .12s ease-out, color .12s ease-out, opacity .12s ease-out;
}
.btn .ic { font-size: 18px; }
.btn--s { --h: 30px; padding: 0 10px; border-radius: 7px; font-size: 12.5px; }
.btn--s .ic { font-size: 16px; }
.btn--l { --h: 44px; padding: 0 18px; border-radius: 10px; font-size: 15px; }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .4; cursor: not-allowed; }
.btn[aria-busy=true] { cursor: progress; }

.btn--primary { background: var(--tx); color: var(--bg); border-color: var(--tx); font-weight: 500; border-width: 0; }
.btn--primary:not(:disabled):hover { background: color-mix(in oklch, var(--tx) 85%, var(--bg)); }
.btn--primary:disabled:not([aria-busy=true]) { opacity: 1; background: var(--sf3); color: var(--mu); }  /* as in the mockup: a quiet grey button until the form is ready */
.btn--accent { background: var(--ac); color: var(--acf); font-weight: 500; border-width: 0; }
.btn--accent:not(:disabled):hover { background: color-mix(in oklch, var(--ac) 85%, var(--bg)); }
.btn--secondary { background: var(--sf); color: var(--tx); border-color: var(--bd); }
.btn--secondary:not(:disabled):hover { background: var(--sf2); }
.btn--ghost { background: transparent; color: var(--tx); }
.btn--ghost:not(:disabled):hover { background: var(--sf2); }
.btn--muted { background: transparent; color: var(--mu); }
.btn--muted:not(:disabled):hover { background: var(--sf2); color: var(--tx); }
.btn--danger { background: var(--err); color: #fff; font-weight: 500; border-width: 0; }
.btn--danger:not(:disabled):hover { background: color-mix(in oklch, var(--err) 85%, var(--bg)); }
.btn--danger-soft { background: var(--errbg); color: var(--err); font-weight: 500; border-width: 0; }
.btn--danger-soft:not(:disabled):hover { background: color-mix(in oklch, var(--err) 20%, transparent); }
.btn--link { background: none; border: 0; padding: 0; height: auto; color: var(--act); }
.btn--link:not(:disabled):hover { text-decoration: underline; }
.btn--text { background: none; border: 0; padding: 0; height: auto; color: var(--mu); font-size: 13px; line-height: 1.5; }
.btn--text:not(:disabled):hover { color: var(--tx); }

.spinner { animation: kp-spin .9s linear infinite; }

/* Icon button: square, same heights as buttons. */
.ibtn {
  --h: 36px;
  width: var(--h); height: var(--h); padding: 0; border-radius: 9px; border: 1px solid var(--bd);
  background: var(--sf); color: var(--tx); display: grid; place-items: center; position: relative; flex: none;
  transition: border-color .12s ease-out, background-color .12s ease-out, color .12s ease-out;
}
.ibtn:not(:disabled):hover { border-color: var(--bd2); }
.ibtn .ic { font-size: 20px; }
.ibtn--s { --h: 30px; border-radius: 7px; border-color: transparent; background: transparent; color: var(--mu); }
.ibtn--s .ic { font-size: 18px; }
.ibtn--s:not(:disabled):hover { background: var(--sf2); color: var(--tx); border-color: transparent; }
.ibtn--l { --h: 44px; border-radius: 10px; }

/* ── Inputs ─────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; min-width: 0; }
.field--mu { color: var(--mu); font-weight: 400; }
.field--s { font-size: 12.5px; }
.field-hint { font-size: 12px; color: var(--mu); font-weight: 400; line-height: 1.5; }
.field-err { font-size: 12px; color: var(--err); font-weight: 400; display: flex; gap: 4px; align-items: center; line-height: 1.4; }
.field-err .ic { font-size: 14px; }

.input {
  height: 36px; width: 100%; min-width: 0; border: 1px solid var(--bd); border-radius: 9px; background: var(--sf); color: var(--tx);
  padding: 0 12px; font-size: 13.5px; font-weight: 400; outline: none;
  transition: border-color .12s ease-out, box-shadow .12s ease-out;
}
.input::placeholder { color: var(--mu); opacity: 1; }
.input:focus { border-color: var(--tx); outline: 3px solid var(--acbg); outline-offset: 0; }
.input[aria-invalid=true] { border-color: var(--err); }
.input[aria-invalid=true]:focus { outline-color: var(--errbg); }
.input:disabled { background: var(--sf2); color: var(--mu); cursor: not-allowed; }
.input--l { height: 44px; border-radius: 10px; padding: 0 14px; font-size: 15px; }
.input--l:focus { border-color: var(--ac); outline: none; box-shadow: 0 0 0 3px var(--acbg); }
.input--mono { font-family: var(--mono); font-size: 13px; }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }

.search {
  display: flex; align-items: center; gap: 8px; height: 34px; border: 1px solid var(--bd); border-radius: 9px; background: var(--sf);
  padding: 0 10px; min-width: 0;
}
.search .ic { font-size: 18px; color: var(--mu); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 13.5px; }
.search:focus-within { border-color: var(--tx); outline: 3px solid var(--acbg); }

.kbd { font-family: var(--mono); font-size: 11px; color: var(--mu); border: 1px solid var(--bd); border-radius: 5px; padding: 1px 5px; line-height: 1.4; }

/* Six-box code input backed by one hidden numeric input. */
.code { position: relative; display: block; cursor: text; }
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-box {
  height: 56px; border: 1px solid var(--bd2); border-radius: 12px; background: var(--sf);
  display: grid; place-items: center; font-family: var(--mono); font-size: 22px; font-weight: 500;
}
.code-box[data-active=true] { border-color: var(--ac); }
.code input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; font-size: 16px; border: 0; }
.code--s .code-boxes { gap: 6px; }
.code--s .code-box { height: 48px; border-radius: 9px; background: var(--bg); font-size: 20px; font-weight: 400; }
.code[aria-busy=true] { pointer-events: none; opacity: .6; }

/* ── Toggle, checkbox, radio ────────────────────────── */
.toggle { width: 36px; height: 22px; border-radius: 999px; background: var(--sf3); position: relative; flex: none; border: 0; padding: 0; transition: background-color .15s; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: left .15s; }
.toggle[aria-checked=true] { background: var(--ac); }
.toggle[aria-checked=true]::after { left: 16px; }
.toggle:disabled { opacity: .45; }

.check {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--bd2); background: transparent; flex: none;
  display: grid; place-items: center; color: var(--bg); padding: 0;
}
.check .ic { font-size: 16px; visibility: hidden; }
.check[aria-checked=true] { border-color: var(--tx); background: var(--tx); }
.check[aria-checked=true] .ic { visibility: visible; }
.check--radio { border-radius: 50%; }
.check--radio .ic { font-size: 10px; font-variation-settings: "FILL" 1; }

/* ── Segmented control, tabs, chips ─────────────────── */
.seg { display: inline-flex; border: 1px solid var(--bd); border-radius: 9px; padding: 2px; background: var(--sf); flex: none; }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; font-size: 12.5px; background: transparent; color: var(--mu); }
.seg button[aria-pressed=true] { background: var(--sf3); color: var(--tx); }
.seg--compact button { padding: 0 10px; }
.seg--l button { height: 31px; font-size: 13px; }
.seg--icons button { width: 30px; padding: 0; display: grid; place-items: center; }
.seg--icons .ic { font-size: 17px; }
.seg--field { background: var(--bg); align-self: flex-start; }
.seg--field button { height: auto; padding: 7px 14px; font-size: 13px; }
.seg--xs { border-radius: 7px; }
.seg--xs button { height: 24px; padding: 0 9px; border-radius: 5px; font-size: 12px; font-weight: 500; }
.seg--xs button[aria-pressed=true] { background: var(--tx); color: var(--bg); }

.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--bd); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { height: 36px; padding: 0; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--mu); font-size: 13.5px; }
.tabs button[aria-selected=true] { border-bottom-color: var(--tx); color: var(--tx); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px;
  font-size: 12.5px; border: 1px solid var(--bd); background: var(--sf); color: var(--tx); white-space: nowrap;
}
.chip[aria-pressed=true] { background: var(--tx); color: var(--bg); border-color: var(--tx); }
.chip .n { font-family: var(--mono); font-size: 11.5px; opacity: .7; }
/* A choice in the status's own colour (a lead's status), not the inverted filter look */
.chip--ac { --c: var(--act); } .chip--ok { --c: var(--ok); } .chip--warn { --c: var(--warn); } .chip--err { --c: var(--err); } .chip--mu { --c: var(--mu); }
:is(.chip--ac, .chip--ok, .chip--warn, .chip--err, .chip--mu)[aria-pressed=true] { border-color: var(--c); background: color-mix(in oklch, var(--c) 14%, transparent); color: var(--c); }

/* ── Badge ──────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; border: 1px solid transparent; white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-dot--live { animation: kp-pulse 2s infinite; }
.badge--ok { background: var(--okbg); color: var(--ok); }
.badge--warn { background: var(--warnbg); color: var(--warn); }
.badge--err { background: var(--errbg); color: var(--err); }
.badge--ac { background: var(--acbg); color: var(--act); }
.badge--mu { background: var(--sf2); color: var(--mu); border-color: var(--bd); }
.badge--outline { background: transparent; color: var(--tx); border-color: var(--bd2); }
.counter { min-width: 18px; height: 18px; border-radius: 9px; background: var(--err); color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.lock-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--warn); border: 1px solid var(--bd); border-radius: 999px; padding: 1px 8px; }
.lock-pill .ic { font-size: 13px; }

/* ── Card, panel ────────────────────────────────────── */
.card { border: 1px solid var(--bd); border-radius: 12px; background: var(--sf); }
.card--pad { padding: 16px; }

/* ── Menu (raised) ──────────────────────────────────── */
.menu {
  position: fixed; z-index: var(--z-dropdown); background: var(--sf); border: 1px solid var(--bd2); border-radius: 12px;
  box-shadow: var(--menu-shadow); padding: 4px; display: flex; flex-direction: column;
  max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin;
  animation: kp-in .16s ease-out;
}
.menu-scrim { position: fixed; inset: 0; z-index: calc(var(--z-dropdown) - 1); }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--bd); margin-bottom: 4px; display: flex; flex-direction: column; min-width: 0; }
.menu-label { padding: 6px 10px 2px; font-size: 11.5px; color: var(--mu); font-weight: 500; }
.menu-sep { height: 1px; background: var(--bd); margin: 4px 0; flex: none; }
.menu-item {
  display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 7px 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--tx); font-size: 13px; text-align: left; width: 100%; white-space: nowrap;
}
.menu-item > .ic { font-size: 18px; color: var(--mu); }
.menu-item:hover, .menu-item:focus-visible { background: var(--sf2); outline: none; }
.menu-item--mu { color: var(--mu); }
.menu-item--mu:hover { color: var(--tx); }
.menu-item--danger, .menu-item--danger > .ic { color: var(--err); }
.menu-item .end { margin-left: auto; font-size: 12px; color: var(--mu); }
.menu-row { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 10px; font-size: 13px; }
.menu-row > .ic { font-size: 18px; color: var(--mu); }

/* ── Modal, sheet ───────────────────────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: var(--z-modal); background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  width: min(420px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overflow-x: hidden;
  background: var(--sf); border: 1px solid var(--bd2); border-radius: 16px; box-shadow: var(--shadow);
  animation: kp-in .14s ease-out; outline: none;
}
.modal-head { padding: 18px 20px 0; display: flex; align-items: center; gap: 10px; }
.modal-title { font-weight: 600; font-size: 16px; line-height: 1.3; flex: 1; min-width: 0; }
.modal-body { padding: 16px 20px 0; display: flex; flex-direction: column; gap: 6px; }
.modal-text { font-size: 13px; color: var(--mu); line-height: 1.5; text-wrap: pretty; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px; flex-wrap: wrap; }
.modal-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--sf2); border: 1px solid var(--bd); display: grid; place-items: center; flex: none; }

/* ── Toast ──────────────────────────────────────────── */
.toasts {
  position: fixed; z-index: var(--z-toast); right: 20px; bottom: 20px; width: 380px; max-width: calc(100vw - 24px);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
@media (max-width: 639px) { .toasts { left: 12px; right: 12px; bottom: 76px; width: auto; } }
.toasts--no-tabbar { bottom: 20px !important; }
.toast {
  pointer-events: auto; position: relative; overflow: hidden; display: grid; grid-template-columns: 28px minmax(0,1fr) auto;
  gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--bd2); border-radius: 12px;
  background: var(--sf); color: var(--tx); box-shadow: var(--shadow); animation: kp-in .18s ease-out;
}
.toast-icon { width: 28px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--c); background: color-mix(in oklch, var(--c) 14%, transparent); }
.toast-icon .ic { font-size: 16px; }
.toast-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 4px; }
.toast-msg { font-size: 13.5px; font-weight: 500; line-height: 1.3; text-wrap: pretty; }
.toast-desc { font-size: 12.5px; color: var(--mu); line-height: 1.5; }
.toast-actions { display: flex; gap: 4px; align-items: center; }
.toast-act { height: 30px; padding: 0 10px; border: 1px solid var(--bd); border-radius: 7px; background: var(--sf2); color: var(--tx); font-size: 12.5px; font-weight: 500; }
.toast-close { width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--mu); font-size: 16px; line-height: 1; padding: 0; }
.toast-close:hover { background: var(--sf2); color: var(--tx); }
.toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--c); opacity: .7; transform-origin: left; animation: kp-bar var(--dur) linear forwards; }
.toast:hover .toast-bar { animation-play-state: paused; }
.toast--ok { --c: var(--ok); } .toast--err { --c: var(--err); } .toast--warn { --c: var(--warn); } .toast--info, .toast--loading { --c: var(--act); }

/* ── Banner, alert ──────────────────────────────────── */
.banner {
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; flex-wrap: wrap;
  border: 1px solid color-mix(in oklch, var(--c) 35%, transparent); background: var(--cbg);
}
.banner > .ic { font-size: 18px; color: var(--c); }
.banner--warn { --c: var(--warn); --cbg: var(--warnbg); }
.banner--err { --c: var(--err); --cbg: var(--errbg); }
.banner--info { --c: var(--act); --cbg: var(--acbg); }
.inline-err { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--err); line-height: 1.5; }
.inline-err .ic { font-size: 16px; }

/* ── Skeleton, progress ─────────────────────────────── */
.skel { border-radius: 7px; background: var(--sf2); animation: kp-skel 1.2s infinite; }
.progress { height: 4px; border-radius: 2px; background: var(--sf3); overflow: hidden; }
.progress > div { height: 100%; border-radius: 2px; background: var(--c, var(--tx)); }

/* ── Empty / error states ───────────────────────────── */
.empty {
  border: 1px dashed var(--bd2); border-radius: 16px; background: var(--sf); padding: 56px 24px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px;
}
.empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--sf2); border: 1px solid var(--bd); display: flex; align-items: center; justify-content: center; }
.empty-icon .ic { font-size: 28px; color: var(--mu); }
.empty-head { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; max-width: 440px; text-wrap: pretty; }
.empty-body { color: var(--mu); font-size: 14px; line-height: 1.55; max-width: 460px; text-wrap: pretty; }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

.state-err {
  border: 1px solid color-mix(in oklch, var(--err) 30%, transparent); border-radius: 12px; background: var(--sf);
  padding: 48px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
}
.tile-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tile-icon .ic { font-size: 22px; }
.tile-icon--err { background: var(--errbg); color: var(--err); }
.tile-icon--warn { background: var(--warnbg); color: var(--warn); }
.tile-icon--mu { background: var(--sf2); border: 1px solid var(--bd); }
.tile-icon--ok { background: var(--okbg); color: var(--ok); }

/* ── Data views: stat tiles, filters, bulk bar, tables ── */
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--bd); border: 1px solid var(--bd); border-radius: 12px; overflow: hidden; }
@media (max-width: 1023px) { .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-tile { background: var(--sf); padding: 14px 18px; display: flex; align-items: center; gap: 10px; cursor: pointer; border: 0; color: var(--tx); text-align: left; font: inherit; }
.stat-tile:hover { background: var(--sf2); }
.stat-tile[aria-pressed=true] { background: var(--sf2); box-shadow: inset 0 0 0 1.5px var(--tx); }
.stat-tile .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.stat-tile .l { color: var(--mu); font-size: 13px; flex: 1; }
.stat-tile .v { font-size: 20px; font-weight: 600; }

.tabs--page button { height: auto; padding: 10px 0; display: flex; gap: 6px; align-items: center; }
/* Page tabs with the list's tools on the same line (search, view, sort), as on Projects in the mockup */
.tabs-bar { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--bd); flex-wrap: wrap; }
.tabs-bar > .tabs { border-bottom: 0; }
.tabs-bar-tools { margin-left: auto; display: flex; gap: 8px; padding-bottom: 6px; flex-wrap: wrap; flex: 0 1 auto; min-width: 0; align-items: center; }
.tabs-bar-tools .search { width: 220px; }
@media (max-width: 639px) { .tabs-bar-tools { flex: 1 1 100%; } .tabs-bar-tools .search { width: 100%; } }
.tab-n { font-family: var(--mono); font-size: 11px; color: var(--mu); background: var(--sf2); border-radius: 5px; padding: 1px 5px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .search { flex: 0 1 300px; min-width: 180px; }
@media (max-width: 639px) { .toolbar .search { flex: 1 1 200px; } }
.search .ic { font-size: 16px; }
.fchip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px 0 10px; border: 1px solid var(--bd); border-radius: 999px; background: var(--sf2); font-size: 12.5px; white-space: nowrap; }
.fchip .k { color: var(--mu); }
.fchip button { width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: var(--mu); display: grid; place-items: center; padding: 0; }
.fchip button .ic { font-size: 14px; }
.fchip button:hover { color: var(--tx); }

.bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--bd2); border-radius: 12px; background: var(--sf2); }
.bulkbar .n { font-size: 13px; font-weight: 500; margin-right: auto; }

.table { border: 1px solid var(--bd); border-radius: 12px; background: var(--sf); overflow-x: auto; }
.table-in { min-width: var(--minw, 930px); }
.trow { display: grid; grid-template-columns: var(--cols); gap: 12px; padding: 10px 18px; align-items: center; border-bottom: 1px solid var(--bd); font-size: 13.5px; }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--sf2); }
.thead { display: grid; grid-template-columns: var(--cols); gap: 12px; align-items: center; padding: 9px 18px; font-size: 12px; color: var(--mu); background: var(--sf2); border-bottom: 1px solid var(--bd); }
.th { border: 0; background: none; padding: 0; font-size: 12px; color: var(--mu); display: flex; gap: 4px; align-items: center; min-width: 0; cursor: default; }
.th[data-sort] { cursor: pointer; }
.th[aria-sort=ascending], .th[aria-sort=descending] { color: var(--tx); }
.th .arrow { font-family: var(--mono); }
.th--right { justify-content: flex-end; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.ibtn--danger { color: var(--err); }
.ibtn--danger:not(:disabled):hover { background: var(--errbg); }
.ibtn--s.ibtn--bordered { border-color: var(--bd); background: var(--sf); color: var(--tx); }
.ibtn--s.ibtn--bordered:not(:disabled):hover { background: var(--sf2); }
.ibtn--s.ibtn--bordered.ibtn--danger { color: var(--err); }
.ibtn--s.ibtn--bordered.ibtn--danger:not(:disabled):hover { background: var(--errbg); }
.table-empty { padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.table-empty > .ic { font-size: 28px; color: var(--mu); }

.cb { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--bd2); background: transparent; padding: 0; display: grid; place-items: center; color: var(--bg); flex: none; }
.cb .ic { font-size: 13px; visibility: hidden; }
.cb[aria-checked=true], .cb[aria-checked=mixed], .cb[data-on=true] { border-color: var(--tx); background: var(--tx); }
.cb[aria-checked=true] .ic, .cb[data-on=true] .ic { visibility: visible; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; justify-self: start; color: var(--c); background: var(--cbg); border: 0; font-family: var(--font); line-height: 1.5; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--nodot::before { display: none; }
.pill .ic { font-size: 14px; margin-left: 2px; }
button.pill { cursor: pointer; }
.pill--ok { --c: var(--ok); --cbg: var(--okbg); }
.pill--warn { --c: var(--warn); --cbg: var(--warnbg); }
.pill--err { --c: var(--err); --cbg: var(--errbg); }
.pill--ac { --c: var(--act); --cbg: var(--acbg); }
.pill--mu { --c: var(--mu); --cbg: var(--sf2); }
.pill--live::before { animation: kp-pulse 2s infinite; }

.cards { display: flex; flex-direction: column; gap: 10px; }

/* ── Side sheet ─────────────────────────────────────── */
.sheet-scrim { position: fixed; inset: 0; z-index: var(--z-sheet); background: var(--scrim); display: flex; justify-content: flex-end; }
.sheet { width: 460px; max-width: 100%; height: 100%; background: var(--sf); border-left: 1px solid var(--bd2); box-shadow: var(--shadow); display: flex; flex-direction: column; outline: none; animation: kp-in .16s ease-out; }
@media (max-width: 639px) { .sheet { width: 100%; } }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--bd); }
.sheet-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.sheet-sub { font-size: 13px; color: var(--mu); line-height: 1.5; text-wrap: pretty; }
.sheet-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.sheet-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--bd); flex-wrap: wrap; }
.optchips { display: flex; gap: 6px; flex-wrap: wrap; }
.optchip { height: 30px; padding: 0 10px; border: 1px solid var(--bd); border-radius: 7px; background: transparent; color: var(--tx); font-size: 12.5px; }
.optchip[aria-pressed=true] { border-color: var(--tx); background: var(--tx); color: var(--bg); }
.optchips--l { gap: 8px; }
.optchips--l .optchip { height: 36px; padding: 0 14px; border-radius: 9px; font-size: 13.5px; }  /* the wizard's questions, as in the mockup */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--sf2); font-size: 12.5px; line-height: 1.5; }
.note > .ic { font-size: 17px; color: var(--c, var(--act)); }
.note--warn { background: var(--warnbg); border: 1px solid var(--bd); font-size: 13px; --c: var(--warn); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; cursor: pointer; }
.dropzone { border: 1px dashed var(--bd2); border-radius: 12px; background: var(--bg); color: var(--tx); padding: 22px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; white-space: normal; text-align: center; }
.dropzone:hover, .dropzone[data-over=true] { border-color: var(--tx); }
.dropzone > .ic { font-size: 24px; color: var(--mu); }

.select { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.select select { height: 36px; border: 1px solid var(--bd); border-radius: 9px; background: var(--sf); color: var(--tx); padding: 0 32px 0 12px; font-size: 13.5px; outline: none; appearance: none; -webkit-appearance: none; cursor: pointer; width: 100%; }
.select select:focus { border-color: var(--tx); outline: 3px solid var(--acbg); }
.select > .ic { position: absolute; right: 9px; pointer-events: none; font-size: 18px; color: var(--mu); }
.select--s select { height: 30px; border-radius: 7px; font-size: 12.5px; padding: 0 28px 0 10px; }
.select--s > .ic { right: 7px; font-size: 16px; }
.select--l select { height: 44px; border-radius: 10px; font-size: 14px; padding: 0 36px 0 14px; }

.option-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.option-card { border: 1px solid var(--bd); background: transparent; border-radius: 12px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--tx); white-space: normal; font: inherit; }
.option-card[aria-pressed=true] { border-color: var(--tx); background: var(--sf2); }
.option-card > .ic { font-size: 22px; }
.option-card .t { font-size: 13px; font-weight: 500; }
.option-card .d { font-size: 11.5px; color: var(--mu); }
@media (max-width: 479px) { .option-cards { grid-template-columns: minmax(0, 1fr); } }

.qr { border-radius: 12px; background: var(--qr); padding: 14px; flex: none; display: grid; place-items: center; }
.qr img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.result { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 0; text-align: center; }
.result .t { font-weight: 600; font-size: 15px; }
.result .d { font-size: 13px; color: var(--mu); max-width: 360px; line-height: 1.5; text-wrap: pretty; }

/* Empty/error states inside a wide scrolling table stay in the visible part (the table is the size container). */
.table, .table-scroll { container-type: inline-size; }
.table-in > .table-empty, .table-in > .table-state { position: sticky; left: 0; width: 100cqw; box-sizing: border-box; }
.cap-first::first-letter { text-transform: uppercase; }  /* a phrase that is lowercase mid-sentence (“кредиты KicksPost”) used as a title */
