/* Layout, type and colour. Both themes use the same token names; the CSP allows no inline style anywhere. */
:root {
  --bg: #f2f5f5;
  --surface: #ffffff;
  --ink: #142529;
  --muted: #465b61;
  --line: #cfdadc;
  --field-line: #6d858b;
  --accent: #0b6460;
  --accent-ink: #ffffff;
  --accent-soft: #dcefec;
  --danger: #9b2c24;
  --warn-bg: #fff0c9;
  --warn-ink: #4f3a00;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e181b;
    --surface: #17262a;
    --ink: #e3eeee;
    --muted: #a3b7bb;
    --line: #2b4046;
    --field-line: #6f8b92;
    --accent: #66c9c0;
    --accent-ink: #062220;
    --accent-soft: #163b39;
    --danger: #ffa49a;
    --warn-bg: #3b2f0d;
    --warn-ink: #ffe29a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: anywhere;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.skip {
  position: absolute;
  left: -100rem;
}

.skip:focus {
  left: 1rem;
  top: 0.5rem;
  z-index: 1;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
}

/* The header says at a glance whether the keys are open. */
.top {
  background: var(--surface);
  border-bottom: 0.25rem solid var(--line);
}

.top.is-unlocked {
  background: var(--accent-soft);
  border-bottom-color: var(--accent);
}

.top > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 3.5rem;
}

.brand { font-weight: 700; }

.lockstate {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  font-weight: 600;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
}

nav a {
  display: inline-block;
  padding: 0.6rem 0;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 0.15rem solid transparent;
}

nav a.active {
  color: var(--ink);
  border-bottom-color: currentColor;
  font-weight: 600;
}

.banner {
  background: var(--warn-bg);
  color: var(--warn-ink);
  padding: 0.75rem 0;
}

.banner a { color: inherit; }

main { padding-bottom: 4rem; }

main:focus { outline: none; }

h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 2rem 0 1rem;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 2.25rem 0 0.5rem;
}

a { color: var(--accent); }

.meta, .hint, .empty { color: var(--muted); }

.meta, .hint { font-size: 0.9rem; }

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rows li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.rows li.unread { border-left: 0.3rem solid var(--accent); }

.rows p { margin: 0.15rem 0; }

.rows button { margin-top: 0.5rem; }
