:root {
  --bg: #12131a;
  --panel: #1b1d27;
  --ink: #e8e9f0;
  --dim: #9ea3b8;
  --accent: #7dd3a0;
  --bad: #ff8b7a;
  --line: #2b2e3d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2.5rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

main { max-width: 42rem; margin: 0 auto; }

h1 {
  margin: 0 0 .25rem;
  font-size: 2.5rem;
  letter-spacing: -.03em;
}

h2 {
  margin: 0 0 .6rem;
  font-size: 1.05rem;
  letter-spacing: .02em;
  text-transform: lowercase;
  color: var(--accent);
}

.lede { margin: 0 0 2rem; color: var(--dim); font-size: 1.1rem; }

section {
  margin: 0 0 1.5rem;
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

ol { margin: 0 0 .75rem; padding-left: 1.25rem; }
li { margin-bottom: .4rem; }

ul.examples {
  margin: 0 0 .75rem;
  padding: 0;
  list-style: none;
}
ul.examples li { margin-bottom: .5rem; }
p { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }

code {
  padding: .1em .4em;
  background: #0d0e14;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .9em;
  word-break: break-word;
}

form { display: flex; flex-direction: column; gap: .6rem; }

label {
  font-size: .85rem;
  color: var(--dim);
  text-transform: lowercase;
}

input {
  padding: .7rem .8rem;
  background: #0d0e14;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
}

input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  padding: .7rem 1rem;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #10231a;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }

.scope { margin-top: .9rem; font-size: .85rem; color: var(--dim); }

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

.good { color: var(--accent); }
.bad { color: var(--bad); }
.back { margin-top: 1.5rem; }

/* --- the signed-in list UI --- */

/* An inline form so a button can sit in a line of prose. Forms are flex
   columns above, which would otherwise stack these onto their own row. */
form.inline { display: inline; }

/* A button that reads as a link — for actions that must be POSTs (so they
   can't be triggered by a stray GET) but shouldn't look like primary buttons. */
.linkish {
  padding: 0;
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.linkish:hover { filter: none; opacity: .8; }
.danger { color: var(--bad); }

.who { color: var(--dim); font-size: .9rem; margin-bottom: 1.5rem; }

.listlinks {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: .85rem;
}

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

ul.members li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 0;
  border-top: 1px solid var(--line);
}

ul.members img, .noavatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 999px;
  background: #0d0e14;
  border: 1px solid var(--line);
}

/* Pushes the remove button to the right edge. */
.names {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.display { font-size: .95rem; }
.names a, .did {
  color: var(--dim);
  font-size: .85rem;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.names a:hover { text-decoration: underline; }

.remove {
  padding: .35rem .7rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--dim);
  font-size: .8rem;
  font-weight: 400;
}
.remove:hover { border-color: var(--bad); color: var(--bad); filter: none; }

.empty { color: var(--dim); font-size: .9rem; }
.fine { margin-top: 2rem; color: var(--dim); font-size: .85rem; }

/* --- handle typeahead --- */

/* The anchor for the dropdown. Inside the form's flex column, so it stretches. */
.handle-field { position: relative; }
.handle-field input { width: 100%; }

.typeahead {
  position: absolute;
  z-index: 10;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 17rem;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  /* Lifts it off the panel behind, which is the same color. */
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}

.ta-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .5rem .7rem;
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}
.ta-row:hover, .ta-row.active { background: #0d0e14; filter: none; }

.ta-row img {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 999px;
  background: #0d0e14;
}

.ta-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}
.ta-display {
  font-size: .9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ta-handle {
  color: var(--dim);
  font-size: .8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* --- /lists index --- */

ul.listindex { margin: 0 0 1.5rem; padding: 0; list-style: none; }

ul.listindex li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 0;
  border-top: 1px solid var(--line);
}

/* The whole row is the link, so the tap target is the row and not just the
   words — this page is mostly read on a phone. */
.listlink {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}
.listlink:hover .listname { text-decoration: underline; }

.listname {
  color: var(--ink);
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kind {
  padding: .1em .5em;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-size: .7rem;
  white-space: nowrap;
}
.kind.mod { border-color: var(--bad); color: var(--bad); }

/* --- /lists/<rkey> --- */

.crumb { margin-bottom: 1rem; font-size: .9rem; }

.listtitle {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .4rem;
  text-transform: none;
  font-size: 1.3rem;
  color: var(--ink);
}

.more { margin-top: 1rem; }

/* Settings that belong to one list, kept below its members so the page reads
   as "here's who's on it" first. */
.settings {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  background: none;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
}
.settings .fine { margin-top: 0; margin-bottom: .5rem; }
.settings form.inline { display: block; margin-bottom: 1.25rem; }
