/* web/styles.css
   Deliberately plain and dependency-free. This page is read once, in a
   moment that is usually not a happy one, and it has to be legible on a
   phone browser as readily as on a desktop. */

:root {
  color-scheme: light dark;
  --bg: #fdfcfa;
  --fg: #1d1b18;
  --muted: #6b665e;
  --line: #e2ded6;
  --accent: #2f6f4f;
  --danger: #a1281f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614;
    --fg: #eeebe5;
    --muted: #9d978c;
    --line: #33302b;
    --accent: #7fc0a0;
    --danger: #e8877c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

h1 {
  font-size: 1.45rem;
  line-height: 1.25;
  margin: 0 0 1.5rem;
}

p { margin: 0 0 1rem; }
.lede { font-size: 1.08rem; }
.muted { color: var(--muted); font-size: 0.92rem; }

ul { margin: 0 0 1.25rem; padding-left: 1.2rem; }
li { margin-bottom: 0.35rem; }

.who { font-weight: 600; overflow-wrap: anywhere; }

button {
  display: block;
  width: 100%;
  padding: 0.8rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:disabled { opacity: 0.55; cursor: default; }

.primary { background: var(--accent); color: var(--bg); }
.secondary { background: transparent; color: var(--muted); border-color: var(--line); font-weight: 500; }
.danger { background: var(--danger); color: #fff; }

/* Destructive actions go last and separated — the rule CLAUDE.md states
   for Settings, applied to the one screen where it matters most. */
.danger-zone {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

section[hidden] { display: none; }

/* ---------------------------------------------------------------------
   The accounts page — TODO.md item 31
   ------------------------------------------------------------------ */

/* A button that reads as a link. Used for "← Accounts", "Sign out" and
   "Clear", none of which is the primary action of the screen it is on —
   CLAUDE.md's rule that controls which are not peers must not be laid
   out as peers, applied here rather than restated. */
.link {
  background: transparent;
  color: var(--accent);
  border-color: transparent;
  padding: 0.4rem 0;
  font-weight: 600;
}

/* One account. A button rather than a div with a click handler, so it is
   reachable by keyboard and announced as an action without any ARIA. */
.card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.75rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border-color: var(--line);
  font-weight: 400;
}

.card-title {
  font-weight: 600;
  /* An id is long and has no spaces, so it would otherwise push the
     chip off the end of the row. */
  overflow-wrap: anywhere;
}

.card-meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.85rem;
}

/* The tier, and whether it currently grants anything. Two states rather
   than a colour per tier: what matters at a glance is "can this person
   extract", which the server answers. */
.chip {
  justify-self: end;
  align-self: start;
  padding: 0.15rem 0.55rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.chip-on {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
}

legend { color: var(--muted); font-size: 0.85rem; padding: 0 0.35rem; }

.radio { display: block; padding: 0.35rem 0; }

input[type="date"] {
  font: inherit;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: inherit;
}
