/* vibeperdollar — Win95 chrome on top of 98.css, mobile-first */

:root {
  --grade-a: #008000;
  --grade-b: #b8860b;
  --grade-c: #d2691e;
  --grade-other: #666;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #008080;
  font-family: "MS Sans Serif", "Pixelated MS Sans Serif", Tahoma, sans-serif;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 8px; }

/* top chrome */
.title-bar-text { font-weight: normal; }
.status-bar { display: flex; gap: 4px; margin-top: 4px; font-size: 11px; }
.status-bar-field { padding: 2px 6px; }

.menubar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  padding: 2px;
  margin-bottom: 8px;
  font-size: 13px;
}
.menubar a {
  padding: 3px 10px;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
}
.menubar a:hover { background: #000080; color: #fff; outline: 1px dotted #fff; }
.menubar a.active { background: #000080; color: #fff; }

/* grade badge */
.grade {
  display: inline-block;
  min-width: 26px;
  text-align: center;
  font-weight: bold;
  font-size: 15px;
  color: #fff;
  padding: 3px 8px;
  border: 1px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
}
.grade-A { background: var(--grade-a); }
.grade-B { background: var(--grade-b); }
.grade-C { background: var(--grade-c); }
.grade-Z, .grade-N { background: var(--grade-other); }

/* feed */
.feed { display: flex; flex-direction: column; gap: 10px; }
.card { margin: 0; }
.card .card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.card .card-title { font-weight: bold; }
.card .card-sub { color: #444; font-size: 12px; margin: 2px 0 6px; }
.card .card-note textarea { width: 100%; min-height: 48px; resize: vertical; }
.card .card-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.card .meta { font-size: 12px; color: #444; }

/* filters */
.filters fieldset { display: flex; flex-direction: column; gap: 8px; }
.filters .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select, .filters input[type="text"] { flex: 1; min-width: 120px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  cursor: pointer;
  padding: 2px 10px;
  border: 1px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  background: #c0c0c0;
  font-size: 12px;
}
.chip.on { background: #000080; color: #fff; }

/* map */
#map { height: clamp(280px, 55vh, 560px); width: 100%; border: inset 1px #808080; background: #fff; }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tabs button { flex: 1; }

.pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 10px; }

/* leaflet inside win95 chrome: system-ish font */
.leaflet-container { font: 11px Tahoma, sans-serif; }

.hero { margin-top: 12px; }
.hero p { margin: 8px 0; }
ul.plain { margin: 8px 0; padding-left: 20px; }
ul.plain li { margin: 4px 0; }

footer {
  text-align: center;
  color: #fff;
  font-size: 11px;
  margin: 16px 0 8px;
}
footer a { color: #fff; }

@media (min-width: 700px) {
  .wrap { max-width: 900px; }
}

/* ---------- desktop (/app) ---------- */

body.desktop {
  min-height: 100vh;
  position: relative;
}

#desktop-icons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding-top: 10px;
  z-index: 5;
}

/* wide screens: icons pin to the left like a real desktop, and the
   window sizes itself to whatever room is left */
@media (min-width: 1024px) {
  #desktop-icons {
    position: absolute;
    top: 12px;
    left: 12px;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 16px;
    padding-top: 0;
  }
}

.dicon {
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  text-align: center;
}
.dicon svg {
  width: 40px;
  height: 40px;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,.45));
}
.dicon span {
  font-size: 11px;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  line-height: 1.2;
}
.dicon:hover span { text-decoration: underline; }
.dicon.on { outline: 1px dotted #fff; outline-offset: 3px; }

body.desktop .wrap {
  width: 100%;
  box-sizing: border-box;
  max-width: min(960px, calc(100vw - 20px));
  margin: 10px auto 8px;
}

@media (min-width: 1024px) {
  body.desktop .wrap {
    max-width: min(960px, calc(100vw - 132px));
    margin: 14px 12px 10px 116px;
  }
}

/* ---------- place card (trading card) ---------- */

#place-card {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.4);
  padding: 12px;
}

.pc-window { width: min(340px, 94vw); }

.pc-frame {
  background: linear-gradient(135deg, #f7e08b, #b8860b 30%, #f7e08b 50%, #b8860b 70%, #f7e08b);
  padding: 4px;
  border: 2px solid #808080;
}

.pc-inner {
  background: #fdfcf3;
  border: 1px solid #999;
  box-shadow: inset 1px 1px 0 #fff;
}

.pc-holo {
  position: relative;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-bottom: 2px solid #b8860b;
  background-image: linear-gradient(115deg,
    #7fdfff 0%, #c9f7ff 15%, #ffd9f2 30%, #fff6c4 45%,
    #d0ffd9 60%, #ffd9f2 75%, #c9f7ff 90%, #7fdfff 100%);
  background-size: 300% 300%;
  animation: holo 7s linear infinite;
}

@keyframes holo {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.pc-grade-big {
  font-size: 44px;
  font-weight: bold;
  line-height: 1;
  color: #1a1a1a;
  text-shadow: 2px 2px 0 rgba(255,255,255,.7);
}
.pc-score { font-size: 12px; color: #333; margin-top: 2px; }

.pc-stats { padding: 8px 10px 4px; }
.pc-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  border-bottom: 1px dotted #bbb;
  font-size: 12px;
}
.pc-row span { color: #666; }
.pc-row b { text-align: right; font-weight: bold; }

.pc-note { padding: 6px 10px 10px; }
.pc-note textarea {
  width: 100%;
  min-height: 44px;
  resize: vertical;
}

.pc-camis { text-align: right; padding: 0 10px 8px; color: #999; }

@media (prefers-reduced-motion: reduce) {
  .pc-holo { animation: none; }
}

/* small screens: compact icons (they are a row by default now) */
@media (max-width: 1023px) {
  .dicon { width: 64px; }
  .dicon svg { width: 34px; height: 34px; }
  body.desktop .wrap { margin-top: 4px; padding: 4px; }
}

/* card: history + violations */
.pc-window .pc-body { max-height: 80vh; overflow-y: auto; }
.pc-history { padding: 6px 10px; border-bottom: 1px dotted #bbb; }
.pc-history .meta, .pc-violations .meta { display: block; margin-bottom: 4px; }
.pc-history .grade { margin-right: 4px; margin-bottom: 4px; }
.pc-violations { padding: 6px 10px; border-bottom: 1px dotted #bbb; }
.pc-violations ul { margin: 0; padding-left: 16px; font-size: 11px; }
.pc-violations li { margin: 3px 0; color: #333; }
.pc-violations li.crit { color: #a00; }
.pc-violations li i { font-style: normal; color: #a00; font-weight: bold; margin-left: 4px; }

/* card art: site preview replaces the holo header when available */
.pc-holo.pc-art {
  background-image: none;
  animation: none;
  height: 150px;
  position: relative;
  padding: 0;
}
.pc-holo.pc-art img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.pc-art-grade {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 14px;
  border: 1px solid #fff;
  box-shadow: 1px 1px 0 rgba(0,0,0,.5);
}

/* ---------- taskbar + start menu ---------- */

body.desktop { padding-bottom: 46px; }

#taskbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 40px;
  background: #c0c0c0;
  border-top: 2px solid #dfdfdf;
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 3px 4px;
  box-sizing: border-box;
  z-index: 100;
}

#taskbar button { height: 30px; align-self: center; }

#taskbar-tasks { display: flex; gap: 4px; overflow: hidden; flex: 1; }
.task-btn { white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.task-btn.pressed {
  background: #dfdfdf;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  font-weight: bold;
}

#tray {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tray-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  white-space: nowrap;
}
.wicon { width: 16px; height: 16px; }

#start-menu {
  position: fixed;
  left: 4px;
  bottom: 42px;
  z-index: 110;
  display: flex;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  box-shadow: 2px 2px 0 rgba(0,0,0,.35);
}
.start-menu-banner {
  width: 26px;
  background: linear-gradient(#000080, #1084d0);
  color: #c0c0c0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  font-size: 13px;
  padding: 8px 2px;
}
.start-menu-items { display: flex; flex-direction: column; padding: 4px 2px; min-width: 150px; }
.start-menu-items a {
  padding: 6px 12px;
  color: #000;
  text-decoration: none;
  font-size: 13px;
}
.start-menu-items a:hover { background: #000080; color: #fff; }
.start-menu-items hr { border: none; border-top: 1px solid #808080; border-bottom: 1px solid #fff; margin: 3px 6px; width: 100%; }

/* ---------- window maximize ---------- */

.window.maximized {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 42px;
  max-width: none;
  width: auto;
  margin: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
}
/* scroll inside the window instead of spilling over the taskbar */
.window.maximized .window-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.window.maximized #view-map {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.window.maximized #view-map #map {
  flex: 1;
  min-height: 240px;
  height: auto;
}

/* ---------- listings table ---------- */

.feed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.feed-table th, .feed-table td {
  border: 1px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  padding: 4px 8px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.feed-table th { background: #c0c0c0; position: sticky; top: 0; }
.feed-row { cursor: pointer; }
.feed-row:hover { background: #000080; }
.feed-row:hover td { color: #fff; }
.feed-table td .grade { font-size: 11px; padding: 1px 6px; }

/* ---------- filters: neighborhoods + franchise ---------- */


@media (max-width: 700px) {
  .col-score, .col-phone { display: none; }
  .feed-table th, .feed-table td { max-width: 140px; }
}

/* nested borough -> neighborhood dropdown (custom combo box) */
.areadd { position: relative; flex: 1; min-width: 190px; }
.areadd-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 23px;
  padding: 3px 4px 3px 6px;
  background: #fff;
  border: 1px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  box-shadow: inset 1px 1px 0 #404040;
  font-family: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.areadd-btn:focus { outline: 1px dotted #000; outline-offset: -4px; }
.areadd-arrow {
  flex: none;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #000;
}
.areadd-panel {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 100%;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #808080;
  box-shadow: 2px 2px 0 rgba(0,0,0,.3);
  padding: 2px;
  z-index: 60;
}
.areadd-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 6px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.areadd-item:hover { background: #000080; color: #fff; }
.areadd-item .box, .areadd-item .bullet {
  flex: none;
  width: 12px; height: 12px;
  border: 1px solid #808080;
  background: #fff;
  position: relative;
}
.areadd-item .bullet { border-radius: 50%; }
.areadd-item.sel .box::after {
  content: "";
  position: absolute;
  left: 1px; top: 1px;
  width: 6px; height: 3px;
  border-left: 2px solid #000;
  border-bottom: 2px solid #000;
  transform: rotate(-45deg);
}
.areadd-item.sel .bullet::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #000;
}
.areadd-item.area-nta { padding-left: 25px; }
.areadd-item.area-boro { font-weight: bold; }
.areadd-group-label {
  font-size: 11px;
  font-weight: bold;
  background: #c0c0c0;
  padding: 2px 6px;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #808080;
  position: sticky;
  top: 0;
}

/* 98.css forces min-width: 75px on every <button>; undo where it
   breaks compact chrome (taskbar, dropdowns) */
#taskbar button, .areadd-btn, .mdrop-btn, .task-btn { min-width: 0; }

/* menubar "Filter" dropdown menu */
.mdrop { position: relative; display: inline-block; }
.mdrop-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13px;
  padding: 3px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
}
.mdrop-btn::after {
  content: "";
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}
.mdrop-btn:hover { background: #000080; color: #fff; }
.mdrop-panel {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  box-shadow: 2px 2px 0 rgba(0,0,0,.35);
  padding: 3px;
  z-index: 80;
}
.mdrop-panel .areadd-item { color: #000; }
.mdrop-panel .areadd-item:hover { background: #000080; color: #fff; }
.mdrop-panel hr {
  border: none;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
  margin: 3px 4px;
}
.mdrop-label { font-size: 11px; font-weight: bold; padding: 2px 6px 4px; color: #404040; }

@media (max-width: 600px) {
  .wx-cond { display: none; }
  .task-btn { max-width: 90px; }
  .tray-item { padding: 0 6px; }
}

/* map loading overlay */
#view-map { position: relative; }
.map-loading {
  position: absolute;
  inset: 0 0 46px 0;   /* above map, below the caption lines */
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  background: rgba(224, 224, 224, .72);
  z-index: 500;
}
.map-loading .progress-bar {
  width: 200px;
  height: 16px;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  box-shadow: 1px 1px 0 rgba(0,0,0,.4);
  overflow: hidden;
}
.map-loading .indicator {
  width: 40%;
  height: 100%;
  background: repeating-linear-gradient(90deg, #000080 0 8px, #1084d0 8px 16px);
  animation: loading-slide 1.1s linear infinite;
}
@keyframes loading-slide {
  from { transform: translateX(-100%); }
  to   { transform: translateX(250%); }
}
@media (prefers-reduced-motion: reduce) {
  .map-loading .indicator { animation: none; }
}

/* card art: the place NAME (preview image replaces it when ready) */
.pc-holo {
  padding: 12px;
  text-align: center;
}
.pc-name {
  font-size: 19px;
  font-weight: bold;
  line-height: 1.2;
  color: #1a1a1a;
  text-shadow: 1px 1px 0 rgba(255,255,255,.75);
  overflow-wrap: break-word;
}
.pc-art-name {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 5px 8px;
  background: rgba(0, 0, 64, .6);
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* card save row: list picker */
.pc-list-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 0 4px;
}
.pc-list-row select { flex: 1; min-width: 130px; font-size: 12px; }
