/* style.css — WAKESCAN app layout (Task 3). Dense 8px grid, hairlines only. */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font-ui);
  font-size: 13px;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ---- header ---------------------------------------------------------- */
.app-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-rule { width: 1px; height: 16px; background: var(--hairline); }
.toolbar { display: flex; gap: 6px; flex: 1; justify-content: center; flex-wrap: wrap; }
.header-right { display: flex; align-items: center; gap: 10px; }

/* ---- body grid --------------------------------------------------------- */
.app-body {
  display: flex;
  height: calc(100% - 48px);
  position: relative;
}

/* left icon rail */
.rail {
  width: 48px;
  background: var(--bg-1);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
  gap: 4px;
  z-index: 30;
}
.rail button {
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 15px;
  cursor: pointer;
  transition: color var(--motion), border-color var(--motion);
}
.rail button:hover { color: var(--text-0); }
.rail button.on { color: var(--accent); border-color: var(--hairline); background: var(--bg-2); }

/* collapsible left panel */
.panel {
  position: absolute;
  left: 48px; top: 0; bottom: 0;
  width: 300px;
  background: var(--bg-1);
  border-right: 1px solid var(--hairline);
  z-index: 25;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  overflow-y: auto;
}
.panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
}
.result {
  padding: 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--motion);
}
.result:hover { border-color: var(--accent); }
.result .r-name { font-weight: 600; font-size: 13px; }
.result .r-sub { font-family: var(--font-mono); font-size: 11px; color: var(--text-1); margin-top: 2px; }

/* map fills the rest */
#map { flex: 1; background: var(--bg-0); }
#map canvas { outline: none; }
.maplibregl-ctrl-attrib {
  background: rgba(5, 7, 10, 0.7) !important;
  font-size: 10px;
}
.maplibregl-ctrl-attrib a { color: var(--text-1) !important; }

/* ---- right dossier slide-in ------------------------------------------- */
.dossier {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 340px;
  background: var(--bg-1);
  border-left: 1px solid var(--hairline);
  z-index: 25;
  overflow-y: auto;
  padding: 16px;
  transition: transform var(--motion);
}
.dossier .d-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; color: var(--text-1);
  font-size: 16px; cursor: pointer;
}
.dossier .d-close:hover { color: var(--text-0); }
.d-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 4px 0 2px;
}
.d-ids { font-family: var(--font-mono); font-size: 11px; color: var(--text-1); }
.d-chips { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.d-kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 8px; margin: 8px 0; }
.d-kv .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-1); padding-top: 2px; }
.d-kv .v { font-family: var(--font-mono); font-size: 12px; }
.d-track-controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.d-track-controls .input { width: auto; flex: 1; min-width: 120px; }

/* ---- login overlay ------------------------------------------------------ */
.login-overlay {
  position: fixed; inset: 0;
  background: var(--bg-0);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.login-card {
  width: 320px;
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card .l-title {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 15px;
}
.login-card .l-err { color: var(--alert); font-size: 12px; min-height: 15px; }
