/* Nimbus analytics - light dashboard. No external fonts/CDNs. */
:root {
  --cream: #FFFBF4; --paper: #FFFFFF; --ink: #3A2E28; --ink-2: #6B5D54; --line: #EADFCF;
  --sage: #8FBF9A; --sage-d: #5E9A6C; --sky: #8EB8E5; --orange: #F2A65A; --red: #C8644F;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--ink); font: 14px/1.45 var(--font); }
a { color: var(--sage-d); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }

.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: #FBF3E6; border-right: 1px solid var(--line); padding: 22px 14px; position: sticky; top: 0;
        height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 0 10px 18px; }
.brand-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--sky); display: inline-flex;
             align-items: center; justify-content: center; color: #fff; font-size: 16px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; color: var(--ink);
         font-weight: 500; }
.nav a:hover { background: #F4E8D6; text-decoration: none; }
.nav a.active { background: var(--paper); box-shadow: 0 1px 2px rgba(58,46,40,.08); color: var(--sage-d); }
.nav .num-badge { margin-left: auto; font-size: 11px; color: var(--ink-2); }
.side-foot { margin-top: auto; padding: 12px 10px 0; font-size: 12.5px; color: var(--ink-2); }
.side-foot form { margin: 6px 0 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--sage-d); font: inherit; cursor: pointer; }

.main { padding: 26px 32px 48px; min-width: 0; max-width: 1280px; }
.top h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.top .sub { margin: 4px 0 16px; color: var(--ink-2); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; background: var(--paper);
           border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 18px; }
.filters label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--ink-2);
                 text-transform: uppercase; letter-spacing: .04em; }
.filters input, .filters select { font: 13.5px var(--font); color: var(--ink); background: var(--cream);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; min-width: 120px; }
.filters .quick { display: flex; gap: 6px; align-self: center; margin-left: 4px; }
.filters .quick a { font-size: 12.5px; padding: 4px 9px; border-radius: 999px; background: var(--cream);
                    border: 1px solid var(--line); color: var(--ink); }
.filters .quick a.on { background: var(--sage); border-color: var(--sage); color: #fff; }
.btn { font: 600 13.5px var(--font); background: var(--sage-d); color: #fff; border: 0; border-radius: 10px;
       padding: 8px 14px; cursor: pointer; }
.btn:hover { background: #4F8A5D; }
.btn.ghost { background: var(--cream); color: var(--ink); border: 1px solid var(--line); }
.static-note { font-size: 12.5px; color: var(--ink-2); align-self: center; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
        margin-bottom: 16px; min-width: 0; }
.grid > .card { margin-bottom: 0; }
.grid { margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card h2 { font-size: 15px; margin: 0; }
.card h3 { font-size: 13.5px; margin: 14px 0 6px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; }
.stat-label { font-size: 12px; color: var(--ink-2); }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 2px; letter-spacing: -.01em; }
.stat-sub { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; padding: 7px 9px;
     border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 9px; border-bottom: 1px solid #F3EBDD; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.empty { text-align: center; color: var(--ink-2); padding: 18px; }
.empty-note { color: var(--ink-2); margin: 6px 0; }
.muted { color: var(--ink-2); }
.up { color: var(--sage-d); font-weight: 600; }
.down { color: var(--red); font-weight: 600; }
.pill { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #F4E8D6; }
.pill.full { background: #E3F0E6; color: #3F6E4B; }
.pill.anonymous { background: #E6EFF9; color: #3E6690; }
.props { font-family: var(--mono); font-size: 12px; color: var(--ink-2); word-break: break-word; }
.bar-inline { display: inline-block; height: 8px; border-radius: 4px; background: var(--sky); vertical-align: middle;
              margin-right: 6px; }

/* heat-coloured cells: cream -> sage */
.heat-0 { background: #FBF6EE; color: var(--ink-2); }
.heat-1 { background: #EEF5EC; }
.heat-2 { background: #DCEBDD; }
.heat-3 { background: #C3DEC8; }
.heat-4 { background: #A6CEAF; }
.heat-5 { background: #8FBF9A; color: #21352A; font-weight: 600; }
td[class*="heat-"] { border-bottom: 2px solid #fff; }

/* tooltips (CSS only) */
.tip { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%;
       background: #F1E6D4; color: var(--ink-2); font-size: 10px; font-weight: 700; cursor: help; position: relative;
       vertical-align: 1px; text-transform: none; letter-spacing: 0; }
.tip:hover::after, .tip:focus::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%);
  width: max-content; max-width: 280px; white-space: normal; background: var(--ink); color: #FFFBF4; font-weight: 400;
  font-size: 12px; line-height: 1.4; padding: 7px 10px; border-radius: 9px; z-index: 20; text-align: left;
  box-shadow: 0 4px 14px rgba(58,46,40,.18); }
th .tip:hover::after, th .tip:focus::after { bottom: auto; top: calc(100% + 7px); }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart .axis { font: 11px var(--font); fill: #8B7D72; }
.chart .legend { font: 12px var(--font); fill: var(--ink); }
.chart .flabel { font: 12.5px var(--font); fill: var(--ink); }
.chart .fvalue { font: 600 12.5px var(--font); fill: var(--ink); }
.spark { vertical-align: middle; }

.answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.answers .card { margin: 0; }
.tapmap { margin-top: 4px; }
details.screen { border-top: 1px solid #F3EBDD; padding: 8px 0; }
details.screen summary { cursor: pointer; font-weight: 600; }
.live-controls { display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--ink-2); }
.timeline .session { border-left: 3px solid var(--sky); padding-left: 12px; margin: 14px 0; }
.timeline .session h3 { margin: 0 0 6px; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 30px 30px 24px;
         width: 100%; max-width: 360px; box-shadow: 0 10px 30px rgba(58,46,40,.06); }
.login h1 { font-size: 20px; margin: 10px 0 18px; }
.login label { display: block; font-size: 12.5px; color: var(--ink-2); margin: 10px 0 4px; }
.login input { width: 100%; font: 15px var(--font); padding: 9px 11px; border-radius: 11px; border: 1px solid var(--line);
               background: var(--cream); color: var(--ink); }
.login .btn { width: 100%; margin-top: 18px; padding: 10px; }
.login .err { background: #FBE7E1; color: #8A3B2A; border-radius: 10px; padding: 8px 11px; font-size: 13px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin-top: 0; }
  .main { padding: 18px; }
  .grid.two { grid-template-columns: 1fr; }
}

/* warm cells (drop-off): cream -> orange */
.warm-0 { background: #FBF6EE; color: var(--ink-2); }
.warm-1 { background: #FDF0E2; }
.warm-2 { background: #FBE2C8; }
.warm-3 { background: #F8CFA5; }
.warm-4 { background: #F5BB80; }
.warm-5 { background: #F2A65A; color: #4A2A0E; font-weight: 600; }
td[class*="warm-"] { border-bottom: 2px solid #fff; }
td.props { min-width: 240px; }
.login .brand { padding: 0; }
