/* Shared styles for the JFK Explosion Report mockups (dashboard + media page). */
  /* Tokens derived from catalog entry: layouts/dashboard/calm-illustrated-task-dashboard */
  :root {
    --frame: #E2E2E2;
    --app-bg: #F4F4F4;
    --card: #FFFFFF;
    --teal: #1E8C7E;
    --brand-orange: #F47920; /* sampled from JFK Neighborhood Association logo */
    --brand-orange-deep: #BF560A; /* same hue, deepened so white text clears 4.5:1 */
    --teal-deep: #1F4A42;
    --mint: #CDEFE3;
    --mint-soft: #E8F6F1;
    --ink: #1F2A2E;
    --muted: #6E767A;
    --hair: #ECEEEE;

    /* Explosion size: gold → orange-red → crimson → deep purple. Validated: every adjacent pair
       distinct for normal + colorblind vision, lightness steps darker with size. No green. */
    --size-small: #D49E1A;
    --size-medium: #E44E2C;
    --size-large: #B0163F;
    --size-massive: #5A2884;
    --size-unrated: #A9AEB0; /* neutral, outside the size ramp */


    --radius-frame: 32px;
    --radius-card: 24px;
    --gap: 20px;
  }
  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  /* Swapped by admin-bar.js, which adds body.is-admin when an admin is signed in */
  .admin-only { display: none !important; }
  body.is-admin .admin-only { display: inline-flex !important; }
  body.is-admin .public-only { display: none !important; }
  html { background: var(--frame); }
  body {
    margin: 0;
    background: var(--frame);
    color: var(--ink);
    font-family: "Urbanist", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
  }
  button { font: inherit; color: inherit; cursor: pointer; }

  .frame {
    max-width: 1360px;
    margin: 32px auto;
    padding: 24px;
    background: var(--app-bg);
    border-radius: var(--radius-frame);
  }
  .card {
    background: var(--card);
    border-radius: var(--radius-card);
    padding: 24px;
  }
  .card h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
  }
  .card .sub { margin: 0; color: var(--muted); font-size: 14px; }
  .card-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
  }

  /* ---------- Top bar ---------- */
  .topbar {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: var(--gap);
  }
  .brand { display: flex; align-items: center; gap: 12px; margin-right: auto; padding-left: 8px; }
  .brand-logo { width: 52px; height: 52px; display: block; flex: none; }
  .brand-name { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }

  .topbar-actions {
    display: flex; align-items: center; gap: 12px;
    background: var(--card); border-radius: 999px; padding: 8px;
  }
  .seg { display: flex; background: var(--app-bg); border-radius: 999px; padding: 4px; }
  .seg button {
    border: 0; background: transparent; padding: 8px 16px; border-radius: 999px;
    font-size: 14px; font-weight: 500; color: var(--muted);
  }
  .seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
  .btn {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--hair); background: var(--card);
    padding: 10px 18px; border-radius: 999px; font-weight: 500; font-size: 15px;
    white-space: nowrap;
  }
  .btn-primary { background: var(--brand-orange); border-color: var(--brand-orange); color: #fff; font-weight: 700; }
  .btn svg { width: 18px; height: 18px; flex: none; }
  a.btn { text-decoration: none; color: var(--ink); }
  a.btn-primary { color: #fff; }

  /* ---------- Layout ---------- */
  .layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gap);
    align-items: start;
  }
  .col { display: grid; gap: var(--gap); min-width: 0; }
  .col > *, .two-up > *, .tiles > * { min-width: 0; }

  /* ---------- Banner ---------- */
  .banner {
    position: relative; overflow: hidden; padding: 0;
    min-height: 400px;
    background: #C9CDD0;
  }
  .banner-photo {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: 50% 38%; z-index: 0;
  }
  /* Light fade over the gray sky only, so the scrap pile below stays crisp */
  .banner::before {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(180deg, rgba(244,246,245,.85) 0%, rgba(244,246,245,.6) 28%, rgba(244,246,245,0) 50%);
  }
  .banner-text { position: relative; z-index: 2; padding: 32px 40px 0; max-width: calc(100% - 330px); }
  .banner-about { max-width: 460px; line-height: 1.45; }
  .banner-about a { color: var(--teal-deep); font-weight: 700; white-space: nowrap; }
  .banner-text h1, .banner-text p { text-shadow: 0 0 10px rgba(244,246,245,.95), 0 0 22px rgba(244,246,245,.8); }
  .banner-eyebrow { font-size: 14px; font-weight: 600; color: var(--teal); text-transform: uppercase; letter-spacing: .08em; }
  .banner h1 {
    margin: 8px 0 8px; font-size: 40px; line-height: 1.05; font-weight: 700;
    color: var(--teal-deep); letter-spacing: -0.02em;
  }
  .banner p { margin: 0; font-size: 18px; color: #35504A; }
  .banner p b { color: var(--teal-deep); }

  .latest {
    position: absolute; z-index: 3; right: 20px; bottom: 20px; width: 300px;
    background: var(--card); border-radius: 18px; padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(31, 74, 66, .10);
  }
  .latest h3 { margin: 0 0 12px; font-size: 17px; font-weight: 600; }
  .latest-item { display: flex; gap: 12px; padding: 6px 0; }
  .latest-item + .latest-item { border-top: 1px solid var(--hair); padding-top: 10px; margin-top: 4px; }
  .latest-bar { width: 4px; border-radius: 4px; flex: none; }
  .latest-title { font-size: 15px; font-weight: 600; }
  .latest-meta { font-size: 13px; color: var(--muted); }

  /* ---------- Stat tiles ---------- */
  .tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
  .tile { padding: 20px 22px; }
  .tile-label { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
  .tile-label svg { width: 18px; height: 18px; color: var(--teal); }
  .tile-value { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 2px; line-height: 1.1; }
  .tile-note { font-size: 13px; color: var(--muted); }
  .tile-note b { color: var(--ink); font-weight: 600; }

  /* ---------- Legend ---------- */
  .legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
  .legend span { display: inline-flex; align-items: center; gap: 6px; }
  .swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

  /* ---------- Timeline ---------- */
  .chart { width: 100%; position: relative; }
  .chart svg { display: block; overflow: visible; }
  .axis text { font-size: 12px; fill: var(--muted); font-family: inherit; }
  .grid line { stroke: var(--hair); }
  .hit { fill: transparent; }
  .bar-col:hover .hit { fill: rgba(30, 140, 126, .06); }

  /* ---------- Two-up ---------- */
  .period-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: var(--card); border-radius: 999px; padding: 8px 8px 8px 24px;
  }
  .period-intro { font-weight: 600; font-size: 15px; color: var(--muted); }
  .period { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .period-nav { display: flex; align-items: center; gap: 8px; }
  .period-nav[hidden] { display: none; }
  .period-label { min-width: 120px; text-align: center; font-weight: 600; font-size: 15px; }
  .chart-legend { margin-top: 14px; justify-content: center; }
  .chart-empty {
    position: absolute; inset: 0 0 26px 32px; display: grid; place-content: center; text-align: center;
    color: var(--muted); font-size: 15px; pointer-events: none;
  }
  .chart-empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
  .two-up { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--gap); }

  /* Heatmap */
  .hours .bar { fill: var(--teal); }
  .hours .bar-col:hover .bar { fill: var(--teal-deep); }
  .peaks { margin-top: 18px; padding: 16px 18px; background: var(--app-bg); border-radius: 16px; }
  .peak { display: grid; grid-template-columns: 22px 1fr auto; align-items: baseline; gap: 8px; padding: 6px 0; }
  .peak-rank { font-size: 13px; font-weight: 600; color: var(--muted); }
  .peak-when { font-size: 16px; font-weight: 600; }
  .peak-n { font-size: 14px; color: var(--muted); }

  /* Size + impacts */
  .sizebar { display: flex; gap: 2px; height: 16px; border-radius: 6px; overflow: hidden; margin: 6px 0 10px; }
  .sizebar div { height: 100%; }
  .size-keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; margin-bottom: 24px; }
  .size-key .n { font-size: 22px; font-weight: 700; }
  .size-key .pct { font-size: 13px; font-weight: 500; color: var(--muted); }
  .size-key .l { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
  .impact { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; margin-bottom: 12px; }
  .impact svg { width: 20px; height: 20px; color: var(--teal-deep); }
  .impact-name { font-size: 14px; margin-bottom: 4px; }
  .impact-track { height: 8px; background: var(--app-bg); border-radius: 4px; overflow: hidden; }
  .impact-fill { height: 100%; background: var(--teal); border-radius: 0 4px 4px 0; }
  .impact-n { font-size: 15px; font-weight: 600; min-width: 28px; text-align: right; }
  .section-label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; }

  /* ---------- Log table ---------- */
  .chips { display: flex; gap: 8px; flex-wrap: wrap; }
  .chip {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--hair); background: var(--card);
    padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
  }
  .chip[aria-pressed="true"] { background: var(--mint-soft); border-color: var(--teal); color: var(--teal-deep); }
  table { width: 100%; border-collapse: collapse; font-size: 15px; }
  th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 12px 10px; border-bottom: 1px solid var(--hair); }
  td { padding: 14px 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
  tr:last-child td { border-bottom: 0; }
  .size-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
  .size-dot { width: 10px; height: 10px; border-radius: 50%; }
  .approx { font-size: 12px; color: var(--muted); margin-left: 4px; }
  .felt { display: flex; gap: 6px; }
  .felt span {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--app-bg); border-radius: 999px; padding: 3px 10px; font-size: 13px; color: #3C4649;
  }
  .felt svg { width: 14px; height: 14px; }
  .table-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 14px; color: var(--muted); }


  /* ---------- Shared ---------- */
  .icon-btn {
    width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--hair); background: var(--card);
    display: grid; place-items: center;
  }
  .icon-btn svg { width: 18px; height: 18px; }
  .icon-btn:disabled { opacity: .35; cursor: default; }
  .empty { color: var(--muted); font-size: 14px; }
  .star { color: var(--brand-orange-deep); text-decoration: none; font-weight: 700; margin-left: 2px; }
  .count-note {
    display: flex; gap: 8px; margin: 0; padding: 14px 20px;
    background: var(--card); border-radius: 16px; border-left: 4px solid var(--brand-orange-deep);
    font-size: 16px; line-height: 1.55; color: #3C4649;
  }
  .count-note .star { font-size: 20px; line-height: 1.1; margin: 0; }

  .about p { color: #3C4649; font-size: 15px; margin: 8px 0 0; }
  .about p.about-source { font-size: 13px; color: var(--muted); margin-top: 12px; }
  .about-source a { color: var(--teal-deep); font-weight: 600; }

  /* ---------- Tooltip ---------- */
  .tip {
    position: fixed; pointer-events: none; z-index: 50;
    background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 12px;
    font-size: 13px; line-height: 1.45; min-width: 140px;
    box-shadow: 0 8px 20px rgba(0,0,0,.18); opacity: 0; transition: opacity .1s;
  }
  .tip b { font-size: 14px; }
  .tip .row { display: flex; align-items: center; gap: 6px; }
  .tip .row .v { margin-left: auto; font-weight: 600; padding-left: 12px; }

  .site-foot { max-width: 1360px; margin: -16px auto 8px; padding: 0 24px; display: flex; justify-content: center; }
  .admin-link {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
    font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none;
  }
  .admin-link:hover { background: var(--card); color: var(--ink); }
  .admin-link svg { width: 16px; height: 16px; }
  .mock-note { text-align: center; font-size: 13px; color: var(--muted); margin: 0 0 32px; }

  /* ---------- Responsive ---------- */
  @media (max-width: 1100px) {
    .layout { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 860px) {
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .two-up { grid-template-columns: minmax(0, 1fr); }
    .topbar { flex-wrap: wrap; }
    .brand { width: 100%; }
    .banner-text { max-width: 100%; }
    .banner { background: linear-gradient(180deg, #F4F6F5 0%, var(--card) 100%); min-height: 0; }
    .banner::before { display: none; }
    .banner-photo { position: relative; display: block; height: 230px; margin-top: 20px; object-position: 30% 70%; }
    .latest { position: relative; right: auto; bottom: auto; width: auto; margin: 16px; box-shadow: none; border: 1px solid var(--hair); }
  }
  @media (max-width: 640px) {
    .frame { margin: 0; padding: 16px; border-radius: 0; }
    .period-bar { border-radius: 20px; padding: 14px; }
    .period { width: 100%; justify-content: space-between; }
    .period-intro { width: 100%; text-align: center; }
    .topbar-actions { width: 100%; flex-wrap: wrap; border-radius: 20px; justify-content: space-between; }
    .seg { width: 100%; }
    .seg button { flex: 1; padding: 8px 6px; }
    .topbar-actions .btn { flex: 1; justify-content: center; }
    .banner-text { padding: 24px 20px 0; }
    .banner h1 { font-size: 34px; }
    .brand-name { font-size: 22px; }
    .card { padding: 20px; }
    .tile-value { font-size: 30px; }
    .col-felt { display: none; }
    td, th { padding-left: 6px; padding-right: 6px; }
  }
