/* cplists: the look of ICOS Curve (m9curve's styles.css), on the
   pages' own markup.  Colour is a token: the light values here, the
   dark ones under both the system setting and an explicit data-theme,
   which the switch in the header pins. */
:root {
  color-scheme: light;
  --bg: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink2: #52514e;
  --muted: #898781;
  --line: #e1e0d9;
  --line-strong: #c3c2b7;
  --accent: #00abc9;
  --accent-ink: #00566a;
  --accent-wash: rgba(0, 171, 201, 0.12);
  --mark: #e41c63;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --ink: #ffffff;
    --ink2: #c3c2b7;
    --muted: #898781;
    --line: #2c2c2a;
    --line-strong: #383835;
    --accent: #00a3c0;
    --accent-ink: #7fdcee;
    --accent-wash: rgba(0, 163, 192, 0.18);
    --mark: #f0508a;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #1a1a19;
  --ink: #ffffff;
  --ink2: #c3c2b7;
  --muted: #898781;
  --line: #2c2c2a;
  --line-strong: #383835;
  --accent: #00a3c0;
  --accent-ink: #7fdcee;
  --accent-wash: rgba(0, 163, 192, 0.18);
  --mark: #f0508a;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the header, the panel and the footer are the body's flex items: let
   them shrink below their content (a textarea's columns, a long
   address), so that a phone never scrolls sideways */
.top, main.content, footer { min-width: 0; max-width: 100%; }

/* ---- the header ---- */
.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.logo { display: block; background: #fff; border-radius: 6px; padding: 4px 8px; line-height: 0; flex: none; }
.logo img { height: 40px; width: auto; }
/* the dark theme's logo has the lettering light grey and no white
   plate; two images and CSS, not a <picture>, because the theme can
   be pinned by the switch as well as followed */
.logo .on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo { background: none; padding-left: 0; padding-right: 0; }
  :root:not([data-theme="light"]) .logo .on-light { display: none; }
  :root:not([data-theme="light"]) .logo .on-dark { display: block; }
}
:root[data-theme="dark"] .logo { background: none; padding-left: 0; padding-right: 0; }
:root[data-theme="dark"] .logo .on-light { display: none; }
:root[data-theme="dark"] .logo .on-dark { display: block; }
.heading { min-width: 0; }
.heading h1 { font-size: 20px; font-weight: 600; line-height: 1.2; margin: 0; }
.heading h1 a { color: inherit; text-decoration: none; }
.heading p { color: var(--ink2); font-size: 13px; margin: 0; }
.top nav {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink2); white-space: nowrap;
}
.theme { font-size: 13px; flex: none; }
.theme span { padding: 4px 10px; }

.segmented { display: flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.segmented label { flex: 1; text-align: center; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 6px 4px; color: var(--ink2); border-left: 1px solid var(--line-strong); }
.segmented label:first-child span { border-left: 0; }
.segmented input:checked + span { background: var(--accent-wash); color: var(--ink); font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---- the page: one panel ---- */
main.content {
  width: min(1100px, 100% - 32px);
  margin: 16px auto;
  padding: 16px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
h1 { font-size: 22px; font-weight: 600; line-height: 1.25; margin: 0 0 10px; }
h2 { font-size: 15px; font-weight: 600; margin: 22px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.nav + h2, h1 + h2 { border-top: 0; padding-top: 0; margin-top: 12px; }
/* who runs a list, on the members page */
.officer { white-space: nowrap; }
.officer small { color: var(--muted); }
p { margin: 0 0 10px; }
small { color: var(--muted); font-size: 12px; }
code { font-size: 0.92em; }
/* a list's pages, under its name */
.nav { font-size: 13px; color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--line); margin: 0 0 14px; }
.nav a { color: var(--accent-ink); text-decoration: none; font-weight: 600; }
.nav a:hover { text-decoration: underline; }

/* the lists on the home page */
ul.lists { list-style: none; margin: 0 0 12px; padding: 0; }
ul.lists li { padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.lists li a { font-weight: 600; text-decoration: none; }
ul.lists li a:hover { text-decoration: underline; }
ul.lists li small { display: block; margin-top: 2px; }

/* ---- tables ---- */
table { border-collapse: collapse; width: 100%; margin: 0 0 12px; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; font-weight: 600; color: var(--ink2); border-bottom-color: var(--line-strong); }
table.form th { width: 11em; padding-top: 10px; }
table.form td { padding-top: 6px; padding-bottom: 6px; }
td form { margin: 0; }
tr:last-child td { border-bottom: 0; }

/* ---- forms ---- */
form { margin: 0 0 12px; }
form.inline { display: inline; margin: 0; }
label { font-size: 13px; color: var(--ink2); }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  font: inherit; font-size: 13px; max-width: 100%;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 5px 6px;
}
textarea { width: 100%; min-width: 0; }
td > input:not([type="checkbox"]) { width: 100%; min-width: 6em; }
td > input[size] { width: auto; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
button {
  font: inherit; font-size: 13px; cursor: pointer;
  color: var(--ink2); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 12px;
  white-space: nowrap;
}
button:hover { background: var(--accent-wash); color: var(--ink); }
/* the one button that does the form's work: filled */
form > button, form > table + button { color: #fff; background: var(--accent-ink); border-color: var(--accent-ink); }
form > button:hover, form > table + button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
form.inline > button { color: var(--ink2); background: transparent; border-color: var(--line-strong); }
form.inline > button:hover { background: var(--accent-wash); color: var(--ink); }
.top nav form.inline > button { padding: 2px 10px; font-size: 12px; }

footer { color: var(--muted); font-size: 12px; text-align: center; padding: 8px 16px 16px; margin-top: auto; }

@media (max-width: 880px) {
  .top { gap: 10px; padding: 10px; flex-wrap: wrap; }
  .logo img { height: 32px; }
  .heading { flex: 1 1 auto; }
  .heading p { display: none; }
  .heading h1 { font-size: 18px; }
  /* the logo, the name and the switch on one line, the nav under them */
  .theme { margin-left: auto; order: 2; }
  .top nav { order: 3; flex-basis: 100%; margin-left: 0; justify-content: flex-end; white-space: normal; flex-wrap: wrap; }
  .theme span { padding: 4px 7px; }
  main.content { width: auto; margin: 10px; padding: 12px; }
}
@media (max-width: 40em) {
  th, td { display: block; width: auto; }
  tr { display: block; margin-bottom: 1em; border-bottom: 1px solid var(--line); }
  tr:first-child { display: none; }
  table.form th { width: auto; padding-bottom: 0; }
  table.form tr:first-child { display: block; }
}
