/* ============================================================
   win95.css - unified chrome for the Cordero Win95 family.
   Distilled from jobs.cordero.im, rc212.com and vibeperdollar.com.
   Project-specific styling goes in a separate site.css.
   Style guide: ../STYLEGUIDE.md
   ============================================================ */

/* ---------- tokens ---------- */

:root {
  --face:       #c0c0c0;
  --highlight:  #ffffff;
  --shadow:     #808080;
  --dshadow:    #0a0a0a;
  --bevel-lite: #dfdfdf;
  --title-1:    #000080;
  --title-2:    #1084d0;
  --text:       #111111;
  --desktop-bg: #008080;
  --tooltip-bg: #ffffe1;
  --ok:         #008000;
  --warn:       #b8860b;
  --bad:        #c00000;
  --pink:       #ff69b4;   /* hot pink: location markers */
}

@font-face {
  font-family: "MS Sans Serif";
  src: url("../fonts/ms_sans_serif.woff2") format("woff2");
  font-weight: 400;
}
@font-face {
  font-family: "MS Sans Serif";
  src: url("../fonts/ms_sans_serif_bold.woff2") format("woff2");
  font-weight: 700;
}

/* ---------- base ---------- */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "MS Sans Serif", Tahoma, "Segoe UI", Verdana, sans-serif;
  font-size: 11px;
  color: var(--text);
  background-color: var(--desktop-bg);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.06), transparent 40%),
    linear-gradient(160deg, #0a7a7a 0%, #005757 100%);
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: 56px;              /* taskbar space */
}

.pixel { font-family: "Courier New", monospace; letter-spacing: 1px; }
.meta  { color: var(--shadow); font-size: 11px; }
.muted { color: var(--shadow); }

a { color: var(--title-1); }

/* ---------- desktop ---------- */

.desktop { position: relative; min-height: calc(100vh - 46px); }

.icon-col {
  position: absolute;
  top: 8px; left: 8px; bottom: 8px;
  width: 96px;
  display: flex; flex-direction: column; flex-wrap: wrap;
  gap: 14px;
  z-index: 5;
}

.dicon {
  width: 88px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 2px;
  cursor: pointer;
  user-select: none;
  text-align: center;
  border: 1px dotted transparent;
}
.dicon-img, .dicon svg { width: 32px; height: 32px; display: block; }
.dicon-lbl { line-height: 1.25; font-size: 11px; color: #fff; text-shadow: 1px 1px 0 #000; }
.dicon:hover, .dicon:focus-visible { border-color: #fff; }
.dicon:active  { background: rgba(0,0,128,.55); }
.dicon.on      { background: rgba(0,0,128,.55); }

@media (max-width: 1024px) {
  .icon-col {
    position: static; width: auto; flex-direction: row;
    flex-wrap: wrap; margin-bottom: 8px;
  }
}

/* ---------- windows ---------- */

.window {
  position: absolute;
  background: var(--face);
  border: 2px solid;
  border-color: var(--highlight) var(--dshadow) var(--dshadow) var(--highlight);
  box-shadow: inset -1px -1px 0 var(--shadow), inset 1px 1px 0 var(--highlight),
              4px 4px 0 rgba(0,0,0,.25);
  width: min(860px, calc(100vw - 150px));
  display: flex; flex-direction: column;
}

.window.minimized { display: none; }

@keyframes win-open {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
.window.opening { animation: win-open 140ms ease-out; }

.window.maximized {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 42px;
  max-width: none; width: auto; margin: 0;
  z-index: 20;
}
.window.maximized .window-body { flex: 1; min-height: 0; overflow-y: auto; }

.window-body { padding: 8px; }

/* ---------- titlebar ---------- */

.titlebar {
  height: 24px;
  background: var(--title-1);
  color: #fff;
  font-weight: bold; font-size: 12px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 3px 0 4px;
  user-select: none;
  cursor: default;
}
.titlebar-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.titlebar-controls { display: flex; gap: 2px; flex: none; margin-left: 8px; }

.tb-btn {
  width: 16px; height: 14px; flex: none; padding: 0;
  background: var(--face); color: #000;
  font: bold 9px Tahoma, "MS Sans Serif", sans-serif;
  line-height: 10px; text-align: center;
  border: 1px solid;
  border-color: var(--highlight) var(--dshadow) var(--dshadow) var(--highlight);
  box-shadow: inset 1px 1px 0 var(--bevel-lite), inset -1px -1px 0 var(--shadow);
  cursor: pointer;
}
.tb-btn:active {
  border-color: var(--dshadow) var(--highlight) var(--highlight) var(--dshadow);
  box-shadow: inset 1px 1px 0 var(--shadow);
}
.tb-btn:focus { outline: 1px dotted #fff; outline-offset: -4px; }

.window:not(.focused) .titlebar {
  background: var(--shadow);
  color: var(--bevel-lite);
}

/* ---------- menubar + dropdowns ---------- */

.menubar {
  display: flex; align-items: center; gap: 2px;
  padding: 1px 0;
  border-bottom: 1px solid var(--shadow);
  box-shadow: 0 1px 0 var(--bevel-lite);
  user-select: none;
}
.menubar a, .menu-title {
  padding: 3px 8px; cursor: pointer; color: #000; text-decoration: none;
}
.menu-title.open, .menubar a:hover { background: var(--title-1); color: #fff; }

.mdrop { position: relative; }
.mdrop-panel {
  position: absolute;
  top: calc(100% + 2px); left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--dshadow);
  padding: 2px;
  z-index: 300;
  text-align: left;
}
.mdrop-item { padding: 4px 18px 4px 16px; cursor: pointer; white-space: nowrap; color: #000; }
.mdrop-item:hover { background: var(--title-1); color: #fff; }
.mdrop-item.sel::before { content: "\2713 "; }
.mdrop-sep { height: 1px; background: var(--shadow); box-shadow: 0 1px 0 #fff; margin: 3px 2px; }

/* ---------- combo-box dropdown (hierarchical) ---------- */

.areadd { position: relative; flex: 1; min-width: 190px; }
.areadd-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%;
  background: var(--face);
  border: 2px solid;
  border-color: var(--bevel-lite) var(--shadow) var(--shadow) var(--bevel-lite);
  box-shadow: inset 1px 1px 0 var(--highlight), inset -1px -1px 0 var(--dshadow);
  padding: 3px 6px;
  font: 11px "MS Sans Serif", Tahoma, sans-serif;
  cursor: pointer;
  text-align: left;
}
.areadd-btn:focus { outline: 1px dotted #000; outline-offset: -4px; }
.areadd-arrow::after { content: "\25BE"; }
.areadd-panel {
  position: absolute;
  top: calc(100% + 2px); left: 0;
  min-width: 100%;
  max-height: min(62vh, 520px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--shadow);
  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; color: #000;
  cursor: pointer; white-space: nowrap;
}
.areadd-item:hover { background: var(--title-1); color: #fff; }
.areadd-item .box, .areadd-item .bullet {
  flex: none; width: 12px; height: 12px;
  border: 1px solid var(--shadow); 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-caret { margin-left: auto; padding-left: 10px; font-size: 11px; font-weight: normal; color: var(--title-1); }
.areadd-item:hover .areadd-caret { color: #fff; }
.areadd-sub { border-left: 1px solid var(--face); margin-left: 6px; }

/* ---------- buttons / inputs / panes ---------- */

.btn {
  display: inline-block;
  font: 11px "MS Sans Serif", Tahoma, Verdana, sans-serif;
  color: #000; text-decoration: none; text-align: center;
  background: var(--face);
  border: 2px solid;
  border-color: var(--bevel-lite) var(--dshadow) var(--dshadow) var(--bevel-lite);
  box-shadow: inset 1px 1px 0 var(--highlight), inset -1px -1px 0 var(--shadow);
  padding: 4px 12px;
  cursor: pointer; user-select: none; white-space: nowrap;
}
.btn:active:not(:disabled), .btn.pressed {
  border-color: var(--dshadow) var(--bevel-lite) var(--bevel-lite) var(--dshadow);
  box-shadow: inset 1px 1px 0 var(--shadow), inset -1px -1px 0 var(--highlight);
}
.btn:disabled { color: var(--shadow); text-shadow: 1px 1px 0 var(--highlight); }
.btn:focus { outline: 1px dotted #000; outline-offset: -5px; }

.input {
  font: 11px "MS Sans Serif", Tahoma, Verdana, sans-serif;
  color: #000; background: #fff;
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dshadow), inset -1px -1px 0 var(--bevel-lite);
  padding: 3px 4px;
}
.input:focus { outline: 1px dotted #000; outline-offset: -4px; }
textarea.input { resize: vertical; }
select.input { padding: 2px; }

.pane {
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dshadow), inset -1px -1px 0 var(--bevel-lite);
  background: #fff; padding: 8px;
}
.pane.gray { background: var(--face); }

.gb {
  border: 1px solid var(--shadow);
  box-shadow: inset 0 1px 0 var(--highlight);
  margin: 12px 0 8px; padding: 12px 10px 10px;
}
.gb legend { padding: 0 4px; background: var(--face); font-weight: bold; }
.gb.collapsed > .gb-body { display: none; }
.gb legend.collapsible { cursor: pointer; user-select: none; }

.row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.spacer, .gap { flex: 1; }

/* ---------- status bar ---------- */

.statusbar, .status-bar {
  display: flex; gap: 4px;
  padding: 4px 2px 3px;
  border-top: 1px solid var(--shadow);
  box-shadow: inset 0 1px 0 var(--bevel-lite);
}
.status-panel, .status-bar-field {
  padding: 3px 8px; white-space: nowrap; overflow: hidden;
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dshadow), inset -1px -1px 0 var(--bevel-lite);
}
.status-panel.grow, .status-bar-field.grow { flex: 1 1 auto; }

/* ---------- tiles / pipeline / chips ---------- */

.tiles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tile {
  flex: 1 1 110px; min-width: 100px; padding: 8px 6px; text-align: center;
  border: 2px solid;
  border-color: var(--bevel-lite) var(--shadow) var(--shadow) var(--bevel-lite);
  box-shadow: inset 1px 1px 0 var(--highlight), inset -1px -1px 0 var(--dshadow);
}
.tile .tile-num { font-size: 18px; font-weight: bold; }
.tile .tile-lbl  { margin-top: 2px; }
.tile.bad { background: var(--bad); color: #fff; }
.tile.bad .tile-num, .tile.bad .tile-lbl { color: #fff; }

.pipe {
  display: flex; height: 22px; background: #fff;
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dshadow), inset -1px -1px 0 var(--bevel-lite);
  margin-bottom: 4px; overflow: hidden;
}
.pipe-seg {
  height: 100%; border-right: 1px solid #fff;
  overflow: hidden; white-space: nowrap;
  color: #fff; font-size: 10px; line-height: 18px; padding-left: 4px;
}

.bar-track {
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dshadow), inset -1px -1px 0 var(--bevel-lite);
  background: #fff; height: 16px; padding: 1px;
}
.bar-fill { height: 100%; background: repeating-linear-gradient(90deg, var(--title-1) 0 8px, #fff 8px 10px); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px;
  border: 2px solid;
  border-color: var(--bevel-lite) var(--shadow) var(--shadow) var(--bevel-lite);
  box-shadow: inset 1px 1px 0 var(--highlight), inset -1px -1px 0 var(--dshadow);
  cursor: pointer; user-select: none;
}
.chip.on {
  border-color: var(--dshadow) var(--bevel-lite) var(--bevel-lite) var(--dshadow);
  box-shadow: inset 1px 1px 0 var(--shadow);
  font-weight: bold;
}
.chip-x { padding: 0 5px; font-size: 10px; line-height: 14px; cursor: pointer; }

.grade { display: inline-block; min-width: 18px; text-align: center; padding: 1px 4px;
         border: 1px solid #000; font-weight: bold; color: #fff; }
.grade-A { background: var(--ok); }
.grade-B { background: var(--warn); }
.grade-C { background: #d2691e; }
.grade-N { background: var(--shadow); }

/* ---------- tables ---------- */

.table-wrap { overflow: auto; max-height: calc(100vh - 230px); }
.grid { width: 100%; border-collapse: collapse; background: #fff; }
.grid th {
  background: var(--face); text-align: left; font-weight: bold;
  padding: 3px 6px; white-space: nowrap; cursor: pointer; user-select: none;
  border: 2px solid;
  border-color: var(--bevel-lite) var(--shadow) var(--shadow) var(--bevel-lite);
  box-shadow: inset 1px 1px 0 var(--highlight);
}
.grid th.sorted {
  border-color: var(--shadow) var(--bevel-lite) var(--bevel-lite) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--shadow);
}
.grid td {
  padding: 3px 6px;
  border-bottom: 1px solid var(--bevel-lite);
  border-right: 1px solid var(--bevel-lite);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px;
}
.grid td.num, .grid th.num { text-align: right; }
.grid tbody tr { cursor: pointer; }
.grid tr.sel td { background: var(--title-1); color: #fff; }
.grid tr.is-new td { background: var(--tooltip-bg); }
.grid tr.sel.is-new td { background: var(--title-1); color: #fff; }
.grid tr.closed td { color: var(--shadow); }
.grid tr.closed td.td-title { text-decoration: line-through; }

/* ---------- dialogs / tooltips / busy ---------- */

.overlay { position: fixed; inset: 0; background: rgba(128,128,128,.55); z-index: 400; }

.dialog {
  position: fixed; z-index: 401;
  left: 50%; top: 38%; transform: translate(-50%, -50%);
  min-width: 340px; max-width: 480px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--bevel-lite) #404040 #404040 var(--bevel-lite);
  box-shadow: inset 1px 1px 0 var(--highlight), inset -1px -1px 0 var(--dshadow);
}
.dialog .titlebar { cursor: default; }
.dialog-body { display: flex; gap: 14px; padding: 14px 14px 12px; align-items: flex-start; }
.dialog-msg { line-height: 1.5; overflow-wrap: anywhere; user-select: text; white-space: pre-line; }
.dialog-btns { display: flex; justify-content: center; gap: 8px; padding: 0 14px 14px; }
.dialog-icon {
  width: 32px; height: 32px; flex: none;
  border: 2px solid;
  border-color: var(--bevel-lite) #404040 #404040 var(--bevel-lite);
  box-shadow: inset 1px 1px 0 var(--highlight);
  background: var(--face); color: var(--title-1);
  font: bold 20px/28px Tahoma, sans-serif; text-align: center;
}

.win-tip {
  position: fixed; z-index: 600; pointer-events: none; display: none;
  background: var(--tooltip-bg); border: 1px solid #000; padding: 3px 5px;
  font: 11px "MS Sans Serif", Tahoma, Verdana, sans-serif; color: #000;
  max-width: 360px;
}
.win-tip .tip-title { font-weight: bold; margin-bottom: 2px; }
.win-tip .tip-row { white-space: nowrap; }

.busy-track {
  overflow: hidden; white-space: nowrap; background: #fff; padding: 4px;
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dshadow), inset -1px -1px 0 var(--bevel-lite);
  margin: 6px 0;
}
.busy-text { display: inline-block; animation: marq 2.5s linear infinite; }
@keyframes marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- taskbar / start menu / tray ---------- */

#taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 42px;
  display: flex; align-items: center; gap: 4px;
  background: var(--face);
  border-top: 2px solid var(--bevel-lite);
  box-shadow: 0 -2px 0 var(--shadow);
  padding: 3px 4px;
  z-index: 110;
}
#start-btn {
  font: bold 12px "MS Sans Serif", Tahoma, sans-serif;
  display: flex; align-items: center; gap: 5px;
  padding: 3px 8px;
}
#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 {
  border-color: var(--dshadow) var(--bevel-lite) var(--bevel-lite) var(--dshadow);
  box-shadow: inset 1px 1px 0 var(--shadow);
  font-weight: bold;
}
#tray { display: flex; gap: 6px; align-items: center; }
.tray-item {
  display: inline-flex; gap: 4px; align-items: center;
  padding: 3px 8px;
  border: 2px solid;
  border-color: var(--shadow) var(--highlight) var(--highlight) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dshadow), inset -1px -1px 0 var(--bevel-lite);
}

#start-menu {
  position: fixed; left: 2px; bottom: 44px;
  min-width: 200px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--bevel-lite) var(--shadow) var(--shadow) var(--bevel-lite);
  box-shadow: inset 1px 1px 0 var(--highlight), inset -1px -1px 0 var(--dshadow);
  padding: 3px;
  z-index: 120;
}
.start-menu-banner {
  background: linear-gradient(90deg, var(--title-1), var(--title-2));
  color: #fff; font-weight: bold; font-size: 15px;
  padding: 26px 8px 6px 10px; margin-bottom: 4px;
  letter-spacing: .5px;
}
.start-menu-items { display: flex; flex-direction: column; }
.start-menu-items a, .start-menu-items button {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px;
  color: #000; text-decoration: none; background: none; border: none;
  font: 11px "MS Sans Serif", Tahoma, sans-serif; text-align: left; cursor: pointer;
  width: 100%;
}
.start-menu-items a:hover, .start-menu-items button:hover { background: var(--title-1); color: #fff; }
.start-menu-items hr { border: none; border-top: 1px solid var(--shadow);
                        border-bottom: 1px solid var(--bevel-lite); margin: 3px 6px; }

/* 98.css leaks min-width 75px into every button; undo it on chrome */
#taskbar button, .areadd-btn, .mdrop-btn, .task-btn { min-width: 0; }

/* ---------- lightbox ---------- */

#lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.lb-window {
  background: var(--face);
  border: 2px solid;
  border-color: var(--bevel-lite) var(--dshadow) var(--dshadow) var(--bevel-lite);
  box-shadow: inset 1px 1px 0 var(--highlight);
  max-width: 92vw;
}
.lb-window img { display: block; max-width: 92vw; max-height: 78vh; }
.lb-caption { padding: 6px 10px; background: var(--face); }

/* ---------- content-window patterns (rc212) ---------- */

.metric-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.metric { flex: 1 1 100px; }
.metric-num { font-size: 22px; font-weight: bold; color: var(--title-1); display: block; }
.metric-label { font-size: 11px; color: #444; }

.shot-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.shot img { width: 100%; display: block; border: 1px solid var(--shadow); cursor: zoom-in; }
.shot img:active { opacity: .8; }
.shot figcaption { font-size: 11px; margin-top: 4px; }

.stack-box {
  border: 1px solid var(--shadow);
  box-shadow: inset 0 1px 0 var(--highlight);
  background: var(--bevel-lite);
  padding: 10px 12px;
  margin: 14px 0;
}
.stack-box h3 { color: var(--title-1); margin-bottom: 8px; }
.stack-box ul { margin: 0 0 0 18px; line-height: 1.5; }

/* ---------- map ---------- */

/* MapLibre GL standard: the map background is the desktop teal - it is
   the WebGL load screen, the tile placeholder and the beyond-city mask
   all at once. Location markers are hot pink (--pink). Maps ride at
   bearing 24 so Manhattan points north-south (see STYLEGUIDE.md). */
.map-view, .maplibregl-map { background: var(--desktop-bg); }

/* Keep the map in its own stacking context so nothing inside it ever
   competes with dropdowns and dialogs. CSP needs
   connect-src https://tile.openstreetmap.org and worker-src 'self' blob:. */
.map-view { position: relative; z-index: 0; }

/* ---------- responsive ---------- */

@media (max-width: 800px) {
  .two-col { flex-direction: column; }
  .grid .col-opt { display: none; }
}
