:root {
  --bg: #faf9f5; --card: #ffffff; --tint: #f1efe8;
  --border: rgba(0, 0, 0, 0.12); --border-soft: rgba(0, 0, 0, 0.07);
  --text: #1f1f1c; --text-2: #5f5e5a; --muted: #8a8984;
  --ok: #0f6e56; --ok-bg: #e1f5ee;
  --warn: #854f0b; --warn-bg: #faeeda;
  --bad: #a32d2d; --bad-bg: #fcebeb;
  --accent: #185fa5; --accent-bg: #e6f1fb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1d1b; --card: #262624; --tint: #2e2e2b;
    --border: rgba(255, 255, 255, 0.16); --border-soft: rgba(255, 255, 255, 0.09);
    --text: #f1efe8; --text-2: #b4b2a9; --muted: #888780;
    --ok: #9fe1cb; --ok-bg: #085041;
    --warn: #fac775; --warn-bg: #633806;
    --bad: #f7c1c1; --bad-bg: #791f1f;
    --accent: #b5d4f4; --accent-bg: #0c447c;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 680px; margin: 0 auto; padding: 20px 16px 48px; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; font-weight: 500; }
h1 { font-size: 17px; }
h2 { font-size: 15px; margin-bottom: 4px; }
p { font-weight: 400; }

.topnav { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-bottom: 16px; }
.topnav .spacer { flex: 1; }
.topnav a:hover { color: var(--text); }

.head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 14px;
}
.sub { font-size: 13px; color: var(--text-2); }

.pill { font-size: 12px; border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.muted { background: var(--tint); color: var(--text-2); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.metric { background: var(--tint); border-radius: 8px; padding: 14px 16px; }
.metric .label { font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.metric .value { font-size: 24px; font-weight: 500; }
.metric .note { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.metric .note.up { color: var(--ok); }
.metric.small { padding: 10px 14px; }
.metric.small .value { font-size: 18px; }
.metric.small .label { font-size: 12px; margin-bottom: 2px; }

.meter { height: 6px; background: var(--border-soft); border-radius: 3px; margin: 8px 0 4px; overflow: hidden; }
.meter > div { height: 100%; background: var(--accent); border-radius: 3px; }

.card {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 16px 20px; margin-bottom: 12px;
}
.row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-top: 0.5px solid var(--border-soft); }
.row:first-of-type { border-top: none; }
.row .grow { flex: 1; min-width: 0; }
.row .when { font-size: 12px; color: var(--muted); flex: none; }
.row .right { font-size: 13px; font-weight: 500; flex: none; }
.row p.title { font-size: 14px; font-weight: 500; }
.row p.detail { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.row p.plain { font-size: 14px; flex: 1; margin: 0; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 6px; }
.dot.ok { background: #1d9e75; }
.dot.warn { background: #ef9f27; }
.dot.bad { background: #e24b4a; }
.dot.muted { background: var(--muted); }

.notice { border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-top: 8px; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }

.preview { border-radius: 12px 12px 0 0; background: var(--accent-bg); color: var(--accent); padding: 16px 20px; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; background-size: cover; background-position: center; }
.preview .photonote { font-size: 12px; margin-bottom: auto; }
.preview .headline { font-size: 19px; font-weight: 500; margin: 20px 0 4px; }
.preview .desc { font-size: 13px; margin-bottom: 10px; }
.preview.hasimg { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55); background-color: #0c447c; }
.ctachip { font-size: 12px; background: var(--card); color: var(--text); border: 0.5px solid var(--border); border-radius: 999px; padding: 5px 12px; align-self: flex-start; text-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 20px; border-top: 0.5px solid var(--border-soft); }
.chip { font-size: 11px; color: var(--text-2); border: 0.5px solid var(--border); border-radius: 999px; padding: 3px 10px; }
.card.flush { padding: 0; overflow: hidden; }

.bars { display: flex; align-items: flex-end; gap: 14px; height: 110px; margin-top: 12px; }
.bars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.bars .col span { font-size: 12px; color: var(--text-2); }
.bars .col .bar { width: 100%; background: var(--border); border-radius: 4px 4px 0 0; }
.bars .col.hot .bar { background: var(--accent); }
.bars .col.hot span { font-weight: 500; color: var(--text); }
.barlabels { display: flex; gap: 14px; margin-top: 6px; }
.barlabels span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { border-radius: 8px; min-height: 118px; background: var(--tint); display: flex; flex-direction: column; justify-content: flex-end; padding: 10px; background-size: cover; background-position: center; }
.tile .tag { font-size: 11px; background: var(--card); border: 0.5px solid var(--border); border-radius: 999px; padding: 3px 9px; align-self: flex-start; color: var(--text-2); }
.tile.add { background: transparent; border: 1px dashed var(--border); align-items: center; justify-content: center; text-align: center; color: var(--text-2); font-size: 12px; padding: 16px; }

.login { max-width: 360px; margin: 10vh auto 0; }
input[type=text] {
  width: 100%; height: 42px; border: 0.5px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--text); font-size: 16px; padding: 0 12px; margin: 6px 0 14px;
}
input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
button {
  height: 40px; padding: 0 18px; border-radius: 8px; border: 0.5px solid var(--border);
  background: var(--card); color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer;
}
button:hover { background: var(--tint); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
label { font-size: 13px; color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 18px;
  border-radius: 8px; border: 0.5px solid var(--border); background: var(--card);
  color: var(--text); font-size: 14px; font-weight: 500;
}
.btn:hover { background: var(--tint); }
.btn.danger { color: var(--bad); }
.btn.small { height: 34px; padding: 0 14px; font-size: 13px; margin-top: 8px; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.footnote { font-size: 13px; color: var(--muted); margin-top: 16px; }
.error { background: var(--bad-bg); color: var(--bad); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
