/* Horizon board — 12 issues × 60 slots — director view (light editorial) */
.horizon-page {
  --hz-bg: #fafafa;
  --hz-surface: #ffffff;
  --hz-surface2: #f5f5f5;
  --hz-border: #e5e5e5;
  --hz-text: #1c1917;
  --hz-muted: #78716c;
  --hz-accent: #0f766e;
  --hz-glow: rgba(15, 118, 110, 0.2);
  --hz-blue: #2563eb;
  --hz-green: #16a34a;
  --hz-amber: #d97706;
  --hz-red: #dc2626;
  height: 100vh;
  min-height: 100vh;
  background: var(--hz-bg);
  color: var(--hz-text);
  font-family: var(--font, "DM Sans", system-ui, sans-serif);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.horizon-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(15, 118, 110, 0.04), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(37, 99, 235, 0.03), transparent);
  pointer-events: none;
  z-index: 0;
}

.hz-header {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  padding: 1.25rem 1.75rem 1rem;
  border-bottom: 1px solid var(--hz-border);
  background: var(--hz-surface);
}

.hz-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hz-eyebrow {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--hz-accent);
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.hz-title {
  font-family: var(--display, "Fraunces", Georgia, serif);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 600;
  margin: 0;
  line-height: 1.15;
  color: var(--hz-text);
}

.hz-sub {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: var(--hz-muted);
  max-width: 42rem;
}

.hz-stats {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.hz-stat {
  background: var(--hz-surface2);
  border: 1px solid var(--hz-border);
  border-radius: 12px;
  padding: 0.55rem 0.9rem;
  min-width: 5.5rem;
  text-align: center;
}
.hz-stat strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--hz-text);
}
.hz-stat span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hz-muted);
}

.hz-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.hz-chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.hz-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--hz-border);
  background: var(--hz-surface);
  color: var(--hz-muted);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.hz-chip:hover { color: var(--hz-text); border-color: #d4d4d4; background: var(--hz-surface2); }
.hz-chip.active {
  background: rgba(15, 118, 110, 0.1);
  border-color: var(--hz-accent);
  color: var(--hz-accent);
}
.hz-chip[data-color="Red"].active { background: rgba(220, 38, 38, 0.1); border-color: var(--hz-red); color: #b91c1c; }
.hz-chip[data-color="Amber"].active { background: rgba(217, 119, 6, 0.1); border-color: var(--hz-amber); color: #b45309; }
.hz-chip[data-color="Green"].active { background: rgba(22, 163, 74, 0.1); border-color: var(--hz-green); color: #15803d; }
.hz-chip[data-color="Blue"].active { background: rgba(37, 99, 235, 0.1); border-color: var(--hz-blue); color: #1d4ed8; }

.hz-search {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--hz-border);
  background: var(--hz-surface);
  color: var(--hz-text);
  font-size: 0.85rem;
  font-family: inherit;
}
.hz-search::placeholder { color: var(--hz-muted); }

.hz-zoom button {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--hz-border);
  background: var(--hz-surface);
  color: var(--hz-muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: inherit;
}
.hz-zoom button.active { color: var(--hz-accent); border-color: var(--hz-accent); background: rgba(15, 118, 110, 0.06); }

.hz-back {
  color: var(--hz-muted);
  font-size: 0.85rem;
  text-decoration: none;
}
.hz-back:hover { color: var(--hz-accent); }

.hz-board {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--hz-bg);
}

#hz-app {
  overflow: hidden;
}

.hz-scroll-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 1rem 1rem;
}

.hz-board-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  padding: 0.65rem 1.75rem;
  background: var(--hz-surface);
  border-top: 1px solid var(--hz-border);
}

.hz-pxax {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hz-matrix {
  --hz-col-type: 172px;
  --hz-col-pages: 58px;
  display: grid;
  grid-template-columns: var(--hz-col-type) var(--hz-col-pages) repeat(12, minmax(124px, 1fr));
  gap: 3px;
  width: max-content;
  min-width: 100%;
  padding-bottom: 2rem;
}
.hz-matrix.compact {
  --hz-col-type: 156px;
  --hz-col-pages: 52px;
  grid-template-columns: var(--hz-col-type) var(--hz-col-pages) repeat(12, minmax(101px, 1fr));
}
.hz-matrix.compact .hz-cell { min-height: 44px; font-size: 0.68rem; }

.hz-corner-type,
.hz-corner-pages {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--hz-bg);
  padding: 0.75rem 0.65rem;
  font-size: 0.72rem;
  color: var(--hz-muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 3.5rem;
}
.hz-corner-type {
  left: 0;
  border-radius: 8px 0 0 0;
}
.hz-corner-pages {
  left: var(--hz-col-type);
  text-align: center;
}
.hz-corner-type strong,
.hz-corner-pages strong {
  color: var(--hz-text);
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.hz-corner-sub {
  font-size: 0.65rem;
  margin-top: 0.15rem;
}

.hz-col-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: 10px 10px 0 0;
  padding: 0.65rem 0.5rem;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}
.hz-col-head.current {
  border-color: var(--hz-accent);
  box-shadow: 0 0 0 1px var(--hz-accent), 0 4px 12px var(--hz-glow);
}
.hz-col-head.highlight { transform: scale(1.02); box-shadow: 0 4px 16px rgba(28, 25, 23, 0.1); }
.hz-col-head .hz-week {
  font-weight: 700;
  font-size: 0.82rem;
  display: block;
  color: var(--hz-text);
}
.hz-col-head .hz-week-date {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--hz-accent, #0f766e);
  display: block;
  margin-top: 0.15rem;
  line-height: 1.2;
}
.hz-col-head .hz-press {
  font-size: 0.65rem;
  color: var(--hz-muted);
  margin-top: 0.2rem;
}
.hz-health {
  display: inline-block;
  margin-top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.hz-health.Red { background: var(--hz-red); box-shadow: 0 0 6px rgba(220, 38, 38, 0.4); }
.hz-health.Amber { background: var(--hz-amber); }
.hz-health.Green { background: var(--hz-green); }
.hz-health.Blue { background: var(--hz-blue); }

.hz-row-head {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-height: 58px;
  transition: background 0.15s, box-shadow 0.15s;
}
.hz-row-pages {
  position: sticky;
  left: var(--hz-col-type);
  z-index: 2;
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--hz-text);
  transition: background 0.15s, box-shadow 0.15s;
}
.hz-row-head.highlight,
.hz-row-pages.highlight {
  background: var(--hz-surface2);
  box-shadow: 4px 0 12px rgba(28, 25, 23, 0.08);
  border-color: var(--hz-accent);
}
.hz-row-head .code {
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--hz-accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hz-row-head .type {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--hz-text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hz-matrix.compact .hz-row-head .type { font-size: 0.78rem; }
.hz-matrix.compact .hz-row-pages { font-size: 0.72rem; }

.hz-cell {
  position: relative;
  min-height: 58px;
  border-radius: 6px;
  border: 1px solid var(--hz-border);
  background: var(--hz-surface);
  padding: 0.3rem 0.4rem 0.35rem 0.5rem;
  cursor: default;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.2rem;
}
.hz-cell-badges {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}
.hz-cell::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 6px 0 0 6px;
}
.hz-cell[data-color="Blue"] {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
}
.hz-cell[data-color="Blue"]::before { background: var(--hz-blue); }
.hz-cell[data-color="Green"] {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.2);
}
.hz-cell[data-color="Green"]::before { background: var(--hz-green); }
.hz-cell[data-color="Amber"] {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.2);
}
.hz-cell[data-color="Amber"]::before { background: var(--hz-amber); }
.hz-cell[data-color="Red"] {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.25);
  animation: hz-pulse 2.5s ease-in-out infinite;
}
.hz-cell[data-color="Red"]::before { background: var(--hz-red); }

@keyframes hz-pulse {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(220, 38, 38, 0); }
  50% { box-shadow: inset 0 0 8px rgba(220, 38, 38, 0.12); }
}

.hz-cell:hover {
  transform: scale(1.04);
  z-index: 5;
  border-color: #d4d4d4;
  box-shadow: 0 4px 16px rgba(28, 25, 23, 0.12);
}
.hz-cell.dimmed { opacity: 0.25; pointer-events: none; }
.hz-cell.col-highlight { outline: 1px solid rgba(15, 118, 110, 0.35); }
.hz-cell.row-highlight { outline: 1px solid rgba(15, 118, 110, 0.2); }

.hz-cell-title {
  font-size: 0.72rem;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 600;
  color: var(--hz-text);
  text-decoration: none;
}
a.hz-cell-title.has {
  color: var(--hz-text);
  cursor: pointer;
}
a.hz-cell-title.has:hover {
  color: var(--hz-accent);
  text-decoration: underline;
}
.hz-cell.empty .hz-cell-title {
  color: var(--hz-muted);
  font-style: italic;
  font-weight: 500;
  opacity: 0.75;
}
.hz-cell-links {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: auto;
}
.hz-btn-pdf {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.5rem;
  border-radius: 5px;
  border: 1px solid transparent;
  line-height: 1.2;
}
.hz-btn-pdf.has {
  color: #334155;
  background: #f1f5f9;
  border-color: #475569;
}
.hz-btn-pdf.has:hover {
  background: #e2e8f0;
  border-color: #334155;
  color: #1e293b;
  text-decoration: none;
}
.hz-btn-pdf.missing {
  color: #94a3b8;
  opacity: 1;
  cursor: not-allowed;
  border-color: #cbd5e1;
  background: #f8fafc;
}
.hz-link {
  font-size: 0.62rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  border: 1px solid transparent;
}
.hz-link.has {
  color: #fff;
  background: #334155;
  border-color: #475569;
}
.hz-link.has:hover {
  background: var(--hz-accent);
  border-color: var(--hz-accent);
  color: #fff;
  text-decoration: none;
}
.hz-link.missing {
  color: var(--hz-muted);
  opacity: 0.55;
  cursor: not-allowed;
  border-color: var(--hz-border);
  background: var(--hz-surface2);
}
.hz-method {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}
.hz-method.A1 { background: rgba(15, 118, 110, 0.15); color: #0f766e; }
.hz-method.A2 { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; }
.hz-method.A3 { background: rgba(217, 119, 6, 0.15); color: #b45309; }
.hz-method.A4 { background: rgba(124, 58, 237, 0.12); color: #6d28d9; }
.hz-priority { font-size: 0.58rem; font-weight: 800; padding: 0.06rem 0.28rem; border-radius: 3px; flex-shrink: 0; }
.hz-priority.P1 { background: #d1fae5; color: #065f46; }
.hz-priority.P3 { background: #dbeafe; color: #1e40af; }
.hz-priority.P2 { background: #fef3c7; color: #b45309; }

.hz-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  max-width: 320px;
}
.hz-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.hz-tooltip-inner {
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: 0 12px 32px rgba(28, 25, 23, 0.12), 0 0 0 1px rgba(28, 25, 23, 0.04);
}
.hz-tooltip h4 {
  margin: 0 0 0.35rem;
  font-family: var(--display, "Fraunces", Georgia, serif);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--hz-text);
}
.hz-tooltip .hz-tt-meta {
  font-size: 0.75rem;
  color: var(--hz-muted);
  margin-bottom: 0.65rem;
}
.hz-tooltip .hz-tt-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
  margin: 0.25rem 0;
  color: var(--hz-text);
}
.hz-tooltip .hz-tt-row span:first-child { color: var(--hz-muted); }
.hz-tt-badges {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}
.hz-tt-badge {
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
}
.hz-tt-angle {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--hz-muted);
  line-height: 1.45;
  border-top: 1px solid var(--hz-border);
  padding-top: 0.55rem;
}

.hz-legend {
  flex-shrink: 0;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0.65rem 1.75rem;
  background: var(--hz-surface);
  border-top: 1px solid var(--hz-border);
  font-size: 0.72rem;
  color: var(--hz-muted);
}
.hz-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.hz-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.hz-legend i.blue { background: var(--hz-blue); }
.hz-legend i.green { background: var(--hz-green); }
.hz-legend i.amber { background: var(--hz-amber); }
.hz-legend i.red { background: var(--hz-red); }

.hz-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--hz-muted);
  font-size: 1rem;
  background: var(--hz-bg);
}
