:root {
  --bg: #f4efe5;
  --bg-strong: #e7ddcd;
  --surface: rgba(255, 251, 245, 0.92);
  --surface-strong: #fffaf2;
  --surface-glass: rgba(255, 251, 245, 0.72);
  --text: #1e1f1c;
  --muted: #6f6c62;
  --line: rgba(50, 47, 39, 0.12);
  --accent: #b3552d;
  --accent-soft: #efe0d3;
  --accent-deep: #8d3e1e;
  --shadow: 0 24px 60px rgba(64, 49, 31, 0.12);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(179, 85, 45, 0.12), transparent 28%),
    linear-gradient(180deg, #f7f1e7 0%, #efe5d7 100%);
}

a {
  color: inherit;
}

code {
  font-family: "IBM Plex Mono", monospace;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  backdrop-filter: blur(16px);
  background: rgba(247, 241, 231, 0.82);
  border-bottom: 1px solid var(--line);
}

.brand,
.nav a,
.button {
  text-decoration: none;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 1rem;
}

.page-shell {
  width: min(1400px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.run-page-shell {
  width: min(1780px, calc(100% - 2rem));
}

.hero,
.run-sticky-nav,
.section,
.viewer-shell,
.viewer-links {
  margin-bottom: 1.5rem;
}

.hero {
  padding: 1.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-tight {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.hero h1,
.section h2,
.card h2 {
  margin: 0 0 0.45rem;
}

.hero p,
.section-head p,
.tile-body span,
.card p,
.card-meta,
.empty {
  color: var(--muted);
}

.run-stat {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 188px;
  padding: 0.72rem 0.88rem;
  background: var(--surface-glass);
  border: 1px solid rgba(141, 62, 30, 0.1);
  border-radius: 16px;
}

.run-stat strong {
  font-size: 1.28rem;
  line-height: 1;
}

.run-stat-label,
.run-stat-detail {
  color: var(--muted);
}

.run-stat-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.run-stat-detail {
  font-size: 0.8rem;
}

.profile-switcher,
.run-nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.run-stat-link,
.run-nav-link {
  text-decoration: none;
}

.run-stat-link {
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.run-stat-link:hover {
  transform: translateY(-1px);
  border-color: rgba(141, 62, 30, 0.24);
  background: rgba(255, 250, 242, 0.96);
}

.run-nav {
  justify-content: flex-end;
}

.run-nav-link {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  min-width: 168px;
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(179, 85, 45, 0.96), rgba(141, 62, 30, 0.96));
  border: 1px solid rgba(104, 43, 20, 0.28);
  color: white;
  box-shadow: 0 12px 28px rgba(141, 62, 30, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.run-nav-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(141, 62, 30, 0.28);
}

.run-nav-button > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.run-nav-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.run-nav-link strong {
  font-size: 0.9rem;
}

.run-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.run-nav-link-disabled {
  background: rgba(184, 175, 164, 0.72);
  border-color: rgba(120, 108, 94, 0.16);
  color: rgba(30, 31, 28, 0.8);
  box-shadow: none;
}

.run-nav-link-disabled .run-nav-label {
  color: rgba(30, 31, 28, 0.54);
}

.run-nav-link-disabled .run-nav-key {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(120, 108, 94, 0.16);
}

.run-sticky-nav {
  position: sticky;
  top: 4.35rem;
  z-index: 8;
}

.page-sticky-nav {
  margin-bottom: 1.25rem;
}

.run-sticky-nav-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0.95rem;
  background: rgba(255, 251, 245, 0.78);
  border: 1px solid rgba(141, 62, 30, 0.1);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 30px rgba(64, 49, 31, 0.1);
}

.run-sticky-label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
  white-space: nowrap;
}

.run-sticky-copy {
  min-width: 0;
}

.run-sticky-title {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 1.25rem;
  line-height: 1.05;
}

.run-sticky-subtitle {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.88rem;
}

.run-sticky-nav .run-nav-link {
  min-width: 156px;
  padding: 0.5rem 0.75rem;
}

.run-sticky-nav .run-nav-key {
  width: 1.8rem;
  height: 1.8rem;
}

.page-sticky-nav .run-sticky-nav-inner {
  grid-template-columns: minmax(0, 1.5fr) auto;
}

.viewer-sticky-nav .run-sticky-nav-inner {
  grid-template-columns: minmax(0, 1.3fr) auto auto;
}

.cards,
.grid,
.history-grid {
  display: grid;
  gap: 1rem;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.history-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.section[id] {
  scroll-margin-top: 8.5rem;
}

.card,
.tile,
.history-card {
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.history-card-rich img {
  display: block;
  width: 100%;
  height: auto;
}

.card,
.tile-body {
  padding: 1rem;
}

.tile-body-top {
  border-bottom: 1px solid var(--line);
  gap: 0.35rem;
  padding: 0.78rem 0.9rem 0.72rem;
}

.tile-body-top strong {
  font-size: 0.92rem;
  line-height: 1.15;
}

.tile-body-top span {
  font-size: 0.8rem;
  line-height: 1.2;
}

.tile-body-top a {
  font-size: 0.82rem;
}

.card-meta {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

.tile img,
.history-card img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg-strong);
}

.tile-body,
.viewer-links,
.nav-inline {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.tile-body {
  flex-direction: column;
}

.button {
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: white;
}

.button-secondary {
  background: rgba(141, 62, 30, 0.1);
  color: var(--accent-deep);
}

.button-disabled {
  background: #b8afa4;
}

.viewer-shell {
  padding: 1rem;
  background: rgba(255, 251, 245, 0.66);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.viewer-shell-rich {
  display: grid;
  gap: 1rem;
}

.viewer-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.viewer-action-link {
  padding: 0.58rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(141, 62, 30, 0.12);
  background: rgba(255, 251, 245, 0.86);
  text-decoration: none;
  font-weight: 600;
}

.viewer-profile-link {
  min-width: 150px;
}

.viewer-profile-link-active {
  background: rgba(255, 246, 238, 0.96);
  border-color: rgba(141, 62, 30, 0.22);
  box-shadow: inset 0 0 0 1px rgba(141, 62, 30, 0.08);
}

.browser-frame {
  width: 100%;
  overflow: hidden;
  background: #ddd4c6;
  border: 1px solid rgba(41, 37, 31, 0.18);
  border-radius: 22px;
}

.browser-frame.mobile {
  width: min(430px, 100%);
  margin: 0 auto;
  border-radius: 32px;
}

.browser-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.9rem 1rem;
  background: #f7f1e8;
  border-bottom: 1px solid var(--line);
}

.browser-bar span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #dbb59f;
}

.browser-bar code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.viewer-image {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 720px) {
  .topbar,
  .hero-tight,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-shell {
    width: min(100% - 1rem, 1400px);
  }

  .run-sticky-nav-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 980px) {
  .run-sticky-nav-inner {
    grid-template-columns: 1fr;
  }

  .run-nav,
  .profile-switcher {
    justify-content: flex-start;
  }

  .page-sticky-nav .run-sticky-nav-inner {
    grid-template-columns: 1fr;
  }

  .viewer-sticky-nav .run-sticky-nav-inner {
    grid-template-columns: 1fr;
  }
}
