:root {
  --ink: #1c2430;
  --muted: #5b6675;
  --paper: #f5f6f8;
  --card: #ffffff;
  --brand: #e8901a;
  --brand-dark: #c67612;
  --accent: #2e9bd6;
  --line: #e2e6ec;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-header {
  background: var(--ink);
  color: #fff;
  padding: 18px 0;
}
.site-header .wrap { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.site-header h1 { margin: 0; font-size: 22px; letter-spacing: 0.5px; }
.logo { color: var(--brand); font-weight: 800; }
.tagline { font-size: 13px; color: #b8c2cf; font-weight: 400; margin-left: 8px; }
.booth-picker { display: flex; gap: 8px; }
.booth-picker a {
  color: #dfe6ee; text-decoration: none; font-size: 13px;
  padding: 4px 12px; border: 1px solid #3a4656; border-radius: 999px;
}
.booth-picker a.active, .booth-picker a:hover { background: var(--brand); border-color: var(--brand); color: #171d26; }

/* hero row */
.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 20px;
  margin: 24px 0;
}
@media (max-width: 860px) { .hero-row { grid-template-columns: 1fr; } }

.viewer-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
#viewer { position: relative; width: 100%; aspect-ratio: 4 / 3; background: linear-gradient(#eceff3, #dfe4ea); }
#viewer canvas { display: block; width: 100%; height: 100%; }
#viewer-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px;
}
.viewer-hint { padding: 8px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

.stats-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stats-card h2 { margin: 0 0 6px; font-size: 20px; }
.stats-card .desc { font-size: 13.5px; color: var(--muted); }
.stats-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; margin: 14px 0 0; }
.stats-card dt { color: var(--muted); }
.stats-card dd { margin: 0; font-weight: 600; }

/* tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 0; }
.tabs button {
  font: inherit; font-size: 14px; cursor: pointer;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-bottom: none;
  border-radius: 10px 10px 0 0; padding: 9px 18px;
}
.tabs button.active { background: var(--brand); border-color: var(--brand); color: #171d26; font-weight: 700; }

.tab-content {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 26px 30px;
  margin-bottom: 40px;
  min-height: 200px;
}

/* doc typography */
.tab-content h1 { font-size: 24px; margin-top: 0; }
.tab-content h2 { font-size: 18px; margin-top: 28px; border-bottom: 2px solid var(--line); padding-bottom: 6px; }
.tab-content h3 { font-size: 15.5px; margin-top: 22px; color: var(--brand-dark); }
.tab-content table { border-collapse: collapse; width: 100%; font-size: 13.5px; margin: 12px 0; display: block; overflow-x: auto; }
.tab-content th, .tab-content td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.tab-content th { background: var(--paper); }
.tab-content code { background: var(--paper); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.tab-content li { margin: 4px 0; }

/* overview gallery */
.render-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.render-grid figure { margin: 0; }
.render-grid img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.render-grid figcaption { font-size: 12.5px; color: var(--muted); margin-top: 4px; text-align: center; }
.cta-note {
  margin-top: 20px; padding: 14px 16px; background: var(--paper);
  border-left: 4px solid var(--brand); border-radius: 6px; font-size: 13.5px;
}

/* designer link + doc gating */
.designer-link {
  color: #171d26; background: var(--brand); text-decoration: none;
  font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 999px;
}
.designer-link:hover { background: #f5a83d; }
.ref-line { font-size: 13px; color: var(--muted); }
.doc-gate {
  margin-top: 22px; padding: 16px 18px; background: #fdf4e6;
  border: 1px dashed var(--brand); border-radius: 10px; font-size: 14px;
}

/* footer */
.site-footer { padding: 18px 0 30px; color: var(--muted); font-size: 12.5px; }

@media print {
  .site-header, .tabs, .viewer-card, .site-footer { display: none; }
  .tab-content { border: none; padding: 0; }
  .hero-row { display: none; }
}

/* ---- saved booth list ---- */
.booth-list-page { padding-top: 26px; padding-bottom: 40px; }
.booth-list-page h2 { margin: 0 0 6px; font-size: 22px; }
.booth-list-page .lede { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

.booth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.booth-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.booth-open {
  display: block;
  padding: 16px 16px 14px;
  text-decoration: none;
  color: inherit;
  flex: 1;
}
.booth-open:hover { background: #fdf3e3; }
.booth-open h3 {
  margin: 0 0 6px;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.booth-meta { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.booth-when { margin: 0; font-size: 12px; color: var(--muted); }
.booth-del {
  font: inherit;
  font-size: 12px;
  padding: 8px 16px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}
.booth-del:hover { color: #c0392b; background: #fdf1ef; }

/* ---- mobile ---- */
@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  /* The header wrapped to 144 px on a phone, most of it empty. */
  .site-header .wrap {
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 10px;
  }
  .site-header h1 { font-size: 18px; }
  .tagline { display: none; }
  .designer-link { padding: 10px 16px; }

  .booth-list-page { padding-top: 18px; }
  .booth-list-page h2 { font-size: 19px; }
  .booth-grid { grid-template-columns: 1fr; gap: 12px; }
  .booth-open { padding: 14px 16px; }
  .booth-del { padding: 12px 16px; }
}
