/* ==========================================================================
   Kindle UI Kit — Components
   Depends on tokens.css. No shadows. Hairlines and fills only.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: var(--lh-snug);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-sunk); color: var(--ink); }

:where(a) { color: inherit; }

/* Focus: a hard e-ink outline, no glow */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* --------------------------------------------------------------------------
   1. Texture helpers
   -------------------------------------------------------------------------- */

.k-grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--grain); mix-blend-mode: multiply;
}
:root[data-theme="dark"] .k-grain::after { mix-blend-mode: screen; opacity: 0.5; }

.k-dither { background: var(--dither); }

.k-rule { border: 0; border-top: var(--hair) solid var(--rule); margin: var(--s-5) 0; }

.k-rule--ornament {
  border: 0; margin: var(--s-6) auto; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: var(--s-3);
  color: var(--ink-4);
}
.k-rule--ornament::before,
.k-rule--ornament::after {
  content: ""; height: var(--hair); flex: 1; background: var(--rule);
}

/* --------------------------------------------------------------------------
   2. Typography
   -------------------------------------------------------------------------- */

.k-display, .k-h1, .k-h2, .k-h3 { font-family: var(--font-serif); font-weight: 400; color: var(--ink); }
.k-display { font-size: var(--t-3xl); line-height: var(--lh-tight); letter-spacing: -0.02em; margin: 0; }
.k-h1 { font-size: var(--t-2xl); line-height: var(--lh-tight); letter-spacing: -0.015em; margin: 0; }
.k-h2 { font-size: var(--t-xl);  line-height: var(--lh-snug);  margin: 0; }
.k-h3 { font-size: var(--t-lg);  line-height: var(--lh-snug);  margin: 0; }

.k-eyebrow {
  font-family: var(--font-sans); font-size: var(--t-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--track-caps); color: var(--ink-3);
  margin: 0;
}

.k-meta { font-size: var(--t-sm); color: var(--ink-3); margin: 0; }

/* The reading column — this is the heart of the kit */
.k-prose {
  font-family: var(--font-serif);
  font-size: var(--t-read);
  line-height: var(--lh-read);
  color: var(--ink);
  max-width: var(--measure);
  hyphens: auto;
  text-align: justify;
  text-wrap: pretty;
}
.k-prose > p { margin: 0; text-indent: 1.4em; }
.k-prose > p:first-of-type,
.k-prose > p.k-flush { text-indent: 0; }
.k-prose > * + * { margin-top: 0; }
/* Headings are set, not justified — at narrow widths justify tears them apart. */
.k-prose h2, .k-prose h3 {
  margin: var(--s-6) 0 var(--s-3); font-weight: 400;
  text-align: left; text-wrap: balance; hyphens: none;
}

.k-dropcap::first-letter {
  font-size: 3.4em; line-height: 0.86; float: left;
  padding: 0.06em 0.12em 0 0; font-weight: 400;
}

.k-quote {
  margin: var(--s-5) 0; padding-left: var(--s-5);
  border-left: 2px solid var(--rule-strong);
  font-style: italic; color: var(--ink-2); text-indent: 0;
}

.k-footnote {
  font-family: var(--font-sans); font-size: var(--t-xs); color: var(--ink-3);
  line-height: var(--lh-snug); border-top: var(--hair) solid var(--rule);
  padding-top: var(--s-3); text-indent: 0;
}
.k-fn-ref { font-size: 0.68em; vertical-align: super; color: var(--accent); text-decoration: none; }

.k-link {
  color: var(--ink); text-decoration: none;
  border-bottom: var(--hair) solid var(--rule-strong);
  transition: border-color var(--dur-fast) var(--ease-page);
}
.k-link:hover { border-bottom-color: var(--ink); }

kbd, .k-kbd {
  font-family: var(--font-mono); font-size: 0.85em;
  border: var(--hair) solid var(--rule-strong); border-radius: var(--r-sm);
  padding: 1px 5px; background: var(--paper-sunk); color: var(--ink-2);
}

/* Highlights */
.k-hl        { background: var(--hl-eink); padding: 0.06em 0.1em; border-radius: 1px; }
.k-hl--yellow{ background: var(--hl-yellow); }
.k-hl--blue  { background: var(--hl-blue); }
.k-hl--pink  { background: var(--hl-pink); }
.k-hl--orange{ background: var(--hl-orange); }
.k-hl--note  { background: var(--hl-eink); border-bottom: 2px solid var(--ink-3); }

/* --------------------------------------------------------------------------
   3. Device chrome — status bar, header, reading footer
   -------------------------------------------------------------------------- */

.k-statusbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); padding: var(--s-2) var(--s-4);
  font-size: var(--t-xs); color: var(--ink-3);
  letter-spacing: 0.02em;
}
.k-statusbar__group { display: flex; align-items: center; gap: var(--s-3); }

.k-battery {
  display: inline-flex; align-items: center; gap: 3px;
}
.k-battery__cell {
  width: 22px; height: 11px; border: var(--hair) solid var(--ink-3);
  border-radius: 2px; padding: 1.5px; display: block;
}
.k-battery__fill { display: block; height: 100%; background: var(--ink-3); border-radius: 1px; }
.k-battery__tip { width: 2px; height: 5px; background: var(--ink-3); border-radius: 0 1px 1px 0; }

.k-appbar {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: var(--hair) solid var(--rule);
  background: var(--paper);
}
.k-appbar__title {
  font-family: var(--font-sans); font-size: var(--t-base); font-weight: 600;
  margin: 0; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.k-appbar__actions { display: flex; align-items: center; gap: var(--s-1); }

.k-readfoot {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-4); padding: var(--s-3) var(--s-4);
  font-size: var(--t-xs); color: var(--ink-3);
  border-top: var(--hair) solid var(--rule);
}

/* Location bar — the thin scrubber under the page */
.k-locbar { display: block; width: 100%; }
.k-locbar__track {
  height: 2px; background: var(--rule); border-radius: var(--r-full); overflow: hidden;
}
.k-locbar__fill { height: 100%; background: var(--ink-3); }

/* Dot pagination (page N of M within a chapter) */
.k-dots { display: flex; gap: 5px; align-items: center; }
.k-dots__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--rule-strong); }
.k-dots__dot[aria-current="true"] { background: var(--ink); }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */

.k-btn {
  --_bg: transparent; --_fg: var(--ink); --_bd: var(--rule-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  font-family: var(--font-sans); font-size: var(--t-base); font-weight: 500;
  line-height: 1; padding: 0.6875rem var(--s-4);
  background: var(--_bg); color: var(--_fg);
  border: var(--hair) solid var(--_bd); border-radius: var(--r-md);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-page),
              color var(--dur-fast) var(--ease-page),
              border-color var(--dur-fast) var(--ease-page);
}
.k-btn:hover { --_bg: var(--paper-sunk); --_bd: var(--ink-4); }
.k-btn:active { --_bg: var(--rule); }

.k-btn--primary { --_bg: var(--ink); --_fg: var(--paper); --_bd: var(--ink); }
.k-btn--primary:hover { --_bg: var(--ink-2); --_bd: var(--ink-2); }
.k-btn--primary:active { --_bg: var(--ink); }

.k-btn--ghost { --_bd: transparent; --_fg: var(--ink-2); }
.k-btn--ghost:hover { --_bd: transparent; --_fg: var(--ink); }

.k-btn--sm { font-size: var(--t-sm); padding: 0.4375rem var(--s-3); }
.k-btn--lg { font-size: var(--t-lg); font-family: var(--font-serif); padding: var(--s-3) var(--s-5); }
.k-btn--block { display: flex; width: 100%; }

.k-btn[disabled], .k-btn[aria-disabled="true"] {
  --_fg: var(--ink-4); --_bd: var(--rule); --_bg: transparent;
  cursor: not-allowed; pointer-events: none;
}

.k-iconbtn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: var(--hair) solid transparent; border-radius: var(--r-md);
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-page);
}
.k-iconbtn:hover { background: var(--paper-sunk); color: var(--ink); }
.k-iconbtn svg { width: 18px; height: 18px; display: block; }

/* --------------------------------------------------------------------------
   5. Form controls
   -------------------------------------------------------------------------- */

.k-field { display: grid; gap: var(--s-2); }
.k-label {
  font-size: var(--t-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: var(--track-caps); color: var(--ink-3);
}
.k-hint { font-size: var(--t-sm); color: var(--ink-3); }

.k-input, .k-textarea, .k-select {
  font-family: var(--font-sans); font-size: var(--t-base); color: var(--ink);
  background: var(--paper-raised);
  border: var(--hair) solid var(--rule-strong); border-radius: var(--r-md);
  padding: 0.625rem var(--s-3); width: 100%;
  transition: border-color var(--dur-fast) var(--ease-page);
}
.k-input::placeholder, .k-textarea::placeholder { color: var(--ink-4); }
.k-input:hover, .k-textarea:hover, .k-select:hover { border-color: var(--ink-4); }
.k-textarea { resize: vertical; min-height: 5.5rem; line-height: var(--lh-snug); }
.k-select { appearance: none; padding-right: var(--s-6);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-size: 5px 5px, 5px 5px;
  background-position: right 16px center, right 11px center;
  background-repeat: no-repeat;
}

/* Search — the Kindle store/library search */
.k-search { position: relative; }
.k-search .k-input { padding-left: 2.25rem; border-radius: var(--r-full); background: var(--paper-sunk); }
.k-search__icon {
  position: absolute; left: var(--s-3); top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--ink-4); pointer-events: none;
}

/* Switch */
.k-switch { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; }
.k-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.k-switch__track {
  width: 40px; height: 22px; border-radius: var(--r-full);
  border: var(--hair) solid var(--rule-strong); background: var(--paper-sunk);
  position: relative; transition: background var(--dur-base) var(--ease-page),
                                  border-color var(--dur-base) var(--ease-page);
}
.k-switch__thumb {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--ink-3);
  transition: transform var(--dur-base) var(--ease-page), background var(--dur-base);
}
.k-switch input:checked + .k-switch__track { background: var(--ink); border-color: var(--ink); }
.k-switch input:checked + .k-switch__track .k-switch__thumb { transform: translateX(18px); background: var(--paper); }
.k-switch input:focus-visible + .k-switch__track { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Checkbox & radio */
.k-check { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; font-size: var(--t-base); }
.k-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.k-check__box {
  width: 17px; height: 17px; flex: none; border: var(--hair) solid var(--rule-strong);
  border-radius: var(--r-sm); background: var(--paper-raised);
  display: grid; place-items: center;
}
.k-check--radio .k-check__box { border-radius: 50%; }
.k-check__box::after {
  content: ""; width: 9px; height: 9px; transform: scale(0);
  transition: transform var(--dur-fast) var(--ease-page);
  background: var(--paper);
  clip-path: polygon(14% 44%, 0 60%, 39% 100%, 100% 18%, 84% 3%, 37% 68%);
}
.k-check--radio .k-check__box::after { clip-path: none; border-radius: 50%; width: 7px; height: 7px; }
.k-check input:checked + .k-check__box { background: var(--ink); border-color: var(--ink); }
.k-check input:checked + .k-check__box::after { transform: scale(1); }
.k-check input:focus-visible + .k-check__box { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Slider — font size, brightness, margins */
.k-slider { -webkit-appearance: none; appearance: none; width: 100%; background: transparent; }
.k-slider::-webkit-slider-runnable-track {
  height: 2px; background: var(--rule-strong); border-radius: var(--r-full);
}
.k-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -8px;
  border-radius: 50%; background: var(--paper-raised);
  border: var(--hair) solid var(--ink); cursor: pointer;
}
.k-slider::-moz-range-track { height: 2px; background: var(--rule-strong); border-radius: var(--r-full); }
.k-slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--paper-raised); border: var(--hair) solid var(--ink); cursor: pointer;
}

/* Stepper — the Aa font-size control */
.k-stepper {
  display: inline-flex; align-items: stretch;
  border: var(--hair) solid var(--rule-strong); border-radius: var(--r-md); overflow: hidden;
}
.k-stepper button {
  border: 0; background: var(--paper-raised); color: var(--ink);
  font-family: var(--font-serif); cursor: pointer; padding: 0 var(--s-4);
  transition: background var(--dur-fast) var(--ease-page);
}
.k-stepper button:hover { background: var(--paper-sunk); }
.k-stepper button:first-child { font-size: var(--t-sm); }
.k-stepper button:last-child { font-size: var(--t-lg); }
.k-stepper__value {
  display: grid; place-items: center; min-width: 3rem; font-size: var(--t-sm);
  border-inline: var(--hair) solid var(--rule); color: var(--ink-2);
}

/* Segmented control */
.k-segment {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--paper-sunk); border-radius: var(--r-md);
  border: var(--hair) solid var(--rule);
}
.k-segment button {
  border: 0; background: transparent; color: var(--ink-3); cursor: pointer;
  font-family: var(--font-sans); font-size: var(--t-sm); font-weight: 500;
  padding: var(--s-2) var(--s-4); border-radius: 3px;
  transition: background var(--dur-fast) var(--ease-page), color var(--dur-fast);
}
.k-segment button[aria-selected="true"] { background: var(--paper-raised); color: var(--ink); }

/* Tabs — underline, library style */
.k-tabs { display: flex; gap: var(--s-5); border-bottom: var(--hair) solid var(--rule); }
.k-tabs button {
  border: 0; background: none; cursor: pointer; padding: var(--s-3) 0;
  font-family: var(--font-sans); font-size: var(--t-base); color: var(--ink-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--dur-fast) var(--ease-page);
}
.k-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.k-tabs button:hover { color: var(--ink); }

/* --------------------------------------------------------------------------
   6. Data display
   -------------------------------------------------------------------------- */

.k-card {
  background: var(--paper-raised);
  border: var(--hair) solid var(--rule); border-radius: var(--r-md);
  padding: var(--s-5);
}

.k-tag {
  display: inline-flex; align-items: center; gap: var(--s-1);
  font-size: var(--t-xs); letter-spacing: 0.03em; color: var(--ink-2);
  border: var(--hair) solid var(--rule-strong); border-radius: var(--r-full);
  padding: 3px var(--s-3); background: transparent;
}
.k-tag--solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.k-tag--sunk  { background: var(--paper-sunk); border-color: transparent; color: var(--ink-3); }

/* Book cover — flat, with a spine edge instead of a shadow */
.k-cover {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--r-sm);
  background: var(--paper-sunk); border: var(--hair) solid var(--rule-strong);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: var(--s-4) var(--s-4) var(--s-4) calc(var(--s-4) + 6px);
  overflow: hidden;
}
.k-cover::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--ink); opacity: 0.14;
}
.k-cover__title {
  font-family: var(--font-serif); font-size: var(--t-base); line-height: var(--lh-snug);
  color: var(--ink); margin: 0;
}
.k-cover__author { font-size: var(--t-xs); color: var(--ink-3); }
.k-cover--dark { background: var(--ink); border-color: var(--ink); }
.k-cover--dark .k-cover__title { color: var(--paper); }
.k-cover--dark .k-cover__author { color: var(--g-3); }
.k-cover--dark::before { background: var(--paper); opacity: 0.25; }

.k-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--s-5); }
.k-shelf__item { display: grid; gap: var(--s-2); }
.k-shelf__progress { height: 2px; background: var(--rule); }
.k-shelf__progress > span { display: block; height: 100%; background: var(--ink-3); }

/* List row — library list view / post index */
.k-list { display: grid; }
.k-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: var(--s-4); padding: var(--s-4) 0;
  border-bottom: var(--hair) solid var(--rule);
  text-decoration: none; color: inherit;
  transition: background var(--dur-fast) var(--ease-page);
}
.k-row:hover { background: var(--paper-sunk); }
.k-row__title { font-family: var(--font-serif); font-size: var(--t-lg); margin: 0; line-height: var(--lh-snug); }
.k-row__sub { font-size: var(--t-sm); color: var(--ink-3); margin: 2px 0 0; }
.k-row__aside { font-size: var(--t-xs); color: var(--ink-4); text-align: right; white-space: nowrap; }

/* Table of contents */
.k-toc { display: grid; gap: var(--s-1); }
.k-toc__item {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: var(--s-3);
  padding: var(--s-3) 0; border-bottom: var(--hair) dotted var(--rule);
  font-family: var(--font-serif); font-size: var(--t-base); text-decoration: none; color: var(--ink-2);
}
.k-toc__item[aria-current="true"] { color: var(--ink); font-weight: 500; }
.k-toc__item:hover { color: var(--ink); }
.k-toc__num { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-4); }

/* Note / highlight card — the "My Clippings" object */
.k-note {
  border-left: 3px solid var(--ink-4); padding: var(--s-1) 0 var(--s-1) var(--s-4);
  display: grid; gap: var(--s-2);
}
.k-note--yellow { border-left-color: #D8BF63; }
.k-note--blue   { border-left-color: #7FA5C0; }
.k-note__text { font-family: var(--font-serif); font-size: var(--t-base); line-height: var(--lh-read); margin: 0; color: var(--ink); }
.k-note__body { font-size: var(--t-sm); color: var(--ink-2); margin: 0; }
.k-note__meta { font-size: var(--t-xs); color: var(--ink-4); display: flex; gap: var(--s-3); }

/* Stat pair */
.k-stat { display: grid; gap: var(--s-1); }
.k-stat__num { font-family: var(--font-serif); font-size: var(--t-xl); line-height: 1; }
.k-stat__label { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: var(--track-caps); color: var(--ink-3); }

/* --------------------------------------------------------------------------
   7. Overlays
   -------------------------------------------------------------------------- */

.k-sheet {
  background: var(--paper-raised);
  border: var(--hair) solid var(--rule-strong);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: var(--s-5);
}
.k-sheet__grip {
  width: 34px; height: 3px; border-radius: var(--r-full);
  background: var(--rule-strong); margin: 0 auto var(--s-4);
}

.k-dialog {
  background: var(--paper-raised); border: var(--hair) solid var(--rule-strong);
  border-radius: var(--r-md); padding: var(--s-5); max-width: 24rem;
  display: grid; gap: var(--s-4);
}
.k-dialog__actions { display: flex; gap: var(--s-2); justify-content: flex-end; }

/* Selection toolbar — appears over highlighted text */
.k-toolbar {
  display: inline-flex; align-items: center; gap: var(--s-1);
  background: var(--ink); border-radius: var(--r-md); padding: var(--s-1);
}
.k-toolbar button {
  border: 0; background: transparent; color: var(--paper);
  font-size: var(--t-sm); padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm); cursor: pointer;
}
.k-toolbar button:hover { background: var(--ink-2); }
.k-toolbar__swatches { display: flex; gap: 5px; padding-inline: var(--s-2); }
.k-toolbar__swatch { width: 15px; height: 15px; border-radius: 50%; border: 0; cursor: pointer; padding: 0; }

/* Dictionary popup */
.k-lookup {
  background: var(--paper-raised); border: var(--hair) solid var(--rule-strong);
  border-radius: var(--r-md); padding: var(--s-4); max-width: 22rem; display: grid; gap: var(--s-3);
}
.k-lookup__word { font-family: var(--font-serif); font-size: var(--t-lg); margin: 0; }
.k-lookup__pron { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-3); }
.k-lookup__def { font-family: var(--font-serif); font-size: var(--t-base); line-height: var(--lh-read); margin: 0; color: var(--ink-2); }
.k-lookup__tabs { display: flex; gap: var(--s-4); border-top: var(--hair) solid var(--rule); padding-top: var(--s-3); font-size: var(--t-xs); color: var(--ink-4); }
.k-lookup__tabs [aria-selected="true"] { color: var(--ink); }

/* Toast — e-ink style, flat slab */
.k-toast {
  display: inline-flex; align-items: center; gap: var(--s-3);
  background: var(--ink); color: var(--paper);
  border-radius: var(--r-md); padding: var(--s-3) var(--s-4); font-size: var(--t-sm);
}
.k-toast button { background: none; border: 0; color: var(--paper); text-decoration: underline; cursor: pointer; font-size: inherit; }

/* --------------------------------------------------------------------------
   8. States
   -------------------------------------------------------------------------- */

.k-empty {
  display: grid; gap: var(--s-3); justify-items: center; text-align: center;
  padding: var(--s-8) var(--s-5); border: var(--hair) dashed var(--rule-strong);
  border-radius: var(--r-md); color: var(--ink-3);
}

.k-skel { background: var(--dither); border-radius: var(--r-sm); height: 0.75rem; opacity: 0.6; }
.k-skel--line { width: 100%; }
.k-skel--short { width: 46%; }

@keyframes k-refresh { 0%, 100% { opacity: 1 } 50% { opacity: 0.35 } }
.k-refreshing { animation: k-refresh 1.1s steps(2, end) infinite; }

/* --------------------------------------------------------------------------
   9. Device frame — wrap any composition to preview it "on device"
   -------------------------------------------------------------------------- */

.k-device {
  background: var(--paper-bezel);
  border-radius: 14px;
  padding: 18px 14px 34px;
  border: var(--hair) solid var(--rule-strong);
  position: relative;
}
.k-device__screen {
  background: var(--paper); border-radius: 3px; overflow: hidden;
  aspect-ratio: 3 / 4; display: flex; flex-direction: column;
  border: var(--hair) solid var(--rule-strong);
}
.k-device__logo {
  position: absolute; bottom: 11px; left: 0; right: 0; text-align: center;
  font-size: 9px; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-4);
}

/* --------------------------------------------------------------------------
   10. Layout helpers
   -------------------------------------------------------------------------- */

.k-stack   { display: grid; gap: var(--s-4); }
.k-stack-2 { display: grid; gap: var(--s-2); }
.k-stack-6 { display: grid; gap: var(--s-6); }
.k-cluster { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.k-page    { max-width: 60rem; margin: 0 auto; padding: 0 var(--s-5); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
