:root {
  color-scheme: dark;
  --ink: #0b0c0f;
  --ink-2: #111318;
  --ink-3: #191c22;
  --paper: #f2efe7;
  --paper-muted: #b9b8b3;
  --line: rgba(242, 239, 231, 0.13);
  --line-strong: rgba(242, 239, 231, 0.26);
  --coral: #ff6b57;
  --coral-hot: #ff4934;
  --cyan: #63d9dd;
  --lime: #d5ff68;
  --violet: #8d83ff;
  --rail-width: 248px;
  --topbar-height: 76px;
  --radius: 18px;
  --radius-small: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  --font-sans: "BIZ UDPGothic", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-display: "Arial Narrow", "Roboto Condensed", "BIZ UDPGothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 78% 9%, rgba(99, 217, 221, 0.08), transparent 26rem),
    radial-gradient(circle at 20% 92%, rgba(255, 107, 87, 0.07), transparent 30rem),
    var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.22;
  background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(8.333vw - 1px), rgba(255,255,255,.028) calc(8.333vw - 1px), rgba(255,255,255,.028) 8.333vw);
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  border: 0;
}

a {
  color: inherit;
}

svg {
  width: 1.2em;
  height: 1.2em;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

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

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 9px 13px;
  color: var(--ink);
  background: var(--paper);
  border-radius: 6px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
  padding-left: var(--rail-width);
}

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--rail-width);
  flex-direction: column;
  padding: 28px 18px 20px;
  background: rgba(10, 11, 14, 0.96);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 52px;
  padding: 0 10px 24px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup strong,
.brand-lockup span {
  display: block;
}

.brand-lockup strong {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.18em;
}

.brand-lockup > div > span {
  margin-top: 6px;
  color: #888c94;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  overflow: hidden;
  background: var(--coral);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.brand-mark i {
  position: absolute;
  width: 23px;
  height: 2px;
  background: var(--ink);
}

.brand-mark i:first-child { transform: translateY(-6px) rotate(22deg); }
.brand-mark i:nth-child(2) { transform: rotate(-17deg); }
.brand-mark i:last-child { transform: translateY(7px) rotate(12deg); }

.rail-nav {
  display: grid;
  gap: 5px;
  margin-top: 25px;
}

.rail-link {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  color: #8e929b;
  text-align: left;
  background: transparent;
  border-radius: 9px;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.rail-link:hover {
  color: var(--paper);
  background: rgba(255,255,255,.045);
  transform: translateX(2px);
}

.rail-link.is-active {
  color: var(--paper);
  background: rgba(255,255,255,.075);
}

.rail-link.is-active::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -18px;
  width: 3px;
  content: "";
  background: var(--coral);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 20px rgba(255, 107, 87, .55);
}

.rail-link svg { font-size: 17px; }
.rail-link span { font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.rail-link em {
  min-width: 22px;
  padding: 1px 6px;
  color: var(--ink);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
  background: var(--cyan);
  border-radius: 999px;
}

.rail-foot {
  display: grid;
  gap: 16px;
  margin-top: auto;
}

.connection-orbit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.connection-orbit > span {
  position: relative;
  width: 10px;
  height: 10px;
  background: #777b84;
  border-radius: 50%;
}

.connection-orbit > span::after {
  position: absolute;
  inset: -5px;
  content: "";
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: .35;
  animation: orbit-pulse 2.3s ease-out infinite;
}

.connection-orbit[data-state="online"] > span { color: var(--cyan); background: var(--cyan); }
.connection-orbit[data-state="offline"] > span { color: var(--coral); background: var(--coral); }
.connection-orbit strong,
.connection-orbit small { display: block; }
.connection-orbit strong { font-size: 9px; letter-spacing: .12em; }
.connection-orbit small { margin-top: 2px; color: #7d818a; font-size: 10px; }

.deerflow-signature {
  color: #5f6269;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: .12em;
  text-decoration: none;
}

.deerflow-signature:hover { color: var(--paper-muted); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(170px, .75fr) minmax(260px, 1.15fr) auto;
  align-items: center;
  min-height: var(--topbar-height);
  padding: 0 clamp(24px, 3vw, 54px);
  background: rgba(11, 12, 15, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

.workspace-crumb span,
.workspace-crumb strong { display: block; }
.workspace-crumb span { color: #666a72; font-family: var(--font-display); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.workspace-crumb strong { margin-top: 2px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.global-search {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  width: min(100%, 540px);
  min-height: 42px;
  padding: 0 11px;
  justify-self: center;
  color: #7f838c;
  background: #13151a;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.global-search:focus-within { border-color: rgba(99,217,221,.55); box-shadow: 0 0 0 3px rgba(99,217,221,.08); }
.global-search input { width: 100%; border: 0; outline: 0; color: var(--paper); background: transparent; }
.global-search input::placeholder { color: #666a72; }
.global-search kbd { padding: 2px 7px; color: #686c74; font-size: 9px; background: #0c0e11; border: 1px solid var(--line); border-radius: 5px; }

.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }

.theme-toggle {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--paper-muted);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
}

.theme-toggle:hover { color: var(--paper); background: rgba(255,255,255,.05); transform: translateY(-1px); }
.theme-icon { position: relative; display: grid; width: 18px; height: 18px; place-items: center; }
.theme-icon svg { position: absolute; width: 17px; height: 17px; transition: opacity 160ms ease, transform 200ms ease; }
.theme-icon-moon { opacity: 0; transform: rotate(-25deg) scale(.7); }
.theme-toggle[data-theme="dark"] .theme-icon-sun { opacity: 0; transform: rotate(25deg) scale(.7); }
.theme-toggle[data-theme="dark"] .theme-icon-moon { opacity: 1; transform: rotate(0) scale(1); }

.button,
.icon-button,
.text-action,
.back-action {
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .035em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 7px;
}

.button:hover { transform: translateY(-1px); }
.button-accent { color: #120e0d; background: var(--coral); }
.button-accent:hover { background: #ff7b69; box-shadow: 0 8px 24px rgba(255,107,87,.18); }
.button-light { color: var(--ink); background: var(--paper); }
.button-light:hover { background: white; }
.button-ghost { color: var(--paper-muted); background: transparent; border-color: var(--line-strong); }
.button-ghost:hover { color: var(--paper); border-color: rgba(242,239,231,.5); }
.button[disabled] { cursor: not-allowed; opacity: .45; transform: none; }

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: #999ca4;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.icon-button:hover { color: var(--paper); background: rgba(255,255,255,.05); }

.text-action,
.back-action {
  padding: 0;
  color: var(--paper-muted);
  font-size: 11px;
  font-weight: 800;
  background: transparent;
}

.text-action span { margin-left: 7px; color: var(--coral); }
.text-action:hover,
.back-action:hover { color: var(--paper); }

main {
  width: 100%;
  min-height: calc(100vh - var(--topbar-height));
  padding: clamp(30px, 4vw, 68px) clamp(24px, 4vw, 64px) 90px;
}

.view { display: none; width: min(100%, 1500px); margin: 0 auto; animation: view-enter 280ms ease both; }
.view.is-active { display: block; }

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
  min-height: 440px;
  overflow: hidden;
  background: #15171c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-grid::after {
  position: absolute;
  right: -7%;
  bottom: -45%;
  width: 500px;
  height: 500px;
  content: "";
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(255,255,255,.018), 0 0 0 110px rgba(255,255,255,.012);
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(44px, 6vw, 90px);
}

.eyebrow,
.section-index {
  margin: 0;
  color: #7e828b;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}

.eyebrow span { margin-right: 12px; color: var(--coral); }

.hero-copy h1,
.page-heading h1 {
  margin: 22px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: 1.05;
}

.hero-copy h1 { font-size: clamp(42px, 5.2vw, 78px); }
.hero-copy h1 em { color: var(--coral); font-style: normal; }
.hero-lead { max-width: 660px; margin: 25px 0 0; color: #a1a4ab; font-size: clamp(13px, 1.2vw, 16px); }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 35px; }

.hero-signal {
  position: relative;
  display: grid;
  min-height: 100%;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(99,217,221,.08), transparent 45%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.024) 0 1px, transparent 1px 24px),
    #0e1014;
  border-left: 1px solid var(--line);
}

.signal-rings { position: relative; width: min(23vw, 290px); aspect-ratio: 1; }
.signal-rings i,
.signal-rings b { position: absolute; inset: 0; border: 1px solid rgba(99,217,221,.23); border-radius: 50%; }
.signal-rings i:nth-child(2) { inset: 16%; border-style: dashed; animation: slow-spin 22s linear infinite; }
.signal-rings i:nth-child(3) { inset: 32%; border-color: rgba(255,107,87,.42); }
.signal-rings b { inset: 43%; background: var(--coral); border: 0; box-shadow: 0 0 40px rgba(255,107,87,.36); }
.signal-rings::before,
.signal-rings::after { position: absolute; z-index: 2; content: ""; background: rgba(242,239,231,.23); }
.signal-rings::before { top: 50%; left: -10%; width: 120%; height: 1px; }
.signal-rings::after { top: -10%; left: 50%; width: 1px; height: 120%; }

.signal-readout {
  position: absolute;
  bottom: 36px;
  left: 32px;
  z-index: 3;
}
.signal-readout span,
.signal-readout strong,
.signal-readout small { display: block; }
.signal-readout span { color: var(--cyan); font-family: var(--font-display); font-size: 8px; font-weight: 800; letter-spacing: .22em; }
.signal-readout strong { margin-top: 4px; font-size: 14px; letter-spacing: .08em; }
.signal-readout small { margin-top: 3px; color: #6e727b; font-size: 9px; }
.vertical-label { position: absolute; top: 30px; right: 18px; color: #555960; font-size: 10px; font-weight: 700; letter-spacing: .35em; writing-mode: vertical-rl; }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 15px;
  background: #111318;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.metric-strip article { position: relative; padding: 20px clamp(14px, 2vw, 28px); border-right: 1px solid var(--line); }
.metric-strip article:last-child { border-right: 0; }
.metric-strip span,
.metric-strip strong,
.metric-strip small { display: block; }
.metric-strip span { color: #60646c; font-family: var(--font-display); font-size: 8px; font-weight: 800; letter-spacing: .18em; }
.metric-strip strong { margin-top: 6px; font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 34px); line-height: 1; }
.metric-strip small { margin-top: 5px; color: #777b83; font-size: 9px; }

.section-block { margin-top: clamp(54px, 6vw, 88px); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
.section-heading h2 { margin: 6px 0 0; font-size: clamp(22px, 2vw, 30px); letter-spacing: -.04em; }
.section-heading.compact { align-items: center; }
.section-heading.compact h2 { font-size: 20px; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.project-card {
  position: relative;
  display: flex;
  min-height: 310px;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  text-align: left;
  background: #15171c;
  border: 1px solid var(--line);
  border-radius: 14px;
  isolation: isolate;
}

.project-thumbnail,
.library-thumbnail,
.artifact-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 20%, var(--project-accent, rgba(255,107,87,.6)), transparent 44%),
    linear-gradient(135deg, #232832, #111318);
}

.project-thumbnail img,
.library-thumbnail img,
.artifact-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms cubic-bezier(.2,.8,.2,1), filter 220ms ease;
}

.thumbnail-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.84);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -.04em;
}

.project-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
}

.project-thumbnail::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(8,10,13,.08), rgba(8,10,13,.02) 50%, rgba(8,10,13,.46));
  pointer-events: none;
}

.project-card::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  opacity: .76;
  background:
    radial-gradient(circle at 76% 18%, var(--project-accent, rgba(255,107,87,.55)), transparent 33%),
    linear-gradient(135deg, rgba(255,255,255,.07), transparent 36%),
    repeating-linear-gradient(135deg, transparent 0 20px, rgba(255,255,255,.017) 20px 21px);
}

.project-card::after {
  position: absolute;
  z-index: -1;
  right: -42px;
  bottom: -70px;
  width: 230px;
  height: 230px;
  content: "";
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(255,255,255,.02), 0 0 0 60px rgba(255,255,255,.015);
  transition: transform 400ms ease;
}

.project-card:hover { border-color: rgba(242,239,231,.28); transform: translateY(-3px); box-shadow: 0 18px 45px rgba(0,0,0,.28); }
.project-card:hover::after { transform: scale(1.08) rotate(9deg); }
.project-card:hover .project-thumbnail img { transform: scale(1.035); }
.project-card header { position: absolute; inset: 0 0 auto; z-index: 3; display: flex; justify-content: space-between; padding: 15px 15px 0; }
.project-type,
.status-chip { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; font-family: var(--font-display); font-size: 8px; font-weight: 800; letter-spacing: .13em; border: 1px solid rgba(255,255,255,.18); border-radius: 99px; }
.project-type { color: #f8f7f2; background: rgba(11,12,15,.7); backdrop-filter: blur(8px); }
.status-chip { color: #8be9ec; background: rgba(11,12,15,.7); backdrop-filter: blur(8px); }
.project-card-body { margin-top: auto; padding: 21px 20px 20px; background: rgba(14,16,20,.94); }
.project-card h3 { max-width: 90%; margin: 0; font-family: var(--font-display); font-size: 27px; line-height: 1.02; letter-spacing: -.035em; }
.project-card p { margin: 7px 0 0; color: #a5a7ac; font-size: 11px; }
.project-card footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line); }
.project-card footer span { color: #777b82; font-family: var(--font-display); font-size: 8px; letter-spacing: .08em; }
.project-card footer strong { color: var(--paper); font-size: 10px; }

.dashboard-split { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 42px; }
.rule-list,
.artifact-list { overflow: hidden; background: #111318; border: 1px solid var(--line); border-radius: 13px; }
.rule-row,
.artifact-row { display: grid; align-items: center; min-height: 67px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.rule-row:last-child,
.artifact-row:last-child { border-bottom: 0; }
.rule-row { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; }
.rule-row > i { display: grid; width: 19px; height: 19px; place-items: center; color: var(--ink); font-size: 10px; font-style: normal; font-weight: 900; background: var(--cyan); border-radius: 50%; }
.rule-row strong,
.rule-row small,
.artifact-row strong,
.artifact-row small { display: block; }
.rule-row strong,
.artifact-row strong { font-size: 11px; }
.rule-row small,
.artifact-row small { max-width: 500px; margin-top: 2px; overflow: hidden; color: #6f737c; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.rule-policy { color: #777b83; font-family: var(--font-display); font-size: 8px; letter-spacing: .11em; }
.live-tag { padding: 3px 8px; color: var(--cyan); font-family: var(--font-display); font-size: 8px; font-weight: 800; letter-spacing: .14em; border: 1px solid rgba(99,217,221,.28); border-radius: 99px; }
.artifact-row { grid-template-columns: 98px minmax(0, 1fr) auto; gap: 14px; min-height: 88px; color: inherit; text-align: left; background: transparent; }
.artifact-row:hover { background: rgba(255,255,255,.035); }
.artifact-row b { color: var(--coral); font-size: 16px; }
.artifact-thumb { width: 98px; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 7px; }
.artifact-thumb .thumbnail-fallback { font-size: 20px; }
.artifact-thumb::after { position: absolute; inset: 0; content: ""; background: linear-gradient(180deg, transparent 45%, rgba(5,7,9,.72)); }
.artifact-thumb i { position: absolute; right: 5px; bottom: 4px; z-index: 2; color: white; font-family: var(--font-display); font-size: 6px; font-style: normal; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.artifact-kind-label { display: block; margin-bottom: 3px; color: var(--coral); font-family: var(--font-display); font-size: 7px; font-weight: 900; letter-spacing: .12em; }
.artifact-row:hover .artifact-thumb img { transform: scale(1.045); }

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 38px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.page-heading h1 { font-size: clamp(38px, 5vw, 68px); }
.page-heading > div > p:last-child { max-width: 680px; margin: 13px 0 0; color: #868a92; }

.segmented-filter { display: flex; gap: 3px; padding: 4px; background: #111318; border: 1px solid var(--line); border-radius: 8px; }
.segmented-filter button { min-height: 32px; padding: 0 13px; color: #777b83; font-size: 10px; font-weight: 800; background: transparent; border-radius: 5px; }
.segmented-filter button.is-active { color: var(--ink); background: var(--paper); }

.project-library { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.library-row { position: relative; display: grid; grid-template-columns: 124px 1fr auto; align-items: center; min-height: 116px; padding: 15px; overflow: hidden; color: inherit; text-align: left; background: #13151a; border: 1px solid var(--line); border-radius: 12px; }
.library-row:hover { background: #171a20; border-color: var(--line-strong); transform: translateY(-2px); }
.library-thumbnail { width: 108px; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 8px; }
.library-thumbnail::after { position: absolute; inset: 0; content: ""; background: linear-gradient(135deg, transparent 50%, rgba(5,7,9,.46)); }
.library-thumbnail .thumbnail-fallback { font-size: 22px; }
.library-thumbnail i { position: absolute; right: 7px; bottom: 5px; z-index: 2; color: white; font-family: var(--font-display); font-size: 8px; font-style: normal; font-weight: 900; text-shadow: 0 1px 5px rgba(0,0,0,.65); }
.library-row:hover .library-thumbnail img { transform: scale(1.045); }
.library-copy strong,
.library-copy span,
.library-copy small { display: block; }
.library-copy strong { font-family: var(--font-display); font-size: 18px; letter-spacing: -.02em; }
.library-copy span { color: #90939a; font-size: 10px; }
.library-copy small { margin-top: 7px; color: #666a72; font-size: 9px; }
.library-meta { text-align: right; }
.library-meta strong,
.library-meta small { display: block; }
.library-meta strong { font-family: var(--font-display); font-size: 12px; }
.library-meta small { color: #646871; font-size: 8px; }

.empty-state { grid-column: 1 / -1; padding: 55px 25px; color: #777b83; text-align: center; background: #111318; border: 1px dashed var(--line-strong); border-radius: 12px; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--paper); }

.back-action { margin-bottom: 28px; }
.project-detail-hero { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 30px; min-height: 260px; padding: clamp(32px, 5vw, 68px); overflow: hidden; background: #15171c; border: 1px solid var(--line); border-radius: 17px; }
.project-detail-hero::after { position: absolute; right: -110px; bottom: -210px; width: 440px; height: 440px; content: ""; background: radial-gradient(circle, var(--project-accent, rgba(255,107,87,.4)), transparent 68%); opacity: .65; }
.project-detail-hero .eyebrow { color: var(--project-accent, var(--coral)); }
.project-detail-hero h1 { margin: 25px 0 0; font-family: var(--font-display); font-size: clamp(38px, 5vw, 72px); letter-spacing: -.055em; line-height: 1; }
.project-detail-hero p { margin: 12px 0 0; color: #9a9da4; }
.project-score { position: relative; z-index: 2; display: grid; width: 118px; aspect-ratio: 1; place-items: center; align-self: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; }
.project-score strong,
.project-score small { display: block; text-align: center; }
.project-score strong { font-family: var(--font-display); font-size: 27px; line-height: 1; }
.project-score small { margin-top: 5px; color: #767a83; font-size: 8px; }

.project-tabs { display: flex; gap: 4px; margin-top: 18px; padding: 5px; overflow-x: auto; background: #111318; border: 1px solid var(--line); border-radius: 10px; }
.project-tabs button { flex: 0 0 auto; min-height: 38px; padding: 0 16px; color: #777b83; font-size: 10px; font-weight: 800; background: transparent; border-radius: 6px; }
.project-tabs button.is-active { color: var(--ink); background: var(--paper); }

.project-tab-content { margin-top: 28px; }
.detail-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.detail-panel { padding: 23px; background: #121419; border: 1px solid var(--line); border-radius: 12px; }
.detail-panel header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.detail-panel h2 { margin: 0; font-size: 17px; }
.detail-panel header span { color: #666a72; font-family: var(--font-display); font-size: 8px; letter-spacing: .13em; }
.count-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.count-grid div { min-height: 86px; padding: 15px; background: #0d0f12; border: 1px solid var(--line); border-radius: 8px; }
.count-grid strong,
.count-grid small { display: block; }
.count-grid strong { font-family: var(--font-display); font-size: 22px; }
.count-grid small { color: #6e727a; font-size: 8px; }
.document-list { display: grid; gap: 7px; }
.document-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; min-height: 55px; padding: 10px 12px; background: #0e1014; border: 1px solid var(--line); border-radius: 7px; }
.document-row strong,
.document-row small { display: block; }
.document-row strong { font-size: 10px; }
.document-row small { max-width: 440px; overflow: hidden; color: #656971; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.document-row span { color: var(--cyan); font-size: 9px; }
.revision-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.revision-tags span { padding: 5px 9px; color: #92959c; font-size: 9px; border: 1px solid var(--line); border-radius: 99px; }

.task-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px; }
.column-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: #8b8e96; font-size: 10px; font-weight: 800; }
.column-label b { display: grid; min-width: 25px; height: 25px; place-items: center; color: var(--ink); background: var(--paper); border-radius: 99px; }
.task-list { display: grid; gap: 10px; }
.task-card { padding: 18px; background: #121419; border: 1px solid var(--line); border-radius: 11px; }
.task-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.task-card header span { color: var(--coral); font-family: var(--font-display); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.task-card header time { color: #666a72; font-size: 8px; }
.task-card h3 { margin: 13px 0 0; font-size: 13px; }
.task-card p { display: -webkit-box; margin: 8px 0 0; overflow: hidden; color: #858991; font-size: 10px; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.task-card footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.task-card footer small { color: #656971; font-size: 8px; }
.run-status { display: inline-flex; align-items: center; gap: 6px; color: var(--cyan); font-size: 9px; }
.run-status::before { width: 6px; height: 6px; content: ""; background: currentColor; border-radius: 50%; }
.run-status.failed { color: var(--coral); }

.knowledge-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 24px; }
.knowledge-map { display: grid; gap: 9px; }
.knowledge-card { position: relative; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; min-height: 80px; padding: 14px 17px; background: #121419; border: 1px solid var(--line); border-radius: 11px; }
.knowledge-card::before { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; content: ""; background: var(--cyan); opacity: .6; }
.knowledge-number { color: #5f636c; font-family: var(--font-display); font-size: 11px; }
.knowledge-card strong,
.knowledge-card small { display: block; }
.knowledge-card strong { font-size: 12px; }
.knowledge-card small { max-width: 600px; margin-top: 4px; overflow: hidden; color: #676b74; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-card b { color: var(--cyan); font-family: var(--font-display); font-size: 8px; letter-spacing: .1em; }
.knowledge-principle { position: sticky; top: calc(var(--topbar-height) + 25px); height: fit-content; padding: 30px; background: var(--coral); border-radius: 13px; color: #16100f; }
.knowledge-principle > span { font-family: var(--font-display); font-size: 8px; font-weight: 900; letter-spacing: .17em; }
.knowledge-principle blockquote { margin: 45px 0 25px; font-size: clamp(22px, 2.3vw, 34px); font-weight: 900; line-height: 1.35; letter-spacing: -.04em; }
.knowledge-principle p { margin: 0; padding-top: 18px; font-size: 10px; border-top: 1px solid rgba(20,14,13,.25); }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.setting-card { min-height: 200px; padding: 24px; background: #121419; border: 1px solid var(--line); border-radius: 13px; }
.setting-card header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.setting-card header span { display: grid; width: 38px; height: 38px; place-items: center; color: var(--cyan); background: rgba(99,217,221,.08); border: 1px solid rgba(99,217,221,.2); border-radius: 50%; }
.setting-card header b { padding: 4px 8px; color: #858991; font-family: var(--font-display); font-size: 8px; letter-spacing: .1em; border: 1px solid var(--line); border-radius: 99px; }
.setting-card h2 { margin: 24px 0 0; font-size: 17px; }
.setting-card p { margin: 8px 0 0; color: #777b83; font-size: 10px; }
.setting-card code { display: block; margin-top: 18px; padding-top: 13px; overflow: hidden; color: #9c9fa6; font-family: Consolas, monospace; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; border-top: 1px solid var(--line); }

.task-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  width: 100vw;
  max-width: 100vw;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) minmax(0, min(760px, 96vw));
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}
.task-drawer.is-open { visibility: visible; pointer-events: auto; }
.drawer-backdrop { background: rgba(0,0,0,.67); opacity: 0; backdrop-filter: blur(4px); transition: opacity 220ms ease; }
.task-drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer-panel { grid-column: 2; height: 100vh; overflow-y: auto; background: #101217; border-left: 1px solid var(--line-strong); box-shadow: -30px 0 80px rgba(0,0,0,.42); opacity: 0; clip-path: inset(0 0 0 100%); transform: scaleX(.97); transform-origin: right center; transition: clip-path 280ms cubic-bezier(.2,.8,.2,1), transform 280ms cubic-bezier(.2,.8,.2,1), opacity 180ms ease; }
.task-drawer.is-open .drawer-panel { opacity: 1; clip-path: inset(0); transform: scaleX(1); }
.drawer-panel > header { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 24px 30px; background: rgba(16,18,23,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.drawer-panel > header span { color: var(--coral); font-family: var(--font-display); font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.drawer-panel > header h2 { margin: 4px 0 0; font-size: 20px; }
.drawer-panel form { display: grid; gap: 21px; padding: 30px; }

label { display: grid; gap: 7px; }
label > span,
fieldset legend { color: #8f9299; font-size: 10px; font-weight: 800; }
input,
textarea,
select { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; outline: none; background: #0b0d10; }
input,
select { min-height: 43px; padding: 0 12px; }
textarea { resize: vertical; padding: 11px 12px; line-height: 1.65; }
input:focus,
textarea:focus,
select:focus { border-color: rgba(99,217,221,.64); box-shadow: 0 0 0 3px rgba(99,217,221,.08); }
select { color-scheme: dark; }
.form-row.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.reference-picker { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
.reference-picker legend { padding: 0 8px; }
.reference-picker legend span { margin-right: 8px; color: var(--cyan); font-family: var(--font-display); font-size: 8px; letter-spacing: .12em; }
#reference-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.reference-option { display: grid; grid-template-columns: 17px 1fr; align-items: start; gap: 9px; min-height: 54px; padding: 10px; background: #0c0e12; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.reference-option:hover { border-color: var(--line-strong); }
.reference-option input { width: 15px; min-height: auto; aspect-ratio: 1; margin: 2px 0 0; accent-color: var(--coral); }
.reference-option strong,
.reference-option small { display: block; }
.reference-option strong { font-size: 9px; }
.reference-option small { margin-top: 2px; overflow: hidden; color: #62666e; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.prompt-preview { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.prompt-preview summary { padding: 12px 15px; color: #94979e; font-size: 10px; font-weight: 800; cursor: pointer; }
.prompt-preview pre { max-height: 300px; margin: 0; padding: 17px; overflow: auto; color: #aaadb3; background: #090b0e; border-top: 1px solid var(--line); font-family: Consolas, monospace; font-size: 9px; white-space: pre-wrap; }
.drawer-panel form > footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 16px; border-top: 1px solid var(--line); }
.drawer-panel form > footer > div { display: flex; gap: 8px; }
.safety-note { display: flex; align-items: center; gap: 8px; max-width: 260px; color: #6f737b; font-size: 8px; }
.safety-note i { flex: 0 0 auto; width: 7px; height: 7px; background: var(--cyan); border-radius: 50%; }

dialog {
  max-width: none;
  max-height: none;
  padding: 0;
  color: var(--paper);
  background: #101217;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0,0,0,.75); backdrop-filter: blur(5px); }
.artifact-dialog { width: min(94vw, 1480px); height: min(90vh, 940px); border-radius: 14px; }
.artifact-dialog > header { display: flex; height: 66px; align-items: center; justify-content: space-between; gap: 18px; padding: 0 17px 0 22px; border-bottom: 1px solid var(--line); }
.artifact-dialog > header > div { display: flex; align-items: center; gap: 12px; }
.artifact-dialog header span { color: var(--coral); font-family: var(--font-display); font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.artifact-dialog header strong { font-size: 12px; }
.artifact-frame-wrap { position: relative; height: calc(100% - 105px); background: #07080a; }
.artifact-frame-wrap iframe { width: 100%; height: 100%; border: 0; background: white; }
.artifact-offline { position: absolute; inset: 0; display: none; place-content: center; padding: 30px; color: #858991; text-align: center; }
.artifact-offline.is-visible { display: grid; }
.artifact-offline strong { color: var(--paper); font-size: 18px; }
.artifact-offline p { max-width: 550px; }
.artifact-dialog > footer { display: flex; height: 39px; align-items: center; padding: 0 18px; overflow: hidden; border-top: 1px solid var(--line); }
.artifact-dialog > footer code { overflow: hidden; color: #686c74; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.new-project-dialog { width: min(92vw, 600px); border-radius: 14px; }
.new-project-dialog form { display: grid; gap: 18px; padding: 25px; }
.new-project-dialog header { display: flex; align-items: center; justify-content: space-between; }
.new-project-dialog header span { color: var(--coral); font-family: var(--font-display); font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.new-project-dialog h2 { margin: 4px 0 0; }
.new-project-dialog p { margin: 0; color: #7d8189; font-size: 10px; }
.new-project-dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; width: min(390px, calc(100vw - 44px)); gap: 8px; }
.toast { padding: 13px 15px; color: var(--paper); background: #1a1d23; border: 1px solid var(--line-strong); border-left: 3px solid var(--cyan); border-radius: 8px; box-shadow: 0 14px 38px rgba(0,0,0,.38); animation: toast-in 220ms ease both; }
.toast.is-error { border-left-color: var(--coral); }
.toast strong,
.toast span { display: block; }
.toast strong { font-size: 10px; }
.toast span { margin-top: 3px; color: #8d9097; font-size: 9px; }

html[data-theme="light"] {
  color-scheme: light;
  --ink: #f4f0e8;
  --ink-2: #fffdf8;
  --ink-3: #f1eee7;
  --paper: #1d2025;
  --paper-muted: #555a62;
  --line: rgba(29, 32, 37, .12);
  --line-strong: rgba(29, 32, 37, .24);
  --coral: #c94233;
  --coral-hot: #b53226;
  --cyan: #087c82;
  --lime: #697f00;
  --violet: #5e52ce;
  --shadow: 0 24px 60px rgba(54, 45, 33, .14);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 78% 9%, rgba(8, 124, 130, .09), transparent 27rem),
    radial-gradient(circle at 20% 92%, rgba(201, 66, 51, .08), transparent 31rem),
    var(--ink);
}

html[data-theme="light"] body::before { opacity: .52; background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(8.333vw - 1px), rgba(38,36,31,.035) calc(8.333vw - 1px), rgba(38,36,31,.035) 8.333vw); }
html[data-theme="light"] .rail { background: rgba(250, 247, 240, .96); box-shadow: 12px 0 40px rgba(66,55,40,.04); }
html[data-theme="light"] .topbar { background: rgba(244, 240, 232, .86); }
html[data-theme="light"] .global-search,
html[data-theme="light"] .metric-strip,
html[data-theme="light"] .rule-list,
html[data-theme="light"] .artifact-list,
html[data-theme="light"] .segmented-filter,
html[data-theme="light"] .project-tabs { background: rgba(255, 253, 248, .92); }
html[data-theme="light"] .global-search kbd { color: #62666d; background: #ece8df; }
html[data-theme="light"] .global-search input { color: var(--paper); }
html[data-theme="light"] .hero-grid,
html[data-theme="light"] .project-card,
html[data-theme="light"] .library-row,
html[data-theme="light"] .project-detail-hero,
html[data-theme="light"] .detail-panel,
html[data-theme="light"] .task-card,
html[data-theme="light"] .knowledge-card,
html[data-theme="light"] .setting-card,
html[data-theme="light"] .empty-state { background: rgba(255, 253, 248, .96); }
html[data-theme="light"] .hero-grid::after { border-color: rgba(29,32,37,.09); box-shadow: 0 0 0 55px rgba(29,32,37,.018), 0 0 0 110px rgba(29,32,37,.012); }
html[data-theme="light"] .hero-signal { background: linear-gradient(145deg, rgba(8,124,130,.1), transparent 48%), repeating-linear-gradient(0deg, rgba(29,32,37,.035) 0 1px, transparent 1px 24px), #edf4f1; }
html[data-theme="light"] .signal-rings::before,
html[data-theme="light"] .signal-rings::after { background: rgba(29,32,37,.2); }
html[data-theme="light"] .project-card-body { background: rgba(255,253,248,.98); }
html[data-theme="light"] .project-card:hover { border-color: rgba(29,32,37,.28); box-shadow: 0 18px 45px rgba(64,52,36,.14); }
html[data-theme="light"] .library-row:hover { background: #fff; }
html[data-theme="light"] .count-grid div,
html[data-theme="light"] .document-row,
html[data-theme="light"] .reference-option { background: #f4f1ea; }
html[data-theme="light"] .drawer-panel,
html[data-theme="light"] dialog { color: var(--paper); background: #fbf8f1; }
html[data-theme="light"] .drawer-panel > header { background: rgba(251,248,241,.95); }
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select { color: var(--paper); background: white; }
html[data-theme="light"] select { color-scheme: light; }
html[data-theme="light"] .prompt-preview pre { color: #3f444b; background: #f0ece4; }
html[data-theme="light"] .artifact-frame-wrap { background: #e7e3da; }
html[data-theme="light"] .toast { color: var(--paper); background: #fffdf8; box-shadow: 0 14px 38px rgba(64,52,36,.18); }
html[data-theme="light"] .theme-toggle:hover,
html[data-theme="light"] .rail-link:hover { background: rgba(29,32,37,.055); }
html[data-theme="light"] .rail-link.is-active { background: rgba(29,32,37,.075); }
html[data-theme="light"] :is(.brand-lockup > div > span, .rail-link, .workspace-crumb span, .global-search, .eyebrow, .section-index, .hero-lead, .signal-readout small, .vertical-label, .metric-strip span, .metric-strip small, .project-card p, .project-card footer span, .rule-row small, .artifact-row small, .rule-policy, .page-heading > div > p:last-child, .library-copy span, .library-copy small, .library-meta small, .project-detail-hero p, .project-score small, .detail-panel header span, .count-grid small, .document-row small, .task-card p, .task-card footer small, .knowledge-number, .knowledge-card small, .setting-card p, .safety-note, .new-project-dialog p, .toast span) { color: #5c6169; }
html[data-theme="light"] .deerflow-signature { color: #73777e; }
html[data-theme="light"] .project-thumbnail,
html[data-theme="light"] .library-thumbnail,
html[data-theme="light"] .artifact-thumb { background: radial-gradient(circle at 78% 20%, var(--project-accent, rgba(201,66,51,.5)), transparent 44%), linear-gradient(135deg, #5e6571, #242932); }

@keyframes orbit-pulse { 0% { transform: scale(.5); opacity: .65; } 75%, 100% { transform: scale(1.65); opacity: 0; } }
@keyframes slow-spin { to { transform: rotate(360deg); } }
@keyframes view-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1180px) {
  :root { --rail-width: 90px; }
  .rail { padding-inline: 13px; }
  .brand-lockup { justify-content: center; padding-inline: 0; }
  .brand-lockup > div { display: none; }
  .rail-link { grid-template-columns: 1fr; justify-items: center; padding: 8px 4px; }
  .rail-link span { font-size: 8px; text-align: center; }
  .rail-link em { position: absolute; top: 3px; right: 1px; }
  .connection-orbit { justify-content: center; }
  .connection-orbit div,
  .deerflow-signature { display: none; }
  .topbar { grid-template-columns: 160px 1fr auto; }
  .topbar-actions .button-ghost { display: none; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-split { gap: 20px; }
}

@media (max-width: 880px) {
  :root { --rail-width: 0px; --topbar-height: 68px; }
  .app-shell { padding-left: 0; padding-bottom: 72px; }
  .rail { inset: auto 0 0; z-index: 50; width: 100%; height: 66px; padding: 6px 10px; border-top: 1px solid var(--line); border-right: 0; }
  .brand-lockup,
  .rail-foot { display: none; }
  .rail-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; margin: 0; }
  .rail-link { min-height: 54px; grid-template-rows: 25px 15px; border-radius: 7px; }
  .rail-link.is-active::before { inset: auto 20% -6px; width: auto; height: 2px; }
  .topbar { grid-template-columns: 1fr auto; padding: 0 18px; }
  .workspace-crumb { display: none; }
  .global-search { justify-self: start; }
  .topbar-actions .icon-button { display: none; }
  main { padding-inline: 18px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-signal { display: none; }
  .metric-strip { grid-template-columns: repeat(3, 1fr); }
  .metric-strip article:nth-child(3) { border-right: 0; }
  .metric-strip article:nth-child(n+4) { border-top: 1px solid var(--line); }
  .dashboard-split,
  .detail-grid,
  .knowledge-layout { grid-template-columns: minmax(0, 1fr); }
  .dashboard-split > *,
  .rule-list,
  .artifact-list,
  .rule-row > div,
  .artifact-row > div { min-width: 0; }
  .knowledge-principle { position: static; }
  .project-library,
  .task-columns { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .task-drawer { grid-template-columns: 1fr; }
  .drawer-panel { grid-column: 1; width: 100%; min-width: 0; }
}

@media (max-width: 620px) {
  .topbar { grid-template-columns: 1fr auto; gap: 8px; }
  .global-search kbd { display: none; }
  .theme-toggle { width: 40px; padding: 0; justify-content: center; }
  .theme-toggle .theme-label { display: none; }
  .topbar-actions .button-accent { width: 42px; padding: 0; }
  .topbar-actions .button-accent span { display: none; }
  main { padding-top: 28px; }
  .hero-copy { padding: 37px 25px; }
  .hero-copy h1 { font-size: 39px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 15px; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric-strip article:nth-child(2n) { border-right: 0; }
  .metric-strip article:nth-child(3) { border-right: 1px solid var(--line); }
  .metric-strip article:nth-child(n+3) { border-top: 1px solid var(--line); }
  .project-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 40px; }
  .segmented-filter { max-width: 100%; overflow-x: auto; }
  .library-row { grid-template-columns: 88px 1fr; }
  .library-thumbnail { width: 76px; }
  .artifact-row { grid-template-columns: 82px minmax(0, 1fr) auto; padding-inline: 10px; }
  .artifact-thumb { width: 82px; }
  .library-meta { display: none; }
  .project-detail-hero { grid-template-columns: 1fr; padding: 30px 24px; }
  .project-score { display: none; }
  .count-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row.two-columns,
  #reference-options { grid-template-columns: 1fr; }
  .drawer-panel > header,
  .drawer-panel form { padding-inline: 18px; }
  .drawer-panel form > footer { align-items: stretch; flex-direction: column; }
  .drawer-panel form > footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .drawer-panel form > footer > div .button:last-child { grid-column: 1 / -1; }
  .artifact-dialog { width: 100vw; height: 100vh; border-radius: 0; }
  .artifact-dialog > header { height: 76px; }
  .artifact-dialog > header .button { display: none; }
  .artifact-frame-wrap { height: calc(100% - 115px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
