/* Beyond Monitoring look: indigo #2C1F83, warm greys #948274 / #F2EFED / #FAF8F5 */
@font-face { font-family: 'Conamore'; src: url('../assets/Conamore-Bold.otf') format('opentype'); }
:root {
  --bm-indigo: #2C1F83;
  --bm-indigo-2: #4a3db0;
  --bm-stone: #948274;
  --bm-line: #F2EFED;
  --bm-bg: #FAF8F5;
  --bm-text: #231c4f;
  --radius: 10px;
  --shadow: 0 4px 14px rgba(35, 28, 79, .16);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; font-family: 'Segoe UI', Roboto, Arial, sans-serif; color: var(--bm-text); background: #e9e5df; }
#cesium { position: absolute; inset: 0; }
.cesium-viewer-bottom { left: auto !important; right: 8px; bottom: 30px !important; }
.cesium-widget-credits { font-size: 10px; }
.hidden { display: none !important; }

/* header */
#topbar { position: absolute; top: 12px; left: 12px; right: 12px; height: 56px; display: flex; align-items: center; gap: 14px;
  background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 14px; z-index: 5; }
.brand-logo { height: 30px; }
.titles .title { font-family: 'Conamore', 'Segoe UI', sans-serif; font-size: 18px; color: var(--bm-indigo); letter-spacing: .3px; }
.titles .subtitle { font-size: 12px; color: var(--bm-stone); }
.spacer { flex: 1; }
.view-buttons { display: flex; gap: 6px; }
.pill { border: 1px solid var(--bm-line); background: var(--bm-bg); color: var(--bm-indigo); padding: 7px 12px; border-radius: 18px;
  font-size: 13px; cursor: pointer; font-weight: 600; transition: all .15s; }
.pill:hover { border-color: var(--bm-indigo); }
.pill.accent { background: var(--bm-indigo); color: white; border-color: var(--bm-indigo); }
.pill.accent.on { background: #ff8a3d; border-color: #ff8a3d; }
.lang { border: 1px solid var(--bm-line); border-radius: 6px; padding: 5px; color: var(--bm-indigo); font-weight: 600; background: white; }

/* panel */
#panel { position: absolute; top: 80px; left: 12px; bottom: 40px; width: 300px; overflow-y: auto; background: white;
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 14px 14px; z-index: 4; }
#panel.collapsed { display: none; }
#panelToggle { position: absolute; top: 80px; left: 320px; z-index: 4; border: none; background: white; color: var(--bm-indigo);
  width: 30px; height: 30px; border-radius: 8px; box-shadow: var(--shadow); cursor: pointer; font-size: 16px; }
#panel.collapsed + #panelToggle { left: 12px; }
#panel section { border-bottom: 1px solid var(--bm-line); padding: 8px 0 10px; }
#panel h3 { margin: 6px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--bm-indigo); }
.row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; }
.row > span { flex: 1; }
.row input[type=range] { width: 100px; accent-color: var(--bm-indigo); }
.row output { width: 38px; text-align: right; font-size: 12px; color: var(--bm-stone); }
.row select { flex: 1.3; padding: 4px; border: 1px solid var(--bm-line); border-radius: 6px; background: var(--bm-bg); color: var(--bm-text); }
.row.check { cursor: pointer; }
.row.check input { accent-color: var(--bm-indigo); }
.swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.15); }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 5px 0; cursor: pointer; }
.legend-item img { width: 18px; height: 18px; }
.legend-item .count { margin-left: auto; color: var(--bm-stone); font-size: 12px; }
.legend-item.off { opacity: .4; }
#search { width: 100%; margin-top: 8px; padding: 7px 9px; border: 1px solid var(--bm-line); border-radius: 8px; background: var(--bm-bg); }
#results { list-style: none; margin: 4px 0 0; padding: 0; max-height: 180px; overflow-y: auto; }
#results li { padding: 5px 6px; font-size: 12px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; }
#results li:hover { background: var(--bm-bg); color: var(--bm-indigo); }
#results li .muted { color: var(--bm-stone); }
.panel-logo { display: block; margin: 14px auto 0; max-width: 140px; opacity: .9; }

/* info card */
#card { position: absolute; top: 80px; right: 12px; width: 330px; background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 14px; z-index: 5; color: var(--bm-indigo); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.card-title { font-family: 'Conamore', 'Segoe UI', sans-serif; font-size: 17px; }
.card-sub { font-size: 12px; color: var(--bm-stone); margin-top: 2px; }
.close { border: none; background: none; font-size: 22px; color: var(--bm-stone); cursor: pointer; line-height: 1; }
#cardTable { width: 100%; border-collapse: collapse; font-size: 12px; }
#cardTable td { border: 1px solid var(--bm-line); padding: 5px 6px; }
#cardTable td:first-child { background: var(--bm-bg); font-weight: 600; width: 45%; }
.card-note { margin-top: 8px; font-size: 11px; color: var(--bm-stone); }

/* status */
#status { position: absolute; left: 0; right: 0; bottom: 0; height: 28px; background: rgba(255,255,255,.92); display: flex;
  align-items: center; gap: 10px; padding: 0 14px; font-size: 12px; color: var(--bm-indigo); z-index: 4; font-variant-numeric: tabular-nums; }
#status .muted, .muted { color: var(--bm-stone); }
#status .sep { color: var(--bm-line); }

#loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; background: rgba(250,248,245,.85);
  z-index: 10; color: var(--bm-indigo); font-weight: 600; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--bm-line); border-top-color: var(--bm-indigo); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  #panel { width: calc(100% - 24px); bottom: 50%; }
  #panelToggle { left: auto; right: 12px; }
  .view-buttons .pill { padding: 6px 8px; font-size: 12px; }
  .titles .subtitle { display: none; }
  #card { width: calc(100% - 24px); top: auto; bottom: 36px; }
}
