:root {
  --sky: #77a7c8;
  --sky-deep: #4d8db8;
  --window: #f4f1e8;
  --sidebar: #efede3;
  --surface: #f8f5ec;
  --surface-strong: #ebe6d8;
  --ink: #37352f;
  --muted: #7b766b;
  --faint: #aaa395;
  --line: rgba(78, 72, 61, 0.15);
  --line-strong: rgba(78, 72, 61, 0.26);
  --blue: #547cb8;
  --coral: #d96863;
  --green: #a9c86d;
  --lilac: #9d7fba;
  --yellow: #d7ac52;
  --pastel-green: #dceac7;
  --pastel-lilac: #d9c9ea;
  --pastel-yellow: #eee8bd;
  --pastel-pink: #ebced9;
  --pastel-blue: #cadde6;
  --pastel-peach: #ead7bd;
  --display: Georgia, "Iowan Old Style", "Songti SC", "STSong", serif;
  --body: -apple-system, BlinkMacSystemFont, "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow: 0 28px 90px rgba(40, 63, 72, 0.3), 0 2px 8px rgba(49, 54, 49, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--window);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: clip;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid rgba(84, 124, 184, 0.55);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 18px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  text-decoration: none;
  transition: top 180ms ease;
}
.skip-link:focus { top: 18px; }

.ambient-sky {
  display: none;
}
.ambient-sky span {
  position: absolute;
  width: 170px;
  height: 58px;
  border-radius: 50%;
  background: rgba(246, 245, 225, 0.72);
  filter: blur(1px);
  box-shadow: 58px 10px 0 12px rgba(246, 245, 225, 0.58), -54px 17px 0 3px rgba(246, 245, 225, 0.52);
}
.ambient-sky span:nth-child(1) { left: 3%; top: 5%; transform: scale(.72); }
.ambient-sky span:nth-child(2) { right: 8%; top: 12%; transform: scale(.5); }
.ambient-sky span:nth-child(3) { left: 46%; top: 2%; transform: scale(.42); }
.ambient-sky span:nth-child(4) { right: -2%; top: 37%; transform: scale(.6); }

.grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0.055;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.workspace-window {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow: clip;
  border: 0;
  border-radius: 0;
  background: var(--window);
  box-shadow: none;
}

.window-chrome {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 52px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(244, 241, 232, 0.94);
  backdrop-filter: blur(18px);
}

.traffic-lights { display: flex; gap: 7px; }
.traffic-lights i { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.traffic-red { background: #e66d62; }
.traffic-yellow { background: #e8b452; }
.traffic-green { background: #72b86f; }

.window-breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}
.window-brand { color: var(--ink); font-weight: 650; }
.breadcrumb-slash { color: var(--faint); }
.breadcrumb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); flex: 0 0 auto; }

.window-actions { display: flex; align-items: center; gap: 5px; }
.chrome-button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 11px;
  transition: background 180ms ease, transform 180ms ease;
}
.chrome-button:hover { background: var(--surface-strong); }
.chrome-button:active { transform: translateY(1px); }
.chrome-button-primary { background: var(--ink); color: var(--window); }
.chrome-button-primary:hover { background: #514d45; }

.workspace-body { display: grid; grid-template-columns: 188px minmax(0, 1fr); align-items: start; }

.library-sidebar {
  position: sticky;
  top: 52px;
  min-height: calc(100dvh - 76px);
  height: calc(100dvh - 76px);
  display: flex;
  flex-direction: column;
  padding: 21px 15px 16px;
  border-right: 1px solid var(--line-strong);
  background: var(--sidebar);
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-nav { display: grid; gap: 2px; }
.sidebar-link {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 7px 8px;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  transition: background 160ms ease, color 160ms ease;
}
.sidebar-link:hover, .sidebar-link.active { color: var(--ink); background: rgba(102, 97, 84, 0.08); }
.sidebar-link small { color: var(--faint); font-variant-numeric: tabular-nums; }

.sidebar-library, .sidebar-collection { margin-top: 25px; }
.sidebar-library h2, .sidebar-collection h2 {
  margin: 0 8px 9px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
}
.sidebar-category-list { display: grid; gap: 1px; }
.sidebar-category {
  width: 100%;
  display: grid;
  grid-template-columns: 8px minmax(0,1fr) auto;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 6px 8px;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  font-size: 11px;
  transition: background 160ms ease, color 160ms ease;
}
.sidebar-category:hover, .sidebar-category.active { color: var(--ink); background: rgba(102, 97, 84, 0.08); }
.sidebar-category small { color: var(--faint); font-variant-numeric: tabular-nums; }
.side-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot-coral { background: var(--coral); }
.dot-blue { background: var(--blue); }
.dot-lilac { background: var(--lilac); }
.tone-0 { background: #b98272; }
.tone-1 { background: #7e8fbf; }
.tone-2 { background: #91af63; }
.tone-3 { background: #d09b55; }
.tone-4 { background: #a882ad; }
.tone-5 { background: #709c8b; }
.tone-6 { background: #c17b92; }
.tone-7 { background: #8e8171; }

.sidebar-collection { display: grid; gap: 2px; }
.sidebar-collection h2 { grid-column: 1 / -1; }
.sidebar-collection a, .sidebar-collection button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 6px 8px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  font-size: 11px;
}
.sidebar-collection a:hover, .sidebar-collection button:hover { color: var(--ink); background: rgba(102,97,84,.08); }

.sidebar-footer { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; }
.sidebar-footer p { margin: 0 0 7px; }
.sidebar-footer button { border: 0; background: transparent; padding: 0; color: var(--muted); cursor: pointer; font-size: 11px; }

.content-pane { min-width: 0; background: var(--window); }
main { min-width: 0; }

.collection-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: clamp(30px, 5vw, 82px);
  padding: 40px clamp(28px, 4.5vw, 72px) 28px;
}

.edition-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font: 500 10px/1 var(--mono);
  letter-spacing: .035em;
}
.edition-divider { width: 30px; height: 1px; background: var(--line-strong); }
#issueLabel { margin-left: auto; }

.title-row { display: flex; align-items: center; gap: 12px; margin-top: 15px; }
.title-row h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.edit-glyph {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 13px;
}

.collection-deck {
  max-width: 720px;
  margin: 14px 0 0;
  color: #666055;
  font-size: 14px;
  line-height: 1.65;
  text-wrap: pretty;
}
.collection-actions { display: flex; gap: 8px; margin-top: 22px; }
.primary-link, .secondary-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 13px;
  font-size: 11px;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}
.primary-link { background: var(--ink); color: var(--window); }
.secondary-link { border: 1px solid var(--line-strong); background: transparent; cursor: pointer; }
.primary-link:hover, .secondary-link:hover { transform: translateY(-1px); }
.secondary-link:hover { background: var(--surface-strong); }

.signal-board {
  align-self: start;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(79, 75, 64, .09);
}
.metric { min-height: 82px; padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric:nth-child(even) { border-right: 0; }
.metric:nth-child(n+3) { border-bottom: 0; }
.metric strong { display: block; font: 500 25px/1 var(--display); font-variant-numeric: tabular-nums; }
.metric span { display: block; margin-top: 10px; color: var(--muted); font-size: 10px; }
.metric-score { background: var(--pastel-green); }

.library-toolbar {
  margin: 0 clamp(28px, 4.5vw, 72px);
  border-bottom: 1px solid var(--line-strong);
}
.library-tabs { display: flex; align-items: end; gap: 2px; }
.library-tab {
  position: relative;
  top: 1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 12px 12px 0 0;
  background: #e7e0d3;
  padding: 10px 18px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  transition: background 160ms ease, color 160ms ease;
}
.library-tab:hover { color: var(--ink); }
.library-tab.active { z-index: 1; border-color: var(--line-strong); border-bottom-color: var(--window); background: var(--window); color: var(--ink); }
.platform-chips { display: flex; gap: 6px; padding: 15px 0 13px; overflow-x: auto; scrollbar-width: none; }
.platform-chips::-webkit-scrollbar { display: none; }
.source-chip {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e8e3d5;
  padding: 5px 9px;
  color: #6f695d;
  font-size: 9px;
}

.featured-section, .stream-section { padding: 34px clamp(28px, 4.5vw, 72px) 48px; }
.featured-section { border-bottom: 1px solid var(--line); }
.stream-section { padding-top: 45px; padding-bottom: 72px; }

.section-heading, .stream-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.section-index, .panel-kicker { margin: 0; color: var(--muted); font: 500 9px/1 var(--mono); letter-spacing: .11em; }
.section-heading h2, .stream-heading h2 { margin: 7px 0 0; font-family: var(--display); font-size: 25px; font-weight: 500; letter-spacing: -.02em; }
.section-heading h2 span { color: var(--faint); font: 500 11px/1 var(--body); }
.section-heading > p, .stream-caption { max-width: 390px; margin: 0; color: var(--muted); font-size: 11px; text-align: right; }

.featured-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.featured-card {
  --card-color: var(--pastel-green);
  min-width: 0;
  min-height: 318px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(72, 68, 58, .14);
  border-radius: 13px;
  background: var(--card-color);
  padding: 14px;
  opacity: 0;
  transform: translateY(10px);
  animation: reveal 460ms cubic-bezier(.2,.72,.2,1) forwards;
  animation-delay: calc(var(--i) * 32ms);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.featured-card:nth-child(6n+2) { --card-color: var(--pastel-lilac); }
.featured-card:nth-child(6n+3) { --card-color: var(--pastel-yellow); }
.featured-card:nth-child(6n+4) { --card-color: var(--pastel-pink); }
.featured-card:nth-child(6n+5) { --card-color: var(--pastel-blue); }
.featured-card:nth-child(6n+6) { --card-color: var(--pastel-peach); }
.featured-card:hover { transform: translateY(-3px) rotate(-.15deg); box-shadow: 0 10px 22px rgba(72,68,58,.12); }

.card-topline { display: flex; align-items: center; gap: 7px; color: rgba(55,53,47,.72); font-size: 9px; }
.card-rank { border-radius: 999px; background: rgba(255,255,255,.4); padding: 3px 6px; font-variant-numeric: tabular-nums; }
.card-category { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-score { margin-left: auto; font: 500 9px/1 var(--mono); }
.featured-card h3 { margin: 16px 0 10px; font-family: var(--display); font-size: 19px; font-weight: 500; line-height: 1.18; letter-spacing: -.025em; text-wrap: pretty; }
.featured-card h3 a { text-decoration: none; }
.featured-card h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.card-summary { margin: 0; color: rgba(55,53,47,.72); font-size: 10.5px; line-height: 1.55; }
.card-insight { margin-top: auto; padding-top: 14px; }
.card-insight span { display: block; margin-bottom: 4px; color: rgba(55,53,47,.55); font: 600 8px/1 var(--mono); letter-spacing: .08em; }
.card-insight p { margin: 0; font-size: 10.5px; line-height: 1.48; }
.card-footer { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin-top: 14px; color: rgba(55,53,47,.58); font-size: 8px; line-height: 1.3; }
.card-footer > span { max-width: calc(100% - 28px); }

.save-button {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(55,53,47,.22);
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: rgba(55,53,47,.66);
  cursor: pointer;
  font-size: 11px;
  transition: transform 160ms ease, background 160ms ease;
}
.save-button:hover { transform: rotate(8deg) scale(1.06); background: rgba(255,255,255,.54); }
.save-button.saved { background: var(--ink); color: var(--window); }

.control-desk {
  display: grid;
  grid-template-columns: minmax(230px, .8fr) minmax(0, 2fr);
  gap: 10px 14px;
  margin-bottom: 20px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 10px;
}
.search-box span { color: var(--muted); font-size: 18px; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-box input::placeholder { color: var(--faint); }
.filter-scroller { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.filter-scroller::-webkit-scrollbar { display: none; }
.platform-filters { grid-column: 2; }
.filter-button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #e8e3d5;
  padding: 6px 9px;
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}
.filter-button:hover { transform: translateY(-1px); color: var(--ink); }
.filter-button.active { background: var(--ink); color: var(--window); }

.stream-layout { display: grid; grid-template-columns: minmax(0,1fr) 205px; gap: 26px; align-items: start; }
.stream-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.stream-card {
  min-width: 0;
  min-height: 238px;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  grid-template-rows: 1fr auto;
  gap: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px;
  animation: reveal 360ms ease both;
  transition: transform 160ms ease, background 160ms ease;
}
.stream-card:nth-child(5n+2) { background: #f1eddf; }
.stream-card:nth-child(5n+3) { background: #edf0e0; }
.stream-card:nth-child(5n+4) { background: #eee7e8; }
.stream-card:hover { transform: translateY(-2px); background: white; }
.stream-rank { color: var(--faint); font: 500 12px/1 var(--mono); padding-top: 2px; }
.stream-main { min-width: 0; }
.stream-meta { display: flex; flex-wrap: wrap; gap: 5px 8px; color: var(--muted); font-size: 8px; }
.stream-category { color: #866847; }
.stream-main h3 { margin: 9px 0 8px; font-family: var(--display); font-size: 17px; font-weight: 500; line-height: 1.24; letter-spacing: -.018em; text-wrap: pretty; overflow-wrap: anywhere; }
.stream-main h3 a { text-decoration: none; }
.stream-main h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.stream-summary { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.48; }
.stream-action { margin: 10px 0 0; padding-left: 8px; border-left: 2px solid var(--pastel-green); font-size: 9.5px; line-height: 1.45; }
.stream-side { grid-column: 2; display: flex; align-items: end; justify-content: space-between; gap: 8px; margin-top: 12px; }
.score-number { color: var(--muted); font: 500 14px/1 var(--mono); }
.score-number small { font-size: 7px; }

.radar-panel {
  position: sticky;
  top: 78px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px;
}
.radar-panel h3 { margin: 8px 0 16px; font-family: var(--display); font-size: 20px; font-weight: 500; }
.radar-bars { display: grid; gap: 10px; }
.radar-row { display: grid; grid-template-columns: 68px 1fr 20px; gap: 7px; align-items: center; font-size: 9px; }
.radar-track { height: 4px; overflow: hidden; border-radius: 3px; background: var(--surface-strong); }
.radar-fill { height: 100%; border-radius: inherit; background: var(--coral); transform-origin: left; animation: grow 650ms ease both; }
.radar-count { text-align: right; color: var(--muted); font: 500 8px/1 var(--mono); }
.radar-note { display: flex; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9.5px; }
.radar-note p { margin: 0; }
.panel-button { width: 100%; margin-top: 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; padding: 8px; cursor: pointer; font-size: 9px; transition: background 160ms ease; }
.panel-button:hover { background: var(--surface-strong); }

.stream-sentinel { min-height: 72px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 9px; }
.loading-mark { width: 11px; height: 11px; border: 1px solid var(--faint); border-top-color: var(--coral); border-radius: 50%; animation: spin 1s linear infinite; }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--ink); font-family: var(--display); font-size: 20px; }
.empty-state p { margin: 6px 0 0; font-size: 11px; }

.site-footer {
  min-height: 90px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0 clamp(28px, 4.5vw, 72px);
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}
.site-footer strong { color: var(--ink); font: 600 9px/1 var(--mono); letter-spacing: .08em; }
.site-footer p { margin: 4px 0 0; }

.modal {
  width: min(760px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  border: 0;
  padding: 0;
  background: transparent;
}
.modal::backdrop { background: rgba(43, 48, 45, .58); backdrop-filter: blur(8px); }
.modal-card { max-height: calc(100dvh - 40px); overflow: auto; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--window); padding: 26px; box-shadow: 0 30px 80px rgba(29,35,33,.28); }
.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 7px 0 0; font-family: var(--display); font-size: 27px; font-weight: 500; }
.close-button { width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; cursor: pointer; font-size: 19px; }
.close-button:hover { background: var(--ink); color: var(--window); }
.modal-intro { max-width: 600px; margin: 18px 0; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.form-grid label { display: grid; gap: 6px; }
.form-grid label > span { color: var(--muted); font-size: 9px; }
.wide-field { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); padding: 10px 11px; color: var(--ink); outline: 0; font-size: 11px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(84,124,184,.13); }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.form-actions p { margin: 0; color: var(--muted); font-size: 10px; }
.primary-button { border: 0; border-radius: 8px; background: var(--ink); color: var(--window); padding: 10px 15px; cursor: pointer; font-size: 11px; }
.primary-button:hover { background: #514d45; }
.info-card { min-height: 300px; }
.source-status-list { display: grid; margin-top: 16px; }
.source-status-row { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status-dot.ok { background: #73a973; }
.status-dot.cached { background: var(--yellow); }
.status-dot.error { background: var(--coral); }
.source-status-row strong { display: block; font-size: 11px; }
.source-status-row small { display: block; color: var(--muted); font-size: 9px; }
.source-status-row code { color: var(--muted); font: 500 8px/1 var(--mono); }
.method-copy h3 { margin: 22px 0 6px; font-family: var(--display); font-weight: 500; }
.method-copy p, .method-copy li { color: var(--muted); font-size: 11px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 60;
  transform: translate(-50%, 12px);
  border-radius: 8px;
  background: var(--ink);
  color: var(--window);
  padding: 10px 14px;
  opacity: 0;
  pointer-events: none;
  font-size: 10px;
  box-shadow: 0 10px 30px rgba(29,35,33,.22);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.show { opacity: 1; transform: translate(-50%,0); }
.error-panel { grid-column: 1 / -1; border: 1px solid rgba(217,104,99,.5); border-radius: 12px; background: #f0d7d2; padding: 24px; }
.error-panel h3 { margin-top: 0; font-family: var(--display); font-weight: 500; }
.error-panel code { font-family: var(--mono); font-size: 10px; }

@keyframes reveal { to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 1180px) {
  .featured-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .collection-header { grid-template-columns: minmax(0,1fr) 220px; gap: 28px; }
  .stream-layout { grid-template-columns: minmax(0,1fr); }
  .radar-panel { position: static; display: grid; grid-template-columns: 150px minmax(0,1fr) 180px; gap: 12px 18px; align-items: start; }
  .radar-panel h3 { grid-row: 2; margin: 0; }
  .radar-bars { grid-column: 2; grid-row: 1 / span 2; }
  .radar-note { grid-column: 3; grid-row: 1 / span 2; margin: 0; padding: 0; border: 0; }
  .panel-button { grid-column: 3; margin: 0; align-self: end; }
}

@media (max-width: 900px) {
  body { background: var(--window); }
  .workspace-window { width: 100%; margin: 0; border-radius: 0; }
  .workspace-body { grid-template-columns: minmax(0,1fr); }
  .library-sidebar {
    position: static;
    min-height: 0;
    height: auto;
    display: block;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
    overflow: hidden;
  }
  .sidebar-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .sidebar-link { width: auto; flex: 0 0 auto; gap: 8px; }
  .sidebar-library { margin-top: 9px; }
  .sidebar-library h2 { display: none; }
  .sidebar-category-list { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; }
  .sidebar-category { width: auto; flex: 0 0 auto; }
  .sidebar-collection, .sidebar-footer { display: none; }
  .collection-header { grid-template-columns: minmax(0,1fr); }
  .signal-board { max-width: 420px; width: 100%; }
  .featured-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stream-list { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 620px) {
  body { font-size: 14px; }
  .workspace-window { width: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .window-chrome { min-height: 48px; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; padding: 0 10px; }
  .traffic-lights i { width: 8px; height: 8px; }
  .window-breadcrumb { font-size: 10px; }
  .window-brand, .breadcrumb-slash { display: none; }
  .window-actions { gap: 2px; }
  .chrome-button { display: none; }
  .chrome-button-primary { display: inline-flex; padding: 7px 9px; font-size: 9px; }
  .library-sidebar { padding: 8px 10px; }
  .sidebar-link { padding: 6px 7px; font-size: 10px; }
  .sidebar-category { padding: 5px 7px; font-size: 9px; }
  .collection-header { gap: 22px; padding: 26px 16px 20px; }
  .edition-line { flex-wrap: wrap; font-size: 8px; }
  .edition-divider { width: 16px; }
  #issueLabel { display: none; }
  .title-row { align-items: start; }
  .title-row h1 { font-size: clamp(38px, 13vw, 52px); }
  .edit-glyph { margin-top: 4px; }
  .collection-deck { font-size: 12px; }
  .collection-actions { flex-wrap: wrap; }
  .signal-board { grid-template-columns: repeat(4,1fr); }
  .metric { min-height: 68px; padding: 10px 7px; border-bottom: 0; border-right: 1px solid var(--line); }
  .metric:last-child { border-right: 0; }
  .metric strong { font-size: 19px; }
  .metric span { margin-top: 7px; font-size: 8px; }
  .library-toolbar { margin: 0 16px; }
  .library-tab { padding: 9px 10px; font-size: 9px; }
  .library-tab span { display: none; }
  .platform-chips { padding: 11px 0; }
  .featured-section, .stream-section { padding-left: 16px; padding-right: 16px; }
  .section-heading, .stream-heading { display: block; }
  .section-heading > p, .stream-caption { margin-top: 8px; text-align: left; }
  .featured-grid { grid-template-columns: minmax(0,1fr); }
  .featured-card { min-height: 286px; }
  .featured-card h3 { font-size: 22px; }
  .control-desk { grid-template-columns: minmax(0,1fr); }
  .platform-filters { grid-column: 1; }
  .radar-panel { display: block; }
  .radar-panel h3 { margin: 8px 0 16px; }
  .radar-note { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
  .panel-button { margin-top: 14px; }
  .site-footer { margin: 0 16px; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .wide-field { grid-column: 1; }
  .modal-card { padding: 20px; }
}

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