:root {
  color-scheme: light;
  /* Concept v2 pinboard kraft — light warm cardboard (#b79b7b family) */
  --kraft: #b79b7b;
  --kraft-deep: #a08a68;
  --kraft-board: #b79b7b;
  --paper: #f4ead6;
  --paper-bright: #fbf3e4;
  --ink: #2a2118;
  --muted: #6b5a48;
  --faint: #9a8670;
  --border: #b89868;
  --border-strong: #8f7044;
  --accent: #b4232a;
  --accent-hover: #8f1a20;
  --accent-soft: #f3ddd8;
  --success: #2d7a3e;
  --success-soft: #d8efd4;
  --warning: #9a6b12;
  --warning-soft: #f5e7c0;
  --error: #a13435;
  --error-soft: #f5ddd8;
  --shadow: 0 14px 32px rgb(42 33 24 / 0.22);
  --focus: 0 0 0 3px rgb(180 35 42 / 0.3);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: "Segoe UI", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  background: var(--kraft);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-width: 320px; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  /* Match concept: pale kraft cardboard board, no heavy brown wash */
  background-color: #b79b7b;
  background-image:
    linear-gradient(180deg, rgb(255 250 240 / 0.1), rgb(90 55 20 / 0.03)),
    url("/static/ui/kraft.jpg");
  background-size: auto, 520px 520px;
  background-repeat: repeat;
}

/* Pinboard page: same continuous kraft board as concept (rail + listings share paper) */
.page-dashboard {
  background-color: #b38f6a;
  background-image: url("/static/ui/pinboard-paper-v3.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  animation: board-reveal 260ms var(--ease-out) both;
}

.page-diagnostics {
  animation: board-reveal 260ms var(--ease-out) both;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.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;
}

/* —— Top bar: minimal; hidden on desktop pinboard/bay —— */
.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 56px;
  padding: 0 18px;
  border-bottom: 2px solid rgb(42 33 24 / 0.18);
  background: linear-gradient(180deg, #f0e2c8, #e2cfab);
}

.page-dashboard .topbar,
.page-diagnostics .topbar {
  display: none;
}

.brand {
  justify-self: start;
  text-decoration: none;
  color: var(--ink);
}

.brand-stamp-inline {
  display: inline-block;
  padding: 5px 10px;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-1deg);
}

.main-nav {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 4px;
}

.main-nav a {
  position: relative;
  display: grid;
  align-items: center;
  padding: 0 16px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.main-nav a[aria-current="page"] {
  color: var(--accent);
}

.main-nav a[aria-current="page"]::after {
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 3px;
  background: var(--accent);
  content: "";
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 18px;
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.button:active { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: 0.72; }

.button-primary {
  justify-self: end;
  background: var(--accent);
  color: #fff8ef;
  box-shadow: 0 5px 0 rgb(90 18 22 / 0.4);
}

.button-primary:hover:not(:disabled) { background: var(--accent-hover); }

.button-secondary {
  border-color: var(--border-strong);
  background: var(--paper);
  color: var(--ink);
}

.button-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgb(255 248 239 / 0.4);
  border-top-color: #fff8ef;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.run-button.is-loading .button-spinner { display: block; }

main {
  width: min(1440px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 56px;
}

.page-dashboard main {
  width: 100%;
  max-width: none;
  padding-top: 18px;
}

/* —— Pinboard dashboard —— */
.dashboard-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 10px 31px;
  align-items: start;
}

/* Hide float nav on pinboard — concept has no top chrome */
.page-dashboard .float-nav {
  display: none !important;
}

/*
 * Scrapbook left rail — v2-listings-pinboard concept stack (asset-first):
 * open stamp wordmark → subtitle → distressed TODAY frame → RUN CHECK
 * → source dots → kraft scrap chips + freehand oval asset on active
 * No panel, no more-filters, no status face, no SaaS chrome.
 */
.control-rail.scrapbook-rail {
  position: sticky;
  top: 10px;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 22px 2px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* The concept uses a separate paper stock for the whole menu column. */
.control-rail.scrapbook-rail::before {
  position: absolute;
  z-index: -1;
  top: -28px;
  right: 0;
  left: 0;
  min-height: calc(100vh + 28px);
  border-right: 1px solid rgb(84 54 29 / 0.24);
  background-color: #bfa98d;
  background-image: url("/static/ui/menu-paper-v3.jpg");
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow:
    inset -7px 0 14px rgb(77 48 25 / 0.06),
    8px 0 18px rgb(66 41 21 / 0.08);
  content: "";
  pointer-events: none;
}

.rail-brand {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 100%;
  text-align: center;
}

/* Open rubber stamp — transparent PNG, no rectangular frame */
.wordmark-img {
  display: block;
  width: min(100%, 235px);
  height: auto;
  margin: 0 auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: rotate(-3deg);
  mix-blend-mode: multiply;
  filter: contrast(1.12) saturate(1.05);
}

.rail-subtitle {
  margin: 0;
  color: #2e2218;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  line-height: 1.35;
  text-transform: uppercase;
}

/* Taped torn-paper control sheet from the pinboard concept. */
.rail-board {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 282px;
  min-height: 304px;
  margin-top: 4px;
  padding: 20px 16px 24px;
  background: url("/static/ui/cardboard-panel-v2.png") center / 100% 100% no-repeat;
  filter: drop-shadow(3px 5px 4px rgb(58 35 17 / 0.2));
}

.rail-board::before {
  position: absolute;
  z-index: 2;
  top: -2px;
  left: -12px;
  width: 74px;
  height: 24px;
  background: rgb(126 75 47 / 0.58);
  box-shadow: inset 0 0 10px rgb(70 36 20 / 0.18);
  content: "";
  opacity: 0.82;
  pointer-events: none;
  transform: rotate(-38deg);
}

/* TODAY rubber stamp — distressed double frame asset + live date */
.date-stamp {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  width: 226px;
  min-height: 114px;
  margin-top: 0;
  padding: 22px 18px 18px;
  border: 0;
  background: transparent;
  color: #b4232a;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-2deg);
  box-shadow: none;
}

.date-stamp-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  mix-blend-mode: multiply;
  filter: contrast(1.15);
}

.date-stamp-label {
  position: relative;
  z-index: 1;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Segoe UI", sans-serif;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  line-height: 1;
  color: #b4232a;
}

.date-stamp strong {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
  color: #b4232a;
}

/* RUN CHECK — solid red capsule + circled arrow (concept) */
.rail-run {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 218px;
  min-height: 56px;
  margin-top: 0;
  padding: 12px 18px 12px 24px;
  border: 0;
  border-radius: 9px;
  background: #c01f28;
  color: #fff8ef;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow:
    0 3px 0 #7a1218,
    0 5px 8px rgb(80 10 14 / 0.16);
}

.rail-run:hover:not(:disabled) {
  background: #a81b23;
}

.rail-run:disabled,
.rail-run.is-loading {
  opacity: 0.95;
  cursor: wait;
  background: #c01f28;
  color: #fff8ef;
}

.rail-run .button-spinner {
  border-color: rgb(255 248 239 / 0.35);
  border-top-color: #fff8ef;
}

.rail-run-arrow {
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border: 2px solid #fff8ef;
  border-radius: 50%;
  font-size: 0.78rem;
  line-height: 1;
  font-weight: 700;
  background: transparent;
}

.rail-section-label {
  width: 100%;
  margin: 0 0 10px;
  color: #2e2218;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
}

.source-health {
  width: 100%;
  margin-top: 0;
}

/* Concept: colored dots + short names, centered wrap */
.source-health-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-health-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #2e2218;
  font-size: 0.61rem;
  font-weight: 750;
}

.health-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a19892;
}

.source-health-item.is-success .health-dot { background: #2f9a3a; }
.source-health-item.is-attention .health-dot,
.source-health-item.is-running .health-dot,
.source-health-item.is-never_run .health-dot { background: #d4a017; }
.source-health-item.is-failed .health-dot,
.source-health-item.is-blocked .health-dot,
.source-health-item.is-login_required .health-dot { background: #c0392b; }

/* Kraft paper scrap chips — asset scrap + freehand oval on active */
.rail-periods {
  display: grid;
  grid-template-columns: repeat(3, 80px);
  gap: 6px;
  width: 252px;
  margin-top: 12px;
  justify-items: center;
  padding: 10px 4px 8px;
}

.period-button {
  position: relative;
  min-height: 38px;
  min-width: 80px;
  padding: 10px 8px;
  border: 0;
  border-radius: 2px;
  background: url("/static/ui/cardboard-chip-v2.png") center / 100% 100% no-repeat;
  color: #24180f;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 1px 2px 3px rgb(42 28 14 / 0.22);
  transform: rotate(-2.4deg);
}

/* tiny pin dots like concept scraps */
.period-button::before {
  position: absolute;
  top: 6px;
  left: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3a2414;
  content: "";
  opacity: 0.75;
  z-index: 1;
}

.period-button:nth-child(2) { transform: rotate(2.6deg); }
.period-button:nth-child(2)::before { left: auto; right: 8px; top: 7px; }
.period-button:nth-child(3) { transform: rotate(-1.6deg); }
.period-button:nth-child(3)::before { top: auto; bottom: 7px; left: 8px; }
.period-button:nth-child(4) { transform: rotate(2deg); }
.period-button:nth-child(4)::before { left: auto; right: 9px; top: auto; bottom: 6px; }

.period-button:hover {
  filter: brightness(1.04);
}

/* Active: freehand red pen oval asset around kraft scrap (not a filled pill) */
.period-button.is-active {
  border: 0;
  border-radius: 2px;
  background: url("/static/ui/cardboard-chip-v2.png") center / 100% 100% no-repeat;
  color: #24180f;
  box-shadow: 1px 2px 3px rgb(42 28 14 / 0.22);
  transform: rotate(-2.4deg);
}

.period-button.is-active::after {
  position: absolute;
  inset: -5px -8px;
  background: url("/static/ui/freehand-oval.png") center / 100% 100% no-repeat;
  content: "";
  pointer-events: none;
  transform: rotate(-4deg);
  opacity: 0.95;
  z-index: 2;
}

.period-button .period-mark {
  display: none !important;
}

/* Functional filters — off the scrapbook face */
.rail-hidden-filters {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Status lives in toast / sr-only — not on rail face */
.scrapbook-rail .rail-status,
.control-rail .rail-status {
  display: none !important;
}

.rail-more {
  display: none !important;
}

/* Quiet empty board — same shell, no cinematic takeover */
.empty-pinboard {
  grid-column: 1 / -1;
  display: grid;
  place-content: center;
  min-height: 42vh;
  padding: 32px 20px;
  text-align: center;
}

.empty-pinboard-title {
  margin: 0;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.empty-pinboard-copy {
  max-width: 36ch;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.listing-feed.pinboard.is-empty {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 42vh;
}

.field,
.select-field {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1.5px solid rgb(42 33 24 / 0.22);
  border-radius: 8px;
  background: rgb(255 248 236 / 0.9);
}

.field:focus-within,
.select-field:focus-within {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

.field svg {
  flex: 0 0 auto;
  width: 16px;
  margin-left: 10px;
  fill: var(--faint);
}

.field input,
.select-field select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.8rem;
}

.select-field select { cursor: pointer; }

.rail-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px dashed rgb(42 33 24 / 0.25);
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--faint);
}

.run-summary[data-status="success"] .status-dot { background: var(--success); }
.run-summary[data-status="partial"] .status-dot,
.run-summary[data-status="running"] .status-dot,
.run-summary[data-status="attention"] .status-dot { background: var(--warning); }
.run-summary[data-status="failed"] .status-dot { background: var(--error); }

.pinboard-stage {
  min-width: 0;
  padding-top: 36px;
  padding-right: 40px;
}

.pinboard-tools {
  display: flex;
  justify-content: flex-end;
  min-height: 42px;
  padding: 0 18px 10px 4px;
}

.pinboard-sort {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 218px;
  min-height: 38px;
  padding: 7px 11px 7px 14px;
  background: url("/static/ui/cardboard-chip-v2.png") center / 100% 100% no-repeat;
  color: #322318;
  box-shadow: 1px 2px 4px rgb(42 28 14 / 0.2);
  transform: rotate(0.7deg);
}

.pinboard-sort > span {
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pinboard-sort select {
  min-width: 0;
  flex: 1;
  padding: 3px 22px 3px 5px;
  border: 0;
  border-bottom: 1px solid rgb(56 37 22 / 0.25);
  border-radius: 0;
  background-color: transparent;
  color: #322318;
  cursor: pointer;
  font-size: 0.67rem;
  font-weight: 850;
}

/* New filters use the same hand-cut paper treatment as the existing sort chip. */
.pinboard-filter-strip {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-right: auto;
}

.pinboard-filter-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 130px;
  min-height: 38px;
  padding: 7px 10px 7px 12px;
  background: url("/static/ui/cardboard-chip-v2.png") center / 100% 100% no-repeat;
  color: #322318;
  box-shadow: 1px 2px 4px rgb(42 28 14 / 0.16);
}

.pinboard-filter-chip > span {
  flex: 0 0 auto;
  color: #59432c;
  font-size: 0.56rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pinboard-filter-chip input,
.pinboard-filter-chip select {
  min-width: 0;
  width: 100%;
  padding: 3px 18px 3px 4px;
  border: 0;
  border-bottom: 1px solid rgb(56 37 22 / 0.25);
  border-radius: 0;
  background: transparent;
  color: #322318;
  font-size: 0.64rem;
  font-weight: 800;
}

.pinboard-filter-chip input::placeholder { color: #806c54; }

.pinboard-filter-chip:first-child { min-width: 170px; }

.category-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid rgb(180 35 42 / 0.36);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mobile-magazine-head {
  display: none;
}

/* Polaroid pinboard — photo-first like concept */
.listing-feed.pinboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, 278px);
  justify-content: space-between;
  align-items: start;
  gap: 124px 18px;
  width: 100%;
  padding: 8px 18px 150px 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  transition: opacity 160ms var(--ease-out), transform 180ms var(--ease-out);
}

.listing-feed.pinboard.is-changing {
  opacity: 0.45;
  transform: translateY(5px);
}

.listing-feed.pinboard.is-empty {
  display: block;
  min-height: calc(100vh - 40px);
  padding: 0;
}

.listing-card {
  position: relative;
  display: grid;
  grid-template-rows: auto;
  min-width: 0;
  width: 278px;
  padding: 12px 12px 24px;
  border: 1px solid rgb(42 33 24 / 0.14);
  border-radius: 2px;
  background: #fbf6ec;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.85) inset,
    4px 6px 0 rgb(42 33 24 / 0.12),
    0 14px 26px rgb(42 33 24 / 0.18);
  transform: rotate(-0.7deg);
  animation: card-pin-in 360ms var(--ease-out) both;
  animation-delay: 0ms;
}

.listing-card.card-stagger-1 { animation-delay: 38ms; }
.listing-card.card-stagger-2 { animation-delay: 76ms; }
.listing-card.card-stagger-3 { animation-delay: 114ms; }
.listing-card.card-stagger-4 { animation-delay: 152ms; }
.listing-card.card-stagger-5 { animation-delay: 190ms; }
.listing-card.card-stagger-6 { animation-delay: 228ms; }
.listing-card.card-stagger-7 { animation-delay: 266ms; }
.listing-card.card-stagger-8 { animation-delay: 304ms; }

.listing-card:nth-child(2n) { transform: rotate(0.65deg); }
.listing-card:nth-child(3n) { transform: rotate(-0.3deg); }
.listing-card:nth-child(4n) { transform: rotate(1deg); }

.listing-card:not(.skeleton-card):hover {
  z-index: 2;
  transform: translateY(-4px) rotate(0deg) scale(1.015);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.85) inset,
    0 20px 32px rgb(42 33 24 / 0.24);
}

.listing-card.is-gone { opacity: 0.78; filter: grayscale(0.2); }

.polaroid-hover {
  display: none;
}

.listing-image-link {
  position: relative;
  display: block;
  overflow: visible;
  aspect-ratio: 1 / 1;
  border: 1px solid rgb(42 33 24 / 0.12);
  background: linear-gradient(145deg, #e8dcc8, #d2c0a4);
  color: inherit;
  text-decoration: none;
}

.source-sticker {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: 8px;
  max-width: 55%;
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid rgb(42 33 24 / 0.12);
  background: rgb(255 252 244 / 0.92);
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 1px 1px 0 rgb(42 33 24 / 0.1);
}

.mobile-listing-sticker {
  display: none;
}

.listing-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: inset(0);
  transition: transform 260ms var(--ease-out);
}

.listing-card:hover .listing-image { transform: scale(1.03); }

.fresh-ribbon {
  position: absolute;
  z-index: 5;
  top: -8px;
  right: auto;
  left: 14px;
  width: auto;
  padding: 8px 18px 8px 15px;
  background: var(--accent);
  color: #fff8ef;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-2deg);
  box-shadow: 0 2px 8px rgb(42 33 24 / 0.28);
  animation: ribbon-drop 320ms 180ms var(--ease-out) both;
}

.fresh-ribbon::after {
  position: absolute;
  top: 0;
  right: -10px;
  width: 14px;
  height: 100%;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 55% 50%, 100% 100%, 0 100%);
  content: "";
}

.gone-ribbon {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgb(42 33 24 / 0.78);
  color: #f6efe2;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.price-tag {
  position: absolute;
  z-index: 4;
  right: -22px;
  bottom: -136px;
  left: auto;
  display: grid;
  align-content: start;
  gap: 3px;
  width: 226px;
  min-height: 146px;
  max-width: calc(100% - 8px);
  padding: 18px 18px 15px;
  overflow: hidden;
  border: 0;
  background: url("/static/ui/listing-postit-v1.png") center / 100% 100% no-repeat;
  box-shadow: none;
  color: #282117;
  transform: rotate(-1.8deg);
  transition: transform 180ms var(--ease-out), filter 180ms var(--ease-out);
}

.listing-card:hover .price-tag {
  filter: brightness(1.025);
  transform: translate(2px, 2px) rotate(-0.5deg);
}

.postit-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.price-tag-label {
  color: #6c4d1f;
  font-size: 0.53rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.postit-source {
  min-width: 0;
  overflow: hidden;
  color: #775b31;
  font-size: 0.48rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.postit-category {
  justify-self: start;
  padding: 2px 5px;
  border: 1px solid rgb(180 35 42 / 0.38);
  color: #8f1820;
  font-size: 0.46rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.price-tag-value {
  font-size: 1.3rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}

.postit-title {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  font-family: var(--display);
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.025em;
  line-height: 1.12;
  text-transform: uppercase;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.postit-facts {
  display: block;
  overflow: hidden;
  color: #594a34;
  font-size: 0.52rem;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.postit-fetched {
  margin-top: auto;
  padding-top: 3px;
  border-top: 1px solid rgb(90 66 30 / 0.22);
  color: #6b2a20;
  font-size: 0.5rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
}
.image-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--faint);
  background: linear-gradient(145deg, #e8dcc8, #d2c0a4);
}

.image-placeholder svg {
  width: 72px;
  fill: currentColor;
  opacity: 0.7;
}

/* Desktop pinboard: polaroid only (photo + tags). Magazine body is mobile. */
.listing-card-body {
  display: none;
  gap: 8px;
  padding: 10px 2px 2px;
}

.listing-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 18px 24px 42px 4px;
}

.page-diagnostics .bay-banner {
  animation: panel-rise 320ms var(--ease-out) both;
}

.page-diagnostics .source-card {
  animation: panel-rise 340ms var(--ease-out) both;
}

.page-diagnostics .source-card:nth-child(2n) { animation-delay: 45ms; }
.page-diagnostics .source-card:nth-child(3n) { animation-delay: 90ms; }

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pagination-page,
.pagination-arrow {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 40px;
  padding: 0 11px;
  border: 0;
  background: url("/static/ui/cardboard-chip-v2.png") center / 100% 100% no-repeat;
  color: #2d2117;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 1px 2px 4px rgb(42 28 14 / 0.22);
  transition: filter 150ms var(--ease-out), transform 150ms var(--ease-out);
}

.pagination-page:nth-child(2n) { transform: rotate(1.5deg); }
.pagination-page:nth-child(2n + 1) { transform: rotate(-1.2deg); }

.pagination-page:hover,
.pagination-arrow:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-2px) rotate(0deg);
}

.pagination-page.is-active {
  position: relative;
  color: #8f1820;
}

.pagination-page.is-active::after {
  position: absolute;
  inset: -5px -7px;
  background: url("/static/ui/freehand-oval.png") center / 100% 100% no-repeat;
  content: "";
  pointer-events: none;
}

.pagination-arrow {
  border-radius: 50%;
  font-size: 1rem;
}

.pagination-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.pagination-gap {
  color: #6f5a45;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

@media (min-width: 851px) and (pointer: fine), (min-width: 961px) {
  .polaroid-hover {
    position: absolute;
    z-index: 7;
    top: 18px;
    right: 14px;
    bottom: auto;
    display: flex;
    opacity: 1;
  }

  .polaroid-hover .listing-favorite {
    display: grid;
    place-items: center;
    width: 34px;
    min-height: 34px;
    padding: 0;
    border-color: rgb(58 42 28 / 0.2);
    background: rgb(251 246 236 / 0.9);
    box-shadow: 1px 2px 5px rgb(42 28 14 / 0.2);
    transition: color 150ms var(--ease-out), transform 150ms var(--ease-out);
  }

  .polaroid-hover .listing-favorite:hover {
    color: var(--accent);
    transform: scale(1.08) rotate(8deg);
  }

  .polaroid-hover .listing-favorite.is-favorite {
    background: #fff1a8;
  }
}

.listing-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 720;
}

.listing-source {
  color: var(--muted);
  text-decoration: none;
}

.listing-source:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.listing-title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 850;
  letter-spacing: -0.015em;
  line-height: 1.28;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.listing-title:hover { color: var(--accent); }

.listing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.listing-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.listing-meta svg {
  width: 12px;
  fill: var(--faint);
}

.listing-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.listing-favorite {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1.5px solid rgb(42 33 24 / 0.2);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 750;
}

.listing-favorite.is-favorite {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.listing-favorite:disabled { cursor: wait; opacity: 0.65; }
.listing-favorite svg { width: 14px; fill: currentColor; }

.listing-open {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff8ef;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
}

.listing-open:hover { background: var(--accent-hover); }

.magazine-price { display: none; }

/* —— Cinematic empty —— */
body.is-cinematic-empty .topbar { display: none !important; }

body.is-cinematic-empty main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.dashboard-shell.is-cinematic-empty {
  grid-template-columns: 1fr;
  gap: 0;
  width: 100%;
}

.dashboard-shell.is-cinematic-empty .control-rail { display: none; }

.dashboard-shell.is-cinematic-empty .pinboard-stage,
.dashboard-shell.is-cinematic-empty .listing-feed.pinboard.is-empty,
.dashboard-shell.is-cinematic-empty .empty-state.cinematic {
  min-height: 100vh;
}

.empty-state {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(70vh, 640px);
  padding: 28px 18px;
  overflow: hidden;
  border: 2px solid rgb(42 33 24 / 0.16);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgb(30 24 18 / 0.18), rgb(30 24 18 / 0.38)),
    url("/static/empty-road.jpg") center / cover no-repeat;
  box-shadow: var(--shadow);
  text-align: center;
}

.empty-state.cinematic {
  width: 100%;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.empty-float-logo {
  position: absolute;
  z-index: 2;
  top: 24px;
  left: 22px;
  width: min(190px, 30vw);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: rotate(-4deg);
}

.empty-float-logo img {
  display: block;
  width: 100%;
  background: transparent;
  mix-blend-mode: multiply;
  filter: drop-shadow(2px 3px 0 rgb(20 14 8 / 0.25));
}

.empty-float-run {
  position: absolute;
  z-index: 2;
  top: 28px;
  right: 24px;
  min-height: 50px;
  padding: 12px 26px 16px;
  border: 0;
  border-radius: 0;
  background: var(--accent);
  color: #fff8ef;
  font-size: 1rem;
  font-weight: 950;
  letter-spacing: 0.03em;
  text-transform: none;
  box-shadow: 4px 5px 0 rgb(90 18 22 / 0.35);
  transform: rotate(3deg);
  /* Torn bottom edge */
  clip-path: polygon(
    0 0, 100% 0, 100% 72%,
    96% 88%, 92% 76%, 88% 94%, 84% 78%, 80% 96%,
    76% 80%, 72% 100%, 68% 82%, 64% 96%, 60% 78%,
    56% 100%, 52% 80%, 48% 94%, 44% 76%, 40% 98%,
    36% 80%, 32% 100%, 28% 78%, 24% 96%, 20% 80%,
    16% 100%, 12% 82%, 8% 96%, 4% 78%, 0 92%
  );
}

.empty-card {
  position: relative;
  z-index: 2;
  width: min(520px, calc(100% - 40px));
  padding: 30px 28px 24px;
  border: 1px solid rgb(42 33 24 / 0.16);
  background:
    linear-gradient(180deg, rgb(255 252 244 / 0.4), transparent),
    #f7f0e2;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.75) inset,
    0 22px 50px rgb(20 14 8 / 0.4);
  transform: rotate(-0.5deg);
}

.empty-card h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 950;
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-transform: uppercase;
}

.empty-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 20px;
  padding-top: 4px;
}

.empty-actions .empty-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 750;
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.empty-actions .empty-link:hover { color: var(--accent-hover); }

.empty-actions .empty-sep {
  color: rgb(42 33 24 / 0.25);
  font-weight: 300;
}

.empty-state.simple {
  background: var(--paper);
  min-height: 280px;
}

.empty-state.simple svg {
  width: 88px;
  fill: var(--border-strong);
  opacity: 0.8;
}

.empty-state.simple h2 {
  margin: 16px 0 8px;
  font-size: 1.15rem;
}

.empty-state.simple p {
  max-width: 42ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

/* Skeletons */
.skeleton {
  border-radius: 4px;
  background: #e2d3b8;
  animation: pulse 1.4s ease-in-out infinite alternate;
}

.skeleton-card .skeleton-image {
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 0;
}

.skeleton-copy {
  display: grid;
  gap: 10px;
  padding: 14px 4px;
}

.skeleton-line { display: block; width: 100%; height: 11px; }
.skeleton-line.short { width: 34%; }
.skeleton-line.medium { width: 64%; }

/* —— Diagnostics bay —— */
.page-diagnostics main {
  width: min(1180px, calc(100% - 28px));
  padding-top: 28px;
}

.bay-banner {
  margin-bottom: 16px;
  padding: 0;
  border: 0;
  background: transparent;
}

.bay-banner-inner,
.bay-banner-face {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "timer headline run"
    "sub sub sub";
  align-items: center;
  gap: 10px 16px;
  min-height: 118px;
  padding: 20px 22px;
  overflow: hidden;
  border: 3px solid rgb(42 28 16 / 0.75);
  border-radius: 0;
  /* Industrial asset is primary — no cream wash */
  background: url("/static/ui/bay-banner.jpg") center / cover no-repeat;
  box-shadow:
    5px 6px 0 rgb(42 28 16 / 0.28),
    inset 0 0 0 1px rgb(255 255 255 / 0.08);
}

.bay-banner-face::before {
  display: none; /* industrial plate asset is the face — no wash */
}

.bay-timer {
  position: relative;
  z-index: 1;
  grid-area: timer;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 4px solid #fff8ef;
  border-radius: 50%;
  color: #fff8ef;
  font-size: 1.6rem;
  font-weight: 900;
  background: var(--accent);
  box-shadow: 2px 3px 0 rgb(20 12 8 / 0.35);
}

.bay-headline {
  position: relative;
  z-index: 1;
  grid-area: headline;
  margin: 0;
  color: #f7efe0;
  font-size: clamp(1.5rem, 3.4vw, 2.25rem);
  font-weight: 950;
  letter-spacing: 0.06em;
  line-height: 1.02;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgb(20 12 8 / 0.55), 0 0 18px rgb(20 12 8 / 0.35);
}

.bay-banner-run {
  position: relative;
  z-index: 1;
  grid-area: run;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  min-width: 132px;
  padding: 10px 18px;
  border: 3px solid #2a1810;
  border-radius: 2px;
  background: var(--accent);
  color: #fff8ef;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 3px 4px 0 rgb(20 12 8 / 0.45);
  transform: rotate(-1deg);
}

.bay-banner-run:hover:not(:disabled) {
  background: var(--accent-hover);
}

.bay-banner-run:disabled {
  cursor: wait;
  opacity: 0.75;
}

.bay-sub {
  position: relative;
  z-index: 1;
  grid-area: sub;
  color: #f0e2cc;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgb(20 12 8 / 0.5);
}

.bay-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
  opacity: 0.72;
}

.bay-refresh {
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 2px;
  border: 1px dashed rgb(42 33 24 / 0.35);
  background: transparent;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.schedule-note {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--muted);
  font-size: 0.7rem;
}

.schedule-note strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.source-bay-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.source-card {
  display: grid;
  gap: 0;
  padding: 0;
  border: 2px solid rgb(62 42 24 / 0.65);
  border-radius: 0;
  /* Dirty kraft instrument plate — not cream SaaS */
  background:
    linear-gradient(180deg, rgb(90 55 20 / 0.08), rgb(40 28 16 / 0.12)),
    url("/static/ui/kraft.jpg") center / 280px 280px repeat;
  box-shadow:
    3px 4px 0 rgb(42 28 16 / 0.22);
  overflow: hidden;
}

.source-card.is-blocked,
.source-card.is-failed,
.source-card.is-login_required {
  border-color: rgb(140 40 40 / 0.85);
  background:
    linear-gradient(180deg, rgb(160 40 30 / 0.18), rgb(90 30 20 / 0.12)),
    url("/static/ui/kraft.jpg") center / 280px 280px repeat;
}

.source-card.is-attention {
  border-color: rgb(140 100 20 / 0.85);
  background:
    linear-gradient(180deg, rgb(160 120 20 / 0.16), rgb(90 60 20 / 0.1)),
    url("/static/ui/kraft.jpg") center / 280px 280px repeat;
}

/* Worn horizontal instrument strip */
.source-card-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) auto auto minmax(100px, 0.95fr);
  align-items: center;
  gap: 12px 14px;
  min-height: 96px;
  padding: 14px 14px 12px;
  background: transparent;
}

.source-name {
  display: grid;
  gap: 0;
  min-width: 0;
}

.source-name strong {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}

.source-name small,
.cell-muted { color: var(--muted); }

.source-found {
  display: grid;
  justify-items: center;
  gap: 0;
  min-width: 64px;
}

.source-found strong {
  font-size: 2.55rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  line-height: 0.95;
  color: var(--ink);
}

.source-duration {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.source-duration-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-transform: uppercase;
}

.duration-track {
  height: 14px;
  overflow: hidden;
  border: 1px solid rgb(42 33 24 / 0.22);
  border-radius: 2px;
  background: rgb(42 33 24 / 0.1);
}

.duration-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f7a30, #5aaa62);
}

.duration-bar.duration-10 { width: 10%; }
.duration-bar.duration-20 { width: 20%; }
.duration-bar.duration-30 { width: 30%; }
.duration-bar.duration-40 { width: 40%; }
.duration-bar.duration-50 { width: 50%; }
.duration-bar.duration-60 { width: 60%; }
.duration-bar.duration-70 { width: 70%; }
.duration-bar.duration-80 { width: 80%; }
.duration-bar.duration-90 { width: 90%; }
.duration-bar.duration-100 { width: 100%; }

.source-card.is-blocked .duration-bar,
.source-card.is-failed .duration-bar {
  background: linear-gradient(90deg, var(--error), #d46a62);
}

.source-card.is-attention .duration-bar,
.source-card.is-running .duration-bar {
  background: linear-gradient(90deg, var(--warning), #d4b05a);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: max-content;
  min-width: 108px;
  min-height: 52px;
  padding: 12px 20px;
  border: 4px solid currentColor;
  border-radius: 999px;
  background: #f4ffe8;
  font-size: 1.05rem;
  font-weight: 950;
  letter-spacing: 0.01em;
  text-transform: none;
  box-shadow: 2px 3px 0 rgb(42 33 24 / 0.12);
}

/* Concept uses solid oval text, not a leading dot */
.status-badge::before { display: none; }

.status-success { color: #178a28; background: #e4f8dc; border-color: #1f9a32; }
.status-attention,
.status-running,
.status-never_run,
.status-partial { color: #8a6208; background: #fff0b8; border-color: #c49a2a; }
.status-failed,
.status-blocked,
.status-login_required { color: #9a2222; background: #ffd8d0; border-color: #c04040; }

.source-found .found-label {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 950;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.source-found .found-new {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.source-details {
  border-top: 1px dashed rgb(42 28 16 / 0.35);
  margin: 0;
  padding: 0 12px;
  background: rgb(42 28 16 / 0.08);
}

.source-details summary {
  width: max-content;
  padding: 7px 0 6px;
  color: rgb(42 28 16 / 0.65);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.debug-note {
  opacity: 0.85;
  background: rgb(244 220 180 / 0.55) !important;
  border-style: dashed !important;
}

.debug-content {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  padding: 4px 0 10px;
}

.debug-message {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.debug-facts {
  display: grid;
  gap: 6px;
  margin: 0;
}

.debug-facts div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 8px;
  font-size: 0.71rem;
}

.debug-facts dt { color: var(--muted); }
.debug-facts dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }

.debug-final-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  text-decoration: none;
}

.raw-heading { margin: 0 0 6px; font-size: 0.7rem; }

.debug-json {
  overflow: auto;
  max-height: 200px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--ink);
  color: #ebe2d4;
  font: 0.68rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.skeleton-source-card { min-height: 148px; padding: 18px; }

.debug-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 2px solid rgb(42 33 24 / 0.16);
  border-radius: 3px;
  background: rgb(244 232 208 / 0.85);
}

.debug-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 800;
}

.debug-note h2 { margin: 2px 0 5px; font-size: 0.84rem; }
.debug-note p {
  max-width: 80ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

/* Floating desktop nav when topbar hidden — pinboard concept has none */
.float-nav {
  display: none;
}

.page-dashboard .float-nav {
  display: none !important;
}

.page-diagnostics .float-nav {
  position: fixed;
  z-index: 35;
  top: 14px;
  right: 16px;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 2px solid rgb(42 33 24 / 0.2);
  background: rgb(244 232 208 / 0.92);
  box-shadow: 2px 3px 0 rgb(42 33 24 / 0.12);
}

body.is-cinematic-empty .float-nav {
  display: none !important;
}

.float-nav a {
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.float-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Toasts */
.toast-region {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  display: grid;
  justify-items: end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 360px;
  padding: 12px 15px;
  border: 1px solid rgb(42 33 24 / 0.3);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
  font-size: 0.79rem;
  line-height: 1.4;
  animation: toast-in 220ms var(--ease-out);
}

.run-progress-toast { width: min(360px, calc(100vw - 32px)); padding: 14px; }

.run-progress-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.run-progress-copy strong,
.run-progress-copy small { display: block; }
.run-progress-copy strong { font-size: 0.8rem; }
.run-progress-copy small {
  max-width: 30ch;
  margin-top: 2px;
  overflow: hidden;
  color: #cfc3b2;
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-progress-icon {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warning);
  animation: progress-pulse 1.2s ease-in-out infinite alternate;
}

.run-progress-count {
  color: var(--paper);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.run-progress-track {
  height: 4px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.14);
}

.run-progress-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--warning);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms var(--ease-out);
}

.run-progress-track span.progress-0 { transform: scaleX(0); }
.run-progress-track span.progress-10 { transform: scaleX(0.1); }
.run-progress-track span.progress-20 { transform: scaleX(0.2); }
.run-progress-track span.progress-30 { transform: scaleX(0.3); }
.run-progress-track span.progress-40 { transform: scaleX(0.4); }
.run-progress-track span.progress-50 { transform: scaleX(0.5); }
.run-progress-track span.progress-60 { transform: scaleX(0.6); }
.run-progress-track span.progress-70 { transform: scaleX(0.7); }
.run-progress-track span.progress-80 { transform: scaleX(0.8); }
.run-progress-track span.progress-90 { transform: scaleX(0.9); }
.run-progress-track span.progress-100 { transform: scaleX(1); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { from { opacity: 0.52; } to { opacity: 1; } }
@keyframes board-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes card-pin-in {
  from {
    opacity: 0;
    transform: translateY(14px) rotate(-1.8deg) scale(0.985);
  }
  to { opacity: 1; }
}
@keyframes ribbon-drop {
  from {
    opacity: 0;
    transform: translateY(-8px) rotate(-4deg);
  }
  to {
    opacity: 1;
    transform: rotate(-2deg);
  }
}
@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes progress-pulse { from { opacity: 0.55; } to { opacity: 1; } }

@media (max-width: 1100px) {
  .listing-feed.pinboard {
    grid-template-columns: repeat(auto-fill, 278px);
  }
  .dashboard-shell { grid-template-columns: 230px minmax(0, 1fr); }
}

/* —— Mobile magazine —— */
@media (max-width: 850px), (max-width: 960px) and (pointer: coarse) {
  :root {
    --mobile-paper: #f2e7d3;
    --mobile-paper-bright: #fbf5e9;
    --mobile-ink: #251f1a;
    --mobile-muted: #79695c;
    --mobile-red: #bf1623;
    --mobile-dock: #1c1815;
    --mobile-green: #32b84b;
    --mobile-display: Impact, Haettenschweiler, "Arial Narrow Bold", "Nimbus Sans Narrow", sans-serif;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: clip;
    overscroll-behavior-x: none;
  }

  /* Keep topbar in DOM so .main-nav can fixed-bottom; hide stamp chrome only */
  .page-dashboard .topbar {
    display: block;
    position: static;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .page-dashboard .topbar .brand,
  .page-dashboard .topbar .topbar-run,
  .page-diagnostics .topbar .topbar-run {
    display: none;
  }

  .page-diagnostics .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    position: fixed;
    z-index: 40;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    justify-content: space-around;
    width: auto;
    height: calc(78px + env(safe-area-inset-bottom));
    margin: 0;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 0;
    border-top: 1px solid rgb(83 72 64);
    background-color: var(--mobile-dock);
    background-image:
      repeating-linear-gradient(
        112deg,
        transparent 0 20px,
        rgb(126 115 105 / 0.07) 21px 23px,
        transparent 24px 34px
      ),
      repeating-linear-gradient(
        68deg,
        transparent 0 27px,
        rgb(4 3 3 / 0.14) 28px 30px,
        transparent 31px 44px
      );
    box-shadow: 0 -10px 26px rgb(32 24 20 / 0.38);
    backface-visibility: hidden;
    transform: translateZ(0);
  }

  .main-nav a {
    flex: 1;
    display: grid;
    justify-items: center;
    align-content: center;
    align-self: stretch;
    gap: 4px;
    padding: 0 20px;
    color: rgb(201 190 177);
  }

  .main-nav a .nav-icon {
    display: block;
    width: 29px;
    height: 29px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
  }

  .main-nav a .nav-icon-detail {
    stroke-width: 1.7;
  }

  .main-nav a .nav-label {
    font-family: var(--mobile-display);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
  }

  .main-nav a[aria-current="page"] {
    color: var(--mobile-paper-bright);
  }

  .main-nav a[aria-current="page"]::after {
    display: none;
  }

  .main-nav a[aria-current="page"] .nav-label {
    color: #e4353f;
  }

  .float-nav { display: none !important; }

  main,
  .page-dashboard main,
  .page-diagnostics main {
    width: min(100% - 16px, 720px);
    padding-top: 12px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  body.is-cinematic-empty main {
    width: 100%;
    padding: 0;
  }

  .toast-region {
    right: 14px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    left: 14px;
  }

  .toast { max-width: 100%; }

  .dashboard-shell {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .control-rail {
    position: static;
    gap: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .control-rail.scrapbook-rail::before {
    display: none;
  }

  .rail-wordmark,
  .rail-brand,
  .rail-board,
  .date-stamp,
  .source-health,
  .rail-status,
  .rail-run,
  .rail-field {
    display: none;
  }

  /* Magazine concept: cream paper stage, not kraft brown */
  .page-dashboard {
    background-color: var(--mobile-paper);
    background-image:
      linear-gradient(180deg, var(--mobile-paper-bright), var(--mobile-paper));
    background-attachment: scroll;
    animation: none;
  }

  .page-dashboard main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 calc(112px + env(safe-area-inset-bottom));
  }

  .mobile-magazine-head {
    position: relative;
    z-index: 4;
    display: block;
    order: 0;
    margin: 0;
    min-height: 112px;
    padding: 26px 30px;
    background-color: var(--mobile-paper);
    background-image:
      linear-gradient(rgb(251 245 233 / 0.93), rgb(242 231 211 / 0.94)),
      url("/static/ui/menu-paper-v3.jpg");
    background-position: center;
    background-size: auto, 520px 520px;
  }

  .mobile-magazine-head::after {
    position: absolute;
    z-index: 5;
    right: 0;
    bottom: -20px;
    left: 0;
    height: 32px;
    background: url("/static/ui/tear-edge.png") center bottom / 100% 100% no-repeat;
    content: "";
    pointer-events: none;
    transform: scaleY(-1);
  }

  .control-rail { order: 1; }
  .pinboard-stage { order: 2; }

  .mobile-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 0;
    color: var(--mobile-ink);
  }

  .mobile-status-main {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }

  .mobile-status-num {
    font-family: var(--mobile-display);
    font-size: 4.1rem;
    font-weight: 950;
    letter-spacing: -0.04em;
    line-height: 0.76;
    font-variant-numeric: tabular-nums;
  }

  .mobile-status-copy {
    display: block;
    width: 6.4ch;
    padding: 0;
  }

  .mobile-status-copy strong {
    position: relative;
    display: block;
    font-family: var(--mobile-display);
    font-size: 1.23rem;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 0.86;
    text-transform: uppercase;
  }

  .mobile-status-copy strong::after {
    position: absolute;
    right: -11px;
    bottom: 0;
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mobile-green);
    box-shadow: 0 0 0 1px rgb(27 104 46 / 0.24);
    content: "";
  }

  .mobile-status-sync {
    display: grid;
    flex: 0 0 auto;
    gap: 2px;
    margin-left: auto;
    padding: 0;
    color: var(--mobile-ink);
    font-family: var(--mobile-display);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 0.95;
    text-align: right;
    text-transform: uppercase;
  }

  .mobile-status-sync strong {
    font-size: 1.1rem;
    letter-spacing: 0.01em;
  }

  .rail-more {
    display: none; /* keep magazine fold clean */
  }

  .dashboard-shell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .control-rail {
    order: 1;
    padding: 0;
    background: var(--mobile-paper-bright);
  }

  .control-rail.scrapbook-rail {
    padding: 0 !important;
  }

  .rail-periods {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    width: 100%;
    margin: 0;
    min-height: 60px;
    padding: 6px 28px;
    border-bottom: 0;
    background: var(--mobile-paper-bright);
    transform: none;
    z-index: 2;
  }

  .rail-brand {
    transform: none;
  }

  /* Torn paper strip under tabs into the photo fold */
  .rail-periods::after {
    position: absolute;
    right: 0;
    bottom: -22px;
    left: 0;
    height: 36px;
    background:
      url("/static/ui/tear-edge.png") center bottom / 100% 100% no-repeat;
    content: "";
    pointer-events: none;
    z-index: 3;
  }

  .period-button {
    width: 86px;
    min-width: 86px;
    min-height: 44px;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
    color: var(--mobile-ink);
    font-family: var(--mobile-display);
    font-size: 1.58rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    transform: none !important;
  }

  .period-button::before,
  .period-button.is-active::after {
    display: none !important;
    content: none !important;
    background: none !important;
  }

  .period-button.is-active {
    background: transparent !important;
    color: var(--mobile-ink);
    box-shadow: none;
    border: 0;
    border-bottom: 4px solid var(--mobile-red);
    border-radius: 0;
    transform: none !important;
  }

  .period-button .period-mark {
    display: none !important;
  }

  .date-stamp-frame {
    display: none !important;
  }

  .scrapbook-rail {
    background: transparent !important;
    padding-inline: 0 !important;
  }

  .pinboard-stage {
    background: var(--mobile-paper);
    padding-top: 0;
    padding-right: 0;
  }

  .pinboard-tools {
    display: none;
  }

  .pinboard-sort {
    min-width: min(220px, 70vw);
    transform: none;
  }

  .listing-feed.pinboard {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0;
    transition: none;
  }

  .listing-feed.pinboard.is-changing {
    opacity: 1;
    transform: none;
  }

  .listing-pagination {
    padding: 22px 12px 30px;
    background: #f7f0e2;
  }

  .pagination-page,
  .pagination-arrow {
    min-width: 38px;
    height: 38px;
  }

  .listing-card,
  .listing-card:nth-child(2n),
  .listing-card:nth-child(3n),
  .listing-card:nth-child(4n) {
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--mobile-paper);
    box-shadow: none;
    transform: none;
    animation: none;
  }

  .listing-card:not(.skeleton-card):hover {
    transform: none;
    box-shadow: none;
  }

  .listing-image,
  .listing-card:hover .listing-image {
    transform: none;
    transition: none;
  }

  .polaroid-hover { display: none !important; }

  .listing-image-link {
    width: 100%;
    aspect-ratio: 1.4 / 1;
    border: 0;
    border-radius: 0;
  }

  .price-tag,
  .source-sticker { display: none; }

  .mobile-listing-sticker {
    position: absolute;
    z-index: 6;
    right: 18px;
    bottom: 88px;
    display: grid;
    min-width: 82px;
    max-width: 42%;
    padding: 6px 8px 5px;
    border: 1px solid rgb(72 60 50 / 0.3);
    background: var(--mobile-paper-bright);
    color: var(--mobile-ink);
    box-shadow: 2px 3px 0 rgb(38 29 23 / 0.2);
    font-size: 0.5rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
    transform: rotate(2deg);
  }

  .mobile-listing-sticker strong,
  .mobile-listing-sticker span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-listing-sticker strong {
    color: var(--mobile-red);
    font-family: var(--mobile-display);
    font-size: 0.68rem;
  }

  .fresh-ribbon {
    top: auto;
    right: 16px;
    bottom: 22px;
    left: auto;
    width: 76px;
    padding: 9px 10px 8px;
    border-radius: 0;
    font-family: var(--mobile-display);
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    line-height: 0.95;
    transform: rotate(4deg);
    animation: none;
  }

  /* Magazine detail fold: asset-first torn paper (no geometric clip-path tear) */
  .listing-card-body {
    display: grid !important;
    position: relative;
    width: calc(100% - 40px);
    min-height: 256px;
    margin: -38px auto 14px;
    align-content: start;
    padding: 42px 28px 16px;
    border: 1px solid rgb(102 86 72 / 0.16);
    background-color: var(--mobile-paper-bright);
    background-image:
      linear-gradient(rgb(251 245 233 / 0.93), rgb(247 238 222 / 0.94)),
      url("/static/ui/menu-paper-v3.jpg");
    background-position: center;
    background-size: auto, 560px 560px;
    box-shadow:
      0 2px 0 rgb(255 255 255 / 0.55) inset,
      0 13px 24px rgb(48 37 28 / 0.24);
    clip-path: none;
  }

  .listing-card-body::before {
    position: absolute;
    top: -31px;
    right: 0;
    left: 0;
    height: 42px;
    background:
      url("/static/ui/tear-edge.png") center bottom / 100% 100% no-repeat;
    content: "";
    pointer-events: none;
    z-index: 2;
  }

  .listing-card-body::after {
    position: absolute;
    z-index: 3;
    top: 14px;
    left: 40px;
    display: block;
    width: 27px;
    height: 3px;
    border-radius: 3px;
    background: rgb(105 98 90);
    box-shadow:
      104px 1px 0 rgb(105 98 90),
      208px -1px 0 rgb(105 98 90),
      0 1px 0 rgb(255 255 255 / 0.5) inset;
    content: "";
    transform: rotate(-2deg);
  }

  .magazine-price {
    position: relative;
    z-index: 1;
    width: max-content;
    max-width: 100%;
    margin: 0 0 12px;
    color: var(--mobile-ink);
    font-family: var(--mobile-display);
    font-size: 3.45rem;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 0.9;
  }

  .magazine-price::after {
    position: absolute;
    right: -2px;
    bottom: -5px;
    left: -2px;
    height: 5px;
    border-radius: 99px;
    background: var(--mobile-red);
    content: "";
    transform: rotate(-2deg);
  }

  .listing-open {
    order: 1;
    min-height: 54px;
    padding: 8px 21px;
    border-radius: 7px;
    background: var(--mobile-red);
    font-family: var(--mobile-display);
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    box-shadow: 0 3px 0 rgb(113 22 28 / 0.55);
  }

  .source-card-strip {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 0;
  }

  .source-card-strip .status-badge {
    justify-self: start;
  }

  .source-found {
    justify-items: start;
  }

  .bay-banner-inner,
  .bay-banner-face {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "timer headline"
      "run run"
      "sub sub";
  }

  .bay-banner-run {
    width: 100%;
  }

  .magazine-price {
    display: block;
    font-variant-numeric: tabular-nums;
  }

  .listing-kicker {
    display: none;
  }

  .listing-title {
    display: block;
    color: var(--mobile-ink);
    font-family: var(--mobile-display);
    font-size: 2.03rem;
    font-weight: 900;
    letter-spacing: -0.015em;
    line-height: 0.95;
    text-transform: uppercase;
    -webkit-line-clamp: unset;
  }

  .listing-meta {
    gap: 0;
    margin-top: 13px;
    color: var(--mobile-muted);
    font-size: 0.69rem;
    font-weight: 750;
    line-height: 1.35;
  }

  .listing-meta span {
    gap: 0;
  }

  .listing-meta span:not(.found-age)::after {
    margin: 0 7px;
    color: var(--mobile-red);
    content: "•";
  }

  .listing-meta span:nth-last-child(2)::after,
  .listing-meta span:last-child::after {
    display: none;
  }

  .listing-meta svg,
  .listing-meta .found-age {
    display: none;
  }

  .listing-card-actions {
    gap: 12px;
    margin-top: 10px;
  }

  .listing-favorite {
    order: 2;
    display: inline-flex;
    width: auto;
    height: auto;
    min-height: 44px;
    padding: 4px 6px;
    border: 0;
    background: transparent;
    color: var(--mobile-red);
    font-family: "Bradley Hand", "Comic Sans MS", cursive;
    font-size: 1rem;
    font-style: italic;
    transform: rotate(-5deg);
  }

  .listing-favorite svg {
    display: none;
  }

  .listing-favorite span {
    display: inline;
  }

  .empty-float-logo {
    top: 16px;
    left: 14px;
    width: min(150px, 42vw);
  }

  .empty-float-run {
    top: 16px;
    right: 14px;
    min-height: 40px;
    padding: 10px 14px;
    font-size: 0.82rem;
  }

  .source-bay-grid { grid-template-columns: 1fr; }

  .page-diagnostics,
  .page-diagnostics .bay-banner,
  .page-diagnostics .source-card {
    animation: none;
  }

  .bay-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .schedule-note { justify-items: start; }

  .debug-content { grid-template-columns: 1fr; }
}

@media (min-width: 851px) and (pointer: fine), (min-width: 961px) {
  .main-nav a .nav-icon { display: none; }
}

@media (max-width: 560px) {
  .magazine-price { font-size: 3.15rem; }
  .listing-title { font-size: 1.82rem; }
  .source-found strong { font-size: 1.7rem; }
  .empty-card h2 { font-size: 1.55rem; }
}

@supports (color: oklch(50% 0.1 30)) {
  @media (max-width: 850px), (max-width: 960px) and (pointer: coarse) {
    :root {
      --mobile-paper: oklch(94.5% 0.018 76);
      --mobile-paper-bright: oklch(97% 0.012 78);
      --mobile-ink: oklch(20% 0.018 58);
      --mobile-muted: oklch(50% 0.028 66);
      --mobile-red: oklch(49% 0.19 26);
      --mobile-dock: oklch(16% 0.014 50);
      --mobile-green: oklch(65% 0.18 143);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .run-progress-icon { animation: none; }
  .run-progress-track span { transition: none; }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Account and monitor ownership layer */
.topbar {
  grid-template-columns: 1fr auto auto auto;
}

.account-menu {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper);
  color: var(--accent);
  font-weight: 900;
}

.account-name {
  max-width: 13ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-logout,
.account-signin {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.monitor-manager {
  width: min(282px, 100%);
  padding: 14px 12px 12px;
  border: 1px solid rgb(84 54 29 / 0.26);
  background: rgb(250 241 222 / 0.42);
  box-shadow: 2px 4px 0 rgb(66 41 21 / 0.08);
}

.monitor-manager-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.monitor-manager-heading .rail-section-label {
  width: auto;
  margin: 0 0 2px;
  text-align: left;
}

.monitor-manager h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.monitor-count {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--paper-bright);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.monitor-list {
  display: grid;
  gap: 3px;
  max-height: 190px;
  margin: 0 0 14px;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.monitor-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 5px 4px;
  border-bottom: 1px dashed rgb(84 54 29 / 0.2);
}

.monitor-list-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgb(45 122 62 / 0.13);
}

.monitor-list-status.is-paused {
  background: var(--faint);
  box-shadow: none;
}

.monitor-list-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.monitor-list-copy strong,
.monitor-list-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-list-copy strong { font-size: 0.72rem; }
.monitor-list-copy small {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.monitor-delete {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.monitor-delete:hover { color: var(--accent); }
.monitor-empty {
  padding: 10px 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-style: italic;
}
.monitor-empty.is-error { color: var(--error); }

.monitor-form {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 2px solid rgb(84 54 29 / 0.2);
}

.monitor-form-heading {
  display: grid;
  gap: 2px;
  margin-bottom: 2px;
}

.monitor-form-heading strong { font-size: 0.78rem; }
.monitor-form-heading span,
.monitor-note {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.4;
}

.monitor-form .field {
  display: grid;
  gap: 4px;
}

.monitor-form .field > span {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.monitor-form .field em {
  font-size: 0.56rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.monitor-form input,
.monitor-form select {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--paper-bright);
  color: var(--ink);
  font-size: 0.72rem;
}

.monitor-form input::placeholder { color: var(--faint); }
.monitor-form .field-help {
  color: var(--muted);
  font-size: 0.57rem;
  line-height: 1.3;
}
.monitor-submit { width: 100%; min-height: 38px; }
.monitor-submit.is-loading .button-spinner { display: block; }
.monitor-form-error {
  margin: 0;
  padding: 7px 8px;
  border: 1px solid var(--error);
  background: var(--error-soft);
  color: var(--error);
  font-size: 0.68rem;
  line-height: 1.35;
}
.monitor-note { margin: 9px 2px 0; }

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.7fr);
  gap: 24px;
  width: min(900px, calc(100% - 32px));
  margin: 8vh auto 0;
  align-items: stretch;
}

.login-paper,
.login-side,
.legal-paper {
  border: 1px solid var(--border-strong);
  background: var(--paper-bright);
  box-shadow: 7px 9px 0 rgb(66 41 21 / 0.12);
}

.login-paper { padding: clamp(28px, 6vw, 64px); }
.login-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.login-paper h1,
.legal-paper h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5.25rem);
  letter-spacing: -0.07em;
  line-height: 0.9;
}
.login-copy {
  max-width: 45ch;
  margin: 22px 0 28px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.6;
}
.google-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid var(--border-strong);
  background: var(--ink);
  color: var(--paper-bright);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}
.google-signin:hover { background: var(--accent); }
.google-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper-bright);
  color: #4285f4;
  font-size: 0.9rem;
  font-weight: 950;
  text-transform: none;
}
.login-error,
.setup-note {
  display: grid;
  gap: 4px;
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--warning);
  background: var(--warning-soft);
  color: var(--ink);
  font-size: 0.74rem;
  line-height: 1.4;
}
.login-legal {
  max-width: 44ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.5;
}
.login-legal a,
.legal-paper a { color: var(--accent); font-weight: 800; }
.login-side {
  display: flex;
  flex-direction: column;
  justify-content: end;
  min-height: 340px;
  padding: 28px;
  background: var(--kraft-deep);
  color: var(--paper-bright);
  transform: rotate(1.3deg);
}
.login-side-stamp {
  align-self: start;
  padding: 7px 9px;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  transform: rotate(-3deg);
}
.login-side h2 {
  max-width: 10ch;
  margin: 22px 0 12px;
  color: var(--paper-bright);
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.06em;
  line-height: 0.9;
}
.login-side p { max-width: 28ch; color: rgb(251 243 228 / 0.78); line-height: 1.55; }

.legal-paper {
  width: min(720px, calc(100% - 32px));
  margin: 8vh auto;
  padding: clamp(28px, 6vw, 58px);
}
.legal-paper h1 { margin-bottom: 28px; }
.legal-paper h2 { margin: 28px 0 8px; font-size: 1.2rem; }
.legal-paper p { max-width: 68ch; color: var(--muted); line-height: 1.65; }

@media (max-width: 850px), (max-width: 960px) and (pointer: coarse) {
  .page-dashboard .topbar,
  .page-diagnostics .topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 42px;
    padding: 7px 8px 0;
  }
  .page-dashboard .topbar .account-menu,
  .page-diagnostics .topbar .account-menu { display: inline-flex; }
  .account-name { display: none; }
  .account-logout { min-height: 36px; padding: 6px; }
  .monitor-manager { width: 100%; margin: 12px 0 10px; }
  .login-shell { grid-template-columns: 1fr; width: min(100% - 20px, 540px); margin-top: 24px; }
  .login-side { min-height: 240px; transform: rotate(0.5deg); }
  .legal-paper { width: min(100% - 20px, 720px); margin-top: 24px; }
}
