/* ACCoRD Roadmap Styles */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&family=Inter:wght@400;500&display=swap');

:root {
  --accord-blue: #1a3a6b;
  --accord-blue-light: #2a5aab;
  --tile-radius: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.10);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.18);
  --transition: 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#accord-roadmap {
  font-family: 'Inter', sans-serif;
  max-width: 980px;
  margin: 2rem auto;
  padding: 0 1rem;
}

#accord-roadmap h2.roadmap-heading {
  font-family: 'Sora', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

#accord-roadmap p.roadmap-subheading {
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* ─── Diagram ─── */
.diagram-wrapper {
  margin-bottom: 2.5rem;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(30, 70, 140, 0.55) 0%, transparent 68%),
    linear-gradient(160deg, #081528 0%, #0c1e38 45%, #080f1e 100%);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 1.25rem 1rem 0.75rem;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 12px 48px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}

/* Subtle dot-grid texture */
.diagram-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 22px 22px;
  border-radius: 20px;
  pointer-events: none;
}

.diagram-caption {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  margin: 0 0 0.75rem 0.5rem;
}

.diagram-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.accord-diagram {
  display: block;
  width: 100%;
  min-width: 520px;
  max-width: 820px;
  margin: 0 auto;
}

/* Segment base */
.diag-seg {
  cursor: pointer;
  transition: opacity 0.2s ease, filter 0.2s ease;
  opacity: 0.88;
}

.diag-seg:hover,
.diag-seg:focus-visible {
  opacity: 1;
  filter: brightness(1.2) drop-shadow(0 0 8px rgba(255,255,255,0.3));
  outline: none;
}

.diag-seg:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}

.diag-seg.diag-active {
  animation: seg-flash 0.6s ease;
}

@keyframes seg-flash {
  0%   { filter: brightness(1.5) drop-shadow(0 0 12px rgba(255,255,255,0.6)); }
  100% { filter: brightness(1); }
}

/* SVG text labels */
.seg-label {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  user-select: none;
}

.advisory-label {
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ─── Grid ─── */
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 780px) {
  .roadmap-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .roadmap-grid { grid-template-columns: 1fr; }
}

/* ─── Tile ─── */
.roadmap-tile {
  border-radius: var(--tile-radius);
  padding: 1.1rem 1rem 0.9rem 1rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  border: none;
  outline: none;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.roadmap-tile:hover,
.roadmap-tile:focus-visible {
  transform: translateY(-4px) scale(1.025);
  box-shadow: var(--shadow-hover);
}

.roadmap-tile:active {
  transform: scale(0.97);
}

.roadmap-tile.active {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accord-blue), var(--shadow-hover);
  transform: translateY(-4px) scale(1.025);
}

.roadmap-tile.flash {
  animation: tile-flash 0.5s ease;
}

@keyframes tile-flash {
  0%   { box-shadow: 0 0 0 4px white, 0 0 20px rgba(255,255,255,0.5); }
  100% { box-shadow: var(--shadow); }
}

.tile-title {
  font-family: 'Sora', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 0.4rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.15);
  z-index: 1;
  position: relative;
}

.tile-icon {
  flex-grow: 1;
  display: flex;
  align-items: center;
  z-index: 1;
  position: relative;
}

.tile-icon svg {
  width: 38px;
  height: 38px;
  stroke: rgba(255,255,255,0.88);
  stroke-width: 1.6;
  fill: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
}

.tile-arrow {
  align-self: flex-end;
  width: 26px;
  height: 26px;
  background: rgba(255,255,255,0.22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  z-index: 1;
  position: relative;
}

.roadmap-tile:hover .tile-arrow,
.roadmap-tile.active .tile-arrow {
  background: rgba(255,255,255,0.38);
}

.tile-arrow svg {
  width: 13px;
  height: 13px;
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
  transition: transform 0.2s;
}

.roadmap-tile.active .tile-arrow svg {
  transform: rotate(90deg);
}

.roadmap-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  border-radius: var(--tile-radius);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.roadmap-tile:hover::after { opacity: 1; }

.tile-status-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
}
.tile-status-dot.in-progress { background: #fff; }
.tile-status-dot.planning { background: rgba(255,255,255,0.35); }

/* ─── Panel ─── */
.roadmap-panel {
  grid-column: 1 / -1;
  background: #fff;
  border-radius: var(--tile-radius);
  box-shadow: 0 8px 48px rgba(0,0,0,0.13);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, margin 0.3s ease;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.roadmap-panel.open {
  max-height: min(620px, 60vh);
  overflow-y: auto;
  opacity: 1;
  margin-top: 4px;
  pointer-events: auto;
}

.panel-inner {
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 640px) {
  .panel-inner { grid-template-columns: 1fr; padding: 1.25rem; }
}

.panel-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-color-bar {
  width: 5px;
  border-radius: 4px;
  flex-shrink: 0;
  align-self: stretch;
  min-height: 48px;
}

.panel-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accord-blue);
  margin: 0 0 0.2rem 0;
  line-height: 1.2;
}

.panel-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.panel-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.panel-status.in-progress { background: #e8f5e9; color: #2e7d32; }
.panel-status.planning { background: #fff3e0; color: #e65100; }

.panel-lead { font-size: 0.8rem; color: #777; }

.panel-summary { font-size: 0.95rem; color: #444; line-height: 1.65; margin: 0; }
.panel-details { font-size: 0.875rem; color: #555; line-height: 1.7; margin-top: 0.75rem; }

.panel-milestones-title {
  font-family: 'Sora', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accord-blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 1rem 0;
}

.panel-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #f0f0f0;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}
.panel-close:hover { background: #e0e0e0; }
.panel-close svg { width: 14px; height: 14px; stroke: #555; stroke-width: 2.5; fill: none; }
.panel-wrapper { position: relative; }

/* ─── Export All ─── */
.export-all-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.export-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--accord-blue);
  border: none;
  border-radius: 7px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s, transform 0.15s;
  font-family: inherit;
}
.export-all-btn:hover:not(:disabled) { background: #2a5aab; transform: translateY(-1px); }
.export-all-btn:active:not(:disabled) { transform: translateY(0); }
.export-all-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.export-all-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ─── Recommendation list ─── */
.rec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rec-item { border: 1px solid rgba(0,0,0,0.08); border-radius: 8px; overflow: hidden; background: #fff; }
.rec-header { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: default; user-select: none; }
.rec-header.expandable { cursor: pointer; }
.rec-header.expandable:hover { background: rgba(0,0,0,0.03); }
.rec-num { flex-shrink: 0; font-size: 0.82rem; font-weight: 700; color: #bbb; min-width: 20px; line-height: 1; }
.rec-num.done { color: var(--tile-color, #888); }
.rec-label { flex: 1; font-size: 0.88rem; color: #333; font-weight: 500; }
.rec-item.done .rec-label { color: #555; }
.rec-chevron { width: 14px; height: 14px; flex-shrink: 0; transition: transform 0.2s ease; }
.rec-chevron svg { width: 100%; height: 100%; stroke: #888; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.rec-header[aria-expanded="true"] .rec-chevron { transform: rotate(90deg); }
.rec-body { display: none; border-top: 1px solid rgba(0,0,0,0.06); }
.rec-body.open { display: block; }

.summary-section { padding: 10px 12px 10px 32px; }
.summary-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #999; margin-bottom: 6px; }
.summary-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.summary-item { background: #f7f7f7; border-radius: 5px; padding: 6px 10px; font-size: 0.82rem; color: #444; line-height: 1.5; }

.export-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 10px 32px; border-top: 1px solid rgba(0,0,0,0.05); gap: 8px; }
.raw-count { font-size: 0.78rem; color: #888; }
.raw-count strong { color: #555; }
.export-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 600; color: var(--tile-color, #555); background: none; border: 1px solid var(--tile-color, #ccc); border-radius: 5px; padding: 4px 10px; cursor: pointer; transition: background 0.15s, color 0.15s; white-space: nowrap; font-family: inherit; }
.export-btn:hover { background: var(--tile-color, #555); color: #fff; }
.export-btn svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }