/* ==========================================================================
   NubiiKids parent web app — brand layer on top of Bootstrap 5.3
   --------------------------------------------------------------------------
   Inspired by nubissFusion's static/custom/css/nb.css (navy + berry), adapted to plain Bootstrap 5.3
   (no Vuexy): we retarget Bootstrap's own CSS variables instead of overriding theme selectors.

   Colour rules:
   - Navy  --nb-navy   structural colour: headings, active nav, buttons, links, dark substrate.
   - Berry --nb-berry  SIGNAL ONLY: one moment per surface (unread dot, "Live" pill, emergency).
   Bump the ?v= cache key in templates/base.html on every change.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root,
[data-bs-theme="light"] {
  --nb-navy: #13348B;
  --nb-navy-600: #0F2A70;
  --nb-navy-700: #0B1F55;
  --nb-navy-400: #1B3F9E;
  --nb-navy-050: #EEF2FC;
  --nb-navy-rgb: 19, 52, 139;
  --nb-navy-text: var(--nb-navy);
  --nb-navy-btn: var(--nb-navy);
  --nb-navy-btn-hover: var(--nb-navy-600);

  --nb-berry: #BD0068;
  --nb-berry-050: #FBE9F2;
  --nb-berry-text: var(--nb-berry);
  --nb-berry-rgb: 189, 0, 104;

  --nb-ink: #0B1230;
  --nb-muted: #5B6B8A;
  --nb-canvas: #F8F9FA;
  --nb-surface: #FFFFFF;
  --nb-surface-2: #F1F4F9;
  --nb-line: #E6ECF3;
  --nb-line-2: #CDD7E3;

  /* state colours darkened 2026-10-10 (axe pass): white text on them and their own text on the tinted chips reach 4.5:1 */
  --nb-success: #14743c;  --nb-success-rgb: 20, 116, 60;
  --nb-warning: #94530b;  --nb-warning-rgb: 148, 83, 11;
  --nb-danger: #d92d3a;   --nb-danger-rgb: 217, 45, 58;
  --nb-info: #1d4ed8;     --nb-info-rgb: 29, 78, 216;
  --nb-indigo: #4F46E5;
  --nb-orange: #EA580C;

  --nb-shadow: 0 10px 40px rgba(19, 52, 139, 0.08);
  --nb-shadow-lg: 0 30px 70px rgba(19, 52, 139, 0.18);
  --nb-card-border: #DCE3ED;
  --nb-shadow-card: 0 1px 2px rgba(19, 52, 139, 0.06), 0 4px 14px rgba(19, 52, 139, 0.06);
  --nb-row-alt: #F5F7FB;
  --nb-radius: 1rem;
  --nb-radius-lg: 1.25rem;
  --nb-substrate: radial-gradient(120% 120% at 80% 0%, var(--nb-navy-400) 0%, var(--nb-navy-700) 70%);

  --nb-sidebar-w: 16.25rem;
  --nb-navbar-h: 3.75rem;
  --nb-bottombar-h: 4rem;
  --nb-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Bootstrap variables */
  --bs-font-sans-serif: var(--nb-font);
  --bs-body-font-family: var(--nb-font);
  --bs-body-bg: var(--nb-canvas);
  --bs-body-color: var(--nb-ink);
  --bs-emphasis-color: var(--nb-ink);
  --bs-secondary-color: var(--nb-muted);
  --bs-tertiary-bg: var(--nb-surface-2);
  --bs-heading-color: var(--nb-navy);
  --bs-primary: var(--nb-navy);
  --bs-primary-rgb: var(--nb-navy-rgb);
  --bs-primary-text-emphasis: var(--nb-navy-600);
  --bs-primary-bg-subtle: var(--nb-navy-050);
  --bs-primary-border-subtle: #C9D4F2;
  --bs-success: var(--nb-success);  --bs-success-rgb: var(--nb-success-rgb);
  --bs-warning: var(--nb-warning);  --bs-warning-rgb: var(--nb-warning-rgb);
  --bs-danger: var(--nb-danger);    --bs-danger-rgb: var(--nb-danger-rgb);
  --bs-info: var(--nb-info);        --bs-info-rgb: var(--nb-info-rgb);
  --bs-border-color: var(--nb-line);
  --bs-border-radius: 0.625rem;
  --bs-border-radius-lg: var(--nb-radius);
  --bs-link-color: var(--nb-navy-text);
  --bs-link-color-rgb: var(--nb-navy-rgb);
  --bs-link-hover-color: var(--nb-navy-600);
  --bs-focus-ring-color: rgba(var(--nb-navy-rgb), 0.25);
  color-scheme: light;
}

[data-bs-theme="dark"] {
  --nb-navy-050: rgba(143, 167, 240, 0.14);
  --nb-navy-text: #8FA7F0;
  --nb-navy-btn: #3457C9;
  --nb-navy-btn-hover: #2A49B0;
  --nb-berry-050: rgba(255, 95, 174, 0.14);
  --nb-berry-text: #FF5FAE;
  --nb-ink: #E8EDF9;
  --nb-muted: #9DAAD0;
  --nb-canvas: #0B1230;
  --nb-surface: #141C45;
  --nb-surface-2: #1B2454;
  --nb-line: rgba(255, 255, 255, 0.08);
  --nb-line-2: rgba(255, 255, 255, 0.16);
  --nb-success: #3FBF72;  --nb-success-rgb: 63, 191, 114;
  --nb-warning: #E0A03A;  --nb-warning-rgb: 224, 160, 58;
  --nb-danger: #FF6B75;   --nb-danger-rgb: 255, 107, 117;
  --nb-info: #60A5FA;     --nb-info-rgb: 96, 165, 250;
  --nb-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --nb-card-border: rgba(255, 255, 255, 0.14);
  --nb-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 18px rgba(0, 0, 0, 0.35);
  --nb-row-alt: rgba(255, 255, 255, 0.035);

  --bs-body-bg: var(--nb-canvas);
  --bs-body-color: var(--nb-ink);
  --bs-emphasis-color: var(--nb-ink);
  --bs-secondary-color: var(--nb-muted);
  --bs-tertiary-bg: var(--nb-surface-2);
  --bs-heading-color: var(--nb-ink);
  --bs-primary-text-emphasis: #B3C3F5;
  --bs-primary-bg-subtle: var(--nb-navy-050);
  --bs-border-color: var(--nb-line);
  --bs-link-color: var(--nb-navy-text);
  --bs-link-hover-color: #B3C3F5;
  /* Bootstrap 5.3 draws links from the -rgb twins: without them dark-mode links stayed navy on navy (axe pass 2026-10-10) */
  --bs-link-color-rgb: 143, 167, 240;
  --bs-link-hover-color-rgb: 179, 195, 245;
  color-scheme: dark;
}

/* --- Base ----------------------------------------------------------------- */
html, body { font-family: var(--nb-font); }
body { background: var(--nb-canvas); color: var(--nb-ink); -webkit-font-smoothing: antialiased; }
@media (max-width: 991.98px) { [data-bs-theme="light"] { --nb-canvas: #EEF2F7; } }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--bs-heading-color); font-weight: 700; letter-spacing: -0.015em; }
h1, .h1 { font-weight: 800; letter-spacing: -0.02em; }
.text-muted, .text-body-secondary { color: var(--nb-muted) !important; }
.text-navy { color: var(--nb-navy-text) !important; }
.text-berry { color: var(--nb-berry-text) !important; }
.fw-800 { font-weight: 800; }
.tabular { font-variant-numeric: tabular-nums; }
.small-caps { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--nb-muted); }

/* --- Buttons (retarget Bootstrap's per-variant vars) ------------------------ */
.btn { --bs-btn-font-weight: 600; --bs-btn-border-radius: .625rem; --bs-btn-padding-y: .5rem; --bs-btn-padding-x: 1rem; }
.btn-lg { --bs-btn-padding-y: .75rem; --bs-btn-border-radius: .75rem; }
/* .btn above sets padding with the same specificity as Bootstrap's .btn-sm, so restore the small size explicitly. */
.btn-sm { --bs-btn-padding-y: .375rem; --bs-btn-padding-x: .75rem; --bs-btn-border-radius: .5rem; }
.btn-primary {
  --bs-btn-bg: var(--nb-navy-btn); --bs-btn-border-color: var(--nb-navy-btn);
  --bs-btn-hover-bg: var(--nb-navy-btn-hover); --bs-btn-hover-border-color: var(--nb-navy-btn-hover);
  --bs-btn-active-bg: var(--nb-navy-700); --bs-btn-active-border-color: var(--nb-navy-700);
  --bs-btn-disabled-bg: var(--nb-navy-btn); --bs-btn-disabled-border-color: var(--nb-navy-btn);
  --bs-btn-focus-shadow-rgb: var(--nb-navy-rgb);
}
.btn-outline-primary {
  --bs-btn-color: var(--nb-navy-text); --bs-btn-border-color: var(--nb-line-2);
  --bs-btn-hover-bg: var(--nb-navy-050); --bs-btn-hover-color: var(--nb-navy-text); --bs-btn-hover-border-color: var(--nb-navy-text);
  --bs-btn-active-bg: var(--nb-navy-050); --bs-btn-active-color: var(--nb-navy-text); --bs-btn-active-border-color: var(--nb-navy-text);
}
.btn-soft { background: var(--nb-navy-050); color: var(--nb-navy-text); border: 0; }
.btn-soft:hover { background: rgba(var(--nb-navy-rgb), .14); color: var(--nb-navy-text); }
.btn-success { --bs-btn-bg: var(--nb-success); --bs-btn-border-color: var(--nb-success); }
.btn-warning { --bs-btn-bg: var(--nb-warning); --bs-btn-border-color: var(--nb-warning); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; }
.btn-danger { --bs-btn-bg: var(--nb-danger); --bs-btn-border-color: var(--nb-danger); }

/* --- Surfaces --------------------------------------------------------------- */
.card {
  --bs-card-bg: var(--nb-surface);
  --bs-card-border-color: var(--nb-card-border);
  --bs-card-border-radius: var(--nb-radius);
  --bs-card-inner-border-radius: calc(var(--nb-radius) - 1px);
  --bs-card-cap-bg: transparent;
  --bs-card-spacer-y: 1.25rem;
  --bs-card-spacer-x: 1.25rem;
  box-shadow: var(--nb-shadow-card);
}
.card-header { border-bottom-color: var(--nb-line); padding-top: 1rem; padding-bottom: 1rem; }
.card-header h2, .card-header h3, .card-header h4, .card-header h5 { margin: 0; font-size: 1rem; }
.card-footer { border-top-color: var(--nb-line); background: transparent; }

.kpi { display: flex; flex-direction: column; gap: .25rem; }
.kpi__icon {
  width: 2.5rem; height: 2.5rem; border-radius: .75rem; display: inline-flex; align-items: center; justify-content: center;
  background: var(--nb-navy-050); color: var(--nb-navy-text); font-size: 1.15rem;
}
.kpi__value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--nb-ink); font-variant-numeric: tabular-nums; }
.kpi__label { font-size: .8rem; color: var(--nb-muted); }
.kpi__delta { font-size: .75rem; font-weight: 700; }
.kpi__delta.up { color: var(--nb-warning); }
.kpi__delta.down { color: var(--nb-success); }

.icon-badge {
  width: 2.25rem; height: 2.25rem; border-radius: .7rem; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1rem;
  background: rgba(var(--badge-rgb, var(--nb-navy-rgb)), .12); color: rgb(var(--badge-rgb, var(--nb-navy-rgb)));
}
.icon-badge.lg { width: 3rem; height: 3rem; border-radius: .9rem; font-size: 1.35rem; }
.tone-success { --badge-rgb: var(--nb-success-rgb); }
.tone-warning { --badge-rgb: var(--nb-warning-rgb); }
.tone-danger  { --badge-rgb: var(--nb-danger-rgb); }
.tone-info    { --badge-rgb: var(--nb-info-rgb); }
.tone-berry   { --badge-rgb: var(--nb-berry-rgb); }
.tone-indigo  { --badge-rgb: 79, 70, 229; }
.tone-orange  { --badge-rgb: 234, 88, 12; }
.tone-secondary { --badge-rgb: 91, 107, 138; }
[data-bs-theme="dark"] .tone-primary { --badge-rgb: 150, 170, 240; }   /* navy/indigo icons stay visible on the dark surface */
[data-bs-theme="dark"] .tone-indigo { --badge-rgb: 165, 160, 255; }

.chip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; background: var(--nb-surface-2); color: var(--nb-ink); border: 1px solid var(--nb-line);
  white-space: nowrap;
}
.chip-tone { background: rgba(var(--badge-rgb, var(--nb-navy-rgb)), .12); color: rgb(var(--badge-rgb, var(--nb-navy-rgb))); border-color: transparent; }
a.chip { text-decoration: none; }
a.chip:hover, .chip.active { background: var(--nb-navy-050); color: var(--nb-navy-text); border-color: rgba(var(--nb-navy-rgb), .25); }
.dot { width: .5rem; height: .5rem; border-radius: 50%; display: inline-block; background: var(--nb-line-2); }
.dot.live { background: var(--nb-success); box-shadow: 0 0 0 3px rgba(var(--nb-success-rgb), .2); }
.dot.signal { background: var(--nb-berry); }

/* Tables */
.table { --bs-table-bg: transparent; --bs-table-color: var(--nb-ink); --bs-table-border-color: var(--nb-line); margin-bottom: 0; }
.table > thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--nb-muted); font-weight: 700; background: var(--nb-surface-2); border-bottom: 0; }
.table-zebra > tbody > tr:nth-of-type(even) > * { background: var(--nb-row-alt); }
.table > tbody > tr > * { vertical-align: middle; padding-top: .75rem; padding-bottom: .75rem; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--nb-navy-050); }

/* Forms */
.form-control, .form-select { border-color: var(--nb-line-2); border-radius: .625rem; padding: .55rem .85rem; background-color: var(--nb-surface); }
.form-control:focus, .form-select:focus { border-color: var(--nb-navy-text); box-shadow: 0 0 0 .2rem rgba(var(--nb-navy-rgb), .15); }
.form-label { font-weight: 600; font-size: .85rem; }
.form-check-input:checked { background-color: var(--nb-navy-btn); border-color: var(--nb-navy-btn); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; }
.helptext, .form-text { font-size: .8rem; color: var(--nb-muted); }
.errorlist { list-style: none; padding: 0; margin: .25rem 0 0; color: var(--nb-danger); font-size: .8rem; }

.list-group { --bs-list-group-bg: var(--nb-surface); --bs-list-group-border-color: var(--nb-line); }
.dropdown-menu { --bs-dropdown-bg: var(--nb-surface); --bs-dropdown-border-color: var(--nb-card-border); --bs-dropdown-link-active-bg: var(--nb-navy-btn); box-shadow: var(--nb-shadow); border-radius: .75rem; }
.modal-content { background: var(--nb-surface); border-radius: var(--nb-radius-lg); border-color: var(--nb-card-border); }
.alert { border-radius: .75rem; }
.progress { --bs-progress-bg: var(--nb-surface-2); --bs-progress-bar-bg: var(--nb-navy-btn); border-radius: 999px; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--nb-navy-btn); --bs-nav-link-color: var(--nb-muted); --bs-nav-link-hover-color: var(--nb-navy-text); }
.nav-pills .nav-link { font-weight: 600; border-radius: .6rem; }

/* --- Desktop shell: sidebar + topbar --------------------------------------- */
.nk-shell { min-height: 100vh; }
.nk-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--nb-sidebar-w); z-index: 1040;
  background: var(--nb-surface); border-right: 1px solid var(--nb-line); display: flex; flex-direction: column;
  transition: width .2s ease, box-shadow .2s ease;
}
/* Brand row: logo + collapse toggle (Fusion .app-brand + .layout-menu-toggle) */
.nk-brand { height: var(--nb-navbar-h); display: flex; align-items: center; gap: .5rem; padding: 0 .75rem 0 1.25rem; flex: 0 0 auto; }
.nk-brand__link { display: flex; align-items: center; gap: .6rem; text-decoration: none; min-width: 0; flex: 1; }
.nk-brand__mark {
  width: 2.1rem; height: 2.1rem; border-radius: .7rem; background: var(--nb-substrate); color: #fff; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.nk-brand__text { font-weight: 800; font-size: 1.1rem; color: var(--nb-navy-text); letter-spacing: .01em; white-space: nowrap; }
.nk-brand__text span { color: var(--nb-berry-text); }
.nk-menu-toggle {
  width: 2rem; height: 2rem; border-radius: .6rem; border: 1px solid var(--nb-line); background: var(--nb-surface);
  color: var(--nb-muted); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.nk-menu-toggle:hover { color: var(--nb-navy-text); background: var(--nb-navy-050); }
/* Shadow under the brand once the menu scrolls (Fusion .menu-inner-shadow) */
.nk-menu-shadow { height: 0; position: relative; z-index: 2; }
.nk-menu-shadow::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 1.25rem; pointer-events: none;
  background: linear-gradient(var(--nb-surface) 10%, transparent); opacity: 0; transition: opacity .2s; }
.nk-sidebar.is-scrolled .nk-menu-shadow::after { opacity: 1; }

/* Menu (Fusion .menu-inner / .menu-item / .menu-link / .menu-sub) */
.nk-menu, .nk-menu__sub { list-style: none; margin: 0; padding: 0; }
.nk-menu { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: .25rem .75rem 1.5rem; }
.nk-menu__header { padding: 1.1rem .85rem .35rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--nb-muted); white-space: nowrap; }
.nk-menu__item { margin: 1px 0; }
.nk-menu__link {
  position: relative; display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem; border-radius: .625rem;
  color: var(--nb-ink); text-decoration: none; font-weight: 500; font-size: .92rem; white-space: nowrap;
}
.nk-menu__link:hover { background: var(--nb-surface-2); color: var(--nb-navy-text); }
.nk-menu__icon { font-size: 1.1rem; width: 1.35rem; text-align: center; color: var(--nb-muted); flex: 0 0 auto; }
.nk-menu__link:hover .nk-menu__icon { color: var(--nb-navy-text); }
.nk-menu-text { overflow: hidden; text-overflow: ellipsis; }
.nk-menu__badge {
  margin-left: auto; min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; border-radius: 999px;
  background: var(--nb-berry); color: #fff; font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
/* Active leaf: tint + slim navy pill on the leading edge */
.nk-menu__item.active > .nk-menu__link:not(.nk-menu__toggle) { background: var(--nb-navy-050); color: var(--nb-navy-text); font-weight: 600; }
.nk-menu__item.active > .nk-menu__link:not(.nk-menu__toggle)::after {
  content: ""; position: absolute; left: 0; top: .5rem; bottom: .5rem; width: 3px; border-radius: 3px; background: var(--nb-navy-text);
}
.nk-menu__item.active > .nk-menu__link .nk-menu__icon { color: var(--nb-navy-text); }
/* Group toggles: chevron, navy label when open (no second "selected" box) */
.nk-menu__toggle::before {
  content: "\f285"; font-family: bootstrap-icons; position: absolute; right: .8rem; font-size: .75rem; color: var(--nb-muted);
  transition: transform .2s ease;
}
.nk-menu__item.open > .nk-menu__toggle::before { transform: rotate(90deg); color: var(--nb-navy-text); }
.nk-menu__item.open > .nk-menu__toggle, .nk-menu__item.active > .nk-menu__toggle { color: var(--nb-navy-text); }
.nk-menu__item.active > .nk-menu__toggle .nk-menu__icon { color: var(--nb-navy-text); }
.nk-menu__sub { display: none; padding: .15rem 0 .35rem; }
.nk-menu__item.open > .nk-menu__sub { display: block; }
.nk-menu__sub .nk-menu__link { padding: .45rem .8rem .45rem 2.85rem; font-size: .88rem; }
/* Sub-item ring bullets; active = filled navy dot */
.nk-menu__sub .nk-menu__link::before {
  content: ""; position: absolute; left: 1.35rem; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%;
  border: 1.5px solid var(--nb-line-2); transition: all .15s ease;
}
.nk-menu__sub .nk-menu__link:hover::before { border-color: var(--nb-navy-text); }
.nk-menu__sub .nk-menu__item.active > .nk-menu__link { background: transparent; }
.nk-menu__sub .nk-menu__item.active > .nk-menu__link::after { display: none; }
.nk-menu__sub .nk-menu__item.active > .nk-menu__link::before {
  width: 8px; height: 8px; border-color: var(--nb-navy-text); background: var(--nb-navy-text); box-shadow: 0 0 0 3px rgba(var(--nb-navy-rgb), .15);
}

/* Collapsed rail (desktop): icons only; hovering expands it over the content, like Vuexy's layout-menu-collapsed */
@media (min-width: 992px) {
  html.nk-menu-collapsed { --nb-sidebar-w-now: 5rem; }
  html.nk-menu-collapsed .nk-main { margin-left: 5rem; }
  html.nk-menu-collapsed .nk-sidebar:not(:hover) { width: 5rem; }
  html.nk-menu-collapsed .nk-sidebar:hover { box-shadow: var(--nb-shadow-lg); }
  html.nk-menu-collapsed .nk-sidebar:not(:hover) .nk-menu-text,
  html.nk-menu-collapsed .nk-sidebar:not(:hover) .nk-menu__sub,
  html.nk-menu-collapsed .nk-sidebar:not(:hover) .nk-menu__toggle::before { display: none; }
  /* The expand toggle appears when the rail is hovered (Bootstrap's d-lg-inline-flex is !important). */
  html.nk-menu-collapsed .nk-sidebar:not(:hover) .nk-menu-toggle { display: none !important; }
  html.nk-menu-collapsed .nk-sidebar:not(:hover) .nk-brand { padding: 0; justify-content: center; }
  html.nk-menu-collapsed .nk-sidebar:not(:hover) .nk-brand__link { flex: 0 0 auto; }
  html.nk-menu-collapsed .nk-sidebar:not(:hover) .nk-menu__header { padding: .9rem 0 .3rem; text-align: center; }
  html.nk-menu-collapsed .nk-sidebar:not(:hover) .nk-menu__header::before { content: "···"; letter-spacing: .1em; }
  html.nk-menu-collapsed .nk-sidebar:not(:hover) .nk-menu__link { justify-content: center; padding-left: 0; padding-right: 0; }
  html.nk-menu-collapsed .nk-sidebar:not(:hover) .nk-menu__item.active > .nk-menu__link { background: var(--nb-navy-050); color: var(--nb-navy-text); }
  html.nk-menu-collapsed .nk-sidebar:not(:hover) .nk-menu__badge { position: absolute; top: .3rem; right: .7rem; min-width: .55rem; height: .55rem; padding: 0; font-size: 0; }
  html.nk-menu-collapsed .nk-menu-toggle i::before { content: "\f277"; } /* bi-chevron-bar-right */
}

.nk-main { margin-left: var(--nb-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .2s ease; }
.nk-topbar {
  position: sticky; top: 0; z-index: 1030; height: var(--nb-navbar-h);
  display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem;
  background: color-mix(in srgb, var(--nb-canvas) 82%, transparent); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--nb-line);
}
.nk-topbar__title { font-weight: 700; color: var(--nb-ink); font-size: 1.05rem; margin: 0; }
.nk-content { padding: 1.5rem; flex: 1; max-width: 87.5rem; width: 100%; }
.nk-footer { padding: 1rem 1.5rem; color: var(--nb-muted); font-size: .8rem; }
.nk-icon-btn {
  width: 2.4rem; height: 2.4rem; border-radius: .7rem; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--nb-line); background: var(--nb-surface); color: var(--nb-ink); position: relative;
}
.nk-icon-btn:hover { color: var(--nb-navy-text); background: var(--nb-navy-050); }
.nk-icon-btn .dot.signal { position: absolute; top: .45rem; right: .5rem; }
.child-switch { border: 1px solid var(--nb-line); background: var(--nb-surface); border-radius: 999px; padding: .25rem .75rem .25rem .3rem; display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--nb-ink); }
.avatar {
  width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .85rem; background: var(--avatar, var(--nb-navy));
}
.avatar.lg { width: 3.25rem; height: 3.25rem; font-size: 1.25rem; }
/* Emoji avatar picker (children new/edit) */
.nk-avatar-option { width: 3rem; height: 3rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; line-height: 1; }
/* Emoji pickers (chores, checklists) and the "add to line" chips under checklist items. */
.nk-emoji-option { min-width: 2.75rem; height: 2.75rem; padding: 0 .5rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; line-height: 1; }
.nk-emoji-option.small { font-size: .85rem; font-weight: 600; }
.nk-emoji-chip { font-size: 1.1rem; line-height: 1; padding: .3rem .45rem; }
.nk-exception > summary { list-style: none; cursor: pointer; }
.nk-exception > summary::-webkit-details-marker { display: none; }

.page-header { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.6rem; margin: 0; }
.page-header p { margin: .25rem 0 0; color: var(--nb-muted); }

/* --- Phone shell: off-canvas sidebar + bottom tab bar ------------------------ */
.nk-bottombar { display: none; }
@media (max-width: 991.98px) {
  /* Hidden (not just off-screen) while closed, so keyboard focus can't land in it. */
  .nk-sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; box-shadow: var(--nb-shadow-lg); }
  .nk-shell.menu-open .nk-sidebar { transform: none; visibility: visible; transition: transform .25s ease; }
  .nk-backdrop { display: none; position: fixed; inset: 0; background: rgba(11, 18, 48, .45); z-index: 1035; }
  .nk-shell.menu-open .nk-backdrop { display: block; }
  .nk-main { margin-left: 0; }
  .nk-topbar { padding: 0 1rem; }
  .nk-content { padding: 1rem 1rem calc(var(--nb-bottombar-h) + 1.5rem + env(safe-area-inset-bottom)); }
  .nk-bottombar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 1030;
    height: calc(var(--nb-bottombar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--nb-surface); border-top: 1px solid var(--nb-line);
  }
  .nk-bottombar a, .nk-bottombar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
    color: var(--nb-muted); text-decoration: none; font-size: .75rem; font-weight: 600; position: relative; min-width: 0;
  }
  .nk-bottombar a i, .nk-bottombar button i { font-size: 1.35rem; }
  /* Tab labels always fit their fifth of the bar: a little smaller on narrow phones, then an ellipsis (long German /
     Czech words). */
  .nk-bottombar__label { display: block; max-width: 100%; padding: 0 .2rem; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; font-size: clamp(.66rem, 2.8vw, .75rem); }
  .nk-bottombar button { background: none; border: 0; padding: 0; font-family: inherit; }
  .nk-bottombar a.active, .nk-bottombar button.active { color: var(--nb-navy-text); }
  .nk-bottombar a::before, .nk-bottombar button::before { content: ""; position: absolute; top: .35rem; left: 50%; width: 3.25rem; height: 1.9rem;
    transform: translateX(-50%) scale(.6); border-radius: 999px; background: var(--nb-navy-050); opacity: 0; transition: transform .2s ease, opacity .2s ease; }
  .nk-bottombar a.active::before, .nk-bottombar button.active::before { transform: translateX(-50%) scale(1); opacity: 1; }
  .nk-bottombar a > *, .nk-bottombar button > * { position: relative; }
  .nk-bottombar a:active i, .nk-bottombar button:active i, .nk-bottombar a:active .nk-bottombar__emoji { transform: scale(.88); }
  .nk-bottombar i, .nk-bottombar__emoji { transition: transform .12s ease; }
  .nk-bottombar__emoji { font-size: 1.45rem; line-height: 1.25; }
  .nk-bottombar--kid { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .nk-bottombar { transition: transform .25s ease; }
  .nk-bottombar.is-hidden { transform: translateY(100%); }
  .nk-bottombar .dot.signal { position: absolute; top: .6rem; left: calc(50% + .5rem); }
  .page-header h1 { font-size: 1.35rem; }
}

/* --- Auth split screen -------------------------------------------------------- */
.nb-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.nb-auth__brand {
  background: var(--nb-substrate); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.nb-auth__brand::after {
  content: ""; position: absolute; width: 28rem; height: 28rem; right: -8rem; bottom: -8rem; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--nb-berry-rgb), .35), transparent 65%);
}
.nb-auth__brand h1, .nb-auth__brand h2 { color: #fff; }
.nb-auth__brand .lead { color: rgba(255, 255, 255, .8); max-width: 30rem; }
.nb-auth__feature { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: 1rem; color: rgba(255, 255, 255, .9); }
.nb-auth__feature i { font-size: 1.2rem; background: rgba(255, 255, 255, .12); border-radius: .6rem; width: 2.2rem; height: 2.2rem; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.nb-auth__form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; background: var(--nb-surface); }
.nb-auth__card { width: 100%; max-width: 26rem; }
.nb-auth__tagline { color: rgba(255, 255, 255, .6); }
/* Legal links + beta line under the sign-in card (templates/auth_layout.html): last on phones, centred on desktop. */
.nb-auth__footer { width: 100%; max-width: 26rem; margin-top: 2rem; text-align: center; font-size: .8rem; color: var(--nb-muted); }
.nb-auth__footer a { color: inherit; }
@media (max-width: 991.98px) {
  .nb-auth { grid-template-columns: 1fr; }
  .nb-auth__brand { padding: 2rem 1.5rem; min-height: auto; }
  .nb-auth__brand .nb-auth__features { display: none; }
}

/* --- Feature pieces ------------------------------------------------------------- */
.status-hero { background: var(--nb-substrate); color: #fff; border: 0; }
.status-hero h2, .status-hero h3 { color: #fff; }
.status-hero .text-muted { color: rgba(255, 255, 255, .72) !important; }
.status-hero .ring { --p: 0; width: 7.5rem; height: 7.5rem; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .18) 0); }
.status-hero .ring > div { width: 6.1rem; height: 6.1rem; border-radius: 50%; background: var(--nb-navy-700); display: grid; place-items: center; text-align: center; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: .85rem; padding: .85rem 0; border-bottom: 1px solid var(--nb-line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .time { margin-left: auto; color: var(--nb-muted); font-size: .8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline-day { position: sticky; top: var(--nb-navbar-h); background: var(--nb-canvas); z-index: 2; padding: .5rem 0; }

.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .75rem; align-items: center; margin-bottom: .85rem; }
.bar-row .bar { grid-column: 1 / -1; height: .45rem; border-radius: 999px; background: var(--nb-surface-2); overflow: hidden; }
.bar-row .bar > span { display: block; height: 100%; border-radius: inherit; background: var(--nb-navy-btn); }
/* Reports › apps (2026-10-27): a meta line under each bar (status chip, devices, "not timed" warning). */
.bar-row .nk-bar-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; font-size: .78rem; }
.bar-row.is-quiet > :not(.nk-bar-meta) { opacity: .75; }
.nk-chip-wrap { white-space: normal; text-align: left; height: auto; line-height: 1.3; padding-top: .2rem; padding-bottom: .2rem; }
/* Reports › Apps by day: seven day chips (weekday · date · total · spark bar), the chosen one shows its apps. */
.nk-daypick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; margin-bottom: 1rem; }
.nk-daypick__chip { display: grid; gap: .1rem; justify-items: center; min-height: 2.75rem; padding: .4rem .25rem .5rem; border: 1px solid var(--nb-line); border-radius: .75rem; background: var(--nb-surface); color: inherit; font: inherit; line-height: 1.15; }
.nk-daypick__wd { font-weight: 600; font-size: .8rem; }
.nk-daypick__date { font-size: .7rem; color: var(--nb-muted); }
.nk-daypick__total { font-size: .75rem; }
.nk-daypick__spark { display: block; width: 100%; height: .2rem; border-radius: 999px; background: var(--nb-surface-2); overflow: hidden; position: relative; }
.nk-daypick__spark::after { content: ""; position: absolute; inset: 0; width: calc(var(--pct, 0) * 1%); background: var(--nb-navy-btn); border-radius: inherit; }
.nk-daypick__chip.is-on { background: var(--nb-navy); border-color: var(--nb-navy); color: #fff; }
.nk-daypick__chip.is-on .nk-daypick__date { color: rgba(255, 255, 255, .8); }
.nk-daypick__chip.is-on .nk-daypick__spark { background: rgba(255, 255, 255, .25); }
.nk-daypick__chip.is-on .nk-daypick__spark::after { background: #fff; }
.nk-daypick__chip:focus-visible { outline: 2px solid var(--nb-berry); outline-offset: 2px; }
@media (max-width: 575.98px) {
  .nk-daypick { display: flex; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-bottom: .25rem; }
  .nk-daypick::-webkit-scrollbar { display: none; }
  .nk-daypick__chip { flex: 0 0 4.6rem; scroll-snap-align: center; }
}
/* Reports › Every app used: a folded card (prints when open). */
.nk-every-apps > summary { list-style: none; cursor: pointer; }
.nk-every-apps > summary::-webkit-details-marker { display: none; }
.nk-every-apps > summary .nk-details-chev { margin-left: auto; transition: transform .2s; }
.nk-every-apps[open] > summary .nk-details-chev { transform: rotate(180deg); }
@media print { .nk-daypick__chip:not(.is-on) { opacity: .5; } }

.qr-panel { background: #fff; border-radius: var(--nb-radius-lg); padding: 1rem; display: inline-block; border: 1px solid var(--nb-card-border); }
.qr-panel img { width: min(260px, 62vw); height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; word-break: break-all; background: var(--nb-surface-2); border-radius: .6rem; padding: .75rem; max-height: 7rem; overflow: auto; }
.pair-wait { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; }
.pair-wait .spinner-grow { width: .8rem; height: .8rem; color: var(--nb-berry); }

.empty { text-align: center; padding: 3rem 1rem; color: var(--nb-muted); }
.empty i { font-size: 2.5rem; color: rgba(var(--nb-navy-rgb), .35); display: block; margin-bottom: .75rem; }

.request-card { border-left: 4px solid var(--nb-warning); }
.emergency-banner { background: rgba(var(--nb-berry-rgb), .1); border: 1px solid rgba(var(--nb-berry-rgb), .35); color: var(--nb-berry-text); border-radius: var(--nb-radius); }

:focus-visible { outline: 2px solid var(--nb-navy-text); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* --- Top nav (structure from nubissFusion topNav / nav_user) --------------------- */
.nk-greeting { font-size: .78rem; color: var(--nb-muted); }
.nk-greeting b { color: var(--nb-ink); font-weight: 600; }
.nk-topbar .nk-topbar__title { font-size: 1rem; }
.nk-topbar__heading { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; line-height: 1.2; }
.nk-topbar__heading > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nk-topnav { flex: 0 0 auto; list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .5rem; }
.nk-topnav > li { position: relative; }
.nk-topnav__link {
  display: inline-flex; align-items: center; gap: .45rem; height: 2.4rem; padding: 0 .75rem; border-radius: .7rem;
  border: 1px solid var(--nb-line); background: var(--nb-surface); color: var(--nb-ink); font-size: .9rem;
}
.nk-topnav__link:hover { color: var(--nb-navy-text); background: var(--nb-navy-050); }
.nk-topnav__link i { color: var(--nb-navy-text); }
.nk-topnav .dropdown-item.active { background: var(--nb-navy-050); color: var(--nb-navy-text); }
.nk-topnav .dropdown-item.active i { color: var(--nb-navy-text); }

.nk-user-btn { position: relative; border: 0; background: transparent; padding: 0; border-radius: 50%; }
.nk-user-btn .avatar { width: 2.4rem; height: 2.4rem; box-shadow: 0 0 0 2px var(--nb-surface), 0 0 0 3px var(--nb-line-2); }
.nk-user-btn::after {
  content: ""; position: absolute; right: 0; bottom: 0; width: .65rem; height: .65rem; border-radius: 50%;
  background: var(--nb-success); box-shadow: 0 0 0 2px var(--nb-surface);
}
.nk-user-menu { min-width: 16rem; }

.nk-notif-menu { width: min(22rem, calc(100vw - 2rem)); overflow: hidden; }
.nk-notif-menu__list { max-height: 22rem; overflow-y: auto; }
.nk-notif-item {
  display: flex; gap: .75rem; align-items: flex-start; width: 100%; padding: .8rem 1rem; border: 0;
  border-bottom: 1px solid var(--nb-line); background: rgba(var(--nb-navy-rgb), .035); color: var(--nb-ink); font-size: .88rem;
}
.nk-notif-item:hover { background: var(--nb-navy-050); }
.nk-notif-menu form:last-child .nk-notif-item { border-bottom: 0; }

/* Appearance segmented control (port of Fusion .nb-seg) */
.nk-seg { display: inline-flex; padding: .2rem; gap: .2rem; border-radius: .7rem; background: var(--nb-surface-2); border: 1px solid var(--nb-line); }
.nk-seg--block { display: flex; }
.nk-seg__btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 0; background: transparent;
  color: var(--nb-muted); font-size: .78rem; font-weight: 600; padding: .35rem .5rem; border-radius: .5rem;
}
.nk-seg__btn:hover { color: var(--nb-navy-text); }
.nk-seg__btn[aria-pressed="true"] { background: var(--nb-surface); color: var(--nb-navy-text); box-shadow: var(--nb-shadow-card); }
@media (max-width: 575.98px) { .nk-topnav { gap: .35rem; } .child-switch { padding-right: .4rem; } }

/* Confirmation dialog opened on top of another modal (see nk.js). */
.modal.nk-confirm-stacked { z-index: 1065; }
.modal-backdrop ~ .modal-backdrop { z-index: 1060; }

/* ---- Request cards (Requests + Overview "Waiting for you") ---- */
.nk-req { border-left: 4px solid var(--nb-warning); }
.nk-req.is-asked-you { border-left-color: var(--nb-primary, #13348B); }
.nk-req__app { display: flex; align-items: center; gap: .85rem; }
.nk-req__title { font-size: 1.05rem; font-weight: 700; color: var(--nb-ink); line-height: 1.25; }
.nk-req__placeholder { font-weight: 600; color: var(--nb-muted, #6c757d); }
.nk-req__clues { background: rgba(var(--nb-warning-rgb), .08); border-radius: .6rem; padding: .55rem .75rem; color: var(--nb-ink); }
.nk-req__clues summary { cursor: pointer; font-weight: 600; }
.nk-req__decide { display: flex; flex-direction: column; gap: .6rem; margin: 0; }
.nk-req__for { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--nb-muted, #6c757d); }
.nk-req__for select { width: auto; min-width: 9rem; }
.nk-req__buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .5rem; }
/* phones: Approve gets its own full row ("Approve 30 min" on one line), Always allow / Deny share the next */
@media (max-width: 575.98px) { .nk-req__buttons { grid-template-columns: 1fr 1fr; } .nk-req__buttons > [value="approve"] { grid-column: 1 / -1; } }
.nk-req__buttons .btn { font-weight: 600; }
.nk-waiting { border: 2px solid rgba(var(--nb-warning-rgb), .45); background: rgba(var(--nb-warning-rgb), .05); }
/* "Update available" / new-request pill: under the header, centred — never on top of a page's own buttons */
.nk-new-request { position: fixed; z-index: 1080; top: calc(4.75rem + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); white-space: nowrap; border-radius: 999px; }

/* Installed web app (PWA) */
.nk-notify .form-check-input { cursor: pointer; }
.nk-install-card { border-color: rgba(var(--nb-info-rgb), .35); }
.nk-req:target { outline: 2px solid var(--nb-berry); outline-offset: 3px; scroll-margin-top: calc(var(--nb-navbar-h) + 1rem); }
@media (display-mode: standalone) {
  .nk-footer { display: none !important; }
  .nk-topbar { padding-top: env(safe-area-inset-top); height: calc(var(--nb-navbar-h) + env(safe-area-inset-top)); }
  .nk-kidbar { padding-top: env(safe-area-inset-top); }
  body { overscroll-behavior-y: contain; }
}

/* Family race */
.nk-race-place { width: 1.75rem; text-align: center; font-weight: 800; font-size: 1.1rem; }
/* Health & mood: 30-day calendar */
.nk-mood-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.nk-mood-cal__head { text-align: center; font-size: .75rem; font-weight: 600; color: var(--bs-secondary-color); }
.nk-mood-cal__day { position: relative; border: 1px solid var(--bs-border-color); border-radius: .6rem; min-height: 3.2rem; display: flex; align-items: center; justify-content: center; }
.nk-mood-cal__day.is-today { border-color: var(--bs-primary); border-width: 2px; }
.nk-mood-cal__num { position: absolute; top: .15rem; left: .35rem; font-size: .65rem; color: var(--bs-secondary-color); }
.nk-mood-cal__emoji { font-size: 1.5rem; line-height: 1; }
/* Sleep calendar (2026-10-19): the night's score 1–10, tinted good / ok / bad. */
.nk-sleep-cell__score { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.nk-sleep-cell.is-good { background: color-mix(in srgb, var(--nb-success) 14%, transparent); }
.nk-sleep-cell.is-ok { background: color-mix(in srgb, var(--nb-warning) 14%, transparent); }
.nk-sleep-cell.is-bad { background: color-mix(in srgb, var(--bs-danger) 16%, transparent); }
/* Family race podium */
.nk-podium { display: flex; align-items: flex-end; justify-content: center; gap: 1.25rem; padding-top: 1.5rem; }
.nk-podium__col { display: flex; flex-direction: column; align-items: center; width: 8rem; }
.nk-podium__crown { font-size: 1.6rem; height: 2rem; }
.nk-podium__bar { width: 100%; height: calc(3rem + var(--h) * .07rem); border-radius: .8rem .8rem .3rem .3rem; margin-top: .5rem; color: #fff; display: flex; flex-direction: column; align-items: center; padding-top: .4rem; }
.nk-podium__bar span { font-size: 1.6rem; font-weight: 800; line-height: 1; }

/* ---- Device hero (Controls hub): today's numbers inside the status hero ---- */
.nk-hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-top: 1.5rem; }
.nk-hero-stat {
  display: flex; flex-direction: column; gap: .1rem; padding: .75rem .9rem; border-radius: .8rem; color: #fff; text-decoration: none;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); transition: background .15s, transform .15s;
}
.nk-hero-stat:hover { background: rgba(255, 255, 255, .18); color: #fff; transform: translateY(-1px); }
.nk-hero-stat__value { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.nk-hero-stat__label { font-size: .75rem; color: rgba(255, 255, 255, .75); }
.nk-hero-stat__delta { font-size: .72rem; font-weight: 700; color: rgba(255, 255, 255, .85); }
@media (max-width: 575.98px) { .nk-hero-stats { grid-template-columns: 1fr 1fr; } .nk-hero-stat:last-child { grid-column: 1 / -1; } }

/* ---- "Worth a look" (Overview) ---- */
.nk-highlights { border-left: 4px solid var(--nb-berry); }
.nk-highlights ul { margin: 0; padding-left: 1.1rem; }
.nk-highlights li + li { margin-top: .2rem; }
.nk-highlights > summary { list-style: none; cursor: pointer; } .nk-highlights > summary::-webkit-details-marker { display: none; }
.nk-highlights[open] .nk-details-chev { transform: rotate(180deg); }
[data-nk-more-toggle] .nk-more-open, [data-nk-more-toggle][aria-expanded="true"] .nk-more-closed { display: none; }
[data-nk-more-toggle][aria-expanded="true"] .nk-more-open { display: inline; }

/* ---- Card header links + section titles ---- */
.nk-section-title { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 1rem; }
.nk-section-title h2 { font-size: 1.05rem; font-weight: 800; margin: 0; }
.nk-section-title p { margin: 0; color: var(--nb-muted); font-size: .85rem; }

/* ---- Mood: 7-day strip + mix bar ---- */
.nk-mood-strip { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; gap: .25rem; }
.nk-mood-strip__emoji { font-size: 1.35rem; line-height: 1.6rem; height: 1.6rem; }
.nk-mood-strip__day { font-size: .7rem; color: var(--nb-muted); }
.nk-mood-strip__day.is-today { color: var(--nb-navy-text); font-weight: 800; }
.nk-mood-bar { display: flex; height: .7rem; border-radius: 999px; overflow: hidden; background: var(--nb-surface-2); gap: 2px; }
.nk-mood-bar > span { width: calc(var(--w) * 1%); background: var(--c); }
.nk-mood-legend { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .8rem; color: var(--nb-muted); }
.nk-mood-legend i { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--c); margin-right: .3rem; }
.mood-great { --c: var(--nb-success); } .mood-good { --c: rgba(var(--nb-success-rgb), .6); } .mood-okay { --c: var(--nb-info); }
.mood-low { --c: var(--nb-warning); } .mood-sad { --c: var(--nb-orange); } .mood-sick { --c: var(--nb-berry); }
.mood-excited { --c: #22c55e; } .mood-calm { --c: #14b8a6; } .mood-tired { --c: #94a3b8; } .mood-bored { --c: #a8a29e; }
.mood-worried { --c: #eab308; } .mood-stressed { --c: #f97316; } .mood-scared { --c: #a855f7; } .mood-angry { --c: #ef4444; }
.mood-frustrated { --c: #f43f5e; } .mood-furious { --c: #b91c1c; } .mood-grumpy { --c: #fb923c; } .mood-lonely { --c: #6366f1; }
.mood-left_out { --c: #818cf8; } .mood-embarrassed { --c: #f472b6; } .mood-disappointed { --c: #64748b; } .mood-nervous { --c: #facc15; }
.mood-overwhelmed { --c: #c026d3; } .mood-hurt { --c: #dc2626; } .mood-jealous { --c: #65a30d; }
.nk-mood-cal__more { position: absolute; bottom: .1rem; right: .3rem; font-size: .6rem; font-weight: 700; color: var(--bs-secondary-color); }
/* Check-ins that day (2026-10: several a day): one dot each, bottom left. */
.nk-mood-cal__dots { position: absolute; bottom: .05rem; left: .3rem; font-size: .6rem; letter-spacing: .05rem; line-height: 1; color: var(--nb-info); }
@media (min-width: 768px) { .nk-mood-cal__day { min-height: 3.8rem; } .nk-mood-cal__emoji { font-size: 1.8rem; } }
/* Medicine month (Health & mood, 2026-10-18): one colour + symbol per day status (routines.dose_day_status). */
.nk-med-day { --med: var(--bs-secondary-color); --med-bg: transparent; background: var(--med-bg); color: var(--med); font: inherit; padding: 0; width: 100%; }
button.nk-med-day { cursor: pointer; }
button.nk-med-day:focus-visible { outline: 3px solid var(--bs-primary); outline-offset: 2px; }
button.nk-med-day[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--med); }
.nk-med-day.is-all { --med: var(--nb-success); --med-bg: rgba(var(--nb-success-rgb), .16); }
.nk-med-day.is-some { --med: var(--nb-warning); --med-bg: rgba(var(--nb-warning-rgb), .16); }
.nk-med-day.is-missed { --med: var(--nb-berry); --med-bg: rgba(var(--nb-berry-rgb), .14); }
.nk-med-day.is-skipped { --med: var(--bs-secondary-color); --med-bg: var(--bs-tertiary-bg); }
.nk-med-day.is-upcoming { --med: var(--nb-info); --med-bg: rgba(var(--nb-info-rgb), .1); }
.nk-med-day__sym { font-size: 1.15rem; font-weight: 700; line-height: 1; }
.nk-med-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--bs-secondary-color); }
.nk-med-legend li { display: inline-flex; align-items: center; gap: .35rem; }
.nk-med-legend .nk-med-day { display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; border-radius: .35rem; border: 1px solid var(--bs-border-color); font-weight: 700; font-size: .75rem; }
.nk-med-list { border: 1px solid var(--bs-border-color); border-radius: .6rem; padding: .75rem 1rem; margin-top: .5rem; }
.nk-med-badge { display: inline-block; border-radius: 999px; padding: .05rem .55rem; font-size: .75rem; font-weight: 600; background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.nk-med-badge.is-all, .nk-med-badge.is-taken { background: rgba(var(--nb-success-rgb), .16); color: var(--nb-success); }
.nk-med-badge.is-some { background: rgba(var(--nb-warning-rgb), .16); color: var(--nb-warning); }
.nk-med-badge.is-missed { background: rgba(var(--nb-berry-rgb), .14); color: var(--nb-berry); }
.nk-med-badge.is-upcoming { background: rgba(var(--nb-info-rgb), .1); color: var(--nb-info); }

/* ---- All kids chore board (dashboard/choreboard.py, 2026-10-30): one column per kid, symbol + words per cell ---- */
.nk-chore-board { --cb: var(--bs-secondary-color); --cb-bg: transparent; }
.nk-chore-board th, .nk-chore-board td { vertical-align: middle; }
.nk-chore-board .nk-cb-first { min-width: 10rem; max-width: 16rem; }
.nk-chore-board .nk-cb-kid { text-align: center; min-width: 5.5rem; }
.nk-chore-board .nk-cb-kid .avatar { display: inline-flex; margin-bottom: .2rem; }
.nk-chore-board .nk-cb-kid__name { display: block; font-size: .85rem; }
.nk-chore-board .nk-cb-group th { background: var(--bs-tertiary-bg); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--nb-muted); padding: .35rem .75rem; }
.nk-chore-board .nk-cb-cell { text-align: center; padding: .3rem .25rem; }
.nk-cb-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .05rem; min-width: 2.75rem; min-height: 2.75rem;
  padding: .25rem .5rem; border-radius: .5rem; border: 1px solid transparent; background: var(--cb-bg); color: var(--cb); font: inherit; font-size: .8rem; line-height: 1.15; text-decoration: none; }
button.nk-cb-btn { cursor: pointer; }
a.nk-cb-btn:hover, a.nk-cb-btn:focus-visible, button.nk-cb-btn:hover, button.nk-cb-btn:focus-visible { box-shadow: inset 0 0 0 2px var(--cb); color: var(--cb); }
.nk-cb-btn > span:first-child { font-size: 1.1rem; font-weight: 700; }
.nk-cb-txt { font-size: .72rem; }
.nk-chore-board .is-done, .nk-cb-legend .is-done { --cb: var(--nb-success); --cb-bg: rgba(var(--nb-success-rgb), .16); }
.nk-chore-board .is-finished, .nk-cb-legend .is-finished { --cb: var(--nb-success); --cb-bg: rgba(var(--nb-success-rgb), .07); }
.nk-chore-board .is-todo, .nk-cb-legend .is-todo { --cb: var(--nb-info); --cb-bg: rgba(var(--nb-info-rgb), .1); }
.nk-chore-board .is-todo .nk-cb-btn, .nk-cb-legend .is-todo .nk-cb-btn { border-style: dashed; border-color: currentColor; }
.nk-chore-board .is-turn_other, .nk-cb-legend .is-turn_other, .nk-chore-board .is-later, .nk-cb-legend .is-later { --cb: var(--bs-secondary-color); --cb-bg: var(--bs-tertiary-bg); }
.nk-chore-board .is-paused, .nk-cb-legend .is-paused, .nk-chore-board .is-none, .nk-cb-legend .is-none { --cb: var(--bs-secondary-color); --cb-bg: transparent; }
.nk-chore-board .is-paused .nk-cb-btn, .nk-chore-board .is-none .nk-cb-btn { opacity: .65; }
.nk-cb-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--bs-secondary-color); border-top: 1px solid var(--bs-border-color); }
.nk-cb-legend li { display: inline-flex; align-items: center; gap: .35rem; }
.nk-cb-legend .nk-cb-btn { min-width: 1.6rem; min-height: 1.6rem; padding: 0; border-radius: .35rem; font-size: .8rem; }
[data-bs-theme="dark"] .nk-chore-board .is-todo, [data-bs-theme="dark"] .nk-cb-legend .is-todo { --cb: #9ab8ff; }
[data-bs-theme="dark"] .nk-chore-board .is-done, [data-bs-theme="dark"] .nk-cb-legend .is-done, [data-bs-theme="dark"] .nk-chore-board .is-finished { --cb: #6fd49a; }
/* Per-kid list groups (Running today · Other days · Paused) and the row's status marker. */
.nk-group-head { background: var(--bs-tertiary-bg); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--nb-muted); padding: .4rem 1rem; }
.nk-state { font-weight: 600; }
.nk-state.is-today { color: var(--nb-success); }
.nk-state.is-later { color: var(--nb-info); }
.nk-state.is-paused { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .nk-state.is-today { color: #6fd49a; }
[data-bs-theme="dark"] .nk-state.is-later { color: #9ab8ff; }
.nk-chore-board .nk-cb-first .chip { white-space: normal; text-align: left; }
@media (max-width: 575.98px) {
  /* 390 px: the chore column + three kid columns fit without scrolling; more kids scroll with the chore name pinned. */
  .nk-chore-board .nk-cb-first { min-width: 6.5rem; max-width: 9rem; padding-left: .6rem; padding-right: .4rem; }
  .nk-chore-board .nk-cb-kid { min-width: 3.9rem; padding-left: .15rem; padding-right: .15rem; }
  .nk-chore-board .nk-cb-kid__name { font-size: .78rem; }
  .nk-chore-board .nk-cb-kid small { font-size: .65rem; }
  .nk-chore-board .nk-cb-cell { padding: .3rem .1rem; }
  .nk-cb-btn { min-width: 2.75rem; padding: .25rem .3rem; }
  .nk-chore-board .nk-cb-first .fw-semibold { font-size: .92rem; }
}

.nk-checkin-day { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--nb-muted);
  padding: .6rem 1rem .3rem; background: var(--nb-surface-2); }

/* ---- Small stat inside a card (Reports wellbeing, Health medicine) ---- */
.nk-mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: .5rem; }
.nk-mini-stat { background: var(--nb-surface-2); border-radius: .7rem; padding: .6rem .75rem; }
.nk-mini-stat b { display: block; font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--nb-ink); }
.nk-mini-stat span { font-size: .75rem; color: var(--nb-muted); }

/* ---- Family race page ---- */
.nk-goal { background: var(--nb-substrate); color: #fff; border: 0; }
.nk-goal .progress { background: rgba(255, 255, 255, .2); height: .9rem; }
.nk-goal .progress-bar { background: #fff; }
.nk-goal__reward { font-size: 1.6rem; line-height: 1; }
.nk-goal .small { color: rgba(255, 255, 255, .8); }
.nk-race-row { display: grid; grid-template-columns: 2rem auto minmax(0, 1fr) auto; gap: .5rem 1rem; align-items: center; }
.nk-race-row.is-leader { background: rgba(var(--nb-warning-rgb), .07); }
.nk-race-row__chips { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
@media (max-width: 575.98px) { .nk-race-row { grid-template-columns: 2rem auto minmax(0, 1fr); } .nk-race-row__chips { grid-column: 2 / -1; justify-content: flex-start; } }
.nk-howto li { display: flex; gap: .6rem; align-items: flex-start; }
.nk-howto li + li { margin-top: .6rem; }
.nk-howto li > span:first-child { font-size: 1.15rem; line-height: 1.4rem; }
.avatar.sm { width: 1.6rem; height: 1.6rem; font-size: .7rem; }

/* ---- Guardians & settings: tabs + member rows ---- */
.nk-tabs { flex-wrap: nowrap; overflow-x: auto; gap: .35rem; padding-bottom: .15rem; scrollbar-width: none;
  /* Fade at the right edge hints that more tabs scroll into view on phones. */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent); padding-right: 1.5rem; }
@media (min-width: 992px) { .nk-tabs { -webkit-mask-image: none; mask-image: none; padding-right: 0; } }
.nk-tabs::-webkit-scrollbar { display: none; }
.nk-tabs .nav-link { white-space: nowrap; background: var(--nb-surface); border: 1px solid var(--nb-line); }
.nk-tabs .nav-link.active { border-color: transparent; }
.nk-tabs .nav-link.active .badge.text-bg-light { background: rgba(255, 255, 255, .2) !important; color: #fff !important; }
.nk-member { display: grid; grid-template-columns: minmax(12rem, 1.1fr) minmax(0, 1.4fr) auto; gap: .5rem 1rem; align-items: center; padding-top: .85rem; padding-bottom: .85rem; }
.nk-member__who { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.nk-member__access { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.nk-member__actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
@media (max-width: 767.98px) {
  .nk-member { grid-template-columns: 1fr; }
  .nk-member__access { padding-left: 2.75rem; }
  .nk-member__actions { justify-content: flex-start; padding-left: 2.75rem; }
}
.nk-invite-panel { background: var(--nb-surface-2); border-bottom: 1px solid var(--nb-line); }

/* ---- Children cards ---- */
.nk-kid { overflow: hidden; }
.nk-kid.is-selected { box-shadow: 0 0 0 2px var(--nb-navy-btn), var(--nb-shadow-card); }
.nk-kid__band { height: .35rem; background: var(--kid, var(--nb-navy)); }
.nk-kid__now { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: .7rem; background: var(--nb-surface-2); min-height: 3rem; }
.nk-kid__facts li { display: flex; gap: .55rem; align-items: baseline; }
.nk-kid__facts li + li { margin-top: .3rem; }
.nk-kid__facts i { color: var(--nb-muted); width: 1rem; text-align: center; }
.nk-kid__links { display: flex; justify-content: space-between; gap: .25rem; flex-wrap: wrap; padding-top: .5rem; border-top: 1px solid var(--nb-line); }
.nk-kid__links a { color: var(--nb-muted); text-decoration: none; display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .3rem; border-radius: .4rem; }
.nk-kid__links a:hover { color: var(--nb-navy-text); background: var(--nb-navy-050); }
a.nk-mini-stat:hover { background: var(--nb-navy-050); }
.nk-kid-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; text-align: center; min-height: 14rem;
  border: 2px dashed var(--nb-line-2); background: transparent; box-shadow: none; color: var(--nb-ink); }
.nk-kid-add:hover { border-color: var(--nb-navy-btn); background: var(--nb-navy-050); }


/* ---- Apps page segmented control (was inline in apps.html) ---- */
.nk-app-seg { display: inline-flex; flex-wrap: wrap; padding: .15rem; gap: .15rem; border-radius: .6rem; background: var(--nb-surface-2); border: 1px solid var(--nb-line); }
.nk-app-seg button { border: 0; background: transparent; color: var(--nb-muted); font-size: .78rem; font-weight: 600; padding: .3rem .6rem; border-radius: .45rem; display: inline-flex; gap: .3rem; align-items: center; }
.nk-app-seg button:hover { color: var(--nb-navy-text); }
.nk-app-seg button[aria-pressed="true"] { background: var(--nb-surface); color: var(--nb-navy-text); box-shadow: var(--nb-shadow-card); }
.nk-app-seg button[aria-pressed="true"].is-blocked { color: var(--nb-danger); }
/* Always sits apart from the everyday three and needs a second tap (2026-10-22). */
.nk-app-access { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; }
.nk-app-always { border: 1px dashed var(--nb-line-2, var(--nb-line)); background: transparent; color: var(--nb-muted); font-size: .78rem; font-weight: 600;
  padding: .3rem .7rem; border-radius: .6rem; display: inline-flex; gap: .3rem; align-items: center; }
.nk-app-always:hover { color: var(--nb-success); border-color: var(--nb-success); }
.nk-app-always.is-on { border-style: solid; border-color: var(--nb-success); color: var(--nb-success); background: var(--nb-surface); }
.nk-app-always.is-armed { border-style: solid; border-color: var(--nb-warning); color: var(--nb-warning); background: var(--nb-surface); }
.nk-app-always__hint { flex-basis: 100%; font-size: .75rem; color: var(--nb-warning); }
.nk-app-seg button[aria-pressed="true"].is-ask { color: var(--nb-warning); }

/* ---- List row: text left, actions right; actions drop to their own line on phones ---- */
.nk-row { display: flex; align-items: center; gap: .5rem .85rem; flex-wrap: wrap; }
.nk-row__main { flex: 1 1 10rem; min-width: 0; display: flex; align-items: center; gap: .75rem; }
.nk-row__body { min-width: 0; flex: 1; }
.nk-row__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-left: auto; }
/* (Actions wrap under the text only when they don't fit beside it.) */

/* ---- Wide tables: keep the first column visible while scrolling sideways ---- */
.table-sticky-first th:first-child, .table-sticky-first td:first-child { position: sticky; left: 0; z-index: 1; background: var(--nb-surface); }
.nk-truncate { display: block; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Comparison cards (Devices › Add a device) ---- */
.nk-compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.nk-compare dl { margin: 0; }
.nk-compare dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--nb-muted); margin-top: .6rem; }
.nk-compare dd { margin: 0; font-size: .9rem; }
@media (max-width: 991.98px) { .nk-compare { grid-template-columns: 1fr; } }

/* ---- Phones (≤575): tighter cards, stacked page headers, nothing wider than the screen ---- */
@media (max-width: 575.98px) {
  .card { --bs-card-spacer-x: 1rem; --bs-card-spacer-y: 1rem; --bs-card-cap-padding-x: 1rem; }
  .card-header.d-flex { flex-wrap: wrap; row-gap: .35rem; }
  .row.g-4 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
  .page-header { flex-direction: column; align-items: stretch; gap: .75rem; margin-bottom: 1rem; }
  .page-header h1 { font-size: 1.2rem; }
  .page-header p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .page-header > div + div, .page-header > .d-flex { display: flex; flex-wrap: wrap; gap: .5rem; }
  .page-header .btn-group, .nk-full-xs { display: flex; width: 100%; }
  .page-header .btn-group > .btn, .nk-full-xs > .btn { flex: 1 1 0; white-space: nowrap; }
  .kpi__value { font-size: 1.25rem; }
  .status-hero .ring { margin-inline: auto; }
  .nk-mood-cal { gap: .2rem; }
  .nk-mood-cal__day { min-height: 2.6rem; }
  .nk-mood-cal__emoji { font-size: 1.1rem; }
  .nk-mood-cal__num { font-size: .55rem; }
  .nk-podium { gap: .35rem; }
  .nk-podium__col { width: auto; flex: 1 1 0; min-width: 0; }
  .nk-podium__col .fw-semibold { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .emergency-banner { flex-wrap: wrap; }
  .nk-pills-xs { display: flex; flex-wrap: wrap; gap: .35rem; }
  .nk-pills-xs > .btn { flex: 1 1 auto; border-radius: .5rem !important; margin: 0 !important; }
}

/* ---- Touch screens: bigger hit areas for small links and segmented buttons ---- */
@media (pointer: coarse) {
  a.chip { padding: .4rem .75rem; }
  .nk-kid__links a { padding: .45rem .5rem; }
  .nk-seg__btn, .nk-app-seg button, .nk-app-always { min-height: 2.25rem; }
  .nk-icon-btn { width: 2.75rem; height: 2.75rem; }
  .btn-link.p-0 { padding: .35rem !important; margin: -.35rem; }
}
@media (max-width: 575.98px) { .nb-auth__title { font-size: 1.5rem; } }
.nk-kid-name { max-width: 11rem; }
@media (max-width: 575.98px) { .nk-kid-name { max-width: none; flex: 1 1 100%; } }
/* Chart boxes: Chart.js needs a fixed-height parent (rem, no px in templates). */
.nk-chart-box { height: 17.5rem; }
.nk-chart-box--sm { height: 11.25rem; }
.nk-chart-box--md { height: 13.75rem; }
@media (max-width: 575.98px) { .nk-chart-doughnut { height: 21.25rem !important; } }
/* Legal pages (templates/legal/_layout.html): a readable column. */
.nk-legal-wrap { max-width: 52rem; }
/* Three small numbers in one row on phones (Websites page). */
@media (max-width: 575.98px) {
  .nk-kpis-compact .card-body { padding: .75rem; }
  .nk-kpis-compact .kpi__icon { display: none; }
  .nk-kpis-compact .kpi__label { font-size: .7rem; line-height: 1.2; }
}

/* ---- Child edit ---- */
.nk-kid-hero { border-top: .35rem solid var(--kid, var(--nb-navy)); }
.nk-kid-hero__avatar { width: 4rem; height: 4rem; font-size: 1.8rem; }
.nk-kid-hero .nk-kid__links { justify-content: flex-start; gap: .75rem; flex-wrap: wrap; }
.nk-avatar-details { border-top: 1px solid var(--nb-line); padding-top: .75rem; margin-top: .25rem; }
.nk-avatar-details > summary { list-style: none; cursor: pointer; }
.nk-avatar-details > summary::-webkit-details-marker { display: none; }
.nk-avatar-details[open] > summary .bi-chevron-down { transform: rotate(180deg); }
.nk-pin-input { letter-spacing: .5em; font-size: 1.15rem; text-align: center; }
.nk-savebar { display: flex; justify-content: flex-end; gap: .5rem; }
@media (max-width: 991.98px) {
  /* Phones/tablets: the save button stays reachable above the bottom bar while scrolling the form. */
  .nk-savebar { position: sticky; bottom: calc(var(--nb-bottombar-h) + .75rem + env(safe-area-inset-bottom)); z-index: 5;
    padding: .6rem; border-radius: var(--nb-radius); background: var(--nb-surface); box-shadow: var(--nb-shadow-lg); }
  .nk-savebar .btn { flex: 1 1 0; }
  body.nk-bar-hidden .nk-savebar { bottom: calc(.75rem + env(safe-area-inset-bottom)); }
  /* room under the last field, so the bar never has to sit on top of it at the end of the page */
  form:has(> .nk-savebar), form:has(> * > .nk-savebar) { padding-bottom: calc(var(--nb-bottombar-h) + 1.5rem); }
}
.text-indigo { color: var(--nb-indigo) !important; }

/* ── Medicine page (2026-10): times editor, adherence grid, "Every dose" disclosure ── */
.nk-time-row { width: auto; flex: 0 0 auto; }
.nk-time-row input[type=time] { min-width: 7.5rem; }
.nk-dose {
  display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; margin: .1rem;
  border-radius: 50%; font-size: .8rem; font-weight: 800; line-height: 1;
  background: rgba(var(--nb-secondary-rgb, 91, 107, 138), .14); color: var(--nb-muted);
}
.nk-dose--taken { background: rgba(var(--nb-success-rgb), .16); color: var(--nb-success); }
.nk-dose--missed { background: rgba(var(--nb-berry-rgb), .14); color: var(--nb-berry); }
.nk-dose--upcoming { background: rgba(var(--nb-info-rgb, 29, 78, 216), .1); color: var(--nb-info); }
.nk-med-grid th, .nk-med-grid td { padding: .6rem .5rem; }
.nk-med-grid thead th { font-size: .8rem; }
.nk-med-grid__today { background: rgba(var(--nb-navy-rgb), .04); }
.nk-details > summary { list-style: none; cursor: pointer; }
.nk-details > summary::-webkit-details-marker { display: none; }
.nk-details[open] > summary .bi-chevron-down { transform: rotate(180deg); }
.nk-details > summary .bi-chevron-down { transition: transform .2s; }

/* ── My account: header card ── */
.nk-account-hero .avatar.lg { width: 3.5rem; height: 3.5rem; font-size: 1.4rem; }
.min-w-0 { min-width: 0; }

/* ── Pets page ── */
.el-fire  { --pet-rgb: 234, 88, 12; }
.el-water { --pet-rgb: 37, 99, 235; }
.el-leaf  { --pet-rgb: 26, 138, 74; }
.el-air   { --pet-rgb: 14, 165, 233; }
.el-earth { --pet-rgb: 146, 98, 52; }
.el-magic { --pet-rgb: 147, 51, 234; }
.nk-pet-hero__top { display: flex; gap: 1.5rem; align-items: center; }
.nk-pet-hero__body { flex: 1; min-width: 0; }
.nk-pet-avatar {
  flex: 0 0 auto; width: 9rem; height: 9rem; border-radius: 50%; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(var(--pet-rgb, var(--nb-navy-rgb)), .22), rgba(var(--pet-rgb, var(--nb-navy-rgb)), .06) 70%);
  box-shadow: inset 0 0 0 1px rgba(var(--pet-rgb, var(--nb-navy-rgb)), .18);
}
.nk-pet-avatar__emoji { font-size: 4.5rem; line-height: 1; }
.nk-pet-avatar__stage {
  position: absolute; bottom: -.6rem; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: .2rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: var(--nb-surface); color: var(--nb-ink); border: 1px solid var(--nb-line); box-shadow: var(--nb-shadow-card);
}
.nk-pet-bubble {
  position: relative; display: inline-block; max-width: 100%; margin-bottom: 1rem; padding: .6rem .9rem;
  border-radius: 1rem 1rem 1rem .25rem; background: var(--nb-surface-2); font-style: italic; color: var(--nb-ink);
}
.nk-pet-bubble__mood { margin-left: .5rem; font-style: normal; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--nb-muted); }
.nk-pet-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.nk-pet-stats .kpi { padding: .65rem .85rem; border-radius: .85rem; background: var(--nb-surface-2); gap: .1rem; }
.nk-pet-stats .kpi__value { font-size: 1.35rem; }
.nk-pet-stats .kpi__value small { font-size: .85rem; font-weight: 600; color: var(--nb-muted); }
.nk-stage-steps { list-style: none; display: flex; margin: 1.75rem 0 .75rem; padding: 0; }
.nk-stage-steps li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; position: relative; min-width: 0; }
.nk-stage-steps li + li::before {
  content: ""; position: absolute; top: 1.1rem; right: 50%; width: 100%; height: 3px; transform: translateY(-50%);
  background: var(--nb-line); z-index: 0;
}
.nk-stage-steps li.is-done + li::before, .nk-stage-steps li.is-done + li.is-current::before { background: var(--nb-success); }
.nk-stage-steps__dot {
  position: relative; z-index: 1; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; background: var(--nb-surface-2); border: 2px solid var(--nb-line); filter: grayscale(1); opacity: .55;
}
.nk-stage-steps__label { font-size: .72rem; font-weight: 600; color: var(--nb-muted); }
.nk-stage-steps li.is-done .nk-stage-steps__dot { background: rgba(var(--nb-success-rgb), .12); border-color: var(--nb-success); filter: none; opacity: 1; }
.nk-stage-steps li.is-current .nk-stage-steps__dot { width: 2.6rem; height: 2.6rem; margin-top: -.2rem; background: var(--nb-surface); border-color: var(--nb-success); box-shadow: 0 0 0 4px rgba(var(--nb-success-rgb), .18); filter: none; opacity: 1; }
.nk-stage-steps li.is-current .nk-stage-steps__label { color: var(--nb-ink); font-weight: 800; }
.nk-stage-steps li.is-next .nk-stage-steps__dot { opacity: .85; filter: grayscale(.4); border-style: dashed; }
.nk-stage-progress .progress { height: .5rem; }
.nk-pet-empty { display: flex; align-items: center; gap: 1.25rem; }
.nk-pet-empty .nk-pet-avatar { width: 6rem; height: 6rem; }
.nk-pet-empty .nk-pet-avatar__emoji { font-size: 3rem; }
.nk-pet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .75rem; }
.nk-pet-tile {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; padding: .9rem .6rem;
  border-radius: .9rem; border: 1px solid var(--nb-line); background: var(--nb-surface); min-height: 7.5rem;
}
.nk-pet-tile__emoji { font-size: 2.2rem; line-height: 1.1; margin-bottom: .2rem; }
.nk-pet-tile__name { font-weight: 700; font-size: .9rem; color: var(--nb-ink); }
.nk-pet-tile__meta { font-size: .72rem; color: var(--nb-muted); line-height: 1.3; }
.nk-pet-tile__progress { margin-top: .25rem; padding: .1rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 600; background: var(--nb-surface); color: var(--nb-muted); border: 1px solid var(--nb-line); }
.nk-pet-tile.is-locked { background: var(--nb-surface-2); border-style: dashed; }
.nk-pet-tile.is-locked .nk-pet-tile__emoji { filter: grayscale(1); opacity: .4; }
.nk-pet-tile.is-locked .nk-pet-tile__name { color: var(--nb-muted); }
.nk-pet-tile.is-active { border-color: var(--nb-success); box-shadow: 0 0 0 3px rgba(var(--nb-success-rgb), .15); }
.nk-list__item { padding: .7rem 0; }
.nk-list__item + .nk-list__item { border-top: 1px solid var(--nb-line); }
.nk-how { padding-left: 1.1rem; margin: 0; font-size: .875rem; color: var(--nb-ink); }
.nk-how li + li { margin-top: .35rem; }
@media (max-width: 767.98px) {
  .nk-pet-hero__top { flex-direction: column; text-align: center; gap: 1.25rem; }
  .nk-pet-hero__body .d-flex { justify-content: center; }
  .nk-pet-avatar { width: 7rem; height: 7rem; }
  .nk-pet-avatar__emoji { font-size: 3.5rem; }
  .nk-pet-stats { gap: .5rem; text-align: left; }
  .nk-pet-stats .kpi { padding: .5rem .6rem; }
  .nk-pet-stats .kpi__value { font-size: 1.1rem; }
  .nk-stage-steps__label { font-size: .62rem; }
  .nk-stage-steps__dot { width: 1.9rem; height: 1.9rem; font-size: .9rem; }
  .nk-stage-steps li.is-current .nk-stage-steps__dot { width: 2.2rem; height: 2.2rem; }
  .nk-stage-steps li + li::before { top: .95rem; }
  .nk-pet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Card navigation (dashboard/navigation.py): hubs, Overview "Go to", phone "More" sheet, finder ---------- */
/* Skip link: first Tab stop on every app page. */
.nk-skip { position: fixed; top: .5rem; left: .5rem; z-index: 2000; padding: .6rem 1rem; border-radius: .625rem;
  background: var(--nb-navy); color: #fff; font-weight: 600; text-decoration: none; box-shadow: var(--nb-shadow-lg); }
.nk-content:focus { outline: none; }

/* Sidebar group toggles are <button>s now (aria-expanded + aria-controls). */
button.nk-menu__link { width: 100%; background: none; border: 0; text-align: left; font-family: inherit; cursor: pointer; }
button.nk-menu__toggle .nk-menu__badge { margin-right: 1.25rem; }

/* Live count pill (badges follow the 60 s poll through [data-nk-count]). */
.nk-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .45rem;
  border-radius: 999px; background: var(--nb-berry); color: #fff; font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Hub cards: the whole card is one link. */
.nk-nav-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .nk-nav-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .nk-nav-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.nk-nav-cards > li { display: flex; }
.nk-nav-card { flex: 1; display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem; min-height: 7.5rem;
  background: var(--nb-surface); border: 1px solid var(--nb-card-border); border-radius: var(--nb-radius); box-shadow: var(--nb-shadow-card);
  color: var(--nb-ink); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.nk-nav-card:hover { transform: translateY(-2px); box-shadow: var(--nb-shadow-lg); border-color: rgba(var(--nb-navy-rgb), .35); color: var(--nb-ink); }
.nk-nav-card:focus-visible { outline: 3px solid var(--nb-navy-text); outline-offset: 3px; }
.nk-nav-card[aria-current="page"] { border-color: var(--nb-navy-text); }
.nk-nav-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.nk-nav-card__title { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.nk-nav-card__text { color: var(--nb-muted); font-size: .9rem; line-height: 1.45; }
.nk-nav-card__fact { margin-top: auto; padding-top: .35rem; font-size: .85rem; font-weight: 600; color: var(--nb-navy-text); }
.nk-nav-card__go { align-self: center; color: var(--nb-muted); font-size: 1.1rem; }
.nk-nav-card:hover .nk-nav-card__go { color: var(--nb-navy-text); }

/* Home "Go to": small square cards. */
.nk-quick-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Phones: compact centred tiles, 3 across, so the child's live status stays near the top. */
@media (max-width: 575.98px) {
  .nk-quick-grid .nk-quick-card { align-items: center; text-align: center; gap: .35rem; min-height: 4.5rem; padding: .6rem .35rem; }
  .nk-quick-grid .icon-badge { width: 2rem; height: 2rem; font-size: .95rem; }
  .nk-quick-grid .nk-quick-card__label { font-size: .8rem; }
  .nk-quick-grid .nk-quick-card .nk-count { top: .35rem; right: .35rem; min-width: 1.3rem; height: 1.3rem; font-size: .7rem; }
}
@media (min-width: 576px) { .nk-quick-grid { gap: .75rem; } }
@media (min-width: 768px) { .nk-quick-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .nk-quick-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); } }
.nk-quick-grid > li { display: flex; }
.nk-quick-card { position: relative; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; min-height: 5.5rem;
  padding: .9rem; background: var(--nb-surface); border: 1px solid var(--nb-card-border); border-radius: var(--nb-radius);
  box-shadow: var(--nb-shadow-card); color: var(--nb-ink); text-decoration: none; font: inherit; text-align: left;
  transition: transform .15s ease, box-shadow .15s ease; }
.nk-quick-card:hover { transform: translateY(-2px); box-shadow: var(--nb-shadow-lg); color: var(--nb-ink); }
.nk-quick-card__label { font-weight: 700; font-size: .92rem; line-height: 1.25; }
.nk-quick-card .nk-count { position: absolute; top: .7rem; right: .7rem; }

/* Breadcrumb: Section › page */
.nk-crumb ol { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .88rem; }
.nk-crumb li + li::before { content: "\f285"; font-family: bootstrap-icons; font-size: .7rem; color: var(--nb-muted); margin-right: .35rem; }
.nk-crumb a { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem 0; color: var(--nb-navy-text); text-decoration: none; font-weight: 600; }
.nk-crumb a:hover { text-decoration: underline; }
.nk-crumb [aria-current] { color: var(--nb-muted); }

/* Topbar "Find a page" button */
.nk-find-btn { display: inline-flex; align-items: center; gap: .5rem; height: 2.4rem; min-width: 2.4rem; justify-content: center; padding: 0 .65rem;
  border: 1px solid var(--nb-line); border-radius: 999px; background: var(--nb-surface-2); color: var(--nb-muted); font-size: .88rem; }
.nk-find-btn:hover { color: var(--nb-navy-text); border-color: rgba(var(--nb-navy-rgb), .35); }
.nk-find-btn i { font-size: 1rem; }
.nk-find-btn kbd, .nk-finder kbd { background: var(--nb-surface); color: var(--nb-muted); border: 1px solid var(--nb-line); font-size: .7rem; padding: .05rem .35rem; }
@media (min-width: 1200px) { .nk-find-btn { padding: 0 .5rem 0 .85rem; min-width: 13rem; justify-content: flex-start; } .nk-find-btn kbd { margin-left: auto; } }

/* Finder dialog */
.nk-finder .modal-header { padding: .75rem 1rem; }
.nk-finder .modal-header input { font-size: 1.05rem; }
.nk-finder__list { list-style: none; margin: 0; padding: 0; }
.nk-finder__list a { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; min-height: 2.75rem; border-radius: .625rem;
  color: var(--nb-ink); text-decoration: none; }
.nk-finder__list a small { margin-left: auto; color: var(--nb-muted); }
.nk-finder__group { padding: .75rem .75rem .25rem; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--nb-muted); }
.nk-finder__group:first-child { padding-top: .25rem; }
.nk-finder__list [aria-selected="true"] a, .nk-finder__list a:hover { background: var(--nb-navy-050); color: var(--nb-navy-text); }

/* Phone "More" sheet */
.nk-more-sheet.offcanvas-bottom { height: auto; max-height: 88vh; border-radius: 1.25rem 1.25rem 0 0; background: var(--nb-canvas); }
.nk-more-sheet .offcanvas-body { padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
.nk-more-search { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: .5rem; padding: .25rem 0 .75rem; background: var(--nb-canvas); }
.nk-more-search i { position: absolute; left: .85rem; color: var(--nb-muted); }
.nk-more-search input { padding-left: 2.4rem; min-height: 2.75rem; border-radius: 999px; }
.nk-more-section { margin-bottom: 1rem; }
.nk-more-section__title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--nb-muted); margin: .5rem 0 .5rem; }
.nk-more-section__title a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .25rem; padding: .35rem 0; }
.nk-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 576px) { .nk-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.nk-tiles > li { display: flex; }
.nk-tile { flex: 1; display: flex; align-items: center; gap: .6rem; min-height: 3.5rem; padding: .6rem .7rem; background: var(--nb-surface);
  border: 1px solid var(--nb-card-border); border-radius: .875rem; color: var(--nb-ink); text-decoration: none; font-weight: 600; font-size: .9rem; line-height: 1.25; }
.nk-tile[aria-current="page"] { border-color: var(--nb-navy-text); background: var(--nb-navy-050); color: var(--nb-navy-text); }
.nk-tile__label { flex: 1; min-width: 0; }
.nk-more-foot { border-top: 1px solid var(--nb-line); padding-top: 1rem; margin-top: .5rem; }

/* Touch screens: 44 px targets in the menu too. */
@media (pointer: coarse) {
  .nk-menu__link { min-height: 2.75rem; }
  .nk-find-btn { height: 2.75rem; min-width: 2.75rem; }
}

/* ── Checkbox lists (classes, roles, care rotas) ───────────────────────────── */
.nk-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .15rem 1rem; }

/* ── Kid portal (/me/) ─────────────────────────────────────────────────────── */
.nk-kid-portal { background: var(--nb-canvas); }
.nk-kidbar { background: linear-gradient(135deg, var(--nb-navy), color-mix(in srgb, var(--kid, var(--nb-navy)) 55%, var(--nb-navy))); color: #fff; }
.nk-kidbar .h4, .nk-kidbar .small { color: #fff; }
.nk-kidbar .avatar.lg { width: 3.5rem; height: 3.5rem; font-size: 1.75rem; border: 2px solid rgba(255, 255, 255, .5); }
.nk-kidtabs { display: flex; gap: .35rem; list-style: none; margin: 0; padding: 0 0 .75rem; flex-wrap: nowrap; overflow-x: auto; }
.nk-kidstat { display: block; background: var(--nb-surface); border: 1px solid var(--nb-card-border); border-radius: 1rem; padding: .9rem 1rem; height: 100%; }
.nk-kidstat b { display: block; font-size: 1.5rem; font-weight: 800; color: var(--nb-ink); font-variant-numeric: tabular-nums; }
.nk-kidstat span { font-size: .8rem; color: var(--nb-muted); }
.nk-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .75rem; }
.nk-pick { width: 100%; display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .9rem .5rem; border: 1px solid var(--nb-card-border);
  border-radius: 1rem; background: var(--nb-surface); color: var(--nb-ink); min-height: 44px; }
.nk-pick:hover, .nk-pick:focus-visible { border-color: var(--nb-navy); box-shadow: var(--nb-shadow-card); }
.nk-pet-big { line-height: 1; min-width: 4rem; text-align: center; }
.nk-race-me { background: var(--nb-navy-050); }
[data-bs-theme="dark"] .nk-race-me { background: rgba(var(--nb-navy-rgb), .35); }
.nk-kid-portal .btn-lg { min-height: 44px; }

/* ── Ask about Nibbles (care chat) ─────────────────────────────────────────── */
.nk-chat { display: flex; flex-direction: column; gap: .6rem; }
.nk-chat__msg { max-width: 85%; }
.nk-chat__msg--user { align-self: flex-end; text-align: right; }
.nk-chat__bubble { display: inline-block; text-align: left; padding: .6rem .85rem; border-radius: 1rem; background: var(--nb-surface-2); }
.nk-chat__msg--user .nk-chat__bubble { background: var(--nb-navy); color: #fff; border-bottom-right-radius: .25rem; }
.nk-chat__msg--assistant .nk-chat__bubble { border-bottom-left-radius: .25rem; }
.nk-chat__msg.is-refused .nk-chat__bubble { background: var(--nb-berry-050); }
[data-bs-theme="dark"] .nk-chat__msg.is-refused .nk-chat__bubble { background: rgba(var(--nb-berry-rgb), .25); }
.nk-chat__meta { font-size: .72rem; color: var(--nb-muted); margin-top: .15rem; }

/* ── Home page blocks ─────────────────────────────────────────────────────── */
.nk-home-setup { background: var(--nb-surface); border: 1px solid var(--nb-card-border); border-radius: 1rem; padding: .85rem 1rem; }
.nk-need:hover { background: var(--nb-surface-2); }

/* ── Tree of life & lineage ────────────────────────────────────────────────── */
/* Lineage card: a staircase from kingdom down to the species, each step indented a little more, joined by a line. */
.nk-lineage__crumbs { margin: 0 0 .75rem; gap: .35rem; align-items: center; flex-wrap: wrap; font-size: .85rem; font-weight: 600; color: var(--nb-muted); }
.nk-lineage__crumbs i { font-size: .65rem; }
.nk-lineage__crumbs span:first-child { color: var(--nb-ink); }
.nk-lineage { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.nk-lineage__step { position: relative; display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: .5rem; align-items: start; padding: .3rem 0 .3rem calc(var(--i) * .55rem); }
.nk-lineage__step::before { content: ""; position: absolute; left: calc(5.2rem + .5rem + var(--i) * .55rem + 1.05rem); top: 2.1rem; bottom: -.4rem; width: 2px; background: var(--nb-line-2); }
.nk-lineage__step:last-child::before { display: none; }
.nk-lineage__rank { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: color-mix(in srgb, var(--nb-ink) 70%, transparent); padding-top: .55rem; }
.nk-lineage__node { min-width: 0; }
.nk-lineage__chip { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.2rem; padding: .25rem .75rem .25rem .5rem; border-radius: 999px; background: var(--nb-surface-2);
  border: 1px solid var(--nb-line); color: var(--nb-ink); font-weight: 600; font-size: .98rem; text-decoration: none; max-width: 100%; }
a.nk-lineage__chip:hover { border-color: var(--nb-navy-text); color: var(--nb-navy-text); }
.nk-lineage__emoji { font-size: 1.15rem; line-height: 1; }
.nk-lineage__line { font-size: .85rem; color: var(--nb-muted); margin: .15rem 0 .1rem .35rem; line-height: 1.35; }
.nk-lineage__chip--species { background: rgba(var(--nb-success-rgb), .12); border-color: rgba(var(--nb-success-rgb), .5); font-size: 1.08rem; font-weight: 700; padding: .3rem .9rem .3rem .3rem; }
.nk-lineage__chip--species img { flex: 0 0 40px; }
.nk-lineage__step.is-species { padding-top: .5rem; }
.nk-lineage__rel { text-decoration: none; }
@media (max-width: 575.98px) {
  .nk-lineage__step { grid-template-columns: 1fr; gap: .1rem; padding-left: calc(var(--i) * .5rem); }
  .nk-lineage__step::before { left: calc(var(--i) * .5rem + 1.05rem); top: 2.9rem; }
  .nk-lineage__rank { padding-top: 0; font-size: .66rem; }
  .nk-lineage--long:not(.is-open) .nk-lineage__line { display: none; }
}
@media (min-width: 576px) { [data-nk-lineage-more] { display: none; } }
.nk-tree__node { margin: .2rem 0; }
.nk-tree__node > summary { cursor: pointer; padding: .3rem .4rem; border-radius: .5rem; }
.nk-tree__node > summary:hover { background: var(--nb-surface-2); }
.nk-tree__rank { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--nb-muted); margin-right: .25rem; }
.nk-tree__children { margin-left: 1.1rem; border-left: 2px solid var(--nb-line); padding-left: .6rem; }
.nk-tree__species { display: flex; align-items: center; gap: .5rem; padding: .3rem .4rem; border-radius: .5rem; }
.nk-tree__species.is-mine { background: var(--nb-navy-050); }
[data-bs-theme="dark"] .nk-tree__species.is-mine { background: rgba(var(--nb-navy-rgb), .35); }

/* ── Pets & plants cards + species picker ──────────────────────────────────── */
.nk-care-cards { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1.5rem; }
@media (min-width: 576px) { .nk-care-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .nk-care-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .nk-care-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.nk-care-card { display: flex; flex-direction: column; }
.nk-care-card__top { display: flex; align-items: center; gap: .75rem; padding: 1rem 1rem .5rem; color: inherit; text-decoration: none; }
.nk-care-card__top:hover .nk-care-card__name { color: var(--nb-navy); }
.nk-care-card__pic { flex: 0 0 56px; width: 56px; height: 56px; display: grid; place-items: center; }
.nk-care-card__body { flex: 1 1 auto; min-width: 0; }
.nk-care-card__name { display: block; font-weight: 700; font-size: 1.05rem; }
.nk-care-card__chips { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .2rem; }
.nk-care-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: 0 1rem .75rem; min-height: 1.5rem; }
.nk-care-card__jobs { border-top: 1px solid var(--nb-line); }
.nk-care-card__jobs > summary { cursor: pointer; padding: .55rem 1rem; font-weight: 600; font-size: .9rem; }
.nk-care-card__jobs .list-group-item { padding-left: 1rem; padding-right: 1rem; }
.nk-ring { --p: 0; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700;
  background: conic-gradient(var(--nb-navy) calc(var(--p) * 1%), var(--nb-line) 0); }
.nk-ring > span { width: 38px; height: 38px; border-radius: 50%; background: var(--bs-card-bg, #fff); display: grid; place-items: center; }
.nk-ring.is-done { background: var(--bs-success); }
.nk-species-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: .25rem; }
.nk-species-tile { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .5rem .25rem; border: 2px solid var(--nb-line); border-radius: .75rem;
  background: var(--bs-card-bg, #fff); font-size: .78rem; line-height: 1.15; text-align: center; color: inherit; cursor: pointer; }
.nk-species-tile:hover { border-color: var(--nb-navy); }
.nk-species-tile.is-picked { border-color: var(--nb-navy); background: var(--nb-navy-050); font-weight: 700; }
[data-bs-theme="dark"] .nk-species-tile.is-picked { background: rgba(var(--nb-navy-rgb), .35); }
.nk-species-tile img { border-radius: 50%; }
.chip-lg { padding: .45rem .8rem; font-size: .9rem; }

/* ── Species picker groups, info cards, drawn tree of life ─────────────────── */
.nk-species-group { margin-bottom: .75rem; }
.nk-species-group__title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--nb-muted); margin: .5rem 0 .5rem; }
@media (max-width: 575.98px) { .nk-species-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nk-species-cell { position: relative; display: flex; }
.nk-species-cell > .nk-species-tile { flex: 1 1 auto; justify-content: flex-start; padding: .75rem .5rem .6rem; min-height: 9.5rem; }
.nk-species-tile__emoji { font-size: 2.2rem; line-height: 56px; }
.nk-species-tile__name { font-size: .9rem; font-weight: 600; }
.nk-species-tile__count { font-size: .7rem; font-weight: 600; color: var(--nb-navy); background: var(--nb-navy-050); border-radius: 999px; padding: .05rem .5rem; margin-top: auto; }
[data-bs-theme="dark"] .nk-species-tile__count { color: #c9d4ff; background: rgba(var(--nb-navy-rgb), .35); }
.nk-species-tile__blurb { font-size: .72rem; color: var(--nb-muted); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nk-species-tile__dot { position: absolute; top: .35rem; left: .5rem; color: var(--bs-success); font-size: .7rem; }
.nk-species-tile.is-mine { border-style: dashed; }
.nk-species-tile__info { position: absolute; top: .3rem; right: .3rem; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--nb-line); background: var(--nb-surface-2, #f1f4f9); color: var(--nb-navy); border-radius: 50%; font-size: 1.05rem; line-height: 1; z-index: 1; }
.nk-species-tile__info:hover, .nk-species-tile__info:focus-visible, .nk-species-tile__info[aria-expanded="true"] { background: var(--nb-navy); color: #fff; border-color: var(--nb-navy); }
@media (pointer: coarse) { .nk-species-tile__info { width: 44px; height: 44px; top: .15rem; right: .15rem; } }
.nk-species-pop { --bs-popover-max-width: 340px; }
.nk-species-card { display: flex; gap: .6rem; align-items: flex-start; position: relative; padding-right: 1.25rem; }
.nk-species-card__close { position: absolute; top: -.2rem; right: -.35rem; }
.nk-species-card img { flex: 0 0 56px; }
.nk-relative { display: flex; align-items: center; gap: .6rem; padding: .35rem .4rem; border-radius: .6rem; color: inherit; text-decoration: none; }
.nk-relative:hover { background: var(--nb-surface-2); }
.nk-care-cards--mini { grid-template-columns: 1fr; gap: .25rem; margin-bottom: 0; }
/* the drawn tree */
.nk-tree-stage { position: relative; height: min(72vh, 640px); min-height: 380px; border: 1px solid var(--nb-line); border-radius: 1rem; overflow: hidden;
  background: linear-gradient(180deg, #eaf3ff 0%, #f6fbf3 55%, #e2f0d6 100%); }
[data-bs-theme="dark"] .nk-tree-stage { background: linear-gradient(180deg, #121a2e 0%, #15231a 100%); }
.nk-tree-svg { width: 100%; height: 100%; touch-action: none; cursor: grab; display: block; }
.nk-tree-svg:active { cursor: grabbing; }
/* fingers: the page scrolls first (one finger), the tree moves with two — unless the kid turned on 🖐️ Move (nk-tree.js
   adds .is-touch-move and remembers it) */
@media (pointer: coarse) {
  .nk-tree-svg { touch-action: pan-y; }
  .nk-tree-wrap.is-touch-move .nk-tree-svg { touch-action: none; }
}
.nk-leaf__hit { fill: transparent; stroke: none; pointer-events: all; }
.nk-tree-pop { position: absolute; z-index: 5; background: var(--bs-card-bg, #fff); border: 1px solid var(--nb-line); border-radius: .75rem; box-shadow: var(--nb-shadow, 0 8px 24px rgba(0,0,0,.12)); padding: .75rem; width: 300px; max-width: calc(100% - 16px); }
.nk-tree-legend { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.nk-tree-key { display: inline-block; width: 1.6rem; height: .5rem; border-radius: .25rem; vertical-align: middle; margin-right: .3rem; background: #9aa3ad; }
.nk-tree-key.is-own { background: #3b8d3b; } .nk-tree-key.is-unlocked { background: #d9a400; } .nk-tree-key.is-locked { background: repeating-linear-gradient(90deg, #b5bcc4 0 4px, transparent 4px 7px); }
.nk-branch { stroke: #8b6b4a; opacity: .95; }
.nk-branch.is-own { stroke: #3b8d3b; } .nk-branch.is-unlocked { stroke: #d9a400; }
.nk-branch.is-locked { stroke: #b5bcc4; stroke-dasharray: 6 7; }
.nk-branch.is-leafstem { opacity: .8; }
.nk-tnode, .nk-leaf { cursor: pointer; outline: none; }
.nk-tnode:focus-visible .nk-tnode__disc, .nk-leaf:focus-visible .nk-leaf__ring { stroke: var(--nb-navy); stroke-width: 3; }
.nk-tnode__disc { fill: #fff; stroke: #8b6b4a; stroke-width: 3; }
.nk-tnode.is-own .nk-tnode__disc { stroke: #3b8d3b; fill: #eaf7e6; } .nk-tnode.is-unlocked .nk-tnode__disc { stroke: #d9a400; fill: #fff8df; }
.nk-tnode.is-locked .nk-tnode__disc { stroke: #b5bcc4; fill: #f3f5f7; stroke-dasharray: 4 4; }
.nk-tnode.is-collapsed .nk-tnode__disc { stroke-width: 4; }
.nk-tnode__label { font: 700 13px var(--bs-body-font-family, sans-serif); fill: var(--bs-body-color, #223); }
.nk-tnode__sub { font: 11px var(--bs-body-font-family, sans-serif); fill: var(--nb-muted, #667); }
.nk-tnode__emoji { pointer-events: none; }
.nk-leaf__ring { fill: #fff; stroke: #3b8d3b; stroke-width: 3; }
.nk-leaf.is-unlocked .nk-leaf__ring { stroke: #d9a400; } .nk-leaf.is-locked .nk-leaf__ring { stroke: #b5bcc4; stroke-dasharray: 3 3; fill: #f3f5f7; }
.nk-leaf.is-locked image, .nk-leaf.is-locked .nk-leaf__emoji { filter: grayscale(1); opacity: .45; }
.nk-leaf__emoji { font-size: 26px; }
.nk-leaf__lock { font-size: 13px; }
.nk-leaf__label { font: 600 12px var(--bs-body-font-family, sans-serif); fill: var(--bs-body-color, #223); }
.nk-leaf__owners { font: 700 11px var(--bs-body-font-family, sans-serif); fill: #3b8d3b; }
[data-bs-theme="dark"] .nk-tnode__disc, [data-bs-theme="dark"] .nk-leaf__ring { fill: #1d2435; }
[data-bs-theme="dark"] .nk-tnode__label, [data-bs-theme="dark"] .nk-leaf__label { fill: #e8ecf4; }
.nk-tree-hit { fill: transparent; }
.nk-tnode__info { cursor: pointer; outline: none; }
.nk-tnode__info circle { fill: var(--nb-navy, #13348B); stroke: #fff; stroke-width: 2; }
.nk-tnode__info .nk-tnode__info-hit { fill: transparent; stroke: none; }
.nk-tnode__info text { font: italic 700 12px Georgia, serif; fill: #fff; pointer-events: none; }
.nk-tnode__info:hover circle:not(.nk-tnode__info-hit), .nk-tnode__info:focus-visible circle:not(.nk-tnode__info-hit) { fill: #0b2266; }
.nk-variety-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.nk-variety-card { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem; border: 1px solid var(--nb-line); border-radius: .9rem; background: var(--bs-card-bg, #fff); scroll-margin-top: 5rem; }
.nk-variety-card.is-own { border-color: #3b8d3b; }
.nk-variety-card:target { box-shadow: 0 0 0 3px var(--nb-navy); }
.nk-variety-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; padding: 2px; }
.nk-variety-search { grid-column: 1 / -1; max-width: 22rem; }
@media (max-width: 575.98px) { .nk-variety-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nk-variety-chip { display: flex; align-items: center; gap: .55rem; min-height: 56px; padding: .35rem .7rem .35rem .4rem; border-radius: .9rem; text-align: left; line-height: 1.2;
  border: 1px solid var(--nb-line); background: var(--bs-body-bg); color: inherit; font-size: .9rem; }
.nk-variety-chip img { border-radius: 50%; }
.nk-variety-chip__q { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; background: var(--nb-surface-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.nk-variety-chip.is-picked { border-color: var(--nb-navy); box-shadow: 0 0 0 2px var(--nb-navy) inset; }
.nk-variety-chip:focus-visible { outline: 3px solid var(--nb-navy); outline-offset: 2px; }
.nk-leaf__badge circle { fill: var(--nb-navy, #13348B); stroke: #fff; stroke-width: 2; }
.nk-leaf__badge text { font: 700 10px var(--bs-body-font-family, sans-serif); fill: #fff; }
.nk-tree-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.nk-tree-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem .15rem .25rem; border-radius: 999px; border: 1px solid var(--nb-line); font-size: .8rem; text-decoration: none; color: inherit; min-height: 28px; }
.nk-tree-chip img { border-radius: 50%; }
.nk-tree-chip.is-own { border-color: #3b8d3b; background: #eaf7e6; }
[data-bs-theme="dark"] .nk-tree-chip.is-own { background: rgba(59,141,59,.25); }
/* phones: the tree turns sideways and scrolls with the page */
@keyframes nkDraw { to { stroke-dashoffset: 0; } }
@keyframes nkPop { from { opacity: 0; transform: translate(var(--tx, 0), var(--ty, 0)) scale(.3); } }
/* tree of life v3: bark, circle, wild relatives, unlock glow (static/js/nk-tree.js) */
.nk-tree-key.is-found { background: #1f8fb3; } .nk-tree-key.is-wild { background: #d8c9b0; }
.nk-branch.is-bark { stroke: none; fill: #b9ad9e; opacity: .8; }
.nk-branch.is-bark.is-own { fill: #4a8f3a; opacity: 1; } .nk-branch.is-bark.is-unlocked { fill: #c99a12; opacity: 1; }
.nk-branch.is-bark.is-found { fill: #1f8fb3; opacity: 1; } .nk-branch.is-bark.is-wild { fill: #d8c9b0; opacity: .7; }
.nk-branch.is-bark.is-locked { fill: #b9ad9e; }
.nk-branch.is-line { stroke: #9b8b78; opacity: .85; }
.nk-branch.is-line.is-own { stroke: #3b8d3b; } .nk-branch.is-line.is-unlocked { stroke: #d9a400; } .nk-branch.is-line.is-found { stroke: #1f8fb3; }
.nk-branch.is-line.is-locked { stroke: #b5bcc4; stroke-dasharray: none; } .nk-branch.is-line.is-wild, .nk-branch.is-wildstem { stroke: #d8c9b0; opacity: .7; }
.nk-branch.is-new { filter: drop-shadow(0 0 6px rgba(255, 196, 0, .95)); }
[data-bs-theme="dark"] .nk-branch.is-bark.is-locked, [data-bs-theme="dark"] .nk-branch.is-bark { fill: #5c564d; }
[data-bs-theme="dark"] .nk-branch.is-bark.is-own { fill: #4f9a3f; } [data-bs-theme="dark"] .nk-branch.is-bark.is-unlocked { fill: #d0a21a; }
[data-bs-theme="dark"] .nk-branch.is-bark.is-found { fill: #2aa0c6; } [data-bs-theme="dark"] .nk-branch.is-bark.is-wild { fill: #6d6252; }
.nk-tree-ground { fill: #b8d79c; opacity: .55; }
[data-bs-theme="dark"] .nk-tree-ground { fill: #2c4a22; }
.nk-tree-rankline { stroke: rgba(19, 52, 139, .12); stroke-width: 1; stroke-dasharray: 2 8; }
.nk-tree-ranklabel, .nk-ring-label { font: 700 13px var(--bs-body-font-family, sans-serif); fill: rgba(19, 52, 139, .55); letter-spacing: .08em; text-transform: uppercase; }
[data-bs-theme="dark"] .nk-tree-rankline { stroke: rgba(232, 236, 244, .14); }
[data-bs-theme="dark"] .nk-tree-ranklabel, [data-bs-theme="dark"] .nk-ring-label { fill: rgba(232, 236, 244, .55); }
.nk-ring { fill: none; stroke: rgba(19, 52, 139, .14); stroke-width: 1; stroke-dasharray: 3 6; }
.nk-ring.is-species { stroke-dasharray: none; }
[data-bs-theme="dark"] .nk-ring { stroke: rgba(232, 236, 244, .16); }
.nk-sector { cursor: zoom-in; opacity: .14; fill: #8b6b4a; transition: opacity .2s; }
.nk-sector:hover { opacity: .24; }
.nk-sector.g-Animalia { fill: #f2994a; } .nk-sector.g-Plantae { fill: #3b8d3b; } .nk-sector.g-Fungi { fill: #8d6e63; }
.nk-sector.g-Protista { fill: #9c6ade; } .nk-sector.g-Bacteria { fill: #2f80ed; } .nk-sector.g-Archaea { fill: #eb5757; }
.nk-sector-band { fill: rgba(19, 52, 139, .08); }
.nk-sector-band.is-open { fill: #d9a400; }
.nk-sector-band.is-sweep { animation: nkFadeIn 1s ease-out both; }
.nk-sector-label { font: 700 17px var(--bs-body-font-family, sans-serif); fill: var(--bs-body-color, #223); }
.nk-sector-sub { font-size: 13px; font-weight: 600; fill: var(--nb-muted, #667); }
.nk-wild { cursor: pointer; }
.nk-wild__dot { fill: #f5efe4; stroke: #b9a17d; stroke-width: 1.5; }
.nk-wild__label { font: italic 10px var(--bs-body-font-family, sans-serif); fill: #8a7a62; display: none; }
.nk-tree-svg.is-near .nk-wild__label, .is-circle .nk-tree-svg:not(.is-far) .nk-wild__label { display: inline; }
.nk-radial-label { font-size: 11px; dominant-baseline: middle; }
.nk-tree-svg.is-far .nk-radial-label, .nk-tree-svg.is-far .nk-tnode.rank-genus .nk-tnode__label, .nk-tree-svg.is-far .nk-tnode.rank-genus .nk-tnode__sub,
.nk-tree-svg.is-far .nk-tnode.rank-family .nk-tnode__sub, .nk-tree-svg.is-far .nk-leaf__owners { display: none; }
.nk-circle-node-label { font-size: 12px; paint-order: stroke; stroke: rgba(255, 255, 255, .85); stroke-width: 3px; }
[data-bs-theme="dark"] .nk-circle-node-label { stroke: rgba(18, 26, 46, .85); }
.nk-tnode__label, .nk-leaf__label { paint-order: stroke; stroke: rgba(255, 255, 255, .8); stroke-width: 3px; stroke-linejoin: round; }
[data-bs-theme="dark"] .nk-tnode__label, [data-bs-theme="dark"] .nk-leaf__label { stroke: rgba(18, 26, 46, .8); }
.nk-tnode.is-found .nk-tnode__disc { stroke: #1f8fb3; } .nk-leaf.is-found .nk-leaf__ring { stroke: #1f8fb3; }
.nk-tnode.is-wild .nk-tnode__disc { stroke: #c9b493; }
.nk-leaf__glow { fill: rgba(255, 196, 0, .35); stroke: #ffc400; stroke-width: 2; animation: nkGlow 1.6s ease-in-out 1.3s 3 both; }
.nk-tnode.is-target .nk-tnode__disc, .nk-leaf.is-target .nk-leaf__ring { stroke: #BD0068; stroke-width: 5; }
@keyframes nkGrow { from { opacity: 0; } to { opacity: 1; } }
@keyframes nkFadeIn { from { opacity: 0; } }
@keyframes nkGlow { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nk-leaf__glow, .nk-sector-band.is-sweep { animation: none; } }
/* how the breakdown works */
.nk-tree-example { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .35rem; }
.nk-tree-example__step { display: inline-flex; flex-direction: column; padding: .35rem .6rem; border: 1px solid var(--nb-line); border-radius: .75rem; color: inherit; text-decoration: none; min-height: 44px; background: var(--nb-surface); }
.nk-tree-example__step:hover { border-color: var(--nb-navy, #13348B); }
.nk-tree-example__rank { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--nb-muted); }
.nk-tree-example__name { font-weight: 600; font-size: .9rem; }
.nk-tree-example__latin { font-size: .75rem; color: var(--nb-muted); }
.nk-tree-example__arrow { color: var(--nb-muted); font-size: 1.2rem; }
.nk-tree-rank-list { list-style: none; padding: 0; margin: 0 0 .75rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .5rem .9rem; }
.nk-tree-rank-list__item { display: flex; gap: .6rem; align-items: flex-start; }
.nk-tree-rank-list__step { flex: 0 0 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--nb-navy-050, #e8edf9); color: var(--nb-navy, #13348B); }
.nk-tree-list__count.is-wild { color: #8a7a62; }
.nk-tree-src a { white-space: nowrap; }
/* tree of life: one stage (class, order, family…) */
.nk-stage-path a { text-decoration: none; }
.nk-stage-emoji { font-size: 3rem; line-height: 1; width: 4.5rem; height: 4.5rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--nb-surface-2); }
.nk-stage-groups { display: flex; flex-direction: column; gap: .35rem; }
.nk-stage-group { text-decoration: none; color: inherit; border: 1px solid var(--nb-line); border-radius: .75rem; padding: .5rem .75rem; min-height: 44px; }
.nk-stage-group:hover { background: var(--nb-surface-2); }
.nk-stage-species { text-decoration: none; color: inherit; }
.nk-stage-species.is-locked img { filter: grayscale(1); opacity: .55; }
.nk-tree-stagecard h3 { font-size: 1rem; margin: 0; }
.nk-tree-stagecard ul { padding-left: 1.1rem; margin: .35rem 0 0; }

/* ── Add a pet / plant: steps ─────────────────────────────────────────────── */
.nk-steps { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: 0 0 .5rem; padding: 0; counter-reset: none; }
.nk-steps li[hidden] { display: none; }
.nk-steps__step { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; border: 0; background: none; padding: .25rem .5rem .25rem .25rem;
  border-radius: 999px; color: var(--nb-muted); font-weight: 600; font-size: .9rem; }
.nk-steps__n { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; border: 2px solid var(--nb-line); font-size: .8rem; background: var(--bs-card-bg, #fff); }
.nk-steps__step.is-current { color: var(--nb-navy); }
.nk-steps__step.is-current .nk-steps__n { border-color: var(--nb-navy); background: var(--nb-navy); color: #fff; }
.nk-steps__step.is-done { color: var(--bs-body-color); }
.nk-steps__step.is-done .nk-steps__n { border-color: var(--nb-navy); color: var(--nb-navy); }
.nk-steps__step:not(:disabled):hover { background: var(--nb-surface-2); }
.nk-steps__step:disabled { opacity: .55; }
[data-bs-theme="dark"] .nk-steps__step.is-current { color: #c9d4ff; }
.nk-steps__bar { height: 4px; border-radius: 4px; background: var(--nb-line); overflow: hidden; margin-bottom: 1rem; }
.nk-steps__bar > span { display: block; height: 100%; width: 0; background: var(--nb-navy); transition: width .25s ease; }
.nk-steps-form:not(.is-js) .nk-steps, .nk-steps-form:not(.is-js) .nk-steps__bar, .nk-steps-form:not(.is-js) [data-nk-goto] { display: none; }
.nk-steps-form:not(.is-js) .nk-step + .nk-step { margin-top: 1.5rem; }
.nk-steps-form.is-js .nk-nojs-only { display: none; }
.nk-picker-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .75rem; }
.nk-filter-chips { display: flex; flex-wrap: wrap; gap: .35rem; flex: 1 1 auto; }
.nk-filter-chip { min-height: 36px; border: 1px solid var(--nb-line); background: var(--bs-card-bg, #fff); color: inherit; border-radius: 999px; padding: .25rem .8rem; font-size: .85rem; }
.nk-filter-chip.is-on { background: var(--nb-navy); border-color: var(--nb-navy); color: #fff; }
.nk-picker-search { position: relative; flex: 0 1 16rem; min-width: 12rem; }
.nk-picker-search .bi { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--nb-muted); pointer-events: none; }
.nk-picker-search input { padding-left: 2.1rem; }
@media (max-width: 575.98px) {
  .nk-filter-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
  .nk-filter-chip { flex: 0 0 auto; }
  .nk-picker-search { flex: 1 1 100%; }
}
.nk-picked-summary { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border: 1px solid var(--nb-line); border-radius: .9rem;
  background: var(--nb-surface-2, #f6f8fb); margin-bottom: 1rem; }
.nk-picked-summary[hidden] { display: none; }
.nk-picked-summary img { border-radius: 50%; }
.nk-photo-drop { display: flex; align-items: center; gap: .9rem; padding: .75rem; border: 2px dashed var(--nb-line); border-radius: 1rem; cursor: pointer; min-height: 96px; }
.nk-photo-drop:hover, .nk-photo-drop:focus-within { border-color: var(--nb-navy); background: var(--nb-surface-2); }
.nk-photo-drop__pic { position: relative; flex: 0 0 72px; width: 72px; height: 72px; border-radius: 50%; background: var(--nb-surface-2); display: grid; place-items: center; }
.nk-photo-drop__pic img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.nk-photo-drop__emoji { font-size: 2rem; }
.nk-photo-drop__cam { position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--nb-navy); color: #fff; display: grid; place-items: center; font-size: .8rem; border: 2px solid var(--bs-card-bg, #fff); }
.nk-more { border-top: 1px solid var(--nb-line); padding-top: .75rem; margin: .25rem 0 1rem; }
.nk-more > summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; gap: .35rem; }

/* sign-up: what is the account for */
.nk-type-picker { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
@media (max-width: 575.98px) { .nk-type-picker { grid-template-columns: 1fr; } }
.nk-type-card { display: flex; gap: .6rem; align-items: center; padding: .75rem; border: 2px solid var(--nb-line); border-radius: .9rem; cursor: pointer; min-height: 64px; }
.btn-check:checked + .nk-type-card { border-color: var(--nb-navy); background: var(--nb-navy-050); }
.btn-check:focus-visible + .nk-type-card { outline: 3px solid var(--nb-navy); outline-offset: 2px; }
/* an adult's own pet */
.nk-mypet { position: relative; width: 120px; height: 120px; border-radius: 50%; background: var(--nb-surface-2); display: grid; place-items: center; }
.nk-mypet__emoji { font-size: 4rem; line-height: 1; }
.nk-mypet__gear { position: absolute; font-size: 1.4rem; }
.nk-mypet__gear:nth-of-type(2) { right: 0; top: 10%; } .nk-mypet__gear:nth-of-type(3) { left: 0; top: 10%; } .nk-mypet__gear:nth-of-type(4) { right: 10%; bottom: 0; }

/* ── Individual account ("Just me") pages ─────────────────────────────────── */
.nk-me-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.nk-me-head h1 { margin: 0; }
.nk-me-head p { margin: .25rem 0 0; color: var(--nb-muted); }
@media (max-width: 575.98px) { .nk-me-head .btn { width: 100%; } }
.nk-me-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
@media (min-width: 992px) { .nk-me-hero { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
/* min-width: 0 — a long truncated line (the pet's mood) must never widen the page on a phone */
.nk-me-card { background: var(--bs-card-bg, #fff); border: 1px solid var(--nb-line); border-radius: 1rem; padding: 1.1rem 1.25rem; min-width: 0; }
.nk-me-progress { display: flex; align-items: center; gap: 1.1rem; }
.nk-me-progress .nk-ring { width: 84px; height: 84px; font-size: 1rem; }
.nk-me-progress .nk-ring > span { width: 68px; height: 68px; text-align: center; line-height: 1.05; }
.nk-me-progress .nk-ring small { display: block; font-size: .65rem; font-weight: 600; color: var(--nb-muted); }
.nk-me-stats { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .4rem; font-weight: 600; }
.nk-me-pet { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: inherit; }
.nk-me-pet > *, .nk-me-progress > * { min-width: 0; }
.nk-me-pet:hover { border-color: var(--nb-navy); }
.nk-me-pet__pic { flex: 0 0 76px; width: 76px; height: 76px; border-radius: 50%; background: var(--nb-surface-2); display: grid; place-items: center; font-size: 2.6rem; overflow: hidden; }
.nk-me-pet__pic img { width: 100%; height: 100%; object-fit: contain; }
.nk-me-bar { height: .45rem; border-radius: .45rem; background: var(--nb-line); overflow: hidden; margin-top: .4rem; }
.nk-me-bar > span { display: block; height: 100%; background: #3b8d3b; }
.nk-todo { padding: 0; overflow: hidden; }
.nk-todo__section + .nk-todo__section { border-top: 1px solid var(--nb-line); }
.nk-todo__head { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1.25rem .25rem; }
.nk-todo__head h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--nb-muted); margin: 0; }
.nk-todo__manage { color: var(--nb-muted); font-size: .85rem; text-decoration: none; padding: .35rem .5rem; border-radius: .5rem; min-height: 36px; display: inline-flex; align-items: center; gap: .3rem; }
.nk-todo__manage:hover { background: var(--nb-surface-2); color: var(--nb-navy); }
.nk-todo__item { display: flex; align-items: center; gap: .85rem; padding: .55rem 1.25rem; min-height: 56px; }
.nk-todo__item.is-due { background: rgba(var(--nb-navy-rgb), .05); }
.nk-todo__body { flex: 1 1 auto; min-width: 0; }
.nk-todo__title { font-weight: 600; }
.nk-todo__meta { font-size: .8rem; color: var(--nb-muted); }
.nk-todo__steps { padding: 0 1.25rem .5rem 4.15rem; margin: 0; list-style: none; }
.nk-todo__steps li { min-height: 44px; display: flex; align-items: center; }
.nk-todo details > summary { list-style: none; cursor: pointer; }
.nk-todo details > summary::-webkit-details-marker { display: none; }
.nk-check { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--nb-line); background: var(--bs-card-bg, #fff); display: inline-grid; place-items: center; color: transparent; font-size: 1.1rem; padding: 0; }
.nk-check:hover { border-color: #3b8d3b; color: #3b8d3b; }
.nk-check.is-on { background: #3b8d3b; border-color: #3b8d3b; color: #fff; }
.nk-check--sm { width: 30px; height: 30px; font-size: .9rem; }
.nk-step-btn { display: flex; align-items: center; gap: .6rem; border: 0; background: none; padding: .25rem 0; color: inherit; text-align: left; min-height: 44px; width: 100%; }
.nk-step-btn.is-done span { text-decoration: line-through; color: var(--nb-muted); }
.nk-me-emoji { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; background: var(--nb-surface-2); display: grid; place-items: center; font-size: 1.4rem; }
.nk-me-done > summary { padding: .85rem 1.25rem; font-weight: 600; color: var(--nb-muted); cursor: pointer; }
.nk-me-done .nk-todo__item { opacity: .75; }
.nk-me-list { padding: 0; overflow: visible; }
.nk-me-row { display: flex; align-items: center; gap: .85rem; padding: .7rem 1rem .7rem 1.1rem; min-height: 64px; }
.nk-me-row + .nk-me-row { border-top: 1px solid var(--nb-line); }
.nk-me-row.is-paused { opacity: .6; }
.nk-me-row__body { flex: 1 1 auto; min-width: 0; }
.nk-me-row__title { font-weight: 600; }
.nk-me-meta { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .2rem; }
.nk-me-meta span { font-size: .75rem; color: var(--nb-muted); background: var(--nb-surface-2); border-radius: 999px; padding: .1rem .5rem; }
.nk-me-menu { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--nb-muted); font-size: 1.2rem; }
.nk-me-menu:hover, .nk-me-menu[aria-expanded="true"] { background: var(--nb-surface-2); color: var(--nb-navy); }
.nk-me-empty { text-align: center; padding: 2.5rem 1rem; }
.nk-me-empty .nk-me-emoji { margin: 0 auto .75rem; width: 64px; height: 64px; font-size: 2rem; }
.nk-me-steps-howto { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.nk-me-steps-howto span { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; padding: .3rem .7rem .3rem .3rem; border-radius: 999px; background: var(--nb-surface-2); }
.nk-me-steps-howto b { width: 22px; height: 22px; border-radius: 50%; background: var(--nb-navy); color: #fff; display: grid; place-items: center; font-size: .75rem; }
/* weekday toggles */
.nk-days { display: flex; gap: .35rem; flex-wrap: wrap; }
.nk-day { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--nb-line); display: grid; place-items: center; font-size: .8rem; font-weight: 600; cursor: pointer; user-select: none; margin: 0; }
.btn-check:checked + .nk-day { background: var(--nb-navy); border-color: var(--nb-navy); color: #fff; }
.btn-check:focus-visible + .nk-day { outline: 3px solid var(--nb-navy); outline-offset: 2px; }
.nk-day-presets { display: flex; gap: .35rem; margin-top: .4rem; }
.nk-day-presets button { border: 0; background: none; color: var(--nb-navy); font-size: .8rem; padding: .2rem .4rem; border-radius: .4rem; }
.nk-day-presets button:hover { background: var(--nb-surface-2); }
/* routine cards */
.nk-me-routines { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.nk-me-routine { display: flex; flex-direction: column; gap: .5rem; }
.nk-me-routine ul { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.nk-me-routine li { padding: .15rem 0; }
@media (max-width: 575.98px) { .nk-me-routines { grid-template-columns: 1fr; } }

.nk-art-fallback { font-size: inherit; line-height: 1; }
.nk-mypet .nk-art-fallback { font-size: 4rem; }

/* ── Phone app feel (shared by the adult dashboard and the kid portal) ─────── */
/* Same-document page transitions where the browser supports them; a short fade on the page body. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: nkFadeOut .12s ease both; }
  ::view-transition-new(root) { animation: nkFadeIn .16s ease both; }
  /* fade only, and nothing kept after it ends: a kept transform would make <main> a stacking context and trap its modals under the backdrop */
  .nk-content, .nk-kid-main { animation: nkFadeIn .2s ease backwards; }
}
@keyframes nkFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes nkRise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Tap feel: no grey flash, no double-tap zoom delay, a small press on cards and buttons. */
a, button, .btn, .nk-tile, .nk-care-card, .nk-row, .nk-pick { -webkit-tap-highlight-color: transparent; }
.btn, .nk-tile, .nk-quick-card, .nk-nav-card, .nk-pick, .nk-check, .nk-kidstat, .nk-bottombar a, .nk-bottombar button, .nk-tree-list__species { touch-action: manipulation; }
@media (pointer: coarse) {
  .btn:active, .nk-tile:active, .nk-quick-card:active, .nk-nav-card:active, .nk-pick:active, .nk-care-card__top:active, .nk-kidstat:active,
  .nk-tree-list__species:active, .nk-sp-tile:active { transform: scale(.97); transition: transform .08s ease; }
  .nk-bottombar, .nk-kidtabs, .nk-tabs { user-select: none; -webkit-user-select: none; }
  .chip, a.chip { min-height: 2rem; display: inline-flex; align-items: center; }
  .nk-kid-portal .btn-sm { min-height: 44px; padding-top: .45rem; padding-bottom: .45rem; }
  .list-group-item { min-height: 3.5rem; }
}
/* Pull-to-refresh indicator (installed app only, nk.js [data-nk-ptr]). */
.nk-ptr { position: fixed; top: calc(env(safe-area-inset-top) + .5rem); left: 50%; z-index: 1090; width: 2.25rem; height: 2.25rem; margin-left: -1.125rem;
  border-radius: 50%; background: var(--nb-surface); box-shadow: var(--nb-shadow-lg); display: grid; place-items: center; color: var(--nb-navy-text);
  transform: translateY(-4rem); transition: transform .15s ease; }
.nk-ptr.is-armed { transform: none; }
.nk-ptr.is-loading i { animation: nkSpin .8s linear infinite; }
@keyframes nkSpin { to { transform: rotate(360deg); } }
/* Skeleton shimmer while a sheet or a panel loads. */
.nk-skeleton { display: block; border-radius: .5rem; background: linear-gradient(90deg, var(--nb-surface-2) 25%, var(--nb-line) 50%, var(--nb-surface-2) 75%);
  background-size: 200% 100%; animation: nkShimmer 1.2s linear infinite; min-height: 1rem; }
@keyframes nkShimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .nk-skeleton, .nk-ptr.is-loading i { animation: none; } }
/* Sticky page header on phones for long pages. */
@media (max-width: 991.98px) {
  .page-header.is-sticky { position: sticky; top: var(--nb-navbar-h); z-index: 4; margin: -1rem -1rem 1rem; padding: .75rem 1rem;
    background: color-mix(in srgb, var(--nb-canvas) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
}

/* ── Shared sheet: bottom sheet on phones, side panel on desktop (partials/sheet.html) ──── */
.nk-sheet.offcanvas-bottom { height: auto; max-height: 88vh; max-height: 88dvh; border-radius: 1.25rem 1.25rem 0 0; background: var(--nb-canvas); }
.nk-sheet.offcanvas-end { width: min(440px, 100%); background: var(--nb-canvas); }
.nk-sheet .offcanvas-body { padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
.nk-sheet .offcanvas-header { padding-bottom: .5rem; }
.nk-sheet__grip { width: 2.5rem; height: .3rem; border-radius: 999px; background: var(--nb-line-2); margin: .55rem auto 0; }
.nk-sheet.offcanvas-end .nk-sheet__grip { display: none; }
.nk-sheet .card { box-shadow: none; }
.nk-sheet-loading .nk-skeleton + .nk-skeleton { margin-top: .6rem; }
/* Phone ⋯ menus rendered as a sheet: plain full-width rows. */
.nk-sheet-menu { list-style: none; margin: 0; padding: 0; }
.nk-sheet-menu li + li { border-top: 1px solid var(--nb-line); }
.nk-sheet-menu a, .nk-sheet-menu button { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 3.25rem; padding: .6rem .25rem; background: none; border: 0;
  color: var(--nb-ink); text-decoration: none; font: inherit; font-weight: 600; text-align: left; }
.nk-sheet-menu .text-danger { color: var(--nb-danger) !important; }

/* ── Kid portal on phones: compact header, bottom tab bar, bigger touch rows ─── */
.nk-kid-main { padding-bottom: 2.5rem; }
.nk-kidbar__account { width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%; }
/* a visible name under each header icon ("Ask", "Me"); the button keeps its aria-label */
.nk-kid-portal .nk-kidbar .nk-kidbar__account { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
  width: auto; min-width: 48px; height: auto; min-height: 48px; padding: .3rem .5rem .25rem; border-radius: 16px; line-height: 1; }
.nk-kidbar__cap { font-family: var(--k-round, inherit); font-weight: 600; font-size: .75rem; }
.nk-kidbar__account::after { display: none; }
.nk-kidbar__account i { font-size: 1.35rem; }
@media (max-width: 991.98px) {
  .nk-kid-portal .nk-kid-main { padding: 1rem 1rem calc(var(--nb-bottombar-h) + 1.5rem + env(safe-area-inset-bottom)); }
  .nk-kidbar__row { padding: .6rem 0 .75rem; }
  .nk-kidbar .avatar.lg { width: 2.75rem; height: 2.75rem; font-size: 1.35rem; }
  .nk-kidbar__hi { font-size: 1.15rem; }
  .nk-kidbar__tenant { font-size: .75rem; }
  .nk-kid-portal .row.g-4 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
  .nk-kid-portal .h3 { font-size: 1.35rem; }
}
@media (min-width: 992px) { .nk-kidbar__row { padding: 1rem 0; } }
.nk-kid-portal .nk-bottombar { background: var(--nb-surface); }
.nk-kid-portal .nk-bottombar a.active { color: var(--kid-ink, var(--nb-navy-text)); }
/* Kid home: stats grid, "next up" hero and to-do rows (reuses the .nk-todo / .nk-check kit). */
.nk-kidstats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 768px) { .nk-kidstats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; } }
.nk-kidstat { text-decoration: none; display: flex; flex-direction: column; justify-content: center; min-height: 4.5rem; }
.nk-kidstat b { font-size: 1.35rem; }
.nk-kid-next { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border-radius: var(--nb-radius); color: #fff;
  background: linear-gradient(135deg, var(--nb-navy), color-mix(in srgb, var(--kid, var(--nb-navy)) 55%, var(--nb-navy))); margin-bottom: 1rem; box-shadow: var(--nb-shadow-card); }
.nk-kid-next__emoji { font-size: 2.2rem; line-height: 1; flex: 0 0 auto; }
.nk-kid-next__body { flex: 1 1 auto; min-width: 0; }
.nk-kid-next__kicker { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; font-weight: 700; }
.nk-kid-next__title { font-size: 1.15rem; font-weight: 800; line-height: 1.25; }
.nk-kid-next__meta { font-size: .85rem; opacity: .9; }
.nk-kid-next .btn { flex: 0 0 auto; min-height: 56px; min-width: 56px; font-weight: 700; border-radius: 1rem; }
.nk-kid-next--done { background: linear-gradient(135deg, #1a8a4a, #3b8d3b); }
.nk-kid-portal .nk-todo__item { padding-left: 1rem; padding-right: 1rem; }
.nk-kid-portal .nk-todo__steps { padding-left: 3.9rem; }
.nk-kid-portal .nk-check { width: 44px; height: 44px; font-size: 1.2rem; }
.nk-kid-portal .nk-todo__title { font-size: 1.02rem; }
.nk-kid-portal .nk-todo__item form { margin: 0; }
.nk-kid-portal .nk-todo__item.is-other { opacity: .7; }
/* Floating action button (📷 What is this?) above the bar. */
.nk-fab { position: fixed; right: 1rem; bottom: calc(var(--nb-bottombar-h) + 1rem + env(safe-area-inset-bottom)); z-index: 1029; display: inline-flex; align-items: center; gap: .5rem;
  min-height: 52px; padding: 0 1.1rem 0 .9rem; border-radius: 999px; background: var(--nb-navy-btn); color: #fff; font-weight: 700; text-decoration: none; box-shadow: var(--nb-shadow-lg); }
.nk-fab:hover, .nk-fab:focus-visible { color: #fff; background: var(--nb-navy-btn-hover); }
.nk-fab i, .nk-fab .nk-fab__emoji { font-size: 1.3rem; }
@media (min-width: 992px) { .nk-fab { bottom: 1.5rem; right: 1.5rem; } }
/* Kid subject page: segmented sections on phones (Jobs · Ask · About). */
/* scoped to the subject page's tab strip ([data-nk-seg]); unscoped, it leaked a 1rem gap and full-width pills into every segmented control (menus) */
.nk-seg[data-nk-seg] { display: flex; gap: .25rem; padding: .25rem; border-radius: 999px; background: var(--nb-surface-2); margin-bottom: 1rem; }
.nk-seg[data-nk-seg] .nk-seg__btn { flex: 1 1 0; min-height: 2.75rem; border: 0; border-radius: 999px; background: none; color: var(--nb-muted); font: inherit; font-weight: 700; }
.nk-seg[data-nk-seg] .nk-seg__btn[aria-selected="true"] { background: var(--nb-surface); color: var(--nb-navy-text); box-shadow: var(--nb-shadow-card); }
@media (max-width: 991.98px) { .nk-seg-pane:not(.is-active) { display: none !important; } }
.nk-kid-chatbar { position: sticky; bottom: calc(var(--nb-bottombar-h) + .75rem + env(safe-area-inset-bottom)); z-index: 5; }
@media (min-width: 992px) { .nk-kid-chatbar { position: static; } }
.nk-kid-portal .nk-care-card__top { padding: .9rem .9rem .4rem; }

/* ── Tree of life as a list (care/_tree_list.html) ────────────────────────── */
.nk-tree-list__search { max-width: 18rem; min-height: 2.4rem; border-radius: 999px; }
@media (max-width: 575.98px) { .nk-tree-list__search { max-width: none; flex: 1 1 100%; min-height: 2.75rem; } }
.nk-tree-list__list { list-style: none; margin: 0; padding: 0; }
.nk-tree-list__list--root > .nk-tree-list__group { background: var(--nb-surface); border: 1px solid var(--nb-card-border); border-radius: var(--nb-radius); padding: .25rem .5rem .5rem; box-shadow: var(--nb-shadow-card); }
.nk-tree-list__group + .nk-tree-list__group { margin-top: .35rem; }
.nk-tree-list__row { display: flex; align-items: center; gap: .25rem; }
.nk-tree-list__toggle { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: .6rem; min-height: 3.25rem; padding: .45rem .5rem; border: 0; border-radius: .75rem; background: none;
  color: var(--nb-ink); font: inherit; text-align: left; }
.nk-tree-list__toggle:hover { background: var(--nb-surface-2); }
.nk-tree-list__chev { font-size: .8rem; color: var(--nb-muted); transition: transform .18s ease; flex: 0 0 auto; }
.nk-tree-list__toggle[aria-expanded="true"] .nk-tree-list__chev { transform: rotate(90deg); }
.nk-tree-list__emoji { font-size: 1.5rem; line-height: 1; flex: 0 0 2rem; text-align: center; }
.nk-tree-list__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.nk-tree-list__rank { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--nb-muted); }
.nk-tree-list__label { font-size: 1.02rem; }
.nk-tree-list__line { font-size: .84rem; color: var(--nb-muted); }
.nk-tree-list__count { flex: 0 0 auto; font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; background: rgba(var(--nb-success-rgb), .14); color: var(--nb-success); white-space: nowrap; }
.nk-tree-list__count.is-locked { background: var(--nb-surface-2); color: var(--nb-muted); }
.nk-tree-list__group.is-own > .nk-tree-list__row .nk-tree-list__emoji { filter: none; }
.nk-tree-list__group.is-locked > .nk-tree-list__row .nk-tree-list__label { color: var(--nb-muted); }
.nk-tree-list__info { flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem; display: inline-grid; place-items: center; border-radius: 50%; color: var(--nb-navy-text); background: var(--nb-navy-050); text-decoration: none; font-weight: 700; }
.nk-tree-list__children { margin-left: .9rem; padding-left: .75rem; border-left: 2px solid var(--nb-line-2); }
@media (max-width: 575.98px) { .nk-tree-list__children { margin-left: .55rem; padding-left: .5rem; } }
.nk-tree-list__about { margin: .15rem 0 .5rem; font-size: .9rem; }
.nk-tree-list__about > summary { cursor: pointer; color: var(--nb-navy-text); font-weight: 600; padding: .35rem .25rem; list-style: none; }
.nk-tree-list__about > summary::-webkit-details-marker { display: none; }
.nk-tree-list__about-body { padding: .25rem .25rem .5rem; }
.nk-tree-list__species-grid { list-style: none; margin: .25rem 0 .5rem; padding: 0; display: grid; gap: .5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .nk-tree-list__species-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .nk-tree-list__species-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.nk-tree-list__species { display: flex; gap: .75rem; align-items: flex-start; padding: .65rem .7rem; border-radius: .9rem; border: 1px solid var(--nb-line); background: var(--bs-card-bg, #fff);
  color: inherit; text-decoration: none; min-height: 4.5rem; transition: border-color .15s ease, box-shadow .15s ease; }
.nk-tree-list__species:hover { border-color: var(--nb-navy-text); box-shadow: var(--nb-shadow-card); color: inherit; }
.nk-tree-list__species.is-own { border-color: rgba(var(--nb-success-rgb), .6); background: rgba(var(--nb-success-rgb), .06); }
.nk-tree-list__species.is-unlocked { border-color: rgba(217, 164, 0, .6); }
.nk-tree-list__species.is-locked img, .nk-tree-list__species.is-locked .nk-tree-list__pic > span { filter: grayscale(1); opacity: .55; }
.nk-tree-list__pic { position: relative; flex: 0 0 56px; width: 56px; height: 56px; display: grid; place-items: center; font-size: 2rem; line-height: 1; }
.nk-tree-list__pic img { border-radius: 50%; }
.nk-tree-list__lock { position: absolute; right: -4px; top: -4px; font-size: 1rem; filter: none !important; opacity: 1 !important; }
.nk-tree-list__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .15rem; line-height: 1.3; }
.nk-tree-list__summary { font-size: .86rem; color: var(--nb-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nk-tree-list__chips { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .15rem; }
.nk-tree-list__chips .chip { font-size: .72rem; min-height: 1.6rem; }
.nk-tree-list__species.is-target, .nk-tree-list__group.is-target > .nk-tree-list__row { box-shadow: 0 0 0 3px var(--nb-navy-text); border-radius: .9rem; }

/* ── Nature lens ──────────────────────────────────────────────────────────── */
.nk-lens-drop { display: flex; align-items: center; gap: 1rem; padding: 1rem; border: 2px dashed var(--nb-line-2); border-radius: var(--nb-radius); cursor: pointer; background: var(--nb-surface-2); }
.nk-lens-drop:hover, .nk-lens-drop:focus-within { border-color: var(--nb-navy-text); }
.nk-lens-drop__pic { position: relative; flex: 0 0 96px; width: 96px; height: 96px; border-radius: 1rem; background: var(--nb-surface); display: grid; place-items: center; overflow: hidden; }
/* absolute fill: a grid item's height: 100% doesn't resolve, so tall photos overflowed the square and lost their middle */
.nk-lens-drop__pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nk-lens-drop__emoji { font-size: 2.6rem; line-height: 1; }
.nk-lens-drop__text { flex: 1 1 auto; min-width: 0; }
/* Phones: one compact row per photo (picture beside the words) and the "what does it show" chips on one swipeable line,
   so three photos stay a short form instead of three screens of stacked boxes and chips. */
@media (max-width: 575.98px) {
  .nk-lens-drop { gap: .75rem; padding: .75rem; }
  .nk-lens-drop__pic { flex-basis: 76px; width: 76px; height: 76px; border-radius: .85rem; }
  .nk-lens-drop__emoji { font-size: 2rem; }
  .nk-lens-slot + .nk-lens-slot { margin-top: .75rem; }
  .nk-lens-views { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; padding-right: 1.5rem; margin-right: -.25rem;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent); }
  .nk-lens-views::-webkit-scrollbar { display: none; }
  .nk-lens-views .btn { flex: 0 0 auto; white-space: nowrap; }
}
.nk-scan__pic { flex: 0 0 112px; width: 112px; height: 112px; }
.nk-scan__pic--none { border-radius: 1rem; background: var(--nb-surface-2); display: grid; place-items: center; font-size: 3rem; }
.nk-scan__box { border: 1px solid var(--nb-line); border-radius: .9rem; padding: .75rem .9rem; background: var(--nb-surface-2); height: 100%; }
.nk-scan__box--success { border-color: rgba(var(--nb-success-rgb), .5); background: rgba(var(--nb-success-rgb), .08); }
.nk-scan__box--warning { border-color: rgba(var(--nb-warning-rgb), .5); background: rgba(var(--nb-warning-rgb), .08); }
.nk-scan__box--danger { border-color: rgba(var(--nb-danger-rgb), .5); background: rgba(var(--nb-danger-rgb), .08); }
.nk-scan-list .nk-row { min-height: 3.5rem; }

/* ── Virtual pets: tiles with stage art, species sheet, how-it-works boxes (shared by /pets/, /my/pet/, /me/pets/) ── */
.nk-pet-tile { position: relative; padding: 0; overflow: visible; }
.nk-pet-tile__link { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; padding: .9rem .6rem .6rem; width: 100%;
  color: inherit; text-decoration: none; border-radius: .9rem; flex: 1 1 auto; }
.nk-pet-tile__link:hover, .nk-pet-tile__link:focus-visible { background: var(--nb-surface-2); color: inherit; }
.nk-pet-tile__art { width: 4.5rem; height: 4.5rem; object-fit: contain; margin-bottom: .1rem; }
.nk-pet-tile--big .nk-pet-tile__art { width: 6rem; height: 6rem; }
.nk-pet-tile.is-locked .nk-pet-tile__art { filter: grayscale(1) brightness(1.15); opacity: .4; }
.nk-pet-tile__lock { position: absolute; top: .5rem; right: .6rem; font-size: 1rem; }
.nk-pet-tile__path { font-size: .68rem; font-weight: 600; color: var(--nb-muted); }
.nk-pet-tile__more { margin-top: .3rem; font-size: .72rem; font-weight: 700; color: var(--nb-navy-text); }
.nk-pet-tile__action { padding: 0 .6rem .7rem; margin: 0; }
.nk-pet-tile__action.chip { margin: 0 auto .7rem; }
@media (pointer: coarse) { .nk-pet-tile__action .btn { min-height: 44px; } }
.nk-pet-art { width: 125%; height: 125%; object-fit: contain; margin-top: -1.2rem; filter: drop-shadow(0 4px 6px rgba(0,0,0,.12)); }
.nk-stage-steps__dot.has-art { overflow: hidden; background: var(--nb-surface); }
.nk-stage-steps__dot img { width: 135%; height: 135%; object-fit: contain; }
.nk-mypet img, .nk-pet-big img { width: 100%; height: 100%; object-fit: contain; }
.nk-mypet-link { display: block; color: inherit; text-decoration: none; }
.nk-mypet-link:hover .nk-mypet { box-shadow: 0 0 0 3px rgba(var(--nb-navy-rgb), .25); }
.nk-pet-big { display: inline-grid; place-items: center; width: 7.5rem; height: 7.5rem; }
.nk-house-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .6rem; }
/* How-it-works boxes (details on the adult My pet and kid pages) */
.nk-how-box { border: 1px solid var(--nb-line); border-radius: .9rem; padding: .6rem .9rem; background: var(--nb-surface-2); margin-bottom: .75rem; }
.nk-how-box > summary { cursor: pointer; font-weight: 700; color: var(--nb-navy-text); list-style: none; min-height: 2rem; display: flex; align-items: center; gap: .4rem; }
.nk-how-box > summary::-webkit-details-marker { display: none; }
.nk-how-box > summary::after { content: "\f282"; font-family: bootstrap-icons; margin-left: auto; font-size: .8rem; transition: transform .18s ease; }
.nk-how-box[open] > summary::after { transform: rotate(180deg); }
.nk-how-box.is-open { padding: .75rem .9rem; }
.nk-how--stages img { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; }
/* Species sheet */
.nk-petsheet__head { display: flex; align-items: center; gap: 1rem; }
.nk-petsheet__pic { flex: 0 0 7rem; width: 7rem; height: 7rem; border-radius: 50%; background: var(--nb-surface-2); display: grid; place-items: center; font-size: 3.2rem; overflow: hidden; }
.nk-petsheet__pic img { width: 120%; height: 120%; object-fit: contain; }
/* The species sheet always shows the pet in colour (a locked kind too: the 🔒 chip and "Still to unlock" say so) */
.nk-petsheet { container-type: inline-size; }
.nk-petsheet__stages { list-style: none; margin: 0; padding: .6rem 0 .25rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
/* six in a row only when the sheet itself is wide (the full page), not because the window is */
@container (min-width: 46rem) { .nk-petsheet__stages { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.nk-petsheet__stage { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; padding: .6rem .35rem; border-radius: .85rem; border: 1px solid var(--nb-line); background: var(--nb-surface); }
.nk-petsheet__stage.is-current { border-color: var(--nb-success); box-shadow: 0 0 0 3px rgba(var(--nb-success-rgb), .15); }
.nk-petsheet__stage.is-done { background: rgba(var(--nb-success-rgb), .07); }
.nk-petsheet__stage.is-later:not(.is-locked) .nk-petsheet__stagepic img { opacity: .85; }
.nk-petsheet__stagepic { width: 3.4rem; height: 3.4rem; display: grid; place-items: center; font-size: 2rem; line-height: 1; }
.nk-petsheet__stagepic img { width: 115%; height: 115%; object-fit: contain; }
.nk-petsheet__stagename { font-size: .85rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; hyphens: auto; }
.nk-petsheet__stageneed { font-size: .68rem; color: var(--nb-muted); line-height: 1.2; }
.nk-petsheet__now { position: absolute; top: .3rem; left: .35rem; font-size: .62rem; padding: .05rem .4rem; min-height: 0; }
.nk-petsheet__tick { position: absolute; top: .25rem; right: .45rem; font-size: .8rem; font-weight: 800; color: var(--nb-success); }
/* Gear slots, pips and consumables (moved out of pets/page.html) */
.nk-gear-slots { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto auto; gap: 1rem 1.25rem; align-items: center; }
.nk-gear-slots .slot-weapon { grid-area: 1 / 1; } .nk-gear-slots .slot-shield { grid-area: 1 / 3; } .nk-gear-slots .slot-charm { grid-area: 2 / 3; }
.nk-gear-slots__pet { grid-area: 1 / 2 / 3 / 3; text-align: center; font-size: 3.5rem; line-height: 1; position: relative; padding: 0 .5rem; }
.nk-gear-slots__pet img { width: 6rem; height: 6rem; object-fit: contain; }
.nk-gear-slots__gp { grid-area: 2 / 1; font-size: .85rem; }
.nk-gear-slots__orbit { position: absolute; inset: -.4rem; pointer-events: none; }
.nk-gear-slots__orbit span { position: absolute; font-size: 1.3rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.nk-gear-slots__orbit span:nth-child(1) { left: -.5rem; top: 10%; } .nk-gear-slots__orbit span:nth-child(2) { right: -.5rem; top: 10%; } .nk-gear-slots__orbit span:nth-child(3) { left: 50%; bottom: -.9rem; transform: translateX(-50%); }
.nk-gear-slot { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border: 1px dashed var(--nb-line); border-radius: .85rem; background: var(--nb-surface-2); min-height: 3.6rem; }
.nk-gear-slot.is-filled { border-style: solid; background: var(--nb-surface); }
.nk-gear-slot.is-broken { border-color: var(--nb-danger, #c0392b); }
.nk-gear-slot__emoji { font-size: 1.7rem; line-height: 1; }
.nk-gear-slot__body { flex: 1; min-width: 0; font-size: .85rem; }
.nk-pips { display: inline-flex; gap: 2px; vertical-align: middle; }
.nk-pips i { width: .55rem; height: .55rem; border-radius: 2px; background: var(--nb-line); display: inline-block; }
.nk-pips i.on { background: var(--nb-success); }
.is-broken .nk-pips i.on { background: var(--nb-danger, #c0392b); }
.nk-gear-tile .nk-pet-tile__emoji { position: relative; }
.nk-gear-tile.is-broken .nk-pet-tile__emoji { filter: grayscale(1); opacity: .55; }
.nk-gear-tile .nk-gear-tier { position: absolute; top: .4rem; right: .4rem; font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--nb-muted); }
.nk-gear-tile .nk-gear-tile__bonus { font-size: .72rem; color: var(--nb-ink); line-height: 1.3; }
.nk-gear-tile .btn { margin-top: .35rem; }
.nk-gear-tile .nk-gear-tile__flavour { font-size: .7rem; color: var(--nb-muted); font-style: italic; line-height: 1.3; }
.nk-consumable { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border: 1px solid var(--nb-line); border-radius: .75rem; }
.nk-consumable.is-selected { border-color: var(--nb-success); box-shadow: 0 0 0 3px rgba(var(--nb-success-rgb), .15); }
.nk-consumable.is-empty { opacity: .55; }
.nk-consumable__emoji { font-size: 1.6rem; line-height: 1; }
@media (max-width: 767.98px) { .nk-gear-slots { grid-template-columns: 1fr; grid-template-rows: none; } .nk-gear-slots > * { grid-area: auto !important; } .nk-gear-slots__pet { order: -1; } }
/* Species picker card: "Learn more" is a button */
.nk-species-card .btn { font-weight: 700; }

/* ── All of life (three domains after Hug 2016) ───────────────────────────── */

/* Field-guide finds on the tree */
.nk-branch.is-found { stroke: #2b8a9b; }
.nk-tnode.is-found .nk-tnode__disc { stroke: #2b8a9b; fill: #e6f6f8; }
.nk-leaf.is-found .nk-leaf__ring { stroke: #2b8a9b; fill: #e6f6f8; }
.nk-tree-key.is-found { background: #2b8a9b; }
.nk-tree-list__species.is-found { border-color: rgba(43, 138, 155, .6); background: rgba(43, 138, 155, .06); }
.nk-tree-list__species.is-found img { object-fit: cover; }
.nk-tree-list__count.is-found { background: rgba(43, 138, 155, .14); color: #2b8a9b; }

/* ── Field guide ──────────────────────────────────────────────────────────── */
.nk-guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .75rem; }
@media (max-width: 575.98px) { .nk-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nk-guide-tile { display: flex; flex-direction: column; gap: .3rem; padding: .6rem; border-radius: .9rem; border: 1px solid var(--nb-line); background: var(--nb-surface); color: inherit; text-decoration: none; }
.nk-guide-tile:hover { border-color: #2b8a9b; color: inherit; }
.nk-guide-tile.is-mine { border-color: rgba(43, 138, 155, .7); }
.nk-guide-tile__pic { display: grid; place-items: center; aspect-ratio: 1; border-radius: .7rem; background: var(--nb-surface-2); overflow: hidden; font-size: 2.5rem; }
.nk-guide-tile__pic img { width: 100%; height: 100%; object-fit: cover; }
.nk-guide-tile__name { font-weight: 700; font-size: .92rem; line-height: 1.2; }
.nk-guide-tile__meta { font-size: .72rem; color: var(--nb-muted); }

/* ── Chat (nk-chat.js): threads, composer, typing dots, the floating widget ─── */
.nk-chatbox { display: flex; flex-direction: column; min-height: 0; }
.nk-chatbox__list { flex: 0 1 auto; min-height: 4rem; max-height: min(60vh, 560px); overflow: auto; overscroll-behavior: contain; padding: .25rem .1rem; display: flex; flex-direction: column; gap: .6rem; }
/* The full page: the thread grows with its messages up to the viewport, then scrolls; nothing is reserved while it's empty. */
.nk-chatbox--page .nk-chatbox__list { max-height: calc(100vh - var(--nb-navbar-h) - 18rem); }
@media (max-width: 991.98px) { .nk-chatbox--page .nk-chatbox__list { max-height: none; overflow: visible; } }
.nk-chat__msg--system { align-self: center; max-width: 95%; }
.nk-chat__msg--system .nk-chat__bubble { background: rgba(var(--nb-success-rgb), .12); font-size: .85rem; }
.nk-chat__bubble ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.nk-chat__bubble img { max-width: 100%; border-radius: .5rem; }
.nk-chat__photo-tag { font-size: .8rem; opacity: .85; }
.nk-typing { display: inline-flex; gap: 4px; align-items: center; height: 1rem; }
.nk-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--nb-muted); animation: nkBounce .9s infinite; }
.nk-typing span:nth-child(2) { animation-delay: .15s; } .nk-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes nkBounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }
.nk-caret { display: inline-block; width: .5em; height: 1em; margin-left: 2px; vertical-align: -.15em; background: var(--nb-navy-text); animation: nkBlink 1s steps(2) infinite; }
@keyframes nkBlink { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .nk-typing span, .nk-caret { animation: none; } }
.nk-chat__composer { position: sticky; bottom: calc(var(--nb-bottombar-h) + .5rem + env(safe-area-inset-bottom)); z-index: 5; margin-top: .75rem; padding: .5rem; border-radius: 1.25rem; background: var(--nb-surface); box-shadow: var(--nb-shadow-card); border: 1px solid var(--nb-line); }
@media (min-width: 992px) { .nk-chat__composer { position: static; } }
.nk-chat__row { display: flex; gap: .5rem; align-items: flex-end; }
.nk-chat__row textarea { flex: 1 1 auto; resize: none; min-height: 40px; max-height: 120px; border: 0; background: transparent; padding: .5rem .6rem; font-size: 1rem; }
.nk-chat__row textarea:focus { outline: none; box-shadow: none; }
.nk-chat__btn { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; border: 0; font-size: 1.15rem; }
.nk-chat__btn--send { background: var(--nb-navy-btn); color: #fff; }
.nk-chat__btn--send:disabled { opacity: .5; }
.nk-chat__btn--photo { background: var(--nb-surface-2); color: var(--nb-navy-text); cursor: pointer; }
.nk-chat__suggest { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0; }
.nk-chat__suggest button { border: 1px solid var(--nb-line); background: var(--nb-surface); color: var(--nb-navy-text); border-radius: 999px; padding: .35rem .75rem; font-size: .85rem; font-weight: 600; min-height: 2.25rem; }
.nk-chat__photo-preview { display: flex; align-items: center; gap: .5rem; padding: .25rem .5rem; font-size: .85rem; }
.nk-chat__photo-preview img { width: 44px; height: 44px; object-fit: cover; border-radius: .5rem; }
.nk-kid-portal .nk-chat__row textarea { font-size: 1.05rem; }
/* Floating widget */
.nk-ai-widget { position: fixed; right: 1rem; bottom: calc(var(--nb-bottombar-h) + 1rem + env(safe-area-inset-bottom)); z-index: 1060; width: min(420px, calc(100vw - 2rem)); pointer-events: none; }
@media (min-width: 992px) { .nk-ai-widget { bottom: 1.25rem; } }
.nk-ai-panel { display: flex; flex-direction: column; height: min(640px, 75vh); border-radius: 1.25rem; background: var(--nb-surface); border: 1px solid var(--nb-card-border); box-shadow: var(--nb-shadow-lg);
  transform: translateY(16px) scale(.98); opacity: 0; transition: transform .18s ease, opacity .18s ease; overflow: hidden; }
.nk-ai-widget.is-open { pointer-events: auto; } .nk-ai-widget.is-open .nk-ai-panel { transform: none; opacity: 1; }
.nk-ai-widget.is-expanded { width: min(820px, calc(100vw - 2rem)); } .nk-ai-widget.is-expanded .nk-ai-panel { height: min(90vh, 900px); }
@media (max-width: 575.98px) { .nk-ai-widget { right: .5rem; left: .5rem; width: auto; } .nk-ai-panel { height: calc(100vh - var(--nb-bottombar-h) - 5rem - env(safe-area-inset-bottom));
  height: calc(100dvh - var(--nb-bottombar-h) - 5rem - env(safe-area-inset-bottom)); } }
/* Phones, tablets and the expanded panel: a real modal. The backdrop dims the page and catches every tap around the panel,
   the page behind is scroll-locked (nk-chat.js adds body.nk-ai-modal) and scrolling never chains out of the panel. */
.nk-ai-backdrop { position: fixed; inset: 0; z-index: -1; background: rgba(11, 18, 48, .45); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
body.nk-ai-modal .nk-ai-widget.is-open .nk-ai-backdrop { opacity: 1; pointer-events: auto; }
.nk-ai-panel { overscroll-behavior: contain; }
.nk-chat__suggest[hidden], [data-nk-chat-new][hidden], [data-nk-chat-empty][hidden] { display: none !important; }
.nk-chat__new { align-self: flex-end; display: inline-flex; align-items: center; gap: .3rem; margin: 0 0 .35rem; padding: .2rem .6rem; border: 1px solid var(--nb-line); border-radius: 999px;
  background: var(--nb-surface); color: var(--nb-navy-text); font-size: .8rem; font-weight: 600; min-height: 2rem; }
.nk-chat__new:hover { background: var(--nb-surface-2); }
.nk-ai-panel__head { display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem; border-bottom: 1px solid var(--nb-line); background: var(--nb-surface-2); }
.nk-ai-panel__head strong { flex: 1 1 auto; }
.nk-ai-panel__body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: .5rem .75rem .75rem; }
.nk-ai-panel__body .nk-chatbox { flex: 1 1 auto; min-height: 0; }
.nk-ai-panel__body .nk-chatbox__list { max-height: none; flex: 1 1 auto; }
.nk-ai-panel__body .nk-chat__composer { position: static; margin-top: .5rem; }
.nk-ai-launch { position: relative; }
/* Scrollable modals whose body sits inside a form and / or a tab pane (personal editors, guardian edit): the wrappers
   pass the height down so the body scrolls and the footer (Save) stays reachable. Inactive panes keep display: none. */
.modal-dialog-scrollable .modal-content > form,
.modal-dialog-scrollable .modal-content > .tab-content,
.modal-dialog-scrollable .modal-content > .tab-content > .tab-pane.active,
.modal-dialog-scrollable .modal-content > .tab-content > .tab-pane.active > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.modal-dialog-scrollable .modal-content form > .modal-body { overflow-y: auto; }
.nk-pre { white-space: pre-wrap; word-break: break-word; max-height: 22rem; overflow: auto; background: var(--nb-surface-2); padding: .5rem; border-radius: .5rem; }
.nk-tree-wrap [data-nk-tree-drawctl][hidden], .nk-tree-wrap [data-nk-tree-focusbar][hidden] { display: none !important; }

/* tree of life page v3.1: cards in learning order, map-style stage, words that appear as you zoom */
.nk-tree-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.nk-tree-stat { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; background: var(--nb-surface, #fff); border: 1px solid var(--nb-card-border, var(--nb-line)); border-radius: var(--nb-radius, 1rem); box-shadow: var(--nb-shadow-card, none); }
.nk-tree-stat.is-new { border-color: #ffc400; background: linear-gradient(135deg, rgba(255, 196, 0, .14), transparent 70%), var(--nb-surface, #fff); }
.nk-tree-stat__emoji { font-size: 2rem; line-height: 1; }
.nk-tree-stat__body { flex: 1 1 auto; min-width: 0; }
.nk-tree-stat__num { font-size: 1.05rem; line-height: 1.1; } .nk-tree-stat__num strong { font-size: 1.6rem; } .nk-tree-stat__num span { color: var(--nb-muted); }
.nk-tree-stat__label { font-size: .85rem; color: var(--nb-muted); }
.nk-tree-stat__bar { height: .4rem; margin-top: .35rem; } .nk-tree-stat__bar .progress-bar { background: #3b8d3b; }
.nk-tree-explore { overflow: hidden; }
.nk-tree-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .75rem .75rem .6rem; }
.nk-seg { display: inline-flex; padding: .2rem; border-radius: 999px; background: var(--nb-surface-2, #eef1f6); gap: .15rem; }
.nk-seg button { border: 0; background: none; border-radius: 999px; padding: .4rem .85rem; min-height: 40px; font-weight: 600; font-size: .9rem; color: var(--bs-body-color); white-space: nowrap; }
.nk-seg button[aria-pressed="true"] { background: var(--nb-surface, #fff); color: var(--nb-navy, #13348B); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
[data-bs-theme="dark"] .nk-seg button[aria-pressed="true"] { background: #2a3550; color: #fff; }
.nk-tree-focus { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; padding-bottom: 2px; }
.nk-tree-focus::-webkit-scrollbar { display: none; }
.nk-chip-btn { flex: 0 0 auto; border: 1px solid var(--nb-line); background: var(--nb-surface, #fff); border-radius: 999px; padding: .3rem .75rem; min-height: 36px; font-size: .85rem; white-space: nowrap; color: inherit; }
.nk-chip-btn.is-on { border-color: var(--nb-navy, #13348B); background: var(--nb-navy, #13348B); color: #fff; }
.nk-tree-explore .nk-tree-stage { border: 0; border-top: 1px solid var(--nb-line); border-bottom: 1px solid var(--nb-line); border-radius: 0; height: min(70vh, 640px); }
.nk-tree-draw { position: relative; }
.nk-tree-ctl { position: absolute; right: .6rem; bottom: .6rem; z-index: 4; display: flex; flex-direction: column; gap: .3rem; }
.nk-tree-ctl button, .nk-tree-ctl__toggle { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--nb-line); background: var(--nb-surface, #fff); box-shadow: 0 2px 8px rgba(0, 0, 0, .1); font-size: 1.05rem; color: var(--bs-body-color); margin: 0; cursor: pointer; }
.nk-tree-ctl button[hidden] { display: none; }
.nk-tree-ctl__toggle:has(input:checked), .nk-tree-ctl button[aria-pressed="true"] { border-color: #b9a17d; background: #f5efe4; }
[data-bs-theme="dark"] .nk-tree-ctl__toggle:has(input:checked), [data-bs-theme="dark"] .nk-tree-ctl button[aria-pressed="true"] { background: #3a3326; }
.nk-tree-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem .75rem; font-size: .85rem; background: var(--nb-navy-050, #e8edf9); border-top: 1px solid var(--nb-line); }
.nk-tree-nudge > span { flex: 1 1 10rem; }
.nk-tree-nudge[hidden] { display: none; }
[data-bs-theme="dark"] .nk-tree-nudge { background: rgba(var(--nb-navy-rgb, 19, 52, 139), .3); }
.nk-tree-ctl__toggle:has(input:focus-visible), .nk-tree-ctl button:focus-visible { outline: 3px solid var(--nb-navy, #13348B); outline-offset: 1px; }
.nk-tree-hint { position: absolute; left: 50%; top: .6rem; bottom: auto; transform: translateX(-50%); margin: 0; padding: .3rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .9); font-size: .8rem; color: var(--nb-muted); pointer-events: none; white-space: nowrap; transition: opacity .4s; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
[data-bs-theme="dark"] .nk-tree-hint { background: rgba(18, 26, 46, .9); }
.nk-tree-hint.is-gone { opacity: 0; }
.nk-tree-panes > [data-nk-tree-list], .nk-tree-panes > [data-nk-tree-all] { padding: 1rem; }
.nk-tree-explore .nk-tree-legend { margin: 0; padding: .6rem 1rem; font-size: .8rem; color: var(--nb-muted); gap: .3rem 1rem; }
.nk-tree-explore .nk-tree-key { width: .75rem; height: .75rem; border-radius: 50%; }
/* words appear as you zoom: quiet marks keep only their picture / dot, detail adds the small print */
.nk-tree-svg .is-quiet .nk-tnode__label, .nk-tree-svg .is-quiet .nk-tnode__sub, .nk-tree-svg .is-quiet .nk-leaf__label,
.nk-tree-svg .is-quiet .nk-leaf__owners, .nk-tree-svg .is-quiet .nk-leaf__badge, .nk-tree-svg .is-quiet .nk-wild__label { display: none; }
.nk-tree-svg .nk-tnode:not(.is-detail) .nk-tnode__sub { display: none; }
.nk-tree-svg .nk-wild:not(.is-detail) .nk-wild__label { display: none; }
.nk-tree-sources summary { cursor: pointer; list-style: none; } .nk-tree-sources summary::-webkit-details-marker { display: none; }
.nk-tree-sources summary::after { content: "›"; float: right; transition: transform .2s; font-size: 1.2rem; line-height: 1; }
.nk-tree-sources[open] summary::after { transform: rotate(90deg); }
@media (max-width: 575.98px) {
  .nk-tree-toolbar { padding: .6rem; }
  .nk-seg { width: 100%; } .nk-seg button { flex: 1 1 0; padding: .4rem .3rem; font-size: .82rem; }
  .nk-tree-explore .nk-tree-stage { height: 56vh; min-height: 320px; }
  /* the controls leave the stage: a row of thumb-sized buttons right under the drawing, so nothing covers it */
  .nk-tree-ctl { position: static; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: .25rem; padding: .4rem .5rem; border-bottom: 1px solid var(--nb-line); }
  .nk-tree-ctl button, .nk-tree-ctl__toggle { flex: 1 1 44px; width: auto; min-width: 44px; max-width: 64px; height: 44px; box-shadow: none; }
  .nk-tree-pop { left: 8px !important; right: 8px; bottom: 8px; top: auto !important; width: auto; max-width: none; max-height: 50%; overflow-y: auto; }
  .nk-tree-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .nk-tree-stat { padding: .65rem .75rem; gap: .55rem; } .nk-tree-stat__emoji { font-size: 1.5rem; }
}

/* All of life: headline → proportion bar → three cards → you are here */
.nk-life__head { margin-bottom: .9rem; }
.nk-life__bar { display: flex; align-items: stretch; gap: 3px; height: 3rem; border-radius: 999px; overflow: hidden; background: var(--nb-surface-2); }
.nk-life__luca { flex: 0 0 auto; display: grid; place-items: center; padding: 0 .8rem; font-size: .78rem; font-weight: 700; background: var(--nb-ink, #1b2333); color: #fff; }
.nk-life__seg { flex-basis: 0; min-width: 3.4rem; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .9rem; }
.nk-life__seg.tone-grey { background: #8f99a6; } .nk-life__seg.tone-orange { background: #e39a2c; } .nk-life__seg.tone-green { background: #3b8d3b; }
.nk-life__seg-label { white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.nk-life__cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 767.98px) { .nk-life__cards { grid-template-columns: 1fr; } }
.nk-life__card { display: flex; flex-direction: column; gap: .45rem; padding: 1rem; border: 1px solid var(--nb-line); border-top: 4px solid #8f99a6; border-radius: var(--nb-radius, 1rem); background: var(--nb-surface, #fff); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.nk-life__card:hover { transform: translateY(-2px); box-shadow: var(--nb-shadow-card, 0 6px 18px rgba(0, 0, 0, .08)); color: inherit; }
.nk-life__card.tone-orange { border-top-color: #e39a2c; } .nk-life__card.tone-green { border-top-color: #3b8d3b; }
.nk-life__icon { width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: var(--nb-surface-2); }
.nk-life__title { font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; }
.nk-life__pct { font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--nb-surface-2); color: var(--nb-muted); }
.nk-life__line { font-size: .9rem; flex: 1 1 auto; }
.nk-life__chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.nk-life__meta { font-size: .78rem; color: var(--nb-muted); }
.nk-life__here { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: 1rem; padding: 1rem; border-radius: var(--nb-radius, 1rem); background: #eaf7e6; border: 1px solid #cfe8c7; }
[data-bs-theme="dark"] .nk-life__here { background: rgba(59, 141, 59, .18); border-color: rgba(59, 141, 59, .4); }
.nk-life__here-text { flex: 1 1 18rem; display: flex; flex-direction: column; gap: .4rem; }
.nk-life__path { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.nk-life__arrow { color: var(--nb-muted); font-size: 1.1rem; }
@media (max-width: 575.98px) { .nk-life__here .btn { width: 100%; } .nk-life__luca { padding: 0 .5rem; font-size: .7rem; } }

/* nature journal: "I saw something" (nature/_sighting_form.html + nk-nature.js), sighting cards, the journal */
.nk-saw__step + .nk-saw__step { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--nb-line); }
.nk-saw__h { font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.nk-saw__n { width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: var(--nb-navy, #13348B); color: #fff; font-size: .85rem; }
.nk-saw__kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .4rem; }
.nk-saw__kind input { position: absolute; opacity: 0; pointer-events: none; }
.nk-saw__kind > span { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .55rem .3rem; border: 1px solid var(--nb-line); border-radius: .8rem; cursor: pointer; font-size: .85rem; font-weight: 600; min-height: 44px; background: var(--nb-surface, #fff); }
.nk-saw__kemoji { font-size: 1.5rem; line-height: 1; }
.nk-saw__kind input:checked + span { border-color: var(--nb-navy, #13348B); background: var(--nb-navy-050, #e8edf9); box-shadow: inset 0 0 0 1px var(--nb-navy, #13348B); }
.nk-saw__kind input:focus-visible + span { outline: 3px solid var(--nb-navy, #13348B); outline-offset: 2px; }
.nk-saw__q { min-height: 2.75rem; border-radius: 999px; }
.nk-saw__results { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .35rem; max-height: 22rem; overflow-y: auto; }
.nk-saw__results.is-compact { grid-template-columns: 1fr; max-height: 14rem; }
.nk-saw__hit { width: 100%; display: flex; align-items: center; gap: .6rem; text-align: left; border: 1px solid var(--nb-line); border-radius: .75rem; background: var(--nb-surface, #fff); padding: .45rem .6rem; min-height: 44px; color: inherit; }
.nk-saw__hit:hover, .nk-saw__hit:focus-visible { border-color: var(--nb-navy, #13348B); }
.nk-saw__hemoji { font-size: 1.4rem; }
.nk-saw__htext { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; } .nk-saw__htext em { font-size: .78rem; color: var(--nb-muted); }
.nk-saw__hrank { font-size: .78rem; color: var(--nb-muted); }
.nk-saw__none { font-size: .85rem; color: var(--nb-muted); padding: .4rem .2rem; }
.nk-saw__picked { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: .8rem; background: #eaf7e6; border: 1px solid #cfe8c7; }
[data-bs-theme="dark"] .nk-saw__picked { background: rgba(59, 141, 59, .18); border-color: rgba(59, 141, 59, .4); }
.nk-saw__picked-emoji, .nk-saw__picked [data-emoji] { font-size: 1.6rem; }
.nk-journal__bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .75rem; border-bottom: 1px solid var(--nb-line); }
.nk-seg__a { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .4rem .9rem; min-height: 40px; font-weight: 600; font-size: .9rem; color: var(--bs-body-color); text-decoration: none; }
.nk-seg__a[aria-selected="true"] { background: var(--nb-surface, #fff); color: var(--nb-navy, #13348B); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.nk-seg__n { font-size: .72rem; padding: .05rem .45rem; border-radius: 999px; background: var(--nb-line); }
.nk-seg__n.is-alert { background: #BD0068; color: #fff; }
.nk-journal__list { display: flex; flex-direction: column; }
.nk-sight { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .8rem; padding: .85rem 1rem; border-bottom: 1px solid var(--nb-line); }
.nk-sight:last-child { border-bottom: 0; }
.nk-sight.is-pending { background: rgba(255, 196, 0, .07); } .nk-sight.is-mystery { background: rgba(19, 52, 139, .04); }
.nk-sight__pic { flex: 0 0 64px; height: 64px; border-radius: .8rem; overflow: hidden; display: grid; place-items: center; font-size: 2rem; background: var(--nb-surface-2); }
.nk-sight__pic img { width: 100%; height: 100%; object-fit: cover; }
.nk-sight__body { flex: 1 1 14rem; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.nk-sight__title { font-size: 1rem; }
.nk-sight__meta { display: flex; flex-wrap: wrap; gap: .25rem .8rem; font-size: .8rem; color: var(--nb-muted); align-items: center; }
.nk-sight__actions { display: flex; gap: .35rem; align-items: center; }
.nk-sight__check { flex: 1 1 100%; }
.nk-sight__check form { padding: .75rem; border-radius: .8rem; background: var(--nb-surface-2); }

/* phones: nothing may scroll the page sideways (wide tables keep their own scroller) */
@media (max-width: 767.98px) { .nk-content, .nk-kid-main { overflow-x: clip; } }

/* ══ Kid portal identity (/me/, body.nk-kid-portal) ═════════════════════════════════════════════════════════════
   Fredoka for what a kid reads at a glance (greetings, titles, numbers, tabs), Inter for sentences. One interaction
   language: things you can tap are "toy buttons" (rounded, a solid darker edge underneath that presses down);
   things you only read are flat panels. The kid's pet buddy is the one big thing on Home. */
.nk-kid-portal {
  --k-ink: #1E2A5A; --k-cloud: #F4F8FF; --k-leaf: #2FA35B; --k-sun: #FFB703; --k-berry: #E5487E; --k-sky: #DCEFFF;
  --k-panel: #fff; --k-edge: rgba(30, 42, 90, .14); --k-round: 'Fredoka', var(--nb-font, system-ui), sans-serif;
  background: var(--k-cloud); color: var(--k-ink);
}
[data-bs-theme="dark"] .nk-kid-portal { --k-ink: #E8EEFF; --k-cloud: #111a33; --k-panel: #1a2545; --k-sky: #1d3157; --k-edge: rgba(0, 0, 0, .45); }
.nk-kid-portal h1, .nk-kid-portal h2, .nk-kid-portal h3, .nk-kid-portal .h4, .nk-kid-portal .h5, .nk-kid-portal .nk-todo__title,
.nk-kid-portal .nk-kid-h1 { font-family: var(--k-round); font-weight: 600; letter-spacing: 0; }
.nk-kid-h1 { font-size: 1.75rem; margin: .25rem 0 1rem; }

/* header: the kid's own colour */
/* the colour behind the white text is the kid's colour darkened just enough for 4.5:1 (`|on_white_text`, dashboard/templatetags/nk.py) */
.nk-kid-portal .nk-kidbar { background: var(--kid-text-bg, var(--nb-navy)); background: linear-gradient(160deg, var(--kid-text-bg, #13348B), color-mix(in srgb, var(--kid-text-bg, #13348B) 85%, #000)); }
.nk-kid-portal .nk-kidbar__hi { font-family: var(--k-round); font-weight: 600; font-size: 1.6rem; }
.nk-kidtab { display: inline-flex; align-items: center; gap: .4rem; min-height: 48px; padding: .4rem 1.1rem; border-radius: 999px; font-family: var(--k-round);
  font-weight: 600; font-size: 1.05rem; color: #fff; text-decoration: none; background: rgba(255, 255, 255, .14); white-space: nowrap; }
.nk-kidtab:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.nk-kidtab.is-on { background: #fff; color: var(--k-ink); box-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
.nk-kid-portal .nk-bottombar--kid a { font-family: var(--k-round); font-weight: 600; font-size: .875rem; }
.nk-kid-portal .nk-bottombar--kid a.active { color: var(--kid, var(--nb-navy)); }
.nk-kid-portal .nk-bottombar--kid .nk-bottombar__emoji { font-size: 1.6rem; }

/* toy buttons: the only chunky, pressable things */
.nk-toy { --toy: var(--k-panel); --toy-edge: var(--k-edge); display: inline-flex; align-items: center; gap: .5rem; border: 2px solid var(--toy-edge);
  border-radius: 18px; background: var(--toy); color: var(--k-ink); box-shadow: 0 5px 0 var(--toy-edge); text-decoration: none;
  font-family: var(--k-round); font-weight: 600; transition: transform .08s ease, box-shadow .08s ease; cursor: pointer; }
.nk-toy:hover { color: var(--k-ink); filter: brightness(1.03); }
.nk-toy:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--toy-edge); }
.nk-toy:focus-visible { outline: 3px solid var(--kid, var(--nb-navy)); outline-offset: 3px; }
.nk-toy--go { --toy: #1f7f45; --toy-edge: #155c32; color: #fff; font-size: 1.25rem; min-height: 56px; padding: .6rem 1.4rem; }
.nk-toy--go:hover { color: #fff; }
@media (prefers-reduced-motion: reduce) { .nk-toy { transition: none; } }

/* Home: the buddy hero */
.nk-buddy { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); align-items: center; gap: 1.25rem; padding: 1.25rem;
  margin-bottom: 1rem; border-radius: 28px; background: var(--k-sky); }
.nk-buddy.is-done { background: color-mix(in srgb, var(--k-leaf) 18%, var(--k-cloud)); }
.nk-buddy__pet { width: 132px; height: 132px; display: grid; place-items: center; border-radius: 50%; background: var(--k-panel); font-size: 4.5rem;
  box-shadow: inset 0 -6px 0 rgba(30, 42, 90, .06); }
.nk-buddy__pet img { width: 112%; height: 112%; object-fit: contain; }
@media (prefers-reduced-motion: no-preference) { .nk-buddy__pet > * { animation: nkBob 3.2s ease-in-out infinite; } }
@keyframes nkBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.nk-buddy__name { font-family: var(--k-round); font-weight: 600; font-size: 1rem; opacity: .75; }
.nk-buddy__bubble { position: relative; margin: .35rem 0 .9rem; padding: .8rem 1rem; border-radius: 18px; background: var(--k-panel);
  font-family: var(--k-round); font-weight: 500; font-size: 1.35rem; line-height: 1.3; max-width: 30ch; }
.nk-buddy__bubble::before { content: ""; position: absolute; left: -10px; top: 1.1rem; border: 10px solid transparent; border-left: 0; border-right-color: var(--k-panel); }
.nk-buddy__bubble strong { font-weight: 600; }
.nk-buddy__meta { display: inline-block; margin-left: .6rem; font-size: .9rem; opacity: .75; }
@media (max-width: 575.98px) {
  .nk-buddy { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 1rem; }
  .nk-buddy__pet { width: 116px; height: 116px; font-size: 4rem; }
  .nk-buddy__bubble { font-size: 1.2rem; }
  .nk-buddy__bubble::before { left: calc(50% - 10px); top: -10px; border: 10px solid transparent; border-top: 0; border-bottom-color: var(--k-panel); }
  .nk-buddy .nk-toy--go { width: 100%; justify-content: center; }
  .nk-buddy__meta { display: block; margin: .5rem 0 0; }
}

/* numbers as pills, not a tile grid */
.nk-pills { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.25rem; }
.nk-pills li, .nk-pills a { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .9rem; border-radius: 999px; background: var(--k-panel);
  font-size: .95rem; color: var(--k-ink); text-decoration: none; }
.nk-pills b { font-family: var(--k-round); font-weight: 600; font-size: 1.2rem; }
.nk-pills li:has(a) { padding: 0; } .nk-pills li a { padding: .45rem .9rem; }

/* Today: one column of big tick rows */
.nk-kid-today { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1.5rem; align-items: start; }
.nk-kid-today > div { display: contents; }
@media (min-width: 992px) { .nk-kid-today { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } .nk-kid-today .nk-kid-nudge { grid-column: 2; } }
.nk-kid-portal .nk-todo__head h2, .nk-kid-portal .nk-todo__head { text-transform: none; letter-spacing: 0; color: var(--k-ink); }
.nk-kid-portal .nk-todo { border: 0; border-radius: 24px; background: var(--k-panel); }
.nk-kid-portal .nk-todo__head h2 { font-size: 1.3rem; }
.nk-kid-portal .nk-todo__title { font-size: 1.1rem; }
.nk-kid-portal .nk-check { width: 48px; height: 48px; border-width: 3px; }
.nk-kid-portal .nk-check.is-on { background: var(--k-leaf); border-color: var(--k-leaf); }
.nk-kid-nudge { display: flex; width: 100%; justify-content: center; padding: .9rem 1rem; font-size: 1.1rem; margin-bottom: 1rem; --toy: color-mix(in srgb, var(--k-sun) 30%, var(--k-panel)); }

/* Explore: big picture tiles */
.nk-kid-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1rem 1rem; }
@media (max-width: 575.98px) { .nk-kid-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; } }
.nk-kid-tile { flex-direction: column; align-items: flex-start; gap: .25rem; padding: 1.1rem 1rem 1.2rem; min-height: 9.5rem; }
.nk-kid-tile__emoji { font-size: 2.6rem; line-height: 1; margin-bottom: .35rem; }
.nk-kid-tile__title { font-size: 1.2rem; line-height: 1.2; }
.nk-kid-tile__text { font-family: var(--nb-font, system-ui), sans-serif; font-weight: 400; font-size: .9rem; opacity: .8; }
.nk-kid-tile.tone-leaf { --toy: color-mix(in srgb, var(--k-leaf) 16%, var(--k-panel)); --toy-edge: color-mix(in srgb, var(--k-leaf) 55%, #000 0%); }
.nk-kid-tile.tone-sky { --toy: color-mix(in srgb, #3D8BFF 14%, var(--k-panel)); --toy-edge: color-mix(in srgb, #3D8BFF 55%, transparent); }
.nk-kid-tile.tone-sun { --toy: color-mix(in srgb, var(--k-sun) 22%, var(--k-panel)); --toy-edge: color-mix(in srgb, #c98a00 70%, transparent); }
.nk-kid-tile.tone-berry { --toy: color-mix(in srgb, var(--k-berry) 14%, var(--k-panel)); --toy-edge: color-mix(in srgb, var(--k-berry) 60%, transparent); }

/* "How scientists sort life": a ladder going down — the staircase indent grows per step on wide screens */
.nk-ladder { list-style: none; margin: .9rem 0 0; padding: 0; position: relative; max-width: 52rem; }
.nk-ladder__step { position: relative; display: flex; gap: .85rem; align-items: flex-start; padding: 0 0 .9rem; margin-left: calc(var(--i) * 1.6rem); }
.nk-ladder__step:not(:last-child)::before { content: ""; position: absolute; left: 1.15rem; top: 2.4rem; bottom: .1rem; width: 3px; border-radius: 3px; background: var(--nb-line); }
.nk-ladder__n { flex: 0 0 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--nb-navy, #13348B);
  font-family: var(--k-round, inherit); box-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
.nk-ladder__body { flex: 1 1 auto; min-width: 0; padding: .55rem .9rem .6rem; border-radius: 16px; background: var(--k-panel, var(--nb-surface, #fff));
  border: 1px solid var(--nb-line); }
.nk-ladder__top { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.nk-ladder__rank { font-size: 1.05rem; font-family: var(--k-round, inherit); }
.nk-ladder__ex { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; background: #eaf7e6; color: #2d6a2d;
  font-weight: 600; font-size: .85rem; text-decoration: none; min-height: 32px; }
[data-bs-theme="dark"] .nk-ladder__ex { background: rgba(59, 141, 59, .25); color: #bfe6b5; }
.nk-ladder__kid { margin: .2rem 0 0; font-size: .95rem; }
.nk-ladder__more summary { font-size: .8rem; color: var(--nb-muted); cursor: pointer; margin-top: .2rem; min-height: 28px; }
.nk-ladder__more p { font-size: .85rem; color: var(--nb-muted); margin: .25rem 0 0; }
@media (max-width: 767.98px) { .nk-ladder__step { margin-left: calc(var(--i) * .45rem); } }

/* ══ Welcome splash (once per sign-in, templates/partials/preloader.html), navigation bar, busy buttons ════════════ */
.nk-splash { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  overflow: hidden; text-align: center; padding: 1.5rem; transition: opacity .4s ease;
  background: linear-gradient(160deg, #eaf0ff 0%, #fdeff6 50%, #eaf8ef 100%); color: var(--nb-ink, #13348B); }
.nk-splash::before, .nk-splash::after { content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.nk-splash::before { width: 24rem; height: 24rem; top: -6rem; left: -6rem; background: rgba(19, 52, 139, .22); }
.nk-splash::after { width: 22rem; height: 22rem; bottom: -6rem; right: -5rem; background: rgba(189, 0, 104, .16); }
[data-bs-theme="dark"] .nk-splash { background: linear-gradient(160deg, #0a1328 0%, #121c3d 55%, #0d2a22 100%); color: #e8eeff; }
.nk-splash.is-kid { background: linear-gradient(160deg, color-mix(in srgb, var(--kid, #13348B) 18%, #fff) 0%, #fff7dc 55%, #e8f8ec 100%); }
[data-bs-theme="dark"] .nk-splash.is-kid { background: linear-gradient(160deg, color-mix(in srgb, var(--kid, #13348B) 40%, #0a1328), #121c3d 60%, #0d2a22); }
.nk-splash.is-hidden { opacity: 0; pointer-events: none; }
.nk-splash__stage { position: relative; width: 15rem; height: 9.5rem; display: grid; place-items: center; }
.nk-splash__brand { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.nk-splash__brand img { border-radius: 1.1rem; box-shadow: 0 10px 28px rgba(19, 52, 139, .28); }
.nk-splash__name { font-weight: 800; font-size: 1.35rem; letter-spacing: -.01em; background: linear-gradient(90deg, #13348B, #BD0068); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-bs-theme="dark"] .nk-splash__name { background: linear-gradient(90deg, #8fb0ff, #ff6fb1); -webkit-background-clip: text; background-clip: text; }
.nk-splash__avatar { width: 6.5rem; height: 6.5rem; border-radius: 50%; display: grid; place-items: center; font-size: 3.6rem; background: #fff;
  box-shadow: 0 0 0 6px var(--kid, #13348B), 0 12px 30px rgba(0, 0, 0, .18); }
.nk-splash__float { position: absolute; font-size: 1.7rem; }
.nk-splash__float.f1 { top: 0; left: .5rem; } .nk-splash__float.f2 { top: .3rem; right: .4rem; }
.nk-splash__float.f3 { bottom: 0; left: 1.2rem; } .nk-splash__float.f4 { bottom: .3rem; right: 1rem; }
.nk-splash__title { font-size: 1.5rem; font-weight: 700; position: relative; }
.is-kid .nk-splash__title, .is-kid .nk-splash__step { font-family: 'Fredoka', var(--nb-font, system-ui), sans-serif; font-weight: 600; }
.nk-splash__step { color: var(--nb-muted, #5b6785); position: relative; min-height: 1.5em; }
.nk-splash__ring { position: relative; margin-top: .4rem; }
.nk-splash__track { fill: none; stroke: rgba(19, 52, 139, .14); stroke-width: 5; }
.nk-splash__fill { fill: none; stroke: #13348B; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 163.4; stroke-dashoffset: 163.4; }
.is-kid .nk-splash__fill { stroke: var(--kid, #13348B); }
[data-bs-theme="dark"] .nk-splash__fill { stroke: #8fb0ff; }
.nk-splash__skip { position: relative; color: var(--nb-muted, #5b6785); }
@media (prefers-reduced-motion: no-preference) {
  .nk-splash__brand { animation: nkSplashPop .5s cubic-bezier(.2, .8, .3, 1.15) both; }
  .nk-splash__title { animation: nkSplashUp .45s ease .3s both; }
  .nk-splash__step { animation: nkSplashUp .45s ease .4s both; }
  .nk-splash__ring, .nk-splash__skip { animation: nkSplashUp .45s ease .5s both; }
  .nk-splash__float { animation: nkSplashUp .5s ease both, nkBob 2.6s ease-in-out infinite; }
  .nk-splash__float.f2 { animation-delay: .1s, .3s; } .nk-splash__float.f3 { animation-delay: .2s, .6s; } .nk-splash__float.f4 { animation-delay: .3s, .9s; }
}
@keyframes nkSplashPop { from { opacity: 0; transform: scale(.75); } to { opacity: 1; transform: scale(1); } }
@keyframes nkSplashUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nk-splash { display: none; } }

/* slim navigation bar: only when a page takes longer than ~250 ms (nk.js) */
.nk-progress { position: fixed; top: 0; left: 0; z-index: 2001; height: 3px; width: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, #13348B, #BD0068); box-shadow: 0 0 8px rgba(189, 0, 104, .45); transition: width 8s cubic-bezier(.1, .7, .2, 1), opacity .3s; }
.nk-kid-portal .nk-progress { background: linear-gradient(90deg, var(--kid, #13348B), #FFB703); }
.nk-progress.is-on { opacity: 1; width: 85%; }
.nk-progress.is-done { opacity: 0; width: 100%; transition: width .2s ease, opacity .4s ease .2s; }
@media (prefers-reduced-motion: reduce) { .nk-progress { transition: opacity .2s; } .nk-progress.is-on { width: 100%; } }

/* picker rows: pick by tapping the name, learn first with ⓘ */
.nk-saw__row { list-style: none; }
.nk-saw__line { display: flex; gap: .35rem; align-items: stretch; }
.nk-saw__line .nk-saw__hit { flex: 1 1 auto; min-width: 0; }
.nk-saw__info { flex: 0 0 44px; min-height: 44px; border-radius: .75rem; border: 1px solid var(--nb-line); background: var(--nb-surface, #fff);
  font: italic 700 1.05rem Georgia, serif; color: var(--nb-navy, #13348B); }
.nk-saw__info[aria-expanded="true"] { background: var(--nb-navy, #13348B); color: #fff; border-color: var(--nb-navy, #13348B); }
.nk-saw__info:focus-visible { outline: 3px solid var(--nb-navy, #13348B); outline-offset: 2px; }
.nk-saw__more { margin: .3rem 0 .2rem; padding: .7rem .8rem; border-radius: .75rem; background: var(--nb-surface-2); }
.nk-saw__more p { margin: 0 0 .5rem; font-size: .92rem; }
.nk-saw__more-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.nk-saw__more-actions .btn { min-height: 40px; }
.nk-saw__save { margin-top: 1.5rem; }
.nk-saw__save .btn { width: 100%; min-height: 56px; font-size: 1.15rem; }
@media (min-width: 576px) { .nk-saw__save { display: flex; justify-content: flex-end; } .nk-saw__save .btn { width: auto; padding-inline: 2.5rem; } }

/* kid portal: every tap target is finger-sized, no shouting capitals, page titles never squeezed by their buttons */
.nk-kid-portal * { text-transform: none !important; }
.nk-kid-portal .btn, .nk-kid-portal .btn-sm, .nk-kid-portal .nk-chip-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.nk-kid-portal .form-check-input { width: 1.4rem; height: 1.4rem; margin-top: .1rem; }
.nk-kid-portal .nk-ladder__ex { min-height: 40px; }
.nk-kid-portal .nk-ladder__more summary { min-height: 40px; display: flex; align-items: center; }
.nk-kid-portal .nk-todo__title a, .nk-kid-portal .nk-todo__meta a { display: inline-block; padding: .5rem .1rem; margin: -.5rem 0; }
.nk-kid-portal .d-flex:has(> h1) { flex-wrap: wrap; row-gap: .6rem; }
@media (max-width: 767.98px) {
  .nk-kid-portal .d-flex:has(> h1) > h1 { flex: 1 1 100%; }
  .nk-kid-portal .d-flex:has(> h1) > .ms-auto, .nk-kid-portal .d-flex:has(> h1) > span.ms-auto { margin-left: 0 !important; }
}
/* the kid tab bar is taller than the adult one (big emoji): keep the last button of a page clear of it */
@media (max-width: 991.98px) { .nk-kid-portal .nk-kid-main { padding-bottom: calc(var(--nb-bottombar-h) + 3rem + env(safe-area-inset-bottom)); } }

/* an empty field guide says so across the whole row, not in one small tile */
.nk-guide-grid > .card:only-child, .nk-guide-grid > .card:has(.empty) { grid-column: 1 / -1; }
/* dark mode: the white active tab keeps dark ink; links stay readable on the dark panels */
.nk-kidtab.is-on, .nk-kidtab.is-on:hover { color: #1E2A5A; }
[data-bs-theme="dark"] .nk-kid-portal main a:not(.btn):not(.nk-toy):not(.nk-kidtab):not(.nk-ladder__ex):not(.nk-saw__hit),
[data-bs-theme="dark"] .nk-kid-portal .alert a { color: #a9c8ff; }

/* kid page header (kidweb/_page_head.html): icon tile → title → one short line, then the actions as chips */
.nk-kpage { display: flex; align-items: center; gap: .9rem; margin: .25rem 0 .9rem; }
.nk-kpage__icon { flex: 0 0 3.25rem; height: 3.25rem; display: grid; place-items: center; border-radius: 14px; font-size: 1.75rem; line-height: 1;
  background: color-mix(in srgb, var(--kid, #13348B) 16%, var(--k-panel, #fff)); box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--kid, #13348B) 22%, transparent); }
.nk-kpage__text { min-width: 0; }
.nk-kpage__title { font-size: 1.6rem; line-height: 1.15; margin: 0; color: var(--k-ink, var(--nb-ink)); }
.nk-kpage__line { margin: .25rem 0 0; font-size: 1.05rem; line-height: 1.4; color: color-mix(in srgb, var(--k-ink, #1E2A5A) 85%, transparent); max-width: 42ch; }
.nk-kpage.is-plain { display: block; }
.nk-kpage__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
@media (max-width: 575.98px) {
  .nk-kpage__title { font-size: 1.4rem; }
  .nk-kpage__actions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -1rem; padding: 0 1rem .4rem; }
  .nk-kpage__actions::-webkit-scrollbar { display: none; }
}
.nk-toy--chip { min-height: 44px; padding: .35rem 1rem; gap: .45rem; font-size: 1rem; border-radius: 999px; white-space: nowrap; flex: 0 0 auto; box-shadow: 0 3px 0 var(--toy-edge); }
.nk-toy--chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--toy-edge); }
.nk-toy--chip.is-main { --toy: #1f7f45; --toy-edge: #155c32; color: #fff; }  /* same readable green as .nk-toy--go */
.nk-toy--chip.is-main:hover { color: #fff; }
/* secondary text in the kid portal: readable ink, not pale grey */
.nk-kid-portal main .text-muted { color: color-mix(in srgb, var(--k-ink, #1E2A5A) 72%, transparent) !important; }
.nk-saw__kemoji { font-size: 1.75rem; line-height: 1; }
[data-bs-theme="dark"] .nk-kid-portal .nk-bottombar--kid a.active { color: color-mix(in srgb, var(--kid, #8fb0ff) 45%, #fff); }
.nk-new-request > .btn { border-radius: 999px 0 0 999px; } .nk-new-request > .nk-new-request__x { border-radius: 0 999px 999px 0; padding-inline: .8rem; border-left: 1px solid rgba(255, 255, 255, .35); }

/* ---- Activities (dashboard/activities.py): thin weekly-goal bar under a chore row (parent page, kid home, personal) ---- */
.nk-goal-bar { height: .35rem; max-width: 12rem; margin-top: .3rem; background: color-mix(in srgb, var(--bs-primary) 14%, transparent); }
.nk-goal-bar .progress-bar { background: var(--bs-primary); transition: width .4s ease; }
.nk-kid-portal .nk-goal-bar { height: .5rem; border-radius: 999px; background: color-mix(in srgb, var(--k-sky, #DCEFFF) 80%, var(--k-panel, #fff)); }
.nk-kid-portal .nk-goal-bar .progress-bar { border-radius: 999px; background: var(--k-ink, var(--bs-primary)); }

/* ---- Battle stage (pets/_battle_stage.html + _arena_board.html, static/js/nk-battle-stage.js + nk-arena.js + nk-battle-cards.js):
   the arena's scene (pets/scenes.py, one per climate), both pets standing in it, name plates on top and an SVG effects layer.
   The pets move through the Web Animations API on `.nk-fighter__body`; the scene's slow ambient motion is the nkScene… keyframes
   below, and everything stops under reduced motion (the media query and html.nk-motion-reduce). ---- */
.nk-arena { position: relative; }
.nk-stage { position: relative; overflow: hidden; isolation: isolate; border-radius: 1rem; aspect-ratio: 16 / 9; min-height: 16rem; max-height: 30rem; width: 100%; background: #6EC3F4;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, #000 12%, transparent); }
.nk-stage__world { position: absolute; inset: 0; will-change: transform; }
.nk-scene, .nk-stage__fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.nk-stage__fx { pointer-events: none; overflow: visible; z-index: 3; }
.nk-stage__weather { z-index: 1; }
.nk-arena__stage { position: static; }
.nk-fighter { position: static; }
.nk-fighter__figure { position: absolute; z-index: 2; bottom: 9%; font-size: 4.2rem; line-height: 1; }
.nk-fighter.is-left .nk-fighter__figure { left: 13%; } .nk-fighter.is-right .nk-fighter__figure { right: 13%; }
.nk-fighter__figure::before { content: ''; position: absolute; left: 12%; right: 12%; bottom: -.35rem; height: .9rem; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.38), rgba(0,0,0,0)); }
.nk-fighter__body { position: relative; display: inline-block; transform-origin: 50% 100%; will-change: transform; animation: nkStageIdle 2.8s ease-in-out infinite; }
.nk-fighter.is-right .nk-fighter__body { animation-delay: -1.3s; }
.nk-fighter__art { width: 9rem; height: 9rem; object-fit: contain; display: block; filter: drop-shadow(0 .15rem .2rem rgba(0,0,0,.25)); }
/* Fighters face each other: a picture records which way it looks (`data-facing`, pets/art.py); the left fighter must look
   right and the right one left, so only a picture looking the wrong way is mirrored. Emoji count as looking left. */
.nk-fighter__emoji { display: inline-block; }
.nk-fighter.is-left [data-facing="left"], .nk-fighter.is-right [data-facing="right"] { transform: scaleX(-1); }
.nk-fighter__figure.el-glow .nk-fighter__body { filter: drop-shadow(0 0 12px var(--glow, #f59e0b)); }
/* Gear rides inside the body, so it moves with every lunge and knock-back: the fang in front (towards the other pet), the
   shell behind, the charm over the head, the crystal at the feet. */
.nk-fighter__orbit { position: absolute; inset: -.5rem; pointer-events: none; display: block; }
.nk-fighter__orbit span { position: absolute; font-size: 1.35rem; line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,.35); transform-origin: 50% 80%; }
.nk-fighter__orbit [data-slot="weapon"] { right: -.7rem; top: 38%; font-size: 1.7rem; } .nk-fighter__orbit [data-slot="shield"] { left: -.7rem; top: 42%; }
.nk-fighter.is-right .nk-fighter__orbit [data-slot="weapon"] { right: auto; left: -.7rem; } .nk-fighter.is-right .nk-fighter__orbit [data-slot="shield"] { left: auto; right: -.7rem; }
.nk-fighter__orbit [data-slot="charm"] { left: 50%; top: -.6rem; margin-left: -.7rem; } .nk-fighter__orbit [data-slot="crystal"] { left: 50%; bottom: -.9rem; margin-left: -.7rem; }
.nk-fighter__face { position: absolute; top: -1.1rem; width: 2.75rem; height: 2.75rem; padding: .2rem; border-radius: 50%; background: #fff; box-shadow: 0 .15rem .4rem rgba(0,0,0,.3); image-rendering: pixelated; animation: nkStageFace .35s cubic-bezier(.2,.9,.3,1.5); }
.nk-fighter.is-left .nk-fighter__face { right: -1.4rem; } .nk-fighter.is-right .nk-fighter__face { left: -1.4rem; }
.nk-fighter.is-up .nk-fighter__figure::before { background: radial-gradient(closest-side, #FFE27A, rgba(255,226,122,0) 75%); height: 1.3rem; bottom: -.55rem; left: 0; right: 0; animation: nkStageRing 1.2s ease-in-out infinite; }
/* Name plates: readable on any scene, in light and dark. */
.nk-fighter__plate { position: absolute; z-index: 4; top: .6rem; width: min(44%, 17rem); padding: .4rem .65rem .45rem; border-radius: .85rem; text-align: left;
  background: color-mix(in srgb, var(--nb-surface, #fff) 88%, transparent); color: var(--nb-ink, #1E2A5A); box-shadow: 0 .2rem .6rem rgba(0,0,0,.22); }
.nk-fighter.is-left .nk-fighter__plate { left: .6rem; } .nk-fighter.is-right .nk-fighter__plate { right: .6rem; }
.nk-fighter.is-up .nk-fighter__plate { box-shadow: 0 0 0 3px #FFD54A, 0 .2rem .6rem rgba(0,0,0,.22); }
.nk-fighter__name { font-weight: 800; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nk-fighter__title, .nk-fighter__meta { font-size: .75rem; color: var(--nb-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nk-hp { position: relative; height: .75rem; border-radius: 999px; background: color-mix(in srgb, var(--nb-ink, #1E2A5A) 18%, var(--nb-surface, #fff)); overflow: hidden; margin-top: .3rem; }
.nk-hp__bar, .nk-hp__ghost { position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: 999px; }
.nk-hp__bar { background: var(--nb-success); transition: width .35s ease, background .3s; }
.nk-hp__ghost { background: #FFD54A; transition: width .7s ease .45s; }
.nk-hp__bar.mid { background: #f59e0b; } .nk-hp__bar.low { background: var(--nb-danger, #c0392b); }
.nk-hp__num { font-size: .75rem; color: var(--nb-muted); font-variant-numeric: tabular-nums; }
.nk-arena__round { position: absolute; z-index: 4; left: 50%; bottom: .5rem; transform: translateX(-50%); padding: .15rem .7rem; border-radius: 999px; font-weight: 800; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  background: rgba(20, 24, 48, .62); color: #fff; }
.nk-stage__title { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; pointer-events: none; text-align: center; font-weight: 900; color: #fff; opacity: 0;
  text-shadow: 0 .15rem 0 rgba(0,0,0,.45), 0 0 1rem rgba(0,0,0,.5); }
.nk-stage__title b { font-size: 3.2rem; line-height: 1; letter-spacing: .04em; } .nk-stage__title span { font-size: 1.35rem; }
.nk-arena__banner { position: absolute; z-index: 5; left: 50%; top: 46%; transform: translate(-50%, -50%); display: none; padding: .45rem 1.1rem; border-radius: 999px; font-size: 1.5rem; font-weight: 900; white-space: nowrap; pointer-events: none;
  background: rgba(20, 24, 48, .78); color: #fff; box-shadow: 0 .3rem 1rem rgba(0,0,0,.35); }
.nk-arena__banner.show { display: block; animation: nkStageBanner .5s cubic-bezier(.2,.9,.3,1.4); }
.nk-pop { position: absolute; z-index: 6; left: 50%; top: -12%; transform: translateX(-50%); font-weight: 900; font-size: 1.7rem; color: #fff; pointer-events: none; animation: nkFloat 1s forwards; white-space: nowrap;
  text-shadow: 0 .1rem 0 #7f1d1d, .1rem 0 0 #7f1d1d, -.1rem 0 0 #7f1d1d, 0 -.1rem 0 #7f1d1d, 0 .25rem .4rem rgba(0,0,0,.4); }
.nk-pop.heal { text-shadow: 0 .1rem 0 #14532d, .1rem 0 0 #14532d, -.1rem 0 0 #14532d, 0 -.1rem 0 #14532d, 0 .25rem .4rem rgba(0,0,0,.4); }
.nk-pop.is-crit { font-size: 2.3rem; color: #FFE27A; }
.nk-badge { position: absolute; z-index: 6; left: 50%; transform: translateX(-50%); bottom: 100%; margin-bottom: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 800; letter-spacing: .06em; animation: nkBadgePop .4s; white-space: nowrap; box-shadow: 0 .1rem .3rem rgba(0,0,0,.25); }
.nk-badge + .nk-badge { margin-bottom: 1.9rem; }
.nk-badge.crit { background: #fde68a; color: #92400e; } .nk-badge.blocked { background: #bfdbfe; color: #1e3a8a; } .nk-badge.reroll { background: #e9d5ff; color: #581c87; } .nk-badge.element { background: #fecaca; color: #7f1d1d; }
.nk-badge.guard { background: #d1fae5; color: #065f46; } .nk-badge.dodge { background: #e0f2fe; color: #0c4a6e; } .nk-badge.counter { background: #fef3c7; color: #78350f; } .nk-badge.special { background: #fae8ff; color: #701a75; }
.nk-arena__log { font-size: .9rem; color: var(--nb-muted); min-height: 1.4em; text-align: center; margin-top: .6rem; }
.nk-arena__controls { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: .75rem; }
.nk-arena__controls .btn { min-height: 44px; }
.nk-arena__result { margin: .75rem auto 0; max-width: 34rem; padding: .9rem 1rem; border-radius: 1rem; text-align: center; background: color-mix(in srgb, var(--bs-primary) 8%, var(--nb-surface, #fff)); border: 2px solid color-mix(in srgb, var(--bs-primary) 22%, transparent); }
.nk-arena__result h2 { font-size: 1.35rem; margin: 0 0 .35rem; }
.nk-arena__result dl { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.25rem; margin: 0 0 .6rem; font-size: .9rem; }
.nk-arena__result dl div { display: flex; gap: .35rem; } .nk-arena__result dt { font-weight: 400; color: var(--nb-muted); } .nk-arena__result dd { margin: 0; font-weight: 800; }
.nk-arena__result p { margin: 0 0 .6rem; font-size: .9rem; }
.nk-charge { display: inline-flex; gap: .2rem; vertical-align: middle; margin-left: .3rem; }
.nk-charge i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--nb-line); display: inline-block; }
.nk-charge i.on { background: #a855f7; box-shadow: 0 0 6px #a855f7; }
.nk-fighter__flags { font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nk-arena__turn { text-align: center; font-weight: 800; font-size: 1.1rem; margin-top: .35rem; min-height: 1.4em; }
.nk-arena__moves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-top: .6rem; }
.nk-arena__moves .btn, .nk-arena__moves .nk-toy { width: 100%; justify-content: center; min-height: 52px; font-size: 1.05rem; }
.nk-arena__moves .btn:disabled, .nk-arena__moves .nk-toy:disabled { opacity: .45; }
.nk-arena__moves small { display: block; font-size: .75rem; font-weight: 400; opacity: .8; }
.nk-arena__pass { position: absolute; inset: 0; z-index: 8; display: none; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; border-radius: 1rem; background: color-mix(in srgb, var(--nb-surface, #fff) 94%, transparent); text-align: center; padding: 1rem; }
.nk-arena__pass.show { display: flex; }
.nk-arena__pass .h4 { margin: 0; }
.nk-arena__history { list-style: none; margin: .75rem 0 0; padding: 0; font-size: .85rem; max-height: 12rem; overflow-y: auto; }
.nk-arena__history li { padding: .15rem 0; border-bottom: 1px dashed var(--nb-line); }
.nk-arena__history li:last-child { border-bottom: 0; }
/* Scene ambient motion (the SVGs in pets/templates/pets/scenes/). */
.nk-scene__drift { animation: nkSceneDrift 60s linear infinite alternate; } .nk-scene__drift.is-slow { animation-duration: 95s; } .nk-scene__drift.is-fast { animation-duration: 22s; }
.nk-scene__pulse { animation: nkScenePulse 3.2s ease-in-out infinite; }
.nk-scene__sway { transform-box: fill-box; transform-origin: 50% 100%; animation: nkSceneSway 4.5s ease-in-out infinite alternate; } .nk-scene__sway.is-fast { animation-duration: 1.2s; }
.nk-scene__smoke { animation: nkSceneSmoke 9s ease-in-out infinite alternate; }
.nk-scene__flash { animation: nkSceneFlash 7s linear infinite; }
.nk-scene__ripple { transform-box: fill-box; transform-origin: 50% 50%; animation: nkSceneRipple 2.4s ease-out infinite; } .nk-scene__ripple.is-late { animation-delay: -1.2s; }
.nk-scene__gust { animation: nkSceneGust 3.6s linear infinite; }
.nk-scene__spin { transform-box: fill-box; transform-origin: 50% 50%; animation: nkSceneSpin 50s linear infinite; }
.nk-scene__shimmer { animation: nkSceneShimmer 2.6s ease-in-out infinite alternate; }
.nk-scene__roll { animation: nkSceneRoll 14s linear infinite; }
.nk-scene__aurora { animation: nkSceneAurora 8s ease-in-out infinite alternate; }
.nk-scene__twinkle { animation: nkSceneTwinkle 2.2s ease-in-out infinite; } .nk-scene__twinkle.is-late { animation-delay: -1.1s; }
.nk-scene__flag { transform-box: fill-box; transform-origin: 0 50%; animation: nkSceneFlag .7s ease-in-out infinite alternate; }
/* A card battle's two cards of the round, turned over in the middle of the stage (nk-battle-cards.js). */
.nk-stage__cards { position: absolute; z-index: 5; left: 50%; top: 46%; transform: translate(-50%, -50%); display: flex; gap: .75rem; pointer-events: none; }
.nk-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; width: 4.5rem; height: 6rem; border-radius: .7rem; background: #fff; border: 3px solid #1E2A5A; color: #1E2A5A;
  font-size: 2rem; line-height: 1; box-shadow: 0 .3rem .8rem rgba(0,0,0,.35); animation: nkStageCard .4s cubic-bezier(.2,.9,.3,1.3) both; transition: transform .25s, opacity .25s, box-shadow .25s; }
.nk-card + .nk-card { animation-delay: .15s; }
.nk-card small { font-size: .75rem; font-weight: 800; }
.nk-card.is-edge { border-color: #F5B700; box-shadow: 0 0 0 4px #FFE27A, 0 .3rem 1rem rgba(0,0,0,.4); transform: translateY(-.4rem) scale(1.1); }
.nk-card.is-lost { opacity: .55; transform: scale(.94); }
@keyframes nkStageCard { 0% { transform: rotateY(90deg) scale(.6); opacity: 0; } 100% { transform: rotateY(0) scale(1); opacity: 1; } }
.nk-card-order { min-width: 9.5rem; min-height: 2.75rem; }   /* the card order select beside Fight! / Accept */
/* Lasting status auras drawn into the effects layer. */
.nk-aura__flicker { transform-box: fill-box; transform-origin: 50% 100%; animation: nkStageFlicker .5s ease-in-out infinite alternate; }
.nk-aura__drip { animation: nkStageDrip 1.1s ease-in infinite; }
.nk-aura__orbit { transform-box: fill-box; transform-origin: 50% 50%; animation: nkStageOrbit 1.6s linear infinite; }
.nk-aura__blink { animation: nkStageBlink .45s steps(2) infinite; }
@keyframes nkStageIdle { 0%,100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-.2rem) scale(1.015, .985); } }
@keyframes nkStageRing { 0%,100% { opacity: .55; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes nkStageFace { 0% { transform: scale(.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes nkStageBanner { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes nkStageFlicker { 0% { transform: scale(1, .8); opacity: .75; } 100% { transform: scale(.9, 1.15); opacity: 1; } }
@keyframes nkStageDrip { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(26px); opacity: 0; } }
@keyframes nkStageOrbit { to { transform: rotate(360deg); } }
@keyframes nkStageBlink { 0% { opacity: 1; } 100% { opacity: .15; } }
@keyframes nkSceneDrift { from { transform: translateX(-40px); } to { transform: translateX(60px); } }
@keyframes nkScenePulse { 0%,100% { opacity: .65; } 50% { opacity: 1; } }
@keyframes nkSceneSway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@keyframes nkSceneSmoke { from { transform: translate(0, 0); } to { transform: translate(26px, -12px); } }
@keyframes nkSceneFlash { 0%,91%,100% { opacity: 0; } 92% { opacity: .75; } 93% { opacity: .1; } 94% { opacity: .55; } 96% { opacity: 0; } }
@keyframes nkSceneRipple { 0% { transform: scale(.3); opacity: .7; } 100% { transform: scale(1.1); opacity: 0; } }
@keyframes nkSceneGust { from { transform: translateX(-200px); } to { transform: translateX(1100px); } }
@keyframes nkSceneSpin { to { transform: rotate(360deg); } }
@keyframes nkSceneShimmer { from { transform: translateX(-8px); opacity: .25; } to { transform: translateX(8px); opacity: .6; } }
@keyframes nkSceneRoll { from { transform: translateX(-40px) rotate(0deg); } to { transform: translateX(860px); } }
@keyframes nkSceneAurora { from { transform: translateY(-10px) scaleY(.9); opacity: .6; } to { transform: translateY(12px) scaleY(1.15); opacity: 1; } }
@keyframes nkSceneTwinkle { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes nkSceneFlag { from { transform: scaleX(1) skewY(-4deg); } to { transform: scaleX(.88) skewY(5deg); } }
@keyframes nkFloat { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -38px) scale(1); } }
/* own name: a second "nkPop" here used to replace the tree's one and dropped every tree node at the centre */
@keyframes nkBadgePop { 0% { transform: translateX(-50%) scale(.4); opacity: 0; } 100% { transform: translateX(-50%) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nk-hp__bar, .nk-hp__ghost { transition: none !important; } .nk-fighter__body, .nk-pop, .nk-badge, .nk-card, .nk-scene *, .nk-stage__fx * { animation: none !important; } }
html.nk-motion-reduce .nk-hp__bar, html.nk-motion-reduce .nk-hp__ghost { transition: none !important; }
@media (min-width: 992px) { .nk-fighter__art { width: 11rem; height: 11rem; } .nk-fighter__figure { font-size: 5rem; } }
.nk-kid-portal .nk-stage { border: 3px solid var(--k-edge, #e8e8f0); box-shadow: none; }
.nk-kid-portal .nk-fighter__name, .nk-kid-portal .nk-arena__turn, .nk-kid-portal .nk-arena__result h2 { font-family: var(--k-round, inherit); }
/* Battles stay playful for older kids too: the move buttons keep their toy look in the clean and grown-up looks. */
@media (max-width: 575.98px) {
  .nk-stage { aspect-ratio: 1 / 1; min-height: 21rem; max-height: 24rem; }
  .nk-fighter__art { width: 6.5rem; height: 6.5rem; } .nk-fighter__figure { font-size: 3.2rem; bottom: 13%; }
  .nk-fighter.is-left .nk-fighter__figure { left: 6%; } .nk-fighter.is-right .nk-fighter__figure { right: 6%; }
  .nk-fighter__plate { top: .4rem; width: calc(50% - .6rem); padding: .3rem .45rem .3rem; }
  .nk-fighter__title, .nk-fighter__meta, .nk-fighter__flags { display: none; }
  .nk-fighter__plate .nk-hp { margin-top: .2rem; } .nk-fighter__plate .nk-hp__num { line-height: 1.25; }
  .nk-arena__banner { top: 42%; }
  .nk-fighter.is-left .nk-fighter__plate { left: .4rem; } .nk-fighter.is-right .nk-fighter__plate { right: .4rem; }
  .nk-stage__title b { font-size: 2.4rem; } .nk-stage__title span { font-size: 1.1rem; } .nk-arena__banner { font-size: 1.2rem; }
  .nk-status-chip span { display: none; }
}

/* "I saw something" picker: the kinds of the chosen sort as picture tiles before anything is typed */
.nk-saw__results.is-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .5rem; list-style: none; padding: 0; margin: .5rem 0 0; }
.nk-saw__tile { width: 100%; min-height: 44px; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .55rem .35rem; border: 1px solid var(--nb-line); border-radius: .9rem; background: var(--nb-surface, #fff); color: inherit; font-size: .82rem; font-weight: 600; line-height: 1.15; text-align: center; }
.nk-saw__tile:hover, .nk-saw__tile:focus-visible { border-color: var(--nb-navy, #13348B); box-shadow: 0 0 0 2px color-mix(in srgb, var(--nb-navy, #13348B) 25%, transparent); }
.nk-saw__tile img { width: 64px; height: 64px; }
.nk-saw__tile-emoji { font-size: 2.4rem; line-height: 64px; }
.nk-saw__tiles-more { grid-column: 1 / -1; font-size: .8rem; color: var(--nb-muted); }
.nk-saw__hemoji img, .nk-saw__picked [data-emoji] img { width: 32px; height: 32px; vertical-align: middle; }
@media (max-width: 575.98px) { .nk-saw__results.is-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .nk-saw__tile img { width: 56px; height: 56px; } }

/* Learning (learning app): adult setting rows, kid practice rounds (number pad, choices, progress dots). */
.nk-learn-row { align-items: flex-start; }
.nk-learn-row__fields { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.nk-learn-row__fields .form-select { width: auto; min-width: 12rem; }
.nk-learn-row__cap { width: 9rem; }
.nk-learn-row__topics { display: flex; flex-wrap: wrap; gap: .35rem; border: 0; padding: 0; margin: 0; flex: 1 1 100%; }
.nk-learn-card { border: 0; border-radius: 24px; background: var(--k-panel, #fff); padding: 1.1rem 1.2rem; }
.nk-learn-topics { display: flex; flex-wrap: wrap; gap: .5rem; border: 0; padding: 0; margin: 0; }
.nk-learn-topics legend { float: none; width: 100%; font-size: .9rem; }
.nk-learn-topics .btn-check:checked + .nk-toy { --toy: var(--k-sun, #FFB703); --toy-edge: #c98f00; }
.nk-learn-topics .btn-check:focus-visible + .nk-toy { outline: 3px solid var(--kid, var(--nb-navy)); outline-offset: 3px; }
.nk-learn-round { max-width: 28rem; margin: 0 auto 2rem; text-align: center; }
.nk-learn-dots { display: flex; justify-content: center; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.nk-learn-dots li { width: .9rem; height: .9rem; border-radius: 50%; background: var(--k-edge, #ccd); }
.nk-learn-dots li.is-now { background: var(--k-sun, #FFB703); transform: scale(1.25); }
.nk-learn-dots li.is-right { background: var(--k-leaf, #2FA35B); }
.nk-learn-dots li.is-wrong { background: var(--k-berry, #E5487E); }
.nk-learn-feedback { display: inline-block; margin-bottom: .75rem; padding: .4rem 1rem; border-radius: 999px; font-family: var(--k-round); font-weight: 600; font-size: 1.1rem; }
.nk-learn-feedback.is-right { background: color-mix(in srgb, var(--k-leaf, #2FA35B) 20%, transparent); }
.nk-learn-feedback.is-wrong { background: color-mix(in srgb, var(--k-berry, #E5487E) 18%, transparent); }
.nk-learn-q { font-family: var(--k-round); font-weight: 600; font-size: clamp(2.2rem, 9vw, 3.4rem); margin: .5rem 0 1rem; }
.nk-learn-input { width: 100%; max-width: 14rem; margin: 0 auto 1rem; display: block; text-align: center; font-family: var(--k-round); font-weight: 600;
  font-size: 2.2rem; border: 2px solid var(--k-edge, #ccd); border-radius: 18px; background: var(--k-panel, #fff); color: var(--k-ink, inherit); padding: .3rem .5rem; }
.nk-learn-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; max-width: 18rem; margin: 0 auto; }
.nk-learn-pad .nk-toy, .nk-learn-choices .nk-toy { justify-content: center; min-height: 64px; font-size: 1.7rem; }
.nk-learn-pad .nk-toy--go { font-size: 1.7rem; padding: .4rem; }
.nk-learn-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; max-width: 20rem; margin: 0 auto; }
.nk-learn-q--text { font-size: clamp(1.25rem, 5vw, 1.6rem); line-height: 1.35; text-align: start; }
.nk-learn-round--bank { max-width: 34rem; }
.nk-learn-round--bank .nk-learn-q { text-align: start; }
.nk-learn-img { display: block; max-width: 100%; max-height: 16rem; margin: 0 auto .75rem; border-radius: 16px; }
.nk-learn-why { text-align: start; margin: 0 0 1rem; padding: .6rem .9rem; border-radius: 14px; background: color-mix(in srgb, var(--k-sky, #4CC9F0) 14%, transparent); }
.nk-learn-hint { margin: 0 0 1rem; text-align: start; }
.nk-learn-hint summary { list-style: none; width: fit-content; }
.nk-learn-hint summary::-webkit-details-marker { display: none; }
.nk-learn-hint p { margin: .6rem 0 0; }
.nk-learn-answer { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.nk-learn-answer .nk-learn-input { margin: 0 0 1rem; }
.nk-learn-unit { font-family: var(--k-round); font-weight: 600; font-size: 1.4rem; margin-bottom: 1rem; }
.nk-learn-unit--pick { width: auto; min-height: 2.75rem; padding-block: .25rem; border-radius: .9rem; }
.nk-learn-input--text { max-width: 100%; font-size: 1.4rem; }
.nk-learn-choices--text { grid-template-columns: 1fr; max-width: 100%; }
.nk-learn-choices--text .nk-toy { font-size: 1.15rem; min-height: 56px; text-align: start; justify-content: flex-start; }
.nk-learn-multi { border: 0; padding: 0; margin: 0 auto; }
.nk-learn-multi legend { float: none; width: 100%; }
.nk-learn-multi .btn-check:checked + .nk-toy { --toy: var(--k-sun, #FFB703); --toy-edge: #c98f00; }
.nk-learn-multi .btn-check:focus-visible + .nk-toy { outline: 3px solid var(--kid, var(--nb-navy)); outline-offset: 3px; }
.nk-learn-list { border: 0; padding: 0; margin: 0; text-align: start; }
.nk-learn-list legend { float: none; width: 100%; }
.nk-learn-list__row { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.nk-learn-list__row .form-select { min-height: 48px; font-size: 1.05rem; }
.nk-learn-list__num { font-family: var(--k-round); font-weight: 600; font-size: 1.3rem; min-width: 1.6rem; }
.nk-learn-list__left { flex: 0 1 45%; font-weight: 600; }
.nk-learn-preview { min-height: 2.2rem; font-size: 1.4rem; margin: -.5rem 0 .75rem; }
.nk-learn-symbols { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; }
.nk-learn-symbols .nk-toy { min-width: 48px; min-height: 48px; justify-content: center; font-size: 1.15rem; }
.nk-learn-stars { font-family: var(--k-round); font-weight: 600; font-size: 2.6rem; margin: 0 0 .5rem; }
.nk-learn-tile { display: flex; width: 100%; justify-content: center; padding: .9rem 1rem; font-size: 1.1rem; margin-bottom: 1rem;
  --toy: color-mix(in srgb, var(--k-sky, #DCEFFF) 70%, var(--k-panel, #fff)); }

/* Learning question bank (learning/bank/*.html) */
.nk-bank-filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.nk-bank-filters .form-select, .nk-bank-filters .form-control { width: auto; flex: 1 1 10rem; }
.nk-bank-thumb { width: 3rem; height: 3rem; object-fit: cover; border-radius: .5rem; flex: none; }
.nk-bank-thumb--lg { width: 5rem; height: 5rem; }
.nk-bank-subject { display: flex; flex-wrap: wrap; gap: .4rem; }
.nk-bank-subject .form-control { flex: 1 1 10rem; }
.nk-bank-subject .nk-bank-emoji { flex: 0 0 4.5rem; }
.nk-bank-pre { font-size: .8rem; white-space: pre-wrap; word-break: break-word; background: var(--bs-tertiary-bg); padding: .75rem; border-radius: .5rem; }
.nk-bank-preview { min-height: 1.6rem; font-size: 1.2rem; }
@media (min-width: 992px) { .nk-bank-side { position: sticky; top: 5rem; } }
.nk-learn-multi .nk-toy::before { content: "⬜"; margin-inline-end: .6rem; }
.nk-learn-multi .btn-check:checked + .nk-toy::before { content: "✅"; }

/* Kid tabs: a berry count on 🐾 My pet when a challenge or an arena move is waiting (kidweb.views.kid_tabs). */
.nk-kidtab .nk-kidtab__count { min-width: 1.35rem; height: 1.35rem; font-family: inherit; }
.nk-bottombar--kid a { position: relative; }
.nk-bottombar--kid .nk-kidtab__count { position: absolute; top: .15rem; left: calc(50% + .45rem); min-width: 1.2rem; height: 1.2rem; font-size: .7rem; }
/* "Battle on!" card (kid Home, grown-up Today). */
.nk-battle-news .nk-battle-news__row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding: .6rem 0; border-top: 1px solid var(--bs-border-color); }
.nk-battle-news .nk-battle-news__row:first-of-type { border-top: 0; }
.nk-battle-news__pet { font-size: 1.6rem; line-height: 1; }
.nk-battle-news__text { flex: 1 1 9rem; min-width: 0; overflow-wrap: normal; word-break: normal; }  /* a real basis: names wrap by word, not by letter */
.nk-battle-news__row > form { margin-left: auto; }  /* on a narrow card the buttons drop below the text, right-aligned */

/* ---- Battles v2 on the board: MP bar, status chips, the climate banner, stage-based move buttons ---- */
.nk-mp { height: .45rem; border-radius: 999px; background: var(--nb-line); overflow: hidden; margin-top: .25rem; }
.nk-mp__bar { height: 100%; width: 0; border-radius: 999px; background: #7c3aed; transition: width .5s ease; }
.nk-fighter__status { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .2rem; }
.nk-status-chip { display: inline-flex; align-items: center; gap: .2rem; padding: .05rem .45rem; border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: color-mix(in srgb, var(--nb-warning, #f59e0b) 22%, var(--nb-surface, #fff)); color: var(--nb-ink, #1E2A5A); }
.nk-status-chip.is-buff { background: color-mix(in srgb, var(--nb-success, #1f7a41) 18%, var(--nb-surface, #fff)); }
.nk-arena__climate { text-align: center; font-size: .85rem; font-weight: 700; margin: .6rem auto 0; padding: .3rem .8rem; max-width: 36rem;
  border-radius: 999px; background: color-mix(in srgb, var(--bs-primary) 12%, var(--nb-surface, #fff)); }
.nk-arena__moves.is-v2 { grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.nk-arena__moves .nk-toy .nk-cost { display: block; font-size: .72rem; font-weight: 700; opacity: .85; }
.nk-arena__moves .nk-toy.is-locked { filter: grayscale(.8); }
.nk-arena__skill { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem; margin-top: .5rem; }
.nk-arena__skill button { min-height: 44px; border-radius: 999px; border: 2px solid var(--nb-line); background: var(--nb-surface, #fff); padding: .2rem .8rem; font-weight: 700; color: var(--nb-ink, #1E2A5A); }
.nk-arena__skill button[aria-pressed="true"] { border-color: var(--bs-primary); background: color-mix(in srgb, var(--bs-primary) 14%, var(--nb-surface, #fff)); }
.nk-fighter__figure.reveal .nk-fighter__body { animation: nkReveal 1s; }
@keyframes nkReveal { 0% { opacity: 1; } 25% { opacity: .3; } 50% { opacity: 1; } 75% { opacity: .5; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nk-mp__bar { transition: none !important; } }

/* ---- Arena rules 4: the Power bar, the Ultimate Form and the combat effects (static/js/nk-battle-fx.js). Everything that
   moves here animates `transform` or `opacity` only; the names start with nkFx. ---- */
.nk-drive { position: relative; height: .5rem; border-radius: 999px; background: var(--nb-line); overflow: hidden; margin-top: .25rem; }
.nk-drive__bar { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #F5B700, #FF7A2F); transition: width .5s ease; }
.nk-drive.is-full .nk-drive__bar { animation: nkFxFull .7s ease-in-out infinite alternate; }
.nk-drive.is-ultra .nk-drive__bar { background: linear-gradient(90deg, #FFE27A, #fff); }
.nk-drive__num.is-full { color: #B45309; font-weight: 800; }
[data-bs-theme="dark"] .nk-drive__num.is-full, .nk-stage.is-dark .nk-drive__num.is-full { color: #FFD54A; }
.nk-toy.nk-toy--ultra { --toy: #F5B700; --toy-edge: #A16207; color: #2A1B00; grid-column: 1 / -1; order: -1; font-size: 1.2rem; min-height: 60px; animation: nkFxPulse 1.1s ease-in-out infinite; }
.nk-toy.nk-toy--ultra:hover { color: #2A1B00; }
.nk-arena__info { max-width: 36rem; margin: .6rem auto 0; font-size: .9rem; text-align: center; }
.nk-arena__info summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; }
.nk-arena__info p { margin: .25rem 0 0; }
.nk-pop.is-big { font-size: 2.4rem; }
.nk-pop.is-crit.is-big { font-size: 2.9rem; }
.nk-badge.chain { background: #ffedd5; color: #9a3412; } .nk-badge.ko { background: #1B1B2F; color: #FFE27A; font-size: 1rem; }
/* A pet in its Ultimate Form: a little bigger, lit in the colour of its form (static, never animated). */
.nk-fighter__figure.is-ultra .nk-fighter__art, .nk-fighter__figure.is-ultra .nk-fighter__emoji { scale: 1.08;
  filter: drop-shadow(0 0 .15rem #fff) drop-shadow(0 0 .35rem var(--ultra, #FF7A2F)) drop-shadow(0 0 .9rem var(--ultra, #FF7A2F)) drop-shadow(0 .15rem .2rem rgba(0,0,0,.25)); }
.nk-fx-ghost { position: absolute; left: 0; top: 0; pointer-events: none; }
.nk-fx__flame { transform-box: fill-box; transform-origin: 50% 100%; animation: nkFxFlame .55s ease-in-out infinite alternate; }
.nk-fx__rise { animation: nkFxRise 1.4s linear infinite; }
.nk-fx__turn { transform-box: fill-box; transform-origin: 50% 50%; animation: nkFxTurn 9s linear infinite; } .nk-fx__turn.is-fast { animation-duration: 2.2s; }
.nk-fx__dash { animation: nkFxDash .85s linear infinite; }
.nk-fx__glow { animation: nkFxGlow 1.3s ease-in-out infinite alternate; }
@keyframes nkFxFull { from { opacity: .65; } to { opacity: 1; } }
@keyframes nkFxPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes nkFxFlame { from { transform: scale(1, .82); opacity: .75; } to { transform: scale(.86, 1.12); opacity: 1; } }
@keyframes nkFxRise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(var(--rise, -120px)); opacity: 0; } }
@keyframes nkFxTurn { to { transform: rotate(360deg); } }
@keyframes nkFxDash { 0% { transform: translateX(-30px); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateX(46px); opacity: 0; } }
@keyframes nkFxGlow { from { opacity: .65; } to { opacity: 1; } }
/* The Ultimate Form's flame silhouette (nk-battle-fx.js `aura`, 2026-11-21): it flickers upward from the feet, the inner layer
   out of step; the ground ring breathes; an ascended Legend crackles. Opacity never drops below .8: the aura must read. */
.nk-fx__aura { transform-box: fill-box; transform-origin: 50% 100%; animation: nkFxAura .42s ease-in-out infinite alternate; }
.nk-fx__aura.is-late { animation-duration: .36s; animation-delay: -.2s; }
.nk-fx__ring { transform-box: fill-box; transform-origin: 50% 50%; animation: nkFxRing 1.1s ease-in-out infinite alternate; }
.nk-fx__crackle { animation: nkFxCrackle .9s steps(1, end) infinite; }
@keyframes nkFxAura { from { transform: scale(1, .95); opacity: .85; } to { transform: scale(1.04, 1.06); opacity: 1; } }
@keyframes nkFxRing { from { transform: scale(.9); opacity: .55; } to { transform: scale(1.12); opacity: 1; } }
@keyframes nkFxCrackle { 0% { opacity: 1; } 12% { opacity: 0; } 40% { opacity: 1; } 52% { opacity: 0; } 100% { opacity: 0; } }
/* Arena rules 5: the signature move's button, what kind each move is, and how well a hit's element worked. */
.nk-toy.nk-toy--sig { --toy: #8E4DFF; --toy-edge: #4C1D95; color: #fff; }
.nk-toy.nk-toy--sig:hover { color: #fff; }
.nk-movechip { display: block; margin-top: .15rem; font-size: .7rem; font-weight: 700; letter-spacing: .02em; opacity: .85; }
.nk-pop.is-super { color: #FF3B30; font-size: 2.3rem; text-shadow: 0 0 .5rem #FFD54A, .08rem .08rem 0 #14183A; }
.nk-pop.is-resisted { color: #9AA3B5; font-size: 1.5rem; }
.nk-badge.eff-super { background: #FF3B30; color: #fff; font-size: 1rem; }
.nk-badge.eff-resisted { background: #E5E7EB; color: #374151; }
/* The scene lights the pets a little from behind (pets/scenes.py `light`): a thin coloured rim, never animated. */
.nk-stage .nk-fighter__art { filter: drop-shadow(-.12rem -.08rem 0 color-mix(in srgb, var(--scene-light, #fff) 45%, transparent)) drop-shadow(0 .15rem .2rem rgba(0,0,0,.25)); }
/* The cut-in: a slanted band across the stage with the pet's picture and the move's name. */
.nk-cutin { position: absolute; z-index: 7; left: -10%; right: -10%; top: 26%; height: 42%; pointer-events: none; overflow: hidden; }
.nk-cutin[hidden] { display: none; }
.nk-cutin__band { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1rem; overflow: hidden; will-change: transform;
  background: linear-gradient(90deg, #14183A, var(--cut, #FF7A2F) 55%, #14183A); border-block: .3rem solid #fff; box-shadow: 0 0 0 .2rem #14183A; }
.nk-cutin.is-right .nk-cutin__band { flex-direction: row-reverse; }
.nk-cutin__lines { position: absolute; inset: 0 -40%; opacity: .5; background: repeating-linear-gradient(90deg, transparent 0 2.4rem, rgba(255,255,255,.75) 2.4rem 2.55rem, transparent 2.55rem 4.2rem, rgba(255,255,255,.4) 4.2rem 4.3rem); }
.nk-cutin__pet { position: relative; height: 135%; width: auto; transform: skewX(12deg); }
.nk-cutin__pet.is-flipped { transform: skewX(12deg) scaleX(-1); }
.nk-cutin__text { position: relative; transform: skewX(12deg); font-family: var(--k-round, inherit); font-weight: 900; font-size: 2.2rem; line-height: 1; letter-spacing: .04em; color: #fff; text-align: center;
  text-shadow: .12rem .12rem 0 #14183A, -.08rem -.08rem 0 #14183A, 0 0 1rem rgba(0,0,0,.5); }
/* Dark scenes (pets/scenes.py `dark`): the name plates turn dark with light text. */
.nk-stage.is-dark .nk-fighter__plate { background: rgba(16, 20, 44, .84); color: #fff; }
.nk-stage.is-dark .nk-fighter__title, .nk-stage.is-dark .nk-fighter__meta, .nk-stage.is-dark .nk-hp__num { color: #C9D1F0; }
.nk-stage.is-dark .nk-hp, .nk-stage.is-dark .nk-mp, .nk-stage.is-dark .nk-drive { background: rgba(255, 255, 255, .22); }
.nk-stage.is-dark .nk-status-chip { background: rgba(255, 255, 255, .16); color: #fff; }
@media (prefers-reduced-motion: reduce) { .nk-drive__bar { transition: none !important; } .nk-drive.is-full .nk-drive__bar, .nk-toy.nk-toy--ultra, .nk-fx-aura * { animation: none !important; } }
html.nk-motion-reduce .nk-drive__bar { transition: none !important; }
/* Reduced motion, the calm battle (2026-11-21): damage numbers and badges only fade in and out (opacity, no movement),
   and the line under the stage says why there are no moves (nk-battle-stage.js shows the matching row). */
@keyframes nkCalmFade { 0% { opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .nk-fighter .nk-pop, .nk-fighter .nk-badge { animation: nkCalmFade 1.2s linear forwards !important; } }
html.nk-motion-reduce .nk-fighter .nk-pop, html.nk-motion-reduce .nk-fighter .nk-badge { animation: nkCalmFade 1.2s linear forwards !important; }
.nk-motion-note { margin-top: .75rem; padding: .6rem .85rem; border-radius: var(--nb-radius, .75rem); background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); }
.nk-motion-note__row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.nk-motion-note__row[hidden] { display: none; }
.nk-motion-note__text { font-weight: 600; flex: 1 1 12rem; }
.nk-motion-note form { margin: 0; }
.nk-motion-note details summary { min-height: 44px; display: flex; align-items: center; gap: .35rem; cursor: pointer; }
@media (max-width: 575.98px) {
  .nk-cutin { top: 30%; height: 34%; } .nk-cutin__text { font-size: 1.35rem; } .nk-cutin__band { gap: .5rem; }
  .nk-drive__num:not(.is-full) { display: none; } .nk-drive__num { line-height: 1.2; }
  .nk-pop.is-big { font-size: 2rem; } .nk-pop.is-crit.is-big { font-size: 2.3rem; }
}
/* "Look like this" (a Legend's own timeline) + the Pet house cards + element chart + next powers (battles v2) */
.nk-stage-steps__look { margin: 0; }
button.nk-stage-steps__dot { cursor: pointer; padding: 0; min-width: 44px; min-height: 44px; }
.nk-stage-steps li.is-look .nk-stage-steps__dot { box-shadow: 0 0 0 4px color-mix(in srgb, #facc15 55%, transparent); }
.nk-house-card { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.nk-house-card.is-fighter { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.nk-house-card__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.nk-house-card__actions .btn { min-height: 44px; }
.nk-el-chart { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .4rem; }
.nk-el-chart__row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .35rem .6rem; border-radius: .6rem;
  border-left: 4px solid var(--el, #888); background: color-mix(in srgb, var(--el, #888) 10%, var(--nb-surface, #fff)); }
.nk-el-chart__me { font-weight: 700; min-width: 7rem; }
.nk-el-chart__good, .nk-el-chart__bad { font-size: .9rem; white-space: nowrap; }
.nk-powers .nk-row { padding: .35rem 0; border-bottom: 1px dashed var(--nb-line); }
.nk-powers .nk-row:last-child { border-bottom: 0; }
.nk-band.ok { color: var(--nb-success, #1f7a41); font-weight: 700; } .nk-band.off { color: var(--nb-danger, #c0392b); font-weight: 700; }
.nk-matrix__cell.is-strong .form-control { background: color-mix(in srgb, var(--nb-success, #1f7a41) 18%, var(--nb-surface, #fff)); font-weight: 700; }
.nk-matrix__cell.is-weak .form-control { background: color-mix(in srgb, var(--nb-danger, #c0392b) 14%, var(--nb-surface, #fff)); }
.nk-matrix .form-control { min-width: 3.5rem; }

/* ---- Kid race (/me/race/): lanes with running pets, a podium, "you're this close", team goal + prize ---- */
.nk-track { background: linear-gradient(180deg, #8fd16b, #6cbf4d); border-radius: 22px; padding: .75rem; box-shadow: inset 0 -6px 0 rgba(0,0,0,.12); }
[data-bs-theme="dark"] .nk-track { background: linear-gradient(180deg, #2f6b33, #24552a); }
.nk-track__lane { display: grid; grid-template-columns: minmax(6.5rem, 9rem) 1fr auto; align-items: center; gap: .6rem; padding: .35rem .2rem; }
.nk-track__lane + .nk-track__lane { border-top: 2px dashed rgba(255,255,255,.55); }
.nk-track__who { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.nk-track__avatar { flex: 0 0 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff;
  font-family: var(--k-round); font-weight: 700; font-size: 1.25rem; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.nk-track__name { font-family: var(--k-round); font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nk-track__road { position: relative; height: 4.2rem; border-radius: 999px; background: #c99a63; box-shadow: inset 0 4px 0 rgba(0,0,0,.12);
  background-image: repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,255,255,.35) 22px 34px); background-size: 100% 4px; background-repeat: no-repeat; background-position: 0 50%; }
.nk-track__lane.is-me .nk-track__road { box-shadow: inset 0 4px 0 rgba(0,0,0,.12), 0 0 0 3px var(--k-sun); }
.nk-track__runner { position: absolute; left: var(--x); top: 50%; transform: translate(-50%, -50%); width: 4rem; height: 4rem; display: grid; place-items: center;
  font-size: 2.4rem; animation: nkRun .9s ease-out both, nkHop 1.4s ease-in-out .9s infinite; }
.nk-track__runner img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(0,0,0,.3)); }
/* runners head right, toward the flag */
.nk-track__runner [data-facing="left"] { display: inline-block; transform: scaleX(-1); }
.nk-track__flag { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); font-size: 1.6rem; }
.nk-track__stars { font-family: var(--k-round); font-weight: 700; font-size: 1.15rem; color: #fff; background: rgba(0,0,0,.22); padding: .2rem .7rem; border-radius: 999px; white-space: nowrap; }
@keyframes nkRun { from { left: 4%; } }
@keyframes nkHop { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, -62%); } }
.nk-podium { display: flex; align-items: flex-end; justify-content: center; gap: .6rem; height: 100%; padding: 1rem .5rem 0; background: var(--k-panel); border-radius: 22px; border: 2px solid var(--k-edge); }
.nk-podium__spot { flex: 1 1 0; max-width: 11rem; display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.nk-podium__spot.place-1 { order: 2; } .nk-podium__spot.place-2 { order: 1; } .nk-podium__spot.place-3 { order: 3; }
.nk-podium__pet { width: 4.5rem; height: 4.5rem; display: grid; place-items: center; font-size: 2.8rem; }
.nk-podium__spot.place-1 .nk-podium__pet { width: 6rem; height: 6rem; font-size: 3.6rem; }
.nk-podium__pet img { width: 100%; height: 100%; object-fit: contain; }
.nk-podium__name { font-family: var(--k-round); font-weight: 600; }
.nk-podium__spot.is-me .nk-podium__name { color: color-mix(in srgb, var(--k-berry) 80%, #000); }  /* readable on white (4.5:1) */
.nk-podium__block { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .15rem; padding-top: .5rem;
  border-radius: 14px 14px 0 0; background: color-mix(in srgb, var(--k-sky) 85%, var(--k-panel)); font-family: var(--k-round); font-weight: 700; }
.nk-podium__spot.place-1 .nk-podium__block { height: 7rem; background: color-mix(in srgb, var(--k-sun) 55%, var(--k-panel)); }
.nk-podium__spot.place-2 .nk-podium__block { height: 5.2rem; }
.nk-podium__spot.place-3 .nk-podium__block { height: 3.8rem; }
.nk-podium__medal { font-size: 1.8rem; line-height: 1; }
.nk-race-me-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.25rem; border-radius: 22px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--kid, #13348B) 14%, var(--k-panel)), var(--k-panel)); border: 2px solid var(--k-edge); }
.nk-race-me-card__big { font-size: 3.4rem; line-height: 1; }
.nk-race-me-card__title { font-family: var(--k-round); font-weight: 600; font-size: 1.5rem; margin-top: .4rem; }
.nk-ring--big { width: 7.5rem; height: 7.5rem; background: conic-gradient(var(--k-leaf, #2FA35B) calc(var(--p) * 1%), color-mix(in srgb, var(--k-sky, #DCEFFF) 90%, #fff) 0); }
.nk-ring--big > span { width: 6rem; height: 6rem; background: var(--k-panel, #fff); font-family: var(--k-round); font-weight: 700; font-size: 1.5rem; color: var(--k-ink); }
.nk-race-streak { font-family: var(--k-round); font-weight: 600; padding: .3rem .9rem; border-radius: 999px; background: color-mix(in srgb, #ff7a00 18%, var(--k-panel)); }
.nk-race-panel { padding: 1rem 1.1rem; border-radius: 22px; border: 2px solid var(--k-edge); background: var(--k-panel); height: 100%; }
.nk-race-panel.is-prize { background: color-mix(in srgb, var(--k-berry) 10%, var(--k-panel)); }
.nk-race-panel__title { font-family: var(--k-round); font-weight: 600; font-size: 1.15rem; margin-bottom: .5rem; }
.nk-race-goal { height: 1.2rem; border-radius: 999px; background: color-mix(in srgb, var(--k-sky) 80%, var(--k-panel)); overflow: hidden; }
.nk-race-goal span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--k-leaf), #7bd389); transition: width .6s ease; }
.nk-race-prize { font-family: var(--k-round); font-weight: 600; font-size: 1.3rem; }
@media (max-width: 575.98px) {
  .nk-track__runner { width: 3.2rem; height: 3.2rem; font-size: 2rem; }
  .nk-track__road { height: 3.6rem; }
  .nk-podium__pet { width: 3.6rem; height: 3.6rem; } .nk-podium__spot.place-1 .nk-podium__pet { width: 4.6rem; height: 4.6rem; }
  .nk-track__lane { grid-template-columns: 1fr auto; }
  .nk-track__who { grid-column: 1 / -1; }
  .nk-track__road { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) { .nk-track__runner { animation: none !important; } }

/* ---- Kid battle setup (kidweb/_battle_setup.html): picture tiles instead of dropdowns ---- */
.nk-bsetup { display: grid; gap: 1rem; margin-top: .5rem; }
.nk-bsetup__step { border: 0; margin: 0; padding: 0; min-width: 0; }
.nk-bsetup__step legend { font-family: var(--k-round); font-weight: 600; font-size: 1.1rem; margin-bottom: .5rem; float: none; }
.nk-bsetup__sub { font-family: var(--k-round); font-weight: 600; margin: .75rem 0 .4rem; }
.nk-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .6rem; }
.nk-pick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .6rem; }
.nk-pick { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; padding: .7rem .5rem;
  border: 2px solid var(--k-edge); border-radius: 18px; background: var(--k-panel); box-shadow: 0 4px 0 var(--k-edge); cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, border-color .15s; min-height: 44px; }
.nk-pick input { position: absolute; opacity: 0; pointer-events: none; }
.nk-pick:has(input:checked) { border-color: var(--kid, var(--nb-navy)); background: color-mix(in srgb, var(--kid, #13348B) 10%, var(--k-panel)); box-shadow: 0 4px 0 var(--kid, var(--nb-navy)); }
.nk-pick:has(input:focus-visible) { outline: 3px solid var(--kid, var(--nb-navy)); outline-offset: 2px; }
.nk-pick:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--k-edge); }
.nk-pick.is-off { opacity: .5; cursor: not-allowed; }
.nk-pick__art { width: 4.5rem; height: 4.5rem; display: grid; place-items: center; font-size: 2.6rem; }
.nk-pick__art img { width: 100%; height: 100%; object-fit: contain; }
.nk-pick__icon { font-size: 2rem; line-height: 1.1; }
.nk-pick__name { font-family: var(--k-round); font-weight: 600; font-size: 1.05rem; }
.nk-pick__meta { font-size: .85rem; color: color-mix(in srgb, var(--k-ink) 70%, transparent); }
.nk-chip-picks { display: flex; flex-wrap: wrap; gap: .45rem; }
.nk-chip-pick { position: relative; cursor: pointer; }
.nk-chip-pick input { position: absolute; opacity: 0; pointer-events: none; }
.nk-chip-pick > span { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; padding: .3rem .95rem; border-radius: 999px; border: 2px solid var(--k-edge);
  background: var(--k-panel); font-family: var(--k-round); font-weight: 600; box-shadow: 0 3px 0 var(--k-edge); }
.nk-chip-pick input:checked + span { border-color: var(--kid, var(--nb-navy)); background: color-mix(in srgb, var(--kid, #13348B) 12%, var(--k-panel)); box-shadow: 0 3px 0 var(--kid, var(--nb-navy)); }
.nk-chip-pick input:focus-visible + span { outline: 3px solid var(--kid, var(--nb-navy)); outline-offset: 2px; }
.nk-bsetup__go { justify-content: center; min-height: 56px; font-size: 1.3rem; --toy: var(--k-berry, #E5487E); --toy-edge: #b8305f; color: #fff; }
.nk-bsetup__go:hover { color: #fff; }

/* the sheet's own header already names the species — no second big title inside it */
.nk-sheet .nk-petsheet__head h2 { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nk-sheet .nk-petsheet__head { align-items: flex-start; }
.nk-kid-portal .nk-petsheet__stage { border-radius: 16px; border-width: 2px; }
.nk-kid-portal .nk-petsheet__stagepic { width: 4rem; height: 4rem; }
/* arena v2 move buttons: label on top, hint and MP cost underneath */
.nk-arena__moves.is-v2 .nk-toy { flex-direction: column; gap: .1rem; padding: .55rem .5rem; line-height: 1.15; }
.nk-arena__moves.is-v2 .nk-toy small { font-family: var(--nb-font, system-ui); font-size: .75rem; }
.nk-arena__moves.is-v2 .nk-toy .nk-cost { margin-top: .1rem; padding: 0 .45rem; border-radius: 999px; background: color-mix(in srgb, #7c3aed 16%, transparent); color: #5b21b6; }
[data-bs-theme="dark"] .nk-arena__moves.is-v2 .nk-toy .nk-cost { color: #d8c5ff; }
@media (max-width: 575.98px) {
  .nk-pick-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
  .nk-pick-row .nk-pick { padding: .55rem .3rem; }
  .nk-pick-row .nk-pick__icon { font-size: 1.6rem; }
  .nk-pick-row .nk-pick__name { font-size: .92rem; line-height: 1.15; }
  .nk-pick-row .nk-pick__meta { font-size: .72rem; line-height: 1.2; }
  .nk-pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nk-pick__art { width: 3.6rem; height: 3.6rem; }
}
.nk-pick-row.nk-pick-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 575.98px) { .nk-arena__moves.is-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nk-arena__moves.is-v2 .nk-toy small { font-size: .7rem; } }
/* question bank editor: options as spaced chips (stacked fractions need room), tap-to-try */
.nk-bank-opts { display: flex; flex-wrap: wrap; gap: .4rem; }
.nk-bank-opt { display: inline-flex; align-items: center; min-height: 2.4rem; padding: .3rem .8rem; border-radius: .6rem; border: 1px solid var(--nb-line); line-height: 1.6; background: var(--nb-surface); }
.nk-bank-opt.is-right { border-color: var(--nb-success, #1f7a41); background: rgba(var(--nb-success-rgb), .08); font-weight: 600; }
.nk-bank-pick { position: relative; cursor: pointer; }
.nk-bank-pick input { position: absolute; opacity: 0; pointer-events: none; }
.nk-bank-pick > span { display: inline-flex; align-items: center; min-height: 44px; padding: .3rem .9rem; border-radius: .6rem; border: 2px solid var(--nb-line); line-height: 1.6; background: var(--nb-surface); }
.nk-bank-pick > input:checked + span { border-color: var(--bs-primary); background: color-mix(in srgb, var(--bs-primary) 10%, var(--nb-surface)); }
.nk-bank-pick > input:focus-visible + span { outline: 3px solid var(--bs-primary); outline-offset: 2px; }

/* ---- Learning world map (static/learning/maps/world.svg, scripts/make_world_map.py): themed only from here ---- */
.nk-world-wrap { --sea: #cfe6f8; --ocean: #b8daf3; --ocean-edge: #5b8fbf; --ocean-lift: #fff; --sea-2: #9ccbee; --land: #efe9d6; --border: #8b8270; --lake: #9ccbee; --pick: #E5487E; border-radius: 1rem; overflow: hidden; background: var(--sea); }
[data-bs-theme="dark"] .nk-world-wrap { --sea: #0f2440; --ocean: #12304f; --ocean-edge: #4f7fae; --ocean-lift: #2b5d8c; --sea-2: #1a4469; --land: #2c3549; --border: #6c7a96; --lake: #1a4469; }
.nk-world { display: block; width: 100%; height: auto; }
.nk-world #sphere { fill: var(--sea); }
.nk-world #oceans path { fill: var(--ocean); stroke: var(--ocean-edge); stroke-width: 1px; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
/* The five oceans tile the water (no overlaps): a slightly different blue each + the dashed edge show where one ends. */
.nk-world #o-atlantic { fill: color-mix(in srgb, var(--ocean) 88%, #2f7fc1); }
.nk-world #o-indian { fill: color-mix(in srgb, var(--ocean) 80%, var(--ocean-lift)); }
.nk-world #o-arctic { fill: color-mix(in srgb, var(--ocean) 65%, var(--ocean-lift)); }
.nk-world #o-southern { fill: color-mix(in srgb, var(--ocean) 78%, #1f5f9a); }
.nk-world #seas path { fill: var(--ocean); }   /* same colour as the ocean around it; its own name on hover / tap */
.nk-world #lakes, .nk-world #named-lakes path { fill: var(--lake); stroke: var(--border); stroke-width: .15; }
.nk-world #countries path { fill: var(--land); stroke: var(--border); stroke-width: .25; vector-effect: non-scaling-stroke; transition: fill .15s; }
.nk-world #countries path:hover, .nk-world #seas path:hover, .nk-world #oceans path:hover, .nk-world #named-lakes path:hover { filter: brightness(.9); }
.nk-world #dots circle { fill: transparent; stroke: var(--border); stroke-width: .3; vector-effect: non-scaling-stroke; }
.nk-world #capitals circle { display: none; fill: var(--nb-ink, #1E2A5A); r: var(--cap-r, 1.3px); }   /* nk scripts set --cap-r to the zoom */
.show-capitals .nk-world #capitals circle { display: inline; }
.nk-world .is-target { fill: var(--pick) !important; stroke: var(--pick) !important; }
.is-continents .nk-world #countries [data-continent="europe"] { fill: #f6d58e; } .is-continents .nk-world #countries [data-continent="africa"] { fill: #f2b880; }
.is-continents .nk-world #countries [data-continent="asia"] { fill: #e8a3a3; } .is-continents .nk-world #countries [data-continent="north-america"] { fill: #b6d98b; }
.is-continents .nk-world #countries [data-continent="south-america"] { fill: #9fd4b6; } .is-continents .nk-world #countries [data-continent="oceania"] { fill: #c7b3e6; }
.is-continents .nk-world #countries [data-continent="antarctica"] { fill: #fbfdff; }
[data-bs-theme="dark"] .is-continents .nk-world [data-continent] { filter: brightness(.6) saturate(.9); }
.nk-world-key { display: inline-flex; align-items: center; gap: .35rem; }
.nk-world-key::before { content: ''; width: .9rem; height: .9rem; border-radius: .25rem; background: #ccc; }
.nk-world-key[data-continent="europe"]::before { background: #f6d58e; } .nk-world-key[data-continent="africa"]::before { background: #f2b880; }
.nk-world-key[data-continent="asia"]::before { background: #e8a3a3; } .nk-world-key[data-continent="north-america"]::before { background: #b6d98b; }
.nk-world-key[data-continent="south-america"]::before { background: #9fd4b6; } .nk-world-key[data-continent="oceania"]::before { background: #c7b3e6; }
.nk-world-key[data-continent="antarctica"]::before { background: #fbfdff; border: 1px solid #ccc; }
/* map questions (learning/kid/_kind_map.html, nk-map.js) */
.nk-world #dots circle { r: var(--dot-r, 2.6px); }
/* Rivers and mountain ranges: hidden unless the question (data-layers) or the platform preview shows them */
.nk-world #rivers, .nk-world #mountains { display: none; }
.nk-world.show-rivers #rivers, .show-rivers .nk-world #rivers, .nk-world.show-mountains #mountains, .show-mountains .nk-world #mountains { display: inline; }
.nk-world #rivers .line { fill: none; stroke: var(--river, #3b82c4); stroke-width: 1.4px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.nk-world #rivers .hit { fill: none; stroke: transparent; stroke-width: 14px; vector-effect: non-scaling-stroke; pointer-events: stroke; }
.nk-world #rivers g:hover .line { stroke-width: 2.4px; }
.nk-world #rivers .is-target .line { stroke: var(--pick) !important; stroke-width: 3.2px; }
.nk-world #rivers .is-picked .line { stroke: var(--k-sun, #FFB703) !important; stroke-width: 3.2px; }
.nk-world #mountains path { fill: var(--mtn, #b98b54); fill-opacity: .5; stroke: var(--mtn-line, #8a6a3f); stroke-width: .3px; vector-effect: non-scaling-stroke; }
.nk-world #mountains path:hover { fill-opacity: .7; }
[data-bs-theme="dark"] .nk-world-wrap { --river: #6fb3ef; --mtn: #a0794a; --mtn-line: #d0a874; }
.nk-world .is-home { fill: var(--home, #9fb6e6) !important; }
[data-bs-theme="dark"] .nk-world-wrap { --home: #3d5a96; }
.nk-world .is-picked { fill: var(--k-sun, #FFB703) !important; stroke: #b07a00 !important; }
/* Quiz hover (2026-11-05): the place under the pointer is outlined, never named */
.nk-world .is-hover { stroke: var(--pick, #13348B); stroke-width: 1.6px; vector-effect: non-scaling-stroke; }
/* Deserts and peninsulas (2026-11-05): layers like mountains */
.nk-world #deserts, .nk-world #peninsulas { display: none; }
.nk-world.show-deserts #deserts, .show-deserts .nk-world #deserts, .nk-world.show-peninsulas #peninsulas, .show-peninsulas .nk-world #peninsulas { display: inline; }
.nk-world #deserts path { fill: var(--desert, #e6c77a); fill-opacity: .6; stroke: var(--desert-line, #b8933f); stroke-width: .3px; stroke-dasharray: 1.5 1; vector-effect: non-scaling-stroke; }
.nk-world #peninsulas path { fill: var(--peninsula, #8fbf9a); fill-opacity: .35; stroke: var(--peninsula-line, #3f7f52); stroke-width: .5px; vector-effect: non-scaling-stroke; }
.nk-world #deserts path:hover, .nk-world #peninsulas path:hover { fill-opacity: .8; }
[data-bs-theme="dark"] .nk-world-wrap { --desert: #a8873c; --desert-line: #d9b867; --peninsula: #4f8a62; --peninsula-line: #9fd4b0; }
[data-nk-map] svg { touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
[data-nk-map][data-mode="show"] svg { cursor: default; }
.nk-learn-map { position: relative; margin-top: .5rem; }
.nk-learn-map__canvas { min-height: 12rem; max-height: 62vh; border: 2px solid var(--k-edge, var(--nb-line)); }
.nk-learn-map__canvas svg { max-height: 62vh; width: 100%; }
.nk-learn-map__zoom { position: absolute; top: .5rem; right: .5rem; display: flex; flex-direction: column; gap: .35rem; }
.nk-learn-map__zoom .nk-toy--chip { width: 44px; justify-content: center; padding: 0; font-size: 1.3rem; }
.nk-learn-map__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .75rem; }
.nk-learn-map__picked { font-family: var(--k-round, inherit); font-weight: 600; font-size: 1.25rem; }
.nk-learn-map__bar [data-nk-map-go]:disabled { opacity: .45; }
.nk-learn-map__list { margin-top: .75rem; }
.nk-learn-map__list summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.nk-learn-map__places { display: flex; flex-wrap: wrap; gap: .4rem; max-height: 14rem; overflow-y: auto; padding: .25rem; }
.nk-learn-map__credit { margin: .4rem 0 0; font-size: .72rem; opacity: .7; text-align: right; }
.nk-learn-map--answer .nk-learn-map__canvas { max-height: 30vh; min-height: 8rem; }
.nk-learn-map--answer svg { max-height: 30vh; }
/* Map questions use the whole page width; on bigger screens the map gets a tall stage (the sea fills any spare room) */
.nk-learn-round--map { max-width: none; }
.nk-flag { width: 1.6em; height: 1.2em; object-fit: cover; border-radius: .2em; box-shadow: 0 0 0 1px rgba(0,0,0,.12); vertical-align: -.2em; }
.nk-learn-map__flag { width: 2.1rem; height: 1.6rem; object-fit: cover; border-radius: .3rem; box-shadow: 0 0 0 1px rgba(0,0,0,.12); margin-right: .5rem; vertical-align: -.3rem; }
.nk-learn-img[src*="/learning/flags/"] { width: min(18rem, 80%); height: auto; max-height: none; border-radius: .6rem; box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 6px 18px rgba(0,0,0,.12); }
.nk-learn-choices .nk-toy.nk-learn-flagchoice { padding: .6rem; display: flex; justify-content: center; align-items: center; text-align: center; }
.nk-learn-flagchoice img { width: 100%; max-width: 9rem; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .4rem; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.nk-learn-choices--text:has(.nk-learn-flagchoice) { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) {
  .nk-learn-round--map .nk-learn-choices--text { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
  .nk-learn-round--map .nk-learn-map:not(.nk-learn-map--answer) .nk-learn-map__canvas { height: var(--nk-map-fit, clamp(18rem, calc(100vh - 26rem), 48rem)); max-height: none; }   /* nk-map.js measures the room left so the question, map and "This one!" fit the screen */
  .nk-learn-round--map .nk-learn-map:not(.nk-learn-map--answer) .nk-learn-map__canvas svg { height: 100%; max-height: none; }
  .nk-learn-round--map .nk-learn-map--answer .nk-learn-map__canvas { height: min(34vh, 22rem); max-height: none; }
  .nk-learn-round--map .nk-learn-map--answer svg { height: 100%; max-height: none; }
}
.nk-qedit-map .nk-world-wrap { border: 1px solid var(--nb-line); }
.nk-qedit-map svg { max-height: 22rem; }

/* ---- Map name bubbles (nk-map.js): on the picked place, following the mouse, "It was here" ---- */
.nk-map-host { position: relative; }
.nk-map-pop { position: absolute; z-index: 5; display: inline-flex; align-items: center; gap: .45rem; max-width: min(18rem, 80%);
  padding: .45rem .75rem; border-radius: .8rem; background: #fff; color: #17213f; font-weight: 700; font-size: 1.1rem; line-height: 1.2;
  box-shadow: 0 6px 18px rgba(16, 24, 48, .22), 0 0 0 1px rgba(16, 24, 48, .08); pointer-events: none; white-space: normal; }
.nk-kid-portal .nk-map-pop { font-family: var(--k-round, inherit); font-weight: 600; }
.nk-map-pop img { width: 1.9rem; height: 1.4rem; object-fit: cover; border-radius: .25rem; box-shadow: 0 0 0 1px rgba(0,0,0,.12); flex: none; }
.nk-map-pop::after { content: ''; position: absolute; left: var(--arrow-x, 50%); bottom: -7px; width: 14px; height: 14px; margin-left: -7px;
  background: inherit; transform: rotate(45deg); box-shadow: 3px 3px 4px rgba(16, 24, 48, .1); }
.nk-map-pop.is-below::after { bottom: auto; top: -7px; box-shadow: -3px -3px 4px rgba(16, 24, 48, .08); }
.nk-map-pop.is-pin { border: 2px solid var(--k-sun, #FFB703); }
.nk-map-pop.is-hover { font-size: 1rem; opacity: .97; }
[data-bs-theme="dark"] .nk-map-pop { background: #1f2a44; color: #f2f5ff; box-shadow: 0 6px 18px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.12); }
.nk-learn-map--answer .nk-map-pop.is-pin { border-color: var(--nb-success, #2e9d5b); }

/* ---- Full screen for maps and the tree (nk.js data-nk-fullscreen) ---- */
html.nk-fs-open, html.nk-fs-open body { overflow: hidden; }
.is-fullscreen { position: fixed !important; inset: 0 !important; z-index: 2000 !important; margin: 0 !important; max-width: none !important;
  width: 100vw !important; height: 100vh !important; height: 100dvh !important; border-radius: 0 !important; border: 0 !important;
  background: var(--bs-body-bg, #fff); display: flex !important; flex-direction: column; gap: .5rem;
  padding: max(.5rem, env(safe-area-inset-top)) max(.5rem, env(safe-area-inset-right)) max(.5rem, env(safe-area-inset-bottom)) max(.5rem, env(safe-area-inset-left)) !important; }
.nk-fs-head { display: none; }
.is-fullscreen > .nk-fs-head { display: flex; align-items: center; gap: .75rem; flex: none; }
.nk-fs-title { flex: 1 1 auto; font-weight: 700; font-size: 1.1rem; line-height: 1.25; min-width: 0; }
.nk-kid-portal .nk-fs-title { font-family: var(--k-round, inherit); font-size: 1.25rem; }
.nk-fs-done { flex: none; min-height: 44px; padding: .4rem 1rem; border-radius: 999px; border: 0; background: var(--nb-navy, #13348B); color: #fff; font-weight: 700; }
.nk-fs-btn[aria-pressed="true"] { background: var(--nb-navy, #13348B); color: #fff; }
/* the map fills what the bar and the buttons leave */
.nk-learn-map.is-fullscreen .nk-learn-map__canvas { flex: 1 1 auto; height: auto !important; min-height: 0; max-height: none; }
.nk-learn-map.is-fullscreen .nk-learn-map__canvas svg { height: 100% !important; max-height: none !important; width: 100%; }
.nk-learn-map.is-fullscreen .nk-learn-map__zoom { top: 4rem; right: 1rem; }
.nk-learn-map.is-fullscreen .nk-learn-map__list, .nk-learn-map.is-fullscreen .nk-learn-map__credit { display: none; }
.nk-learn-map.is-fullscreen .nk-learn-map__bar { flex: none; margin: 0; }
.nk-platform-map.is-fullscreen #map-wrap { flex: 1 1 auto; min-height: 0; }
.nk-platform-map.is-fullscreen #map-wrap svg { height: 100%; width: 100%; }
.nk-qedit-map.is-fullscreen [data-nk-map-canvas] { flex: 1 1 auto; min-height: 0; }
.nk-qedit-map.is-fullscreen [data-nk-map-canvas] svg { height: 100%; width: 100%; }
.nk-tree-draw.is-fullscreen .nk-tree-stage { flex: 1 1 auto; height: auto !important; min-height: 0 !important; border-radius: .75rem; }
.nk-tree-draw.is-fullscreen .nk-tree-ctl { position: static; flex: none; justify-content: center; }
.nk-tree-draw.is-fullscreen .nk-tree-nudge { display: none; }
@media (max-width: 575.98px) {
  .nk-tree-stage, .nk-tree-explore .nk-tree-stage { height: 70vh; height: 70dvh; min-height: 22rem; }
}

/* ── Messages to kids › Sent: full replies, wrapping on phones ─────────────── */
.nk-msg-list { display: grid; gap: 1rem; }
.nk-msg__head { display: flex; align-items: flex-start; gap: .75rem; }
.nk-msg__body { flex: 1 1 auto; min-width: 0; }
.nk-msg__text { font-weight: 600; margin: 0 0 .15rem; overflow-wrap: anywhere; white-space: pre-line; }
.nk-msg__count { flex: none; margin-top: .15rem; }
.nk-msg__kids { list-style: none; padding: 0; margin: .85rem 0 0; display: grid; gap: .5rem; }
.nk-msg-kid { padding: .6rem .8rem; border-radius: .75rem; background: var(--nb-surface-2); border: 1px solid var(--nb-line); min-width: 0; }
.nk-msg-kid__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .15rem .75rem; }
.nk-msg-kid__reply { margin: .4rem 0 0; padding: .5rem .75rem; border-radius: .25rem .9rem .9rem .9rem; background: var(--bs-body-bg);
  border: 1px solid var(--nb-line); overflow-wrap: anywhere; white-space: pre-line; line-height: 1.45; }
.nk-msg-kid__reply--quick { display: inline-block; font-weight: 600; }
.nk-msg-kid--urgent { background: rgba(var(--nb-berry-rgb, 189,0,104), .08); border-color: rgba(var(--nb-berry-rgb, 189,0,104), .35); }
.nk-msg-kid--urgent .nk-msg-kid__reply { border-color: rgba(var(--nb-berry-rgb, 189,0,104), .35); color: var(--nb-berry); }
@media (max-width: 575.98px) {
  .nk-msg__head { flex-wrap: wrap; }
  .nk-msg__count { order: 3; margin-left: calc(2.25rem + .75rem); }
}
.nk-kid-section { font-family: var(--k-round, inherit); font-size: 1.25rem; margin: 1.5rem 0 .75rem; }
.nk-kid-section:first-of-type { margin-top: .5rem; }
/* kids' free world map (learning/kid/world_map.html) */
.nk-world.show-capitals #capitals circle { display: inline; }
.nk-map-pop small { display: block; font-size: .78em; font-weight: 500; opacity: .8; margin-top: .1rem; }
.nk-explore-map__regions, .nk-explore-map__layers { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.nk-explore-map__regions .nk-toy.is-on { background: var(--nb-navy, #13348B); color: #fff; }
.nk-explore-map__more > summary { cursor: pointer; font-weight: 600; padding: .25rem 0; }
.nk-learn-levelup { font-family: var(--k-font-head, inherit); font-size: 1.25rem; font-weight: 700; color: var(--k-accent, var(--nb-navy)); }
.nk-explore-map__layers label { cursor: pointer; }
.nk-explore-map__layers input { width: 1.1rem; height: 1.1rem; margin-right: .3rem; vertical-align: -.15rem; }
.nk-explore-map__stage { position: relative; }
.nk-explore-map.is-fullscreen .nk-explore-map__stage { flex: 1 1 auto; min-height: 0; display: flex; }
.nk-explore-map.is-fullscreen .nk-learn-map__canvas { flex: 1 1 auto; height: auto !important; min-height: 0; }
.nk-explore-map.is-fullscreen .nk-learn-map__canvas svg { height: 100% !important; max-height: none !important; }
.nk-explore-map.is-fullscreen .nk-learn-map__zoom { top: .5rem; right: .5rem; }

/* ---- Platform frame (templates/partials/platform_sidebar.html, dashboard.context_processors.platform_context) ---- */
.nk-scope { display: inline-flex; align-items: center; gap: .4rem; margin: 0 0 .75rem; padding: .25rem .75rem; border-radius: 999px;
  background: var(--nb-navy-700); color: #fff; font-size: .8rem; font-weight: 600; }
.nk-sidebar--platform .nk-brand__mark { background: var(--nb-navy-700); }

/* ---- Back where you were (nk.js [data-nk-saved]): the row just saved flashes once ---- */
.nk-saved-flash { animation: nkSavedFlash 2s ease-out; }
@keyframes nkSavedFlash { 0%, 30% { background-color: var(--nb-navy-050); box-shadow: inset 4px 0 0 var(--nb-navy); } 100% { background-color: transparent; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .nk-saved-flash { animation: none; background-color: var(--nb-navy-050); } }

/* ---- Review page rows answered in place (nk.js [data-nk-async]) ---- */
.nk-row--settled { transition: opacity .6s ease .3s; opacity: .55; }
.nk-async-failed { animation: nkAsyncShake .3s; }
@keyframes nkAsyncShake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .nk-row--settled { transition: none; } .nk-async-failed { animation: none; outline: 2px solid var(--nb-danger); } }

/* ---- Dark mode contrast (axe pass 2026-10-10): light state colours carry dark text; outline buttons use the theme's
   state colours instead of Bootstrap's fixed mid-tones ---- */
[data-bs-theme="dark"] .btn-success, [data-bs-theme="dark"] .btn-warning {
  --bs-btn-color: #0B1230; --bs-btn-hover-color: #0B1230; --bs-btn-active-color: #0B1230; --bs-btn-disabled-color: #0B1230; }
[data-bs-theme="dark"] .btn-outline-success { --bs-btn-color: var(--nb-success); --bs-btn-border-color: var(--nb-success);
  --bs-btn-hover-bg: var(--nb-success); --bs-btn-hover-border-color: var(--nb-success); --bs-btn-hover-color: #0B1230; }
[data-bs-theme="dark"] .btn-outline-danger { --bs-btn-color: var(--nb-danger); --bs-btn-border-color: var(--nb-danger);
  --bs-btn-hover-bg: var(--nb-danger); --bs-btn-hover-border-color: var(--nb-danger); --bs-btn-hover-color: #0B1230; }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: var(--nb-muted); --bs-btn-border-color: var(--nb-line-2); }
[data-bs-theme="dark"] .nk-podium__spot.is-me .nk-podium__name { color: #FF8FB8; }
[data-bs-theme="dark"] .nk-podium__spot.place-1 .nk-podium__block { background: #E0A92B; color: #1E2A5A; }  /* gold step with dark ink (≥ 4.5:1) */

/* ---- Large text on phones (200 % text, axe/reflow pass 2026-10-10): the top bar may grow a second row instead of
   pushing its buttons off the screen; request selects and hub cards shrink with their column ---- */
@media (max-width: 575.98px) {
  .nk-topbar { height: auto; min-height: var(--nb-navbar-h); flex-wrap: wrap; row-gap: .25rem; padding-top: .35rem; padding-bottom: .35rem; }
  .nk-topnav { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; margin-left: auto; }
  .nk-topbar__heading { min-width: 0; flex: 1 1 0; }   /* the title shrinks first; buttons wrap only when they alone don't fit */
  .nk-req__for, .nk-req__for .form-select { max-width: 100%; min-width: 0; }
  .nk-nav-card { min-width: 0; }
  .nk-nav-card > *, .nk-battle-news__text { min-width: 0; overflow-wrap: anywhere; }
  .nk-battle-news__row > form { flex-wrap: wrap; justify-content: flex-end; }
  .card-header.d-flex { flex-wrap: wrap; }
}

/* ---- Display settings (accounts.display, My account › Display; kid portal › My display): classes on <html> ---- */
html.nk-text-large { font-size: 112.5%; }
html.nk-text-larger { font-size: 125%; }
html.nk-comfy body { line-height: 1.65; }
html.nk-comfy .list-group-item, html.nk-comfy .nk-todo__item { padding-top: .9rem; padding-bottom: .9rem; }
html.nk-comfy .nk-row, html.nk-comfy .nk-row__actions, html.nk-comfy .card-body > * + * { gap: .75rem; }
html.nk-comfy .btn { --bs-btn-padding-y: .65rem; }
html.nk-motion-reduce *, html.nk-motion-reduce *::before, html.nk-motion-reduce *::after {
  animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
/* Kid portal "← Explore" above a page opened from an Explore tile (kidweb/_page_head.html) */
.nk-kback { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; margin: -.25rem 0 .25rem; font-family: var(--k-round, inherit);
  font-weight: 600; color: var(--k-ink); text-decoration: none; }
.nk-kback:hover { text-decoration: underline; }

/* ---- Class race on a projector (dashboard/teacher_race_screen.html) ---- */
.nk-race-screen { min-height: 100vh; padding: 2.5rem clamp(1rem, 4vw, 4rem); background: var(--nb-substrate); color: #fff; }
.nk-race-screen h1 { color: #fff; font-size: clamp(2rem, 4vw, 3.5rem); }
.nk-race-screen__emoji { font-size: clamp(2.5rem, 5vw, 4rem); }
.nk-race-screen__sub { font-size: 1.4rem; opacity: .85; }
.nk-race-screen__list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; max-width: 60rem; }
.nk-race-screen__list li { display: flex; align-items: center; gap: 1.25rem; padding: .9rem 1.4rem; border-radius: 1rem; background: rgba(255, 255, 255, .1);
  font-size: clamp(1.4rem, 2.6vw, 2.4rem); }
.nk-race-screen__place { width: 3.5rem; text-align: center; font-weight: 800; }
.nk-race-screen__name { flex: 1; font-weight: 700; }
.nk-race-screen__pts { font-weight: 800; }

/* ══ Kid portal looks that grow up (devices/looks.py, body.nk-look-*; UX rounds 6–7) ═══════════════════════════════
   Playful = the kid portal above (≤ 9). Clean (10–14) and Grown-up (≥ 15) are mature and colour-free: the adult tokens,
   white cards with neutral borders, navy for the one main action; the kid colour stays only on the avatar. Clean keeps
   a little kid warmth (rounder corners, emoji in soft circles); Grown-up uses the adult hub-card style. Same navigation,
   content and accessibility in every look; only presentation changes. */

/* My display › My look picker */
.nk-look-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .6rem; }
.nk-look-tile { display: flex; flex-direction: column; gap: .15rem; height: 100%; padding: .75rem .9rem; border: 2px solid var(--nb-line-2); border-radius: 14px;
  background: var(--k-panel, var(--nb-surface)); cursor: pointer; min-height: 44px; }
.nk-look-tile__emoji { font-size: 1.6rem; line-height: 1; }
.nk-look-tile__title { font-weight: 700; }
.nk-look-tile__text { font-size: .85rem; color: var(--nb-muted); }
.btn-check:checked + .nk-look-tile { border-color: var(--nb-navy-text); background: var(--nb-navy-050); }
.btn-check:focus-visible + .nk-look-tile { outline: 3px solid var(--nb-navy-text); outline-offset: 2px; }
fieldset:disabled .nk-look-tile { cursor: not-allowed; opacity: .6; }

/* ---- Shared by Clean and Grown-up: neutral tokens, white header, navy actions ---- */
.nk-look-clean, .nk-look-grownup { --k-ink: var(--nb-ink); --k-cloud: var(--nb-canvas); --k-panel: var(--nb-surface); --k-sky: var(--nb-surface);
  --k-leaf: var(--nb-navy-btn); --k-edge: var(--nb-line-2); background: var(--nb-canvas); color: var(--nb-ink); }
.nk-look-clean :is(h1, h2, h3, .h4, .h5, .nk-todo__title, .nk-kpage__title, .nk-kid-tile__title, .nk-buddy__bubble, .nk-kidbar__hi),
.nk-look-grownup :is(h1, h2, h3, .h4, .h5, .nk-todo__title, .nk-kpage__title, .nk-kid-tile__title, .nk-buddy__bubble, .nk-kidbar__hi) {
  font-family: var(--nb-font); font-weight: 700; letter-spacing: -.012em; color: var(--nb-ink); }
.nk-look-clean .nk-kid-section, .nk-look-grownup .nk-kid-section { font-family: var(--nb-font); font-weight: 700; color: var(--nb-ink); font-size: 1.05rem; }
.nk-look-clean .nk-kidbar, .nk-look-grownup .nk-kidbar { background: var(--nb-surface); color: var(--nb-ink); border-bottom: 1px solid var(--nb-line); }
.nk-look-clean .nk-kidbar :is(.h4, .small), .nk-look-grownup .nk-kidbar :is(.h4, .small) { color: var(--nb-ink); }
.nk-look-clean .nk-kidbar__hi { font-size: 1.3rem; }
.nk-look-grownup .nk-kidbar__hi { font-size: 1.15rem; }
.nk-look-clean .nk-kidbar__account, .nk-look-grownup .nk-kidbar__account { border: 1px solid var(--nb-line); background: var(--nb-surface); }
.nk-look-clean .nk-kidtab, .nk-look-grownup .nk-kidtab { color: var(--nb-ink); background: transparent; font-family: var(--nb-font); font-size: .95rem; min-height: 44px; }
.nk-look-clean .nk-kidtab:hover, .nk-look-grownup .nk-kidtab:hover { color: var(--nb-navy-text); background: var(--nb-navy-050); }
.nk-look-clean .nk-kidtab.is-on, .nk-look-grownup .nk-kidtab.is-on { background: var(--nb-navy-btn); color: #fff; box-shadow: none; }
.nk-look-clean .nk-bottombar--kid a, .nk-look-grownup .nk-bottombar--kid a { font-family: var(--nb-font); }
.nk-look-clean .nk-bottombar--kid a.active, .nk-look-grownup .nk-bottombar--kid a.active { color: var(--nb-navy-text); }
/* buttons: white with a hairline; the main action navy */
.nk-look-clean .nk-toy, .nk-look-grownup .nk-toy { --toy: var(--nb-surface); --toy-edge: var(--nb-line-2); border-width: 1px; box-shadow: none;
  font-family: var(--nb-font); font-weight: 600; color: var(--nb-ink); }
.nk-look-clean .nk-toy { border-radius: 14px; box-shadow: 0 1px 2px rgba(11, 18, 48, .06); }
.nk-look-grownup .nk-toy { border-radius: .625rem; }
.nk-look-clean .nk-toy:active, .nk-look-grownup .nk-toy:active { transform: none; box-shadow: none; }
.nk-look-clean :is(.nk-toy--go, .nk-toy--chip.is-main), .nk-look-grownup :is(.nk-toy--go, .nk-toy--chip.is-main) {
  --toy: var(--nb-navy-btn); --toy-edge: var(--nb-navy-btn); color: #fff; font-size: 1rem; min-height: 44px; padding: .5rem 1.1rem; }
.nk-look-clean .nk-kpage__icon, .nk-look-grownup .nk-kpage__icon { background: var(--nb-surface-2); box-shadow: none; }
/* tick circles and number pills: neutral, ticked = navy */
.nk-look-clean .nk-check, .nk-look-grownup .nk-check { border-color: var(--nb-line-2); }
.nk-look-clean .nk-check.is-on, .nk-look-grownup .nk-check.is-on { background: var(--nb-navy-btn); border-color: var(--nb-navy-btn); }
.nk-look-clean .nk-pills :is(li, a), .nk-look-grownup .nk-pills :is(li, a) { border: 1px solid var(--nb-line); background: var(--nb-surface); }
.nk-look-clean .nk-pills b, .nk-look-grownup .nk-pills b { font-family: var(--nb-font); }
.nk-look-clean .nk-todo, .nk-look-grownup .nk-todo { border: 1px solid var(--nb-line); box-shadow: none; }
.nk-look-clean .nk-todo { border-radius: 16px; }
.nk-look-grownup .nk-todo { border-radius: var(--nb-radius); }
/* the compact pet card: a white card in one row, small pet, no bubble */
.nk-look-clean .nk-buddy, .nk-look-grownup .nk-buddy { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; gap: .9rem;
  padding: .9rem 1rem; border-radius: 16px; background: var(--nb-surface); border: 1px solid var(--nb-line); }
.nk-look-clean .nk-buddy.is-done, .nk-look-grownup .nk-buddy.is-done { background: var(--nb-surface); }
.nk-look-clean .nk-buddy__pet, .nk-look-grownup .nk-buddy__pet { width: 64px; height: 64px; font-size: 2.2rem; background: var(--nb-surface-2); box-shadow: none; }
.nk-look-clean .nk-buddy__pet > *, .nk-look-grownup .nk-buddy__pet > * { animation: none; }
.nk-look-clean .nk-buddy__bubble, .nk-look-grownup .nk-buddy__bubble { margin: .1rem 0 .6rem; padding: 0; background: none; font-size: 1.05rem; max-width: none; }
.nk-look-clean .nk-buddy__bubble::before, .nk-look-grownup .nk-buddy__bubble::before { display: none; }
.nk-look-clean .nk-buddy .nk-toy--go, .nk-look-grownup .nk-buddy .nk-toy--go { width: auto; }

/* ---- Explore cards: one structure, three skins ---- */
/* Clean: white cards, neutral border, the emoji in a soft grey circle; no tone colours */
.nk-look-clean .nk-kid-tile, .nk-look-clean .nk-kid-tile[class*="tone-"] { --toy: var(--nb-surface); --toy-edge: var(--nb-line); min-height: 8.5rem;
  padding: 1rem; border-radius: 16px; box-shadow: 0 1px 2px rgba(11, 18, 48, .05), 0 4px 14px rgba(11, 18, 48, .04); }
.nk-look-clean .nk-kid-tile:hover { border-color: var(--nb-navy-text); filter: none; }
.nk-look-clean .nk-kid-tile__emoji { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--nb-surface-2);
  font-size: 1.45rem; margin-bottom: .55rem; }
.nk-look-clean .nk-kid-tile__title { font-size: 1.05rem; }
.nk-look-clean .nk-kid-tile__text { color: var(--nb-muted); opacity: 1; }
/* Grown-up: the adult hub card (icon badge · title + line · chevron), 1 per row on phones, 2–3 on wider screens */
.nk-look-grownup .nk-kid-tiles { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
@media (max-width: 575.98px) { .nk-look-grownup .nk-kid-tiles { grid-template-columns: minmax(0, 1fr); } }
.nk-look-grownup .nk-kid-tile, .nk-look-grownup .nk-kid-tile[class*="tone-"] { --toy: var(--nb-surface); --toy-edge: var(--nb-card-border);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 1rem; row-gap: .15rem; align-items: center;
  min-height: 6.5rem; padding: 1.25rem; border-radius: var(--nb-radius); box-shadow: var(--nb-shadow-card); }
.nk-look-grownup .nk-kid-tile:hover { border-color: rgba(var(--nb-navy-rgb), .35); filter: none; }
.nk-look-grownup .nk-kid-tile__emoji { grid-row: 1 / span 2; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .75rem;
  background: var(--nb-navy-050); font-size: 1.35rem; margin: 0; align-self: start; }
.nk-look-grownup .nk-kid-tile__title { grid-column: 2; font-size: 1rem; align-self: end; }
.nk-look-grownup .nk-kid-tile__text { grid-column: 2; color: var(--nb-muted); opacity: 1; font-size: .875rem; align-self: start; }
.nk-look-grownup .nk-kid-tile::after { content: "›"; grid-column: 3; grid-row: 1 / span 2; color: var(--nb-muted); font-size: 1.5rem; line-height: 1; }

/* ---- Menus: the kid "Me" menu and the adult user menu (UX round 7) ---- */
.nk-menu-panel { min-width: 17.5rem; padding: .4rem 0; border-radius: 12px; border: 1px solid var(--nb-line); box-shadow: var(--nb-shadow); }
.nk-menu-panel .dropdown-item { display: flex; align-items: center; gap: .65rem; min-height: 44px; padding: .45rem 1rem; border-radius: 0; }
.nk-menu-panel .dropdown-item > .bi { width: 1.1rem; text-align: center; color: var(--nb-muted); }
.nk-menu-panel .dropdown-item:hover, .nk-menu-panel .dropdown-item:focus-visible { background: var(--nb-surface-2); }
.nk-menu-panel .dropdown-item:active, .nk-menu-panel .dropdown-item.active { background: var(--nb-navy-050); color: var(--nb-navy-text); }
.nk-menu-panel .dropdown-item.text-danger > .bi { color: inherit; }
.nk-menu-panel .dropdown-divider { margin: .35rem 0; }
.nk-menu-panel__who { display: flex; align-items: center; gap: .75rem; padding: .5rem 1rem .4rem; }
.nk-menu-panel__group { padding: .35rem 1rem .5rem; }
.nk-menu-panel__group .small-caps { margin-bottom: .35rem; }
.nk-menu-panel .nk-seg { display: flex; width: 100%; margin: 0; gap: .15rem; padding: .2rem; border-radius: .7rem; }
.nk-menu-panel .nk-seg__btn { flex: 1 1 0; justify-content: center; min-height: 40px; padding: .3rem .4rem; font-size: .9rem; border-radius: .55rem; }
.nk-kid-portal .nk-menu-panel { font-family: var(--nb-font); }

/* --- Headers that stand out (UX 2026-10-10) ------------------------------------------------------------------------
   The top bar is a solid surface with a shadow (it used to be the page colour), shows the page's icon, and on phones
   keeps only menu · icon + title · bell · avatar: search, AI chat and the child / class switcher move into the title
   band (static/js/nk-band.js). Every .page-header is a tinted band with an accent edge and an icon tile. */
.nk-topbar { background: var(--nb-surface); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid var(--nb-line-2);
  box-shadow: 0 1px 2px rgba(19, 52, 139, .06), 0 6px 16px rgba(19, 52, 139, .06); }
[data-bs-theme="dark"] .nk-topbar { box-shadow: 0 1px 0 rgba(0, 0, 0, .45), 0 8px 18px rgba(0, 0, 0, .3); }
.nk-topbar__icon { flex: 0 0 auto; width: 2.2rem; height: 2.2rem; border-radius: .7rem; display: inline-flex; align-items: center; justify-content: center;
  background: var(--nb-navy-050); color: var(--nb-navy-text); font-size: 1.05rem; }
@media (max-width: 575.98px) {
  .nk-topbar { gap: .5rem; }
  .nk-topbar .nk-topbar__heading > .nk-topbar__title { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
    -webkit-box-orient: vertical; line-height: 1.2; font-size: .98rem; }
}

.page-header { align-items: center; padding: 1rem 1.25rem; border-radius: var(--nb-radius); border: 1px solid var(--nb-line);
  background: color-mix(in srgb, var(--nb-navy) 5%, var(--nb-surface)); box-shadow: inset 4px 0 0 var(--nb-navy-text), var(--nb-shadow-card); }
[data-bs-theme="dark"] .page-header { background: color-mix(in srgb, var(--nb-navy-text) 8%, var(--nb-surface)); }
.page-header p { color: color-mix(in srgb, var(--nb-muted) 70%, var(--nb-ink)); }
.page-header.has-icon > .nk-ph-icon + * { flex: 1 1 14rem; min-width: 0; }
.nk-ph-icon { flex: 0 0 auto; width: 3rem; height: 3rem; border-radius: .9rem; display: inline-flex; align-items: center; justify-content: center;
  background: var(--nb-surface); border: 1px solid var(--nb-line); color: var(--nb-navy-text); font-size: 1.35rem; box-shadow: var(--nb-shadow-card); }
.nk-pagetools { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.page-header > .nk-pagetools { flex: 1 0 100%; padding-top: .75rem; border-top: 1px solid var(--nb-line); }
main > .nk-pagetools { margin-bottom: 1rem; }
.nk-crumb ol { margin-bottom: .5rem; }
@media (max-width: 575.98px) {
  /* A wrapping row (the older phone rule stacked it as a column): icon tile + title side by side, actions and the
     page tools on full-width lines below. */
  .page-header { flex-direction: row; flex-wrap: wrap; align-items: center; padding: .85rem 1rem; gap: .75rem; }
  .page-header > :not(.nk-ph-icon):not(.nk-pagetools) { flex: 1 1 100%; min-width: 0; }
  .page-header.has-icon > .nk-ph-icon + * { flex: 1 1 0; }
  .nk-ph-icon { width: 2.5rem; height: 2.5rem; font-size: 1.15rem; border-radius: .75rem; }
}
/* A person's avatar without a colour of its own stays visible in dark mode. */
[data-bs-theme="dark"] .avatar { background: var(--avatar, var(--nb-navy-btn)); }

/* Kid portal, Clean and Grown-up looks: the header lifts off the page and the page title gets the same band. */
.nk-look-clean .nk-kidbar, .nk-look-grownup .nk-kidbar { border-bottom-color: var(--nb-line-2); box-shadow: 0 1px 2px rgba(19, 52, 139, .06), 0 6px 16px rgba(19, 52, 139, .06); }
.nk-look-clean .nk-kpage, .nk-look-grownup .nk-kpage { padding: .9rem 1rem; border-radius: var(--nb-radius); border: 1px solid var(--nb-line);
  background: color-mix(in srgb, var(--nb-navy) 5%, var(--nb-surface)); box-shadow: inset 4px 0 0 var(--nb-navy-text), var(--nb-shadow-card); }
[data-bs-theme="dark"] .nk-look-clean .nk-kpage, [data-bs-theme="dark"] .nk-look-grownup .nk-kpage { background: color-mix(in srgb, var(--nb-navy-text) 8%, var(--nb-surface)); }

/* Home (UX 2026-10-10): "Needs you now" folds away from its header; "Go to" comes first and is one swipeable row on phones. */
.nk-fold__toggle { width: 100%; display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; border: 0; background: none;
  color: inherit; font: inherit; font-weight: 700; border-radius: inherit; }
.nk-fold__toggle:hover { background: var(--nb-navy-050); }
.nk-fold__chevron { transition: transform .2s ease; color: var(--nb-muted); }
.nk-fold__toggle.collapsed .nk-fold__chevron, .nk-fold__toggle[aria-expanded="false"] .nk-fold__chevron { transform: rotate(-90deg); }
.nk-fold .card-header { border-bottom: 0; }
.nk-fold .collapse.show, .nk-fold .collapsing { border-top: 1px solid var(--nb-line); }
@media (max-width: 575.98px) {
  .nk-home-goto .nk-quick-grid { display: flex; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    margin-inline: -1rem; padding: 0 1rem .25rem; }
  .nk-home-goto .nk-quick-grid::-webkit-scrollbar { display: none; }
  .nk-home-goto .nk-quick-grid > li { flex: 0 0 5.75rem; scroll-snap-align: start; }
}

/* Kid home: mood & sleep check-ins (kidweb/_mood_sleep.html, UX 2026-10-10). Big tappable feeling chips (44 px). */
.nk-feel { display: grid; gap: 1rem; margin: 0 0 1.25rem; }
@media (min-width: 768px) { .nk-feel { grid-template-columns: 3fr 2fr; align-items: start; } }
.nk-feel__row { font-size: .95rem; font-weight: 700; margin-bottom: .35rem; float: none; }
.nk-feel__chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.nk-feel__chip { min-height: 44px; display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--k-edge, var(--nb-line)); background: var(--k-panel, var(--nb-surface)); color: var(--k-ink, var(--nb-ink)); font-weight: 600; user-select: none; }
.nk-feel__chip.is-hard { border-color: color-mix(in srgb, var(--nb-warning) 35%, var(--k-edge, var(--nb-line))); }
.btn-check:checked + .nk-feel__chip { background: var(--nb-navy-btn); border-color: var(--nb-navy-btn); color: #fff; }
.btn-check:focus-visible + .nk-feel__chip { outline: 3px solid var(--nb-navy-text); outline-offset: 2px; }
.btn-check:disabled + .nk-feel__chip { opacity: .45; cursor: not-allowed; }
.nk-feel__now { font-weight: 600; }
/* Mood picker step 1: three big group tiles (side by side on phones too); with JS only the tapped group's panel shows. */
.nk-feel__groups { display: none; }
.is-stepped .nk-feel__groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: .25rem 0 .75rem; }
.nk-feel__group { display: flex; flex-direction: column; align-items: center; gap: .15rem; min-height: 6.5rem; padding: .6rem .35rem; border-radius: 1rem;
  border: 2px solid var(--k-edge, var(--nb-line)); background: var(--k-panel, var(--nb-surface)); color: var(--k-ink, var(--nb-ink)); cursor: pointer; }
.nk-feel__group-emoji { font-size: 2.2rem; line-height: 1; }
.nk-feel__group-name { font-weight: 700; font-size: 1rem; text-align: center; line-height: 1.15; }
.nk-feel__group-samples { font-size: .95rem; letter-spacing: .1rem; opacity: .85; }
.nk-feel__group.is-on { border-color: var(--nb-navy-btn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nb-navy-btn) 25%, transparent); }
.nk-feel__group.is-hard.is-on { border-color: var(--nb-warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nb-warning) 25%, transparent); }
.nk-feel__group:focus-visible { outline: 3px solid var(--nb-navy-text); outline-offset: 2px; }
.is-stepped .nk-feel__panel > legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nk-feel__picked { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: .5rem 0; }
.nk-feel__picked[hidden] { display: none; }
.nk-feel__picked-chip { border: 0; border-radius: 999px; padding: .3rem .7rem; min-height: 36px; background: var(--nb-navy-btn); color: #fff; font-weight: 600; }
[data-feel-submit]:disabled { opacity: .5; }

/* Kid home / race / school without empty space (UX 2026-10-10). */
.nk-kid-portal .nk-pills li { flex: 1 1 auto; justify-content: center; }
.nk-kid-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; margin: 0 0 1.25rem; }
.nk-kid-shortcut { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; text-align: left; justify-content: flex-start; }
.nk-kid-shortcut__emoji { font-size: 1.8rem; line-height: 1; }
.nk-kid-shortcut strong { display: block; font-family: var(--k-round, inherit); font-size: 1.05rem; }
.nk-kid-shortcut small { display: block; opacity: .8; font-weight: 500; }
@media (max-width: 575.98px) { .nk-kid-shortcuts { grid-template-columns: 1fr 1fr; } .nk-kid-shortcut { flex-direction: column; text-align: center; gap: .25rem; } }
.nk-kid-board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1.5rem; align-items: start; }
@media (min-width: 992px) { .nk-kid-board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.nk-kid-col { min-width: 0; }
.nk-todo__done { border-top: 1px solid var(--k-edge, var(--nb-line)); }
.nk-todo__done > summary { cursor: pointer; padding: .75rem 1rem; font-weight: 600; list-style: none; display: flex; align-items: center; gap: .5rem; }
.nk-todo__done > summary::-webkit-details-marker { display: none; }
.nk-todo__done > summary::before { content: "\f285"; font-family: bootstrap-icons; transition: transform .2s ease; }
.nk-todo__done[open] > summary::before { transform: rotate(90deg); }
.nk-todo__done .nk-todo__item { opacity: .75; }
h2.nk-race-panel__title { margin: 0 0 .5rem; }
.nk-prizes__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 992px) { .nk-prizes__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr); } }
.nk-prizes__col { min-width: 0; }
.nk-prizes__ideas { display: flex; flex-wrap: wrap; gap: .35rem; }
.nk-prizes__ideas .nk-feel__chip { min-height: 40px; padding: .25rem .7rem; font-size: .92rem; }
.nk-prizes__others { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .75rem; padding-top: .6rem; border-top: 1px dashed var(--k-edge, var(--nb-line)); }
/* Kid messages from grown-ups (kidweb:messages, home card, header bell). */
.nk-kidbar__count { position: absolute; top: -.25rem; right: -.25rem; min-width: 1.2rem; height: 1.2rem; font-size: .7rem; }
.nk-kmsg.is-new { border-color: var(--kid, var(--nb-navy)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--kid, var(--nb-navy)) 25%, transparent); }
.nk-kmsg__emoji { font-size: 1.6rem; line-height: 1; }
.nk-kmsg__text { font-size: 1.1rem; white-space: normal; overflow-wrap: anywhere; }
.nk-kmsg-card .nk-todo__item { min-height: 44px; }
/* Kid My pet › Pet friends (kidweb/_pet_friends.html). */
.nk-kfriends__value { font-size: 1.6rem; font-weight: 700; letter-spacing: .08em; }
/* Phone drawer: the space you're in (family / school / own) and the switch to the others (partials/sidebar.html). */
.nk-space { margin: 0 .75rem .5rem; padding: .6rem .75rem; border: 1px solid var(--nb-line); border-radius: .75rem; background: var(--bs-body-bg); }
.nk-space__now { display: flex; align-items: center; gap: .6rem; }
.nk-space__now > i { font-size: 1.25rem; color: var(--nb-navy-text); }
.nk-space__switch summary { margin-top: .4rem; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--nb-navy-text); cursor: pointer; }
.nk-space__switch .dropdown-item { padding: .5rem .25rem; border-radius: .5rem; white-space: normal; }
/* Kid portal: 🏠 Home / 🏫 School switch for a kid with a family and a school profile (kidweb/layout.html). */
.nk-kidswitch { display: inline-flex; gap: .25rem; margin-top: .3rem; padding: .2rem; border-radius: 999px; background: rgba(255,255,255,.18); }
.nk-kidswitch form { margin: 0; }
.nk-kidswitch__btn { min-height: 36px; padding: .2rem .8rem; border: 0; border-radius: 999px; background: transparent; color: inherit; font-weight: 600; font-size: .85rem; }
.nk-kidswitch__btn.is-on { background: #fff; color: var(--nb-navy); }
/* "Notifications are off on this device" (2026-10-11): amber dot on the bell + the kid home device card. */
.nk-notify-dot { position: absolute; top: .3rem; left: .3rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--nb-warning, #94530b); box-shadow: 0 0 0 2px var(--bs-body-bg); }
.nk-devcard.is-warning { border-color: var(--nb-warning, #94530b); }
.nk-notify-dot--menu { position: static; display: inline-block; margin-left: .4rem; vertical-align: middle; }
.nk-notify-dot--menu[hidden] { display: none; }

/* Pet faces (2026-10): the kid's / grown-up's own pet instead of the phone emoji — 64 px pixel art, scaled crisp
   (`pets/emoji.py`, tags `pet_face` / `mood_face` / `checkin_faces` in pets_art). Sizes follow the text around them. */
.nk-pet-face { display: inline-block; vertical-align: middle; image-rendering: pixelated; image-rendering: crisp-edges;
  width: 1.5em; height: 1.5em; object-fit: contain; flex: none; }
.nk-pet-face--xs { width: 1.25em; height: 1.25em; }
.nk-pet-face--sm { width: 1.6em; height: 1.6em; margin: -.2em 0; }
.nk-pet-face--md { width: 2.4rem; height: 2.4rem; }
.nk-pet-face--lg { width: 3rem; height: 3rem; }
.nk-pet-face--xl { width: 4.5rem; height: 4.5rem; }
.nk-feel__faces { display: inline-flex; gap: .15rem; vertical-align: middle; }
.nk-feel__group-samples .nk-pet-face { margin: 0 -.05em; }
.nk-feel__group-emoji .nk-pet-face { width: 1.4em; height: 1.4em; }
/* Pet portraits as profile pictures (`|avatar` filter → img.nk-avatar-portrait inside any .avatar circle). */
:where(.avatar, .nk-splash__avatar, .nk-track__avatar):has(> .nk-avatar-portrait) { padding: 0; overflow: hidden; background: color-mix(in srgb, var(--avatar, var(--nb-navy)) 22%, var(--bs-body-bg)); }
.nk-avatar-portrait { width: 100%; height: 100%; object-fit: contain; display: block; transform: scale(1.08); }
.nk-avatar-option--pet { padding: .15rem; }
.nk-avatar-option--pet img { width: 100%; height: 100%; object-fit: contain; }
/* Kid "My picture" (kidweb/picture.html): big tappable tiles, the chosen one ringed. */
.nk-pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .6rem; }
.nk-pic-grid--emoji { grid-template-columns: repeat(auto-fill, minmax(3.5rem, 1fr)); }
.nk-pic-option { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; min-height: 44px; padding: .4rem;
  border: 2px solid var(--k-edge, var(--nb-line)); border-radius: 1rem; background: var(--bs-body-bg); cursor: pointer; text-align: center; font-size: .85rem; }
.nk-pic-option img { width: 100%; max-width: 6rem; aspect-ratio: 1; object-fit: contain; }
.nk-pic-option__emoji { font-size: 2rem; line-height: 1; }
.btn-check:checked + .nk-pic-option { border-color: var(--nb-navy-btn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nb-navy-btn) 30%, transparent); background: color-mix(in srgb, var(--nb-navy-btn) 8%, var(--bs-body-bg)); }
.btn-check:focus-visible + .nk-pic-option { outline: 3px solid var(--nb-navy-text); outline-offset: 2px; }
/* Kid "My profile" colour swatches (kidweb/profile.html). */
.nk-pic-grid--colour { grid-template-columns: repeat(auto-fill, minmax(3rem, 1fr)); }
.nk-colour-option { aspect-ratio: 1; border-radius: 50%; background: var(--swatch); border-color: transparent; }
.btn-check:checked + .nk-colour-option { box-shadow: 0 0 0 3px var(--bs-body-bg), 0 0 0 6px var(--swatch); background: var(--swatch); }
/* Parent home kid cards (dashboard/home/_kids.html, 2026-10-13): one card per kid — mood as pet faces, today, device,
   quick buttons. One column on phones, then as many 18rem columns as fit. */
.nk-kid-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.nk-kid-card { border-top: 4px solid var(--kid, var(--nb-navy)); }
.nk-kid-card__mood { display: flex; align-items: center; gap: .6rem; padding: .5rem .65rem; margin-bottom: .6rem; border-radius: .75rem;
  background: color-mix(in srgb, var(--nb-success) 8%, var(--bs-body-bg)); }
.nk-kid-card__mood.is-hard { background: color-mix(in srgb, var(--nb-warning) 12%, var(--bs-body-bg)); }
.nk-kid-card__quick { display: flex; flex-wrap: wrap; gap: .4rem; }
.nk-kid-card__quick .btn { min-height: 2.25rem; }

/* Phones (2026-10-13, "lots of overflow" on Chores): tab pills wrap onto a second line instead of scrolling out of
   sight, and list-row buttons sit under the text so titles get the full width (no 4-line names next to 3 buttons). */
@media (max-width: 575.98px) {
  .nk-tabs { flex-wrap: wrap; overflow-x: visible; -webkit-mask-image: none; mask-image: none; padding-right: 0; }
  .nk-tabs .nav-item { flex: 1 1 auto; }
  .nk-tabs .nav-link { width: 100%; justify-content: center; text-align: center; }
  .nk-row__main { flex-basis: 100%; }
  .nk-row__actions { margin-left: auto; justify-content: flex-end; }
}

/* ---- Parent "Me" home (dashboard/home/_me.html): the adult's own corner + the "Kids' area" launcher ---- */
.nk-me-home__grid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 992px) { .nk-me-home__grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.nk-me-home__today { display: flex; align-items: center; gap: 1rem; }
.nk-me-home__today .nk-ring { flex: 0 0 auto; }
.nk-me-home__pet { flex: 0 0 4rem; width: 4rem; height: 4rem; border-radius: 50%; background: var(--nb-surface-2); display: grid; place-items: center; font-size: 2.2rem; overflow: hidden; }
.nk-me-home__pet img { width: 100%; height: 100%; object-fit: contain; }
.nk-me-rename > summary { list-style: none; }
.nk-me-rename > summary::-webkit-details-marker { display: none; }
.nk-me-home__kids { color: inherit; border-left: .3rem solid var(--bs-primary); transition: transform .15s; }
.nk-me-home__kids:hover { transform: translateY(-2px); }
.nk-me-home__kids-icon { font-size: 1.8rem; }
.nk-me-home__kidlist li { display: flex; align-items: center; gap: .6rem; min-height: 2.75rem; }
@media (prefers-reduced-motion: reduce) { .nk-me-home__kids { transition: none; } .nk-me-home__kids:hover { transform: none; } }

/* "Preview as a kid" bar (kidweb/layout.html): always visible on top, never covers content (it's in the flow). */
.nk-preview-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1rem; padding: .45rem 1rem;
  background: #1d4ed8; color: #fff; font-weight: 600; text-align: center; }

/* School setup (marks/_setup_panel.html, kidweb/_school_setup.html, 2026-10-18): scale tiles with examples, subject chips
   grouped by area; a ticked subject shows its own-scale select. */
.nk-scale-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .5rem; }
.nk-scale-tile { display: flex; flex-direction: column; gap: .15rem; min-height: 44px; height: 100%; padding: .6rem .75rem; border: 2px solid var(--nb-line); border-radius: .75rem; cursor: pointer; background: var(--bs-card-bg, #fff); }
.btn-check:checked + .nk-scale-tile { border-color: var(--nb-navy); box-shadow: 0 0 0 2px color-mix(in srgb, var(--nb-navy) 25%, transparent); }
.btn-check:focus-visible + .nk-scale-tile { outline: 2px solid var(--nb-navy); outline-offset: 2px; }
.nk-subject-group { margin-bottom: .75rem; }
.nk-subject-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.nk-subject-chip { display: inline-flex; flex-direction: column; gap: .25rem; }
.nk-subject-chip .btn { min-height: 44px; display: inline-flex; align-items: center; }
/* Mixed grading (2026-10-19): "Grading per subject" rows under the subject chips; shown only with 2+ systems (nk.js). */
.nk-main-scale [data-nk-main-option][hidden] { display: none; }
.nk-subject-scales { display: grid; gap: .5rem; }
.nk-subject-scales[hidden], .nk-subject-scales__row[hidden] { display: none; }
.nk-subject-scales__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: .5rem; align-items: center; }
@media (max-width: 575.98px) { .nk-subject-scales__row { grid-template-columns: 1fr; gap: .25rem; } }
/* Pet friend code card (kidweb/_friend_code.html) */
.nk-fcode { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.nk-fcode__qr { width: 9rem; height: 9rem; flex: 0 0 auto; background: #fff; border-radius: .75rem; padding: .35rem; }
.nk-fcode__qr svg { width: 100%; height: 100%; display: block; }
.nk-fcode__value { font-size: 2rem; letter-spacing: .12em; font-weight: 700; word-break: break-all; }
.nk-fcode__video { width: 100%; max-width: 20rem; border-radius: .75rem; background: #000; }

/* Kid routine outside its time window (2026-10-22): shown, not tappable. */
.nk-todo__steps.is-locked .nk-step-btn { opacity: .55; cursor: not-allowed; }

/* Requests › Always allow waiting for its second tap (2026-10-22). */
.nk-req-always.is-armed { background: var(--nb-surface); color: var(--nb-warning); border-color: var(--nb-warning); }

/* Schedule editor "Different times on some days" (2026-11-05): a day's break rows show only with "Own breaks" on. */
.nk-day-breaks { display: none; }
details:has(input[name^="day_breaks_own_"]:checked) .nk-day-breaks { display: block; }
/* School marks (2026-11-19): an exam's chip stands out from short tests. */
.chip.nk-mark-exam { border-color: rgb(var(--nb-navy-rgb)); border-width: 2px; font-weight: 700; }
.nk-marks-cell { min-width: 11rem; }
