/* Light office theme: white surfaces, blue accents, slate text (never pure black). */
:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --text: #1f2a37;
  --muted: #56657a;
  --faint: #8594a8;
  --border: #dbe3ee;
  --border-strong: #9fb6d3;
  --accent: #2a78d6;
  --accent-strong: #1c5cab;
  --accent-soft: #eaf2fc;
  --up: #1d7a3e;
  --down: #b83a32;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.05rem; margin-bottom: .25rem; }

.topbar { background: var(--accent-strong); color: #fff; }
.topbar nav, main { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.topbar nav { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { font-weight: 600; font-size: 1.05rem; letter-spacing: .01em; }
.topbar form button { background: none; border: 0; color: #d6e6fa; cursor: pointer; font: inherit; font-size: .875rem; }
.topbar form button:hover { color: #fff; }
main { padding-top: 32px; padding-bottom: 48px; }

section { margin-bottom: 40px; }
.hint { color: var(--muted); font-size: .85rem; margin: 0 0 12px; }
.back { display: inline-block; margin-bottom: 8px; color: var(--accent); font-size: .875rem; }
.back:hover { color: var(--accent-strong); }
.subtle { color: var(--muted); font-size: .875rem; margin: 2px 0 24px; }
.faint { color: var(--faint); font-size: .8rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(31, 42, 55, .04);
}
.card:has(.card-link:hover) { border-color: var(--border-strong); }
/* The whole card is clickable through its title link; the star sits above it. */
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-link:hover { color: var(--accent-strong); }

.stack > * + * { margin-top: 12px; }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.title { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.name { font-weight: 500; }
.row .figure { font-size: .875rem; text-align: right; white-space: nowrap; color: var(--muted); }

.star-form { position: relative; z-index: 1; margin: 0; }
.star {
  background: none; border: 0; padding: 0 2px; cursor: pointer;
  font-size: 1.15rem; line-height: 1.2; color: var(--border-strong);
}
.star:hover { color: var(--accent); }
.star.on { color: var(--accent); }
h1 + .star-form, .title h1 { line-height: 1.2; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 32px; }
.stat .label { color: var(--muted); font-size: .8rem; }
.stat .value { font-size: 1.35rem; font-weight: 600; }

.chart { margin: 8px 0 32px; }

.list { list-style: none; margin: 8px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.list li + li { border-top: 1px solid var(--border); }
.list a { display: flex; justify-content: space-between; gap: 16px; padding: 8px 16px; font-size: .875rem; }
.list a:hover { background: var(--accent-soft); }
.list .path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .figure { flex-shrink: 0; color: var(--muted); }

.trend { font-weight: 500; }
.trend.up { color: var(--up); }
.trend.down { color: var(--down); }
.trend.flat, .trend.none { color: var(--faint); }

.sync-status { color: var(--faint); font-size: .8rem; }
.sync-status .error { color: var(--down); }

.signin {
  max-width: 360px; margin: 72px auto 0; padding: 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.signin h1 { margin-bottom: 20px; color: var(--accent-strong); }
.signin label { display: block; font-size: .875rem; color: var(--muted); margin-bottom: 4px; }
.signin input[type=email], .signin input[type=password] {
  width: 100%; padding: 8px 10px; margin-bottom: 16px; font: inherit;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 6px;
}
.signin input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.signin input[type=submit] {
  padding: 8px 18px; font: inherit; font-weight: 500; cursor: pointer;
  background: var(--accent); color: #fff; border: 0; border-radius: 6px;
}
.signin input[type=submit]:hover { background: var(--accent-strong); }
.flash { padding: 8px 12px; border-radius: 6px; margin-bottom: 16px; font-size: .875rem; background: var(--accent-soft); }
.flash.alert { background: #fbeceb; color: var(--down); }

.list.countries li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 16px; font-size: .875rem; }
