:root {
  --ink: #112E51;
  --deep: #0A1F38;
  --brass: #B08D3E;
  --paper: #F7F3E8;
  --muted: #6E6D62;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Georgia, "Times New Roman", serif; background: var(--paper); color: #23271F; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

/* login */
body.dark { background: var(--deep); color: var(--paper); }
body.center { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 320px; text-align: center; }
.seal {
  width: 56px; height: 56px; margin: 0 auto 18px; border: 2px solid var(--brass);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--brass); font-size: 24px;
}
.login-card h1 { letter-spacing: 8px; font-weight: normal; font-size: 30px; }
.login-card .sub { color: #9AA9BD; font-size: 12px; letter-spacing: 2px; margin: 8px 0 28px; text-transform: uppercase; }
.login-card input {
  width: 100%; padding: 12px 14px; margin-bottom: 12px; font-size: 15px;
  background: transparent; border: 1px solid #B08D3E66; color: var(--paper); outline: none;
  font-family: inherit;
}
.login-card input:focus { border-color: var(--brass); }
.login-card button {
  width: 100%; padding: 12px; background: var(--brass); color: var(--deep);
  border: none; font-size: 15px; letter-spacing: 2px; cursor: pointer; font-family: inherit;
  text-transform: uppercase;
}
.login-card button:hover { background: #C9A24E; }
.error { color: #E8A09A; font-size: 13px; margin-top: 12px; min-height: 18px; }

/* viewer */
body.viewer { background: var(--deep); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; color: var(--paper);
}
.topbar.light { background: var(--paper); border-bottom: 1px solid #D8D2C0; }
.brand { letter-spacing: 5px; font-size: 15px; }
.dark-text { color: var(--ink); }
.thin { color: var(--muted); letter-spacing: 1px; }
.counter { color: #9AA9BD; font-size: 13px; letter-spacing: 2px; }
.ghost {
  background: none; border: 1px solid currentColor; color: inherit; padding: 5px 14px;
  font-size: 12px; letter-spacing: 1px; cursor: pointer; font-family: inherit; text-decoration: none;
}
.stage { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; padding: 8px 64px; }
.stage img { max-width: 100%; max-height: calc(100vh - 130px); user-select: none; box-shadow: 0 8px 40px rgba(0,0,0,.45); }
.nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #9AA9BD; font-size: 44px; cursor: pointer; padding: 10px 16px;
}
.nav:hover { color: var(--brass); }
.nav.prev { left: 8px; }
.nav.next { right: 8px; }
.dots { display: flex; gap: 8px; justify-content: center; padding: 12px 0 18px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #ffffff33; cursor: pointer; }
.dot.on { background: var(--brass); }

/* admin */
body.admin { padding-bottom: 60px; }
.cards { display: flex; gap: 16px; padding: 24px 32px 0; flex-wrap: wrap; }
.card { border-top: 3px solid var(--brass); padding: 14px 24px 12px; background: #fff; min-width: 150px; }
.card .num { font-size: 30px; color: var(--ink); }
.card .lbl { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.panel { margin: 28px 32px 0; }
.panel h2 { font-weight: normal; color: var(--ink); font-size: 20px; margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
th {
  text-align: left; font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--ink);
}
td { padding: 8px 10px; border-bottom: 1px solid #E8E2CF; vertical-align: top; }
.bars { background: #fff; padding: 16px 20px; }
.bar-row { display: flex; align-items: center; gap: 12px; padding: 4px 0; font-size: 12px; }
.bar-label { width: 60px; color: var(--muted); }
.bar-track { flex: 1; height: 10px; background: #EFEAD9; }
.bar-fill { height: 100%; background: var(--ink); }
.bar-val { width: 120px; color: var(--muted); }
.heatmap-controls { display: flex; gap: 24px; margin-bottom: 12px; font-size: 13px; }
.heatmap-controls select { font-family: inherit; font-size: 13px; padding: 4px 8px; }
.heatmap-wrap { position: relative; display: inline-block; }
.heatmap-wrap img { display: block; max-width: 100%; }
.heatmap-wrap canvas { position: absolute; inset: 0; pointer-events: none; }
.hint { font-size: 12px; color: var(--muted); font-weight: normal; letter-spacing: 0; text-transform: none; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2E9E5B; margin-right: 6px; }
.timeline { background: #fff; padding: 16px 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { background: #EFEAD9; border-left: 3px solid var(--ink); padding: 5px 10px; font-size: 12px; }
.chip em { color: var(--muted); font-style: normal; margin-left: 6px; }
.arrow { color: var(--brass); font-size: 12px; }

/* geo permission modal (viewer) */
.geo-modal[hidden] { display: none !important; }
.geo-modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 20, 35, .45);
  display: flex; align-items: center; justify-content: center;
}
.geo-card {
  width: min(380px, 90vw);
  background: rgba(255,255,255,.96);
  border-radius: 14px; padding: 22px 24px 18px;
  box-shadow: 0 16px 50px rgba(0,0,0,.3);
  text-align: center;
}
.geo-title { font-size: 16px; font-weight: 600; color: #12324e; margin-bottom: 8px; }
.geo-text { font-size: 13px; color: #4a5f73; line-height: 1.5; margin-bottom: 16px; }
.geo-actions { display: flex; gap: 10px; justify-content: center; }
.geo-allow {
  padding: 10px 22px; font-size: 14px; font-weight: 600; color: #fff;
  background: #1f5c8a; border: none; border-radius: 8px; cursor: pointer;
}
.geo-allow:hover { background: #236496; }
.geo-skip {
  padding: 10px 18px; font-size: 14px; color: #4a5f73;
  background: none; border: 1px solid #c4d2de; border-radius: 8px; cursor: pointer;
}
