/* Layout and components. Colors, fonts and decorations come from theme.css. */
:root {
  /* Fallbacks so the page works even with no theme loaded. */
  --bg: #f6f5f2;
  --bg-image: none;
  --surface: #ffffff;
  --surface-2: #f0eee9;
  --line: #d9d5cc;
  --text: #1f1d1a;
  --muted: #6b665d;
  --accent: #2f6f4f;
  --accent-ink: #ffffff;
  --ok: #2e7d32;
  --err: #c62828;
  --radius: 12px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-body);
  --display-size: clamp(2rem, 8vw, 3rem);
  --shadow: 0 1px 2px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-image), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.5 var(--font-body);
}
main { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; padding: 32px 16px 96px; }
.deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

h1 {
  font-family: var(--font-display);
  font-size: var(--display-size);
  line-height: 1.1;
  color: var(--accent);
  margin: 0 0 8px;
}
h2 { font-family: var(--font-display); font-size: 1.25rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
a { color: var(--accent); }

.intro { white-space: pre-line; margin: 0 0 12px; }
.facts { list-style: none; padding: 0; margin: 0 0 8px; color: var(--muted); }
.facts li { margin: 2px 0; white-space: pre-line; }
.facts strong { color: var(--text); font-weight: 600; }

.banner {
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-weight: 600;
}
.banner.live { border-color: var(--accent); }

section.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 20px;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.stack { display: grid; gap: 6px; }
label { font-size: .875rem; color: var(--muted); }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="checkbox"] { width: auto; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 1rem; }

.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
button {
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--accent);
  cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-ink); }
button.ghost { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--err); border-color: var(--err); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font-weight: 500; }
button:disabled { opacity: .5; cursor: wait; }

.status { min-height: 1.5em; margin: 10px 0 0; font-weight: 600; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

.member {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  padding: 14px;
  margin-top: 12px;
  display: grid;
  gap: 6px;
  background: var(--surface);
}
.member-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.member-head strong { font-size: .95rem; }

.match {
  border-left: 4px solid var(--accent);
  background: var(--surface-2);
  border-radius: calc(var(--radius) - 4px);
  padding: 12px 14px;
  margin-top: 12px;
}
.match .who { font-size: 1.1rem; margin: 0 0 6px; }
.match .who strong { color: var(--accent); }
.wish { white-space: pre-line; margin: 4px 0; }

table { width: 100%; border-collapse: collapse; font-size: .925rem; }
th, td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 0; }
.table-wrap { overflow-x: auto; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); }
.pill.open { color: var(--ok); border-color: var(--ok); }
.pill.drafted { color: var(--accent); border-color: var(--accent); }
.pill.published { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 > .full { grid-column: 1 / -1; }
.row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.row > button { flex: 0 0 auto; }

footer { text-align: center; margin-top: 32px; }

.proposal {
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed var(--accent);
  border-radius: calc(var(--radius) - 4px);
  background: var(--surface-2);
}
.proposal p { margin: 8px 0; }
.warn { color: var(--err); font-weight: 600; }
.warn-text { color: var(--err); }
.pool-row { margin: 8px 0; align-items: flex-start; }
.pool-row input { margin-top: 4px; }
.pool-row .pill { margin-left: 6px; }
.late-status { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; margin: 12px 0; border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); }
.splice { border-top: 1px solid var(--line); padding: 10px 0; }
.splice:first-child { border-top: 0; }
.splice.done .chain { color: var(--ok); }
.chain { font-weight: 600; }
details.sub { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
details.sub summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details.sub[open] summary { margin-bottom: 10px; }
.badge { display: inline-block; margin-left: 6px; font-size: .75rem; font-weight: 700; color: var(--accent); }

@media (max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
}
