/* AK Cone City - C:\Users\ayepa\Builds\cone-city\app\style.css */

:root {
  --bg: #0b0d10;
  --panel: rgba(16, 19, 24, 0.92);
  --edge: rgba(255, 255, 255, 0.10);
  --ink: #e9edf2;
  --dim: #97a3b2;
  --faint: #66707d;
  --onpermit: #f97316;   /* road-cone orange */
  --nostart: #facc15;
  --overdue: #ef4444;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}

#map { position: absolute; inset: 0; }
canvas { outline: none; }

/* ---------------------------------------------------------------- panels */

.panel {
  position: absolute;
  z-index: 5;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

#title {
  top: 14px; left: 14px;
  width: 320px;
  padding: 14px 16px 12px;
}

#info {
  top: 14px;
  left: 348px;
  padding: 8px 11px;
  color: var(--ink);
  font: 600 12px/1.2 inherit;
  cursor: pointer;
}
#info:hover { border-color: rgba(249, 115, 22, 0.7); color: var(--onpermit); }

#info-panel {
  top: 58px;
  left: 348px;
  width: min(430px, calc(100vw - 376px));
  max-height: calc(100vh - 86px);
  padding: 16px 18px;
  overflow: auto;
  font-size: 12.5px;
}
#info-panel h2 { margin: 0 26px 10px 0; font-size: 15px; }
#info-panel p { color: var(--dim); }
#info-panel dl { margin: 13px 0; }
#info-panel dt { margin-top: 10px; color: var(--ink); font-weight: 650; }
#info-panel dd { margin: 2px 0 0; color: var(--dim); }
#info-panel code { color: var(--ink); }
#info-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: 0; color: var(--faint);
  font-size: 20px; cursor: pointer;
}
#info-close:hover { color: var(--ink); }

h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h1 .dot { color: var(--onpermit); }

#tagline {
  margin: 4px 0 12px;
  color: var(--dim);
  font-size: 12.5px;
}

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 8px; }

.stat .n {
  font-size: 21px;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat .l { color: var(--dim); font-size: 11px; }
.stat.red .n { color: var(--overdue); }
.stat.amber .n { color: var(--nostart); }

/* ---------------------------------------------------------------- legend */

#legend {
  bottom: 14px; left: 14px;
  width: 320px;
  padding: 12px 16px 13px;
  font-size: 12px;
}

.key { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.key i {
  width: 0; height: 0; flex: none;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 13px solid currentColor;
}
.key .c { color: var(--dim); }
.key.on i { color: var(--onpermit); }
.key.no i { color: var(--nostart); }
.key.od i { color: var(--overdue); }

#honesty {
  margin: 11px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--edge);
  color: var(--dim);
  font-size: 11.5px;
}
#honesty b { color: var(--ink); font-weight: 600; }

#source { margin: 8px 0 0; color: var(--faint); font-size: 11px; }
#source a { color: var(--faint); }

/* --------------------------------------------------------------- filters */

#controls {
  top: 14px; right: 14px;
  width: 268px;
  padding: 13px 15px;
  font-size: 12.5px;
}

#controls h2 {
  margin: 0 0 9px;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}

label.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
label.check input { accent-color: var(--onpermit); margin: 0; }
label.check .n { margin-left: auto; color: var(--faint); font-variant-numeric: tabular-nums; }

.slider { margin: 12px 0 2px; }
.slider .row { display: flex; justify-content: space-between; color: var(--dim); font-size: 11.5px; }
.slider input { width: 100%; accent-color: var(--onpermit); margin: 5px 0 0; }

#orgbox {
  width: 100%;
  margin-top: 11px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--edge);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
}
#orgbox::placeholder { color: var(--faint); }
#controls > label:not(.check) { display: block; margin-top: 10px; color: var(--dim); font-size: 11.5px; }
#controls select { display: block; width: 100%; min-width: 0; max-width: 100%; margin-top: 4px; padding: 6px 8px; background: rgba(255,255,255,.05); border: 1px solid var(--edge); border-radius: 6px; color: var(--ink); font: inherit; }
#org-count { margin: 6px 0 0; color: var(--faint); font-size: 11px; overflow-wrap: anywhere; }

#shown {
  margin: 11px 0 0;
  padding-top: 9px;
  border-top: 1px solid var(--edge);
  color: var(--dim);
  font-size: 11.5px;
}
#shown b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ top ten */

#top {
  top: 296px; right: 14px;
  width: 268px;
  max-height: calc(100vh - 320px);
  padding: 13px 15px;
  overflow: auto;
}
#top h2 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}
.row {
  display: flex; gap: 9px; align-items: baseline;
  padding: 5px 0;
  border-top: 1px solid var(--edge);
  cursor: pointer;
  font-size: 12px;
}
.row:first-of-type { border-top: 0; }
.row:hover { color: var(--onpermit); }
.row .d { font-variant-numeric: tabular-nums; font-weight: 600; flex: none; width: 62px; }
.row .t { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row:hover .t { color: var(--ink); }

/* --------------------------------------------------------------- detail */

#detail {
  bottom: 14px; right: 14px;
  width: 340px;
  max-height: 60vh;
  padding: 14px 16px;
  overflow: auto;
  display: none;
}
#detail.open { display: block; }

#detail h3 { margin: 0 6px 2px 0; font-size: 14.5px; font-weight: 620; }
#detail .org { color: var(--dim); font-size: 12px; margin-bottom: 10px; }

#close {
  position: absolute; top: 9px; right: 11px;
  background: none; border: 0; color: var(--faint);
  font-size: 19px; line-height: 1; cursor: pointer;
}
#close:hover { color: var(--ink); }

.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 9px;
}
.pill.on { background: rgba(249, 115, 22, 0.16); color: var(--onpermit); }
.pill.no { background: rgba(250, 204, 21, 0.16); color: var(--nostart); }
.pill.od { background: rgba(239, 68, 68, 0.18); color: var(--overdue); }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
td { padding: 4px 0; vertical-align: top; border-top: 1px solid var(--edge); }
td:first-child { color: var(--dim); width: 44%; padding-right: 10px; }
td.num { font-variant-numeric: tabular-nums; }

#detail .note { margin: 10px 0 0; color: var(--faint); font-size: 11px; }

/* ------------------------------------------------------------- loading */

#loading {
  position: absolute; inset: 0; z-index: 20;
  display: grid; place-content: center;
  background: var(--bg);
  color: var(--dim);
  font-size: 13px;
  transition: opacity 0.35s;
}
#loading.gone { opacity: 0; pointer-events: none; }

.maplibregl-ctrl-attrib { font-size: 10px; }

@media (max-width: 860px) {
  #controls, #top, #detail { display: none; }
  #detail.open { display: block; left: 14px; right: 14px; width: auto; }
  #title, #legend { width: auto; left: 14px; right: 14px; }
  #legend { font-size: 11.5px; }
  #info { left: auto; right: 14px; top: 14px; }
  #info-panel { left: 14px; right: 14px; top: 58px; width: auto; }
}

/* --------------------------------------------------------------- search */

#search {
  position: absolute;
  z-index: 6;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 340px;
  max-width: calc(100vw - 28px);
}

.qwrap { display: flex; gap: 6px; }

#q {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}
#q::placeholder { color: var(--faint); }
#q:focus { outline: none; border-color: var(--onpermit); }

#results {
  margin-top: 6px;
  max-height: 46vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  display: none;
}
#results.open { display: block; }

.hit {
  padding: 8px 12px;
  border-top: 1px solid var(--edge);
  cursor: pointer;
  font-size: 12.5px;
}
.hit:first-child { border-top: 0; }
.hit:hover, .hit.on { background: rgba(249, 115, 22, 0.13); }
.hit .a { display: block; }
.hit .b { display: block; color: var(--faint); font-size: 11px; }
.hit i { color: var(--onpermit); font-style: normal; font-weight: 650; }
.hit em { color: var(--faint); font-style: normal; }

#results .none { padding: 9px 12px; color: var(--faint); font-size: 12px; }

@media (max-width: 860px) {
  #search { top: auto; bottom: 14px; left: 14px; right: 14px;
            transform: none; width: auto; }
  #results { max-height: 34vh; }
}

#here {
  flex: none;
  padding: 0 11px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 10px;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}
#here:hover { color: var(--ink); border-color: var(--onpermit); }
#here[disabled] { opacity: 0.5; cursor: default; }

#results h4 {
  margin: 0;
  padding: 7px 12px 5px;
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  border-top: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.02);
}
#results h4:first-child { border-top: 0; }
#results h4 + .hit { border-top: 0; }

.hit.place .a::before {
  content: "CE";
  color: var(--faint);
  margin-right: 7px;
}

#nearby li {
  padding: 6px 0;
  border-top: 1px solid var(--edge);
  cursor: pointer;
  list-style: none;
}
#nearby li:hover { color: var(--onpermit); }
#nearby ul { margin: 8px 0 0; padding: 0; }
#nearby .m { color: var(--faint); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- timeline */

#timeline {
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  width: 560px;
  max-width: calc(100vw - 720px);   /* clear of the legend (left) and detail (right) */
  min-width: 300px;
  padding: 10px 14px 8px;
  font-size: 12px;
}
#timeline[hidden] { display: none; }
.tl-row { display: flex; align-items: center; gap: 6px; }
.tl-row button {
  flex: none;
  min-width: 30px; height: 28px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--edge);
  border-radius: 7px;
  color: var(--ink);
  font: inherit; font-size: 14px;
  cursor: pointer;
}
.tl-row button:hover { background: rgba(255, 255, 255, 0.12); }
.tl-row button.playing { background: var(--onpermit); color: #111; border-color: var(--onpermit); }
#tl-latest { font-size: 11.5px; color: var(--dim); }
.tl-text { flex: 1; min-width: 0; margin-left: 6px; line-height: 1.3; }
.tl-text b { display: block; font-size: 13.5px; font-weight: 620; }
.tl-text span { color: var(--dim); font-size: 11.5px; display: block; }
#tl-day { width: 100%; accent-color: var(--onpermit); margin: 8px 0 2px; }
.tl-ends { display: flex; justify-content: space-between; color: var(--faint); font-size: 10.5px; }
#tl-changes { display: flex; flex-wrap: wrap; gap: 5px 12px; margin: 9px 0 0; padding: 7px 0 0; border: 0; border-top: 1px solid var(--edge); }
#tl-changes legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#tl-changes label { color: var(--dim); font-size: 11.5px; cursor: pointer; white-space: nowrap; }
#tl-changes input { margin: 0 4px 0 0; accent-color: var(--onpermit); vertical-align: -1px; }
#tl-filter-note { margin: 6px 0 0; color: var(--faint); font-size: 10.5px; }

@media (max-width: 1240px) {
  #timeline { max-width: calc(100vw - 28px); width: 560px; bottom: 210px; }
}
@media (max-width: 860px) {
  /* Phones use a flat dot map: fast to load, easy to tap, no 3D GPU work. */
  #title { right: 58px; padding: 11px 13px 9px; }
  #title h1 { font-size: 17px; }
  #tagline { margin-bottom: 8px; font-size: 11.5px; }
  #title .stats, #legend { display: none; }
  #info { right: 14px; left: auto; }
  #timeline { left: 14px; right: 14px; transform: none; width: auto; min-width: 0;
              bottom: auto; top: 108px; padding: 9px 12px 8px; }
  #tl-changes { gap: 5px 10px; }
  #tl-filter-note { font-size: 10px; }
}

#disclosure { margin: 8px 0 0; color: var(--faint); font-size: 11px; }

#detail h4.hist { margin: 12px 0 4px; font-size: 12px; font-weight: 620; color: var(--dim);
                  text-transform: uppercase; letter-spacing: .04em; }

/* ------------------------------------------------------------- report */
/* "Report this site" - everything stays in the reader's browser.        */

.report-btn {
  display: block; width: 100%;
  margin: 12px 0 0; padding: 8px 10px;
  background: rgba(249, 115, 22, 0.14);
  border: 1px solid rgba(249, 115, 22, 0.45);
  border-radius: 9px;
  color: var(--onpermit);
  font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer;
}
.report-btn:hover { background: rgba(249, 115, 22, 0.22); }
.report-btn[hidden] { display: none; }

#report h4 { margin: 14px 0 6px; font-size: 12.5px; font-weight: 620; color: var(--ink); }
#report .r-111 {
  margin-top: 12px; padding: 8px 10px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 9px;
  color: var(--ink); font-size: 12px; line-height: 1.45;
}
#report .r-opt {
  display: flex; gap: 8px; align-items: flex-start;
  margin: 5px 0; font-size: 12px; line-height: 1.4; color: var(--dim);
  cursor: pointer;
}
#report .r-opt input { margin: 3px 0 0; flex: none; accent-color: var(--onpermit); }
#report .r-opt b { color: var(--ink); }
#report .r-text {
  display: block; width: 100%; box-sizing: border-box;
  margin: 8px 0 0; padding: 7px 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--edge); border-radius: 8px;
  color: var(--ink); font: inherit; font-size: 12px; line-height: 1.4;
  resize: vertical;
}
#report .r-prefill { margin: 10px 0 0; color: var(--faint); font-size: 11px; line-height: 1.45; }
#report .r-prefill b { color: var(--dim); }
#report .r-btn {
  display: inline-block; margin: 10px 6px 0 0; padding: 7px 11px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--edge); border-radius: 9px;
  color: var(--ink); font: inherit; font-size: 12px; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
#report .r-btn:hover { background: rgba(255, 255, 255, 0.12); }
#report .r-primary {
  display: block; width: 100%; text-align: center;
  background: rgba(249, 115, 22, 0.18); border-color: rgba(249, 115, 22, 0.5);
  color: var(--onpermit);
}
#report .r-why { margin: 0 0 8px; font-size: 12px; line-height: 1.45; color: var(--dim); }
#report .r-card {
  padding: 9px 11px; margin: 0 0 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--edge); border-radius: 9px;
  font-size: 12px; line-height: 1.5;
}
#report .r-who { font-weight: 620; color: var(--ink); margin-bottom: 2px; }
#report .r-line { color: var(--dim); }
#report .r-line a, #report .r-why a { color: var(--ink); }
#report .r-src { margin-top: 4px; color: var(--faint); font-size: 11px; word-break: break-all; }
#report .r-hint { margin: 8px 0 0; color: var(--faint); font-size: 11px; line-height: 1.45; }
#report .r-warn { color: var(--nostart); }
#report .r-esc { margin: 12px 0 0; }
#report .r-esc summary { cursor: pointer; font-size: 12.5px; font-weight: 620; color: var(--ink); }
#report .r-esc > * { margin-top: 8px; }
#report .r-keep {
  margin: 14px 0 0; padding-top: 8px;
  border-top: 1px solid var(--edge);
  color: var(--faint); font-size: 11px; line-height: 1.45;
}
