/* ══════════════════════════════════════════════
   Josh OS — Training Event OS
   Three-pane layout: rail / detail / activity.
   ══════════════════════════════════════════════ */

/* Override the legacy 900px-capped .main so the workspace fills the viewport. */
.main {
  max-width: none;
  margin: 0;
  padding: 88px 0 0;
}

/* Hide the legacy floating .header from layout.css; we use .site-header now. */
.header { display: none !important; }

/* ── Site header — CAIS-portal-inspired full-width sticky bar ── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(17, 17, 16, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  gap: 32px;
  max-width: none;
}

.site-header-divider {
  height: 1px;
  background: var(--border);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
  flex-shrink: 0;
}

.site-brand-mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--copper);
  flex-shrink: 0;
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.site-brand-primary {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: var(--black);
}

.site-brand-affiliate {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--light-gray);
  margin-top: 2px;
}

.site-brand:hover .site-brand-primary { color: var(--copper); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  justify-content: center;
}

.site-nav-link {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--gray);
  cursor: pointer;
  transition: color 0.15s var(--ease-out);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.site-nav-link:hover { color: var(--black); }
.site-nav-link.is-active {
  color: var(--copper);
  border-bottom-color: var(--copper);
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.header-tool-btn {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.15s var(--ease-out);
}
.header-tool-btn:hover {
  color: var(--copper);
  border-color: var(--copper);
}
.header-tool-btn.active {
  color: #fff;
  background: var(--copper);
  border-color: var(--copper);
}

/* ── Masthead crumb (back link inside a tool) ── */

.os-masthead-crumb {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light-gray);
  cursor: pointer;
  display: inline-block;
  margin-bottom: 8px;
  transition: color 0.15s var(--ease-out);
}
.os-masthead-crumb:hover { color: var(--copper); }

/* ── Home (single-screen control panel) ── */

.home-shell {
  padding: 1.4rem 2rem 1.6rem;
  height: calc(100vh - 88px - 32px); /* viewport minus header */
  min-height: 600px;
  display: flex;
  flex-direction: column;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.home-main {
  display: grid;
  grid-template-rows: minmax(280px, 0.85fr) minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
}

.home-map-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.home-map-section .hero-map {
  flex: 1;
  height: auto;
  min-height: 240px;
}

.home-aars,
.home-tools-rail {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.home-aars-head,
.home-rail-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.home-kicker {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
}

.home-section-title {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--light-gray);
}

/* AAR feed */

.aar-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.aar-empty {
  font-size: 0.85rem;
  color: var(--light-gray);
  font-style: italic;
  padding: 24px 0;
}

.aar-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: all 0.15s var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aar-card:hover {
  border-color: var(--copper);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.aar-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.aar-card-kicker {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light-gray);
  margin-bottom: 4px;
}

.aar-card-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.1px;
  color: var(--black);
  line-height: 1.25;
}

.aar-card-dates {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--light-gray);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.aar-card-takeaway {
  font-size: 0.82rem;
  color: var(--gray);
  line-height: 1.5;
}

.aar-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid rgba(46, 42, 38, 0.5);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.aar-keep    { color: var(--green); }
.aar-improve { color: var(--amber); }

.aar-open {
  color: var(--copper);
  font-weight: 600;
}

/* Tools rail (right) */

.tool-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.tool-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: center;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: all 0.15s var(--ease-out);
}
.tool-row.live:hover {
  border-color: var(--copper);
  background: rgba(196, 113, 59, 0.06);
}
.tool-row.soon {
  cursor: not-allowed;
  opacity: 0.55;
}

.tool-row-rank {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--copper);
}
.tool-row.soon .tool-row-rank { color: var(--light-gray); }

.tool-row-body { min-width: 0; }

.tool-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.tool-row-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.1px;
  color: var(--black);
}

.tool-row-stat {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light-gray);
  white-space: nowrap;
}
.tool-row.live .tool-row-stat { color: var(--copper); }

.tool-row-desc {
  font-size: 0.76rem;
  color: var(--gray);
  margin-top: 2px;
  line-height: 1.4;
}

.tool-row-arrow {
  font-family: var(--font-mono);
  color: var(--copper);
  font-weight: 600;
  text-align: right;
}
.tool-row.soon .tool-row-arrow { color: transparent; }

@media (max-width: 1100px) {
  .home-shell { height: auto; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── Globe (3D test build via Globe.gl) ── */

.globe-shell {
  padding: 1.4rem 2rem 4rem;
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.globe-head { padding-bottom: 4px; }

.globe-beta {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--copper);
  color: #fff;
  vertical-align: middle;
  margin-left: 8px;
}

.globe-link {
  color: var(--copper);
  border-bottom: 1px solid rgba(196, 113, 59, 0.4);
  cursor: pointer;
}
.globe-link:hover { color: #fff; border-bottom-color: #fff; }

.globe-canvas {
  background: #050403;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  height: 580px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.globe-canvas canvas { display: block; }

.globe-loading {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--light-gray);
}

.globe-tooltip {
  background: rgba(17, 17, 16, 0.96);
  color: #fff;
  border: 1px solid var(--copper);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-body);
  min-width: 220px;
  pointer-events: auto;
  box-shadow: var(--shadow-lg);
}
.globe-tooltip-kicker {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 4px;
}
.globe-tooltip-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}
.globe-tooltip-sub {
  font-size: 0.78rem;
  color: rgba(232, 228, 223, 0.7);
  line-height: 1.45;
}
.globe-tooltip-cta {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(232, 228, 223, 0.15);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--copper);
  font-weight: 700;
}

.weather-strip { display: block; }

/* ── Weather (placeholder) ── */

.weather-shell {
  padding: 1.4rem 2rem 4rem;
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.weather-head { padding-bottom: 8px; }

.weather-title {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 400;
  letter-spacing: -0.8px;
  color: var(--black);
  margin: 10px 0 12px;
  line-height: 1.05;
}

.weather-sub {
  font-size: 0.95rem;
  color: var(--gray);
  line-height: 1.55;
  max-width: 720px;
}

.weather-map { display: block; }
.weather-map .hero-map { height: 360px; }

.weather-roadmap {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 22px 24px;
}

.weather-todo {
  list-style: none;
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px 18px;
  font-size: 0.86rem;
  color: var(--gray);
  line-height: 1.5;
}
.weather-todo li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.weather-todo li span {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--black);
  margin-bottom: 2px;
}

/* ── Onboarding empty state for Training Event OS ── */

.detail-onboard {
  padding: 2rem 1rem;
}

.detail-onboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: start;
  max-width: 1080px;
}

.detail-onboard-cta { max-width: 480px; }

.onboard-title {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 400;
  letter-spacing: -0.6px;
  line-height: 1.05;
  margin-bottom: 18px;
  margin-top: 8px;
}

.onboard-lead {
  font-size: 1rem;
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 24px;
}
.onboard-lead strong { color: var(--copper); }

.onboard-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.onboard-flow {
  list-style: none;
  margin-top: 16px;
  counter-reset: stage;
  font-size: 0.88rem;
  color: var(--gray);
  line-height: 1.5;
}
.onboard-flow li {
  counter-increment: stage;
  padding: 8px 0 8px 36px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.onboard-flow li:last-child { border-bottom: none; }
.onboard-flow li::before {
  content: counter(stage, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--copper);
  letter-spacing: 0.04em;
}
.onboard-flow li span {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--black);
}

@media (max-width: 980px) {
  .detail-onboard-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ── Dev mode annotations ── */

.dev-mode [data-dev-note] {
  position: relative;
  outline: 1px dashed rgba(196, 113, 59, 0.45);
  outline-offset: 4px;
  border-radius: 2px;
}
.dev-mode [data-dev-note]::after {
  content: attr(data-dev-note);
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(196, 113, 59, 0.95);
  color: #fff;
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  line-height: 1.45;
  border-radius: 4px;
  max-width: 300px;
  white-space: normal;
  z-index: 100;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}

/* Dev-mode banner */
.dev-mode::before {
  content: "DEV MODE — annotations show why each section exists. Click Dev again to hide.";
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--copper);
  color: #fff;
  padding: 8px 18px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  pointer-events: none;
}

/* Feedback now via Rockdrill — see public/js/lib/rockdrill.js. */

.events-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
  padding: 1.6rem 2rem 4rem;
}

/* ── Rail (left) ── */

.events-rail,
.events-activity {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 18px 14px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--header-height) + 20px);
  max-height: calc(100vh - var(--header-height) - 40px);
  overflow-y: auto;
}

.rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 10px;
}

.rail-title {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light-gray);
}

.rail-new {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--copper);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.15s var(--ease-out);
}
.rail-new:hover { background: #b0632f; }

.rail-section {
  margin-top: 6px;
}

.rail-section-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light-gray);
  padding: 8px 10px 4px;
}

.rail-empty {
  font-size: 0.78rem;
  color: var(--light-gray);
  padding: 10px;
  font-style: italic;
  line-height: 1.6;
}

.rail-link {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: inherit;
  color: var(--copper);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-style: normal;
}
.rail-link:hover { color: #b0632f; }

.rail-footer {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding: 12px 12px 4px;
  text-align: center;
}
.rail-footer .rail-link-muted {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light-gray);
  text-decoration: none;
}
.rail-footer .rail-link-muted:hover { color: var(--red); }

.rail-item {
  padding: 10px 12px 10px 14px;
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: background 0.15s var(--ease-out);
  margin-bottom: 2px;
  position: relative;
}
.rail-item:hover { background: rgba(196, 113, 59, 0.08); }
.rail-item.selected {
  background: rgba(196, 113, 59, 0.12);
}
.rail-item.selected::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--copper);
}

.rail-item-name {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--black);
  letter-spacing: -0.1px;
}

.rail-item-meta {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--light-gray);
  margin-top: 3px;
  letter-spacing: 0.04em;
}

.rail-item-stage {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper);
  background: var(--copper-light);
  padding: 2px 7px;
  border-radius: var(--radius-badge);
  margin-top: 6px;
}

.rail-item.is-soon .rail-item-meta { color: var(--amber); }
.rail-item.is-today .rail-item-meta { color: var(--red); font-weight: 700; }

/* ── Detail (center) ── */

.events-detail {
  min-height: 60vh;
}

.detail-empty {
  text-align: center;
  padding: 6rem 2rem;
  color: var(--light-gray);
}
.detail-empty h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--gray);
  margin-bottom: 0.6rem;
}
.detail-empty p {
  font-size: 0.9rem;
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.6;
}

.event-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 1.8rem;
  padding: 0.6rem 0 1rem;
}

.event-kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 10px;
}

.event-title {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 400;
  letter-spacing: -0.8px;
  color: var(--black);
  line-height: 1.08;
}

.event-subtitle {
  font-size: 0.95rem;
  color: var(--gray);
  margin-top: 10px;
  line-height: 1.5;
}

.event-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.event-delete {
  background: none;
  border: none;
  color: var(--light-gray);
  font-size: 1.2rem;
  font-weight: 400;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s var(--ease-out);
  line-height: 1;
  padding: 0;
}
.event-delete:hover {
  color: var(--red);
  background: var(--red-light);
}

/* ── Stage bar ── */

.stage-bar-wrap {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.stage-bar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding-bottom: 4px;
  margin-bottom: -2px;
}
.stage-bar::-webkit-scrollbar { height: 4px; }
.stage-bar::-webkit-scrollbar-track { background: transparent; }
.stage-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.stage-bar::-webkit-scrollbar-thumb:hover { background: var(--copper-mid); }

.stage-pill {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--light-gray);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s var(--ease-out);
  flex-shrink: 0;
}
.stage-pill:hover {
  color: var(--copper);
  border-color: var(--copper-mid);
}
.stage-pill.done {
  background: var(--copper-light);
  color: var(--copper);
}
.stage-pill.active {
  background: var(--copper);
  color: #fff;
  border-color: var(--copper);
  box-shadow: var(--copper-glow-shadow);
}

/* ── Next action card ── */

.next-action {
  border-radius: var(--radius-card);
  padding: 24px 28px;
  margin-bottom: 1.4rem;
  background: var(--copper-light);
  border: 1px solid var(--copper-mid);
}

.next-action-kicker {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 8px;
}

.next-action-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--black);
  line-height: 1.35;
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}

.next-action-sub {
  font-size: 0.82rem;
  color: var(--gray);
  margin-bottom: 12px;
  line-height: 1.5;
}

.next-action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Checklist ── */

.checklist-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 22px 28px;
  margin-bottom: 1.6rem;
  box-shadow: var(--shadow-sm);
}

.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.checklist-progress {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--light-gray);
  letter-spacing: 0.06em;
}

.checklist-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
}
.checklist-item:hover .checkbox { border-color: var(--copper); }

.checklist-text {
  font-size: 0.88rem;
  color: var(--black);
  line-height: 1.4;
  flex: 1;
}
.checklist-text.done {
  color: var(--light-gray);
  text-decoration: line-through;
}

/* ── Event tabs (sub-panels) ── */

.event-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.8rem;
  margin-top: 0.6rem;
  overflow-x: auto;
}

.event-tab {
  background: none;
  border: none;
  padding: 12px 18px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--gray);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.15s var(--ease-out);
}
.event-tab:hover { color: var(--black); }
.event-tab.active {
  color: var(--copper);
  border-bottom-color: var(--copper);
  font-weight: 600;
}

.event-panel { display: none; }
.event-panel.active { display: block; }

/* ── Field forms ── */

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px 24px;
  margin-bottom: 1.2rem;
}
.field-grid.cols-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.field-grid.cols-1 { grid-template-columns: minmax(0, 1fr); }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light-gray);
}

.field-hint {
  font-size: 0.72rem;
  color: var(--light-gray);
  margin-top: 2px;
  line-height: 1.4;
}

.field.full { grid-column: 1 / -1; }

/* ── Trainer chips ── */

.trainer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trainer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.trainer-name {
  font-size: 0.88rem;
  font-weight: 600;
  flex: 1;
  color: var(--black);
}

.trainer-role {
  font-size: 0.75rem;
  color: var(--light-gray);
}

.status-chip {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s var(--ease-out);
}
.status-chip.tentative { background: var(--amber-light); color: var(--amber); }
.status-chip.invited { background: var(--copper-light); color: var(--copper); }
.status-chip.confirmed { background: var(--green-light); color: var(--green); }
.status-chip.declined { background: var(--red-light); color: var(--red); }

.trainer-picker {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Activity (right) ── */

.activity-section {
  margin-bottom: 1.4rem;
}

.activity-section:last-child {
  margin-bottom: 0;
}

.activity-section-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light-gray);
  padding: 4px 8px 8px;
}

.log-entry {
  font-size: 0.76rem;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--gray);
  line-height: 1.4;
}
.log-entry:last-child { border-bottom: none; }

.log-entry-time {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--light-gray);
  margin-bottom: 2px;
  letter-spacing: 0.04em;
}

.artifact-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--white);
}

.artifact-kind {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 4px;
}

.artifact-status {
  font-size: 0.76rem;
  color: var(--gray);
  margin-bottom: 8px;
}

.artifact-actions {
  display: flex;
  gap: 6px;
}

.prompt-card {
  padding: 10px 12px;
  background: var(--amber-light);
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: var(--black);
  line-height: 1.4;
}
[data-theme="dark"] .prompt-card {
  border-color: rgba(251, 191, 36, 0.2);
}

/* ── Modal ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding-top: 8vh;
  padding-left: 20px;
  padding-right: 20px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-modal);
  padding: 28px;
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  max-height: 80vh;
  overflow-y: auto;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -0.3px;
  margin-bottom: 1.4rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 1.6rem;
}

/* ── Artifact preview (MOU + canvas) ── */

.artifact-preview {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--black);
  white-space: pre-wrap;
  max-height: 480px;
  overflow-y: auto;
}

.artifact-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.2rem;
  margin-bottom: 6px;
}

/* ── Training Event OS hero (map + time bar) ── */

.training-hero {
  max-width: none;
  padding: 0 2rem;
  margin-bottom: 1.4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.hero-map {
  position: relative;
  background: #0a0908;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  height: 280px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.leaflet-host {
  position: absolute;
  inset: 0;
  background: #0a0908;
}

/* Leaflet dark-mode overrides */

.leaflet-container {
  background: #0a0908;
  font-family: var(--font-body);
  outline: none;
}

.leaflet-control-attribution {
  background: rgba(17, 17, 16, 0.78) !important;
  color: var(--light-gray) !important;
  font-family: var(--font-mono) !important;
  font-size: 0.55rem !important;
  letter-spacing: 0.02em !important;
  padding: 2px 8px !important;
  border-top-left-radius: 4px;
}
.leaflet-control-attribution a {
  color: var(--copper) !important;
}

/* Pins (DivIcon) */

.lf-icon { pointer-events: none; }
.lf-icon * { pointer-events: auto; cursor: pointer; }

.lf-pin {
  position: relative;
  width: 18px;
  height: 18px;
}

.lf-pin-ring,
.lf-pin-dot {
  position: absolute;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.lf-pin-ring {
  width: 18px;
  height: 18px;
  background: rgba(196, 113, 59, 0.22);
  border: 1px solid var(--copper);
  animation: lf-pulse 2.4s ease-in-out infinite;
}
.lf-pin-dot {
  width: 6px;
  height: 6px;
  background: var(--copper);
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.55);
}

.lf-pin.pin-fly   .lf-pin-ring { border-color: var(--green); background: rgba(74, 222, 128, 0.22); }
.lf-pin.pin-fly   .lf-pin-dot  { background: var(--green); }
.lf-pin.pin-sim   .lf-pin-ring { border-color: var(--red); background: rgba(248, 113, 113, 0.22); }
.lf-pin.pin-sim   .lf-pin-dot  { background: var(--red); }
.lf-pin.pin-watch .lf-pin-ring { border-color: var(--amber); background: rgba(251, 191, 36, 0.22); }
.lf-pin.pin-watch .lf-pin-dot  { background: var(--amber); }

@keyframes lf-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 113, 59, 0.0); }
  50%      { box-shadow: 0 0 0 6px rgba(196, 113, 59, 0.12); }
}

.lf-pin-label {
  position: absolute;
  left: 22px;
  top: -2px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  pointer-events: none;
}
.lf-pin-sub {
  position: absolute;
  left: 22px;
  top: 10px;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  color: rgba(255, 255, 255, 0.65);
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  pointer-events: none;
}

.lf-hq {
  position: relative;
  width: 10px;
  height: 10px;
}
.lf-hq-dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(232, 228, 223, 0.9);
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.55);
}
.lf-hq-label {
  position: absolute;
  left: 14px;
  top: -2px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: rgba(232, 228, 223, 0.75);
  letter-spacing: 0.04em;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  font-weight: 600;
}

/* Popups */

.josh-popup .leaflet-popup-content-wrapper {
  background: #111110;
  color: var(--black);
  border: 1px solid var(--copper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  padding: 0;
}
.josh-popup .leaflet-popup-content {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--font-body);
  line-height: 1.4;
  width: 260px !important;
}
.josh-popup .leaflet-popup-tip {
  background: #111110;
  border: 1px solid var(--copper);
}
.josh-popup .leaflet-popup-close-button {
  color: rgba(232, 228, 223, 0.55);
  font-size: 18px;
  padding: 6px 8px;
}
.josh-popup .leaflet-popup-close-button:hover { color: #fff; }

.josh-popup-kicker {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 4px;
}
.josh-popup-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: -0.2px;
  line-height: 1.15;
  color: #e8e4df;
  margin-bottom: 10px;
}
.josh-popup-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(232, 228, 223, 0.75);
  margin-bottom: 8px;
}
.josh-popup-days {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--copper);
}
.josh-popup-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(232, 228, 223, 0.6);
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(232, 228, 223, 0.12);
  margin-bottom: 12px;
}
.josh-popup-wx.wx-fly   { color: var(--green); }
.josh-popup-wx.wx-sim   { color: var(--red); }
.josh-popup-wx.wx-watch { color: var(--amber); }

.josh-popup-cta {
  width: 100%;
  background: var(--copper);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: var(--radius-button);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s var(--ease-out);
}
.josh-popup-cta:hover { background: #b0632f; }

/* Time-zone bar */

.hero-tz-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.tz-cell {
  padding: 12px 14px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tz-cell-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light-gray);
}
.tz-cell-home .tz-cell-label { color: var(--copper); }

.tz-cell-time {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--black);
  letter-spacing: -0.5px;
  line-height: 1;
}
.tz-cell-abbr {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--light-gray);
  letter-spacing: 0.04em;
  margin-left: 4px;
}

.tz-cell-weather {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: none;
  border: none;
  padding: 4px 0 0;
  text-align: left;
  cursor: pointer;
  transition: opacity 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}
.tz-cell-weather:hover { transform: translateX(2px); }
.tz-cell-weather.wx-fly   { color: var(--green); }
.tz-cell-weather.wx-sim   { color: var(--red); }
.tz-cell-weather.wx-watch { color: var(--amber); }

/* ── Masthead (slimmer) ── */

.os-masthead {
  padding: 0 2rem 0.8rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.os-masthead-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: -0.4px;
  color: var(--black);
}
.os-masthead-title span { color: var(--copper); }

.os-masthead-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light-gray);
  white-space: nowrap;
}

/* ── Responsive ── */

@media (max-width: 1320px) {
  .events-shell {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
    padding: 1.4rem 1.5rem 4rem;
  }
  .events-activity {
    display: none;
  }
}

@media (max-width: 860px) {
  .events-shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 1rem 1rem 3rem;
    gap: 14px;
  }
  .events-rail {
    position: static;
    max-height: none;
  }
  .field-grid,
  .field-grid.cols-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .os-masthead { padding: 0 1rem 0.6rem; }
  .os-masthead-title { font-size: 1.4rem; }
  .event-title { font-size: 1.7rem; }
  .stage-bar-wrap { padding: 10px 12px; }
  .checklist-card, .next-action { padding: 16px 18px; }
}
