:root {
  --bg: #f6f8fc;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4fa;
  --text: #1a2332;
  --text-muted: #5c6b7f;
  --brand: #1e5a8e;
  --amber: #c47a0a;
  --cyan: #0d7ea5;
  --rose: #c23d4a;
  --violet: #5b4bb8;
  --border: rgba(30, 90, 142, 0.14);
  --shadow: 0 1px 3px rgba(26, 35, 50, 0.06), 0 8px 24px rgba(26, 35, 50, 0.04);
  --radius: 14px;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: radial-gradient(1000px 480px at 0% 0%, rgba(30, 90, 142, 0.06) 0%, transparent 50%),
    radial-gradient(800px 400px at 100% 0%, rgba(196, 122, 10, 0.07) 0%, transparent 45%),
    var(--bg);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.site-header,
.controls,
.stats,
main,
.site-footer {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.site-header {
  padding-top: 2.5rem;
  padding-bottom: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, var(--brand), var(--cyan), var(--amber), var(--brand));
  box-shadow: var(--shadow);
}

.brand-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 600;
}

.site-header h1 {
  margin: 0.1rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tagline {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.tagline strong {
  color: var(--amber);
  font-weight: 600;
}

.tagline a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}
.tagline a:hover {
  text-decoration: underline;
}

.controls {
  padding-bottom: 1rem;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.field-grow {
  flex: 1;
  min-width: 180px;
}

.field select,
.field input,
.btn {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  padding: 0.55rem 0.75rem;
  box-shadow: 0 1px 2px rgba(26, 35, 50, 0.04);
}

.field input:focus,
.field select:focus,
.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.chip-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  box-shadow: 0 1px 2px rgba(26, 35, 50, 0.04);
}

.chip-toggle input {
  accent-color: var(--brand);
}

.btn {
  cursor: pointer;
  background: linear-gradient(135deg, #2569a8, var(--brand));
  color: #fff;
  font-weight: 600;
  border: none;
  box-shadow: var(--shadow);
}

.btn:hover {
  filter: brightness(1.05);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.chip {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
}

.chip.active {
  background: rgba(30, 90, 142, 0.1);
  color: var(--brand);
  border-color: rgba(30, 90, 142, 0.35);
  font-weight: 600;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  padding-bottom: 1.25rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.stat-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.stat-card .label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.stat-card.highlight .value {
  color: var(--brand);
}

.status {
  min-height: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.status.error {
  color: var(--rose);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-bottom: 3rem;
}

.day-group h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.day-group h2 .weekday {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.event-card {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.85rem 1rem;
  padding: 1rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: background 0.15s, border-color 0.15s;
}

.event-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(30, 90, 142, 0.28);
}

.event-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--amber);
  line-height: 1.35;
}

.event-time .end {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.event-body h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.event-body h3 a {
  color: inherit;
  text-decoration: none;
}

.event-body h3 a:hover {
  color: var(--brand);
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pill {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pill-fair {
  background: rgba(91, 75, 184, 0.12);
  color: var(--violet);
}

.pill-onsite {
  background: rgba(13, 126, 165, 0.12);
  color: var(--cyan);
}

.pill-offsite {
  background: rgba(194, 61, 74, 0.1);
  color: var(--rose);
}

.site-footer {
  padding-bottom: 2.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--brand);
}

.site-footer .muted {
  margin-top: 0.35rem;
  opacity: 0.85;
}

.btn-detail {
  margin-top: 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
  background: rgba(30, 90, 142, 0.08);
  border: 1px solid rgba(30, 90, 142, 0.2);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

.btn-detail:hover {
  background: rgba(30, 90, 142, 0.12);
}

.event-detail {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
}

.detail-lead {
  margin: 0 0 0.65rem;
  color: var(--text-muted);
}

.company-head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.company-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

.company-name {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.company-sub {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.detail-talk {
  margin: 0 0 0.65rem;
  color: var(--text-muted);
}

.detail-dl {
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.detail-dl div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.5rem;
}

.detail-dl dt {
  color: var(--text-muted);
  font-weight: 500;
}

.detail-dl dd {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 0.5rem 0;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.pos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.pos-table th,
.pos-table td {
  padding: 0.45rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.pos-table th {
  background: #f0f4fa;
  color: var(--text-muted);
  font-weight: 600;
}

.pos-table a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.pos-table a:hover {
  text-decoration: underline;
}

.muted-cell {
  color: var(--text-muted);
  text-align: center;
}

.detail-links {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
}

.detail-links a {
  color: var(--brand);
}

@media (max-width: 520px) {
  .event-card {
    grid-template-columns: 1fr;
  }

  .detail-dl div {
    grid-template-columns: 1fr;
  }
}
