/* Krate Studio, the 2026-10 design: the same language as the new krate.tech.
 *
 * Loaded LAST, after style.css and session.css, so it wins the cascade
 * without touching a single rule the interface's script depends on. Every
 * id, class, state class and data attribute app.js and the web bridge use
 * is unchanged (scripts/check-studio-hooks.mjs proves it); this file only
 * changes how they look.
 *
 * Plain Apple-like grounds, one quiet type scale at weight 500, flat pill
 * buttons, hairlines instead of boxes, and motion that explains what is
 * happening rather than decorating it. The sidebar is the window's ground
 * and the work sits on it as one rounded sheet. Light and dark share every
 * rule; only the tokens change (body.light is the light theme, as before).
 *
 * The design reference is krate-redesign/preview/experiments/studio. */

@font-face { font-family: "Geist"; src: url("fonts/geist-var-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* ---------------------------------------------------------------- tokens
 * The existing names, with the design's values. Dark first (no class), then
 * body.light. The text steps keep the floor the old palette set for them:
 * --faint, --ghost and --quiet carry real words (hints, placeholders, the
 * line under a settings row), so each still clears 3:1 on its ground. */
:root {
  --bg: #0b0b0d;
  --panel: #18181b;
  --panel-raised: #1f1f23;
  --line: #222226;
  --line-strong: #2c2c31;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #7c7c85;
  --ghost: #6e6e77;
  --quiet: #7c7c85;
  --reply: #e8e8ea;
  --blue: #6f94ff;
  --blue-soft: #8aa8ff;
  --danger: #ff6b70;

  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --radius: 12px;
  --radius-card: 16px;

  /* flat, not glass: surfaces are a colour and a hairline */
  --glass-chrome: #18181b;
  --glass-card: #18181b;
  --glass-blur: none;
  --glass-blur-soft: none;
  --glass-edge: rgba(255, 255, 255, 0.08);
  --glass-edge-soft: rgba(255, 255, 255, 0.06);
  --glass-lit: transparent;

  --side-bg: #101012;
  --shelf-bg: #18181b;

  --send-idle-bg: #2a2a2f;
  --send-idle-fg: #6e6e77;
  --send-hover-bg: #333339;
  --send-hover-fg: #f4f4f5;
  --send-ready-bg: #f4f4f5;
  --send-ready-fg: #0b0b0d;
  --send-ready-hover: #ffffff;

  --film: rgba(255, 255, 255, 0.05);
  --film-strong: rgba(255, 255, 255, 0.08);

  /* the design's own names, for the rules below */
  --surface: #18181b; --surface-2: #1f1f23; --surface-3: #2a2a2f;
  --ink: #f4f4f5; --ink-2: #a1a1aa; --ink-3: #7c7c85; --ink-4: #4d4d55;
  --hair: rgba(255, 255, 255, 0.08);
  --accent: #6f94ff; --accent-2: #8aa8ff; --accent-soft: rgba(111, 148, 255, 0.14);
  --green: #22c55e; --green-ink: #4ade80; --green-soft: rgba(34, 197, 94, 0.14);
  --orange: #f39c5b; --violet: #a38dff; --pink: #ee7cad;
  --btn: #f4f4f5; --btn-hover: #ffffff; --btn-ink: #0b0b0d;
  --sh-1: 0 0 0 1px var(--hair);
  --sh-2: 0 0 0 1px var(--hair), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
  --sh-pop: 0 0 0 1px rgba(255, 255, 255, 0.09), 0 24px 60px -18px rgba(0, 0, 0, 0.85);
  --ease: cubic-bezier(.22, 1, .36, 1); --spring: cubic-bezier(.34, 1.56, .64, 1); --io: cubic-bezier(.65, 0, .35, 1);

  /* Interaction states: one look per state, on every control. A hover is a
   * film of the ink over whatever ground the control sits on, so it reads
   * the same on the sidebar, a sheet or a menu; pressed is one step past
   * it; the current item is the accent's tint, and a hair stronger under
   * the pointer; the keyboard's focus is an accent ring. Redefined under
   * body.light, because a token that names another token is resolved
   * where it is declared. */
  --hover: rgba(255, 255, 255, 0.06);
  --pressed: rgba(255, 255, 255, 0.1);
  --selected: color-mix(in srgb, var(--accent) 16%, transparent);
  --selected-hover: color-mix(in srgb, var(--accent) 22%, transparent);
  --selected-ink: var(--accent);
  --focus-ring: color-mix(in srgb, var(--accent) 70%, transparent);
  color-scheme: dark;
}
body.light {
  --bg: #fbfbfd;
  --panel: #ffffff;
  --panel-raised: #f5f5f7;
  --line: #ececee;
  --line-strong: #e2e2e6;
  --text: #1c1c1e;
  --muted: #52525b;
  --faint: #6e6e76;
  --ghost: #85858d;
  --quiet: #6e6e76;
  --reply: #1c1c1e;
  --blue: #3d6df0;
  --blue-soft: #2f5be0;
  --danger: #e5484d;

  --glass-chrome: #ffffff;
  --glass-card: #ffffff;
  --glass-edge: rgba(24, 24, 27, 0.08);
  --glass-edge-soft: rgba(24, 24, 27, 0.06);
  --glass-lit: transparent;

  --side-bg: #f4f4f6;
  --shelf-bg: #ffffff;

  --send-idle-bg: #ececf0;
  --send-idle-fg: #a1a1aa;
  --send-hover-bg: #e2e2e6;
  --send-hover-fg: #1c1c1e;
  --send-ready-bg: #0d0d0d;
  --send-ready-fg: #ffffff;
  --send-ready-hover: #2b2b2b;

  --film: rgba(24, 24, 27, 0.045);
  --film-strong: rgba(24, 24, 27, 0.07);

  --surface: #ffffff; --surface-2: #f5f5f7; --surface-3: #ececf0;
  --ink: #1c1c1e; --ink-2: #52525b; --ink-3: #8e8e96; --ink-4: #b9b9c0;
  --hair: rgba(24, 24, 27, 0.07);
  --accent: #3d6df0; --accent-2: #2f5be0; --accent-soft: #eaf0fe;
  --green: #22c55e; --green-ink: #1f8a4c; --green-soft: #e8f8ee;
  --orange: #e8873f; --violet: #7c5ce8; --pink: #d6578f;
  --btn: #0d0d0d; --btn-hover: #2b2b2b; --btn-ink: #ffffff;
  --sh-1: 0 0 0 1px var(--hair), 0 1px 2px rgba(24, 24, 27, 0.04);
  --sh-2: 0 0 0 1px var(--hair), 0 8px 24px -12px rgba(24, 24, 27, 0.16);
  --sh-pop: 0 0 0 1px rgba(24, 24, 27, 0.06), 0 22px 50px -16px rgba(24, 24, 27, 0.24);

  --hover: rgba(24, 24, 27, 0.05);
  --pressed: rgba(24, 24, 27, 0.09);
  --selected: color-mix(in srgb, var(--accent) 10%, transparent);
  --selected-hover: color-mix(in srgb, var(--accent) 15%, transparent);
  --selected-ink: var(--accent);
  --focus-ring: color-mix(in srgb, var(--accent) 60%, transparent);
  color-scheme: light;
}

body {
  font-family: var(--sans);
  letter-spacing: -0.006em;
  background: var(--side-bg);
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
::selection { background: color-mix(in srgb, var(--blue) 24%, transparent); }

/* ---------------------------------------------------------------- the frame
 * The sidebar is the window's ground; each page sits on it as one rounded
 * sheet with all four corners curved. Desktop widths only: on a phone the
 * drawer is an overlay and the page keeps the whole screen. */
@media (min-width: 861px) {
  .view {
    margin: 8px;
    height: calc(100vh - 16px);
    border-radius: 16px;
    background: var(--bg);
    box-shadow: 0 0 0 1px var(--hair), 0 1px 3px rgba(24, 24, 27, 0.05), 0 10px 30px -18px rgba(24, 24, 27, 0.18);
    overflow: hidden;
  }
  body:not(.light) .view { box-shadow: 0 0 0 1px var(--hair), 0 10px 30px -14px rgba(0, 0, 0, 0.7); }
  body.side-open .view { margin-left: var(--side-w, 240px); }
  body.side-open .home, body.side-open .titlebar { border-top-left-radius: 0; }
}

/* ---------------------------------------------------------------- the sidebar */
.side {
  background: var(--side-bg);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-right: 0;
  box-shadow: none;
}
@media (min-width: 861px) { .side { border-right: 0; } }
.side-mark { gap: 8px; padding: 0 8px; }
.side-mark img { width: 18px; height: 18px; }
.side-mark span {
  font-size: 14.5px; font-weight: 500; letter-spacing: -0.02em; text-transform: none;
  color: var(--ink-2);
}
.side-search {
  height: 34px; margin: 4px 0 8px; padding: 0 10px;
  background: transparent; border: 0; border-radius: 10px;
  color: var(--ink-3);
  transition: background 0.2s;
}
.side-search:hover, body.light .side-search:hover { background: var(--hover); }
.side-search:focus-within { background: var(--surface); box-shadow: var(--sh-1); }
body.light .side-search, body.light .side-search:focus-within { border: 0; }
body.light .side-search { background: transparent; }
body.light .side-search:focus-within { background: var(--surface); }
.side-search input { font: 400 13.5px var(--sans); color: var(--ink); }
.side-search input::placeholder { color: var(--ink-2); }
.side-key, body.light .side-key {
  font: 500 11px/1 var(--sans); color: var(--ink-3);
  min-width: 0; height: auto; padding: 3px 5px; border-radius: 5px;
  background: transparent; border: 0; box-shadow: inset 0 0 0 1px var(--line-strong);
}
.side-nav { gap: 1px; }
.side-row {
  height: 34px; padding: 0 10px; gap: 10px; border-radius: 10px;
  font-size: 13.5px; color: var(--ink-2);
  transition: color 0.25s, background 0.2s;
}
.side-row svg { opacity: 1; color: var(--ink-3); transition: color 0.25s; }
.side-row:hover { color: var(--ink); background: var(--hover); }
.side-row:hover svg { opacity: 1; }
.side-row.on {
  padding: 0 10px; border: 0;
  color: var(--ink); font-weight: 500;
  background: var(--selected); box-shadow: none;
}
.side-row.on svg { color: var(--selected-ink); }
.side-row.on::before { display: none; }
.side-label {
  margin: 18px 10px 6px; padding: 0;
  font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- Home
 * No glow and no greeting line: the question, a quiet line under it, and
 * one card holding the composer with Create and Port on top of it. */
#viewHome .home-glow { display: none; }
#viewHome .home-hail { display: none; }
/* `auto` on every side, not `0 auto`: the room is a column and the hero's
   vertical auto margins are what push the shelf down to the floor. With
   them only on wide windows, a phone centred the hero and the shelf
   together, and the shelf -- drawn to sit on the window's edge, rounded
   on top only -- floated 100px above it, looking cut off. */
#viewHome .home-hero { width: min(720px, calc(100% - 48px)); margin: auto; text-align: center; }
#viewHome .home-title {
  margin: 0; font-family: var(--sans);
  font-size: clamp(30px, 3vw, 38px); line-height: 1.1; font-weight: 500; letter-spacing: -0.04em;
  color: var(--ink); text-align: center;
}
#viewHome .home-title .rw {
  position: relative; display: inline-grid; vertical-align: bottom; text-align: left;
  transition: width 0.7s var(--ease);
}
#viewHome .home-title .rw .w {
  grid-area: 1 / 1; justify-self: start; width: max-content; white-space: nowrap;
  background: linear-gradient(90deg, var(--blue), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; transform: translateY(0.4em); filter: blur(4px);
  transition: opacity 0.35s var(--ease), transform 0.6s var(--ease), filter 0.4s var(--ease);
}
#viewHome .home-title .rw .w.on { opacity: 1; transform: none; filter: none; transition-delay: 0.1s; }
#viewHome .home-title .rw .w.out { opacity: 0; transform: translateY(-0.4em); filter: blur(4px); }
#viewHome .home-sub { margin-top: 10px; font-size: 14.5px; color: var(--ink-3); }

/* the card */
#viewHome .composer-shell { margin-top: 26px; width: 100%; }
#viewHome .bigbar {
  width: 100%; padding: 0; text-align: left;
  border: 0; border-radius: 22px; background: var(--surface);
  box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(24, 24, 27, 0.04), 0 24px 50px -30px rgba(30, 40, 90, 0.3);
  transition: box-shadow 0.35s var(--ease);
}
body:not(.light) #viewHome .bigbar { box-shadow: 0 0 0 1px var(--hair), 0 24px 60px -30px rgba(0, 0, 0, 0.9); }
#viewHome .bigbar:focus-within {
  background: var(--surface); border: 0;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, var(--hair)), 0 0 0 4px color-mix(in srgb, var(--accent) 7%, transparent), 0 24px 50px -30px rgba(30, 40, 90, 0.35);
}
/* Create / Port */
.home-tabs { position: relative; display: flex; align-items: center; gap: 2px; height: 46px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.home-tabs button {
  position: relative; z-index: 1; height: 46px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; cursor: pointer;
  font: 500 13.5px var(--sans); color: var(--ink-3); transition: color 0.3s;
}
.home-tabs button svg { transition: transform 0.4s var(--spring); }
.home-tabs button:hover { color: var(--ink-2); }
.home-tabs button.on { color: var(--ink); }
.home-tabs button.on svg { transform: scale(1.1); }
.home-tabs button[data-mode="create"].on svg { color: var(--accent); }
.home-tabs button[data-mode="port"].on svg { color: var(--violet); }
.home-tabs .tab-ind { position: absolute; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); transition: left 0.45s var(--ease), width 0.45s var(--ease); }
.home-tabs .grow { flex: 1; }
.home-kb { font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; padding-right: 6px; }
.home-kb kbd { font: 500 11px/1 var(--sans); color: var(--ink-3); padding: 3px 5px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line-strong); }
#viewHome .bigbar[data-mode="port"] textarea,
#viewHome .bigbar[data-mode="port"] .bigbar-row,
#viewHome .bigbar[data-mode="port"] .attach-row { display: none; }
.home-portpane { display: flex; align-items: center; gap: 14px; padding: 18px 18px 18px 20px; text-align: left; }
.home-portpane[hidden] { display: none; }
.home-portpane .dz-i { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, transparent); }
.home-portpane div { flex: 1; min-width: 0; }
.home-portpane b { display: block; font-size: 14.5px; font-weight: 500; color: var(--ink); }
.home-portpane small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--ink-3); }
.home-portpane .pp-go {
  flex: none; height: 34px; padding: 0 15px; border-radius: 999px; border: 0; cursor: pointer;
  font: 500 13.5px var(--sans); color: var(--btn-ink); background: var(--btn);
  transition: background 0.2s, transform 0.2s var(--ease);
}
.home-portpane .pp-go:hover { background: var(--btn-hover); }
.home-portpane .pp-go:active { transform: scale(0.97); }
/* the box and its row */
#viewHome .bigbar textarea {
  padding: 16px 20px 4px; min-height: 76px;
  font-size: 16px; line-height: 1.5; color: var(--ink); caret-color: var(--accent);
}
#viewHome .bigbar textarea::placeholder { color: var(--ink-4); }
#viewHome .bigbar-row { gap: 4px; margin: 0; padding: 8px 10px 10px 12px; border-top: 0; }
#viewHome .home-port { display: none; }
#viewHome .home-hint { min-height: 18px; margin: 8px 6px 0; font-size: 12px; color: var(--ink-3); text-align: center; }

/* the composer's row: +, who writes it, Build / Plan, voice, send */
.bigbar-row .tool.plus, .bigbar-row .tool.wave {
  width: 36px; height: 36px; flex: none; justify-content: center; padding: 0;
  border-radius: 50%; color: var(--ink-2); background: transparent;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.bigbar-row .tool.plus { box-shadow: inset 0 0 0 1px var(--line-strong); margin: 0; }
.bigbar-row .tool.wave, .bigbar-row .send, .bigbar-row .aichip { margin: 0; }
.bigbar-row .tool.plus:hover, .bigbar-row .tool.wave:hover { background: var(--hover); color: var(--ink); }
.bigbar-row .aichip {
  height: 36px; padding: 0 10px; gap: 6px; border: 0; border-radius: 999px;
  font: 400 13.5px var(--sans); color: var(--ink-2); background: transparent;
  transition: background 0.2s, color 0.2s;
}
.bigbar-row .aichip:hover { background: var(--hover); color: var(--ink); }
.bigbar-row .aichip b { font-weight: 500; color: var(--ink); }
.bigbar-row .aichip .chev { opacity: 0.55; }
.bigbar-row .aichip .dot { width: 6px; height: 6px; }
.web-mode {
  position: relative; display: inline-flex; padding: 3px; gap: 0;
  border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair);
}
.web-mode button {
  height: 28px; padding: 0 13px; border: 0; border-radius: 999px; cursor: pointer;
  font: 400 13px var(--sans); color: var(--ink-3); background: transparent;
  transition: color 0.3s, background 0.3s, box-shadow 0.3s;
}
.web-mode button:hover { color: var(--ink); }
.web-mode button[aria-pressed="true"] {
  color: var(--ink); background: var(--surface);
  box-shadow: 0 0 0 1px var(--hair), 0 2px 6px -2px rgba(24, 24, 27, 0.16);
}
body:not(.light) .web-mode button[aria-pressed="true"] { background: var(--surface-3); }
.bigbar-row .send {
  width: 38px; height: 38px; border-radius: 12px; margin-left: 2px;
  background: var(--send-idle-bg); color: var(--send-idle-fg);
  transition: background 0.3s var(--ease), color 0.3s, transform 0.3s var(--spring), border-radius 0.4s var(--ease);
}
.bigbar-row .send.ready { background: var(--send-ready-bg); color: var(--send-ready-fg); }
.bigbar-row .send.ready:hover { background: var(--send-ready-hover); transform: translateY(-1px); border-radius: 14px; }
.bigbar-row .send:active { transform: scale(0.92); }

/* the shelf: a quiet strip along the foot of the sheet, not a raised tray */
@media (min-width: 861px) {
  /* In the page's own column, not fixed over it: the hero takes the space
     above and the shelf sits at the foot, so opening it lifts the composer
     instead of covering it, on a window of any height. */
  #viewHome .home { padding-bottom: 0; }
  #viewHome .home-hero { margin-top: auto; margin-bottom: auto; flex: none; }
  #viewHome .shelf, body.side-open #viewHome .shelf, body.kr-rail #viewHome .shelf {
    position: relative; left: auto; right: auto; bottom: auto; flex: none; align-self: stretch;
    width: auto; margin: 24px -32px 0; transform: none;
    border-radius: 0 0 15px 15px; border: 0; border-top: 1px solid var(--line);
    background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none;
    padding: 10px 20px 12px;
  }
}
#viewHome .shelf-tabs { background: transparent; padding: 0; gap: 2px; }
#viewHome .shelf-tab { height: 28px; padding: 0 10px; border-radius: 8px; font: 500 13px var(--sans); color: var(--ink-3); background: transparent; }
#viewHome .shelf-tab:hover { color: var(--ink); }
#viewHome .shelf-tab.on { color: var(--ink); background: transparent; }
#viewHome .shelf-grip { color: var(--ink-3); }
#viewHome .shelf-all { font: 400 13px var(--sans); color: var(--ink-3); }
#viewHome .shelf-all:hover { color: var(--ink); }
#viewHome .shelf-card .shot { border: 0; border-radius: 12px; background: var(--surface-2); box-shadow: var(--sh-1); }
#viewHome .shelf-card:hover .shot { box-shadow: var(--sh-2); }
#viewHome .shelf-card b { font-weight: 500; font-size: 13px; color: var(--ink); }

/* the sidebar's foot: rows, not cards; the account row last */
.side-foot { padding-top: 10px; gap: 1px; }
.side-card {
  height: 34px; padding: 0 10px; gap: 10px; border: 0; border-radius: 10px;
  display: flex; align-items: center; flex-direction: row-reverse; justify-content: flex-end;
  background: transparent; box-shadow: none; color: var(--ink-2);
  transition: color 0.25s, background 0.2s;
}
.side-card:hover { background: var(--hover); color: var(--ink); border: 0; }
.side-card .card-text small { display: none; }
.side-card .card-text b { font: 400 13.5px var(--sans); color: inherit; }
.side-card .card-icon { width: auto; height: auto; border: 0; background: none; color: var(--ink-3); }
.side-me { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.side-avatar { border-radius: 50%; }

/* ---------------------------------------------------------------- the session
 * The conversation on the left, the app on the right, one hairline between
 * them. The app's side is the sheet itself rather than a box inside it. */
@media (min-width: 861px) {
  #viewSession .panel-body { margin: 0; border: 0; border-radius: 0; background: transparent; }
  #viewSession .rail { border-right: 1px solid var(--line); }
}
#viewSession .panel-body { border-color: var(--line); }
#viewSession .sess-title .crumb { font-weight: 500; letter-spacing: -0.015em; color: var(--ink); }

/* Preview / Files / Code / Details: words in a segmented pill, not icons */
.ptabs { padding: 3px; gap: 0; border: 0; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); }
.ptabs button { height: 28px; padding: 0 13px; gap: 0; font: 400 13px var(--sans); color: var(--ink-3); transition: color 0.3s, background 0.3s, box-shadow 0.3s; }
.ptabs button svg { display: none; }
.ptabs button span { display: inline; }
/* A segmented control: the sliding thumb is the current tab, so a hover
   only lifts the word. A film here read as a second thumb in dark. */
.ptabs button:hover { color: var(--ink); }
.ptabs button.on { color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 2px 6px -2px rgba(24, 24, 27, 0.16); }
body:not(.light) .ptabs button.on { background: var(--surface-3); }

/* the composer: the Home card, sized for a column */
#viewSession .sessbar {
  border: 0; border-radius: 22px; background: var(--surface);
  box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(24, 24, 27, 0.04), 0 18px 40px -28px rgba(30, 40, 90, 0.3);
  transition: box-shadow 0.35s var(--ease);
}
body:not(.light) #viewSession .sessbar { box-shadow: 0 0 0 1px var(--hair), 0 18px 50px -28px rgba(0, 0, 0, 0.9); }
#viewSession .sessbar:focus-within {
  border: 0; background: var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, var(--hair)), 0 0 0 4px color-mix(in srgb, var(--accent) 7%, transparent);
}
#viewSession .sessbar textarea { min-height: 0; padding: 4px 6px 8px; color: var(--ink); caret-color: var(--accent); }
#viewSession .sessbar textarea::placeholder { color: var(--ink-4); }
#viewSession .sessbar .tool.plus { width: 32px; height: 32px; border: 0; }
#viewSession .sessbar .tool.wave { width: 32px; height: 32px; }
#viewSession .sessbar .aichip { height: 32px; }
#viewSession .sessbar .send { width: 34px; height: 34px; border-radius: 50%; }
#viewSession .composer-hint { font-size: 12px; color: var(--ink-3); }

/* ---------------------------------------------------------------- the card being made
 * One card: a quiet wash of colour with the crate in it, the name and the
 * live line under that, the time on the right. A grey line goes round the
 * card while it is being made. The first real frame of the app replaces the
 * crate in the same place, as before. */
@property --kr-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
#viewSession .build-card {
  border: 0; border-radius: 26px; background: var(--surface);
  box-shadow: 0 0 0 1px var(--hair), 0 30px 60px -34px rgba(30, 40, 90, 0.3), 0 2px 6px rgba(24, 24, 27, 0.04);
}
body:not(.light) #viewSession .build-card { box-shadow: 0 0 0 1px var(--hair), 0 30px 70px -34px rgba(0, 0, 0, 0.9); }
#viewSession .build-card.bloom::before {
  inset: -1.5px; left: -1.5px; right: -1.5px; bottom: -1.5px; height: auto;
  border-radius: 27.5px; padding: 1.5px; z-index: 0; filter: none; opacity: 0;
  background: conic-gradient(from var(--kr-a), transparent 0 58%, color-mix(in srgb, var(--ink) 12%, transparent) 70%, color-mix(in srgb, var(--ink) 55%, transparent) 95%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: krSpin 3.4s linear infinite;
}
#stateBuilding .build-card.bloom::before { opacity: 1; }
@keyframes krSpin { to { --kr-a: 360deg; } }

#viewSession .build-shot { border: 0; background: none; }
#viewSession .build-shot.showing-term { background: #0b0b0d; }
#viewSession .forming-sweep { display: none; }
#viewSession .forming-ghost { padding: 0 0 8%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#viewSession .forming-ghost > .g-chrome, #viewSession .forming-ghost > .g-block, #viewSession .forming-ghost > .g-row { display: none; }
#viewSession .forming-ghost::before {
  content: ""; position: absolute; inset: -20%; z-index: 0; opacity: 0.8; filter: blur(40px);
  background:
    radial-gradient(38% 42% at 24% 30%, color-mix(in srgb, var(--pink) 30%, transparent), transparent 70%),
    radial-gradient(40% 46% at 80% 42%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
    radial-gradient(36% 40% at 50% 84%, color-mix(in srgb, var(--violet) 18%, transparent), transparent 70%);
  animation: krDrift 14s ease-in-out infinite alternate;
}
body:not(.light) #viewSession .forming-ghost::before { opacity: 0.55; }
@keyframes krDrift { to { transform: translate(4%, -3%) scale(1.06); } }
#viewSession .build-shot-tag {
  z-index: 3; top: 12px; left: 12px; bottom: auto; right: auto; padding: 3px 9px; border-radius: 999px;
  font: 500 11.5px var(--sans); color: var(--ink-2);
  background: color-mix(in srgb, var(--surface) 80%, transparent); box-shadow: 0 0 0 1px var(--hair);
}

/* the crate */
.fg-crate { position: relative; z-index: 2; flex: none; width: auto; height: min(100px, 58%); overflow: visible; }
.fg-crate .sl { transition: transform 0.7s cubic-bezier(.34, 1.4, .5, 1); }
.fg-crate path { stroke-linejoin: round; }
.fg-crate .sk .t { fill: color-mix(in srgb, var(--ink) 7%, var(--surface)); }
.fg-crate .sk .l { fill: color-mix(in srgb, var(--ink) 12%, var(--surface)); }
.fg-crate .sk .r { fill: color-mix(in srgb, var(--ink) 17%, var(--surface)); }
.fg-crate .sk path { stroke: var(--surface); stroke-width: 0.6; }
.fg-crate.draw .sl { animation: krShellIn 0.8s var(--ease) both; }
.fg-crate.draw .s2 { animation-delay: 0.14s; }
.fg-crate.draw .s3 { animation-delay: 0.28s; }
@keyframes krShellIn { from { opacity: 0; transform: translateY(-8px); } }
.fg-crate .fl path { stroke: rgba(255, 255, 255, 0.18); stroke-width: 0.6; }
.fg-crate .fl { opacity: 0; transition: opacity 0.5s var(--ease); }
.fg-crate .sl.on .fl { opacity: 1; animation: krMat 0.9s var(--ease) both; }
@keyframes krMat { 0% { opacity: 0; filter: brightness(1.9) saturate(.3); } 40% { opacity: 1; filter: brightness(1.3) saturate(.8); } 100% { opacity: 1; filter: none; } }
.fg-crate .shn { opacity: 0; fill: #fff; filter: blur(6px); }
body:not(.light) .fg-crate .shn { fill: #dfe8ff; }
.fg-crate:is([data-ph="plan"], [data-ph="write"]) .shn { animation: krShim 1.5s var(--io) infinite; }
body:not(.light) .fg-crate:is([data-ph="plan"], [data-ph="write"]) .shn { animation-name: krShimDark; }
@keyframes krShim { 0% { opacity: .7; transform: translateX(0); } 100% { opacity: .7; transform: translateX(190px); } }
@keyframes krShimDark { 0% { opacity: .18; transform: translateX(0); } 100% { opacity: .18; transform: translateX(190px); } }
.fg-crate:is([data-ph="build"], [data-ph="pack"]) .shn { animation: krShine 2.8s var(--io) 0.3s infinite; }
@keyframes krShine { 0% { opacity: .5; transform: translateX(0); } 60%, 100% { opacity: .5; transform: translateX(190px); } }
.fg-crate[data-ph="pack"] .s2 { transform: translateY(2px); }
.fg-crate[data-ph="pack"] .s3 { transform: translateY(4px); }
.fg-crate .rp { fill: none; stroke: color-mix(in srgb, var(--accent) 60%, transparent); stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: 0; transform-box: fill-box; transform-origin: center; }
.fg-crate[data-ph="pack"] .rp { animation: krRipple 1.3s var(--ease) 0.45s both; }
@keyframes krRipple { from { opacity: .8; transform: scale(.6); } to { opacity: 0; transform: scale(1.5); } }
.fg-crate .sh { fill: color-mix(in srgb, var(--ink) 9%, transparent); }
#stateBuilding .fg-crate { animation: krFloat 4.8s ease-in-out infinite; }
@keyframes krFloat { 50% { transform: translateY(-4px); } }
/* while the code is written, bits of it drift in and are packed away */
.fg-bits { position: absolute; left: 50%; top: 50%; z-index: 1; width: 0; height: 0; }
.fg-bits i { position: absolute; left: 0; top: 0; width: var(--w); height: 3px; margin: -1.5px 0 0 calc(var(--w) / -2); border-radius: 2px; background: color-mix(in srgb, var(--c) 55%, transparent); opacity: 0; }
.forming-ghost[data-ph="write"] .fg-bits i { animation: krBit 2s cubic-bezier(.55, 0, .75, .35) var(--d) infinite; }
@keyframes krBit { 0% { opacity: 0; transform: translate(var(--x), var(--y)); } 20% { opacity: .9; } 80% { opacity: .7; } 100% { opacity: 0; transform: translate(0, 6px) scale(.2); } }

/* the words under it */
#viewSession .build-title, #viewSession .brail .build-title { font-size: 17px; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); }
#viewSession .brail .bpeek { font-size: 13px; color: var(--ink-2); }
#viewSession .build-elapsed { color: var(--ink-3); font-size: 12.5px; }
#viewSession .build-detail-toggle {
  border: 0; padding: 0 10px; height: 30px; border-radius: 999px; gap: 7px;
  font: 400 12.5px var(--sans); color: var(--ink-2); background: transparent;
}
#viewSession .build-detail-toggle:hover { color: var(--ink); background: var(--hover); border: 0; }
#viewSession .build-detail-toggle[aria-pressed="true"] { color: var(--ink); background: var(--surface-2); border: 0; }
#viewSession .bfoot button {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 999px;
  font: 400 12.5px var(--sans); color: var(--ink-2); transition: background 0.2s, color 0.2s;
}
#viewSession .bfoot button:hover { color: var(--ink); background: var(--hover); }
#stopBtn::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }

/* On a desktop the card is laid out like the design: the picture across the
   top fading into the card, then the name and live line on the left and the
   time on the right, then Details and Stop. Phones keep their own tuned
   layout (in style.css) that guarantees Stop is always on screen. */
@media (min-width: 861px) {
  #viewSession .build-card.brail {
    width: min(520px, 92%); max-height: none; padding: 0 0 12px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-content: start;
  }
  #viewSession .build-card.brail > * { grid-column: 1 / -1; }
  #viewSession .brail .build-shot {
    margin: 0; height: clamp(170px, 34vh, 300px); min-height: 0;
    border-radius: 26px 26px 0 0;
    -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 98%); mask-image: linear-gradient(180deg, #000 62%, transparent 98%);
  }
  #viewSession .brail .build-shot.showing-term { -webkit-mask-image: none; mask-image: none; border-radius: 26px 26px 0 0; }
  #viewSession .brail .build-head { display: contents; }
  #viewSession .brail .build-title { grid-column: 1; grid-row: 2; margin: 2px 0 0 24px; }
  #viewSession .brail .bpeek { grid-column: 1; grid-row: 3; margin: 2px 0 0 24px; min-width: 0; }
  #viewSession .brail .build-elapsed { grid-column: 2; grid-row: 2 / span 2; align-self: center; margin: 0 24px 0 0; text-align: right; }
  #viewSession .brail .build-detail-toggle { grid-column: 1; grid-row: 4; justify-self: start; margin: 12px 0 0 14px; }
  #viewSession .build-card.brail .bfoot { grid-column: 2; grid-row: 4; margin: 12px 14px 0 0; justify-content: flex-end; }
  #viewSession .build-card.brail .plan-ask, #viewSession .build-card.brail .plan-actions { margin-left: 24px; margin-right: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  #viewSession .build-card.bloom::before, #viewSession .forming-ghost::before, .fg-crate, .fg-crate *, .fg-bits i { animation: none !important; }
}

/* ---------------------------------------------------------------- the build chip in the conversation
 * One quiet card per build: the version, what it is doing, a thin bar. */
#viewSession .vchip {
  gap: 10px; padding: 9px 12px 9px 14px; border: 0; border-radius: 14px;
  font: 400 13px var(--sans); color: var(--ink-2);
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(24, 24, 27, 0.04);
}
#viewSession .vchip.vlivec, #viewSession .vchip.vbadc { border: 0; }
#viewSession .vchip.vbadc { box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent); }
#viewSession .vchip b { font-weight: 600; color: var(--ink); }
#viewSession .vchip .vm { font: 400 12px var(--sans); color: var(--ink-3); }
#viewSession .vchip .vbar { width: 96px; height: 4px; border-radius: 4px; background: var(--surface-3); }
#viewSession .vchip .vbar i { border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--violet)); }
#viewSession .vchip .vact { height: 28px; padding: 0 12px; border-radius: 999px; font: 500 12.5px var(--sans); background: var(--btn); color: var(--btn-ink); }
#viewSession .vchip .vact.vg { background: transparent; color: var(--ink-2); }
#viewSession .vchip .vact.vg:hover { background: var(--hover); color: var(--ink); }

/* ---------------------------------------------------------------- the finished app
 * One card: the app's picture on a soft wash, then the file, its size and
 * what it may touch. The picture is never faded or covered -- nothing an app
 * drew is hidden (the old caption strip once hid a timer's Start button). */
#viewSession .done-card {
  width: min(660px, 100%); border-radius: 26px; overflow: hidden;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--hair), 0 30px 60px -34px rgba(30, 40, 90, 0.35), 0 2px 6px rgba(24, 24, 27, 0.04);
}
body:not(.light) #viewSession .done-card { box-shadow: 0 0 0 1px var(--hair), 0 30px 70px -34px rgba(0, 0, 0, 0.9); }
#viewSession .done-card.in { animation: krDoneIn 0.9s var(--ease) both; }
@keyframes krDoneIn { from { opacity: 0; transform: scale(0.96) translateY(12px); } }
#viewSession .done-card .shot-stage, body.light #viewSession .done-card .shot-stage {
  border: 0; border-radius: 0; padding: 26px 26px 0;
  background:
    radial-gradient(60% 70% at 20% 10%, color-mix(in srgb, var(--pink) 14%, transparent), transparent 70%),
    radial-gradient(60% 70% at 85% 20%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
}
#viewSession .done-card .shot-stage img {
  margin-bottom: 0; border: 0; border-radius: 12px 12px 0 0;
  box-shadow: 0 0 0 1px var(--hair), 0 18px 40px -24px rgba(24, 24, 27, 0.35);
}
#viewSession .done-card .shot-stage.no-shot { padding: 0; min-height: 120px; }
#viewSession .done-card .shot-stage.no-shot::after { color: var(--ink-3); font-size: 13px; }
#viewSession .done-card .shot-cap { display: none; }
#viewSession .done-card .done-meta, body.light #viewSession .done-card .done-meta {
  position: relative; padding: 18px 24px 22px 76px; background: none; border: 0;
}
#viewSession .done-meta::before {
  content: ""; position: absolute; left: 24px; top: 18px; width: 38px; height: 44px;
  background: url("krate-doc.png") center / contain no-repeat;
  filter: drop-shadow(0 3px 6px rgba(24, 24, 27, 0.12));
}
#viewSession .done-name { font-size: 18px; font-weight: 500; letter-spacing: -0.025em; color: var(--ink); }
#viewSession .done-sub { margin-top: 2px; font-size: 13px; color: var(--ink-3); }
#viewSession .done-verdict { border: 0; border-radius: 12px; background: color-mix(in srgb, var(--pink) 10%, transparent); color: var(--ink); }
#viewSession .asks { margin: 14px 0 0 -52px; gap: 6px; }
#viewSession .asks li {
  display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 10px 0 5px;
  border: 0; border-radius: 999px; font: 400 12px var(--sans); color: var(--ink-2);
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair);
  animation: krAskIn 0.5s var(--ease) both;
}
#viewSession .asks li:first-child { color: var(--ink-2); }
#viewSession .asks li::before {
  content: ""; width: 17px; height: 17px; border-radius: 50%; flex: none;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.6 8.3l2.2 2.2 4.6-4.9' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat;
}
#viewSession .asks li.no::before {
  background: var(--surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5.5 5.5l5 5m0-5l-5 5' fill='none' stroke='%238e8e96' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 13px no-repeat;
}
#viewSession .asks li.no { color: var(--ink-3); }
#viewSession .asks li:nth-child(2) { animation-delay: 0.06s; }
#viewSession .asks li:nth-child(3) { animation-delay: 0.12s; }
#viewSession .asks li:nth-child(4) { animation-delay: 0.18s; }
#viewSession .asks li:nth-child(5) { animation-delay: 0.24s; }
@keyframes krAskIn { from { opacity: 0; transform: translateY(4px) scale(0.96); } }
@media (prefers-reduced-motion: reduce) { #viewSession .done-card.in, #viewSession .asks li { animation: none; } }

/* ---------------------------------------------------------------- first run
 * The welcome has the whole window: no sidebar beside it. A short line under
 * the title, and dots along the foot for the step you are on. */
@media (min-width: 861px) {
  #viewOnboard, body.side-open #viewOnboard {
    position: fixed; inset: 0; z-index: 70; margin: 0; height: 100vh;
    border-radius: 0; box-shadow: none; background: var(--bg);
  }
}
#viewOnboard .ob-h { font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -0.045em; color: var(--ink); }
#viewOnboard .ob-p { max-width: 460px; margin: 12px auto 0; font-size: 15px; line-height: 1.55; color: var(--ink-3); text-wrap: balance; }
#viewOnboard .ob-skip { color: var(--ink-2); }
#viewOnboard .ob-cta {
  height: 42px; padding: 0 20px; gap: 8px; border: 0; border-radius: 999px;
  font: 500 14.5px var(--sans); color: var(--btn-ink); background: var(--btn);
}
#viewOnboard .ob-cta:hover { background: var(--btn-hover); }
.ob-dots { position: absolute; left: 0; right: 0; bottom: 34px; z-index: 2; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.ob-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--ink-4); transition: width 0.5s var(--ease), background 0.4s; }
.ob-dots i.on { width: 22px; background: var(--ink); }

/* ---------------------------------------------------------------- Files, Code, Details
 * The same surfaces as the rest: grouped rows on a white card with hairlines
 * between them, quiet section labels, pill buttons. */
#viewSession .pane-head { padding: 16px 20px 10px; border-bottom: 0; gap: 8px; }
#viewSession .pane-title { font-size: 15px; font-weight: 500; letter-spacing: -0.015em; color: var(--ink); }
#viewSession .pane-scroll { padding: 6px 20px 20px; }
#viewSession .pane-empty { color: var(--ink-3); }
#viewSession .btn {
  border: 0; border-radius: 999px; font-family: var(--sans); font-weight: 500;
  background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
#viewSession .btn:hover { background-image: linear-gradient(var(--hover), var(--hover)); }
#viewSession .btn:active { transform: scale(0.97); }
#viewSession .btn.btn-primary { background: var(--btn); color: var(--btn-ink); box-shadow: none; }
#viewSession .btn.btn-primary:hover { background: var(--btn-hover); }
#viewSession .btn.btn-ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
#viewSession .btn.btn-ghost:hover { background: var(--hover); color: var(--ink); }
#viewSession .btn.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }

.f-group { margin-bottom: 20px; }
.f-label { margin: 0 0 8px 2px; font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.f-group > .f-row { border-radius: 0; padding: 11px 14px; gap: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair); }
.f-group > .f-row + .f-row { margin-top: 1px; }
.f-group > .f-label + .f-row { border-radius: 14px 14px 0 0; }
.f-group > .f-row:last-child { border-radius: 0 0 14px 14px; }
.f-group > .f-label + .f-row:last-child { border-radius: 14px; }
.f-row:hover { background: var(--hover); }
.f-group > .f-row:hover { background: linear-gradient(var(--hover), var(--hover)) var(--surface); }
.f-row .f-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--ink-2); }
.f-row .f-name { font-size: 13.5px; color: var(--ink); }
.f-row .f-note { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.f-row button {
  height: 28px; padding: 0 12px; border: 0; border-radius: 999px;
  font: 500 12.5px var(--sans); color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong);
}
.f-row button:hover { background-image: linear-gradient(var(--hover), var(--hover)); border: 0; }

.code-tree { border-right: 1px solid var(--line); }
.code-search {
  margin: 12px; height: 34px; padding: 0 12px; border: 0; border-radius: 10px;
  font: 400 13px var(--sans); color: var(--ink); background: var(--surface-2);
}
.code-search:focus { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, var(--hair)); }
.code-dir { font-size: 12px; color: var(--ink-3); }
.code-file { height: 32px; padding: 0 10px; border-radius: 9px; font: 400 13px var(--sans); color: var(--ink-2); }
.code-file:hover { background: var(--hover); color: var(--ink); }
.code-file.on { background: var(--selected); color: var(--ink); box-shadow: none; }
.code-file.on:hover { background: var(--selected-hover); }
.code-head { border-bottom: 1px solid var(--line); }
.code-path { color: var(--ink); }
.code-ro, .code-stats { color: var(--ink-3); }
.code-text .ln::before { color: var(--ink-4); }
.code-text .ln:hover { background: var(--hover); }

.dt-name { font-size: 24px; font-weight: 500; letter-spacing: -0.03em; color: var(--ink); }
.dt-trust { color: var(--ink-2); }
.dt-chip { border: 0; padding: 0 11px; height: 26px; display: inline-flex; align-items: center; font-size: 12.5px; color: var(--ink-2); background: var(--surface); box-shadow: 0 0 0 1px var(--hair); }
.dt-card { border: 0; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(24, 24, 27, 0.04); padding: 16px 18px 18px; }
.dt-card h3 { font-size: 14px; font-weight: 500; color: var(--ink); }
.dt-count { color: var(--ink-3); }
.dt-list li { border-radius: 10px; background: var(--surface-2); color: var(--ink); }
.dt-dot { background: var(--accent); }
.dt-dot.ok { background: var(--green); }
.dt-note { color: var(--ink-3); }
.dt-cmd { border: 0; border-radius: 10px; background: var(--surface-2); color: var(--ink); }
.dt-rows dt { color: var(--ink-3); }
.dt-rows dd { color: var(--ink); }

/* ---------------------------------------------------------------- small menus (Share, the title, "...")
 * A floating card that grows out of the button that opened it. */
.pop {
  border: 0; border-radius: 16px; padding: 6px; background: var(--surface);
  box-shadow: var(--sh-pop);
  transform-origin: top right; animation: krPopIn 0.22s var(--ease) both;
}
body.light .pop { box-shadow: var(--sh-pop); }
@keyframes krPopIn { from { opacity: 0; transform: translateY(-4px) scale(0.97); } }
.pop button, .pop .pop-row { min-height: 38px; padding: 0 12px; border-radius: 10px; font: 400 13.5px var(--sans); color: var(--ink); transition: background 0.15s; }
.pop button:hover { background: var(--hover); }
.pop .pop-val { padding-left: 16px; font-size: 12.5px; color: var(--ink-3); }
.pop .pop-sub { color: var(--ink-2); }
.pop hr { border-top-color: var(--line); }
@media (prefers-reduced-motion: reduce) { .pop { animation: none; } }

/* ---------------------------------------------------------------- sheets and Settings
 * The page behind dims and softens; the sheet rises a little and settles. */
.sheet-wrap { background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(8px) saturate(1.1); -webkit-backdrop-filter: blur(8px) saturate(1.1); }
body:not(.light) .sheet-wrap { background: rgba(0, 0, 0, 0.55); }
.sheet {
  border: 0; border-radius: 22px; padding: 24px; background: var(--surface);
  box-shadow: var(--sh-pop); animation: krSheetIn 0.4s var(--ease) both;
}
@keyframes krSheetIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.sheet h2 { font-size: 18px; font-weight: 500; letter-spacing: -0.025em; color: var(--ink); }
.sheet-sub { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.sheet-foot { color: var(--ink-3); }
.sheet input[type="text"], .sheet input[type="email"], .sheet input[type="url"], .sheet input:not([type]), .sheet textarea, .sheet select {
  border: 0; border-radius: 12px; background: var(--surface-2); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hair); font-family: var(--sans);
  transition: box-shadow 0.2s, background 0.2s;
}
.sheet input:focus, .sheet textarea:focus, .sheet select:focus {
  outline: none; background: var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, var(--hair)), 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent);
}
.sheet .btn, .set-modal .btn {
  border: 0; border-radius: 999px; font-family: var(--sans); font-weight: 500;
  background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong);
  transition: background 0.2s, transform 0.2s var(--ease);
}
.sheet .btn:hover, .set-modal .btn:hover { background-image: linear-gradient(var(--hover), var(--hover)); }
.sheet .btn:active, .set-modal .btn:active { transform: scale(0.97); }
.sheet .btn.btn-primary, .set-modal .btn.btn-primary { background: var(--btn); color: var(--btn-ink); box-shadow: none; }
.sheet .btn.btn-primary:hover, .set-modal .btn.btn-primary:hover { background: var(--btn-hover); }
.sheet .btn.btn-ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .sheet, .set-modal { animation: none; } }

.set-modal {
  border: 0; border-radius: 22px; background: var(--surface);
  box-shadow: var(--sh-pop); animation: krSheetIn 0.4s var(--ease) both;
}
.set-side, body.light .set-side { background: var(--surface-2); border-right: 1px solid var(--line); padding: 20px 10px 14px; }
body:not(.light) .set-side { background: #141417; }
.set-side-head { font-size: 15px; font-weight: 500; letter-spacing: -0.015em; color: var(--ink); }
.set-nav button { height: 34px; padding: 0 10px; border-radius: 10px; font: 400 13.5px var(--sans); color: var(--ink-2); }
.set-nav button:hover { background: var(--hover); color: var(--ink); }
.set-nav button.on { background: var(--selected); color: var(--ink); font-weight: 500; box-shadow: none; }
.set-close { width: 30px; height: 30px; border-radius: 999px; color: var(--ink-3); }
.set-close:hover { background: var(--hover); color: var(--ink); }
.set-scroll .set-group > h2 { font-size: 18px; letter-spacing: -0.025em; color: var(--ink); }
.set-sub { color: var(--ink-3); }
.set-group .set-panel, .set-group.panel { border: 0; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(24, 24, 27, 0.04); }
.set-row, body.light .set-row { background: var(--surface); border: 0; border-radius: 14px; box-shadow: 0 0 0 1px var(--hair); backdrop-filter: none; -webkit-backdrop-filter: none; }
.set-group > .set-row, body.light .set-group > .set-row { background: transparent; box-shadow: none; border-radius: 0; border-top: 1px solid var(--line); }
.set-group > .set-row:first-of-type { border-top: 0; }
.set-group > .set-row:hover, body.light .set-group > .set-row:hover { background: var(--hover); }
.set-row .lab { color: var(--ink); }
.set-row .hint { color: var(--ink-3); }
.set-val { border: 0; border-radius: 8px; font-size: 12px; color: var(--ink-2); background: var(--surface-2); }
.set-mini { height: 30px; padding: 0 13px; border: 0; border-radius: 999px; font: 500 12.5px var(--sans); color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.set-mini:hover { background-image: linear-gradient(var(--hover), var(--hover)); border: 0; }
.set-mini.go, .set-mini.go:hover { background: var(--btn); color: var(--btn-ink); box-shadow: none; filter: none; }
.set-panel > .set-row, body.light .set-panel > .set-row { margin: 0; background: transparent; box-shadow: none; border-radius: 0; border-top: 1px solid var(--line); }
.set-panel > .set-row:first-child { border-top: 0; }
.set-panel > .set-row:hover, body.light .set-panel > .set-row:hover { background: var(--hover); }

/* ---------------------------------------------------------------- Your apps, Gallery, one app
 * Pages read like the site: a large quiet heading on the left, the tools on
 * the right, and each app shown as its own picture first with its name under
 * it. */
.page-inner { max-width: 1160px; padding: 56px 44px 0; }
.page-head { margin-bottom: 26px; align-items: flex-end; }
.page-head h1 { font-size: 34px; font-weight: 500; letter-spacing: -0.04em; color: var(--ink); margin: 0 0 6px; }
.page-head p { font-size: 14.5px; color: var(--ink-3); }
.page-head .head-actions { margin-left: auto; }
.apps-count { color: var(--ink-3); }
.apps-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px 22px; }
.app-card, body.light .app-card {
  background: none; border: 0; box-shadow: none; border-radius: 16px; overflow: visible;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  transition: transform 0.4s var(--ease);
}
.app-card:hover { border: 0; transform: translateY(-3px); }
.app-card .thumb-well {
  height: auto; aspect-ratio: 16 / 10.5; padding: 16px 16px 0; border: 0; border-radius: 16px;
  background: var(--surface-2); box-shadow: 0 0 0 1px var(--hair);
  transition: box-shadow 0.4s var(--ease);
}
.app-card:hover .thumb-well { box-shadow: 0 0 0 1px var(--hair), 0 18px 40px -24px rgba(30, 40, 90, 0.35); }
.app-card .thumb-well img { border: 0; border-radius: 8px 8px 0 0; box-shadow: 0 0 0 1px var(--hair), 0 8px 24px -14px rgba(24, 24, 27, 0.4); }
.app-card .card-body { padding: 12px 2px 0; }
.app-card .card-body .name { font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
.app-card .card-body .meta { font-size: 12.5px; color: var(--ink-3); }
.card-x { top: 10px; right: 10px; width: 28px; height: 28px; border: 0; border-radius: 999px; color: var(--ink-2); background: var(--surface); box-shadow: var(--sh-1); }
.card-x:hover { color: var(--danger); border: 0; }
.apps-finish {
  border: 0; border-radius: 16px; padding: 0 12px 0 18px; min-height: 54px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(24, 24, 27, 0.04);
  font-size: 14px; color: var(--ink-2);
}
.apps-finish > span:first-child { display: inline-flex; align-items: center; gap: 0; white-space: pre; }
.apps-finish > span:first-child::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); margin-right: 12px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 18%, transparent); }
.apps-finish:hover { border: 0; color: var(--ink); }
.apps-finish b { color: var(--ink); }
.apps-finish .go, .apps-finish .apps-x { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 999px; color: var(--ink-3); }
.apps-finish .go:hover, .apps-finish .apps-x:hover { background: var(--hover); color: var(--ink); }

.cloud { padding: 52px 44px 64px; }
.cloud-head { max-width: 1160px; margin: 0 auto 22px; text-align: left; }
.cloud-head .display { font-size: 34px; font-weight: 500; letter-spacing: -0.04em; color: var(--ink); margin-bottom: 6px; }
.cloud-sub { max-width: 620px; font-size: 14.5px; color: var(--ink-3); }
.cloud-controls, .cloud-grid, .cloud-shelves { max-width: 1160px; }
.cloud-count { max-width: 1160px; margin-left: auto; margin-right: auto; color: var(--ink-3); }
.cloud-search {
  height: 40px; padding: 0 14px; border: 0; border-radius: 12px; color: var(--ink-3);
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(24, 24, 27, 0.04);
}
.cloud-search:focus-within { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, var(--hair)), 0 0 0 4px color-mix(in srgb, var(--accent) 7%, transparent); }
.cloud-search input { font: 400 14px var(--sans); color: var(--ink); }
.cloud-search input::placeholder { color: var(--ink-3); }
.cloud-cats { padding: 3px; gap: 0; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); }
.cloud-cats .cat { height: 30px; padding: 0 14px; border: 0; border-radius: 999px; font: 400 13px var(--sans); color: var(--ink-3); background: transparent; transition: color 0.3s, background 0.3s; }
.cloud-cats .cat:hover { color: var(--ink); border: 0; }
.cloud-cats .cat.on { color: var(--btn-ink); background: var(--btn); }
.shelf-row-head h2 { font-size: 16px; letter-spacing: -0.02em; color: var(--ink); }
.shelf-row-more { color: var(--ink-3); }
.shelf-row-more:hover { color: var(--ink); }
.shelf-strip { gap: 20px; padding: 2px 2px 8px; }
.shelf-strip .cloud-card { width: 280px; }
.cloud-grid { gap: 28px 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cloud-card {
  gap: 0; padding: 0; border: 0; border-radius: 16px; background: none; box-shadow: none;
  transition: transform 0.4s var(--ease);
}
.cloud-card:hover { border: 0; transform: translateY(-3px); }
.cloud-card .cloud-shot {
  margin: 0 0 12px; border: 0; border-radius: 16px; background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--hair); transition: box-shadow 0.4s var(--ease);
}
.cloud-card:hover .cloud-shot { box-shadow: 0 0 0 1px var(--hair), 0 18px 40px -24px rgba(30, 40, 90, 0.35); }
.cloud-card .cloud-id { padding: 0 2px; }
.cloud-card .cloud-icon { width: 30px; height: 30px; border-radius: 8px; font-size: 11.5px; border: 0; }
.cloud-name { font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
.cloud-tag { font-size: 12px; color: var(--ink-3); text-transform: capitalize; }
.cloud-desc { margin: 8px 2px 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.cloud-foot { margin-top: 8px; padding: 0 2px; }
.cloud-by { color: var(--ink-3); }
.cloud-meta { color: var(--ink-3); }

.detail .appstage { border-radius: 22px; box-shadow: 0 0 0 1px var(--hair), 0 30px 60px -34px rgba(30, 40, 90, 0.35); }
.detail .card, body.light .detail .card { border: 0; border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(24, 24, 27, 0.04); }
.detail .label, #viewApp .label { font-size: 13px; font-weight: 500; letter-spacing: -0.005em; text-transform: none; color: var(--ink); }
.detail .quick .k { letter-spacing: 0; text-transform: none; font-family: var(--sans); font-size: 12px; color: var(--ink-3); }
.detail .actionbar .btn { border: 0; border-radius: 999px; font: 500 14px var(--sans); background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }
.detail .actionbar .btn.btn-primary { background: var(--btn); color: var(--btn-ink); box-shadow: none; }
.sheet .label { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.sheet input[type="checkbox"], .set-modal input[type="checkbox"] { accent-color: var(--accent); }

/* ---------------------------------------------------------------- a build that did not come together */
#viewSession .fail-card, body.light #viewSession .fail-card {
  border: 0; border-radius: 26px; background: var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 30%, var(--hair)), 0 30px 60px -34px rgba(30, 40, 90, 0.3);
  animation: krSheetIn 0.5s var(--ease) both;
}
#viewSession .fail-card.bloom::before { display: none; }
#viewSession .fail-mark { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border: 0; }
#viewSession .fail-title { font-size: 18px; font-weight: 500; letter-spacing: -0.025em; color: var(--ink); }
#viewSession .fail-why { color: var(--ink-2); }
#viewSession .fail-offer, body.light #viewSession .fail-offer { border: 0; border-radius: 14px; background: var(--surface-2); color: var(--ink-2); }
#viewSession .fail-offer b { color: var(--ink); }
#viewSession .fail-raw-wrap summary { color: var(--ink-3); }
#viewSession .fail-raw { border: 0; border-radius: 12px; background: var(--surface-2); color: var(--ink); }
@media (prefers-reduced-motion: reduce) { #viewSession .fail-card { animation: none; } }
@media (max-width: 600px) {
  .cloud { padding: 28px 18px 48px; }
  .page-inner { padding: 28px 18px 0; }
  .cloud-head .display, .page-head h1 { font-size: 28px; }
}

/* ================================================================ round two
 * Element by element against the design's Studio prototype: the sidebar
 * (indicator, rail, account), Home's typing placeholder and chips, the
 * conversation (bubble, mark, words, thinking, build steps, receipt), the
 * composer pill, the stage's glow, the finished card's glint and badge, and
 * the motion between views and panes. */

.kr-ico { width: 16px; height: 16px; flex: none; }
.kr-lgo { width: 18px; height: 18px; flex: none; display: block; }
.kr-lgo-dot { width: 7px; height: 7px; margin: 0 5px; border-radius: 50%; background: var(--green); }

/* ---- boot --------------------------------------------------------------- */
.kr-boot { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: var(--bg); transition: opacity .6s var(--ease), visibility .6s; }
.kr-boot.gone { opacity: 0; visibility: hidden; }
.kr-bm { position: relative; width: 56px; height: 56px; }
.kr-bm img { width: 56px; height: 56px; object-fit: contain; animation: krBootIn 1s var(--spring) both; }
.kr-bm::after { content: ""; position: absolute; left: 50%; bottom: -26px; width: 120px; height: 2px; margin-left: -60px; border-radius: 2px; opacity: .6;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 200% 100%; animation: krBootLine 1.1s var(--io) infinite; }
@keyframes krBootIn { from { opacity: 0; transform: translateY(14px) scale(.86); filter: blur(6px); } }
@keyframes krBootLine { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---- views and panes arrive, they do not blink in ----------------------- */
.view:not(.hidden) { animation: krViewIn .55s var(--ease) both; }
@keyframes krViewIn { from { opacity: 0; } }
#viewSession .panel-pane:not(.hidden) { animation: krPaneIn .45s var(--ease) both; }
@keyframes krPaneIn { from { opacity: 0; transform: translateY(6px); } }
.page-head > *, .cloud-head > * { animation: krRv .8s var(--ease) both; }
.page-head > :nth-child(2), .cloud-head > :nth-child(2) { animation-delay: .07s; }
@keyframes krRv { from { opacity: 0; transform: translateY(14px); } }

/* ---- small menus --------------------------------------------------------- */
.kr-pop { position: fixed; z-index: 300; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--surface); box-shadow: var(--sh-pop); animation: krPopIn2 .4s var(--spring) both; }
body:not(.light) .kr-pop { background: #1c1c1f; }
.kr-pop.big { min-width: 280px; padding: 7px; }
@keyframes krPopIn2 { from { opacity: 0; transform: translateY(-4px) scale(.96); } }
.kr-pi { width: 100%; min-height: 34px; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 0; border-radius: 9px; background: none; cursor: pointer;
  font: 400 13.5px var(--sans); color: var(--ink); text-align: left; transition: background .15s; }
.kr-pi:hover, .kr-pi.hl { background: var(--hover); }
.kr-pi .kr-ico { width: 15px; height: 15px; color: var(--ink-3); }
.kr-pi .kr-pt { flex: 1; min-width: 0; }
.kr-pi small { display: block; font-size: 12px; color: var(--ink-3); }
.kr-pi em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--ink-3); }
.kr-pi .kr-tick { color: var(--accent); }
.kr-pop.big .kr-pi { min-height: 50px; padding: 8px 12px; border-radius: 11px; }
.kr-pop.big .kr-pi .kr-pt { font-weight: 500; }
.kr-pop.big .kr-pi.on { background: var(--selected); }
.kr-pop.big .kr-pi.on:hover, .kr-pop.big .kr-pi.on.hl { background: var(--selected-hover); }
.kr-sep { height: 1px; margin: 5px 6px; background: var(--line); }
.kr-pop-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 13.5px; }
.kr-pop-head b { display: block; font-weight: 500; } .kr-pop-head small { display: block; font-size: 12px; color: var(--ink-3); }
.kr-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12.5px; font-weight: 600; color: #fff; background: linear-gradient(140deg, #6c8cff, #9a6cf0); }

/* ---- the sidebar --------------------------------------------------------- */
.side { padding: 0 12px 10px; }
.side-nav { position: relative; gap: 1px; }
.side-nav > .side-row { position: relative; z-index: 1; padding: 0 10px 0 12px; gap: 12px; }
.side-nav > .side-row.on, body.light .side-nav > .side-row.on { background: transparent; box-shadow: none; }
.kr-ind { position: absolute; left: 0; right: 0; top: 0; z-index: 0; height: 34px; border-radius: 10px; background: var(--selected); box-shadow: none;
  transition: transform .5s var(--ease), height .3s var(--ease), opacity .3s, background .2s; pointer-events: none; }
.side-nav:has(> .side-row.on:hover) > .kr-ind { background: var(--selected-hover); }
.side-nav > .side-search { position: relative; z-index: 1; margin: 0; height: 34px; padding: 0 10px 0 12px; gap: 12px; border-radius: 10px; }
.side-nav > .side-search svg { width: 15px; height: 15px; color: var(--ink-3); }
.side-nav > .side-search input::placeholder { color: var(--ink-2); }
.side-nav > .side-search .side-key { margin-left: auto; font-size: 11px; color: var(--ink-4); padding: 1px 6px; border-radius: 6px; }
.kr-gap { display: block; height: 10px; }
.side-label { margin: 22px 12px 6px; }
.side-brandrow { padding: 0 2px; margin-bottom: 8px; }
.side-mark { padding: 0 10px; gap: 8px; }
.side-mark img { width: 18px; height: 18px; }
.side-mark span { font-size: 14.5px; font-weight: 500; letter-spacing: -.02em; color: var(--ink-2); }

/* recents: plain rows, the open one raised, the one being made pulsing */
.sess-row { height: 34px; min-height: 0; padding: 0 6px 0 12px; gap: 8px; border-radius: 10px; font: 400 13.5px var(--sans); color: var(--ink-2); }
.sess-row:hover { background: var(--hover); color: var(--ink); }
.sess-row.on, body.light .sess-row.on { background: var(--selected); color: var(--ink); box-shadow: none; }
.sess-row.on:hover, body.light .sess-row.on:hover { background: var(--selected-hover); }
.sess-dot, .sess-dot.here, body.light .sess-dot.here { display: none; }
.sess-row.kr-live::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); animation: krPing 1.6s var(--ease) infinite; }
@keyframes krPing { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.sess-row.kr-enter { animation: krRowIn .6s var(--ease) both; }
@keyframes krRowIn { from { opacity: 0; transform: translateY(-6px); } }
.sess-kebab { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border-radius: 7px; color: var(--ink-3); transition: opacity .2s, background .2s; }
.sess-kebab:hover { background: var(--hover); color: var(--ink); }
.sess-name[contenteditable="true"], body.light .sess-name[contenteditable="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, var(--hair)); }

/* the foot: you, then the bell; the old rows live in your menu */
#sideShare, #sideDocs, #sideSettings { display: none; }
.side-foot { padding-top: 6px; gap: 0; }
.side-me, body.light .side-me { margin-top: 0; padding: 4px 0 0; border-top: 0; gap: 4px; }
.side-avatar, body.light .side-avatar { flex: 1; min-width: 0; width: auto; height: 42px; padding: 0 6px 0 10px; gap: 10px; display: flex; align-items: center; justify-content: flex-start;
  border: 0; border-radius: 11px; background: transparent; overflow: hidden; text-align: left; transition: background .2s; }
.side-avatar:hover, body.light .side-avatar:hover { background: var(--hover); border: 0; }
.side-avatar > img, .side-avatar > #sideInitial { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; object-fit: cover; }
.side-avatar > #sideInitial { font-size: 12.5px; font-weight: 600; color: #fff; background: linear-gradient(140deg, #6c8cff, #9a6cf0); }
.side-avatar > img:not(.hidden) + #sideInitial { display: none; }
.kr-mt { min-width: 0; display: block; }
.kr-mt b { display: block; font-size: 13px; font-weight: 500; line-height: 1.2; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kr-mt small { display: block; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-bell { width: 32px; height: 32px; margin-left: 0; border-radius: 9px; color: var(--ink-2); }
.side-bell:hover { background: var(--hover); color: var(--ink); }
.bell-dot { box-shadow: 0 0 0 2px var(--side-bg); background: var(--accent); }

/* the rail: a shut sidebar on a wide window keeps its icons */
.kr-tip { position: fixed; z-index: 320; height: 26px; padding: 0 9px; display: flex; align-items: center; border-radius: 8px; font: 500 12px var(--sans); white-space: nowrap;
  color: var(--btn-ink); background: var(--btn); box-shadow: var(--sh-2); opacity: 0; transform: translate(-4px, -50%); pointer-events: none; transition: opacity .15s, transform .25s var(--ease); }
.kr-tip.on { opacity: 1; transform: translate(0, -50%); }
@media (min-width: 861px) {
  body.kr-rail .side { transform: none; width: 72px; padding: 0 10px 10px; overflow: hidden; }
  body.kr-rail .view { margin-left: 72px; }
  body.kr-rail .titlebar .side-toggle:not(#sideCloseToggle) { display: none; }
  body.kr-rail .side-top { justify-content: center; padding: 0; }
  body.kr-rail .side-mark span { display: none; }
  body.kr-rail .side-mark { padding: 0 8px; }
  body.kr-rail .side-brandrow { justify-content: center; }
  body.kr-rail .side-mark span, body.kr-rail .side-row > span, body.kr-rail .side-nav > .side-search input,
  body.kr-rail .side-nav > .side-search .side-key, body.kr-rail .kr-mt { opacity: 0; pointer-events: none; }
  /* Every rail control is one 30px square with a 9px corner, the size of
     the panel toggle above them, centred on the rail's one centre line.
     A row keeps its 35px pitch (30 + 2 + 2 + the list's 1px), so each
     icon stays exactly where it sits in the open sidebar and folding it
     only takes the words away; the squares have 5px between them instead
     of the 1px that made two highlights read as one slab. */
  body.kr-rail #side .side-nav > .side-row, body.kr-rail #side .side-nav > .side-search {
    width: 30px; height: 30px; margin: 2px auto; padding: 0 0 0 7.5px; border-radius: 9px; overflow: hidden;
  }
  body.kr-rail #side .side-nav > .kr-ind { left: 50%; right: auto; width: 30px; margin-left: -15px; border-radius: 9px; }
  body.kr-rail .side-label, body.kr-rail .side-sessions { opacity: 0; visibility: hidden; }
  body.kr-rail .side-me { flex-direction: column-reverse; align-items: center; }
  /* The avatar's square is the photo plus 4px a side; its 3px margins keep
     the 42px the open sidebar gives it, so the bell above does not move. */
  body.kr-rail #side .side-avatar { width: 36px; height: 36px; margin: 3px 0; flex: none; padding: 0 0 0 4px; border-radius: 10px; }
  body.kr-rail #side .side-bell { width: 30px; height: 30px; margin: 1px 0; }
  body.kr-rail .side-grip { display: none; }
}
.side-mark span, .side-row > span, .side-nav > .side-search input, .kr-mt, .side-label, .side-sessions { transition: opacity .25s var(--ease); }

/* ---- Home ---------------------------------------------------------------- */
#viewHome .home-hero { position: relative; }
#viewHome .home-hero::before { content: ""; position: absolute; left: 50%; top: 44%; width: 120%; height: 70%; transform: translate(-50%, -50%); z-index: -1; pointer-events: none; filter: blur(10px);
  background: radial-gradient(40% 50% at 30% 50%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%), radial-gradient(40% 50% at 72% 55%, color-mix(in srgb, var(--violet) 10%, transparent), transparent 70%), radial-gradient(30% 40% at 52% 80%, color-mix(in srgb, var(--pink) 7%, transparent), transparent 70%); }
#viewHome .home-title .rw .w { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: color-mix(in srgb, var(--accent) 42%, var(--ink));
  transform: translateY(.42em); filter: blur(6px); transition: opacity .55s var(--ease), transform .8s var(--ease), filter .6s var(--ease); }
#viewHome .home-title .rw .w + .w { color: color-mix(in srgb, var(--violet) 46%, var(--ink)); }
#viewHome .home-title .rw .w.on { transition-delay: .12s; }
#viewHome .home-title .rw .w.out { transform: translateY(-.42em); }
/* the typed word: text, then a caret that blinks while it waits */
#viewHome .home-title .rw.kr-typed { display: inline-block; width: auto; transition: none; white-space: nowrap; }
#viewHome .home-title .rw.kr-typed .tw { color: color-mix(in srgb, var(--accent) 42%, var(--ink)); transition: color .3s var(--ease); }
#viewHome .home-title .rw.kr-typed[data-i="1"] .tw { color: color-mix(in srgb, var(--violet) 46%, var(--ink)); }
#viewHome .home-title .rw.kr-typed .tq { color: var(--ink); }
#viewHome .home-title .rw.kr-typed .car { display: inline-block; width: .07em; height: .86em; margin-left: .05em; vertical-align: -.06em; border-radius: 2px; background: color-mix(in srgb, var(--accent) 70%, var(--ink)); animation: krBlink 1.06s steps(1) infinite; }
#viewHome .home-title .rw.kr-typed.busy .car { animation: none; }
.kr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { #viewHome .home-title .rw.kr-typed .car { display: none; } }
#viewHome .home-sub.kr-swap { animation: krSwap .55s var(--ease) both; }
@keyframes krSwap { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } }
.home-tabs .tab-ind { background: linear-gradient(90deg, var(--accent), var(--violet)); transition: left .5s var(--ease), width .5s var(--ease); }
.kr-ta { position: relative; }
.kr-ta textarea { display: block; width: 100%; }
@keyframes krBlink { 50% { opacity: 0; } }

/* chips in the composer row: who writes it, and Build or Plan first */
#builtByChip { font-size: 0; gap: 6px; }
#builtByChip > b, #builtByChip .kr-lg { font-size: 13.5px; }
#builtByChip > b { font-weight: 400; color: var(--ink-2); }
#builtByChip > .dot, #builtByChip > .chev, #agentChip2 > .dot, #agentChip2 > .chev, #agentChip > .dot, #agentChip > .chev { display: none; }
.kr-lg { display: inline-grid; place-items: center; width: 20px; height: 20px; position: relative; }
.kr-lg > svg:not(.kr-lgo) { width: 15px; height: 15px; }
/* kr-state: kr-aibad -- added by redesign.js to an AI chip whose AI needs attention */
.kr-aibad .kr-lg::after { content: ""; position: absolute; right: 0; bottom: 1px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 1.5px var(--surface); }
.kr-chev { width: 12px; height: 12px; opacity: .55; }
#viewSession #agentChip2 > span:not(.kr-lg) { display: none; }
#viewSession #agentChip2 { padding: 0 8px; gap: 4px; }
.web-mode.kr-folded { display: none !important; }
.kr-mode { height: 34px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; flex: none;
  font: 400 13.5px var(--sans); color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s; }
.kr-mode:hover { background: var(--hover); color: var(--ink); }
.kr-mode.plan .mv { color: var(--violet); font-weight: 500; }
body:not(.light) .kr-mode.plan .mv { color: #a891ff; }
.kr-mode.compact:not(.plan) { display: none; }
#viewHome .bigbar-row { gap: 2px; }
#viewHome .bigbar-row #homeAttachBtn { order: 0; } #viewHome .bigbar-row .kr-mode { order: 1; } #viewHome .bigbar-row #builtByChip { order: 2; }
#viewHome .bigbar-row .grow { order: 3; } #viewHome .bigbar-row #homeVoiceBtn { order: 4; } #viewHome .bigbar-row #homeSend { order: 5; }
#viewHome .bigbar-row .tool.plus, #viewSession .sessbar .tool.plus { box-shadow: none; }
.tool.wave.listening { color: #fff; background: var(--danger); animation: krMic 1.2s ease-in-out infinite; }
@keyframes krMic { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 18%, transparent); } }

/* the send: Krate's rounded square on Home, a round button in a session.
   Empty, it is the voice button; with words, an arrow; building, a stop. */
#homeSend { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
#homeSend.ready:hover { transform: translateY(-1px); border-radius: 14px; }
/* kr-state: kr-sending kr-micbtn -- added by redesign.js so these rules style them */
#send, #homeSend { position: relative; }
#send svg, #homeSend svg { position: absolute; left: 50%; top: 50%; translate: -50% -50%; transition: opacity .25s, transform .4s var(--spring); }
.kr-wave { width: 18px; height: 18px; opacity: 0; transform: scale(.4); }
#send.kr-voice .kr-wave, #send.kr-listen .kr-wave { opacity: 1; transform: none; }
#send.kr-voice .send-arrow, #send.kr-listen .send-arrow { opacity: 0; transform: scale(.4) rotate(-90deg); }
#send.kr-voice { background: var(--btn); color: var(--btn-ink); }
#send.kr-listen { background: var(--danger); color: #fff; animation: krMic 1.2s ease-in-out infinite; }
/* Sent: the button dips, the arrow lifts away, a soft ring goes out, the
   mark breathes while the words land, then the stop square settles in.
   The stop stays the dark button (style.css's .send.stopping lost to
   .bigbar-row .send here and painted it pale grey). */
#send.stopping, #send.stopping.ready { background: var(--btn); color: var(--btn-ink); box-shadow: none; }
#send.stopping:hover { background: var(--btn-hover); }
#send .send-square { display: block; width: 18px; height: 18px; opacity: 0; transform: scale(.3); }
#send.stopping .send-square { opacity: 1; transform: none; }
#send.stopping .send-arrow { display: block; opacity: 0; transform: scale(.4); }
#send.kr-sending { animation: krSendDip .32s var(--spring); }
#send.kr-sending .send-arrow { opacity: 0 !important; transform: translateY(-14px) scale(.7) !important; transition: opacity .22s, transform .3s var(--ease); }
#send.kr-sending::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: krSendRing .7s var(--ease) both; }
@keyframes krSendDip { 40% { transform: scale(.88); } }
@keyframes krSendRing { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } to { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { #send.kr-sending, #send.kr-sending::before { animation: none; } }
#homeSend .kr-wave { display: none; }

/* ---- the session's header ------------------------------------------------ */
#viewSession .sess-title { height: 32px; padding: 0 8px 0 10px; border-radius: 9px; transition: background .2s; }
#viewSession .sess-title:hover { background: var(--hover); }
#viewSession .sess-title .crumb { font-size: 14px; }
.kr-ver { height: 22px; padding: 0 8px; margin-left: 2px; border-radius: 999px; display: inline-flex; align-items: center; flex: none;
  font: 500 11.5px var(--sans); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-strong); font-variant-numeric: tabular-nums; animation: krPop .45s var(--spring) both; }
.kr-ver[hidden] { display: none; }
@keyframes krPop { from { transform: scale(.3); opacity: 0; } }
.ptabs { position: relative; }
.ptabs button { position: relative; z-index: 1; }
/* The thumb behind the tabs is the current tab's look; the tab itself stays
   clear, or in dark it painted a second box that jumped while the thumb slid. */
.ptabs button.on, body.light .ptabs button.on, body:not(.light) .ptabs button.on { background: transparent; box-shadow: none; }
.kr-thumb { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; z-index: 0; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 2px 6px -2px rgba(24, 24, 27, .16); pointer-events: none; }
.kr-thumb.ready { transition: left .45s var(--ease), width .45s var(--ease); }
body:not(.light) .kr-thumb { background: var(--surface-3); }
.kr-thumb.dark, body:not(.light) .kr-thumb.dark { background: var(--btn); box-shadow: none; transition: left .45s var(--ease), width .45s var(--ease), opacity .3s; }
#viewSession .panel-bar .btn:not(.hidden) { animation: krFadeUp .45s var(--ease) both; }
@keyframes krFadeUp { from { opacity: 0; transform: translateY(-4px); } }
#barRun, #barShare { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 15px; }
#barRun::before { content: ""; width: 11px; height: 11px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 3.6v8.8c0 .5.5.8.9.5l6.6-4.4a.6.6 0 0 0 0-1L5.9 3.1c-.4-.3-.9 0-.9.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 3.6v8.8c0 .5.5.8.9.5l6.6-4.4a.6.6 0 0 0 0-1L5.9 3.1c-.4-.3-.9 0-.9.5z'/%3E%3C/svg%3E") center / contain no-repeat; }
#barShare .kr-ico { width: 15px; height: 15px; }

/* ---- the conversation ------------------------------------------------------ */
#thread { gap: 18px; padding: 18px 22px 24px; }
#thread > .kr-in { animation: krItIn .6s var(--ease) both; }
@keyframes krItIn { from { opacity: 0; transform: translateY(8px); } }
/* your words: a bubble with one corner tucked in */
#thread .msg.you { align-self: flex-end; max-width: 84%; padding: 0; border: 0; background: none; box-shadow: none; }
#viewSession #thread .msg.you .body { padding: 10px 14px; border: 0; border-radius: 18px 18px 6px 18px; background: var(--surface-2); font-size: 14px; line-height: 1.5; color: var(--ink); }
#thread .msg .who { display: none; }
/* Krate's: the mark where its turn starts, everything it says beside it */
#thread .msg.krate, #thread .thought, #thread .plancard { position: relative; margin-left: 26px; }
#thread .msg.you + .msg.krate::before, #thread .msg.you + .thought::before, #thread > :first-child.krate::before {
  content: ""; position: absolute; left: -26px; top: 4px; width: 16px; height: 16px; background: url("krate-logo.png") center / contain no-repeat; }
#thread .msg.krate .body { font-size: 14px; line-height: 1.6; color: var(--ink); }
.kr-w { opacity: 0; animation: krWord .4s var(--ease) forwards; }
@keyframes krWord { to { opacity: 1; } }
#thread .msg-tools { opacity: 0; transition: opacity .2s; }
/* Only the newest answer keeps its copy row in the flow; an older one shows
   it on hover, floating, so answers are not spaced apart by empty rows. */
@media (hover: hover) { #thread .msg.krate:not(.last) > .msg-tools { position: absolute; right: 0; bottom: -30px; z-index: 2; margin: 0; padding: 2px; border-radius: 9px; background: var(--bg); } }
@media (hover: none) { #thread .msg.krate:not(.last) > .msg-tools { display: none; } }
#thread .thought.live .t-now::after { display: none; }
#thread .msg:hover .msg-tools, #thread .msg.last .msg-tools { opacity: 1; }
#thread .msg-tools button { color: var(--ink-3); border-radius: 7px; }
#thread .msg-tools button:hover { color: var(--ink); background: var(--hover); }
/* thinking: a shimmer while it happens, a quiet line after */
#thread .thought-head, #thread .vwork-head { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 400 13px var(--sans); color: var(--ink-3); transition: color .2s; }
#thread .thought-head:hover, #thread .vwork-head:hover { color: var(--ink-2); }
#thread .t-caret, #thread .vwork-caret { display: inline-block; transition: transform .35s var(--ease); }
#thread .thought.open .t-caret, #thread .vwork.open .vwork-caret { transform: rotate(90deg); }
#thread .thought.live .t-now, #thread .vlive .vwork-now {
  background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink-3) 35%, var(--ink) 50%, var(--ink-3) 65%, var(--ink-3) 100%); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: krShimText 1.8s linear infinite; }
@keyframes krShimText { from { background-position: 100% 0; } to { background-position: -100% 0; } }
#thread .thought-steps:not([hidden]), #thread .vwork-steps:not([hidden]) { margin: 6px 0 0 2px; padding-left: 12px; border-left: 1px solid var(--line-strong);
  font-size: 12.5px; color: var(--ink-3); animation: krPaneIn .45s var(--ease) both; }
#thread .thought-steps .msg { margin-left: 0; }
#thread .thought-steps .msg .body { font-size: 12.5px; color: var(--ink-3); }
/* the build as one card: version, what it is doing, a bar, Stop */
#viewSession #thread .vchip { display: flex; width: 100%; height: 44px; padding: 0 8px 0 12px; gap: 10px; border-radius: 14px; background: var(--surface); box-shadow: var(--sh-1); font: 400 13px var(--sans); color: var(--ink-2); }
body:not(.light) #viewSession #thread .vchip { background: var(--surface-2); }
#viewSession #thread .vchip b { font-size: 12px; font-weight: 600; }
#viewSession #thread .vchip .vbar { flex: 1; width: auto; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
#viewSession #thread .vchip .vbar i { background: var(--accent); overflow: hidden; }
#viewSession #thread .vchip .vbar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); animation: krSweep 1.3s linear infinite; }
@keyframes krSweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
#viewSession #thread .vchip .vm { color: var(--ink-3); font-size: 12.5px; }
#viewSession #thread .vok .vchip .vm { margin-right: auto; }
#viewSession #thread .vok .vchip::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; animation: krPop .5s var(--spring) both;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9'%3E%3Cpath d='M2 4.7l1.6 1.6L7 2.8' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat; }
#viewSession #thread .vbad .vchip .vm { margin-right: auto; }
#viewSession #thread .vchip .vact { height: 28px; padding: 0 12px; font-size: 12.5px; }
#viewSession #thread .msg.vlive::before, #viewSession #thread .msg.vok::before, #viewSession #thread .msg.vbad::before { display: none; }
#thread .msg.vlive, #thread .msg.vok, #thread .msg.vbad { margin-left: 0; align-self: stretch; }
#thread .vwork { margin: 10px 0 0 26px; display: flex; justify-content: flex-start; flex-direction: column; align-items: flex-start; text-align: left; }
#thread .vwork-head { flex-direction: row; width: auto; }
/* the build's steps, one row each */
.kr-tools { display: flex; flex-direction: column; gap: 2px; margin: 12px 0 0 26px; }
.kr-tr { display: flex; align-items: center; gap: 9px; height: 26px; font: 400 13px var(--sans); color: var(--ink-2); animation: krItIn .5s var(--ease) both; }
.kr-tr.done { color: var(--ink-3); }
.kr-tic { width: 16px; height: 16px; display: grid; place-items: center; flex: none; }
.kr-spin { width: 12px; height: 12px; border-radius: 50%; border: 1.6px solid var(--line-strong); border-top-color: var(--accent); animation: krRot .8s linear infinite; }
@keyframes krRot { to { transform: rotate(360deg); } }
.kr-ck { width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green-ink); animation: krPop .45s var(--spring) both; }
.kr-ck svg { width: 9px; height: 9px; }
.kr-bad { width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); font-size: 10px; font-weight: 700; }
.kr-stp { width: 8px; height: 8px; border-radius: 2px; background: var(--ink-4); }
.kr-tools.settled .kr-tr { animation: none; }
/* a plan, and a question */
#thread .plancard { border: 0; border-radius: 16px; padding: 14px 16px; background: var(--surface); box-shadow: var(--sh-1); }
body:not(.light) #thread .plancard { background: var(--surface-2); }
#thread .msg.ask::before { display: none; }
#thread .msg.plan::before { display: none; }
#thread .msg.plan .body, #thread .msg.ask .body { font-size: 14px; line-height: 1.6; color: var(--ink); }
#thread .msg.plan .msg-actions, #thread .msg.ask .msg-actions { display: flex; gap: 8px; margin-top: 14px; }
#thread .msg.plan .msg-tools, #thread .msg.ask .msg-tools { display: none; }
#thread .msg-actions .btn { height: 30px; padding: 0 12px; font-size: 13px; }

/* ---- the composer in a session: one pill -------------------------------- */
#viewSession .composer { padding: 8px 16px 12px; }
#viewSession .sessbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 2px; padding: 6px; border-radius: 24px; }
#viewSession .sessbar .attach-row { flex: 1 0 100%; order: -1; }
#viewSession .sessbar .bigbar-row { display: contents; }
#viewSession .sessbar .tool.plus { order: 0; }
#viewSession .sessbar textarea { order: 1; flex: 1; min-width: 60px; align-self: center; padding: 7px 4px; font-size: 14px; line-height: 1.45; min-height: 34px; }
#viewSession .sessbar .grow { display: none; }
#viewSession .sessbar .kr-mode { order: 2; height: 34px; }
#viewSession .sessbar .aichip { order: 3; height: 34px; }
#viewSession .sessbar .tool.wave { display: none; }
#viewSession .sessbar .send { order: 5; width: 34px; height: 34px; border-radius: 50%; }
#viewSession .sessbar .tool.plus { width: 34px; height: 34px; }
#viewSession .composer-hint { margin: 7px 4px 0; text-align: left; }

/* ---- the stage: a soft light while it is made, green once it is done ---- */
#stage::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1s var(--ease);
  background: radial-gradient(50% 45% at 50% 40%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%); }
#stage[data-kr="building"]::before, #stage[data-kr="planning"]::before { opacity: 1; animation: krBreathe 3.2s ease-in-out infinite; }
#stage[data-kr="done"]::before { opacity: 1; background: radial-gradient(50% 45% at 50% 40%, color-mix(in srgb, var(--green) 6%, transparent), transparent 70%); }
@keyframes krBreathe { 50% { opacity: .55; } }
#stage > .stage-state { position: relative; z-index: 1; }
#peekBox.kr-stin #nowLine { display: inline-block; animation: krStin .5s var(--ease) both; }
@keyframes krStin { from { opacity: 0; transform: translateY(9px); } }
/* when Krate opens the app to look at it, a line scans the picture */
#viewSession .build-card.flashing .build-shot::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 40%; z-index: 4; pointer-events: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 16%, transparent) 80%, color-mix(in srgb, var(--accent) 45%, transparent));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 65%, transparent); animation: krScan 1.6s var(--io) infinite; }
@keyframes krScan { from { transform: translateY(-110%); } to { transform: translateY(260%); } }
#viewSession .build-card.flashing .fg-crate { opacity: .35; }
/* Details and Stop sit under the card, as in the design */
@media (min-width: 861px) {
  #stateBuilding .build-card.brail { margin-bottom: 46px; overflow: visible; }
  #stateBuilding .brail .build-detail-toggle { position: absolute; left: 50%; bottom: -42px; margin: 0; translate: calc(-100% - 2px) 0; grid-column: 1 / -1; grid-row: auto; justify-self: auto; }
  #stateBuilding .build-card.brail .bfoot { position: absolute; left: 50%; bottom: -42px; width: auto; margin: 0 0 0 2px; padding: 0; justify-content: flex-start; grid-column: 1 / -1; grid-row: auto; }
  #stateBuilding .brail .build-elapsed, #stateBuilding .brail .bpeek { padding-bottom: 0; }
  #stateBuilding .build-card.brail { padding-bottom: 18px; }
}

/* ---- the finished app: it settles in, light passes over it once -------- */
#viewSession #stateDone:not(.hidden) .done-card { animation: krDoneIn2 .9s var(--ease) both; }
@keyframes krDoneIn2 { from { opacity: 0; transform: scale(.93) translateY(12px); } }
#viewSession #stateDone:not(.hidden) .shot-stage img { animation: krFocus 1.2s var(--ease) both; }
@keyframes krFocus { from { opacity: 0; filter: blur(14px) saturate(.6); transform: scale(1.03); } }
#viewSession .done-card .sheen { z-index: 4; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%); background-size: auto; transform: translateX(-120%); }
#viewSession #stateDone:not(.hidden) .done-card .sheen { animation: krGlint 1.4s var(--ease) .5s both; }
body:not(.light) #viewSession .done-card .sheen { background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .18) 50%, transparent 65%); }
@keyframes krGlint { to { transform: translateX(120%); } }
.kr-ready { position: absolute; top: 38px; right: 38px; z-index: 5; height: 26px; padding: 0 10px 0 6px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
  font: 500 12px var(--sans); color: #fff; background: rgba(20, 20, 24, .7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; pointer-events: none; }
.kr-ready i { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--green); }
.kr-ready svg { width: 9px; height: 9px; }
#stateDone:not(.hidden) .kr-ready { animation: krReadyIn .6s var(--spring) 1.1s both, krReadyOut .5s var(--ease) 4.6s forwards; }
.shot-stage.no-shot .kr-ready { display: none; }
@keyframes krReadyIn { from { opacity: 0; transform: translateY(-6px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes krReadyOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-4px); } }
#viewSession .asks li { animation: krAsk .5s var(--spring) both; animation-delay: calc(1s + var(--k, 0) * 110ms); }
@keyframes krAsk { from { transform: scale(.3); opacity: 0; } }

/* ---- Files and Details rows arrive one after another --------------------- */
.f-group > .f-row { animation: krItIn .5s var(--ease) both; }
.f-group > .f-row:nth-child(3) { animation-delay: 40ms; } .f-group > .f-row:nth-child(4) { animation-delay: 80ms; }
.f-group > .f-row:nth-child(5) { animation-delay: 120ms; } .f-group > .f-row:nth-child(6) { animation-delay: 160ms; }
.dt-card { animation: krItIn .5s var(--ease) both; }
.dt-card:nth-child(2) { animation-delay: 50ms; } .dt-card:nth-child(3) { animation-delay: 100ms; } .dt-card:nth-child(4) { animation-delay: 150ms; } .dt-card:nth-child(5) { animation-delay: 200ms; }
.code-file.on { transition: background .2s; }

/* ---- Your apps ------------------------------------------------------------- */
.app-card { animation: krRv .7s var(--ease) both; animation-delay: calc(var(--k, 0) * 55ms); }
.kr-newcard { align-self: start; text-align: left; border: 0; background: none; padding: 0; cursor: pointer; animation: krRv .7s var(--ease) both; }
.kr-nth { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 10.5; border-radius: 16px; color: var(--ink-3); box-shadow: inset 0 0 0 1.5px var(--line-strong); transition: color .2s, box-shadow .2s; }
.kr-nth > span { display: flex; flex-direction: column; align-items: center; gap: 10px; font: 400 13.5px var(--sans); }
.kr-nth i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); transition: transform .4s var(--spring); }
.kr-newcard:hover .kr-nth { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink-4); }
.kr-newcard:hover .kr-nth i { transform: rotate(90deg); }

/* ---- the Gallery: each app in a window -------------------------------------- */
.cloud-cats { position: relative; }
.cloud-cats .cat { position: relative; z-index: 1; }
.cloud-cats .cat.on, body.light .cloud-cats .cat.on { background: transparent; color: var(--btn-ink); }
.cloud-card { animation: krRv .7s var(--ease) both; animation-delay: calc(var(--k, 0) * 50ms); }
.cloud-card .cloud-shot { position: relative; padding-top: 26px; aspect-ratio: auto; }
.cloud-card .cloud-shot img { aspect-ratio: 16 / 10; height: auto; }
.kr-fb { position: absolute; left: 0; right: 0; top: 0; height: 26px; display: flex; align-items: center; padding: 0 10px; border-bottom: 1px solid var(--line); background: var(--surface); z-index: 1; }
.kr-lights { display: flex; gap: 5px; } .kr-lights i { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12); }
.kr-lights i:nth-child(1) { background: #ff5f57; } .kr-lights i:nth-child(2) { background: #febc2e; } .kr-lights i:nth-child(3) { background: #28c840; }
.kr-fbn { position: absolute; left: 0; right: 0; text-align: center; font: 500 11px var(--sans); color: var(--ink-3); pointer-events: none; }
.skel-card { border-radius: 16px; }
.skel-thumb, .skel-line { position: relative; overflow: hidden; background: var(--surface-2); }
.skel-thumb::after, .skel-line::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 75%, transparent), transparent); animation: krSweep 1.4s linear infinite; }

/* ---- Settings: the section indicator slides ---------------------------------- */
.set-nav { position: relative; }
.set-nav button { position: relative; z-index: 1; gap: 10px; }
.set-nav button .kr-ico { width: 15px; height: 15px; color: var(--ink-3); }
.set-nav button.on .kr-ico { color: var(--selected-ink); }
.set-nav button.on, body.light .set-nav button.on { background: transparent; box-shadow: none; }
.kr-nind { position: absolute; left: 0; right: 0; top: 0; height: 34px; border-radius: 10px; background: var(--selected); box-shadow: none; transition: transform .45s var(--ease), opacity .3s, background .2s; pointer-events: none; }
.set-nav:has(> button.on:hover) > .kr-nind { background: var(--selected-hover); }
.set-group.showing { animation: krPaneIn .45s var(--ease) both; }
.sw { transition: background .3s; }
.sw::after, .sw::before { transition: transform .4s var(--spring); }

/* ---- first run: the cards fan out and drift ------------------------------- */
#viewOnboard .ob-scene.on { animation: krObIn .8s var(--ease) both; }
#viewOnboard .ob-scene.on.kr-back { animation-name: krObBack; }
@keyframes krObIn { from { opacity: 0; transform: translateX(40px); } }
@keyframes krObBack { from { opacity: 0; transform: translateX(-40px); } }
#viewOnboard .fan-card { animation-delay: calc(var(--k, 0) * 70ms + .2s); }

/* ---- search: ⌘K ------------------------------------------------------------ */
.kr-scrim { position: fixed; inset: 0; z-index: 280; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(6px) saturate(1.2); -webkit-backdrop-filter: blur(6px) saturate(1.2);
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility 0s .35s; }
body:not(.light) .kr-scrim { background: rgba(6, 6, 8, .6); }
.kr-scrim.on { opacity: 1; visibility: visible; transition: opacity .35s var(--ease), visibility 0s; }
.kr-pal { position: fixed; left: 50%; top: 14vh; z-index: 290; width: min(600px, 100% - 32px); border-radius: 18px; background: var(--surface); box-shadow: var(--sh-pop); overflow: hidden;
  opacity: 0; visibility: hidden; transform: translate(-50%, -8px) scale(.98); transition: opacity .2s var(--ease), transform .35s var(--ease), visibility 0s .2s; }
body:not(.light) .kr-pal { background: #1a1a1d; }
.kr-pal.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .2s var(--ease), transform .45s var(--spring), visibility 0s; }
.kr-pin { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.kr-pin input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 16px var(--sans); color: var(--ink); }
.kr-pin kbd { font: 500 11px var(--sans); color: var(--ink-3); padding: 3px 5px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.kr-pres { max-height: 380px; overflow-y: auto; padding: 6px; }
.kr-pres .kr-pi { height: 40px; gap: 12px; padding: 0 12px; border-radius: 10px; font-size: 14px; }
.kr-ph2 { padding: 10px 12px 4px; font: 500 11.5px var(--sans); color: var(--ink-3); }
.kr-pf { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); font: 400 11.5px var(--sans); color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  .view:not(.hidden), #viewSession .panel-pane:not(.hidden), .page-head > *, .cloud-head > *, .kr-pop, #thread > .kr-in, .kr-w, .kr-tr, .app-card, .cloud-card, .kr-newcard,
  .f-group > .f-row, .dt-card, #viewOnboard .ob-scene.on, #viewSession .asks li, .kr-ready, #viewSession .done-card, #viewSession .done-card img, .sess-row.kr-enter { animation: none !important; opacity: 1; }
  .kr-ready { display: none; }
}

/* ---- Home: the shelf of your apps, five across the sheet ------------------ */
#viewHome .shelf-body { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; overflow: hidden; padding: 4px 0 2px; max-height: min(210px, 38vh); }
#viewHome .shelf.shut .shelf-body { max-height: 0; padding: 0; }
#viewHome .shelf-card { width: auto; min-width: 0; }
#viewHome .shelf-card:nth-child(n + 6) { display: none; }
#viewHome .shelf-card .shot { border-radius: 14px; transition: transform .45s var(--ease), box-shadow .3s; }
/* The lift fits: the body keeps 4px above the tiles for it. */
#viewHome .shelf-card:hover .shot { transform: translateY(-3px); box-shadow: var(--sh-2); border: 0; }
#viewHome .shelf-card b { margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--ink); }
#viewHome .shelf-card .shelf-making { color: var(--accent); font-size: 12px; }
#viewHome .shelf:not(.shut) .shelf-card { animation: krRv .6s var(--ease) both; }
#viewHome .shelf:not(.shut) .shelf-card:nth-child(2) { animation-delay: 45ms; } #viewHome .shelf:not(.shut) .shelf-card:nth-child(3) { animation-delay: 90ms; }
#viewHome .shelf:not(.shut) .shelf-card:nth-child(4) { animation-delay: 135ms; } #viewHome .shelf:not(.shut) .shelf-card:nth-child(5) { animation-delay: 180ms; }
#viewHome .shelf-grip .chev { transition: transform .5s var(--ease); }
#viewHome .shelf-tabs { gap: 2px; }
@media (max-width: 1100px) { #viewHome .shelf-body { grid-template-columns: repeat(4, minmax(0, 1fr)); } #viewHome .shelf-card:nth-child(n + 5) { display: none; } }
@media (max-width: 600px) { #viewHome .shelf-body { grid-template-columns: repeat(2, minmax(0, 1fr)); } #viewHome .shelf-card:nth-child(n + 3) { display: none; } }
/* In a session the pill is narrow: Plan first shows as its violet spark. */
#viewSession .kr-mode.compact.plan { width: 34px; padding: 0; justify-content: center; }
#viewSession .kr-mode.compact.plan .mv, #viewSession .kr-mode.compact.plan .kr-chev { display: none; }
#viewSession .kr-mode.compact.plan::before { content: ""; width: 15px; height: 15px; background: var(--violet);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l1.3 3.7L13 6.5 9.3 7.8 8 11.5 6.7 7.8 3 6.5l3.7-1.3z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l1.3 3.7L13 6.5 9.3 7.8 8 11.5 6.7 7.8 3 6.5l3.7-1.3z'/%3E%3C/svg%3E") center / contain no-repeat; }
#viewSession .sessbar textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- a toast, and a small burst when something is published ------------- */
.kr-toast { position: fixed; left: 50%; bottom: 26px; z-index: 330; height: 40px; padding: 0 16px 0 10px; border-radius: 999px; display: flex; align-items: center; gap: 9px;
  font: 500 13.5px var(--sans); color: var(--btn-ink); background: var(--btn); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .45);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: transform .5s var(--spring), opacity .3s; }
.kr-toast.on { transform: translate(-50%, 0); opacity: 1; }
.kr-toast i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; }
.kr-toast i svg { width: 11px; height: 11px; }
.kr-burst { position: absolute; left: 20px; top: 20px; width: 0; height: 0; }
.kr-burst b { position: absolute; width: 6px; height: 6px; border-radius: 2px; background: var(--c); animation: krBurst .9s var(--ease) both; }
@keyframes krBurst { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--x), var(--y)) scale(.4) rotate(220deg); opacity: 0; } }

/* ---- actions that appear on a picture when you hover it ------------------ */
.kr-hov { position: absolute; right: 10px; bottom: 10px; z-index: 3; display: flex; gap: 6px; opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity .3s var(--ease), transform .4s var(--ease); }
.app-card:hover .kr-hov, .app-card:focus-within .kr-hov, .cloud-card:hover .kr-hov, .cloud-card:focus-within .kr-hov { opacity: 1; transform: none; pointer-events: auto; }
.kr-hb { height: 30px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font: 500 12.5px var(--sans); color: #111; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .35); transition: transform .2s var(--ease); }
.kr-hb.dark { background: #111; color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .22), 0 4px 14px -6px rgba(0, 0, 0, .35); }
.kr-hb:hover { transform: translateY(-1px); }
.kr-hb .kr-ico { width: 13px; height: 13px; }
.app-card .thumb-well { position: relative; }
@media (hover: none) { .kr-hov { display: none; } }

/* ---- one gallery app: a window on the left, the rest on the right -------- */
#viewApp .detail-inner { max-width: 1120px; padding-top: 6px; }
#viewApp .appstage { border: 0; border-radius: 14px; padding-top: 26px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 30px 60px -30px rgba(24, 24, 27, .4);
  opacity: 1; transform: none; animation: krZoom .8s var(--ease) both; }
@keyframes krZoom { from { opacity: 0; transform: scale(.96); } }
#viewApp .appstage-shot { height: auto; min-height: 0; max-height: none; aspect-ratio: 16 / 10; background: #0b0c0e; }
#viewApp .appstage-fade { display: none; }
#viewApp .ident { position: static; display: flex; align-items: center; gap: 14px; margin: 0; }
#viewApp .ident h1 { color: var(--ink); text-shadow: none; font-size: 30px; font-weight: 600; letter-spacing: -.04em; }
#viewApp .ident-by { color: var(--ink-3); text-shadow: none; margin-top: 6px; }
#viewApp .ident-by .ident-cat { color: var(--ink-3); }
#viewApp .ident-icon-slot .cloud-icon { width: 56px; height: 56px; border-radius: 15px; font-size: 19px; border: 0; box-shadow: var(--sh-1); }
#viewApp .actionbar { margin-top: 18px; gap: 8px; }
#viewApp .actionbar .btn { height: 36px; }
#viewApp .quick { gap: 18px; }
#viewApp .detail .card, body.light #viewApp .detail .card { padding: 16px 18px; }
#viewApp .plist li, body.light #viewApp .plist li { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px 0 7px; border: 0; border-radius: 999px;
  font: 400 12.5px var(--sans); color: var(--ink-2); background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); animation: krAsk .5s var(--spring) both; }
#viewApp .plist li::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9'%3E%3Cpath d='M2 4.7l1.6 1.6L7 2.8' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat; }
#viewApp .pgroup.out .plist li::before { background-color: var(--orange); }
#viewApp .pgroup.out .plist li, body.light #viewApp .pgroup.out .plist li { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange) 40%, transparent); background: color-mix(in srgb, var(--orange) 7%, transparent); }
#viewApp .wall { color: var(--ink-3); }
#viewApp .ident, #viewApp .actionbar, #viewApp .detail-note, #viewApp .cols { opacity: 1; transform: none; }
@media (min-width: 1100px) {
  #viewApp .detail-inner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 36px; align-items: start; }
  #viewApp .appstage { grid-column: 1; grid-row: 1 / span 6; position: sticky; top: 8px; margin-top: 0; }
  #viewApp .detail-inner > :not(.appstage) { grid-column: 2; min-width: 0; }
  #viewApp .ident { animation: krRv .8s var(--ease) .1s both; }
  #viewApp .actionbar { animation: krRv .8s var(--ease) .17s both; flex-wrap: wrap; }
  #viewApp .actionbar .quick { margin-left: 0; width: 100%; justify-content: flex-start; margin-top: 10px; }
  #viewApp .actionbar .quick .v { text-align: left; }
  #viewApp .cols { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 18px; animation: krRv .8s var(--ease) .24s both; }
}

/* ---- first run: the fan springs open, then drifts ------------------------ */
#viewOnboard .fan-card { width: 240px; height: 157px; border: 0; border-radius: 16px; box-shadow: 0 0 0 1px var(--hair), 0 40px 80px -40px rgba(24, 24, 27, .45);
  animation: fanIn 1s var(--spring) forwards, krFanDrift 7s ease-in-out infinite alternate; animation-delay: calc(var(--k, 0) * 70ms + .2s), calc(1.4s + var(--k, 0) * .4s); }
body:not(.light) #viewOnboard .fan-card { box-shadow: 0 0 0 1px var(--hair), 0 40px 90px -40px rgba(0, 0, 0, .9); }
#viewOnboard .fan-card:nth-child(n) { --o: 1; }
#viewOnboard .fan-card:nth-child(1) { --x: -300px; --y: 34px; --r: -12deg; --s: .86; }
#viewOnboard .fan-card:nth-child(2) { --x: -170px; --y: 8px; --r: -6deg; --s: .94; }
#viewOnboard .fan-card:nth-child(3) { --x: 0px; --y: -6px; --r: 0deg; --s: 1.08; }
#viewOnboard .fan-card:nth-child(4) { --x: 170px; --y: 8px; --r: 6deg; --s: .94; }
#viewOnboard .fan-card:nth-child(5) { --x: 300px; --y: 34px; --r: 12deg; --s: .86; }
@keyframes krFanDrift { to { translate: 0 -6px; } }
@media (max-width: 760px) {
  #viewOnboard .fan-card { width: 170px; height: 111px; }
  #viewOnboard .fan-card:nth-child(1) { --x: -150px; } #viewOnboard .fan-card:nth-child(2) { --x: -85px; }
  #viewOnboard .fan-card:nth-child(4) { --x: 85px; } #viewOnboard .fan-card:nth-child(5) { --x: 150px; }
}
@media (prefers-reduced-motion: reduce) { #viewOnboard .fan-card { animation: fanIn .01s forwards; } .kr-toast { transition: none; } }

/* A change to a built app: the app itself, softened, while it is reworked. */
.kr-face { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: top center; opacity: 0; filter: blur(12px) saturate(.6); transform: scale(1.04); transition: opacity .8s var(--ease), filter .8s var(--ease); }
.forming-ghost[data-rev="1"] .kr-face { opacity: .8; filter: blur(3px) saturate(.75); }
.forming-ghost[data-rev="1"] .fg-crate, .forming-ghost[data-rev="1"] .fg-bits { opacity: 0; transition: opacity .6s var(--ease); }
#viewSession .build-card.flashing .forming-ghost[data-rev="1"] .kr-face { filter: blur(5px) saturate(.75); }
/* The open shelf has to fit the 232px Home keeps for it (style.css .home),
   or it covers the bottom of the composer on an ordinary laptop window. */
#viewHome .shelf-body { max-height: 164px; }
#viewHome .shelf-card .shot { aspect-ratio: auto; height: clamp(64px, 12vh, 104px); }
/* On a Mac the traffic lights sit in the rail's top corner: the toggle goes under them. */
@media (min-width: 861px) {
  body.macos.kr-rail .side-top { height: 78px; padding: 0 0 4px; justify-content: center; align-items: flex-end; }
}

/* ================================================================ round three
 * Against the design file the founder sent (krate-studio.html), screen by
 * screen. */

/* ---- the sidebar's head: lights row, then the mark and the toggle ------- */
body.macos .side-top { height: 44px; padding: 0; margin: 0; }
body:not(.macos) .side-top { height: 8px; }
.side-brandrow, body:not(.macos) .side-brandrow { height: 34px; margin: 0 0 10px; padding: 0 2px 0 0; justify-content: space-between; }
.side-brandrow .side-toggle { position: static; width: 30px; height: 30px; margin: 0; border-radius: 9px; color: var(--ink-2); background: transparent; }
.side-brandrow .side-toggle:hover { background: var(--hover); color: var(--ink); }
body.macos .side-brandrow .side-toggle, body.macos.light .side-brandrow .side-toggle { color: var(--ink-2); }
.side-mark { padding: 0 8px 0 14px; }
.kr-ct { margin-left: auto; font: 400 11.5px var(--sans); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kr-ct:empty { display: none; }
@media (min-width: 861px) {
  /* The design's rail head: the mark alone, and the panel toggle in its
     place on hover (or keyboard focus). Stacked, the toggle sat above the
     mark and pressed it against the first row. */
  body.kr-rail #side .side-brandrow { position: relative; flex-direction: row; height: 44px; gap: 0; align-items: center; justify-content: center; margin: 4px 0 10px; }
  /* One centre line down the rail: the mark, every row's icon, the bell and
     the avatar. The rows are centred squares (above, with the rail's
     other sizes), so the line holds at 72px and at the Mac's 88px alike. */
  body.kr-rail .side-brandrow .side-toggle { order: 0; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
  body.kr-rail .side-brandrow:hover .side-toggle, body.kr-rail .side-brandrow .side-toggle:focus-visible { opacity: 1; pointer-events: auto; }
  body.kr-rail .side-mark { padding: 0; width: 30px; justify-content: center; transition: opacity .2s var(--ease); }
  /* Keyboard focus on the toggle swaps them too; a mouse click leaves focus
     on the toggle, and :focus-within hid the mark for good after it. */
  body.kr-rail .side-brandrow:hover .side-mark, body.kr-rail .side-brandrow:has(.side-toggle:focus-visible) .side-mark { opacity: 0; }
  @media (hover: none) {
    body.kr-rail .side-brandrow .side-toggle { opacity: 1; pointer-events: auto; }
    body.kr-rail .side-mark { opacity: 0; pointer-events: none; }
  }
  body.kr-rail .kr-ct { display: none; }
  body.macos.kr-rail .side-top { height: 44px; display: block; }
}

/* ---- Home: no theme button (it lives in your menu), a microphone -------- */
#themeBtn { display: none !important; }
.kr-micbtn > svg:not(.kr-mic) { display: none; }
.kr-micbtn .kr-mic { width: 18px; height: 18px; }

/* ---- Home: "Your apps 5 ⌃" ------------------------------------------------- */
#viewHome .shelf-grip, #viewHome .shelf-tabs { display: none; }
.kr-shtog { display: inline-flex; align-items: center; gap: 7px; height: 32px; margin-left: -10px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font: 500 13.5px var(--sans); color: var(--ink-2); transition: background .2s, color .2s; }
.kr-shtog:hover { background: var(--hover); color: var(--ink); }
.kr-shct { font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--ink-3); padding: 1px 7px; border-radius: 999px; background: var(--surface-2); }
.kr-shct:empty { display: none; }
.kr-shchev { width: 13px; height: 13px; color: var(--ink-3); transform: rotate(180deg); transition: transform .5s var(--ease); }
.kr-shtog[aria-expanded="true"] .kr-shchev { transform: none; }
#viewHome .shelf.shut .shelf-all { opacity: 0; pointer-events: none; }
#viewHome .shelf-all { transition: opacity .3s var(--ease); }

/* ---- search: thumbnails and keys ----------------------------------------- */
.kr-th0 { width: 28px; height: 20px; flex: none; border-radius: 5px; overflow: hidden; background: var(--surface-2); box-shadow: var(--sh-1); }
.kr-th0 img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.side-nav > .side-search { cursor: pointer; }
.side-nav > .side-search input { cursor: pointer; pointer-events: none; }

/* ---- Home: the IDE door ------------------------------------------------- */
#viewHome .bigbar[data-mode="ide"] textarea, #viewHome .bigbar[data-mode="ide"] .bigbar-row, #viewHome .bigbar[data-mode="ide"] .attach-row,
#viewHome .bigbar[data-mode="ide"] .kr-ta, #viewHome .bigbar[data-mode="port"] .kr-ta { display: none; }
#homeTitle[data-mode="create"] .kr-t-alt, #homeTitle:not([data-mode="create"]) .kr-t-main { display: none; }
#homeTitle .kr-swap { display: inline-block; animation: krSwap .55s var(--ease) both; }
.home-idepane[hidden], .kr-under[hidden] { display: none !important; }
.kr-drop2 { display: flex; align-items: flex-start; gap: 12px; margin: 14px 14px 2px; padding: 14px 14px 12px; border-radius: 16px; border: 1.5px dashed var(--line-strong); text-align: left; transition: border-color .3s, background .3s; }
.kr-drop2:focus-within { border-color: color-mix(in srgb, var(--green) 45%, transparent); background: color-mix(in srgb, var(--green) 4%, transparent); }
.kr-drop2 .dz-i { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.kr-ta2 { flex: 1; min-width: 0; }
.kr-ta2 input { width: 100%; border: 0; outline: 0; background: transparent; padding: 6px 0 0; font: 400 15px var(--sans); color: var(--ink); }
.kr-ta2 input::placeholder { color: var(--ink-4); }
.kr-ta2 small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.kr-cmprow { display: flex; align-items: center; gap: 4px; padding: 8px 10px 10px 12px; }
.kr-chipb { height: 34px; padding: 0 10px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; background: transparent; cursor: pointer;
  font: 400 13.5px var(--sans); color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s; }
.kr-chipb:hover { background: var(--hover); color: var(--ink); }
.kr-sq { width: 38px; height: 38px; border: 0; border-radius: 12px; display: grid; place-items: center; cursor: pointer; background: var(--btn); color: var(--btn-ink); transition: transform .3s var(--spring), border-radius .4s var(--ease); }
.kr-sq:hover { transform: translateY(-1px); border-radius: 14px; } .kr-sq:active { transform: scale(.92); }
.kr-newp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 14px 12px; padding: 10px; border-radius: 14px; background: var(--surface-2); animation: krItIn .45s var(--ease) both; }
.kr-newp input { flex: 1; min-width: 160px; height: 36px; padding: 0 12px; border: 0; outline: 0; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); font: 400 14px var(--sans); color: var(--ink); }
.kr-newp .kr-mk, .kr-newp .kr-cx { height: 36px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer; font: 500 13px var(--sans); }
.kr-newp .kr-mk { background: var(--btn); color: var(--btn-ink); } .kr-newp .kr-cx { background: transparent; color: var(--ink-2); }
.kr-newp.busy input, .kr-newp.busy button { opacity: .6; }
.kr-np-line { flex: 1 0 100%; margin: 2px 2px 0; font: 400 12.5px var(--mono); color: var(--ink-3); min-height: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kr-np-line:empty { display: none; }
.kr-under { width: 100%; margin-top: 26px; text-align: left; animation: krItIn .55s var(--ease) .05s both; }
.kr-lab { margin: 0 4px 10px; font: 500 12.5px var(--sans); color: var(--ink-3); }
.kr-starts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kr-start { border: 0; padding: 0; background: none; cursor: pointer; text-align: left; animation: krRv .6s var(--ease) both; animation-delay: calc(var(--k, 0) * 60ms + 150ms); }
.kr-start .th { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--surface-2); box-shadow: var(--sh-1); color: var(--ink-3); transition: transform .45s var(--ease), box-shadow .3s; }
.kr-start .th img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.kr-start:hover .th { transform: translateY(-3px); box-shadow: var(--sh-2); }
.kr-start b { display: block; margin-top: 8px; font: 500 13px var(--sans); color: var(--ink); }
.kr-start small { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kr-start.newp .th { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.kr-start.newp:hover .th { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink-4); }
@media (max-width: 860px) { .kr-starts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- the IDE -------------------------------------------------------------- */
#viewIde { display: flex; flex-direction: column; }
#viewIde.hidden { display: none; }
#viewIde .ide-top { gap: 8px; padding-right: 14px; border-bottom: 1px solid var(--line); }
.ide-proj { display: inline-flex; align-items: center; gap: 8px; min-width: 0; margin-left: 4px; font: 400 14px var(--sans); color: var(--ink); -webkit-app-region: no-drag; }
.ide-proj svg { color: var(--ink-3); flex: none; } .ide-proj b { font-weight: 500; }
.ide-path { font: 12px var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ide-st { display: inline-flex; align-items: center; gap: 7px; margin-right: 6px; font: 400 12.5px var(--sans); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ide-st i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); }
.ide-st[data-kind="ok"] i { background: var(--green); }
.ide-st[data-kind="bad"] i { background: var(--danger); } .ide-st[data-kind="bad"] { color: var(--danger); }
.ide-st[data-kind="busy"] i { background: var(--accent); animation: krPing 1.4s var(--ease) infinite; }
.ide-btn { height: 34px; padding: 0 14px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap; -webkit-app-region: no-drag;
  font: 500 13.5px var(--sans); color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); transition: background .2s, transform .2s var(--ease), opacity .2s; }
.ide-btn:hover { background: var(--hover); } .ide-btn:active { transform: scale(.97); }
.ide-btn.dark { background: var(--btn); color: var(--btn-ink); box-shadow: none; } .ide-btn.dark:hover { background: var(--btn-hover); }
.ide-btn[disabled] { opacity: .4; pointer-events: none; }
.ide-btn kbd { margin-left: 2px; padding: 2px 4px; font: 500 11px var(--sans); color: var(--ink-3); border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.ide-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 224px minmax(0, 1fr) 380px; }
.ide-tree { overflow: auto; padding: 12px 8px; background: var(--side-bg); border-right: 1px solid var(--line); font: 400 13px var(--sans); }
.ide-tree .th2 { padding: 4px 8px 8px; font-size: 11.5px; font-weight: 500; letter-spacing: .02em; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ide-tree .tn { width: 100%; height: 28px; display: flex; align-items: center; gap: 7px; padding: 0 8px 0 calc(8px + var(--lv, 0) * 14px); border: 0; border-radius: 7px; background: none; cursor: pointer;
  font: inherit; color: var(--ink-2); text-align: left; transition: background .15s, color .15s; }
.ide-tree .tn span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ide-tree .tn:hover { background: var(--hover); color: var(--ink); }
.ide-tree .tn.on { background: var(--selected); color: var(--ink); box-shadow: none; }
.ide-tree .tn.on:hover { background: var(--selected-hover); }
.ide-tree .tn svg { flex: none; color: var(--ink-3); }
.ide-tree .tn.dir.shut svg { opacity: .6; }
.md { margin-left: auto; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--orange); }
.ide-main { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; --panel-h: 200px; }
.ide-main.pmin { --panel-h: 38px; }
.ide-tabs { height: 38px; flex: none; display: flex; align-items: flex-end; gap: 2px; padding: 0 8px; overflow-x: auto; background: var(--side-bg); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.ide-tab { position: relative; top: 1px; height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 6px 0 12px; flex: none; cursor: pointer; border: 1px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0;
  font: 400 12.5px var(--sans); color: var(--ink-3); }
.ide-tab.on { background: var(--bg); color: var(--ink); border-color: var(--line); }
.ide-tab .md { margin-left: 0; }
.ide-tab .x { width: 18px; height: 18px; border: 0; border-radius: 5px; display: grid; place-items: center; background: none; color: inherit; cursor: pointer; opacity: .5; }
.ide-tab .x:hover { background: var(--hover); opacity: 1; }
.ide-ed { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.ide-empty, .ide-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; font: 400 13.5px var(--sans); color: var(--ink-3); }
.ide-empty.hidden, .ide-msg.hidden, .ide-code.hidden { display: none; }
.ide-code { position: absolute; inset: 0; display: flex; }
.ide-gut { width: 56px; flex: none; overflow: hidden; padding: 14px 0 0; }
.ide-gutin span { display: block; padding-right: 16px; text-align: right; font: 12.5px/1.75 var(--mono); color: var(--ink-4); user-select: none; }
.ide-cw { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.ide-hl, .ide-src { margin: 0; padding: 14px 24px 120px 2px; font: 12.5px/1.75 var(--mono); tab-size: 4; letter-spacing: 0; white-space: pre; }
.ide-hl { position: absolute; left: 0; top: 0; min-width: 100%; pointer-events: none; color: var(--ink); }
.ide-hl .l { display: block; min-height: 1.75em; }
.ide-hl .l.add { background: color-mix(in srgb, var(--green) 12%, transparent); animation: krAdd 1.4s var(--ease) both; }
@keyframes krAdd { from { background: color-mix(in srgb, var(--green) 35%, transparent); } }
.ide-src { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; outline: 0; resize: none; overflow: auto; background: transparent; color: transparent; caret-color: var(--ink); }
.ide-src::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); color: transparent; }
.tk-k { color: #c2457d; } .tk-s { color: #1f8a4c; } .tk-c { color: var(--ink-3); font-style: italic; } .tk-n { color: #b45a2a; } .tk-t { color: #3d6df0; } .tk-f { color: #7c5ce8; } .tk-a { color: var(--ink-3); } .tk-m { color: #a1600a; }
body:not(.light) .tk-k { color: #f291bd; } body:not(.light) .tk-s { color: #7ee2a8; } body:not(.light) .tk-n { color: #f0a274; } body:not(.light) .tk-t { color: #8fb0ff; } body:not(.light) .tk-f { color: #b8a5ff; } body:not(.light) .tk-m { color: #f0c674; }
.ide-ask { position: absolute; left: 50%; bottom: calc(var(--panel-h) + 16px); z-index: 3; width: min(540px, calc(100% - 40px)); height: 46px; display: flex; align-items: center; gap: 9px; padding: 0 5px 0 15px;
  border-radius: 999px; background: var(--surface); box-shadow: var(--sh-pop); color: var(--violet); transform: translateX(-50%); transition: bottom .45s var(--ease), box-shadow .3s; }
body:not(.light) .ide-ask { background: #1c1c1f; color: #a891ff; }
.ide-ask:focus-within { box-shadow: 0 0 0 1px color-mix(in srgb, var(--violet) 45%, transparent), 0 0 0 5px color-mix(in srgb, var(--violet) 10%, transparent), var(--sh-pop); }
.ide-ask input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 13.5px var(--sans); color: var(--ink); }
.ide-ask input::placeholder { color: var(--ink-3); }
.ide-ask .lg-s { display: inline-grid; place-items: center; width: 22px; height: 22px; }
.ide-ask .lg-s svg, .ide-ask .lg-s img { width: 18px; height: 18px; }
.ide-go { position: relative; width: 34px; height: 34px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: var(--btn); color: var(--btn-ink); transition: transform .3s var(--spring); }
.ide-go:hover { transform: scale(1.06); } .ide-go:active { transform: scale(.92); } .ide-go[disabled] { opacity: .5; }
.ide-ask.busy .ide-go::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--violet); animation: krRot .8s linear infinite; }
.ide-why { height: 30px; flex: none; padding: 0 11px; border: 0; border-radius: 999px; cursor: pointer; font: 500 12.5px var(--sans); color: var(--ink-2); background: var(--surface-2); transition: background .2s, color .2s, opacity .2s; }
.ide-why:hover { color: var(--ink); background-image: linear-gradient(var(--hover), var(--hover)); } .ide-why[disabled] { opacity: .45; pointer-events: none; }
.ide-runs { display: inline-flex; align-items: center; }
.ide-runs #ideRun { border-radius: 999px 0 0 999px; padding-right: 12px; }
.ide-runs .ide-rs { width: 34px; padding: 0; justify-content: center; margin-left: -1px; border-radius: 0 999px 999px 0; color: var(--ink-3); position: relative; }
.ide-runs .ide-rs[aria-pressed="true"] { color: var(--violet); background: color-mix(in srgb, var(--violet) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--violet) 40%, transparent); }
.ide-runs .ide-rs[aria-pressed="true"]::after { content: ""; position: absolute; top: 6px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--violet); }
.ide-ans { flex: 1; min-height: 0; overflow: auto; padding: 6px 18px 14px; font: 400 13px/1.6 var(--sans); color: var(--ink-2); animation: krPaneIn .3s var(--ease); }
.ide-ans.hidden { display: none; }
.ide-ans .ia-q { margin-bottom: 8px; font-weight: 500; color: var(--ink); }
.ide-ans .ia-a p { margin: 0 0 8px; max-width: 72ch; }
.ide-ans code { padding: 1px 5px; border-radius: 5px; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); color: var(--ink); }
.ide-ans pre { margin: 4px 0 10px; padding: 10px 12px; border-radius: 9px; overflow: auto; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); color: var(--ink); }
.ide-ans .ia-foot { margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.ide-ans .ia-bad { color: var(--danger); white-space: pre-wrap; }
.ide-ans .ia-wait { display: flex; align-items: center; gap: 5px; color: var(--ink-3); }
.ide-ans .ia-wait i { width: 5px; height: 5px; border-radius: 50%; background: var(--violet); animation: krWaitDot 1.2s var(--ease) infinite; }
.ide-ans .ia-wait i:nth-child(2) { animation-delay: .15s; } .ide-ans .ia-wait i:nth-child(3) { animation-delay: .3s; }
.ide-ans .ia-wait span { margin-left: 5px; }
@keyframes krWaitDot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .ide-ans .ia-wait i { animation: none; opacity: .6; } }
.ide-panel { height: var(--panel-h); flex: none; display: flex; flex-direction: column; border-top: 1px solid var(--line); background: var(--bg); transition: height .45s var(--ease); }
.ip-tabs { height: 38px; flex: none; display: flex; align-items: center; gap: 2px; padding: 0 8px; }
.ip-tabs > button[data-ip] { height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: none; cursor: pointer; font: 400 12.5px var(--sans); color: var(--ink-3); }
.ip-tabs > button[data-ip].on { color: var(--ink); background: var(--selected); }
.ip-tabs > button[data-ip]:not(.on):hover, .ip-tabs .ib:hover { color: var(--ink); background: var(--hover); }
.ip-tabs em { margin-left: 4px; font-style: normal; font-size: 11px; color: var(--ink-3); }
.ip-tabs .ib { width: 28px; height: 28px; border: 0; border-radius: 8px; display: grid; place-items: center; background: none; color: var(--ink-2); cursor: pointer; }
.ip-tabs .ib svg { transition: transform .4s var(--ease); }
.ide-main.pmin .ip-tabs .ib svg { transform: rotate(180deg); }
.ip-stop { height: 26px; padding: 0 10px; border: 0; border-radius: 999px; cursor: pointer; font: 500 12px var(--sans); color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.ip-stop.hidden { display: none; }
.ide-term { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 2px 18px 12px; font: 12px/1.75 var(--mono); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.ide-term.hidden, .ide-probs.hidden { display: none; }
.ide-term .g { color: var(--green-ink); } .ide-term .b { color: var(--accent); } .ide-term .r { color: var(--danger); } .ide-term .m { color: var(--ink-3); }
.ip-act { margin: 2px 0; padding: 3px 10px; border: 0; border-radius: 999px; cursor: pointer; font: 500 12px var(--sans); color: var(--ink); background: var(--surface-2); }
.ide-probs { flex: 1; min-height: 0; overflow: auto; padding: 4px 18px 12px; }
.ip-prob b { display: block; font: 500 12.5px var(--sans); color: var(--danger); text-transform: capitalize; }
.ip-prob pre { margin: 4px 0 10px; font: 12px/1.6 var(--mono); color: var(--ink-2); white-space: pre-wrap; }
.ip-ok { font: 400 12.5px var(--sans); color: var(--ink-3); }
.ide-prev { min-width: 0; display: flex; flex-direction: column; background: var(--side-bg); border-left: 1px solid var(--line); }
.ip-h { height: 44px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; font: 500 13px var(--sans); color: var(--ink); }
.ip-h .grow { flex: 1; }
.ip-h .ib { width: 30px; height: 30px; border: 0; border-radius: 9px; display: grid; place-items: center; background: none; color: var(--ink-2); cursor: pointer; }
.ip-h .ib:hover { background: var(--hover); color: var(--ink); }
#viewIde .live { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font: 500 11.5px var(--sans); color: var(--green-ink); background: var(--green-soft); }
#viewIde .live.hidden { display: none; }
#viewIde .live i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: krPing 1.6s var(--ease) infinite; }
.ip-frame { position: relative; margin: 4px 16px 10px; border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 40px 80px -40px rgba(24, 24, 27, .3); }
.ip-frame .fb { position: relative; height: 30px; display: flex; align-items: center; padding: 0 10px; border-bottom: 1px solid var(--line); }
.ip-frame .lights { display: flex; gap: 6px; } .ip-frame .lights i { width: 10px; height: 10px; border-radius: 50%; }
.ip-frame .lights i:nth-child(1) { background: #ff5f57; } .ip-frame .lights i:nth-child(2) { background: #febc2e; } .ip-frame .lights i:nth-child(3) { background: #28c840; }
.ip-frame .fb > span:last-child { position: absolute; left: 0; right: 0; text-align: center; font: 500 11.5px var(--sans); color: var(--ink-3); pointer-events: none; }
.ip-app { position: relative; display: grid; place-items: center; min-height: 220px; background: var(--surface-2); }
.ip-app img { display: block; width: 100%; height: auto; }
.ip-app img.hidden { display: none; }
.ip-app.flash { animation: krFlash .7s var(--ease); }
@keyframes krFlash { 0% { filter: blur(8px); opacity: .3; } }
.ip-none { padding: 24px; font: 400 13px var(--sans); color: var(--ink-3); text-align: center; }
.ip-none.hidden { display: none; }
.ip-note { margin: 0 18px; font: 400 12px/1.5 var(--sans); color: var(--ink-3); }
.ip-note b { font-weight: 500; color: var(--ink-2); }
@media (max-width: 1200px) { .ide-body { grid-template-columns: 200px minmax(0, 1fr) 300px; } }
@media (max-width: 860px) { .ide-body { grid-template-columns: minmax(0, 1fr); } .ide-tree, .ide-prev { display: none; } .ide-path, .ide-st, #ideAsk kbd { display: none; } }

/* ---- round four: the plan and the question as cards ---------------------- */
#thread .msg.kr-carded { padding: 0; background: none; box-shadow: none; border: 0; }
#thread .msg.kr-carded > .body, #thread .msg.kr-carded > .msg-actions, #thread .msg.kr-carded > .msg-tools { display: none !important; }
#thread .msg.kr-carded > .who { display: none; }
.kr-plan, .kr-qc { border-radius: 16px; padding: 14px 16px; background: var(--surface); max-width: 520px; }
.kr-plan { box-shadow: var(--sh-1); }
.kr-qc { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, var(--hair)), 0 10px 30px -18px color-mix(in srgb, var(--accent) 50%, transparent); }
body:not(.light) .kr-plan, body:not(.light) .kr-qc { background: var(--surface-2); }
.kr-ptag, .kr-qtag { display: inline-flex; align-items: center; gap: 6px; font: 500 11.5px var(--sans); color: var(--violet); }
.kr-qtag { color: var(--accent); }
body:not(.light) .kr-ptag { color: #a891ff; }
.kr-ptag .kr-ico, .kr-qtag .kr-ico { width: 13px; height: 13px; }
.kr-plan h4 { margin: 4px 0 8px; font: 500 15px var(--sans); letter-spacing: -.015em; color: var(--ink); }
.kr-plead { margin: 0 0 8px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.kr-plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.kr-plan li { display: flex; gap: 9px; animation: krItIn .5s var(--ease) both; }
.kr-plan li::before { content: ""; width: 5px; height: 5px; margin-top: 8px; border-radius: 50%; background: var(--ink-4); flex: none; }
.kr-pneeds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.kr-pneeds em { font-style: normal; height: 22px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 99px; color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line-strong); animation: krPop .45s var(--spring) both; }
.kr-qq { display: flex; gap: 8px; margin-top: 8px; font: 500 14px/1.5 var(--sans); color: var(--ink); animation: krItIn .5s var(--ease) both; }
.kr-qq i { font-style: normal; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; color: var(--accent); background: var(--accent-soft); }
.kr-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
#thread .kr-acts .btn { height: 32px; padding: 0 14px; border-radius: 99px; font: 500 13px var(--sans); border: 0; cursor: pointer;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s; }
#thread .kr-acts .btn:active { transform: scale(.97); }
#thread .kr-acts .btn.kr-dark { background: var(--ink); color: var(--bg); }
#thread .kr-acts .btn.kr-dark:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
#thread .kr-acts .btn.kr-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
#thread .kr-acts .btn.kr-ghost:hover { background: var(--hover); }
.kr-went { height: 28px; color: var(--ink-3); }

/* ---- the AI picker ------------------------------------------------------- */
.kr-pi .kr-lgb { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); }
body:not(.light) .kr-pi .kr-lgb { background: #26262a; }
.kr-pi .kr-lgb svg, .kr-pi .kr-lgb img { width: 17px; height: 17px; }
.kr-pop.big .kr-pi.on .kr-lgb { background: var(--surface); }
.kr-pop .kr-pop-head { padding: 6px 12px 4px; font: 500 11.5px var(--sans); color: var(--ink-3); letter-spacing: .01em; }
.kr-pop.big .kr-pi em { padding: 3px 9px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-2); }
.kr-pop.big .kr-pi { text-align: left; }

/* ---- Share: one sheet, three ways --------------------------------------- */
.kr-share { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 22px; }
.kr-sh-h { display: flex; align-items: flex-start; gap: 12px; }
.kr-sh-h > div { flex: 1; min-width: 0; }
.kr-sh-h h2 { margin: 0; }
.kr-sh-h .sheet-sub { margin: 4px 0 0; }
.kr-x { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; color: var(--ink-3); cursor: pointer; }
.kr-x:hover { background: var(--hover); color: var(--ink); }
.kr-x .kr-ico { width: 16px; height: 16px; }
.kr-shfile { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 12px; border-radius: 16px; background: var(--surface-2); }
.kr-shic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--surface); box-shadow: var(--sh-1); }
.kr-shic img { width: 28px; height: 28px; }
.kr-sht { flex: 1; min-width: 0; }
.kr-sht b { display: block; font: 500 14.5px var(--sans); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kr-sht small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.kr-shfile em { font-style: normal; font-size: 12px; color: var(--ink-3); padding: 3px 9px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line-strong); white-space: nowrap; }
.kr-ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.kr-ways.four { grid-template-columns: repeat(2, 1fr); }
.kr-way[hidden] { display: none; }
.kr-way { position: relative; padding: 14px 12px 12px; border: 0; border-radius: 16px; background: none; text-align: left; cursor: pointer; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow .25s, background .25s, transform .25s var(--ease); }
.kr-way:hover { background: var(--hover); }
.kr-way:active { transform: scale(.98); }
.kr-way.on { box-shadow: inset 0 0 0 1.5px var(--ink); background: var(--surface); }
body:not(.light) .kr-way.on { background: var(--surface-2); }
.kr-way i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.kr-way i .kr-ico { width: 17px; height: 17px; }
.kr-way b { display: block; margin-top: 10px; font: 500 13.5px var(--sans); }
.kr-way small { display: block; margin-top: 1px; font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.kr-wp { display: none; margin-top: 12px; }
.kr-wp.on { display: block; animation: krFadeUp .45s var(--ease) both; }
.kr-share .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border: 0; border-radius: 12px; font: 500 13.5px var(--sans); cursor: pointer; transition: transform .15s var(--ease), background .2s, box-shadow .2s; }
.kr-share .btn:active { transform: scale(.98); }
.kr-share .btn .kr-ico { width: 15px; height: 15px; }
.kr-share .btn.kr-dark { background: var(--ink); color: var(--bg); }
.kr-share .btn.kr-dark:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.kr-share .btn.kr-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.kr-share .btn.kr-ghost:hover { background: var(--hover); }
.kr-make { width: 100%; height: 46px !important; border-radius: 14px !important; position: relative; overflow: hidden; }
.kr-make .kr-pg { position: absolute; inset: 0 auto 0 0; width: 0; background: color-mix(in srgb, #fff 18%, transparent); }
.kr-make.busy .kr-pg { animation: krLinkGrow 8s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes krLinkGrow { to { width: 92%; } }
.kr-make .kr-lb { position: relative; }
.kr-linkf { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 6px 0 14px; border-radius: 14px; background: var(--surface-2); font: 13.5px ui-monospace, Menlo, monospace; color: var(--ink-2); }
.kr-u { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kr-c { display: inline-block; white-space: pre; animation: krLinkCh .3s var(--ease) both; }
@keyframes krLinkCh { from { opacity: 0; transform: translateY(4px); } }
.kr-linkf .btn { height: 34px !important; border-radius: 10px !important; padding: 0 12px !important; }
.kr-linkf .btn.ok { background: var(--green) !important; color: #fff !important; }
.kr-qr { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 12px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.kr-qrsvg { width: 86px; height: 86px; flex: none; border-radius: 8px; animation: krPop .5s var(--spring) both; }
.kr-qr p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.kr-qr p span { color: var(--ink-2); }
.kr-shp { margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.kr-shacts { display: flex; flex-wrap: wrap; gap: 8px; }
.kr-shst { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); min-height: 1em; }
.kr-sherr { margin: 10px 0 0; font-size: 12.5px; color: var(--danger); }
.kr-new { margin-top: 14px; padding: 12px 14px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.kr-new b { display: block; font: 500 13.5px var(--sans); color: var(--ink); }
.kr-new small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.kr-os { display: flex; gap: 6px; margin-top: 10px; }
.kr-os .btn { height: 32px !important; padding: 0 12px !important; border-radius: 99px !important; font-size: 12.5px !important; }
.kr-shnote { display: flex; align-items: center; gap: 7px; margin: 14px 0 0; font-size: 12.5px; color: var(--ink-3); }
.kr-shnote .kr-ico { width: 14px; height: 14px; flex: none; }
@media (max-width: 560px) {
  .kr-ways, .kr-ways.four { grid-template-columns: 1fr; }
  .kr-way { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; align-items: center; padding: 10px 12px; }
  .kr-way i { grid-row: span 2; }
  .kr-way b { margin-top: 0; }
}
.kr-share-wrap { z-index: 250; }

/* ---- the finished app: where the file is, and the systems it opens on --- */
.kr-dnrow { display: flex; align-items: center; gap: 12px; }
.kr-dnrow .done-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kr-showf { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 9px; background: none;
  font: 500 13px var(--sans); color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s; }
.kr-showf:hover { background: var(--hover); color: var(--ink); }
.kr-showf .kr-ico { width: 15px; height: 15px; }
.kr-os-dots { display: inline-flex; gap: 10px; margin-left: 10px; }
.kr-os-dots i { font-style: normal; display: inline-flex; align-items: center; gap: 5px; }
.kr-os-dots i::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }

/* ---- Settings: Your AI as cards ----------------------------------------- */
.kr-agc-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 12px; }
.kr-agc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong);
  animation: krItIn .45s var(--ease) both; animation-delay: calc(var(--k, 0) * 50ms); transition: box-shadow .2s, background .2s; }
.kr-agc.on { box-shadow: inset 0 0 0 1.5px var(--ink); }
.kr-agc.pick { cursor: pointer; }
.kr-agc.pick:hover { background-image: linear-gradient(var(--hover), var(--hover)); }
.kr-agc .kr-lgb { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); }
.kr-agc .kr-lgb svg, .kr-agc .kr-lgb img { width: 18px; height: 18px; }
.kr-agt { flex: 1; min-width: 0; }
.kr-agt b { display: block; font: 500 14px var(--sans); color: var(--ink); }
.kr-agt small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ink-3); }
.kr-cmdl { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin-top: 7px; padding: 4px 9px; border-radius: 8px; background: var(--surface-2); }
.kr-cmdl code { font: 12px ui-monospace, Menlo, monospace; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kr-cmdl button { border: 0; background: none; padding: 0; font: 500 12px var(--sans); color: var(--accent); cursor: pointer; }
.kr-stt { flex: none; font: 500 12.5px var(--sans); color: var(--ink-3); }
.kr-stt.ok { display: inline-flex; align-items: center; gap: 6px; color: var(--green-ink); }
.kr-stt.ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
button.kr-stt { height: 30px; padding: 0 12px; border: 0; border-radius: 99px; background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink); cursor: pointer; }
button.kr-stt:hover { background: var(--hover); }
.kr-agc-empty { margin: 0; font-size: 13px; color: var(--ink-3); }
#setSheet .set-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-3); }
#setSheet .set-group > .set-panel { margin-top: 14px; }
/* Reduce motion, chosen in Settings */
body.kr-calm *, body.kr-calm *::before, body.kr-calm *::after { animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
/* An off switch on a light page was white on white. */
.sw:not(.on) { background: var(--line-strong); }
.sw::after { box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.sw.on { background: var(--accent); }

/* ---- first run: the welcome over Home ----------------------------------- */
.kr-ob { position: fixed; inset: 0; z-index: 260; display: none; place-items: center; padding: 24px;
  background: color-mix(in srgb, #0b0b10 38%, transparent); -webkit-backdrop-filter: blur(6px) saturate(1.1); backdrop-filter: blur(6px) saturate(1.1); }
.kr-ob.on { display: grid; animation: krWelBg .35s var(--ease) both; }
.kr-ob.out { animation: krWelOut .28s var(--ease) both; }
@keyframes krWelBg { from { background: transparent; -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); } }
@keyframes krWelOut { to { opacity: 0; } }
.kr-ob-card { position: relative; width: min(560px, 100%); max-height: calc(100vh - 48px); overflow: auto; padding: 30px 30px 22px; border-radius: 28px; text-align: center;
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 40px 100px -30px rgba(0, 0, 0, .45); animation: krWelIn .6s var(--spring) both; }
body:not(.light) .kr-ob-card { background: #141417; }
.kr-ob.out .kr-ob-card { animation: krWelCardOut .28s var(--ease) both; }
@keyframes krWelIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes krWelCardOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
.kr-ob-x { position: absolute; top: 14px; right: 14px; }
.kr-ob-mk { display: block; width: 30px; height: 30px; margin: 0 auto 14px; }
.kr-ob h2 { margin: 0; font: 600 clamp(28px, 3vw, 36px)/1.08 var(--sans); letter-spacing: -.04em; color: var(--ink); }
.kr-ob-s { margin: 10px auto 0; max-width: 380px; font-size: 15px; line-height: 1.5; color: var(--ink-3); }
.kr-pv { position: relative; margin-top: 22px; height: 236px; border-radius: 20px; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); text-align: left;
  --g1: #ececef; --g2: #dfdfe4; --g3: #d2d2d9; }
body:not(.light) .kr-pv { --g1: #2a2a2f; --g2: #232327; --g3: #1d1d21; }
.kr-pv-win { position: absolute; left: 34px; top: 30px; right: -40px; bottom: -40px; display: grid; grid-template-columns: 92px 1fr; border-radius: 12px; overflow: hidden;
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 20px 40px -24px rgba(0, 0, 0, .35); }
.kr-pv-side { padding: 12px 10px; background: var(--side-bg); display: flex; flex-direction: column; gap: 7px; }
.kr-pv-side b { width: 40px; height: 8px; border-radius: 4px; background: var(--accent); opacity: .8; margin-bottom: 6px; }
.kr-pv-side i { height: 9px; border-radius: 4px; background: var(--surface-3); }
.kr-pv-side i.on { background: var(--surface); box-shadow: 0 0 0 1px var(--hair); }
.kr-pv-side i:nth-of-type(4) { margin-bottom: 8px; }
.kr-pv-side span { height: 6px; width: 70%; border-radius: 3px; background: var(--surface-3); opacity: .7; }
.kr-pv-main { position: relative; }
.kr-pv-a, .kr-pv-b, .kr-pv-c { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; opacity: 0; transform: translateY(8px);
  transition: opacity .5s var(--ease), transform .7s var(--ease); }
.kr-pv[data-ph="a"] .kr-pv-a, .kr-pv[data-ph="b"] .kr-pv-b, .kr-pv[data-ph="c"] .kr-pv-c { opacity: 1; transform: none; transition-delay: .12s; }
.kr-pv-a, .kr-pv-b { padding-right: 40px; }
.kr-pv-q { margin: 0; font: 500 15px var(--sans); letter-spacing: -.02em; color: var(--ink); }
.kr-pv-q em { font-style: normal; color: color-mix(in srgb, var(--accent) 50%, var(--ink)); }
.kr-pv-cmp { position: relative; margin-top: 10px; width: 270px; height: 40px; display: flex; align-items: center; padding: 0 6px 0 14px; border-radius: 12px; font-size: 12.5px; color: var(--ink);
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 10px 24px -14px rgba(0, 0, 0, .3); }
.kr-pv-tx { white-space: nowrap; overflow: hidden; }
.kr-pv-car { width: 1.5px; height: 14px; margin-left: 1px; background: var(--accent); animation: krBlink 1s steps(1) infinite; }
.kr-pv-go { margin-left: auto; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--ink); color: var(--bg); }
.kr-pv-go .kr-ico { width: 13px; height: 13px; }
.kr-pv-card { width: 230px; border-radius: 16px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 16px 30px -18px rgba(0, 0, 0, .35); }
.kr-pv-th { height: 110px; display: grid; place-items: center;
  background: radial-gradient(50% 60% at 30% 30%, color-mix(in srgb, var(--pink) 18%, transparent), transparent 70%), radial-gradient(50% 60% at 75% 50%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.kr-pv-th svg { width: 62px; overflow: visible; }
.kr-pv-th .t { fill: var(--g1); } .kr-pv-th .l { fill: var(--g2); } .kr-pv-th .r { fill: var(--g3); }
.kr-pv[data-ph="b"] .kr-sl .t { animation: krPvT 2.4s var(--ease) both; }
.kr-pv[data-ph="b"] .kr-sl .l { animation: krPvL 2.4s var(--ease) both; }
.kr-pv[data-ph="b"] .kr-sl .r { animation: krPvR 2.4s var(--ease) both; }
.kr-pv[data-ph="b"] .kr-s2 path { animation-delay: .55s !important; }
.kr-pv[data-ph="b"] .kr-s3 path { animation-delay: 1.1s !important; }
@keyframes krPvT { 30%, 100% { fill: #3b8cff; } }
@keyframes krPvL { 30%, 100% { fill: #1b6de8; } }
@keyframes krPvR { 30%, 100% { fill: #0f56c9; } }
.kr-pv-nm { position: relative; padding: 0 14px 12px; margin-top: -14px; }
.kr-pv-nm b { display: block; font: 500 13px var(--sans); color: var(--ink); }
.kr-pv-nm small { font-size: 11px; color: var(--ink-3); }
.kr-pv-c { padding: 14px 54px 0 14px; align-content: start; justify-items: start; }
.kr-pv-app { position: relative; width: 300px; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--hair), 0 16px 30px -18px rgba(0, 0, 0, .35);
  -webkit-mask-image: linear-gradient(#000 55%, transparent 95%); mask-image: linear-gradient(#000 55%, transparent 95%); }
.kr-pv-app img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.kr-pv-file { position: relative; white-space: nowrap; margin-top: -40px; margin-left: 12px; display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px 0 6px; border-radius: 9px;
  font-size: 11.5px; color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 6px 14px -8px rgba(0, 0, 0, .3); }
.kr-pv-file img { height: 18px; width: auto; } .kr-pv-file b { font-weight: 500; } .kr-pv-file small { color: var(--ink-3); }
.kr-ob-f { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 18px; }
.kr-plain { height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: none; font: 500 14px var(--sans); color: var(--ink-2); cursor: pointer; }
.kr-plain:hover { background: var(--hover); color: var(--ink); }
.kr-ob-f .kr-plain { justify-self: start; }
button.kr-dark { border: 0; border-radius: 99px; background: var(--ink); color: var(--bg); font: 500 14px var(--sans); cursor: pointer; transition: transform .15s var(--ease), background .2s; }
button.kr-dark:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
button.kr-dark:active { transform: scale(.97); }
.kr-ob-go { justify-self: end; height: 42px; padding: 0 20px; }
.kr-dots { display: flex; gap: 6px; }
.kr-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--line-strong); transition: width .45s var(--ease), background .3s; }
.kr-dots i.on { width: 18px; background: var(--ink); }
@media (max-width: 560px) {
  .kr-ob-card { padding: 26px 20px 18px; }
  .kr-pv { height: 200px; } .kr-pv-win { left: 16px; top: 18px; grid-template-columns: minmax(0, 1fr); } .kr-pv-side { display: none; }
  .kr-pv-c { padding: 12px 28px 0 12px; grid-template-columns: minmax(0, 1fr); justify-items: stretch; } .kr-pv-app { width: 100%; }
  .kr-pv-file { justify-self: start; margin-top: -58px; } .kr-pv-cmp, .kr-pv-card { width: 220px; }
  .kr-ob-f .kr-dots { display: none; } .kr-ob-f { grid-template-columns: 1fr 1fr; }
}
/* the tour: everything dims but the one thing being explained */
.kr-tour { position: fixed; inset: 0; z-index: 270; display: none; pointer-events: none; }
.kr-tour.on { display: block; }
.kr-tr-hole { position: absolute; border-radius: 16px; pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(10, 10, 16, .48), 0 0 0 2px color-mix(in srgb, #fff 70%, transparent);
  transition: left .55s var(--ease), top .55s var(--ease), width .55s var(--ease), height .55s var(--ease), border-radius .55s var(--ease); animation: krTrIn .4s var(--ease) both; }
.kr-tr-hole::after { content: ""; position: absolute; inset: -6px; border-radius: inherit; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent); animation: krTrPing 2s var(--ease) infinite; }
@keyframes krTrIn { from { box-shadow: 0 0 0 200vmax rgba(10, 10, 16, 0), 0 0 0 2px transparent; } }
@keyframes krTrPing { 0% { opacity: .9; transform: scale(.98); } 70%, 100% { opacity: 0; transform: scale(1.04); } }
.kr-tr-card { position: absolute; width: 320px; padding: 16px 18px 14px; border-radius: 20px; background: var(--surface); pointer-events: auto; opacity: 0; transform: translateY(6px) scale(.98);
  box-shadow: 0 0 0 1px var(--hair), 0 30px 60px -20px rgba(0, 0, 0, .45); transition: left .55s var(--ease), top .55s var(--ease); }
body:not(.light) .kr-tr-card { background: #18181c; }
.kr-tr-card.in { animation: krTrCard .5s var(--spring) .12s both; }
@keyframes krTrCard { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
.kr-tr-arr { position: absolute; top: -6px; width: 12px; height: 12px; background: inherit; transform: rotate(45deg); border-radius: 2px; box-shadow: -1px -1px 0 var(--hair); }
.kr-tr-card[data-side="above"] .kr-tr-arr { top: auto; bottom: -6px; box-shadow: 1px 1px 0 var(--hair); }
.kr-tr-card[data-side="right"] .kr-tr-arr { box-shadow: -1px 1px 0 var(--hair); }
.kr-tr-top { display: flex; align-items: center; justify-content: space-between; margin: -4px -8px 4px 0; }
.kr-tr-n { font: 500 12px var(--sans); color: var(--accent); }
.kr-tr-top .kr-x { width: 28px; height: 28px; }
.kr-tr-top .kr-x .kr-ico { width: 14px; height: 14px; }
.kr-tr-card h4 { margin: 0; font: 600 17px var(--sans); letter-spacing: -.02em; color: var(--ink); }
.kr-tr-card p { margin: 5px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.kr-tr-f { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.kr-tr-f .kr-dots { margin-right: auto; }
.kr-tr-f button { height: 34px; padding: 0 14px; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .kr-tr-hole::after { animation: none; } }
.kr-ob-card:focus, .kr-tr-card:focus { outline: none; }

/* ---- Files and Code: the design's icons on their buttons ---------------- */
#filesAttach, #filesSave, #paneCode .kr-toide { display: inline-flex; align-items: center; gap: 6px; }
#filesAttach::before, #filesSave::before { content: ""; width: 13px; height: 13px; flex: none; background: currentColor;
  -webkit-mask: var(--kr-m) center / contain no-repeat; mask: var(--kr-m) center / contain no-repeat; }
#filesAttach { --kr-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 3v10M3 8h10' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E"); }
#filesSave { --kr-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2.5v8M4.6 7.4L8 10.8l3.4-3.4M3 13.3h10' stroke='black' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#paneFiles .pane-head #filesSave { background: var(--ink); color: var(--bg); border-color: transparent; }
#paneFiles .pane-head #filesSave:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); color: var(--bg); }
#paneCode .kr-toide .kr-ico { width: 14px; height: 14px; }
#paneFiles .f-label { text-transform: uppercase; letter-spacing: .05em; font-size: 11px; font-weight: 500; color: var(--ink-3); }

/* ---- a build that did not finish, as in the design ---------------------- */
#viewSession #stateFailed:not(.hidden) { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.kr-failghost { width: min(360px, 100%); border-radius: 22px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 30px 60px -36px rgba(0, 0, 0, .35);
  animation: krFadeUp .5s var(--ease) both; --g1: #ececef; --g2: #dfdfe4; --g3: #d2d2d9; }
body:not(.light) .kr-failghost { background: var(--surface-2); --g1: #2a2a2f; --g2: #232327; --g3: #1d1d21; }
.kr-fg-th { height: 150px; display: grid; place-items: center;
  background: radial-gradient(50% 60% at 30% 30%, color-mix(in srgb, var(--pink) 14%, transparent), transparent 70%), radial-gradient(50% 60% at 75% 50%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.kr-fg-th svg { width: 74px; overflow: visible; opacity: .8; }
.kr-fg-th .t { fill: var(--g1); } .kr-fg-th .l { fill: var(--g2); } .kr-fg-th .r { fill: var(--g3); }
.kr-fg-nm { padding: 0 18px 16px; margin-top: -10px; position: relative; }
.kr-fg-nm b { display: block; font: 500 15px var(--sans); color: var(--ink); }
.kr-fg-nm small { font-size: 12.5px; color: var(--danger); }
#viewSession #stateFailed .fail-card, body.light #viewSession #stateFailed .fail-card { position: relative; width: min(460px, 100%); padding: 0 0 0 30px; text-align: left; background: none; box-shadow: none; border: 0; animation: krFadeUp .5s var(--ease) .1s both; }
#viewSession #stateFailed .fail-mark { position: absolute; left: 0; top: 1px; width: 20px; height: 20px; margin: 0; display: grid; place-items: center; border-radius: 50%; }
#viewSession #stateFailed .fail-mark svg { width: 14px; height: 14px; }
#viewSession #stateFailed .fail-title { margin: 0; font-size: 15px; }
#viewSession #stateFailed .fail-why { margin: 6px 0 0; font-size: 13.5px; line-height: 1.55; }
#viewSession #stateFailed .fail-actions { justify-content: flex-start; margin-top: 14px; gap: 8px; }
#viewSession #stateFailed .fail-offer { margin-top: 14px; }
#viewSession #stateFailed .fail-raw-wrap { text-align: left; }

/* ---- Your apps: find one ------------------------------------------------ */
.kr-find { display: inline-flex; align-items: center; gap: 8px; height: 36px; width: 210px; padding: 0 12px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-3); cursor: text; transition: box-shadow .2s; }
.kr-find:focus-within { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, var(--line-strong)), 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.kr-find .kr-ico { width: 15px; height: 15px; flex: none; }
.kr-find input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 13.5px var(--sans); color: var(--ink); }
.kr-find input::-webkit-search-cancel-button { display: none; }
.kr-findnone { grid-column: 1 / -1; margin: 20px 0; text-align: center; font-size: 14px; color: var(--ink-3); }
#viewApps .head-actions { display: flex; align-items: center; gap: 8px; }
.kr-remix { display: inline-flex; align-items: center; gap: 6px; }
.kr-remix .kr-ico { width: 14px; height: 14px; }
@media (max-width: 600px) { .kr-find { width: 100%; } #viewApps .head-actions { flex-wrap: wrap; } }
/* One gallery app: the way back reads as where you came from. */
#viewApp #appCrumb::before { content: "Gallery  \203A  "; white-space: pre; color: var(--ink-3); }

/* ---- Share: publish in the sheet ---------------------------------------- */
.kr-frm { display: flex; flex-direction: column; gap: 12px; }
.kr-frm label { display: flex; flex-direction: column; gap: 6px; font: 500 12.5px var(--sans); color: var(--ink-2); }
.kr-field { height: 40px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); font: 400 14px var(--sans); color: var(--ink); outline: 0; transition: box-shadow .2s, background .2s; }
.kr-field:focus { background: var(--surface); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, var(--line-strong)), 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.kr-tog { display: flex; align-items: center; gap: 12px; padding: 2px 0; }
.kr-tog > span { flex: 1; font: 500 13.5px var(--sans); color: var(--ink); }
.kr-tog small { display: block; font: 400 12px var(--sans); color: var(--ink-3); }
.kr-pubdone { position: relative; text-align: center; padding: 8px 0 12px; }
.kr-pubdone b { display: block; margin-top: 12px; font: 500 16px var(--sans); color: var(--ink); }
.kr-pubdone p { margin: 3px 0 0; font-size: 13px; color: var(--ink-3); }
.kr-shacts.kr-center { justify-content: center; margin-top: 12px; }

/* ---- every sheet is a modal: above the sidebar too ----------------------- */
/* At 40 the sidebar (60) stayed bright and clickable beside an open sheet. */
.sheet-wrap { z-index: 80; }
/* ---- What is free, as in the design ------------------------------------- */
#planSheet .sheet { position: relative; width: min(460px, calc(100vw - 32px)); }
.sheet-x { position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; color: var(--ink-3); cursor: pointer; }
.sheet-x:hover { background: var(--hover); color: var(--ink); }
#planSheet h2 { padding-right: 36px; }
#planSheet .plan-list { margin-top: 14px; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-strong); gap: 0; }
#planSheet .plan-row, body.light #planSheet .plan-row { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; border: 0; border-radius: 0; background: none; box-shadow: none; }
#planSheet .plan-row + .plan-row { border-top: 1px solid var(--line); }
#planSheet .plan-row > div { flex: 1; min-width: 0; }
#planSheet .plan-row b { display: block; font: 500 13.5px var(--sans); color: var(--ink); }
#planSheet .plan-row span:not(.plan-tag) { display: block; margin-top: 1px; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
#planSheet .plan-tag { flex: none; padding: 2px 9px; border-radius: 99px; font: 500 11.5px var(--sans); background: var(--green-soft); color: var(--green-ink); border: 0; }
#planSheet #planSetUp { flex: none; border-radius: 99px; }
#planSheet .detail-actions { display: none; }
.kr-cmprow > .kr-sq:last-child, .kr-cmprow #homeIdeGo { margin-left: auto; }

/* ---- Home: Port, in the same shape as the IDE door ---------------------- */
#homePortPane { display: block; padding: 0; }
#homePortPane[hidden] { display: none; }
.kr-portdrop { width: calc(100% - 28px); background: none; font: inherit; color: inherit; cursor: pointer; }
.kr-portdrop:hover { border-color: color-mix(in srgb, var(--violet) 45%, var(--line-strong)); background: color-mix(in srgb, var(--violet) 4%, transparent); }
.kr-portdrop .dz-i { color: var(--violet); }
.kr-portdrop .kr-ta2 { display: block; flex: 1; min-width: 0; }
.kr-portdrop b { display: block; font: 400 15px var(--sans); color: var(--ink-3); }
.kr-portdrop small { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
/* Chrome text is not a document: a double-click on your name no longer selects it. */
.side, .side * { -webkit-user-select: none; user-select: none; }
.side input, .side textarea { -webkit-user-select: text; user-select: text; }

/* ---- round five ---------------------------------------------------------- */
.kr-panehint { margin: 0; padding: 0 16px 12px; font-size: 12.5px; line-height: 1.45; color: var(--danger); }
.kr-panehint[hidden] { display: none; }

/* Krate's plain lines (a stop, a wall, a note) read as text, like the rest of
   what it says. Only a plan and a question are cards (kr-carded). */
#thread .msg.krate.ask:not(.kr-carded), #thread .msg.krate.plan:not(.kr-carded) { padding: 0; border: 0; background: none; box-shadow: none; }
#thread .msg.krate.ask:not(.kr-carded) .body, #thread .msg.krate.plan:not(.kr-carded) .body { background: none; padding: 0; }
/* The Mac window buttons sit at x 20 and end near x 74; a 72px rail put the
   green one on the card's edge. On macOS the rail is wide enough to hold them. */
@media (min-width: 861px) {
  body.macos.kr-rail .side { width: 88px; }
  body.macos.kr-rail .view { margin-left: 88px; }
}
.kr-pop:not(.big) .kr-pi .kr-lgb { width: 18px; height: 18px; border-radius: 5px; background: none; box-shadow: none; }
.kr-pop:not(.big) .kr-pi .kr-lgb svg, .kr-pop:not(.big) .kr-pi .kr-lgb img { width: 15px; height: 15px; }
.kr-pi.danger, .kr-pi.danger .kr-ico { color: var(--danger); }
#viewHome .shelf-card .shelf-meta { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================================================================ loading, in Krate's own motion
 * From krate-studio-loading.html. The mark is three layers in a box; loaders move the layers.
 * Names carry kr- where the design's own would meet app.js's. */
:root { --danger-soft: color-mix(in srgb, var(--danger) 14%, transparent); --line-2: var(--line-strong); }
.iso { display: block; overflow: visible; flex: none; }
.iso polygon { stroke: rgba(255, 255, 255, .95); stroke-width: 1.4; stroke-linejoin: round; }
.iso .tp { fill: #5b9dff; } .iso .lf { fill: #1f74f0; } .iso .rt { fill: #0f59d4; }
.iso.mono polygon { stroke: var(--gap, var(--surface)); }
.iso.mono .tp { fill: currentColor; fill-opacity: .42; } .iso.mono .lf { fill: currentColor; } .iso.mono .rt { fill: currentColor; fill-opacity: .7; }
.iso.breathe .ly, .kr-tav.kwork .iso .ly { animation: krPart 1.5s var(--ease) infinite; animation-delay: calc(var(--k) * 70ms); }
@keyframes krPart { 0%, 100% { transform: none; } 42% { transform: translateY(calc((1 - var(--k)) * -6px)); } }
.iso.stack .ly { opacity: 0; transform: translateY(-34px); }
.iso.stack .ly.on { opacity: 1; transform: none; transition: transform .62s cubic-bezier(.3, 1.45, .55, 1), opacity .2s; }
.kr-swp { position: relative; display: inline-grid; }
.kr-swp > span { grid-area: 1 / 1; white-space: nowrap; transition: opacity .35s var(--ease), transform .5s var(--ease), filter .35s; }
.kr-swp > span.sw-out { opacity: 0; transform: translateY(-7px); filter: blur(2px); }
.kr-swp > span.sw-in { animation: krSwin .5s var(--ease) both; }
.kr-swp small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
@keyframes krSwin { from { opacity: 0; transform: translateY(7px); filter: blur(2px); } }
@media (prefers-reduced-motion: reduce) { .iso .ly { animation: none !important; } }

/* ---- the conversation: the avatar breathes while that turn is working ---- */
#thread .msg.you + .msg.krate::before, #thread .msg.you + .thought::before, #thread > :first-child.krate::before { display: none; }
.kr-tav { position: absolute; left: -26px; top: 4px; width: 16px; height: 16px; }
#thread .thought > .kr-tav { top: 2px; }
.kr-tav .iso { width: 16px; height: 16px; }
/* the first beat of a reply: three dots in blue, violet and pink, with a little squash */
.kr-kdots { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 14px 14px 14px 5px; background: var(--surface); box-shadow: var(--sh-2); animation: krItIn .4s var(--ease) both; }
body:not(.light) .kr-kdots { background: var(--surface-2); }
.kr-kdots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: krSq 1.15s var(--ease) infinite; }
.kr-kdots i:nth-child(2) { background: var(--violet); animation-delay: .14s; }
.kr-kdots i:nth-child(3) { background: var(--pink); animation-delay: .28s; }
@keyframes krSq { 0%, 62%, 100% { transform: none; } 22% { transform: translateY(-5px) scale(.88, 1.12); } 44% { transform: translateY(0) scale(1.18, .84); } }
#thread .kr-beat { position: relative; margin-left: 26px; }
/* the words of a reply, led by a small dot that takes the next colour each sentence */
.kr-bk { display: inline-block; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; vertical-align: 1px; background: var(--c, var(--accent)); transition: background .2s, opacity .4s; }
#thread .kr-w.kr-wait { opacity: 0; animation: none; }
#thread .kr-w.kr-on { animation: krWord .4s var(--ease) both; }
/* a step that is working: a tiny breathing mark */
.kr-tic .iso { color: var(--accent); --gap: var(--bg); }
/* sending: the arrow gives way to a tiny breathing mark until the message is in */
.kr-sd { position: absolute; left: 50%; top: 50%; margin: -8px 0 0 -8px; opacity: 0; transform: scale(.5); transition: opacity .2s, transform .35s var(--ease); color: var(--btn-ink); --gap: var(--btn); pointer-events: none; }
.kr-sending .kr-sd { opacity: 1; transform: none; }
/* The button centres its own icons with absolute + translate; the mark is
   inside a box of its own, so it must not be centred a second time (it sat
   8px up and left, half off the button). */
#send .kr-sd, #homeSend .kr-sd { width: 16px; height: 16px; display: block; line-height: 0; }
#send .kr-sd svg, #homeSend .kr-sd svg { position: static; translate: none; display: block; }
#send .kr-sd .iso.mono .tp, #homeSend .kr-sd .iso.mono .tp { fill-opacity: .62; } #send .kr-sd .iso.mono .rt, #homeSend .kr-sd .iso.mono .rt { fill-opacity: .82; }
.kr-sending > svg:not(.iso), .kr-sending > .kr-ico { opacity: 0 !important; transform: scale(.4) !important; transition: opacity .2s, transform .3s var(--ease); }
/* a page loading from the network: a thin bar in the home page's colours */
.kr-tbar { position: fixed; left: 0; top: 0; z-index: 460; height: 2.5px; width: 0; border-radius: 0 3px 3px 0; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), var(--violet) 40%, var(--pink) 70%, var(--orange)); background-size: 100vw 100%;
  box-shadow: 0 0 8px color-mix(in srgb, var(--violet) 45%, transparent); opacity: 0; }
#send, #homeSend { position: relative; }
/* the live thinking line shimmers, the way the design's does */
#thread .thought.live .t-now { background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink-3) 35%, var(--ink) 50%, var(--ink-3) 65%, var(--ink-3) 100%); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: krThinkShim 1.8s linear infinite; }
@keyframes krThinkShim { from { background-position: 100% 0; } to { background-position: 0 0; } }
#thread .thought-head .kr-kdots { height: 24px; padding: 0 10px; margin-right: 8px; box-shadow: none; background: var(--surface-2); }

/* ---- the receipt row, as the design has it ----------------------------- */
#viewSession #thread .vchip { height: 40px; padding: 0 5px 0 11px; gap: 8px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; color: var(--ink-2); }
body:not(.light) #viewSession #thread .vchip { background: var(--surface-2); }
#viewSession #thread .vok .vchip::before { display: none; }
#viewSession #thread .vchip.vbadc { box-shadow: inset 0 0 0 1px var(--line); }
#viewSession #thread .vchip .vbar { display: none; }
#viewSession #thread .vchip > b { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font: 600 11.5px var(--sans); color: var(--ink-2); }
body:not(.light) #viewSession #thread .vchip > b { background: var(--surface-3); }
#viewSession #thread .vchip .vm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); margin: 0; }
.kr-re { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.kr-ri { width: 16px; height: 16px; flex: none; display: grid; place-items: center; }
.kr-ri .ok { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green-ink); animation: krPop .45s var(--spring) both; }
.kr-ri .ok svg { width: 9px; height: 9px; }
.kr-ri .no { width: 8px; height: 8px; border-radius: 2px; background: var(--ink-4); }
.kr-ri .bad { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); font: 700 10px var(--sans); font-style: normal; }
#viewSession #thread .vchip .vact { height: 28px; padding: 0 13px; border-radius: 99px; font: 500 12.5px var(--sans); }
#viewSession #thread .vchip .vact.vg { padding: 0 10px; background: transparent; color: var(--ink-2); }
#viewSession #thread .vchip .vact.vg:hover { background: var(--hover); color: var(--ink); }
#viewSession #thread .vbad .vchip .vact { background: transparent; color: var(--danger); padding: 0 10px; }
#viewSession #thread .vbad .vchip .vact:hover { background: var(--danger-soft); }
/* The newest receipt has no buttons: the app's card beside it has Run and
   Share (or Stop, or Try again). Older receipts keep theirs. */
#viewSession #thread .msg.vlatest .vchip .vact { display: none; }

/* ---- the card being made: the code streaming in ------------------------- */
.kr-code { --code-bg: #fdfdfe; position: absolute; inset: 0; z-index: 3; display: none; background: var(--code-bg); }
body:not(.light) .kr-code { --code-bg: #111114; }
.kr-code.on { display: block; animation: krFadeUp .45s var(--ease) both; }
.kr-cw { position: absolute; inset: 0; overflow: hidden; -webkit-mask-image: linear-gradient(transparent, #000 12px, #000 78%, transparent); mask-image: linear-gradient(transparent, #000 12px, #000 78%, transparent); }
.kr-wc { position: absolute; left: 0; right: 0; top: 12px; transition: transform .7s var(--ease); }
.kr-wl { position: relative; display: flex; height: 18px; max-height: 18px; overflow: hidden; font: 11.5px/18px ui-monospace, "SF Mono", Menlo, monospace; white-space: pre; color: var(--ink); transition: opacity .3s; }
.kr-wl.kr-wait { max-height: 0; opacity: 0; }
.kr-wn { width: 38px; flex: none; padding-right: 14px; text-align: right; color: color-mix(in srgb, var(--ink) 22%, transparent); font-variant-numeric: tabular-nums; }
.kr-wk { display: inline-block; white-space: pre; opacity: 0; filter: blur(2.5px); transition: opacity .4s var(--ease), filter .4s var(--ease); }
.kr-wk.shown { opacity: 1; filter: none; }
.kr-hlb { position: absolute; left: 0; right: 0; top: 0; height: 18px; background: color-mix(in srgb, var(--accent) 7%, transparent); transition: transform .3s var(--ease), opacity .4s; }
.kr-hlb::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 2px; border-radius: 2px; background: var(--accent); }
.kr-car { display: inline-block; width: 1.5px; height: 13px; margin-left: 1px; vertical-align: -2px; border-radius: 1px; background: var(--accent); box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 70%, transparent); }
.kr-code .tk-c { color: #8a8f98; font-style: italic; } .kr-code .tk-s { color: #1a7f4b; } .kr-code .tk-k { color: #7c3aed; }
.kr-code .tk-t { color: #b45309; } .kr-code .tk-f { color: #2563eb; } .kr-code .tk-n { color: #c2410c; }
body:not(.light) .kr-code .tk-s { color: #6ee7a8; } body:not(.light) .kr-code .tk-k { color: #c4a5ff; } body:not(.light) .kr-code .tk-t { color: #fbbf72; }
body:not(.light) .kr-code .tk-f { color: #8ab4ff; } body:not(.light) .kr-code .tk-n { color: #fda47a; }
/* past 30 s: the home page's sentence, its word turning per step */
.kr-snt { margin: 2px 0 0; font: 500 14px var(--sans); letter-spacing: -.01em; color: var(--ink); animation: krSwin .5s var(--ease) both; }
.kr-snt .w { color: var(--c); border-bottom: 1.6px solid color-mix(in srgb, var(--c) 35%, transparent); }
.kr-snt[hidden] { display: none; }
#stateBuilding:has(.kr-snt:not([hidden])) .bpeek { display: none; }
/* past 45 s: a peach note */
.kr-still { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease); }
.kr-still > div { overflow: hidden; min-height: 0; }
.kr-still.on { grid-template-rows: 1fr; }
.kr-still p { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 2px; padding: 7px 12px; border-radius: 11px; background: #fff6ec; color: #4a3a2c; font-size: 12.5px; opacity: 0; transform: translateY(-4px); transition: opacity .4s var(--ease) .15s, transform .5s var(--ease) .15s; }
body:not(.light) .kr-still p { background: #2a2016; color: #d6c3b0; }
.kr-still.on p { opacity: 1; transform: none; }
.kr-still .iso { color: #e8873f; --gap: #fff6ec; }
body:not(.light) .kr-still .iso { --gap: #2a2016; }
@media (min-width: 0px) {
  #viewSession .brail .kr-snt { grid-column: 1; grid-row: 3; margin: 2px 0 0 24px; min-width: 0; }
  #viewSession .brail .kr-still { grid-column: 1 / -1; grid-row: 4; margin: 0 16px; }
}
#viewSession .brail .build-detail-toggle, #viewSession .build-card.brail .bfoot { grid-row: 5; }
#viewSession .brail .kr-snt { grid-column: 1 / -1; grid-row: 3; margin: 2px 24px 0; }
#stateBuilding:has(.kr-snt:not([hidden])) .brail .build-elapsed { grid-row: 2; }

/* ================================================================ the Gallery, as the design has it */
#viewCloud.kr-galon .cloud-head, #viewCloud.kr-galon .cloud-controls, #viewCloud.kr-galon .cloud-count,
#viewCloud.kr-galon #cloudLoading, #viewCloud.kr-galon #cloudGrid { display: none !important; }
#viewCloud.kr-galon main.cloud { max-width: 1120px; margin: 0 auto; padding: 18px 36px 60px; }
.kr-gal { animation: krFadeUp .45s var(--ease) both; }
.kr-galh { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.kr-galh h1 { margin: 0; font: 600 30px/1.1 var(--sans); letter-spacing: -.04em; color: var(--ink); }
.kr-galh p { margin: 6px 0 0; font-size: 14px; color: var(--ink-3); }
.kr-galq { width: min(330px, 100%); }
.kr-galbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.kr-cats, .kr-sorts { display: inline-flex; gap: 2px; padding: 3px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.kr-cats::-webkit-scrollbar { display: none; }
.kr-cats button, .kr-sorts button { flex: none; height: 30px; padding: 0 13px; border: 0; border-radius: 99px; background: none; font: 400 13px var(--sans); color: var(--ink-3); cursor: pointer; transition: color .25s, background .25s, box-shadow .25s; }
.kr-cats button:hover, .kr-sorts button:hover { color: var(--ink); }
.kr-cats button:not(.on):hover { background: var(--hover); }
.kr-cats button.on { background: var(--btn); color: var(--btn-ink); }
.kr-sorts button.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--hair), 0 1px 3px rgba(0, 0, 0, .06); }
body:not(.light) .kr-sorts button.on { background: var(--surface-3); }
/* the featured app */
.kr-kf { position: relative; isolation: isolate; overflow: hidden; margin-top: 22px; display: grid; grid-template-columns: 1fr 1.15fr; gap: 28px; align-items: center; padding: 30px 30px 30px 34px; border-radius: 24px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 24px 50px -34px rgba(30, 40, 90, .3); cursor: pointer; animation: krFadeUp .8s var(--ease) both; }
body:not(.light) .kr-kf { background: var(--surface-2); }
.kr-kf::before { content: ""; position: absolute; inset: -30% -10% auto 40%; height: 120%; z-index: -1; filter: blur(10px);
  background: radial-gradient(40% 40% at 50% 50%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%), radial-gradient(30% 30% at 75% 70%, color-mix(in srgb, var(--violet) 10%, transparent), transparent 70%); }
.kr-kf.sk { height: 330px; padding: 0; display: block; cursor: default; box-shadow: none; background: var(--surface-2); }
.kf-eye { font: 500 12px var(--sans); color: var(--accent); }
.kf-said { margin: 10px 0 0; font: 500 clamp(22px, 2.4vw, 30px)/1.22 var(--sans); letter-spacing: -.035em; color: var(--ink); min-height: 2.4em; }
.kf-said .car { display: inline-block; width: 2px; height: .9em; margin-left: 2px; vertical-align: -.08em; background: var(--accent); animation: krBlink 1s steps(1) infinite; }
.kf-by { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--ink-3); }
.kr-av.sm { width: 20px; height: 20px; font-size: 10px; }
.kr-av.kr-av-img { object-fit: cover; background: var(--s2); padding: 0; }
.kf-act { display: flex; gap: 8px; margin-top: 18px; }
.kf-r .kr-kwin { transform: perspective(1200px) rotateY(-8deg) rotateX(2deg); transition: transform .9s var(--ease); }
.kr-kf:hover .kf-r .kr-kwin { transform: perspective(1200px) rotateY(-3deg); }
/* an app in a window */
.kr-kwin { position: relative; border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), var(--sh-1); }
.kr-kwin.big { box-shadow: 0 0 0 1px var(--hair), 0 30px 60px -30px rgba(24, 24, 27, .4); }
.kr-kwin .fb { position: relative; height: 26px; display: flex; align-items: center; padding: 0 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.kr-kwin .fb > span:last-child { position: absolute; left: 0; right: 0; text-align: center; font: 500 11px var(--sans); color: var(--ink-3); pointer-events: none; }
.kr-lights { display: flex; gap: 5px; }
.kr-lights i { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12); }
.kr-lights i:nth-child(1) { background: #ff5f57; } .kr-lights i:nth-child(2) { background: #febc2e; } .kr-lights i:nth-child(3) { background: #28c840; }
.kr-kwin .kb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.kr-kwin .kb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.kr-kwin .kb-none { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-4); --gap: var(--surface-2); }
.khov { position: absolute; right: 10px; bottom: 10px; z-index: 3; display: flex; gap: 6px; opacity: 0; transform: translateY(6px); transition: opacity .3s var(--ease), transform .4s var(--ease); }
.kr-kcard:hover .khov, .kr-kcard:focus-within .khov { opacity: 1; transform: none; }
.kr-hbtn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border: 0; border-radius: 99px; background: var(--btn); color: var(--btn-ink); font: 500 12.5px var(--sans); cursor: pointer; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .4); }
.kr-hbtn .kr-ico { width: 13px; height: 13px; }
.kr-kgrid { margin-top: 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 30px 22px; }
.kr-kcard { text-align: left; cursor: pointer; outline: none; animation: krFadeUp .7s var(--ease) both; animation-delay: calc(var(--k, 0) * 50ms); }
.kr-kcard .kr-kwin { transition: transform .5s var(--ease), box-shadow .35s; }
.kr-kcard:hover .kr-kwin, .kr-kcard:focus-visible .kr-kwin { transform: translateY(-4px); box-shadow: 0 0 0 1px var(--hair), var(--sh-2); }
.kr-kcard .kmeta { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
.kr-kcard .kmeta b { font: 500 14.5px var(--sans); letter-spacing: -.01em; color: var(--ink); }
.kr-kcard .kmeta small { font-size: 12.5px; color: var(--ink-3); }
.kr-kcard .ksaid { margin: 3px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kfoot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.kr-kchip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 6px; border-radius: 8px; font: 500 12px var(--sans); color: var(--ink-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); white-space: nowrap; }
.kr-kchip img { height: 16px; width: auto; } .kr-kchip em { font-style: normal; font-weight: 400; color: var(--ink-3); }
.kr-kreach { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px 0 7px; border-radius: 8px; font-size: 12px; color: var(--green-ink); background: var(--green-soft); white-space: nowrap; }
.kr-kreach .kr-ico { width: 12px; height: 12px; }
.kr-kreach.net { color: color-mix(in srgb, var(--orange) 80%, var(--ink)); background: color-mix(in srgb, var(--orange) 12%, transparent); }
/* Get: the mark fills up, layer by layer from the bottom, as the file comes down */
.kr-get { position: relative; flex: none; min-width: 58px; height: 28px; padding: 0 13px; border: 0; border-radius: 99px; display: inline-grid; place-items: center; font: 600 12.5px var(--sans); color: var(--btn-ink); background: var(--btn); cursor: pointer; transition: background .2s, min-width .4s var(--ease), padding .4s var(--ease), color .2s; }
.kr-get.big { height: 36px; padding: 0 18px; font-size: 13.5px; font-weight: 500; }
.khov .kr-get { background: rgba(255, 255, 255, .94); color: #111; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .4); }
.kr-get .gt { grid-area: 1 / 1; transition: opacity .2s; }
.kr-get .iso { grid-area: 1 / 1; width: 20px; height: 20px; opacity: 0; transition: opacity .2s; }
.kr-get .iso polygon { stroke: rgba(255, 255, 255, .9); fill: color-mix(in srgb, currentColor 22%, transparent); }
.kr-get .iso .tp { --to: #5b9dff; } .kr-get .iso .lf { --to: #1f74f0; } .kr-get .iso .rt { --to: #0f59d4; }
.kr-get.ing { min-width: 28px; padding: 0; background: transparent; color: var(--ink); }
.kr-get.big.ing { min-width: 36px; }
.kr-get.ing .gt { opacity: 0; }
.kr-get.ing .iso { opacity: 1; }
.kr-get.ing .iso polygon { animation: krFillB .4s var(--ease) forwards; animation-delay: calc((2 - var(--k)) * .42s + .1s); }
@keyframes krFillB { to { fill: var(--to); } }
.kr-get.got { background: var(--green); color: #fff; }
.kr-ghost2, .kr-dark2 { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border: 0; border-radius: 99px; font: 500 13.5px var(--sans); cursor: pointer; }
.kr-ghost2 { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.kr-ghost2:hover { background-image: linear-gradient(var(--hover), var(--hover)); }
.kr-dark2 { background: var(--btn); color: var(--btn-ink); }
.kr-ghost2 .kr-ico, .kr-dark2 .kr-ico { width: 14px; height: 14px; }
/* the gallery filling in: tiles light up one after another, like windows coming on */
.kr-skc .th { aspect-ratio: 16 / 10.5; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); transition: background .5s; }
.kr-skc .th .iso { color: var(--ink-4); opacity: .7; --gap: var(--surface-2); transition: color .5s, opacity .5s; }
.kr-skc.lit .th { background: color-mix(in srgb, var(--c) 14%, var(--surface-2)); }
.kr-skc.lit .th .iso { color: var(--c); opacity: 1; --gap: color-mix(in srgb, var(--c) 14%, var(--surface-2)); }
.kr-skc .l1, .kr-skc .l2 { display: block; margin-top: 12px; height: 12px; width: 60%; border-radius: 6px; background: var(--surface-2); }
.kr-skc .l2 { margin-top: 8px; height: 10px; width: 38%; }
.kr-galempty { margin: 70px 0; text-align: center; color: var(--ink-3); }
.kr-galempty b { display: block; font: 500 17px var(--sans); color: var(--ink); }
.kr-galempty span { display: block; margin-top: 4px; }
.kr-galempty .kr-dark2 { margin-top: 14px; }
@media (max-width: 1100px) { .kr-kf { grid-template-columns: 1fr; } .kf-r { display: none; } }
@media (max-width: 600px) { #viewCloud.kr-galon main.cloud { padding: 12px 16px 40px; } .kr-kf { padding: 22px; } .kr-kgrid { grid-template-columns: 1fr; } }

/* ---- one gallery app ---------------------------------------------------- */
#viewApp.kr-kdon .detail-inner { display: none; }
#viewApp.kr-kdon main.detail { padding: 18px 36px 60px; }
.kr-kd { max-width: 1120px; margin: 0 auto; animation: krFadeUp .45s var(--ease) both; }
.kd-cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: 36px; align-items: start; padding-top: 6px; }
.kd-l { position: sticky; top: 0; }
.kd-r h1 { margin: 0; font: 600 30px/1.1 var(--sans); letter-spacing: -.04em; color: var(--ink); }
.kd-by { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.kd-said { margin-top: 20px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
.kd-said small { font: 500 11.5px var(--sans); color: var(--ink-3); }
.kd-said p { margin: 2px 0 0; font: 500 16px/1.4 var(--sans); letter-spacing: -.015em; color: var(--ink); }
.kd-file { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.kd-file img { height: 38px; width: auto; flex: none; filter: drop-shadow(0 3px 6px rgba(24, 24, 27, .12)); }
.kd-file b { display: block; font: 500 14.5px var(--sans); color: var(--ink); }
.kd-file small { font-size: 12.5px; color: var(--ink-3); }
.kd-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.kr-ib { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 99px; background: none; color: var(--ink-2); cursor: pointer; }
.kr-ib:hover { background: var(--hover); color: var(--ink); }
.kr-ib .kr-ico { width: 16px; height: 16px; }
.kd-note #detailNote { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); }
.kd-sec { margin-top: 24px; }
.kd-sec h6, .kd-more h6 { margin: 0 0 10px; font: 500 12px var(--sans); color: var(--ink-3); }
.kd-asks { display: flex; flex-wrap: wrap; gap: 6px; }
.kd-dim { font-size: 13px; color: var(--ink-3); }
.kr-ask { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 6px; border-radius: 99px; font-size: 12.5px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); animation: krPop .45s var(--spring) both; animation-delay: calc(var(--k) * 60ms); }
.kr-ask i { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; }
.kr-ask i svg { width: 9px; height: 9px; }
.kr-ask.y i { background: var(--green); color: #fff; }
.kr-ask.n { color: var(--ink-3); }
.kr-ask.n i { background: var(--surface-2); color: var(--ink-3); }
.kd-wall { display: flex; gap: 7px; margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.kd-wall .kr-ico { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--green-ink); }
.kd-more { margin-top: 44px; }
.kd-more .kr-kgrid { margin-top: 0; }
@media (max-width: 1100px) { .kd-cols { grid-template-columns: 1fr; } .kd-l { position: static; } }
@media (max-width: 600px) { #viewApp.kr-kdon main.detail { padding: 12px 16px 40px; } }

/* ---- Studio opening ------------------------------------------------------ */
.kr-boot .bk { position: relative; display: grid; justify-items: center; }
.kr-boot .bmk .iso { width: 84px; height: 84px; }
.kr-boot .bweb { display: none; align-items: center; gap: 10px; height: 84px; }
.kr-boot .bweb b { font: 600 28px var(--sans); letter-spacing: -.04em; color: var(--ink); }
.kr-boot .bweb small { margin-top: 7px; font-size: 13px; color: var(--ink-3); }
.kr-boot .hair { width: 120px; height: 2px; margin-top: 22px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.kr-boot .hair i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--ink); }
.kr-boot.run .hair i { width: 100%; transition: width 1.4s cubic-bezier(.3, .6, .2, 1) .15s; }
.kr-boot .cbar { display: none; position: relative; width: 160px; height: 3px; margin-top: 24px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.kr-boot .cbar i { position: absolute; top: 0; bottom: 0; width: 46px; border-radius: 3px; animation: krRun 1.25s var(--ease) infinite, krHue5 6.25s steps(1) infinite; }
@keyframes krRun { from { left: -46px; } to { left: 160px; } }
@keyframes krHue5 { 0% { background: var(--accent); } 20% { background: var(--violet); } 40% { background: var(--pink); } 60% { background: var(--orange); } 80% { background: var(--green); } }
.kr-boot .bt { margin: 14px 0 0; font-size: 13px; color: var(--ink-2); text-align: center; }
.kr-boot.web .bmk, .kr-boot.web .hair { display: none; }
.kr-boot.web .bweb { display: flex; }
.kr-boot.web .cbar { display: block; }

/* ---- a pill at the foot: offline and back, an app opening ---------------- */
.kr-netp { position: fixed; left: 50%; bottom: 26px; z-index: 340; display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 12px; border-radius: 18px; background: var(--surface); box-shadow: var(--sh-pop);
  transform: translate(-50%, 20px); opacity: 0; transition: transform .5s var(--spring), opacity .3s; pointer-events: none; }
body:not(.light) .kr-netp { background: #1c1c1f; }
.kr-netp.on { transform: translate(-50%, 0); opacity: 1; }
.kr-netp b { display: block; font: 500 13.5px var(--sans); color: var(--ink); }
.kr-netp small { display: block; font-size: 12px; color: var(--ink-3); }
.kr-netp .kr-swp > span { white-space: nowrap; }
.kr-netp .iso { width: 30px; height: 30px; }
.kr-netp .iso .ly { transition: transform .7s cubic-bezier(.3, 1.4, .55, 1); }
.kr-netp .iso polygon { transition: fill .5s; }
.kr-netp.off .iso .ly:nth-child(1) { transform: translateX(5px); }
.kr-netp.off .iso .ly:nth-child(3) { transform: translateX(-7px) translateY(-2px); }
.kr-netp.off .iso { animation: krJig 1.6s ease-in-out infinite; }
@keyframes krJig { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-3deg); } 60% { transform: rotate(2.5deg); } }
.kr-netp.off .iso polygon { fill: var(--ink-4); }
.kr-netp.off .iso .tp { fill: color-mix(in srgb, var(--ink-4) 55%, var(--surface)); }
.kr-netp.opening .iso .ly:last-child { transition: transform .5s var(--ease); }
.kr-netp.opening.lift .iso .ly:last-child { transform: translate(-6px, -22px) rotate(-12deg); }
/* Your apps, first time */
.kr-skapp { animation: krFadeUp .4s var(--ease) both; animation-delay: calc(var(--k) * 60ms); }
.kr-skapp .th { aspect-ratio: 16 / 10; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); }
.kr-skapp .th .iso { color: var(--ink-4); --gap: var(--surface-2); }
.kr-skapp .l1, .kr-skapp .l2 { display: block; height: 10px; width: 62%; margin-top: 12px; border-radius: 5px; background: var(--surface-2); }
.kr-skapp .l2 { height: 8px; width: 40%; margin-top: 7px; }
/* saving a field */
.kr-svs { display: inline-flex; align-items: center; gap: 6px; min-width: 64px; margin-left: 8px; font-size: 12px; color: var(--ink-3); }
.kr-svs .sdot { position: relative; width: 14px; height: 14px; flex: none; }
.kr-svs .sdot i { position: absolute; left: 3.5px; top: 3.5px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); transform: scale(0); transition: transform .3s var(--spring); }
.kr-svs.saving .sdot i { transform: scale(1); animation: krBeat .9s ease-in-out infinite; }
@keyframes krBeat { 50% { transform: scale(.6); opacity: .55; } }
.kr-svs .sdot svg { position: absolute; inset: 0; }
.kr-svs .sdot circle { fill: var(--green); transform: scale(0); transform-origin: 7px 7px; transition: transform .4s var(--spring); }
.kr-svs .sdot path { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .35s var(--ease) .2s; }
.kr-svs.saved .sdot circle { transform: scale(1); }
.kr-svs.saved .sdot path { stroke-dashoffset: 0; }
.kr-svs.saved { color: var(--green-ink); }

/* ---- publishing: a ring fills around the mark, then comes down as a stamp */
.kr-make .kr-lb { display: inline-flex; align-items: center; gap: 8px; }
.kr-make .iso { color: var(--btn-ink); --gap: var(--btn); }
.kr-frm[hidden] { display: none; }

/* ---- the sign-in page: a page of its own -------------------------------- */
body.kr-gating .side, body.kr-gating .kr-sidetoggle, body.kr-gating .side-grip { display: none !important; }
body.kr-gating #viewGate.view { margin-left: 8px !important; }
#viewGate.kr-gate .titlebar .brand { display: none; }
#viewGate.kr-gate .gate-card { max-width: 420px; text-align: center; }
.kr-gmark { display: inline-block; margin-bottom: 18px; }
.kr-gmark .iso { width: 56px; height: 56px; }
#viewGate.kr-gate h1 { font: 600 32px/1.1 var(--sans); letter-spacing: -.045em; color: var(--ink); }
#viewGate.kr-gate .gate-sub { max-width: 340px; margin: 10px auto 0; font-size: 15px; line-height: 1.5; color: var(--ink-3); }
.kr-gwait { display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; padding: 12px 18px 12px 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--sh-1); text-align: left; animation: krFadeUp .45s var(--ease) both; }
body:not(.light) .kr-gwait { background: var(--surface-2); }
.kr-gwait[hidden] { display: none; }
.kr-gwait b { display: block; font: 500 13.5px var(--sans); color: var(--ink); }
.kr-gwait small { display: block; font-size: 12px; color: var(--ink-3); }
#viewGate.kr-gate #gateStart { margin-top: 24px; }

/* the tour: one colour per step */
.kr-tr-card { --c: var(--accent); }
.kr-tr-n { color: var(--c); }
.kr-tr-hole::after { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c, var(--accent)) 60%, transparent); }
.kr-tr-f .kr-dots i.on { background: var(--c); }
/* Home's box takes the cursor on arrival, so its ring is quieter than the design's hover-focus. */
#viewHome .bigbar:focus-within { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, var(--hair)), 0 0 0 4px color-mix(in srgb, var(--accent) 5%, transparent), 0 24px 50px -30px rgba(30, 40, 90, .32); }
/* On a narrow window the corner hint would wrap; the tabs are enough. */
@media (max-width: 600px) { #homeKb { display: none; } }

/* ================================================================ the chat, round five
 * A question answered in its own card. */
.kr-qrow { margin-top: 10px; animation: krItIn .5s var(--ease) both; }
.kr-qrow .kr-qq { margin-top: 0; animation: none; }
.kr-qchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 26px; }
.kr-q1 .kr-qchips, .kr-q1 .kr-qin, .kr-q1 .kr-qa { margin-left: 0 !important; width: 100%; }
.kr-qchip { height: 30px; padding: 0 12px; border: 0; border-radius: 99px; background: none; font: 400 13px var(--sans); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer; transition: background .2s, box-shadow .2s, color .2s; }
.kr-qchip:hover { background: var(--hover); }
.kr-qchip.on { background: var(--accent); color: #fff; box-shadow: none; }
.kr-qin { display: block; width: calc(100% - 26px); margin: 8px 0 0 26px; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; outline: 0; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); font: 400 13.5px var(--sans); color: var(--ink); transition: box-shadow .2s, background .2s; }
.kr-qin:focus { background: var(--surface); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, var(--line-strong)), 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.kr-qin.kr-need { animation: krNudge .35s var(--ease); }
@keyframes krNudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.kr-qa { margin: 4px 0 0 26px; font-size: 13.5px; color: var(--ink-2); }
.kr-qa::before { content: "→ "; color: var(--ink-3); }
.kr-qskip { height: 32px; padding: 0 8px; border: 0; background: none; font: 400 12.5px var(--sans); color: var(--ink-3); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.kr-qskip:hover { color: var(--ink-2); }
.kr-qc .kr-acts { align-items: center; }
/* the stage's copy of the question has no buttons: one place to answer */
#planAsk .plan-ask-actions, #planAsk .plan-ask-cost { display: none; }
/* the steps, as the design draws them: the file as code, a count on the right */
.kr-tr code { font: 12px ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink-3); }
.kr-tr em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kr-tools { margin-right: 4px; }
.kr-add { color: var(--green-ink); } .kr-del { color: var(--danger); }
.kr-diff { font: 500 12px var(--sans); font-variant-numeric: tabular-nums; }
#thread .msg.kr-close { margin-top: 2px; }
/* the AI's raw tool lines ("ran sed -n") are the log's, not the conversation's */
#thread .vlive .vwork, #thread .msg .vwork { display: none; }
/* the live thinking line says Thinking; what it is doing is inside the fold */
#thread .thought.live .t-now { font-size: 0 !important; background: none !important; -webkit-background-clip: border-box; animation: none !important; }
#thread .thought.live .t-now::before { content: "Thinking"; font-size: 13px; background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink-3) 35%, var(--ink) 50%, var(--ink-3) 65%, var(--ink-3) 100%); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: krThinkShim 1.8s linear infinite; }
#thread .kr-qchip.on { background: var(--accent); color: #fff; box-shadow: none; }
#thread .msg.kr-dup { display: none; }
/* The note under the session's box: short, quiet, centred. */
#viewSession .composer-hint { margin: 7px 8px 0; text-align: center; font-size: 11.5px; color: var(--ink-4); line-height: 1.4; min-height: 16px; }
#viewSession .composer-hint:empty { visibility: hidden; }
/* With the sidebar open or a rail, the Mac window buttons sit over the
   sidebar, so a view's title bar starts at its own left edge, not 84px in. */
@media (min-width: 861px) {
  body.macos.kr-rail .view > .titlebar, body.macos.kr-rail #viewSession .rail-head { padding-left: 14px; }
}
.kr-pop .kr-pop-head b { font: 500 13px var(--sans); color: var(--ink); letter-spacing: 0; } .kr-pop .kr-pop-head small { margin-top: 1px; }

/* ---- the right side: one card, start to finish (redesign.js, forge) ------
   A quiet grey inset with a dot grid and one thin glyph per step, one line
   that says what Krate is doing to this app, the time. The app arrives in
   the inset, small, then settles into the card with the file, Run and Share
   underneath and what it may do said plainly. A failure edges the card red. */
#stage.kr-forged > .stage-state { display: none !important; }
#stage.kr-forged { align-content: center; }
.kr-forge { position: relative; z-index: 1; width: min(100%, 500px); display: flex; flex-direction: column; align-items: center; gap: 12px; transition: width .8s var(--ease); }
.kr-forge[data-st="done"], .kr-forge[data-st="arrive"] { width: min(100%, 620px); }
.kr-fcard { position: relative; width: 100%; padding: 8px; border-radius: 22px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 30px 60px -34px rgba(30, 40, 90, .3), 0 2px 6px rgba(24, 24, 27, .04); transition: box-shadow .5s; }
body:not(.light) .kr-fcard { box-shadow: 0 0 0 1px var(--hair), 0 30px 70px -34px rgba(0, 0, 0, .9); }
.kr-forge[data-st="failed"] .kr-fcard { box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent), 0 30px 60px -34px rgba(30, 40, 90, .3); }
.kr-fth { position: relative; aspect-ratio: 16 / 10; border-radius: 15px; overflow: hidden; display: grid; place-items: center; isolation: isolate;
  background-color: var(--surface-2); background-image: radial-gradient(circle, color-mix(in srgb, var(--ink) 11%, transparent) 1px, transparent 1.6px); background-size: 16px 16px; background-position: 8px 8px; }
/* the glyphs */
.kr-fgl { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .5s var(--ease), transform .7s var(--ease); }
.kr-fgl::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 70% at 50% 50%, transparent 15%, var(--surface-2) 78%); }
.kr-gl { grid-area: 1 / 1; position: relative; width: 62px; height: 62px; overflow: visible; opacity: 0; transform: scale(.94); filter: blur(5px); transition: opacity .4s var(--ease), transform .8s var(--ease), filter .5s var(--ease); }
.kr-gl.on { opacity: 1; transform: none; filter: blur(0); transition-delay: .14s; }
.kr-gl path, .kr-gl circle { fill: none; stroke: var(--ink); stroke-width: 4.2; stroke-linecap: round; stroke-linejoin: round; }
.kr-gl [pathLength] { stroke-dasharray: 1 1.5; stroke-dashoffset: 0; }
.kr-gl g, .kr-gl .arc, .kr-gl .cur { transform-origin: 50px 50px; }
.kr-gl .sp { stroke-width: 4.6; }
.kr-gl .cur { fill: var(--ink); stroke: none; transform-origin: 57px 67px; }
.kr-gl .ly, .kr-gl .ln { opacity: 0; }
.kr-gl .trk { stroke: color-mix(in srgb, var(--ink) 9%, transparent); }
.kr-gl .arc { stroke-dasharray: .18 .82; opacity: 0; }
.kr-forge[data-st="building"] .kr-gl.on .ol { animation: krGlDraw 1.1s var(--ease) both; animation-delay: calc(.18s + var(--i) * .13s); }
.kr-forge[data-st="building"] .kr-gl[data-g="think"].on .rot { animation: krGlSpin 14s linear infinite; }
.kr-forge[data-st="building"] .kr-gl[data-g="think"].on .sp { animation: krGlSpoke 3.4s var(--io) infinite both; animation-delay: calc(var(--i) * .07s); }
.kr-forge[data-st="building"] .kr-gl[data-g="write"].on .cur { animation: krGlCurIn .55s var(--ease) .7s both, krGlCaret 1.15s ease-in-out 1.3s infinite; }
.kr-forge[data-st="building"] .kr-gl[data-g="write"].on .nud { animation: krGlNudge 2.3s var(--io) 1.4s infinite; }
.kr-forge[data-st="building"] .kr-gl[data-g="build"].on .ly { animation: krGlLayer 2.9s var(--io) infinite both; animation-delay: calc(1s + var(--i) * .32s); }
.kr-forge[data-st="building"] .kr-gl[data-g="pack"].on .ln { animation: krGlLayer 3.1s var(--io) infinite both; animation-delay: calc(.9s + var(--i) * .24s); }
.kr-forge[data-st="building"] .kr-gl[data-g="check"].on .trk { animation: krGlFade .6s var(--ease) both; }
.kr-forge[data-st="building"] .kr-gl[data-g="check"].on .arc { opacity: 1; animation: krGlFade .6s var(--ease) .15s both, krGlSpin 1.7s cubic-bezier(.45, .1, .55, .9) infinite; }
@keyframes krGlSpin { to { transform: rotate(360deg); } }
@keyframes krGlDraw { 0% { stroke-dashoffset: 1; opacity: 0; } 12% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes krGlFade { from { opacity: 0; } }
@keyframes krGlSpoke { 0% { stroke-dashoffset: 1; opacity: 0; } 6% { opacity: 1; } 36%, 66% { stroke-dashoffset: 0; } 94% { stroke-dashoffset: 1; opacity: 1; } 100% { stroke-dashoffset: 1; opacity: 0; } }
@keyframes krGlCurIn { from { opacity: 0; transform: scaleX(.15); } }
@keyframes krGlCaret { 50% { opacity: .12; } }
@keyframes krGlNudge { 0%, 64%, 100% { transform: none; } 76% { transform: translateX(2px); } }
@keyframes krGlLayer { 0% { stroke-dashoffset: 1; opacity: 0; } 6% { opacity: 1; } 38%, 72% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
/* not building: the asterisk rests, faint and still; nothing on a failure */
.kr-forge:not([data-st="building"]) .kr-gl[data-g="think"] { opacity: .15; transform: none; filter: none; }
/* Reading the request, checking the AI: the asterisk forms and turns, the
   line under it shimmers and the small mark turns, as while it builds. */
#stage .kr-forge.kr-busy .kr-gl[data-g="think"] { opacity: .85; }
#stage .kr-forge.kr-busy .kr-gl[data-g="think"] .rot { animation: krGlSpin 14s linear infinite; }
#stage .kr-forge.kr-busy .kr-gl[data-g="think"] .sp { animation: krGlSpoke 3.4s var(--io) infinite both; animation-delay: calc(var(--i) * .07s); }
#stage .kr-forge.kr-busy .kr-fmk { display: grid; }
#stage .kr-forge.kr-busy .kr-fmk .kr-ast g { animation: krGlSpin 6s linear infinite; }
#stage .kr-forge.kr-busy .kr-fst > span { background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink-3) 35%, var(--ink) 50%, var(--ink-3) 65%, var(--ink-3) 100%); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: krStin .5s var(--ease) both, krThinkShim 1.8s linear infinite; }
.kr-forge:not([data-st="building"]) .kr-gl:not([data-g="think"]) { opacity: 0; }
.kr-forge:is([data-st="failed"], [data-st="stopped"]) .kr-gl { opacity: 0 !important; }
.kr-forge:is([data-st="arrive"], [data-st="done"]) .kr-fgl { opacity: 0; transform: scale(.92); }
/* the app arriving, then settling in as the preview */
.kr-flive { position: absolute; inset: 0; z-index: 3; overflow: hidden; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 28px 48px -22px rgba(24, 24, 27, .45);
  opacity: 0; transform: translateY(16%) scale(.58); transition: opacity .5s var(--ease), transform .9s var(--spring), border-radius .7s var(--ease), box-shadow .7s; pointer-events: none; }
.kr-flive img { display: block; width: 100%; height: 100%; object-fit: contain; }
.kr-forge[data-st="arrive"] .kr-flive { opacity: 1; transform: scale(.62); }
.kr-forge[data-st="done"] .kr-flive { opacity: 1; transform: none; border-radius: 0; box-shadow: none; pointer-events: auto; transition: opacity .3s, transform .8s var(--ease), border-radius .6s var(--ease), box-shadow .6s; }
.kr-forge.kr-noshot .kr-flive { display: none; }
.kr-forge.kr-noshot[data-st="done"] .kr-fgl { opacity: 1; transform: none; }
/* the rows: the status line, and the file once it is made, in one place */
.kr-frows { display: grid; grid-template-columns: minmax(0, 1fr); }
.kr-frows > * { grid-area: 1 / 1; transition: opacity .4s var(--ease), transform .55s var(--ease); }
.kr-fmeta { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 12px 10px 6px; }
.kr-grow { flex: 1; }
.kr-fst { display: block; min-width: 0; height: 22px; font-size: 14px; line-height: 22px; color: var(--ink-3); white-space: nowrap; overflow: visible; }
.kr-fst > span { display: block; overflow: hidden; text-overflow: ellipsis; animation: krStin .5s var(--ease) both; }
.kr-fst .kr-fok { color: var(--green-ink); }
.kr-fst .kr-fbad { color: var(--danger); }
.kr-forge[data-st="building"] .kr-fst { color: var(--ink-2); }
.kr-fst .kr-fsnt { color: var(--ink); font-weight: 500; letter-spacing: -.01em; animation: none; overflow: visible; }
.kr-fw { position: relative; display: inline-block; height: 22px; vertical-align: top; transition: width .5s var(--ease); }
.kr-fw > span { position: absolute; left: 0; top: 0; display: block; line-height: 22px; white-space: nowrap; color: var(--c); opacity: 0; transform: translateY(.5em); filter: blur(3px); transition: opacity .35s var(--ease), transform .55s var(--ease), filter .4s; }
.kr-fw > span.on { opacity: 1; transform: none; filter: none; transition-delay: .1s; }
.kr-fw > span.out { opacity: 0; transform: translateY(-.5em); filter: blur(3px); transition-delay: 0s; }
.kr-fw::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1.6px; border-radius: 2px; background: currentColor; color: var(--accent); opacity: .3; }
.kr-fmk { width: 14px; height: 14px; flex: none; display: grid; place-items: center; margin-left: 1px; }
.kr-ast path { fill: none; stroke: var(--ink-2); stroke-width: 10; stroke-linecap: round; }
.kr-ast g { transform-origin: 50px 50px; }
.kr-forge[data-st="building"] .kr-fmk .kr-ast g { animation: krGlSpin 6s linear infinite; }
.kr-forge:not([data-st="building"]) .kr-fmk { display: none; }
.kr-fel { flex: none; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kr-fdone { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 6px 8px 8px; opacity: 0; transform: translateY(8px); pointer-events: none; }
.kr-forge[data-st="done"] .kr-fmeta { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.kr-forge[data-st="done"] .kr-fdone { opacity: 1; transform: none; pointer-events: auto; transition-delay: .25s; }
.kr-dcic { height: 34px; width: auto; flex: none; }
.kr-dn { flex: 1; min-width: 0; }
.kr-dn b { display: block; font-size: 14.5px; font-weight: 500; letter-spacing: -.015em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kr-dn small { display: flex; margin-top: 1px; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
.kr-dn small > span + span::before { content: "\00b7"; margin: 0 6px; color: var(--ink-4); }
.kr-dn .kr-mono { font: 600 11.5px ui-monospace, Menlo, monospace; color: var(--ink-2); }
.kr-da { display: flex; align-items: center; gap: 6px; flex: none; }
.kr-da .btn { height: 32px; padding: 0 14px; border-radius: 99px; font-size: 13px; gap: 6px; display: inline-flex; align-items: center; }
.kr-da .btn .kr-ico { width: 12px; height: 12px; }
.kr-fmore { width: 32px; height: 32px; border: 0; border-radius: 99px; background: transparent; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s; }
.kr-fmore:hover { background: var(--hover); color: var(--ink); }
.kr-fmore .kr-ico { width: 15px; height: 15px; }
/* what opens under the rows: a verdict, what it may do, the long-wait note */
.kr-fx { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease); }
.kr-fx > div { overflow: hidden; min-height: 0; }
.kr-forge[data-st="done"] .kr-fasks { grid-template-rows: 1fr; transition-delay: .35s; }
.kr-forge[data-st="done"].kr-hasverd .kr-fverd { grid-template-rows: 1fr; }
.kr-forge[data-st="building"].kr-long .kr-fnote { grid-template-rows: 1fr; }
.kr-fverd p { margin: 2px 8px 8px; padding: 8px 12px; border-radius: 11px; background: color-mix(in srgb, var(--orange) 12%, var(--surface)); color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.kr-perm { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 2px 8px 8px 10px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); text-wrap: pretty; }
.kr-perm .kr-ico { width: 13px; height: 13px; flex: none; margin-top: 2.5px; color: var(--green-ink); }
.kr-perm b { color: var(--ink-2); font-weight: 500; }
.kr-perm button { font: inherit; color: var(--ink-2); padding: 0; margin-left: 2px; border: 0; background: none; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
.kr-perm button:hover { color: var(--ink); text-decoration-color: currentColor; }
.kr-fstill { display: inline-flex; align-items: center; gap: 8px; margin: 4px 10px 6px; padding: 7px 12px; border-radius: 11px; background: #fff6ec; color: #4a3a2c; font-size: 12.5px; opacity: 0; transform: translateY(-4px); transition: opacity .4s var(--ease) .15s, transform .5s var(--ease) .15s; }
body:not(.light) .kr-fstill { background: #2a2016; color: #d6c3b0; }
.kr-fstill .kr-ast path { stroke: #e8873f; stroke-width: 12; }
.kr-forge.kr-long .kr-fstill { opacity: 1; transform: none; }
/* under the card: Show the log and Stop while it works */
.kr-facts { display: none; gap: 2px; }
.kr-forge[data-st="building"] .kr-facts { display: flex; animation: krStin .5s var(--ease) both; }
#stage .kr-forge .kr-plain { height: 30px; box-shadow: none; padding: 0 11px; border: 0; border-radius: 99px; background: transparent; color: var(--ink-3); font-size: 12.5px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; transition: background .2s, color .2s; }
#stage .kr-forge .kr-plain:hover { background: var(--hover); color: var(--ink); }
#stage .kr-forge .kr-plain .kr-ico { width: 13px; height: 13px; }
/* Details: the engine's lines inside the card's grey panel, where the glyph
   was. Small, light and quiet; the newest line darkest at the bottom, the
   oldest fading out at the top, a dot on each step. The card keeps its size. */
.kr-flg { position: absolute; inset: 0; z-index: 4; opacity: 0; pointer-events: none; background: color-mix(in srgb, var(--surface-2) 96%, transparent); transition: opacity .45s var(--ease); }
#stage .kr-forge.kr-logon:is([data-st="building"], [data-st="failed"], [data-st="stopped"]) .kr-flg { opacity: 1; pointer-events: auto; }
#stage .kr-forge.kr-logon:is([data-st="building"], [data-st="failed"], [data-st="stopped"]) .kr-fgl { opacity: 0; transform: scale(.96); }
.kr-flg-in { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 16px; scrollbar-width: none;
  font: 11px/1.8 ui-monospace, Menlo, monospace; color: var(--ink-4);
  -webkit-mask-image: linear-gradient(transparent, #000 46px, #000); mask-image: linear-gradient(transparent, #000 46px, #000); outline: none; }
.kr-flg-in::-webkit-scrollbar { display: none; }
.kr-flg-in { display: flex; flex-direction: column; } .kr-flg-in > :first-child { margin-top: auto; }
.kr-ll { position: relative; white-space: pre-wrap; word-break: break-word; }
.kr-ll.kr-ls { color: var(--ink-3); padding-left: 13px; }
.kr-ll.kr-ls::before { content: ""; position: absolute; left: 1px; top: .78em; width: 5px; height: 5px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 70%, transparent); }
.kr-ll.kr-le { color: var(--danger); }
.kr-ll:last-child { color: var(--ink-2); }
.kr-ll.kr-ls:last-child::before { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.kr-ll.kr-lnew { animation: krStin .45s var(--ease) both; }
.kr-ll.kr-lq { color: var(--ink-4); font-family: var(--sans); font-size: 12px; }
.kr-flg-copy { position: absolute; top: 9px; right: 10px; z-index: 1; height: 24px; padding: 0 9px; border: 0; border-radius: 7px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair);
  color: var(--ink-3); font: 500 11px var(--sans); cursor: pointer; opacity: 0; transition: opacity .25s, color .2s; }
.kr-flg:hover .kr-flg-copy, .kr-flg-copy:focus-visible { opacity: 1; }
.kr-flg-copy:hover { color: var(--ink); }
/* a failure: what happened, and what to do */
.kr-ffail { display: none; width: 100%; text-align: left; padding: 6px 6px 0; }
.kr-forge:is([data-st="failed"], [data-st="stopped"]) .kr-ffail { display: block; animation: krStin .5s var(--ease) both; }
.kr-ffail h5 { margin: 0; font-size: 15.5px; font-weight: 500; letter-spacing: -.015em; color: var(--ink); display: flex; align-items: center; gap: 9px; }
.kr-ffail h5 i { width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); font-style: normal; font-size: 12px; font-weight: 700; }
.kr-forge[data-st="stopped"] .kr-ffail h5 i { display: none; }
.kr-ffail p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.kr-facts2 { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.kr-facts2 .btn { height: 34px; padding: 0 14px; border-radius: 99px; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .kr-gl, .kr-gl *, .kr-ast g { animation: none !important; } .kr-gl .ly, .kr-gl .ln, .kr-gl .arc { opacity: 1; } }
/* a phone: the preview strip is short, so the card is too -- a wider inset,
   tighter rows, and Run and Share stay on the file's line */
@media (max-width: 560px) {
  #stage.kr-forged { padding: 10px 12px; }
  .kr-fcard { padding: 6px; border-radius: 18px; }
  .kr-fth { aspect-ratio: 2 / 1; border-radius: 13px; }
  .kr-gl { width: 46px; height: 46px; }
  .kr-fmeta { padding: 9px 8px 4px; }
  .kr-fdone { gap: 9px; padding: 9px 4px 6px 6px; }
  .kr-dcic { height: 28px; }
  .kr-dn small > span:nth-child(n+3) { display: none; }
  .kr-da .btn { height: 30px; padding: 0 11px; }
  .kr-perm { padding: 0 6px 6px 8px; font-size: 12px; }
  .kr-forge { gap: 6px; }
}
#stage .kr-forge .btn.kr-dark { border: 0; background: var(--btn); color: var(--btn-ink); cursor: pointer; transition: background .2s, transform .3s var(--spring); }
#stage .kr-forge .btn.kr-dark:hover { background: var(--btn-hover); }
#stage .kr-forge .btn.kr-ghost { border: 0; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer; transition: background .2s; }
#stage .kr-forge .btn.kr-ghost:hover { background: var(--hover); }
.kr-forge .btn:active { transform: scale(.96); }
/* the sign-in wait: always a way back (K-971) */
.kr-gw-acts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.kr-gw-a { padding: 0; border: 0; background: none; font: 500 12.5px var(--sans); color: var(--ink-2); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.kr-gw-a:hover { color: var(--ink); text-decoration-color: currentColor; }
.kr-gw-a[hidden] { display: none; }
#gateCode .kr-gw-back { display: block; margin: 14px auto 0; }

/* ---- signing in: one small popup (redesign.js, signInPopup) ---------------
   The design's sign-in: the mark stacks in over a plain question; GitHub,
   Google, an email link, a code. The popup keeps its place and only changes
   height while its inside crossfades. */
.kr-lgw { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, #0b0b10 38%, transparent); -webkit-backdrop-filter: blur(6px) saturate(1.1); backdrop-filter: blur(6px) saturate(1.1); animation: krWelBg .35s var(--ease) both; }
.kr-lgw[hidden] { display: none; }
.kr-lgw.out { animation: krWelOut .26s var(--ease) both; }
.kr-lgc { position: relative; width: min(392px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 24px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 40px 100px -30px rgba(0, 0, 0, .45); animation: krWelIn .55s var(--spring) both; }
body:not(.light) .kr-lgc { background: #141417; }
.kr-lgc:focus { outline: none; }
.kr-lgw.out .kr-lgc { animation: krWelCardOut .26s var(--ease) both; }
.kr-lg-x { position: absolute; top: 12px; right: 12px; z-index: 2; }
.kr-lg-wrap { overflow: hidden; transition: height .45s var(--ease); }
.kr-lg-in { padding: 34px 28px 0; }
.kr-lg-in.kr-lg-sw > * { animation: krLgIn .5s var(--ease) both; }
.kr-lg-in.kr-lg-sw > :nth-child(2) { animation-delay: .04s; } .kr-lg-in.kr-lg-sw > :nth-child(3) { animation-delay: .08s; } .kr-lg-in.kr-lg-sw > :nth-child(4) { animation-delay: .12s; } .kr-lg-in.kr-lg-sw > :nth-child(n+5) { animation-delay: .16s; }
@keyframes krLgIn { from { opacity: 0; transform: translateY(6px); filter: blur(3px); } }
.kr-lg-hd { display: flex; flex-direction: column; align-items: center; text-align: center; }
.kr-lg-mk { height: 44px; display: grid; place-items: center; } .kr-lg-mk .iso { width: 42px; height: 42px; }
.kr-lg-hd h3 { margin: 16px 0 0; font: 500 20px var(--sans); letter-spacing: -.025em; color: var(--ink); }
.kr-lg-hd p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-3); text-wrap: balance; } .kr-lg-hd p b { color: var(--ink); font-weight: 500; }
.kr-lg-btns { display: grid; gap: 8px; margin-top: 24px; }
.kr-lg-b { position: relative; width: 100%; height: 44px; border: 0; border-radius: 13px; display: flex; align-items: center; justify-content: center; gap: 10px; font: 500 14px var(--sans); color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer; transition: background .2s, box-shadow .2s, transform .15s; }
.kr-lg-b:hover { background-image: linear-gradient(var(--hover), var(--hover)); } .kr-lg-b:active { transform: scale(.985); }
.kr-lg-b svg { width: 17px; height: 17px; flex: none; }
.kr-lg-b.dark { color: var(--bg); background: var(--ink); box-shadow: none; } .kr-lg-b.dark:hover { background: color-mix(in srgb, var(--ink) 88%, var(--bg)); }
.kr-lg-b.sm { margin-top: 22px; }
.kr-lg-b .last { position: absolute; right: 12px; font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 99px; color: var(--ink-3); background: var(--surface-2); }
.kr-lg-b.dark .last { color: color-mix(in srgb, var(--bg) 70%, transparent); background: color-mix(in srgb, var(--bg) 14%, transparent); }
.kr-lg-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; font-size: 12px; color: var(--ink-4); } .kr-lg-or::before, .kr-lg-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.kr-lg-mail { position: relative; display: flex; margin: 0; }
.kr-lg-mail input { flex: 1; min-width: 0; height: 44px; padding: 0 50px 0 15px; border-radius: 13px; font: 14px var(--sans); color: var(--ink); background: var(--surface-2); border: 0; outline: 0; box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .2s, background .2s; }
.kr-lg-mail input::placeholder { color: var(--ink-4); }
.kr-lg-mail input:focus { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong), 0 0 0 4px var(--accent-soft); }
.kr-lg-mail button { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border: 0; border-radius: 10px; display: grid; place-items: center; color: var(--ink-4); background: transparent; cursor: pointer; transition: background .25s, color .25s, transform .3s var(--spring); }
.kr-lg-mail button .kr-ico, .kr-lg-mail button svg { width: 15px; height: 15px; }
.kr-lg-mail.ok button { color: var(--bg); background: var(--ink); }
.kr-lg-mail.bad input { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 55%, transparent); animation: krLgShake .4s var(--ease); }
@keyframes krLgShake { 20% { transform: translateX(-4px); } 45% { transform: translateX(3px); } 70% { transform: translateX(-2px); } }
.kr-lg-msg { height: 0; overflow: hidden; font-size: 12px; color: var(--danger); transition: height .3s var(--ease); } .kr-lg-mail.bad + .kr-lg-msg { height: auto; min-height: 22px; padding-top: 6px; }
.kr-lg-fine { margin: 14px 0 0; text-align: center; font-size: 11.5px; line-height: 1.5; color: var(--ink-4); } .kr-lg-fine a { color: var(--ink-3); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; } .kr-lg-fine a:hover { color: var(--ink); }
.kr-lg-ft { display: flex; align-items: center; gap: 7px; margin: 22px -28px 0; padding: 13px 20px 14px 22px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.kr-lg-ft svg { width: 13px; height: 13px; color: var(--green-ink); }
.kr-lg-ft button { border: 0; background: none; padding: 0; font: 500 12.5px var(--sans); color: var(--ink-2); cursor: pointer; } .kr-lg-ft button:hover { color: var(--ink); }
/* waiting on the browser: the mark, a few dots walking across, the other side */
.kr-lg-link { display: flex; align-items: center; gap: 10px; height: 44px; }
.kr-lg-link .t { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink); } .kr-lg-link .t svg { width: 20px; height: 20px; }
.kr-lg-link .t .iso { width: 24px; height: 24px; }
.kr-lg-link .dots { display: flex; gap: 5px; } .kr-lg-link .dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-4); animation: krLgDot 1.4s var(--ease) infinite; }
.kr-lg-link .dots i:nth-child(2) { animation-delay: .12s; } .kr-lg-link .dots i:nth-child(3) { animation-delay: .24s; } .kr-lg-link .dots i:nth-child(4) { animation-delay: .36s; }
@keyframes krLgDot { 0%, 60%, 100% { opacity: .35; transform: none; } 25% { opacity: 1; transform: scale(1.35); background: var(--ink-2); } }
.kr-lg-wait { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: 12.5px; color: var(--ink-3); background: var(--surface-2); text-align: center; font-variant-numeric: tabular-nums; }
.kr-lg-spin { width: 12px; height: 12px; flex: none; border-radius: 50%; border: 1.6px solid color-mix(in srgb, var(--ink) 14%, transparent); border-top-color: var(--ink-2); animation: krGlSpin .9s linear infinite; }
.kr-lg-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-size: 12.5px; color: var(--ink-4); }
.kr-lg-row .btn { height: 32px; font-size: 13px; padding: 0 13px; border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; } .kr-lg-row .btn svg { width: 12px; height: 12px; }
.kr-lnk { border: 0; background: none; padding: 0; font: 500 12.5px var(--sans); color: var(--ink-2); cursor: pointer; } .kr-lnk:hover { color: var(--ink); } .kr-lnk:disabled { color: var(--ink-4); font-weight: 400; cursor: default; }
.kr-lg-pad { height: 26px; }
/* the code, for a browser on another device */
.kr-lg-code { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; min-height: 44px; }
.kr-lg-code .ch { width: 34px; height: 44px; border-radius: 10px; display: grid; place-items: center; font: 600 19px ui-monospace, Menlo, monospace; color: var(--ink); background: var(--surface-2); animation: krLgCh .45s var(--ease) both; animation-delay: calc(.1s + var(--i) * 45ms); }
.kr-lg-code .dash { width: 8px; height: 2px; border-radius: 2px; background: var(--ink-4); margin: 0 2px; }
.kr-lg-code .cp { width: 34px; height: 34px; margin-left: 6px; border: 0; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); background: none; cursor: pointer; } .kr-lg-code .cp:hover { color: var(--ink); background: var(--hover); } .kr-lg-code .cp svg { width: 14px; height: 14px; }
@keyframes krLgCh { from { opacity: 0; transform: translateY(5px) scale(.96); } }
/* the envelope, the link card peeking out while it waits */
.kr-env { position: relative; width: 124px; height: 82px; margin: 0 auto; transform: scale(.82); transform-origin: 50% 70%; }
.kr-env .lk { position: absolute; left: 22px; right: 22px; top: 24px; height: 50px; border-radius: 7px; background: var(--accent); color: #fff; padding: 7px 9px; font-size: 9px; font-weight: 500; text-align: left; animation: krLgPeek 2.6s var(--ease) infinite; }
.kr-env .lk i { display: block; height: 4px; margin-top: 5px; border-radius: 3px; background: rgba(255, 255, 255, .55); width: 70%; } .kr-env .lk i + i { width: 46%; }
.kr-env svg { position: absolute; left: 0; top: 0; overflow: visible; } .kr-env .back { fill: var(--surface-3); } .kr-env .front { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.2; } .kr-env .front2 { fill: none; stroke: var(--line-strong); stroke-width: 1.2; }
@keyframes krLgPeek { 0%, 100% { transform: translateY(14px); } 45%, 65% { transform: translateY(-12px); } }
/* you're in */
.kr-lg-av { position: relative; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 500; color: #fff; background: linear-gradient(135deg, #6f94ff, #7c5ce8); animation: krLgPop .6s var(--spring) both; }
.kr-lg-av .ok { position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--green); box-shadow: 0 0 0 3px var(--surface); animation: krLgPop .5s var(--spring) .35s both; }
.kr-lg-av .ok svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; animation: krLgTick .4s var(--ease) .6s forwards; }
@keyframes krLgPop { from { opacity: 0; transform: scale(.6); } } @keyframes krLgTick { to { stroke-dashoffset: 0; } }
.kr-lg-done-bar { height: 3px; margin-top: 24px; border-radius: 3px; background: var(--surface-2); overflow: hidden; } .kr-lg-done-bar i { display: block; height: 100%; width: 100%; background: var(--ink-4); transform-origin: left; animation: krLgBar 1.9s linear both; } @keyframes krLgBar { from { transform: scaleX(0); } }
/* something went wrong */
.kr-lg-bad { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); font-size: 18px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .kr-lg-in *, .kr-lg-in.kr-lg-sw > * { animation: none !important; } .kr-lg-av .ok svg { stroke-dashoffset: 0; } }
.kr-lgc .btn.kr-ghost { border: 0; background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer; transition: background .2s, color .2s; }
.kr-lgc .btn.kr-ghost:hover { background: var(--hover); color: var(--ink); }
/* the sign-in page behind it: the popup is the page */
body.kr-lgopen #viewGate .gate-body { visibility: hidden; }

/* ---- Files, Code and Details, as the design has them -------------------- */
#paneFiles .pane-head, #paneDetails .dt2-head { padding: 18px 24px 4px; display: flex; align-items: center; gap: 8px; }
#paneFiles .pane-title, #paneDetails .pane-title { margin: 0; font: 500 15px var(--sans); color: var(--ink); }
#paneFiles .pane-head .btn, #paneDetails .dt2-head .btn { height: 34px; padding: 0 15px; border-radius: 99px; font: 500 13.5px var(--sans); display: inline-flex; align-items: center; gap: 7px; }
#filesAttach { background: var(--surface); color: var(--ink); border: 0; box-shadow: inset 0 0 0 1px var(--line-strong); }
#filesSave { background: var(--btn); color: var(--btn-ink); border: 0; box-shadow: none; }
#filesList { padding: 14px 24px 24px; }
#paneFiles .f-label { margin: 6px 0 9px 2px; font-size: 11.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
#paneFiles .f-group { margin-bottom: 22px; border-radius: 14px; }
#paneFiles .f-group > .f-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 58px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair); transition: background .2s; }
#paneFiles .f-row .f-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); color: var(--ink-2); }
#paneFiles .f-row .f-ico img { width: 18px; height: auto; }
#paneFiles .f-row .f-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#paneFiles .f-row .f-name { font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#paneFiles .f-row .f-note { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#paneFiles .f-row .f-size { flex: none; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
#paneFiles .f-row button { flex: none; height: 30px; padding: 0 13px; border: 0; border-radius: 99px; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); font: 500 12.5px var(--sans); cursor: pointer; }
#paneFiles .f-row button:hover { background-image: linear-gradient(var(--hover), var(--hover)); }
/* Code: a quiet tree, the file's path, its line count, Open in the IDE and Copy */
#paneCode .code-tree { padding: 12px 10px; }
#paneCode .code-search[hidden] { display: none; }
#paneCode .code-dir { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 10px; margin: 0; font: 400 13px var(--sans); color: var(--ink-2); }
#paneCode .code-file { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
#paneCode .code-file.in { padding-left: 26px; }
#paneCode .cf-ico { display: inline-grid; place-items: center; flex: none; color: var(--ink-3); }
#paneCode .cf-ico svg, svg.cf-ico { width: 14px; height: 14px; }
#paneCode .code-dir svg.cf-ico { color: var(--ink-3); }
#paneCode .code-file.on .cf-ico { color: var(--selected-ink); }
#paneCode .code-ro { display: none; }
#paneCode .code-head { gap: 6px; }
#paneCode .code-path { font: 400 13px ui-monospace, Menlo, monospace; color: var(--ink-2); }
#paneCode .code-stats { font-size: 12.5px; margin-right: 6px; }
#paneCode .code-head .btn { height: 32px; border: 0; background: none; box-shadow: none; color: var(--ink-2); font: 400 13px ui-monospace, Menlo, monospace; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; border-radius: 9px; }
#paneCode .code-head .btn:hover { background: var(--hover); color: var(--ink); }
#codeCopy::before { content: ""; width: 13px; height: 13px; background: currentColor; -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="black" stroke-width="1.3"><rect x="5.2" y="5.2" width="8" height="8" rx="1.6"/><path d="M10.8 5.2V3.9a1.3 1.3 0 00-1.3-1.3H3.9a1.3 1.3 0 00-1.3 1.3v5.6a1.3 1.3 0 001.3 1.3h1.3"/></svg>') center / contain no-repeat; mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="black" stroke-width="1.3"><rect x="5.2" y="5.2" width="8" height="8" rx="1.6"/><path d="M10.8 5.2V3.9a1.3 1.3 0 00-1.3-1.3H3.9a1.3 1.3 0 00-1.3 1.3v5.6a1.3 1.3 0 001.3 1.3h1.3"/></svg>') center / contain no-repeat; }
/* Details: one table of facts */
#detailsHost { padding: 0; }
.dt2-rows { margin: 14px 24px 24px; border-radius: 16px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--hair); display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); }
.dt2-rows dt, .dt2-rows dd { margin: 0; min-height: 46px; display: flex; align-items: center; padding: 11px 16px; font-size: 13.5px; border-top: 1px solid var(--line); }
.dt2-rows dt:first-child, .dt2-rows dt:first-child + dd { border-top: 0; }
.dt2-rows dt { color: var(--ink-3); }
.dt2-rows dd { color: var(--ink); min-width: 0; }
.dt2-rows dd.mono, .dt2-rows .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.dt2-by { display: inline-flex; align-items: center; gap: 8px; } .dt2-mk { display: inline-grid; place-items: center; width: 18px; height: 18px; } .dt2-mk svg { width: 16px; height: 16px; }
.dt2-os { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; } .dt2-os span { display: inline-flex; align-items: center; gap: 6px; } .dt2-os span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.dt2-act { display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%; }
.dt2-path, .dt2-hash { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.dt2-link { flex: none; padding: 0; border: 0; background: none; font: 500 12.5px var(--sans); color: var(--ink-2); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.dt2-link:hover { color: var(--ink); text-decoration-color: currentColor; }
/* Port's one control is its card: the row under it repeated the card's
   own action twice (Choose a folder, and an arrow that also chose one). */
#homePortPane .kr-cmprow { display: none; }
#homePortPane:not([hidden]) { display: flow-root; padding-bottom: 14px; }
#homePortPane .kr-portdrop { margin-bottom: 0; align-items: center; }
#homePortPane .kr-portdrop b { color: var(--ink); }
#homePortPane .kr-portgo { flex: none; display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 16px; border-radius: 99px; background: var(--btn); color: var(--btn-ink); font: 500 13.5px var(--sans); transition: background .2s; }
#homePortPane .kr-portdrop:hover .kr-portgo { background: var(--btn-hover); }
@media (max-width: 560px) {
  #homePortPane .kr-portdrop { flex-wrap: wrap; align-items: flex-start; }
  #homePortPane .kr-portgo { order: 3; width: 100%; height: 44px; font-size: 15px; }
}
#homeSheetLine.kr-offmode { display: none; }
/* The terminal commands, folded at the foot of Details (desktop only). */
#paneDetails .dt2-dev { margin: 0 24px 24px; }
#paneDetails .dt2-dev > summary { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 2px; list-style: none; cursor: pointer; font: 500 13.5px var(--sans); color: var(--ink-2); border-radius: 10px; }
#paneDetails .dt2-dev > summary::-webkit-details-marker { display: none; }
#paneDetails .dt2-dev > summary::before { content: ""; width: 6px; height: 6px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s var(--ease); }
#paneDetails .dt2-dev[open] > summary::before { margin-top: -4px; transform: rotate(45deg); }
#paneDetails .dt2-dev > summary:hover { color: var(--ink); }
#paneDetails .dt2-dev .dt2-rows { margin: 4px 0 0; }
/* An app's versions (IC-976): newest first, the current one marked, Open and
   Make current as quiet links, and the one line that says what Make current
   does before it does it. Only the publisher sees it. */
.vers { margin: 0 24px 24px; }
.vers-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 10px; }
.vers-title { margin: 0; font: 500 14px var(--sans); color: var(--ink); }
.vers-sub { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.vers-list { list-style: none; margin: 0; padding: 0; border-radius: 16px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--hair); }
.vers-row { padding: 0 16px; border-top: 1px solid var(--line); }
.vers-row:first-child { border-top: 0; }
.vers-top { display: flex; align-items: center; gap: 10px; min-height: 48px; flex-wrap: wrap; padding: 6px 0; }
.vers-n { font: 600 13.5px var(--sans); color: var(--ink); min-width: 34px; font-variant-numeric: tabular-nums; }
.vers-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; font: 500 11.5px var(--sans); color: var(--green-ink); background: var(--green-soft); }
.vers-pill.ghost { color: var(--ink-2); background: var(--surface-3); }
.vers-meta { min-width: 0; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.vers-acts { display: inline-flex; gap: 16px; margin-left: auto; }
.vers-acts .dt2-link { min-height: 32px; }
.vers-ask { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 0 0 12px; }
.vers-ask p { flex: 1; min-width: 180px; margin: 0; font-size: 13px; color: var(--ink-2); }
.vers-ask p.vers-err { color: var(--danger); }
.vers-btns { display: inline-flex; gap: 8px; }
#paneDetails .vers-btns .btn { height: 34px; padding: 0 14px; border-radius: 99px; font: 500 13px var(--sans); border: 0; cursor: pointer; }
#paneDetails .vers-btns .vers-go { background: var(--btn); color: var(--btn-ink); box-shadow: none; }
#paneDetails .vers-btns .vers-go:hover:not(:disabled) { background: var(--btn-hover); }
#paneDetails .vers-btns .vers-no { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
#paneDetails .vers-btns .btn:disabled { opacity: .6; cursor: default; }
.kr-upd { margin: 10px 0 12px; }
@media (max-width: 560px) { .vers { margin: 0 16px 20px; } .vers-top { column-gap: 8px; } .vers-meta { order: 9; flex-basis: 100%; margin: -6px 0 0 42px; } }
@media (max-width: 560px) { .dt2-rows { grid-template-columns: 1fr; } .dt2-rows dt { min-height: 0; padding-bottom: 0; } .dt2-rows dd { border-top: 0; padding-top: 4px; } #paneFiles .pane-head, #paneDetails .dt2-head { flex-wrap: wrap; } }
/* On a phone, Files and Details read at the phone's type floor. */
@media (max-width: 560px) {
  .dt2-rows dt, .dt2-rows dd, .dt2-rows .dt2-link, #paneDetails .dt2-dev > summary { font-size: 14px; }
  .dt2-rows dd.mono, .dt2-rows .mono { font-size: 13.5px; }
  #paneFiles .f-row .f-name, #paneFiles .f-row .f-size, #paneFiles .f-row button, #paneFiles .pane-head .btn { font-size: 14px; }
  #paneFiles .f-label { font-size: 12px; }
}

/* ---- the IDE's editor (CodeMirror) and its question bar ------------------ */
#ideEd { position: relative; }
#ideCode .cm-editor { flex: 1; min-width: 0; height: 100%; }
#ideCode .cm-scroller { overscroll-behavior: contain; }
#ideCode .cm-panel.cm-search { padding: 8px 12px; font: 12.5px var(--sans); }
#ideCode .cm-panel.cm-search input, #ideCode .cm-panel.cm-search button { font: 12.5px var(--sans); border-radius: 8px; }
#ideCode .cm-textfield { border: 0; background: var(--surface-2); color: var(--ink); padding: 4px 8px; box-shadow: inset 0 0 0 1px var(--line); }
#ideCode .cm-button { border: 0; background: var(--surface-2); color: var(--ink-2); background-image: none; padding: 3px 9px; }
#ideCode .cm-panel.cm-search label { color: var(--ink-3); }
.ide-bar { position: absolute; left: 12px; right: 12px; top: 10px; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 14px 30px -16px rgba(0, 0, 0, .35); font: 13px var(--sans); color: var(--ink); animation: krStin .35s var(--ease) both; }
.ide-bar.hidden { display: none; }
.ide-bar .grow { flex: 1; }
.ide-bar button { height: 30px; padding: 0 12px; border: 0; border-radius: 99px; background: var(--surface-2); color: var(--ink); font: 500 12.5px var(--sans); cursor: pointer; }
.ide-bar button.pri { background: var(--btn); color: var(--btn-ink); }
.ip-prob.ip-note b { color: var(--ink-3); }
/* the IDE's problems, one per compiler error, and search across files */
.ip-diag { border-bottom: 1px solid var(--line); }
.ip-go { width: 100%; display: flex; align-items: baseline; gap: 10px; padding: 9px 14px; border: 0; background: none; text-align: left; cursor: pointer; font: 13px var(--sans); color: var(--ink); }
.ip-go:hover { background: var(--hover); }
.ip-go i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--danger); transform: translateY(-1px); }
.ip-diag.warning .ip-go i { background: var(--orange); }
.ip-go b { flex: none; font: 500 12.5px ui-monospace, Menlo, monospace; color: var(--ink-2); }
.ip-go span { flex: 1; min-width: 0; }
.ip-go em { flex: none; font: 11.5px ui-monospace, Menlo, monospace; font-style: normal; color: var(--ink-4); }
.ip-diag details { padding: 0 14px 8px 32px; } .ip-diag summary { cursor: pointer; font-size: 12px; color: var(--ink-3); }
.ip-diag pre { margin: 6px 0 0; font: 11.5px/1.6 ui-monospace, Menlo, monospace; color: var(--ink-2); white-space: pre-wrap; }
.ide-find { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ide-find.hidden { display: none; }
.ide-find input { margin: 8px 12px; height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--ink); font: 13px var(--sans); outline: 0; box-shadow: inset 0 0 0 1px var(--line); }
.ide-find input:focus { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong), 0 0 0 3px var(--accent-soft); }
.ide-find-out { flex: 1; min-height: 0; overflow: auto; }
.ip-hit { width: 100%; display: flex; gap: 12px; align-items: baseline; padding: 6px 14px; border: 0; background: none; text-align: left; cursor: pointer; font: 12.5px ui-monospace, Menlo, monospace; color: var(--ink-2); }
.ip-hit:hover { background: var(--hover); }
.ip-hit b { flex: none; font-weight: 500; color: var(--ink-3); }
.ip-hit span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ip-hit mark { background: color-mix(in srgb, var(--orange) 30%, transparent); color: var(--ink); border-radius: 3px; }
#ideCode .cm-diagnostic-error { border-left-color: var(--danger); }
#ideCode .cm-lintRange-error { background-image: none; text-decoration: underline wavy var(--danger); text-underline-offset: 3px; }
#ideCode .cm-lintRange-warning { background-image: none; text-decoration: underline wavy var(--orange); text-underline-offset: 3px; }
/* the AI's change, reviewed before it lands */
.ide-review { position: absolute; inset: 8px; z-index: 6; display: flex; flex-direction: column; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 24px 60px -24px rgba(0, 0, 0, .4); overflow: hidden; animation: krStin .4s var(--ease) both; }
.rv-top { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); font: 14px var(--sans); color: var(--ink); }
.rv-top b { font-weight: 500; } .rv-top .grow { flex: 1; }
.rv-top button { height: 32px; padding: 0 14px; border: 0; border-radius: 99px; font: 500 13px var(--sans); cursor: pointer; background: var(--surface-2); color: var(--ink); }
.rv-top button.pri { background: var(--btn); color: var(--btn-ink); }
.rv-body { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px 16px; }
.rv-f { margin-bottom: 12px; border-radius: 12px; box-shadow: 0 0 0 1px var(--hair); overflow: hidden; }
.rv-h { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--surface-2); font: 13px ui-monospace, Menlo, monospace; color: var(--ink); cursor: pointer; }
.rv-h b { font-weight: 500; } .rv-new { font: 500 11px var(--sans); padding: 1px 7px; border-radius: 99px; background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green-ink); }
.rv-n { margin-left: auto; font-size: 12px; } .rv-n .a { color: var(--green-ink); } .rv-n .d { color: var(--danger); }
.rv-d { font: 12px/1.65 ui-monospace, Menlo, monospace; overflow-x: auto; }
.rv-l { display: flex; white-space: pre; color: var(--ink-2); } .rv-l i { width: 26px; flex: none; text-align: center; font-style: normal; color: var(--ink-4); user-select: none; }
.rv-l.add { background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--ink); } .rv-l.add i { color: var(--green-ink); }
.rv-l.del { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--ink-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 40%, transparent); } .rv-l.del i { color: var(--danger); }
.rv-gap { padding: 3px 12px 3px 34px; font: 11px var(--sans); color: var(--ink-4); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.rv-bin { margin: 0; padding: 10px 14px; font-size: 12.5px; color: var(--ink-3); }
.ip-row { display: flex; align-items: center; }
.ip-row .ip-go { flex: 1; min-width: 0; }
.ip-fix { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 28px; margin-right: 10px; padding: 0 11px; border: 0; border-radius: 99px; background: color-mix(in srgb, var(--violet) 12%, transparent); color: color-mix(in srgb, var(--violet) 80%, var(--ink)); font: 500 12px var(--sans); cursor: pointer; }
.ip-fix:hover { background: color-mix(in srgb, var(--violet) 20%, transparent); }
.ip-prob .ip-fix { float: right; margin: -4px 0 0; }
/* Krate knowledge in the editor: hover, completion, the API tab */
.kr-hov { padding: 8px 10px; max-width: 520px; display: grid; gap: 4px; }
.kr-hov code { font: 12px/1.5 ui-monospace, Menlo, monospace; color: var(--ink); white-space: pre-wrap; }
.kr-hov small { font: 11px var(--sans); color: var(--ink-4); }
#ideCode .cm-tooltip-autocomplete ul li { font: 12.5px ui-monospace, Menlo, monospace; padding: 3px 10px; }
#ideCode .cm-completionDetail { color: var(--ink-4); font-style: normal; margin-left: 10px; }
.api-mod { padding: 10px 14px 4px; font: 500 11.5px var(--sans); letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); }
.api-fn span { color: var(--ink-2); }
/* one box per open file's editor; only the current one shows */
#ideCode .kr-edhost { flex: 1; min-width: 0; height: 100%; display: flex; }
#ideCode .kr-edhost[hidden] { display: none; }
/* the IDE's tree menu, inline names, quick open and starters */
.ide-tree .th2 { display: flex; align-items: center; }
.ide-tree .th2 span { flex: 1; }
.th-new { width: 22px; height: 22px; border: 0; border-radius: 6px; display: grid; place-items: center; background: none; color: var(--ink-3); cursor: pointer; }
.th-new:hover { background: var(--hover); color: var(--ink); }
.ide-menu { position: fixed; z-index: 400; min-width: 180px; padding: 5px; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 18px 40px -14px rgba(0, 0, 0, .35); animation: krPopIn .18s var(--ease) both; }
.ide-menu button { display: block; width: 100%; height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: none; text-align: left; font: 13px var(--sans); color: var(--ink); cursor: pointer; }
.ide-menu button:hover { background: var(--hover); }
.ide-menu button.danger { color: var(--danger); }
.ide-menu .sep { height: 1px; margin: 4px 6px; background: var(--line); }
.tn-in { padding: 2px 8px; }
.tn-in input { width: 100%; height: 28px; padding: 0 9px; border: 0; border-radius: 7px; background: var(--surface); color: var(--ink); font: 12.5px ui-monospace, Menlo, monospace; outline: 0; box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-soft); }
.ide-qo { position: absolute; left: 50%; top: 14px; z-index: 7; width: min(520px, calc(100% - 32px)); transform: translateX(-50%); border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 24px 60px -20px rgba(0, 0, 0, .4); overflow: hidden; animation: krPopIn .2s var(--ease) both; }
.ide-qo input { width: 100%; height: 44px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: 14px var(--sans); outline: 0; }
.qo-list { max-height: 320px; overflow: auto; padding: 5px; }
.qo-list button { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 7px 11px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.qo-list button.on, .qo-list button:hover { background: var(--hover); }
.qo-list b { font: 500 13px var(--sans); color: var(--ink); } .qo-list small { font: 12px ui-monospace, Menlo, monospace; color: var(--ink-3); }
.qo-list p { margin: 10px 12px; font-size: 12.5px; color: var(--ink-3); }
.kr-np-kinds { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.kr-np-kinds label { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.kr-np-kinds label:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.kr-np-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.kr-np-kinds b { font: 500 13px var(--sans); color: var(--ink); } .kr-np-kinds small { font-size: 12px; color: var(--ink-3); }
@media (max-width: 560px) { .kr-np-kinds { grid-template-columns: 1fr; } }
.kr-newp .kr-np-kinds { flex-basis: 100%; }

/* Beta: Port and the IDE work and still have known limits; said where they are named. */
.kr-beta { display: inline-flex; align-items: center; height: 16px; margin-left: 6px; padding: 0 6px; border-radius: 999px; vertical-align: 1px; flex: none;
  font: 600 10px/1 var(--sans); letter-spacing: .03em; font-style: normal; color: var(--violet); background: color-mix(in srgb, var(--violet) 11%, transparent); }
body:not(.light) .kr-beta { color: #b8a6ff; background: color-mix(in srgb, #a891ff 16%, transparent); }
.home-tabs .kr-beta { margin-left: 5px; }
.ide-proj .kr-beta { margin-left: 0; }

/* Home's Port and IDE panes come in the way the design's do (facein). */
.home-idepane:not([hidden]) { animation: krPaneIn .35s var(--ease) both; }
.kr-ide-none, .kr-ide-more { grid-column: 1 / -1; margin: 4px 2px; font: 400 12.5px var(--sans); color: var(--ink-3); }

/* Reduced motion, everywhere: nothing loops and nothing travels. One rule
 * for the whole UI, so a new animation cannot forget it (the busy dot, the
 * Live dot and the thinking dots each did). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.ip-miss { margin: 2px 0 8px 22px; font: 400 12px var(--sans); color: var(--ink-3); }
.sess-more { display: block; width: 100%; margin: 2px 0 6px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; cursor: pointer; text-align: left; font: 500 12.5px var(--sans); color: var(--ink-3); }
.sess-more:hover { color: var(--ink); background: var(--hover); }
/* The gallery's own empty state says "nothing matches"; app.js's line would say it twice. */
#viewCloud.kr-galon #cloudError[data-kind="empty"] { display: none !important; }
/* A phone's panel bar: the four tabs, Run it and Share must fit side by
 * side (Run it sat under Share at 390, and Share ran off the edge at 320).
 * Run it keeps its play mark; at the narrowest Share keeps its icon. */
/* The panel bar is a row at every width: the narrow-window grid meant for
 * the conversation's title bar (three columns) put its four items on top
 * of each other. */
#viewSession .titlebar.panel-bar { display: flex; }
@media (max-width: 480px) {
  #viewSession #barRun { font-size: 0; gap: 0; padding: 0 11px; }
  #viewSession #barRun, #viewSession #barShare { flex: none; }
  #viewSession .panel-bar .ptabs { flex: none; }
  /* Only the open tab carries its word; the others are their icons. */
  #viewSession .ptabs button:not(.on) span { display: none; }
  #viewSession .ptabs button:not(.on) svg { display: inline-block; }
}
@media (max-width: 360px) {
  #viewSession #barShare { font-size: 0; gap: 0; padding: 0 11px; }
  #viewSession .ptabs button.on span { display: none; }
  #viewSession .ptabs button svg { display: inline-block; }
}
/* The Details and Files headers wrap whenever their buttons need the room,
 * not only on a phone: at 900 wide the two buttons spilled 7px past the panel. */
#paneFiles .pane-head, #paneDetails .dt2-head { flex-wrap: wrap; row-gap: 8px; }
/* A long name with no spaces wraps inside its gallery card instead of
 * widening it past a phone's screen. */
.kr-kcard, .kr-kcard .kmeta { min-width: 0; }
.kr-kcard .kmeta b, .kr-kcard .ksaid { overflow-wrap: anywhere; }
/* A long address wraps in "Check your email" rather than running out of the card. */
.kr-lg-hd p b { overflow-wrap: anywhere; }
/* Share Krate on a desktop: the invite link, without the browser's free-app rows. */
#planSheet.kr-shareonly .plan-list { display: none; }
#planSheet.kr-shareonly .ref-block > b { display: none; }
/* Reduced motion: the offline pill's mark stands still (it wobbled on). */
@media (prefers-reduced-motion: reduce) { .kr-netp .iso, .kr-netp.off .iso { animation: none !important; } }
/* The pills stay on a phone's screen: a long app name pushed one 27px past each edge at 390. */
.kr-netp { max-width: calc(100vw - 32px); box-sizing: border-box; }
.kr-netp .kr-swp, .kr-netp .kr-swp > span { min-width: 0; }
.kr-netp .kr-swp b, .kr-netp .kr-swp small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* No apps yet: no "Your apps" handle over an empty shelf. */
.shelf[data-empty="true"] .kr-shtog { display: none; }
/* A phone's done row: the file's name and line on top, Run, Share and More
 * under them (at 320 the name was squeezed to its first letter). */
@media (max-width: 420px) {
  .kr-fdone { flex-wrap: wrap; row-gap: 8px; }
  .kr-fdone .kr-dn { flex: 1 1 calc(100% - 46px); }
  .kr-fdone .kr-da { flex: 1 1 100%; display: flex; gap: 8px; }
  .kr-fdone .kr-da .btn { flex: 1; justify-content: center; }
}

/* ================================================================ phones
 * 2026-10-06: Studio on an iPhone. The session is one pane at a time
 * (redesign.js phoneSession): Chat, or the App with its tabs, each with the
 * whole screen. Edge to edge, no desktop window inset. */
.mob-switch { display: none; }
@media (max-width: 860px) {
  #viewSession .session-body { padding: 0; }
  #viewSession .rail-head {
    position: sticky; top: 0; z-index: 30; margin: 0; border-radius: 0;
    padding: calc(6px + env(safe-area-inset-top)) 10px 6px 6px; min-height: 52px;
    display: flex; align-items: center; gap: 4px; background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  #viewSession .rail-head .sess-title { min-width: 0; flex: 1 1 auto; }
  #viewSession .rail-head .sess-title .crumb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  #viewSession .rail-head .spacer { display: none; }
  #viewSession .rail-head .kr-ver { flex: none; }
  #viewSession .mob-switch {
    display: inline-flex; flex: none; padding: 3px; gap: 2px; border-radius: 999px;
    background: var(--film); border: 1px solid var(--line);
  }
  #viewSession .mob-switch button {
    appearance: none; border: 0; background: none; color: var(--muted); font: inherit;
    font-size: 13px; font-weight: 500; min-height: 34px; padding: 0 13px; border-radius: 999px;
    position: relative; cursor: pointer;
  }
  #viewSession .mob-switch button[aria-selected="true"] { background: var(--text); color: var(--bg); }
  #viewSession .mob-dot {
    display: none; position: absolute; top: 5px; right: 4px; width: 7px; height: 7px;
    border-radius: 50%; background: var(--blue, #6d8bff);
  }
  #viewSession .mob-switch.live .mob-dot, #viewSession .mob-switch.news .mob-dot { display: block; }
  #viewSession .mob-switch.live .mob-dot { animation: krMobPulse 1.4s ease-in-out infinite; }
  #viewSession .mob-switch button[aria-selected="true"] .mob-dot { display: none; }

  /* Chat: the conversation and its bar fill the screen. */
  #viewSession[data-mob="chat"] .panel { display: none; }
  #viewSession[data-mob="chat"] .thread { flex: 1 1 auto; min-height: 0; padding: 14px 14px 10px; }
  #viewSession .composer { padding: 6px 10px calc(8px + env(safe-area-inset-bottom)); }

  /* App: the panel, its tabs on their own row, the app below them. */
  #viewSession[data-mob="app"] .thread, #viewSession[data-mob="app"] .composer { display: none; }
  #viewSession[data-mob="app"] .panel {
    display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin: 0; border-radius: 0;
  }
  #viewSession[data-mob="app"] .panel-bar {
    position: static; flex: none; height: auto; min-height: 48px; padding: 7px 10px; gap: 8px;
    border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  }
  #viewSession[data-mob="app"] .ptabs { flex: none; }
  #viewSession[data-mob="app"] .panel-body {
    flex: 1 1 auto; height: auto; min-height: 0; margin: 0 10px calc(10px + env(safe-area-inset-bottom));
    overflow: auto; -webkit-overflow-scrolling: touch;
  }
  /* The stage was a 34dvh strip with its own scroll; here it is the pane. */
  #viewSession[data-mob="app"] .stage { height: auto; min-height: 0; max-height: none; border-bottom: 0; }
  #viewSession[data-mob="app"] .done-card .shot-stage img { max-height: calc(100dvh - 260px); }
  #viewSession[data-mob="app"] .done-meta .done-name, #viewSession[data-mob="app"] .done-meta .done-sub { display: block; }
}
/* A small phone gives the app's name the room the "draft" chip took. */
@media (max-width: 400px) { #viewSession .rail-head .kr-ver.draft { display: none; } }
@keyframes krMobPulse { 50% { opacity: .35; } }
/* No apps yet and the shelf shut (a phone): the shelf was an empty box,
   its only control faded out. Browse all stays, as it does on a desktop. */
#viewHome .shelf[data-empty="true"] .shelf-all { opacity: 1; pointer-events: auto; }
/* Settings on a phone is the whole screen: no rounded corners at its edges. */
@media (max-width: 600px) { #setSheet .set-modal { border-radius: 0; } }
/* "Finish <long app name>" gives way before its buttons do: at 320 the
   delete was pushed past the screen's edge. */
.apps-finish > span:first-child { min-width: 0; overflow: hidden; }
.apps-finish > span:first-child b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apps-finish .go, .apps-finish .apps-x { flex: none; }

/* ---- publishing: the app's gallery tile, made in front of you ----------
 * 2026-10-07. Replaces the ring of rotating words, the LIVE stamp and the
 * confetti. One tile carries all three moments: ready (it appears, a sheen
 * passes), up (it lifts, a bar fills along its foot, the bytes rise off it),
 * done (it settles; listed, its gallery neighbours slide in and a Live pill
 * lands; unlisted, a Link pill). The finished pane opens on the same tile. */
.kr-pub2 { text-align: center; padding: 4px 0 2px; }
.kr-pub2 .pc { margin: 14px 0 0; font-size: 13px; color: var(--ink-2); }
.kp-stage { position: relative; height: 176px; display: grid; place-items: center; }
.kp-tile {
  position: relative; z-index: 2; width: 172px; border-radius: 16px; overflow: hidden; text-align: left;
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair), 0 12px 32px -14px rgba(0, 0, 0, .45);
  animation: kpIn .55s var(--spring) backwards;
  transition: transform .7s var(--ease), box-shadow .7s var(--ease);
}
.kp-pic { position: relative; height: 104px; display: grid; place-items: center; overflow: hidden; background: var(--surface-2); }
.kp-pic img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.kp-pic .iso { width: 44px; height: 44px; }
.kp-sheen {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
  transform: translateX(-110%); animation: kpSheen 1.6s var(--ease) .25s infinite;
}
.kp-meta { padding: 9px 12px 11px; }
.kp-meta b { display: block; font: 500 13px var(--sans); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-meta small { display: block; margin-top: 1px; font-size: 11px; color: var(--ink-3); min-height: 14px; }
.kp-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; transition: opacity .4s var(--ease); }
.kp-bar i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.kp-live {
  position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 999px; font: 600 11px var(--sans); letter-spacing: .01em;
  color: #fff; background: rgba(12, 12, 14, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(-6px) scale(.8);
}
.kp-live > i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); }
.kp-live svg { width: 12px; height: 12px; }
.kp-ghost {
  position: absolute; z-index: 1; top: 50%; width: 132px; margin-top: -58px; border-radius: 14px; overflow: hidden;
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair); opacity: 0;
  transition: transform .7s var(--ease), opacity .6s var(--ease);
}
.kp-ghost i { display: block; height: 80px; background: linear-gradient(135deg, var(--surface-2), var(--surface-3)); }
.kp-ghost b { display: block; height: 7px; width: 60%; margin: 10px 12px 18px; border-radius: 4px; background: var(--surface-3); }
.kp-ghost.l { left: 50%; transform: translateX(-50%) scale(.9); }
.kp-ghost.r { right: 50%; transform: translateX(50%) scale(.9); }
.kp-up { position: absolute; left: 50%; top: 10px; width: 0; height: 0; z-index: 3; }
.kp-up i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: 0; }
.kp-up i:nth-child(1) { left: -40px; } .kp-up i:nth-child(2) { left: -22px; } .kp-up i:nth-child(3) { left: -6px; }
.kp-up i:nth-child(4) { left: 10px; } .kp-up i:nth-child(5) { left: 26px; } .kp-up i:nth-child(6) { left: 42px; }

/* up: the tile lifts and the bytes rise off it */
.kr-pub2[data-ph="up"] .kp-tile { transform: translateY(-6px); box-shadow: 0 0 0 1px var(--hair), 0 22px 40px -16px rgba(0, 0, 0, .5); }
.kr-pub2[data-ph="up"] .kp-up i { animation: kpRise 1.1s var(--ease) infinite; }
.kr-pub2[data-ph="up"] .kp-up i:nth-child(2) { animation-delay: .35s; } .kr-pub2[data-ph="up"] .kp-up i:nth-child(3) { animation-delay: .7s; }
.kr-pub2[data-ph="up"] .kp-up i:nth-child(4) { animation-delay: .15s; } .kr-pub2[data-ph="up"] .kp-up i:nth-child(5) { animation-delay: .55s; }
.kr-pub2[data-ph="up"] .kp-up i:nth-child(6) { animation-delay: .9s; }

/* done: it settles, the bar goes, the pill lands, the gallery appears */
.kr-pub2[data-ph="done"] .kp-tile { transform: none; animation: kpIn .55s var(--spring) backwards, kpSettle .6s var(--spring) both; }
.kr-pub2[data-ph="done"] .kp-sheen { animation: kpSheen .9s var(--ease) both; }
.kr-pub2[data-ph="done"] .kp-bar { opacity: 0; }
.kr-pub2[data-ph="done"] .kp-live { opacity: 1; transform: none; transition: opacity .2s, transform .5s var(--spring) .15s; }
.kr-pub2[data-ph="done"] .kp-live > i { animation: kpPing 1.6s var(--ease) .5s 2; }
.kr-pub2[data-ph="done"][data-listed="1"] .kp-ghost { opacity: .55; }
.kr-pub2[data-ph="done"][data-listed="1"] .kp-ghost.l { transform: translateX(calc(-50% - 156px)) scale(.9); }
.kr-pub2[data-ph="done"][data-listed="1"] .kp-ghost.r { transform: translateX(calc(50% + 156px)) scale(.9); }
@media (max-width: 420px) {
  .kr-pub2[data-ph="done"][data-listed="1"] .kp-ghost.l { transform: translateX(calc(-50% - 128px)) scale(.86); }
  .kr-pub2[data-ph="done"][data-listed="1"] .kp-ghost.r { transform: translateX(calc(50% + 128px)) scale(.86); }
}
.kr-pub2 .kp-stage { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 24%, #000 76%, transparent); mask-image: linear-gradient(90deg, transparent, #000 24%, #000 76%, transparent); }

/* the finished pane opens on the same tile, already settled */
.kr-pub2.kp-still .kp-tile, .kr-pub2.kp-still .kp-sheen, .kr-pub2.kp-still .kp-live > i { animation: none; }
.kr-pub2.kp-still .kp-live, .kr-pub2.kp-still .kp-ghost { transition: none; }
.kr-pub2.kp-still + .kr-pubdone b, .kr-pub2.kp-still + .kr-pubdone p { animation: kpUp .5s var(--ease) both; }
.kr-pub2.kp-still + .kr-pubdone p { animation-delay: .08s; }
.kr-pub2.kp-still + .kr-pubdone { padding-top: 0; }

@keyframes kpIn { from { opacity: 0; transform: translateY(10px) scale(.92); } }
@keyframes kpSettle { 0% { transform: translateY(-6px); } 60% { transform: translateY(2px); } 100% { transform: none; } }
@keyframes kpSheen { to { transform: translateX(110%); } }
@keyframes kpRise { 0% { opacity: 0; transform: translateY(0) scale(.6); } 25% { opacity: .9; } 100% { opacity: 0; transform: translateY(-34px) scale(1); } }
@keyframes kpPing { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 100% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } }
@keyframes kpUp { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  .kp-tile, .kp-sheen, .kp-up i, .kp-live > i, .kr-pub2.kp-still + .kr-pubdone b, .kr-pub2.kp-still + .kr-pubdone p { animation: none !important; }
  .kp-tile, .kp-ghost, .kp-live { transition: none !important; }
}

/* ---------------------------------------------------------------- company apps
 * IC-953: the apps a member's organisations released to them, under the box.
 * One card each: name, organisation and version, what it can do in one line,
 * Open. Two to a row on a wide window, one on a narrow one; every control
 * is at least 44px tall. Tokens only. */
.co-apps { margin-top: 26px; }
.co-apps .co-h { font-weight: 500; }
.co-note { margin: 0 4px 10px; font: 400 12.5px/1.45 var(--sans); color: var(--ink-2); }
.co-note[hidden] { display: none; }
.co-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.co-card { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 12px 12px 16px; border-radius: 14px; background: var(--surface-2); box-shadow: var(--sh-1); animation: krRv .6s var(--ease) both; }
.co-card.co-ask { grid-column: 1 / -1; }
.co-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.co-txt b { font: 500 13.5px var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-txt small { font: 400 12px var(--sans); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-can { font: 400 12px var(--sans); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-said { font: 400 12px/1.4 var(--sans); color: var(--ink-2); white-space: normal; }
.co-said:empty { display: none; }
.co-open { flex: none; min-height: 44px; min-width: 72px; padding: 0 18px; border: 0; border-radius: 99px; background: var(--btn); color: var(--btn-ink); font: 500 13.5px var(--sans); cursor: pointer; transition: background .2s, transform .15s var(--ease); }
.co-open:hover { background: var(--btn-hover); }
.co-open:active { transform: scale(.97); }
.co-open:disabled { opacity: .6; cursor: default; }
.co-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 860px) { .co-list { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .co-card { animation: none; } }

/* ---------------------------------------------------------------- start from a spreadsheet
 * G6: the line under the box, and its sheet. The file's columns (name over
 * kind) above its first rows, in a table that scrolls sideways inside the
 * sheet so a wide spreadsheet never widens the page. Tokens only. */
#viewHome .home-sheet { margin: 14px 0 0; text-align: center; font: 400 12.5px/1.5 var(--sans); color: var(--ink-3); }
#viewHome .home-sheet[hidden] { display: none; }
#viewHome .home-sheet a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--hair); }
#viewHome .home-sheet a:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
#sheetSheet .sheet-start { width: min(640px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); overflow-y: auto; text-align: left; }
#sheetSheet .sheet-start h2 { text-align: left; }
/* The sheet is a column that scrolls: nothing in it may shrink to fit, or
   the table (which scrolls sideways) collapses to nothing on a phone. */
#sheetSheet .sheet-start > * { flex-shrink: 0; }
#sheetSheet .sheet-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 16px 0 12px; }
#sheetSheet .sheet-pick .btn { min-height: 44px; padding: 0 18px; }
#sheetSheet .sheet-file { min-width: 0; font: 400 12.5px/1.45 var(--sans); color: var(--ink-2); overflow-wrap: anywhere; }
#sheetSheet .pub-label { color: var(--ink-2); }
#sheetSheet .pub-label input, #sheetSheet .pub-label select { display: block; width: 100%; margin-top: 6px; min-height: 44px; padding: 0 12px; font-size: 14px; }
#sheetSheet .sheet-problem { margin: 4px 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); font: 400 13px/1.5 var(--sans); color: var(--ink); }
#sheetSheet .sheet-cols { margin: 4px 0 16px; max-width: 100%; overflow-x: auto; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--hair); }
#sheetSheet .sheet-table { border-collapse: collapse; min-width: 100%; font: 400 12.5px/1.4 var(--sans); color: var(--ink); }
#sheetSheet .sheet-table th, #sheetSheet .sheet-table td { padding: 8px 12px; text-align: left; vertical-align: top; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--hair); }
#sheetSheet .sheet-table th { background: var(--surface-2); font-weight: 500; }
#sheetSheet .sheet-table th b { display: block; font-weight: 500; }
#sheetSheet .sheet-kind { display: block; margin-top: 2px; font: 400 11.5px var(--sans); color: var(--ink-3); }
#sheetSheet .sheet-table tr:last-child td { border-bottom: 0; }
#sheetSheet .sheet-more { margin: 0; padding: 8px 12px; font: 400 12px/1.45 var(--sans); color: var(--ink-3); position: sticky; left: 0; }
#sheetSheet .detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#sheetSheet .detail-actions .btn { min-height: 44px; padding: 0 18px; }
/* The release note, under an organisation's row in the Send menu (G5). */
.pop .pop-note { display: flex; gap: 6px; align-items: center; padding: 4px 6px 8px 12px; }
.pop .pop-note input { flex: 1; min-width: 0; min-height: 36px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); color: var(--ink); font: 400 13px var(--sans); }
.pop .pop-note input:focus { outline: none; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, var(--hair)); }
.pop .pop-note .btn { flex: none; width: auto; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--btn); color: var(--btn-ink); font: 500 13px var(--sans); justify-content: center; }
.pop .pop-note .btn:hover { background: var(--btn-hover); }

/* ---- one look per state (2026-11-21) -----------------------------------
 * Hover, pressed, current and focus come from the state tokens at the top
 * of this file. Before, one screen used four greys for a hover (surface-2,
 * surface-3, surface-3 at 60%, a white film) and the current row was a
 * raised card in light and a second grey box in dark.
 *
 * Pressed: a control under the press swaps its own hover film for the
 * pressed one, so every hover rule above gets a pressed state with no
 * rule of its own. */
:is(button, [role="button"], [role="menuitem"], [role="tab"], .side-row, .side-search, .sess-row, .f-row, .code-file, .kr-pi):active { --hover: var(--pressed); }
/* The keyboard's place: an accent ring inside the control, so a list or
   a scroller never clips it and nothing around it moves. */
:is(button, [role="button"], [role="menuitem"], [role="tab"], [role="option"], .sess-row, summary):focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
a[href]:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .kr-ind, .kr-nind, .kr-thumb, .side-row, .side-search, .sess-row, .side-card, .side-avatar, .side-bell, .side-mark, .side-toggle,
  .kr-pi, .pop button, .set-nav button, .code-file, .ide-tree .tn, .ptabs button, .cloud-cats .cat, .kr-cats button, .kr-sorts button { transition: none !important; }
}

/* ---- a thumb needs 44 (2026-11-07) ------------------------------------
 * style.css raises Studio's controls to 44 on a touch screen, but this
 * design layer sets fixed heights of its own later in the cascade, so on a
 * phone they came back at 28-34: the panel's Preview/Files/Code/Details
 * tabs 28 tall, the card's Run and Share 30, Chat/App 34, the session
 * title 32, the gallery's sort chips 30, and the "Details" and "Download
 * the project" links 16-18. Measured in an emulated phone at 390 x 700.
 * Last in the file so it wins on order; touch only, so a desktop keeps its
 * density. Small text links keep their look and grow an invisible hit area
 * instead, so the lines around them do not move. */
@media (pointer: coarse) {
  #viewSession .ptabs button, #viewSession .mob-switch button,
  #viewSession .sess-title, #viewSession #barRun, #viewSession #barShare,
  #viewSession .btn.btn-sm, .kr-da .btn, .kr-shtog, .kr-mode { height: 44px; min-height: 44px; }
  /* The app's Run and Share, the two buttons a thumb is here for: read at
     the phone's type floor, not the desktop's 13px. */
  .kr-da .btn { font-size: 14.5px; }
  /* A message's own buttons (Make this instead, Try again, Build it). */
  #thread .msg-actions .btn { height: 44px; min-height: 44px; padding: 0 16px; font-size: 14.5px; }
  /* The card's own buttons when a build fails or runs (Try again, Report
     an issue, Details, Stop). */
  #stage .kr-forge .kr-facts2 .btn, #stage .kr-forge .kr-facts .btn { height: 44px; min-height: 44px; font-size: 14.5px; }
  #viewSession #barRun, #viewSession #barShare, #viewSession .ptabs button { min-width: 44px; }
  #paneFiles .f-row > button, #setNav button { min-height: 44px; }
  .kr-fmore { width: 44px; height: 44px; }
  #viewCloud .link-btn { min-height: 44px; }
  /* The chips sit in a scrolling row, which would clip a hit area drawn
     outside them, so they grow for real. */
  .kr-cats button, .kr-sorts button { height: 44px; min-width: 44px; }
  .dt2-link, #thread .thought-head, [data-fa="details"] { position: relative; }
  .dt2-link::after, #thread .thought-head::after, [data-fa="details"]::after {
    content: ""; position: absolute; left: 0; right: 0; top: 50%;
    height: 44px; transform: translateY(-50%);
  }
  .set-input { min-height: 44px; }
}
