/* Sinister Proxy dashboard, built from the "Sinister Proxy" Claude Design canvas.
   Refract tokens and component styles first, then the page layout.
   Dark is the default; app.js puts .theme-light on <html> for the light theme. */

/* Geist and Geist Mono (SIL Open Font License, see fonts/OFL.txt), latin subset, served by this app */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist-mono.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Tokens ────────────────────────────────────────────────────────────────── */
:root {
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px;
  --radius-sm: 10px; --radius-md: 18px; --radius-lg: 26px; --radius-xl: 36px; --radius-full: 999px;
  --blur-thin: 12px; --blur-regular: 24px; --blur-thick: 44px; --glass-saturation: 180%;
  --rf-spring: cubic-bezier(.34, 1.45, .5, 1);
  --rf-ease: cubic-bezier(.32, .72, 0, 1);
}

:root, .theme-dark {
  color-scheme: dark;
  --canvas: #0b0c10;
  --ambient-coral: #b8432c; --ambient-amber: #a8700e; --ambient-teal: #0f7a70; --ambient-sky: #2457b0;
  --glass-regular: #1c1e26a6; --glass-thick: #17181ed9; --glass-clear: #ffffff14;
  --glass-raised: #ffffff2e; --glass-selection: #00000040; --glass-highlight: #ffffff66;
  --glass-sheen: #ffffff1f; --glass-lowlight: #ffffff0f; --surface-solid: #1c1d23;
  --hairline: #ffffff1f;
  --ink: #f5f6f8; --ink-secondary: #c9ccd4; --ink-tertiary: #a9adb7;
  --accent: #5aaeff; --on-accent: #04121f; --accent-tint: #5aaeffeb; --accent-soft: #5aaeff29;
  --control-on: #4a90f0; --control-track: #ffffff66; --control-knob: #ffffff;
  --critical: #ff8f7a; --positive: #4fd39a; --focus: #7cc0ff; --scrim: #00000073;
  --glass-rim: inset 0 1px 0 0 #ffffff4d, inset 0 -1px 0 0 #ffffff14, inset 0 0 0 1px #ffffff1f, inset 0 0 20px 0 #ffffff0d;
  --glass-lift: 0 1px 2px #00000080, 0 10px 28px -8px #000000b3;
  --glass-float: 0 2px 6px #00000080, 0 24px 56px -12px #000000cc;
  --knob-shadow: 0 1px 2px #00000099, 0 3px 8px #00000066;
  --focus-ring: 0 0 0 2px #0b0c10, 0 0 0 4px #7cc0ff;
}

.theme-light {
  color-scheme: light;
  --canvas: #eceef2;
  --ambient-coral: #ff7a5c; --ambient-amber: #ffc94a; --ambient-teal: #2fc6b4; --ambient-sky: #72b6ff;
  --glass-regular: #ffffff8c; --glass-thick: #ffffffc7; --glass-clear: #ffffff26;
  --glass-raised: #ffffffe6; --glass-selection: #ffffff99; --glass-highlight: #ffffffe6;
  --glass-sheen: #ffffff8c; --glass-lowlight: #ffffff40; --surface-solid: #f7f8fa;
  --hairline: #3c3f4a29;
  --ink: #0d0e12; --ink-secondary: #3a3d46; --ink-tertiary: #4b4f59;
  --accent: #004fbf; --on-accent: #ffffff; --accent-tint: #004fbfeb; --accent-soft: #004fbf1f;
  --control-on: #004fbf; --control-track: #30333e99; --control-knob: #ffffff;
  --critical: #ab2510; --positive: #075c39; --focus: #004fbf; --scrim: #0a0c1238;
  --glass-rim: inset 0 1px 0 0 #ffffffe6, inset 0 -1px 0 0 #ffffff40, inset 0 0 0 1px #ffffff59, inset 0 0 20px 0 #ffffff26;
  --glass-lift: 0 1px 2px #0a0c1214, 0 8px 24px -6px #0a0c1233;
  --glass-float: 0 2px 6px #0a0c121a, 0 18px 48px -10px #0a0c1240;
  --knob-shadow: 0 1px 2px #0a0c1229, 0 3px 8px #0a0c121f;
  --focus-ring: 0 0 0 2px #ffffff, 0 0 0 4px #004fbf;
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input { font: inherit; }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }
.sp-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── Glass material ────────────────────────────────────────────────────────── */
.rf-glass {
  --rf-fill: var(--glass-regular);
  --rf-blur: var(--blur-regular);
  --rf-drop: var(--glass-lift);
  position: relative;
  isolation: isolate;
  color: var(--ink);
  background: var(--rf-fill);
  -webkit-backdrop-filter: blur(var(--rf-blur)) saturate(var(--glass-saturation));
  backdrop-filter: blur(var(--rf-blur)) saturate(var(--glass-saturation));
  box-shadow: var(--glass-rim), var(--rf-drop);
}
/* sheen: a soft top-left glow and a bottom bounce, under the content */
.rf-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 16% -20%, var(--glass-sheen) 0%, transparent 58%),
    linear-gradient(to top, var(--glass-lowlight) 0%, transparent 38%);
}
/* rim: specular light, brightest at the top-left and bottom-right corners */
.rf-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  padding: 1px;
  background: linear-gradient(135deg, var(--glass-highlight) 0%, transparent 30%, transparent 70%, var(--glass-highlight) 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);
}
.rf-glass--thick { --rf-fill: var(--glass-thick); --rf-blur: var(--blur-thick); }
.rf-glass--clear { --rf-fill: var(--glass-clear); --rf-blur: var(--blur-thin); }
.rf-glass--float { --rf-drop: var(--glass-float); }

.rf-r-md { border-radius: var(--radius-md); }
.rf-r-xl { border-radius: var(--radius-xl); }
.rf-r-full { border-radius: var(--radius-full); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .rf-glass { --rf-fill: var(--glass-thick); }
}
@media (prefers-reduced-transparency: reduce) {
  .rf-glass { --rf-fill: var(--surface-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ── Icon ──────────────────────────────────────────────────────────────────── */
.rf-icon {
  display: inline-block;
  flex: none;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rf-icon--bold { stroke-width: 2; }

/* ── Button ────────────────────────────────────────────────────────────────── */
.rf-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .5s var(--rf-spring), filter .2s var(--rf-ease), box-shadow .2s var(--rf-ease), background-color .2s var(--rf-ease);
}
.rf-btn:hover { filter: brightness(1.04); }
.rf-btn:active { transform: scale(1.06); filter: brightness(1.1) saturate(1.1); }
.rf-btn:focus-visible { outline: none; box-shadow: var(--glass-rim), var(--rf-drop), var(--focus-ring); }
.rf-btn--sm { height: 32px; padding: 0 14px; font-size: 13px; line-height: 18px; gap: 6px; }
.rf-btn--lg { height: 52px; padding: 0 var(--space-6); font-size: 17px; line-height: 22px; }
.rf-btn--circle { width: 44px; padding: 0; }
.rf-btn--circle.rf-btn--sm { width: 32px; }
.rf-btn--tinted { --rf-fill: var(--accent-tint); color: var(--on-accent); }
.rf-btn--plain {
  background: transparent;
  box-shadow: none;
  color: var(--accent);
  padding: 0 var(--space-3);
}
.rf-btn--plain:hover { background: var(--glass-selection); filter: none; }
.rf-btn--plain:focus-visible { box-shadow: var(--focus-ring); }

/* ── Segmented control ─────────────────────────────────────────────────────── */
.rf-seg {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  min-width: 240px;
  height: 40px;
  padding: 3px;
  border-radius: var(--radius-full);
}
.rf-seg__thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / var(--n, 2));
  border-radius: var(--radius-full);
  background: var(--glass-raised);
  box-shadow: var(--glass-rim), var(--knob-shadow);
  transform: translateX(calc(100% * var(--i, 0)));
  transition: transform .55s var(--rf-spring), scale .35s var(--rf-spring);
  pointer-events: none;
}
.rf-seg:active .rf-seg__thumb { scale: 1.04 1.1; }
.rf-seg__item {
  appearance: none;
  border: 0;
  margin: 0;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 var(--space-3);
  background: transparent;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color .2s var(--rf-ease);
  -webkit-tap-highlight-color: transparent;
}
.rf-seg__item[aria-checked="true"] { color: var(--ink); }
.rf-seg__item:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── Switch ────────────────────────────────────────────────────────────────── */
.rf-switch { display: inline-flex; align-items: center; flex: none; }
.rf-switch__track {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  position: relative;
  flex: none;
  width: 64px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--control-track);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s var(--rf-ease);
}
.rf-switch__track[aria-checked="true"] { background: var(--control-on); }
.rf-switch__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 38px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--control-knob);
  box-shadow: var(--knob-shadow);
  transition: transform .5s var(--rf-spring), scale .35s var(--rf-spring), background-color .2s var(--rf-ease), box-shadow .2s var(--rf-ease);
}
.rf-switch__track[aria-checked="true"] .rf-switch__knob { transform: translateX(22px); }
/* pressed: the knob turns to a glass droplet and swells */
.rf-switch__track:active .rf-switch__knob {
  scale: 1.32 1.5;
  background: var(--glass-clear);
  -webkit-backdrop-filter: blur(2px) saturate(var(--glass-saturation));
  backdrop-filter: blur(2px) saturate(var(--glass-saturation));
  box-shadow: var(--glass-rim), var(--knob-shadow);
}
.rf-switch__track:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── Search field ──────────────────────────────────────────────────────────── */
.rf-search {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 260px;
  height: 44px;
  padding: 0 var(--space-2) 0 14px;
  border-radius: var(--radius-full);
  color: var(--ink-secondary);
  cursor: text;
}
.rf-search:focus-within { box-shadow: var(--glass-rim), var(--rf-drop), var(--focus-ring); }
.rf-search__input {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  margin: 0;
  padding: 0;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 24px;
  letter-spacing: -0.008em;
  color: var(--ink);
}
.rf-search__input::placeholder { color: var(--ink-tertiary); opacity: 1; }
.rf-search__input::-webkit-search-cancel-button,
.rf-search__input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.rf-search__clear {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--ink-tertiary);
  cursor: pointer;
}
.rf-search__clear:hover { background: var(--glass-selection); color: var(--ink-secondary); }
.rf-search__clear:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── Tab bar ───────────────────────────────────────────────────────────────── */
.rf-tabbar {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(72px, 1fr);
  height: 62px;
  padding: 4px;
  border-radius: var(--radius-full);
}
.rf-tabbar__lens {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / var(--n, 3));
  border-radius: var(--radius-full);
  background: var(--glass-selection);
  box-shadow: var(--glass-rim);
  transform: translateX(calc(100% * var(--i, 0)));
  transition: transform .6s var(--rf-spring), scale .35s var(--rf-spring);
  pointer-events: none;
}
.rf-tabbar:active .rf-tabbar__lens { scale: 1.06 1.12; }
.rf-tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-secondary);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color .2s var(--rf-ease);
}
.rf-tab:hover { color: var(--ink); }
.rf-tab[aria-current="page"] { color: var(--accent); }
.rf-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── Stage: wallpaper, dot texture, header, dock ───────────────────────────── */
.sp-wallpaper {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(52% 64% at 50% -8%, var(--ambient-coral) 0%, transparent 72%),
    radial-gradient(30% 46% at -4% 104%, var(--ambient-coral) 0%, transparent 70%),
    radial-gradient(40% 60% at 104% 104%, var(--ambient-sky) 0%, transparent 70%),
    var(--canvas);
}
.sp-stage {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px 32px 0;
}
/* Fine dot texture over the wallpaper so the blur behind glass reads */
.sp-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--hairline) 1.2px, transparent 1.7px);
  background-size: 14px 14px;
}

.sp-header {
  width: 100%;
  max-width: 1280px;
  min-height: 60px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.sp-brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  line-height: 24px;
  letter-spacing: -0.02em;
}
.sp-brand__name { font-weight: 700; }
.sp-brand__sub { font-weight: 500; color: var(--ink-secondary); }
.sp-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.sp-status {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px 0 12px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  white-space: nowrap;
}
.sp-status__dot { color: var(--ink-tertiary); }
.sp-status__engine { color: var(--ink-secondary); }

/* Dashboard reachability; this is not an upstream compatibility guarantee. */
.sp-state { display: flex; align-items: center; gap: 4px; flex: none; color: var(--ink-secondary); }
.sp-state[data-state="online"] { color: var(--positive); }
.sp-state[data-state="offline"] { color: var(--critical); }
.sp-state--lg { font-size: 15px; line-height: 20px; font-weight: 600; }

.sp-dock {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 16px 0 24px;
  pointer-events: none;
}
.sp-dock > * { pointer-events: auto; }

/* ── Views ─────────────────────────────────────────────────────────────────── */
.sp-view {
  flex: 1 0 auto;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.sp-page { gap: 32px; padding: 40px 0 48px; }
.sp-page--bookmarks { max-width: 880px; }
.sp-page--settings { max-width: 1120px; }

.sp-title { margin: 0; font-size: 34px; line-height: 40px; font-weight: 700; letter-spacing: -0.025em; }
.sp-eyebrow { margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-secondary); }
.sp-error { margin: 0; padding: 0 4px; font-size: 15px; line-height: 20px; color: var(--critical); }
.sp-error:empty { display: none; }
.sp-w-full { width: 100%; }

/* Browse */
.sp-browse { max-width: 760px; justify-content: center; gap: 40px; padding: 48px 0; }
.sp-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.sp-display { margin: 0; font-size: 56px; line-height: 60px; font-weight: 700; letter-spacing: -0.035em; }
.sp-lede { margin: 0; font-size: 17px; line-height: 24px; letter-spacing: -0.008em; color: var(--ink-secondary); text-wrap: pretty; }
.sp-searchbox { display: flex; flex-direction: column; gap: 12px; }
.sp-searchrow { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sp-searchrow .rf-search { flex: 1 1 360px; min-width: 0; }
.sp-search-lg { height: 52px; padding-left: 18px; }

.sp-shortcuts { display: flex; flex-direction: column; gap: 16px; }
.sp-shortcuts__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 32px; }
.sp-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(96px, 100%), 1fr));
  gap: 16px 8px;
}
.sp-tiles__item { position: relative; display: flex; justify-content: center; }
.sp-tile {
  appearance: none;
  border: 0;
  margin: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 96px;
  padding: 4px 0;
  border-radius: var(--radius-md);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .5s var(--rf-spring);
}
.sp-tile:hover { color: var(--ink); }
.sp-tile:active { transform: scale(1.06); }
.sp-tile:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sp-tile__disc {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--ink);
}
.sp-tile__disc--add { color: var(--ink-secondary); }
.sp-tile__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-tile__remove {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 0;
  left: calc(50% + 14px);
  z-index: 2;
  display: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--surface-solid);
  box-shadow: var(--glass-rim), var(--knob-shadow);
  color: var(--ink);
  cursor: pointer;
}
/* a bigger touch target than the badge it draws */
.sp-tile__remove::before { content: ""; position: absolute; inset: -9px; }
.sp-tile__remove:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sp-tiles[data-editing] .sp-tile__remove { display: grid; }
.sp-tiles[data-editing] .sp-tile--site { cursor: default; }
.sp-tiles[data-editing] .sp-tile--site:active { transform: none; }

/* Bookmarks */
.sp-pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.sp-pagehead__tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sp-bm-search { width: 300px; max-width: 100%; }
.sp-folder-seg { width: 440px; max-width: 100%; }
.sp-sections { display: flex; flex-direction: column; gap: 32px; }
.sp-group { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sp-group__title { margin: 0; padding: 0 4px; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.018em; }
.sp-panel { display: block; width: 100%; }
.sp-empty { margin: 0; padding: 24px 20px; font-size: 15px; line-height: 20px; color: var(--ink-secondary); text-wrap: pretty; }

.sp-bm-list { list-style: none; margin: 0; padding: 8px 0; }
.sp-bm-row { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 12px 12px 20px; }
.sp-initial {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--glass-raised);
  box-shadow: var(--glass-rim);
  font-size: 17px;
  line-height: 22px;
  font-weight: 700;
  color: var(--ink);
}
.sp-bm-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-row-link {
  align-self: flex-start;
  max-width: 100%;
  border-radius: 6px;
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-row-link:hover { color: var(--accent); }
.sp-row-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sp-bm-row__url {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-bm-row__tag { flex: none; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-secondary); }

/* Hairlines between rows inside a glass panel */
.sp-rows { padding: 4px 0; }
.sp-rows > * { position: relative; }
.sp-rows > * + *::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: var(--hairline);
}
.sp-rows--inset > * + *::before { left: 76px; }

/* Settings */
.sp-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr));
  gap: 32px 24px;
  align-items: start;
}
.sp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  min-height: 72px;
  padding: 16px 20px;
}
.sp-row--stack { flex-direction: column; align-items: stretch; justify-content: flex-start; flex-wrap: nowrap; gap: 12px; }
.sp-row--bare { min-height: 0; padding: 0 4px; }
.sp-row__text { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-row__text--short { flex-basis: 120px; }
.sp-row--stack .sp-row__text { flex: none; }
.sp-row__title { font-size: 17px; line-height: 24px; letter-spacing: -0.008em; color: var(--ink); }
.sp-row__title--strong { line-height: 22px; font-weight: 600; letter-spacing: -0.012em; }
.sp-row__hint { font-size: 15px; line-height: 20px; letter-spacing: -0.005em; color: var(--ink-secondary); text-wrap: pretty; }
.sp-row__actions { flex: none; display: flex; align-items: center; gap: 8px; }
.sp-theme-seg { width: 280px; max-width: 100%; }
.sp-footnote { margin: 0; padding: 0 4px; max-width: 640px; font-size: 13px; line-height: 18px; color: var(--ink-tertiary); text-wrap: pretty; }
.sp-footnote--center { margin: 0 auto; text-align: center; }
.sp-inline-link { color: var(--accent); text-underline-offset: 2px; border-radius: 4px; }
.sp-inline-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── Access keys ───────────────────────────────────────────────────────────── */
/* Nothing shows until the first status check says whether a key is needed. */
body.is-loading .sp-view, body.is-loading .sp-dock { visibility: hidden; }
.sp-access__card { width: 100%; max-width: 520px; margin: 0 auto; }
.sp-dialog__actions--start { justify-content: flex-start; }
.sp-access__help { position: relative; gap: 8px; padding-top: 20px; }
.sp-access__help::before { content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 1px; background: var(--hairline); }
.sp-access__help .sp-dialog__actions:has(> [hidden]:only-child) { display: none; }
.sp-code { padding: 1px 6px; border-radius: 6px; background: var(--glass-selection); font-family: var(--font-mono); font-size: 0.9em; color: var(--ink); }
.sp-keybox { display: flex; flex-direction: column; gap: 8px; }
.sp-keybox__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sp-keybox__key {
  flex: 1 1 240px;
  min-width: 0;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--glass-selection);
  box-shadow: var(--glass-rim);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 20px;
  color: var(--ink);
  overflow-wrap: anywhere;
  user-select: all;
}
.rf-btn--critical { color: var(--critical); }
.rf-btn:disabled { opacity: .45; cursor: default; transform: none; filter: none; }

/* Admin rows wrap their actions under the details on narrow screens */
.sp-admin-row { flex-wrap: wrap; align-items: flex-start; }
.sp-admin-row .sp-bm-row__text { flex: 1 1 260px; }
.sp-admin-row .sp-initial { margin-top: 2px; }
.sp-admin-row__meta { font-size: 13px; line-height: 18px; color: var(--ink-tertiary); overflow-wrap: anywhere; }
.sp-admin-row__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* ── Text field on the glass recipe (Refract has no text-field component) ─── */
.sp-fieldset { display: flex; flex-direction: column; gap: 8px; }
.sp-label { padding: 0 4px; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--ink-secondary); }
.sp-field { display: flex; align-items: center; height: 44px; padding: 0 20px; }
.sp-field:focus-within { box-shadow: var(--glass-rim), var(--glass-lift), var(--focus-ring); }
.sp-input {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 24px;
  letter-spacing: -0.008em;
  color: var(--ink);
}
.sp-input--mono { font-family: var(--font-mono); font-size: 15px; letter-spacing: 0; }
.sp-input::placeholder { color: var(--ink-tertiary); opacity: 1; }

/* ── Dialog ────────────────────────────────────────────────────────────────── */
dialog.sp-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(480px, calc(100% - 32px));
  max-width: none;
  height: fit-content;
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  overflow: auto;
  color: var(--ink);
}
.sp-dialog::backdrop {
  background: var(--scrim, #00000073);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.sp-dialog__form { display: flex; flex-direction: column; gap: 20px; padding: 24px; }
.sp-dialog__title { margin: 0; padding: 0 4px; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.018em; }
.sp-dialog__actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 4px; }

/* ── Bookmark menu ─────────────────────────────────────────────────────────── */
.sp-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  min-width: 220px;
  padding: 6px;
  display: flex;
  flex-direction: column;
}
.sp-menu__item {
  appearance: none;
  border: 0;
  margin: 0;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.sp-menu__item:hover, .sp-menu__item:focus-visible { outline: none; background: var(--accent-soft); }
.sp-menu__item--critical { color: var(--critical); }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.sp-toast {
  position: fixed;
  left: 50%;
  bottom: 112px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 32px);
  min-height: 44px;
  padding: 10px 20px;
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px);
  transition: opacity .2s var(--rf-ease), transform .5s var(--rf-spring), visibility 0s linear .2s;
}
.sp-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity .2s var(--rf-ease), transform .5s var(--rf-spring);
}
.sp-toast__action { margin: -6px -12px -6px 0; }

/* ── Small screens ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .sp-stage { padding: 12px 16px 0; }
  .sp-browse { gap: 32px; padding: 32px 0; }
  .sp-display { font-size: 44px; line-height: 48px; }
  .sp-lede { font-size: 15px; line-height: 22px; }
  .sp-searchrow { flex-wrap: nowrap; gap: 8px; }
  .sp-searchrow .rf-search { flex: 1 1 0; }
  .sp-page { gap: 24px; padding: 24px 0 32px; }
  .sp-title { font-size: 28px; line-height: 34px; }
  .sp-group__title { font-size: 20px; line-height: 26px; }
  .sp-pagehead__tools { width: 100%; flex-wrap: nowrap; gap: 8px; }
  .sp-bm-search { flex: 1 1 0; width: auto; min-width: 0; }
  .rf-seg__item { padding: 0 6px; font-size: 12px; }
  .sp-row { padding: 16px; }
  .sp-rows > * + *::before { left: 16px; right: 16px; }
  .sp-bm-row { padding-left: 16px; padding-right: 8px; }
  .sp-rows--inset > * + *::before { left: 72px; }
  .sp-dialog__form { padding: 20px 16px; }
}
@media (max-width: 480px) {
  .sp-status__extra { display: none; }
  .rf-seg__item { padding: 0 2px; letter-spacing: -0.01em; }
  .sp-pagehead__tools .rf-btn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .sp-pagehead__tools .rf-btn { width: 44px; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .rf-btn, .rf-seg__thumb, .rf-switch__knob, .rf-tabbar__lens, .sp-tile, .sp-toast { transition-duration: .01ms; }
  .rf-btn:active, .sp-tile:active { transform: none; }
}
/* Long destinations remain readable in the admin activity list. */
.sp-log-destination { overflow-wrap: anywhere; white-space: normal; }
