/* kartora's components and layout. Every value comes from tokens.css. Sizes follow the app's own width, not the
   window's: phone below 720px, tablet from 720px, desktop from 1200px, through the container named "app". */

/* ---------- The app and its sizes ---------- */
.k-app {
  container: app / inline-size;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
.k-app[data-size='large'] {
  font-size: 19px;
  --touch: var(--touch-large);
}
:where(.k-app) *,
:where(.k-app) *::before,
:where(.k-app) *::after {
  box-sizing: border-box;
}
.k-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.k-app :focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
:where(.k-app) a {
  color: var(--accent);
}
.k-app img,
.k-app svg {
  max-width: 100%;
}

/* Type */
.k-display,
.k-title,
.k-heading {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.k-display {
  font-size: var(--display);
}
.k-title {
  font-size: var(--title);
}
.k-heading {
  font-size: var(--heading);
  line-height: 1.25;
}
@container app (min-width: 1200px) {
  .k-display {
    font-size: var(--display-wide);
  }
  .k-title {
    font-size: var(--title-wide);
  }
  .k-heading {
    font-size: var(--heading-wide);
  }
}
.k-lede {
  font-size: var(--text-lg);
  margin: 0;
}
.k-small {
  font-size: var(--text-sm);
}
.k-xs {
  font-size: var(--text-xs);
}
.k-muted {
  color: var(--muted);
}
.k-strong {
  font-weight: 700;
}
:where(.k-app) p {
  margin: 0;
}

/* ---------- Layout primitives ---------- */
.k-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap, var(--space-4));
  min-width: 0;
}
.k-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap, var(--space-2));
  min-width: 0;
}
.k-row--between {
  justify-content: space-between;
}
.k-row--end {
  justify-content: flex-end;
}
.k-grid {
  display: grid;
  gap: var(--gap, var(--space-4));
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 240px)), 1fr));
}
.k-split {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@container app (min-width: 1200px) {
  .k-split {
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: var(--space-6);
  }
  .k-split > .k-sticky {
    position: sticky;
    top: var(--space-4);
  }
}
.k-content {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.k-content--read {
  max-width: var(--read);
}
@container app (min-width: 720px) {
  .k-content {
    padding: var(--space-6) var(--space-6) var(--space-8);
  }
}
.k-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}
.k-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
}
.k-only-phone {
  display: revert;
}
.k-from-tablet {
  display: none;
}
.k-only-desktop {
  display: none;
}
@container app (min-width: 720px) {
  .k-only-phone {
    display: none;
  }
  .k-from-tablet {
    display: revert;
  }
}
@container app (min-width: 1200px) {
  .k-only-desktop {
    display: revert;
  }
}

/* ---------- The shell: app bar; bottom tabs on a phone, a rail on a tablet, a sidebar on a desktop ---------- */
.k-shell {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
}
.k-shell__side {
  display: none;
}
.k-shell__main {
  min-width: 0;
}
.k-shell__bottom {
  position: sticky;
  bottom: 0;
  z-index: 5;
}
@container app (min-width: 720px) {
  .k-shell {
    grid-template-columns: var(--rail) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }
  .k-shell > .k-appbar {
    grid-column: 1 / -1;
  }
  .k-shell__side {
    display: block;
    border-right: 1px solid var(--line);
    background: var(--surface);
  }
  .k-shell__bottom {
    display: none;
  }
}
@container app (min-width: 1200px) {
  .k-shell {
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
  }
}

.k-appbar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 60px;
  padding: var(--space-2) var(--space-4);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.k-appbar__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}
.k-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1;
}
.k-logo--lg {
  gap: var(--space-3);
  font-size: 2.6rem;
}
.k-mark {
  flex: none;
  display: block;
}
.k-appbar__title {
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.k-appbar__spacer {
  flex: 1;
}
.k-appbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.k-sidenav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-1);
  position: sticky;
  top: 60px;
}
.k-sidenav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 700;
  text-align: center;
  min-height: var(--touch);
  min-width: 0;
  position: relative;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.k-sidenav__item:hover {
  color: var(--ink);
}
.k-sidenav__item:hover .k-nav__icon {
  background: var(--surface-2);
}
@container app (min-width: 1200px) {
  .k-sidenav__item:hover {
    background: var(--surface-2);
  }
  .k-sidenav__item:hover .k-nav__icon {
    background: none;
  }
}
.k-sidenav__item[aria-current='page'] {
  color: var(--accent-strong);
}
@container app (min-width: 1200px) {
  .k-sidenav__item[aria-current='page'] {
    background: var(--accent-soft);
  }
}
@container app (min-width: 1200px) {
  .k-sidenav {
    padding: var(--space-4) var(--space-3);
  }
  .k-sidenav__item {
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-md);
    text-align: left;
  }
}
.k-sidenav__count {
  position: absolute;
  top: 4px;
  right: 10px;
}
@container app (min-width: 1200px) {
  .k-sidenav__count {
    position: static;
    margin-left: auto;
  }
}

.k-bottomnav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: var(--space-1) var(--space-1) calc(var(--space-1) + env(safe-area-inset-bottom, 0px));
}
.k-bottomnav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
  min-width: 0;
  padding: var(--space-1) 0;
  color: var(--muted);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: var(--radius-md);
  position: relative;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.k-bottomnav__item[aria-current='page'] {
  color: var(--accent-strong);
}
.k-nav__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 32px;
  border-radius: var(--radius-pill);
  transition: background-color var(--motion);
}
.k-nav__label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}
.k-nav__full {
  display: none;
}
.k-bottomnav__item[aria-current='page'] .k-nav__icon,
.k-sidenav__item[aria-current='page'] .k-nav__icon {
  background: var(--accent-soft);
}
@container app (min-width: 1200px) {
  .k-sidenav__item .k-nav__icon {
    width: auto;
    height: auto;
    background: none;
  }
  .k-sidenav__item[aria-current='page'] .k-nav__icon {
    background: none;
  }
  .k-sidenav__item .k-nav__short {
    display: none;
  }
  .k-sidenav__item .k-nav__full {
    display: block;
  }
}
.k-bottomnav__count {
  position: absolute;
  top: 2px;
  left: calc(50% + 10px);
}

/* ---------- Navigation ---------- */
.k-tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.k-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch);
  padding: 0 var(--space-3);
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
}
.k-tab:hover {
  color: var(--ink);
}
.k-tab[aria-selected='true'] {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
}
.k-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 0;
  padding: 0;
  list-style: none;
}
.k-crumbs a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 2px;
}
.k-crumbs a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.k-crumbs [aria-current] {
  color: var(--ink);
  font-weight: 700;
}
.k-seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
}
.k-seg--block {
  display: flex;
}
.k-seg--block .k-seg__opt {
  flex: 1;
}
.k-seg__opt {
  min-height: calc(var(--touch) - 8px);
  padding: 0 var(--space-4);
  border: 0;
  background: none;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.k-seg__opt[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.k-pager {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ---------- Actions ---------- */
.k-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch);
  padding: 0 var(--space-5);
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--motion),
    border-color var(--motion);
  max-width: 100%;
  text-align: center;
  line-height: 1.25;
  padding-block: var(--space-2);
}
.k-btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}
.k-btn--primary:hover {
  background: var(--accent-strong);
}
.k-btn--secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.k-btn--secondary:hover {
  border-color: var(--accent);
}
.k-btn--quiet {
  background: none;
  color: var(--accent);
  padding: 0 var(--space-3);
}
.k-btn--quiet:hover {
  background: var(--accent-soft);
}
.k-btn--danger {
  background: var(--danger);
  color: var(--surface);
}
.k-btn--sm {
  min-height: 36px;
  padding: 0 var(--space-4);
  font-size: var(--text-sm);
}
.k-btn--lg {
  min-height: calc(var(--touch) + 8px);
  padding: 0 var(--space-6);
  font-size: var(--text-lg);
}
.k-btn--block {
  display: flex;
  width: 100%;
}
.k-btn[disabled],
.k-btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
}
.k-iconbtn {
  display: inline-grid;
  place-items: center;
  width: var(--touch);
  height: var(--touch);
  border-radius: var(--radius-pill);
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  position: relative;
}
.k-iconbtn:hover {
  background: var(--surface-2);
}
.k-iconbtn--filled {
  background: var(--accent);
  color: var(--on-accent);
}
.k-iconbtn--filled:hover {
  background: var(--accent-strong);
}
.k-menu {
  position: relative;
  display: inline-block;
}
.k-menu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  padding: var(--space-1);
  display: flex;
  flex-direction: column;
}
.k-menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch);
  padding: 0 var(--space-3);
  border: 0;
  background: none;
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.k-menu__item:hover {
  background: var(--surface-2);
}
.k-menu__item--danger {
  color: var(--danger);
}
.k-menu__avatar {
  display: inline-grid;
  place-items: center;
  min-width: var(--touch);
  min-height: var(--touch);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.k-menu__avatar:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.k-menu__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
}
.k-place {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch);
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.k-place:hover {
  background: var(--surface-2);
}
.k-place:focus-visible,
.k-switcher__now:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.k-place__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.k-place__mark--plain {
  background: none;
  color: var(--muted);
}
.k-place__label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.k-place--large {
  min-height: 64px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-weight: 700;
}
.k-chooser {
  flex: 1 0 auto;
  display: grid;
  place-items: center;
  padding: var(--space-6) var(--space-4);
}
.k-chooser__inner {
  width: min(32rem, 100%);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.k-chooser__rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.k-switcher {
  position: static;
  display: flex;
  min-width: 0;
}
.k-switcher__now {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  min-height: var(--touch);
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.k-switcher__now:hover {
  background: var(--surface-2);
}
.k-switcher__word {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.k-switcher__list {
  position: absolute;
  right: var(--space-4);
  top: calc(100% + 4px);
  z-index: 20;
  width: min(22rem, calc(100cqw - 2 * var(--space-4)));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  padding: var(--space-1);
  display: flex;
  flex-direction: column;
}
.k-switcher--list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.k-switcher__rows {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-1);
}
.k-menu__divider {
  height: 1px;
  background: var(--line);
  margin: var(--space-1) 0;
}
.k-settings {
  display: flex;
  flex-direction: column;
}
.k-settings > * + * {
  box-shadow: inset 0 1px 0 var(--line);
}
.k-settings > .k-switch {
  padding: var(--space-3) 0;
}
.k-setting {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) 0;
}
@container app (min-width: 720px) {
  .k-setting {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
  }
  .k-setting__control {
    flex: none;
    min-width: 220px;
    display: flex;
    justify-content: flex-end;
  }
  .k-setting__control > .k-field {
    width: 100%;
  }
}

/* ---------- Inputs ---------- */
.k-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.k-field__label {
  font-weight: 700;
  font-size: var(--text-sm);
}
.k-field__hint {
  font-size: var(--text-sm);
  color: var(--muted);
}
.k-field__error {
  font-size: var(--text-sm);
  color: var(--danger);
  font-weight: 700;
}
.k-input {
  width: 100%;
  min-height: var(--touch);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.k-input::placeholder {
  color: var(--subtle);
}
.k-input:hover {
  border-color: var(--muted);
}
.k-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
.k-field--invalid .k-input {
  border-color: var(--danger);
}
textarea.k-input {
  min-height: 112px;
  resize: none;
  field-sizing: content;
}
.k-search {
  position: relative;
}
.k-search .k-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.k-search .k-input {
  padding-left: 42px;
  border-radius: var(--radius-pill);
}
.k-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: var(--touch);
  padding: 8px 0;
  cursor: pointer;
}
.k-check input {
  appearance: none;
  flex: none;
  width: 24px;
  height: 24px;
  margin: 1px 0 0;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  border-radius: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.k-check input[type='radio'] {
  border-radius: 50%;
}
.k-check input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.k-check input[type='checkbox']:checked::after {
  content: '';
  width: 12px;
  height: 7px;
  border-left: 2.5px solid var(--on-accent);
  border-bottom: 2.5px solid var(--on-accent);
  transform: translateY(-2px) rotate(-45deg);
}
.k-check input[type='radio']:checked::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--on-accent);
}
.k-check__text {
  display: flex;
  flex-direction: column;
}
.k-check__hint {
  font-size: var(--text-sm);
  color: var(--muted);
}
.k-choicegroup {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.k-choicegroup legend {
  font-weight: 700;
  font-size: var(--text-sm);
  padding: 0;
  margin-bottom: 4px;
}
.k-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--touch);
  width: 100%;
  border: 0;
  background: none;
  padding: 8px 0;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.k-switch__track {
  flex: none;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: var(--line-strong);
  position: relative;
  transition: background var(--motion);
}
.k-switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform var(--motion);
}
.k-switch[aria-checked='true'] .k-switch__track {
  background: var(--accent);
}
.k-switch[aria-checked='true'] .k-switch__track::after {
  transform: translateX(20px);
}
.k-switch[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.k-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: var(--touch);
  background: transparent;
  cursor: pointer;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}
.k-range:focus {
  box-shadow: none;
}
.k-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) var(--fill, 0%), var(--line-strong) var(--fill, 0%));
}
.k-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
}
.k-range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--line-strong);
}
.k-range::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--accent);
}
.k-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
}
.k-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent);
}
.k-range:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent);
}
.k-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.k-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
}
.k-chip:hover {
  border-color: var(--accent);
}
.k-chip[aria-pressed='true'] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}
.k-chip[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Feedback ---------- */
.k-banner {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}
.k-banner__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.k-banner--info {
  background: var(--info-soft);
  color: var(--info);
}
.k-banner--success {
  background: var(--success-soft);
  color: var(--success);
}
.k-banner--warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.k-banner--danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.k-banner--neutral {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line);
}
.k-banner__body > :not(strong) {
  color: var(--ink);
}
.k-toast {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-2);
  max-width: 100%;
}
.k-toast .k-btn--quiet {
  color: var(--map-low);
}
.k-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: var(--scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.k-overlay--fixed {
  position: fixed;
}
.k-dialog {
  width: 100%;
  max-width: 30rem;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.k-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}
.k-overlay--sheet {
  align-items: flex-end;
  padding: 0;
}
.k-sheet {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-2);
  padding: var(--space-3) var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-height: 85%;
  overflow: auto;
}
.k-sheet__grip {
  align-self: center;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
}
@container app (min-width: 720px) {
  .k-overlay--sheet {
    align-items: center;
    padding: var(--space-4);
  }
  .k-sheet {
    max-width: 34rem;
    border-radius: var(--radius-lg);
  }
  .k-sheet__grip {
    display: none;
  }
}
.k-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-4);
}
.k-empty .k-art {
  max-width: 220px;
}
.k-skeleton {
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: k-shimmer 1.4s infinite linear;
  border-radius: var(--radius-sm);
  height: 14px;
}
@keyframes k-shimmer {
  to {
    background-position: -200% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .k-skeleton {
    animation: none;
  }
  .k-app * {
    transition: none !important;
  }
}
.k-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.k-progress__bar {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}
.k-progress__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}
.k-spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  animation: k-spin 0.8s linear infinite;
}
@keyframes k-spin {
  to {
    transform: rotate(360deg);
  }
}
.k-tip {
  position: relative;
  display: inline-flex;
}
.k-tip__bubble {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  font-size: var(--text-xs);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--motion);
  z-index: 10;
}
.k-tip:hover .k-tip__bubble,
.k-tip:focus-within .k-tip__bubble {
  opacity: 1;
}

/* ---------- Showing data ---------- */
.k-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  color: inherit;
  text-decoration: none;
  position: relative;
}
@container app (min-width: 720px) {
  .k-card {
    padding: var(--space-5);
  }
}
.k-card--flat {
  background: var(--surface-2);
  border-color: transparent;
}
.k-card--accent {
  background: var(--accent-soft);
  border-color: transparent;
}
.k-card--raised {
  box-shadow: var(--shadow);
  border-color: transparent;
}
.k-card--link {
  cursor: pointer;
  transition:
    border-color var(--motion),
    box-shadow var(--motion);
}
.k-card--link:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.k-card__head {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.k-card__words {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.k-card__eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.k-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}
.k-card__meta {
  font-size: var(--text-sm);
  color: var(--muted);
}
.k-card--edge {
  border-left: 6px solid var(--edge, var(--accent));
}
.k-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.k-listrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 60px;
  padding: var(--space-3) var(--space-4);
  color: inherit;
  text-decoration: none;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  font: inherit;
  text-align: left;
  width: 100%;
}
.k-list > .k-listrow:first-child {
  border-top: 0;
}
.k-listrow__badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.k-listrow__words .k-listrow__badges {
  margin-top: var(--space-1);
}
a.k-listrow,
button.k-listrow {
  cursor: pointer;
}
a.k-listrow:hover,
button.k-listrow:hover {
  background: var(--surface-2);
}
.k-listrow[aria-current='true'] {
  background: var(--accent-soft);
}
.k-listrow__words {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.k-listrow__title {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.k-listrow__meta {
  font-size: var(--text-sm);
  color: var(--muted);
  overflow-wrap: anywhere;
}
.k-listrow__end {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--muted);
}
.k-kv {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-1) var(--space-4);
  margin: 0;
}
.k-kv__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--line);
}
.k-kv__row:first-child {
  border-top: 0;
}
.k-kv dt {
  font-size: var(--text-sm);
  color: var(--muted);
}
.k-kv dd {
  margin: 0;
}
@container app (min-width: 720px) {
  .k-kv__row {
    grid-template-columns: minmax(9rem, 1fr) minmax(0, 2fr);
    gap: var(--space-4);
  }
}
.k-tablewrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  background: var(--surface);
}
.k-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.k-table th,
.k-table td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.k-table th {
  font-weight: 700;
  color: var(--muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-2);
}
.k-table tr:last-child td {
  border-bottom: 0;
}
.k-table--stack thead {
  display: none;
}
.k-table--stack tr {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.k-table--stack td {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: var(--space-3);
  padding: 4px 0;
  border: 0;
}
.k-table--stack td::before {
  content: attr(data-label);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
@container app (min-width: 720px) {
  .k-table--stack thead {
    display: table-header-group;
  }
  .k-table--stack tr {
    display: table-row;
    padding: 0;
    border: 0;
  }
  .k-table--stack td {
    display: table-cell;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--line);
  }
  .k-table--stack td::before {
    content: none;
  }
}
.k-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--ink);
  line-height: 1.6;
  width: fit-content;
  max-width: 100%;
}
.k-badge--accent {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.k-badge--success {
  background: var(--success-soft);
  color: var(--success);
}
.k-badge--warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.k-badge--danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.k-badge--info {
  background: var(--info-soft);
  color: var(--info);
}
.k-badge--next {
  background: color-mix(in srgb, var(--tone-next) 28%, var(--surface));
  color: var(--ink);
}
.k-badge--count {
  background: var(--danger);
  color: var(--surface);
  min-width: 20px;
  justify-content: center;
  padding: 0 6px;
}
.k-avatar__img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.k-avatar__edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
}
.k-avatar__edit:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.k-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--tint, var(--accent-soft));
  color: var(--ink);
  font-weight: 700;
  font-family: var(--font-display);
}
.k-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}
.k-stat__value {
  font-family: var(--font-display);
  font-size: var(--title);
  font-weight: 700;
  line-height: 1.1;
}
.k-stat__label {
  font-size: var(--text-sm);
  color: var(--muted);
}
.k-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.k-stats > .k-stat {
  flex: 1 1 9rem;
}
.k-stat__value {
  overflow-wrap: break-word;
}
@container app (min-width: 720px) {
  .k-stat {
    padding: var(--space-4);
  }
}
.k-stat__delta {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--success);
}
.k-stat__delta--down {
  color: var(--danger);
}
.k-accordion {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.k-accordion details {
  border-top: 1px solid var(--line);
}
.k-accordion details:first-child {
  border-top: 0;
}
.k-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--touch);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.k-accordion summary::-webkit-details-marker {
  display: none;
}
.k-accordion summary .k-icon {
  transition: transform var(--motion);
  color: var(--muted);
}
.k-accordion details[open] summary .k-icon {
  transform: rotate(90deg);
}
.k-accordion__body {
  padding: 0 var(--space-4) var(--space-4);
}
.k-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
  width: 100%;
}

/* ---------- kartora's own ---------- */
.k-mastery {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.k-mastery__swatch {
  flex: none;
  width: var(--d, 28px);
  height: var(--d, 28px);
  border-radius: 8px;
  background: color-mix(in srgb, var(--map-high) var(--v, 0%), var(--map-low));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent);
}
.k-mastery__swatch--none {
  background: repeating-linear-gradient(45deg, var(--surface-2) 0 4px, var(--surface-3) 4px 8px);
}
.k-mastery__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.k-scale {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  color: var(--muted);
}
.k-scale__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.k-scale__swatch {
  width: 18px;
  height: 12px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--map-high) var(--v, 0%), var(--map-low));
}
.k-scale__swatch--none {
  background: transparent;
  border: 1px dashed var(--line-strong);
}
.k-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 112px;
  min-height: 64px;
  padding: var(--space-2) var(--space-3);
  border-radius: 14px;
  background: color-mix(in srgb, var(--map-high) var(--v, 0%), var(--map-low));
  color: var(--ink);
  border: 2px solid transparent;
  text-align: center;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
}
.k-atlas {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.k-atlas__regions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 45%), 240px));
  justify-content: center;
  gap: var(--space-2);
}
.k-atlas__region {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: var(--space-1);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
}
.k-atlas__region:hover {
  border-color: var(--line-strong);
}
.k-atlas__region--closed {
  font-weight: 400;
  color: var(--muted);
}
.k-atlas__region--selected {
  border-color: var(--ink);
}
.k-atlas__region svg {
  display: block;
  width: 100%;
  height: auto;
}
.k-atlas__unmet {
  fill: var(--surface-3);
}
.k-atlas__off {
  fill: var(--surface-2);
}
.k-atlas__touched {
  fill: var(--tone-next);
  stroke: var(--ink);
  stroke-width: 1.4;
}
.k-atlas__new {
  fill: var(--tone-next);
  stroke: var(--ink);
  stroke-width: 1.4;
  animation: k-atlas-lit 1.6s ease-in-out infinite alternate;
}
@keyframes k-atlas-lit {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .k-atlas__new {
    animation: none;
  }
}
.k-atlas__ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-dasharray: 6 5;
}
.k-atlas__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--muted);
}
.k-atlas__legend i {
  width: 18px;
  height: 12px;
  border-radius: 3px;
}
.k-atlas__legend b {
  font-weight: 400;
  margin-left: var(--space-3);
  padding-left: 32px;
  position: relative;
}
.k-atlas__legend b::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 26px;
  border-top: 2px dashed var(--ink);
}
.k-atlas--compact {
  padding: 0;
  border: 0;
  background: none;
}
.k-atlas--compact .k-atlas__regions {
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  justify-content: stretch;
  gap: 2px;
}
.k-atlas--compact .k-atlas__region {
  padding: 0;
  cursor: inherit;
}
.k-reach {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.k-reach__who {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-sm);
}
.k-reach__who span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.k-reach__who i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.k-reach__scroll {
  overflow-x: auto;
}
.k-reach__row {
  display: grid;
  grid-template-columns: 120px minmax(320px, 1fr);
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  font-size: var(--text-sm);
}
.k-reach__row > div {
  position: relative;
  height: 24px;
  margin: 0 12px;
}
.k-reach__axis {
  color: var(--muted);
  font-size: var(--text-xs);
}
.k-reach__axis em {
  position: absolute;
  transform: translateX(-50%);
  font-style: normal;
}
.k-reach__track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--line);
}
.k-reach__track b {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  opacity: 0.55;
}
.k-reach__track i {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  transform: translate(-50%, -50%);
}
.k-kmap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-3);
}
.k-kmap__ground {
  position: relative;
  margin: 0 auto;
}
.k-kmap__lines {
  position: absolute;
  inset: 0;
}
.k-kmap__line {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 2;
}
.k-kmap__line--lit {
  stroke: var(--ink);
  stroke-width: 3;
}
.k-kmap__line--shares {
  stroke: var(--tone-next);
  stroke-width: 3;
}
.k-kmap__node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 4px 8px;
  box-sizing: border-box;
  border-radius: 14px;
  border: 2px solid var(--map-high);
  background: color-mix(in srgb, var(--map-high) var(--v, 0%), var(--map-low));
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
}
.k-kmap__node--pill {
  border-radius: var(--radius-pill);
}
.k-kmap__node--high {
  color: var(--on-accent);
}
.k-kmap__node--plain {
  background: var(--surface-2);
  border-color: var(--line-strong);
}
.k-kmap__node--none {
  background: var(--map-low);
}
.k-kmap__node--closed {
  background: var(--surface-2);
  color: var(--muted);
  border: 2px dashed var(--line-strong);
}
.k-kmap__node--fading {
  border: 3px dashed var(--tone-revisit);
}
.k-kmap__node--next {
  border: 4px solid var(--tone-next);
}
.k-kmap__node--selected {
  box-shadow: 0 0 0 3px var(--ink);
}
.k-kmap__name {
  font-size: var(--text-sm);
}
.k-kmap__value {
  font-size: var(--text-sm);
  font-weight: 400;
}
.k-strip {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
}
.k-strip__scene {
  flex: 0 0 150px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 96px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
  background: color-mix(in srgb, var(--tile) 26%, var(--surface));
}
.k-strip__scene--story {
  --tile: var(--tone-lens);
}
.k-strip__scene--probe {
  --tile: var(--tone-next);
}
.k-strip__scene--detour {
  --tile: var(--tone-revisit);
}
.k-strip__scene--recall {
  --tile: var(--tone-shelf);
}
.k-strip__scene--current {
  border-color: var(--ink);
}
.k-strip__eyebrow,
.k-strip__meta {
  font-size: var(--text-xs);
  color: var(--ink);
}
.k-ba {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
}
.k-ba__side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-3);
  border-radius: var(--radius-md);
}
.k-ba__side p {
  margin: 0;
}
.k-ba__side--before {
  background: color-mix(in srgb, var(--tone-revisit) 22%, var(--surface));
}
.k-ba__side--after {
  background: var(--accent-soft);
}
.k-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.k-checks li {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}
.k-checks__ok svg {
  color: var(--accent);
  flex: none;
}
.k-checks__look svg {
  color: var(--tone-revisit);
  flex: none;
}
.k-card--strong {
  background: var(--map-high);
  border-color: transparent;
  color: var(--on-accent);
}
.k-card--strong .k-card__title,
.k-card--strong .k-card__meta,
.k-card--strong .k-card__eyebrow {
  color: inherit;
}
.k-card--warm {
  background: color-mix(in srgb, var(--tone-next) 22%, var(--surface));
  border-color: var(--tone-next);
}
.k-heat {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.k-heat__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.k-heat__name {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--muted);
}
.k-heat__tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 4px;
}
.k-heat__tile {
  aspect-ratio: 1;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
  border: 2px solid transparent;
  background: color-mix(in srgb, var(--map-high) var(--v, 0%), var(--map-low));
  color: var(--ink);
  font: inherit;
  font-size: var(--text-xs, 0.8rem);
  font-weight: 700;
  cursor: pointer;
}
.k-heat__tile--high {
  color: var(--on-accent);
}
.k-heat__tile--none {
  background: transparent;
  border: 2px dashed var(--line-strong);
}
.k-heat__tile--fading {
  border: 2px dashed var(--tone-revisit);
}
.k-heat__tile--next {
  border-color: var(--tone-next);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tone-next) 40%, transparent);
}
.k-heat__tile--selected {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
}
.k-node--high {
  color: var(--on-accent);
}
.k-node--next {
  border-color: var(--tone-next);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone-next) 35%, transparent);
}
.k-node--revisit {
  border-style: dashed;
  border-color: var(--tone-revisit);
}
.k-node--closed {
  background: var(--surface-2);
  color: var(--subtle);
  border: 2px dashed var(--line-strong);
}
.k-node__value {
  font-weight: 400;
  font-size: var(--text-xs);
  opacity: 0.9;
}
.k-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.k-step__prompt {
  font-family: var(--font-display);
  font-size: var(--title);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}
.k-step__options {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: minmax(0, 1fr);
}
@container app (min-width: 720px) {
  .k-step__options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.k-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 64px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 2px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-lg);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.k-option:hover {
  border-color: var(--accent);
}
.k-option--picked {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.k-option--right {
  border-color: var(--success);
  background: var(--success-soft);
}
.k-option--wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.k-option__mark {
  margin-left: auto;
}
.k-line {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--line-strong);
  background: var(--surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.k-line--covered {
  border-left-color: var(--success);
}
.k-line--part {
  border-left-color: var(--tone-warn);
}
.k-line--gap {
  border-left-color: var(--danger);
}
.k-line--out {
  border-left-color: var(--tone-quiet);
}
.k-line__text {
  font-weight: 700;
}
.k-line__to {
  font-size: var(--text-sm);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- Icons and pictures ---------- */
.k-icon {
  flex: none;
  display: inline-block;
  vertical-align: middle;
}
.k-spot {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.k-spot--sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.k-spot--lg {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}
.k-spot--next {
  background: color-mix(in srgb, var(--tone-next) 25%, var(--surface));
  color: var(--ink);
}
.k-spot--info {
  background: var(--info-soft);
  color: var(--info);
}
.k-spot--success {
  background: var(--success-soft);
  color: var(--success);
}
.k-spot--warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.k-spot--quiet {
  background: var(--surface-2);
  color: var(--muted);
}
.k-art {
  display: block;
  width: 100%;
  height: auto;
}
.k-hero {
  display: grid;
  gap: var(--space-5);
  align-items: center;
  grid-template-columns: minmax(0, 1fr);
}
.k-hero > .k-art {
  max-width: 320px;
  order: -1;
}
@container app (min-width: 720px) {
  .k-hero {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
  .k-hero > .k-art {
    order: 0;
    max-width: none;
  }
}

/* Nothing native shows: the listbox, scrollbars, spinners, autofill, selection and taps are the design system's own. */
.k-select {
  position: relative;
}
.k-select__button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.k-select__button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.k-select__value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.k-select__button .k-icon {
  flex: none;
  color: var(--muted);
  transform: rotate(90deg);
  transition: transform var(--motion);
}
.k-select__button[aria-expanded='true'] {
  border-color: var(--accent);
}
.k-select__button[aria-expanded='true'] .k-icon {
  transform: rotate(-90deg);
}
.k-select__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  max-height: min(320px, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.k-select__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--touch);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--ink);
  cursor: pointer;
}
.k-select__option--active {
  background: var(--surface-2);
}
.k-select__option[aria-selected='true'] {
  color: var(--accent-strong);
  font-weight: 700;
}
html,
html * {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 2px solid transparent;
  border-radius: 8px;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--muted);
}
:where(.k-app) {
  -webkit-tap-highlight-color: transparent;
  caret-color: var(--accent);
}
:where(.k-app) ::selection {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
}
.k-input[type='number'] {
  -moz-appearance: textfield;
}
.k-input::-webkit-outer-spin-button,
.k-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.k-input[type='search']::-webkit-search-cancel-button,
.k-input[type='search']::-webkit-search-decoration {
  -webkit-appearance: none;
}
.k-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 100px var(--surface) inset;
  -webkit-text-fill-color: var(--ink);
}

/* Bars: a fraction drawn to scale */
.k-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.k-bars__row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.k-bars__label {
  font-weight: 700;
}
.k-bars__bar {
  display: flex;
  gap: 2px;
  height: 36px;
}
.k-bars__part {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 4px;
  background: var(--surface-3);
}
.k-bars__part--on {
  background: var(--accent);
}
.k-switcher__now > svg {
  flex: none;
  transform: rotate(90deg);
}

/* The student: roads, the tree, the Player. */
.k-roads-wrap {
  position: relative;
  display: flex;
  background: var(--grass);
}
.k-roads-names {
  position: relative;
  flex: none;
  width: 122px;
  border-right: 1px solid var(--line);
}
.k-roads-names div {
  position: absolute;
  left: var(--space-3);
  right: var(--space-2);
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.k-roads-names b {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  overflow: hidden;
  text-overflow: ellipsis;
}
.k-roads-names small {
  font-size: var(--text-xs);
  color: var(--muted);
}
.k-roads-wrap .k-road-strip {
  flex: 1;
  min-width: 0;
}
.k-press {
  cursor: pointer;
  outline: none;
}
.k-press:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}
.k-svgdisp {
  font-family: var(--font-display);
  font-weight: 700;
}
.k-svghalo {
  paint-order: stroke;
  stroke-width: 4;
  stroke-linejoin: round;
}
.k-key {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--muted);
}
.k-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.k-road-strip {
  overflow-x: auto;
  scrollbar-width: none;
  display: flex;
  border-radius: var(--radius-lg);
}
.k-road-strip::-webkit-scrollbar {
  display: none;
}
.k-app .k-roads {
  flex: none;
  display: block;
  max-width: none;
}
.k-sticker {
  flex: none;
  display: block;
}
.k-trees {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: var(--space-4) var(--space-2);
  padding-top: var(--space-4);
}
.k-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
}
.k-tree--half {
  width: calc(50% - 8px);
}
.k-tree--small {
  width: 190px;
}
.k-app .k-tree__svg {
  flex: none;
  max-width: none;
  display: block;
}
.k-tree__zoom {
  display: block;
  margin: 0 auto;
}
.k-tree__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}
.k-tree__chips button {
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--ink);
  font: 700 var(--text-sm) var(--font-body);
  cursor: pointer;
}
.k-today {
  background: var(--accent-soft);
  border-radius: 28px;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.k-today__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
}
.k-today__main small {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--accent-strong);
}
.k-today__main strong {
  font-family: var(--font-display);
  font-size: var(--display-wide);
  line-height: 1;
  letter-spacing: -0.02em;
}
.k-today__main p {
  margin: 0;
}
.k-today__later {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.k-stoprow {
  border: 0;
  background: none;
  padding: 2px 0;
  color: var(--ink);
  font: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  min-height: 48px;
}
.k-stoprow b {
  display: block;
  font-family: var(--font-display);
  line-height: 1.15;
}
.k-stoprow small {
  display: block;
  font-size: var(--text-sm);
  color: var(--muted);
}
@container app (min-width: 720px) {
  .k-today {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-6);
  }
}

.k-player {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.k-player__top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  min-height: 60px;
}
.k-player__pace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.k-player__pace small {
  font-size: var(--text-xs);
  color: var(--muted);
}
.k-player__track {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.k-player__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--map-high);
  transition: width var(--motion);
}
.k-player__track--none {
  background: none;
}
.k-player__band {
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--text-sm);
  text-align: center;
  padding: var(--space-1) var(--space-4);
}
.k-player__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.k-player__body::-webkit-scrollbar {
  display: none;
}
.k-player__foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: var(--space-3) var(--space-4);
}
.k-player__footin {
  max-width: 40rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.k-pscene {
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.k-pscene__art {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.k-drawing {
  display: block;
  width: 100%;
  height: auto;
}
.k-pscene__words {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}
.k-pscene__prompt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--title);
  line-height: 1.15;
  margin: 0;
}
.k-up {
  animation: k-up var(--motion) ease-out;
}
@keyframes k-up {
  from {
    opacity: 0.4;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .k-up {
    animation: none;
  }
}
@container app (min-width: 900px) {
  .k-pscene {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-6);
    padding-top: var(--space-5);
  }
  .k-pscene__art {
    flex: 1 1 52%;
    position: sticky;
    top: 0;
  }
  .k-pscene__words {
    flex: 1 1 48%;
  }
}
.k-dialogue {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.k-dialogue__story {
  margin: 0;
  font-size: var(--text-lg);
}
.k-bubble {
  display: flex;
  gap: var(--space-2);
  align-items: flex-end;
}
.k-bubble--me {
  flex-direction: row-reverse;
}
.k-bubble .k-avatar {
  flex: none;
}
.k-bubble__words {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 16px 16px 16px 4px;
  padding: var(--space-2) var(--space-3);
  min-width: 0;
  font-size: var(--text-lg);
}
.k-bubble__words strong {
  font-size: var(--text-xs);
  color: var(--muted);
}
.k-bubble--me .k-bubble__words {
  background: var(--accent-soft);
  border-radius: 16px 16px 4px 16px;
}
.k-bubble__words--act span {
  font-style: italic;
  color: var(--muted);
}
.k-order {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.k-order__slot {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: none;
  color: var(--ink);
  font: inherit;
  padding: 0 var(--space-3);
  text-align: left;
  cursor: pointer;
}
.k-order__slot:disabled {
  cursor: default;
}
.k-order__slot b {
  font-family: var(--font-display);
  color: var(--muted);
}
.k-order__slot--on {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}
.k-order__slot--right {
  border-color: var(--success);
  background: var(--success-soft);
}
.k-order__slot--wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.k-order__pool {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.k-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 48px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font: 700 var(--text-md) var(--font-body);
  cursor: pointer;
}
.k-chip--on {
  outline: 3px solid var(--focus);
}
.k-chip--ghost {
  position: fixed;
  z-index: 60;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.k-place-kind {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.k-place-kind__slots {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.k-place-kind__slot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 64px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: none;
  color: var(--ink);
  font: inherit;
  padding: var(--space-2) var(--space-3);
  text-align: left;
  cursor: pointer;
}
.k-place-kind__slot small {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
}
.k-place-kind__slot--on {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}
.k-place-kind__slot--ready {
  border-color: var(--focus);
}
.k-place-kind__slot--right {
  border-color: var(--success);
  background: var(--success-soft);
}
.k-place-kind__slot--wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.k-feedback {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.k-feedback--right {
  color: var(--success);
}
.k-feedback--wrong {
  color: var(--warning);
}
.k-feedback__words {
  flex: 1;
  color: var(--ink);
  font-size: var(--text-lg);
}
.k-feedback__words p {
  margin: 0;
}
.k-feedback .k-drawing {
  border-radius: var(--radius-md);
  margin-top: var(--space-2);
  max-width: 22rem;
}
.k-sound {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-4);
  align-self: flex-start;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font: 700 var(--text-md) var(--font-body);
  cursor: pointer;
}
.k-waiting {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--warning-soft);
  color: var(--ink);
}
.k-waiting p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}
.k-waiting > div {
  flex: 1;
}
.k-waiting__dots {
  display: flex;
  gap: 4px;
}
.k-waiting__dots i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--tone-warn);
}
.k-tags {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.k-tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.k-tags__add {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}
.k-tags__add .k-field {
  flex: 1;
  min-width: 0;
}
.k-request {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.k-request p {
  margin: 0;
}
.k-request__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.k-request__files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.k-request__files li {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  font-size: var(--text-sm);
}
.k-request__file {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}
.k-request__filedesc {
  grid-column: 1 / -1;
}
.k-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.k-scroll::-webkit-scrollbar {
  display: none;
}
.k-student {
  max-width: 1160px;
  margin: 0 auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.k-student--read {
  max-width: 44rem;
}
.k-student__sec {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.k-student__sec .k-roads-wrap {
  margin: 0 calc(-1 * var(--space-4));
}
.k-student__sec .k-road-strip {
  border-radius: 0;
}
.k-hello {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.k-hello h1 {
  margin: 0;
  font-size: var(--display);
}
.k-student__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.k-student__links button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink);
  font: 700 var(--text-sm) var(--font-body);
  cursor: pointer;
}
.k-colours {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.k-colour {
  position: relative;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 3px solid transparent;
  border-radius: var(--radius-md);
  background: none;
  cursor: pointer;
}
.k-colour span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.k-colour--on {
  border-color: var(--ink);
}
.k-colour b {
  position: absolute;
  right: -6px;
  top: -6px;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--bg);
  font-size: var(--text-xs);
  line-height: 20px;
  text-align: center;
}
.k-pick {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.k-pick__card {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-height: 88px;
  padding: var(--space-3);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.k-pick__card b {
  font-family: var(--font-display);
}
.k-pick__card span {
  font-size: var(--text-sm);
  color: var(--muted);
}
.k-pick__card--on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.k-worldcard {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.k-worldcard figcaption {
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--heading);
  line-height: 1.25;
}
.k-student > div:first-child > .k-btn--quiet {
  margin-left: calc(-1 * var(--space-3));
}
.k-today__quiet {
  font-size: var(--text-sm);
  color: var(--muted);
}
.k-countdown {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.k-countdown__track {
  flex: 1;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.k-countdown__track span {
  display: block;
  height: 100%;
  background: var(--tone-warn);
  transition: width var(--motion);
}
.k-countdown b {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  min-width: 2ch;
  text-align: right;
}
.k-week {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: var(--space-2);
}
.k-week__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.k-week__day b {
  font-size: var(--text-sm);
}
.k-week__day strong {
  font-family: var(--font-display);
  font-size: var(--title);
  line-height: 1.1;
}
.k-week__day small {
  font-size: var(--text-xs);
  color: var(--muted);
}
.k-week__day--rest {
  background: var(--accent-soft);
}
.k-week__btns {
  display: flex;
}
.k-override {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.k-override span {
  display: flex;
  flex-direction: column;
}
.k-override small {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Written maths and the typed fraction */
.k-math {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.22em;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.k-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.12;
  font-size: 0.86em;
}
.k-frac > span:first-child {
  border-bottom: 2px solid currentColor;
  padding: 0 0.18em 0.06em;
}
.k-frac > span:last-child {
  padding-top: 0.06em;
}
.k-math__mixed {
  display: inline-flex;
  align-items: center;
  gap: 0.12em;
}
.k-math__paren {
  font-size: 1.7em;
  font-weight: 400;
  line-height: 1;
}
.k-math__gap {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  border-radius: 4px;
  background: var(--line-strong);
}
.k-fracin {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.k-fracin__box {
  width: 84px;
  text-align: center;
  font-size: var(--title);
  font-weight: 700;
  padding: 6px;
}
.k-fracin__stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.k-fracin__bar {
  height: 3px;
  border-radius: 2px;
  background: var(--ink);
}
.k-fracin--right .k-fracin__box {
  border-color: var(--success);
}
.k-fracin--wrong .k-fracin__box {
  border-color: var(--warning);
}

/* Arrange: beams cut finer */
.k-cut {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.k-cut__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.k-cut__label {
  font-weight: 700;
}
.k-cut__beam {
  display: flex;
  height: 46px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--surface);
}
.k-cut__cell {
  flex: 1 1 0;
  border-right: 1px solid var(--line-strong);
  transition: background-color 0.15s;
}
.k-cut__cell:last-child {
  border-right: 0;
}
.k-cut__cell--old {
  border-right: 2px solid var(--ink);
}
.k-cut__cell--on.k-cut__tone0 {
  background: var(--tone-next);
}
.k-cut__cell--on.k-cut__tone1 {
  background: var(--tone-lens);
}
.k-cut__tools {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.k-cut__tools b {
  min-width: 2.2em;
  text-align: center;
  font-size: var(--title);
}
.k-cut--one .k-cut__beam {
  border-color: var(--success);
}
.k-cut__same {
  margin: 0;
  color: var(--success);
  font-weight: 700;
}

/* The session's pictures */
.k-pitch,
.k-track {
  display: block;
  width: 100%;
  height: auto;
  max-height: 46vh;
}
.k-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.k-stepper__label {
  font-weight: 700;
}
.k-machine {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.k-machine__box {
  min-width: 76px;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  font-size: var(--title);
  font-weight: 700;
  padding: var(--space-2);
}
.k-machine__op {
  min-height: 92px;
  min-width: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--tone-next);
  color: var(--on-tone);
  font-size: var(--title);
  font-weight: 700;
  padding: var(--space-3);
}
.k-machine--back .k-machine__op {
  background: var(--tone-lens);
}
.k-machine__arrow {
  font-size: var(--title);
  font-weight: 700;
}
.k-expr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--title);
  font-weight: 700;
}
.k-expr__part {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
}
.k-expr__part--on {
  background: var(--accent);
  color: var(--on-tone);
}
.k-idea {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.k-idea__art {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.k-idea__art > b {
  font-size: 40px;
  color: var(--muted);
}
.k-idea__words {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.k-idea--locked {
  border-style: dashed;
  border-color: var(--line-strong);
}

/* The living pitch */
.k-field__cut {
  transform-box: fill-box;
  transform-origin: top;
  animation: k-field-draw 0.45s ease-out;
}
@keyframes k-field-draw {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}
.k-field__pop {
  animation: k-field-pop 0.25s ease-out;
}
@keyframes k-field-pop {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.85;
  }
}
.k-field__glow {
  animation: k-field-glow 1.2s ease-in-out infinite;
}
@keyframes k-field-glow {
  50% {
    stroke-opacity: 0.35;
  }
}
.k-field__cutx {
  transform-box: fill-box;
  transform-origin: left;
  animation: k-field-drawx 0.45s ease-out;
}
@keyframes k-field-drawx {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
.k-calc {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  width: 100%;
  align-items: center;
}
.k-calc__line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.k-calc__who {
  font-weight: 700;
  color: var(--muted);
}
.k-calc__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.k-calc__tile {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 5vh, 46px);
  color: var(--ink);
  min-height: 48px;
  min-width: 48px;
  padding: 4px 12px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: var(--surface);
  cursor: pointer;
  animation: k-read-pop 0.3s ease-out;
}
.k-calc__tile--still {
  border-color: transparent;
  background: none;
  cursor: default;
  padding: 4px 2px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
}
.k-calc__tile--bad {
  border-color: var(--danger);
  animation: k-calc-no 0.35s;
}
@keyframes k-calc-no {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}
.k-calc__box {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border: 3px dashed var(--accent);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  animation: k-read-pop 0.3s ease-out;
}
button.k-calc__box {
  cursor: pointer;
}
.k-calc__result {
  font-family: var(--font-display);
  font-size: clamp(24px, 5vh, 46px);
  color: var(--success);
  animation: k-read-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.k-calc__result--wrong {
  color: var(--danger);
}
@media (prefers-reduced-motion: reduce) {
  .k-field__cutx,
  .k-calc__tile,
  .k-calc__box,
  .k-calc__result {
    animation: none;
  }
}
.k-read {
  display: flex;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 5vh, 46px);
}
.k-fields .k-pitch {
  max-height: 34vh;
}
.k-fields--two .k-pitch {
  max-height: 21vh;
}
.k-read--pop {
  animation: k-read-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes k-read-pop {
  from {
    transform: scale(0.7);
    opacity: 0.3;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .k-field__cut,
  .k-field__pop,
  .k-field__glow,
  .k-read--pop {
    animation: none;
  }
}

/* The duel */
.k-says {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.k-says__bubble {
  flex: 1;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
  font-weight: 700;
  line-height: 1.3;
}
.k-coach {
  flex: none;
}
.k-coach--pop {
  animation: k-coach-pop 0.4s cubic-bezier(0.3, 1.8, 0.5, 1);
}
@keyframes k-coach-pop {
  from {
    transform: scale(0.5) rotate(-12deg);
  }
  to {
    transform: none;
  }
}
.k-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--surface);
  font-weight: 700;
  white-space: nowrap;
}
.k-score__name {
  font-size: var(--text-sm);
  max-width: 7em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.k-score__n {
  font-size: 20px;
  animation: k-score-flip 0.5s;
}
@keyframes k-score-flip {
  from {
    transform: translateY(-14px) scale(1.5);
    color: var(--accent);
  }
  to {
    transform: none;
  }
}
.k-goal {
  display: block;
  width: 100%;
  max-height: 30vh;
  border-radius: var(--radius-md);
}
.k-goal__keeper,
.k-goal__ball {
  transition: transform 0.6s cubic-bezier(0.3, 1.2, 0.5, 1);
}
.k-goal--goal .k-goal__ball {
  transform: translate(70px, -82px);
}
.k-goal--goal .k-goal__keeper {
  transform: translateX(-60px) rotate(-14deg);
  transform-origin: 150px 90px;
}
.k-goal--saved .k-goal__ball {
  transform: translate(40px, -60px);
}
.k-goal--saved .k-goal__keeper {
  transform: translateX(40px);
}
.k-goal--rebound .k-goal__ball {
  transform: translate(-30px, -20px);
}
.k-goal--rebound .k-goal__keeper {
  transform: translateX(40px);
}
.k-burst {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 50;
  animation: k-burst-bg 1.5s ease-out forwards;
}
@keyframes k-burst-bg {
  0% {
    background: transparent;
  }
  15% {
    background: color-mix(in srgb, var(--paint-grass) 70%, transparent);
  }
  100% {
    background: transparent;
  }
}
.k-burst b {
  font-family: var(--font-display);
  font-size: clamp(56px, 16vw, 130px);
  color: white;
  -webkit-text-stroke: 3px var(--paint-dark);
  animation: k-burst-word 1.5s cubic-bezier(0.3, 1.6, 0.5, 1) forwards;
}
@keyframes k-burst-word {
  0% {
    transform: scale(0.2) rotate(-8deg);
    opacity: 0;
  }
  25% {
    transform: scale(1.1);
    opacity: 1;
  }
  75% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}
.k-burst__ball {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: white;
  border: 4px solid var(--paint-dark);
  animation: k-burst-ball 1s ease-out forwards;
}
@keyframes k-burst-ball {
  from {
    transform: translate(-46vw, 40vh) rotate(0);
  }
  to {
    transform: translate(0, 0) rotate(900deg);
  }
}
.k-pitch--match {
  animation: k-match 1s ease-out 2;
  border-radius: 6px;
}
@keyframes k-match {
  50% {
    filter: drop-shadow(0 0 14px var(--success)) brightness(1.15);
  }
}
@media (prefers-reduced-motion: reduce) {
  .k-coach--pop,
  .k-score__n,
  .k-burst__ball,
  .k-pitch--match {
    animation: none;
  }
  .k-burst b {
    animation-duration: 1.5s;
  }
}

/* A scene on the whole screen */
.k-stage {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4) var(--space-5);
  min-height: 100%;
  box-sizing: border-box;
}
.k-stage__pic,
.k-stage__panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}
.k-stage__pic {
  justify-content: center;
}
@container app (min-width: 900px) {
  .k-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: 'pic top' 'pic panel';
    column-gap: var(--space-6);
    row-gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    align-content: stretch;
  }
  .k-stage__top {
    grid-area: top;
    align-self: end;
  }
  .k-stage__pic {
    grid-area: pic;
  }
  .k-stage__panel {
    grid-area: panel;
  }
  .k-stage--alone {
    display: flex;
    max-width: 44rem;
    margin: 0 auto;
    justify-content: center;
  }
  .k-stage .k-fields .k-pitch {
    max-height: 66vh;
  }
  .k-stage .k-fields--two .k-pitch {
    max-height: 32vh;
  }
  .k-stage .k-pitch {
    max-height: 66vh;
  }
  .k-stage .k-goal {
    max-height: 62vh;
  }
  .k-stage .k-track {
    max-height: 50vh;
  }
  .k-stage .k-read {
    font-size: clamp(36px, 7vh, 72px);
  }
  .k-stage .k-says__bubble {
    font-size: var(--title);
  }
}

@container app (min-width: 600px) and (max-width: 899px) {
  .k-stage {
    padding: var(--space-4) var(--space-6);
  }
  .k-stage .k-fields .k-pitch {
    max-height: 46vh;
  }
  .k-stage .k-fields--two .k-pitch {
    max-height: 23vh;
  }
  .k-stage .k-read {
    font-size: 48px;
  }
  .k-stage .k-says__bubble {
    font-size: var(--title);
  }
}

.k-steps {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
  overflow-x: auto;
}
.k-steps__item {
  flex: 1 0 auto;
}
.k-steps__item button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 6px 10px;
  border: 0;
  border-bottom: 3px solid var(--line);
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.k-steps__item button:disabled {
  cursor: default;
}
.k-steps__item b {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink);
  font-size: var(--text-sm);
}
.k-steps__item--current button {
  color: var(--ink);
  border-color: var(--accent);
}
.k-steps__item--current b,
.k-steps__item--done b {
  background: var(--accent);
  color: var(--on-accent, white);
}
.k-steps__item--done button {
  color: var(--ink);
}
.k-steps--small .k-steps__item button {
  min-height: 44px;
  font-size: var(--text-sm);
}
.k-bench {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.k-bench__tabs {
  flex: none;
  padding: var(--space-2) var(--space-4);
}
.k-bench__main,
.k-bench__side {
  flex: 1 1 auto;
  min-height: 0;
}
.k-bench__main {
  overflow: auto;
  padding: var(--space-4);
}
.k-bench--main .k-bench__side,
.k-bench--side .k-bench__main {
  display: none;
}
@container app (min-width: 900px) {
  .k-bench {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
  }
  .k-bench__tabs {
    display: none;
  }
  .k-bench--main .k-bench__side,
  .k-bench--side .k-bench__main {
    display: block;
  }
  .k-bench__main {
    padding: var(--space-5) var(--space-6);
  }
  .k-bench__side {
    border-left: 1px solid var(--line);
    height: 100%;
    overflow: hidden;
  }
}
.k-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--surface);
}
.k-chat__context {
  margin: 0;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.k-chat__log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.k-chat__turn--you {
  align-self: flex-end;
  max-width: 88%;
  background: var(--bg, var(--line));
  padding: 8px 12px;
  border-radius: 12px;
}
.k-chat__tools {
  list-style: none;
  margin: 0 0 6px;
  padding: 0 0 0 10px;
  border-left: 2px solid var(--line);
  font-size: var(--text-sm);
  color: var(--muted);
}
.k-chat__tools b {
  color: var(--ink);
}
.k-chat__busy {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}
.k-chat__foot {
  flex: none;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.k-chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.k-chat__chip {
  min-height: 40px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--accent);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
}
.k-chat__chip:disabled {
  opacity: 0.5;
}
.k-chat__input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.k-chat__input textarea {
  flex: 1;
  resize: none;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.k-chat__diff {
  list-style: none;
  margin: 0 0 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: var(--text-sm);
  font-family: ui-monospace, Menlo, monospace;
}
.k-chat__diff--add {
  color: var(--success);
}
.k-chat__diff--del {
  color: var(--danger);
}
.k-chat__diff--mod {
  color: var(--ink);
}
.k-score2 {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.k-score2__grid {
  display: grid;
  min-width: max-content;
}
.k-score2__corner,
.k-score2__row {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.k-score2__corner {
  padding: 8px 10px;
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 700;
  display: flex;
  align-items: end;
}
.k-score2__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 2px 10px;
  border: 0;
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.k-score2__row--dim {
  opacity: 0.4;
  text-decoration: line-through;
}
.k-score2__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  line-height: 1.15;
}
.k-score2__day small {
  color: var(--muted);
  font-size: 11px;
}
.k-score2__cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 36px;
  border-top: 1px solid var(--line);
}
.k-score2__cell--through::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  background: var(--accent);
  opacity: 0.35;
}
.k-score2--past {
  background: var(--surface-2);
}
.k-score2--rest {
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 5px, transparent 5px 10px);
}
.k-score2--today {
  box-shadow: inset 2px 0 0 var(--accent);
}
.k-score2--over {
  background: color-mix(in srgb, var(--danger) 16%, var(--surface));
}
.k-score2--target {
  cursor: pointer;
  outline: 1px dashed var(--accent);
  outline-offset: -1px;
}
.k-score2__note {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--on-accent);
}
.k-score2__note--past {
  background: var(--line-strong);
}
.k-score2__note--other {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.k-score2__note--mine {
  background: var(--accent);
}
.k-score2__note--ghost {
  background: var(--surface);
  border: 2px dashed var(--accent);
  color: var(--ink);
}
.k-score2__note--picked {
  box-shadow: 0 0 0 3px var(--tone-lens);
}
.k-score2__note--gap {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}
.k-score2__note--fresh {
  animation: k-note-in 0.5s cubic-bezier(0.3, 1.7, 0.5, 1) backwards;
}
@keyframes k-note-in {
  from {
    transform: scale(0);
  }
}
.k-score2__min {
  position: relative;
  min-height: 40px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: end;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
}
.k-score2__min i {
  position: absolute;
  left: 25%;
  right: 25%;
  bottom: 0;
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}
.k-score2__min span {
  position: relative;
}
.k-score2__foot {
  border-top: 1px solid var(--line);
  align-items: center;
}
.k-feeds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.k-feeds__item {
  display: flex;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: var(--text-sm);
}
.k-feeds__item span {
  color: var(--muted);
}
.k-feeds__item--missing {
  background: none;
  outline: 1.5px dashed var(--accent);
}
.k-film {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.k-frame {
  flex: none;
  width: 124px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.k-frame--large {
  width: 224px;
}
.k-frame--marked {
  border-color: var(--accent);
}
.k-frame small {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.k-frame span {
  font-size: var(--text-sm);
}
.k-frame__pic {
  height: 62px;
  overflow: hidden;
  display: grid;
  place-items: center;
  pointer-events: none;
  border-radius: 6px;
  background: var(--surface-2);
}
.k-frame--large .k-frame__pic {
  height: 112px;
}
.k-frame__pic svg {
  display: block;
  max-height: 100%;
  width: 100%;
}
.k-frame__pic .k-stack {
  width: 100%;
  gap: 2px;
}
.k-frame__pic .k-read {
  display: none;
}
.k-frame__pic .k-calc__tile {
  font-size: 13px;
  min-height: 0;
  min-width: 0;
  padding: 0 2px;
}
.k-frame__pic .k-calc {
  gap: 2px;
}
.k-frame__pic .k-calc__box {
  padding: 1px 3px;
}
.k-frame__pic .k-calc__result {
  font-size: 13px;
}
.k-frame__pic .k-calc__who {
  display: none;
}
.k-frame__pic .k-machine {
  transform: scale(0.45);
}
.k-score2__trend {
  margin-left: auto;
  font-style: normal;
  font-weight: 700;
  color: var(--muted);
}
.k-score2--dense .k-score2__note {
  width: 25px;
  height: 25px;
  font-size: 11px;
}
.k-score2--dense .k-score2__min span {
  font-size: 9px;
}
.k-score2__note--who0 {
  background: var(--tone-next);
  color: var(--on-tone);
}
.k-score2__note--who1 {
  background: var(--tone-lens);
  color: var(--on-tone);
}
.k-score2__note--who2 {
  background: var(--tone-revisit);
  color: var(--on-tone);
}
.k-score2__note--held {
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px var(--success);
}
.k-score2__note--slipped {
  border: 2px dashed var(--danger);
}
.k-score2__note--wait {
  opacity: 0.75;
}
