/* Flokk — the np.lol design system on the web.
 *
 * The same language as the iOS client: warm paper, near-black ink, tomato
 * and acid accents, 1.5px full-strength borders and hard offset shadows with
 * no blur. Deliberately one palette — there is no dark mode, because
 * inverting this would be a different product.
 *
 * One stylesheet, no build step, CSS nesting.
 */

/* --- Type ---------------------------------------------------------------
   Self-hosted rather than linked from Google, so a page load does not
   depend on a third party and the text does not reflow when it is slow. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/bricolage-400-430c6fe6.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/bricolage-600-8667545d.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/bricolage-700-c0f84d57.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: "Boldonse";
  src: url("/assets/boldonse-400-0fadbb1f.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/jetbrains-400-ffbad94a.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/jetbrains-700-18a134a1.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}

:root {
  --paper:   #F6F1E7;
  --paper-2: #EDE7D8;
  --paper-3: #DCD3BD;

  --ink:   #14110D;
  --ink-2: #3A352D;
  --ink-3: #776E5E;
  --ink-4: #A99F8B;

  --tomato: #FF4E2E;
  --acid:   #DCFF3F;
  --sky:    #4A8FFF;
  --bubble: #FF8FA8;
  --leaf:   #2F8F5C;
  --amber:  #E6A300;
  --berry:  #B5274D;

  --radius:    14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --border:    1.5px;

  --font:    "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --display: "Boldonse", "Bricolage Grotesque", serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.2, 0.9, 0.3, 1);
  --sidebar: 232px;
  --top-bar: 58px;
}

* { box-sizing: border-box; }

/* One focus ring everywhere, in the palette. The browser's default blue is
   the only thing on the page that is not part of the design. */
:focus-visible {
  outline: 2px solid var(--tomato);
  outline-offset: 2px;
  border-radius: 4px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--berry); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0 0 0.7em; }
p:last-child { margin-bottom: 0; }

::selection { background: var(--acid); color: var(--ink); }

.mono { font-family: var(--mono); }
.micro {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: 13px; }

/* --- Shell --------------------------------------------------------------- */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: var(--paper);
  border-bottom: var(--border) solid var(--ink);
}

.top-bar__brand {
  font-family: var(--display);
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.top-bar__brand:hover { text-decoration: none; }
.top-bar__left { display: flex; align-items: center; gap: 14px; }
.top-bar__right { display: flex; align-items: center; gap: 12px; }

.back-arrow {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: var(--border) solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.back-arrow:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

/* The shell imposes nothing: a circle's sidebar has to reach the left edge
   of the window, so the width is decided per page by `.page` instead. */
.main { min-height: calc(100vh - var(--top-bar)); }

.page { max-width: 760px; margin: 0 auto; padding: 22px 20px 56px; }

/* --- The three-pane shell ------------------------------------------------
   rail (84) · context (324) · pane. The left two are the frame and never
   move as you work; only the pane changes. Fixed height with each column
   scrolling its own contents, so the composer and the nav stay put. */

.shell {
  display: grid;
  grid-template-columns: 84px 324px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}
/* The events index has nothing to put in the context column, so it takes
   the width rather than sitting beside an empty rail. */
.shell--wide { grid-template-columns: 84px minmax(0, 1fr); }

.fk-scroll { scrollbar-width: none; }
.fk-scroll::-webkit-scrollbar { width: 0; height: 0; }

/* Rail ------------------------------------------------------------------- */

.rail {
  border-right: var(--border) solid var(--ink);
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 0 14px;
  min-height: 0;
}

.rail__brand {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.rail__brand:hover { text-decoration: none; }

.rail__stack {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  min-height: 0;
}

/* The circle you are in. Doubles as the switcher's handle, which is what
   the chevron is telling you. */
.rail__current {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: none;
  border: var(--border) solid var(--ink);
  border-radius: 15px;
  cursor: pointer;
  padding: 0;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.rail__current:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.rail__emoji { font-size: 26px; line-height: 1; }

.rail__chevron {
  position: absolute;
  right: -6px;
  bottom: -6px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: var(--border) solid var(--ink);
  background: var(--paper);
  font-size: 9px;
  line-height: 1;
}

.rail__dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--berry);
  border: var(--border) solid var(--paper-2);
}

.rail__rule { width: 44px; height: 1px; background: var(--paper-3); margin: 10px 0 4px; }

.rail__nav {
  width: 64px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border: var(--border) solid transparent;
  border-radius: 12px;
  padding: 9px 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  transition: all 0.12s var(--ease);
}
.rail__nav:hover { text-decoration: none; border-color: var(--ink); }
.rail__nav[aria-current="page"] {
  border-color: var(--ink);
  background: var(--acid);
  box-shadow: 2px 2px 0 var(--ink);
}
.rail__glyph { font-size: 15px; line-height: 1; }

.rail__me {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border: var(--border) solid var(--ink);
  border-radius: 999px;
  background: var(--acid);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--ink);
  transition: box-shadow 0.12s var(--ease), transform 0.12s var(--ease);
}
.rail__me:hover { text-decoration: none; box-shadow: 0 0 0 var(--ink); transform: translate(2px, 2px); }

/* Switcher ---------------------------------------------------------------
   A native popover: light-dismiss and escape come free, and it renders in
   the top layer so nothing in the rail can clip it. */

.switcher {
  position: fixed;
  left: 94px;
  top: 14px;
  margin: 0;
  width: 320px;
  padding: 0;
  border: var(--border) solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
}
.switcher::backdrop { background: rgb(20 17 13 / 18%); }

.switcher__head {
  padding: 12px 14px;
  margin: 0;
  border-bottom: var(--border) solid var(--ink);
}

.switcher__list {
  max-height: 480px;
  overflow: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 11px;
  border: var(--border) solid transparent;
  border-radius: 10px;
  padding: 8px;
  color: var(--ink);
  transition: all 0.12s var(--ease);
}
.switch:hover { text-decoration: none; border-color: var(--ink); }
.switch--current { border-color: var(--ink); background: var(--acid); }

.switch__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: var(--border) solid var(--ink);
  border-radius: 10px;
  font-size: 18px;
}
.switch__body { min-width: 0; flex: 1; }
.switch__top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.switch__name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.switch__unread { width: 7px; height: 7px; border-radius: 999px; background: var(--berry); flex: none; }
.switch__sub { display: block; font-size: 10px; color: var(--ink-3); }
.switch__tick { font-size: 13px; font-weight: 700; flex: none; }

.switcher__foot { border-top: var(--border) solid var(--ink); background: var(--paper-2); padding: 10px; }
.switcher__new {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: var(--border) dashed var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.switcher__new:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

/* Context column --------------------------------------------------------- */

.context {
  border-right: var(--border) solid var(--ink);
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.context__head { padding: 18px 18px 14px; border-bottom: var(--border) solid var(--ink); }
.context__title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 3px; }
.context__name { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.context__meta { font-size: 11px; color: var(--ink-3); margin: 0; }

.context__body {
  flex: 1;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.context__heading { padding: 10px 2px 0; margin: 0; }
.context__rule { height: 1px; background: var(--paper-3); margin: 4px 0; }

/* A row in the context column: a thread, an event, or an action. */
.thread, .erow, .rowbtn {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: var(--border) solid var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--paper);
  color: var(--ink);
  transition: all 0.12s var(--ease);
}
.thread:hover, .erow:hover { text-decoration: none; box-shadow: 2px 2px 0 var(--ink); }
.thread--current, .erow--current { background: var(--acid); box-shadow: 3px 3px 0 var(--ink); }

.thread--everyone { background: var(--berry); color: var(--paper); }
.thread--everyone.thread--current { box-shadow: 3px 3px 0 var(--ink); }
.thread--everyone .thread__last { color: var(--paper); }
.thread__tag { border-color: var(--paper); background: transparent; color: var(--paper); }

.thread__mark, .thread__badge {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: var(--border) solid var(--ink);
  border-radius: 11px;
  background: var(--paper-2);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}
.thread__badge { width: 36px; height: 36px; font-family: var(--mono); font-size: 12px; }
.thread__badge--round { border-radius: 999px; }

.thread__body { min-width: 0; flex: 1; text-align: left; }
.thread__top { display: flex; align-items: center; gap: 7px; min-width: 0; }
/* A long circle name has to ellipsis rather than wrap: two lines pushes the
   row taller than every other row beside it. */
.thread__name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.thread__tag { flex: none; }
.thread__last {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.thread__unread { width: 7px; height: 7px; border-radius: 999px; background: var(--berry); flex: none; }
.thread__time { font-size: 10px; flex: none; align-self: flex-start; }

.erow__body { min-width: 0; flex: 1; text-align: left; }
.erow__title { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erow__meta { display: block; font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erow__going { display: block; font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.erow--past { background: var(--paper); border-color: var(--paper-3); }

.rowbtn { justify-content: space-between; font-size: 14px; font-weight: 600; cursor: pointer; }
.rowbtn:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.rowbtn--form { border-radius: 12px; box-shadow: none; }
.rowbtn--action { list-style: none; }
.rowbtn--action::-webkit-details-marker { display: none; }

/* --- Modals -------------------------------------------------------------
   A native <dialog>: escape closes it, focus is trapped, and the backdrop
   is the browser's rather than a div we have to keep in front of things. */

.modal {
  width: min(560px, calc(100vw - 48px));
  max-height: 76vh;
  padding: 0;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
}
.modal::backdrop { background: rgb(20 17 13 / 36%); }

.modal__form { display: flex; flex-direction: column; max-height: 76vh; min-height: 0; }

.modal__head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: var(--border) solid var(--ink);
}
.modal__title { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }

.modal__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: var(--border) solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.modal__close:hover { background: var(--ink); color: var(--paper); }

.modal__body { flex: 1; min-height: 0; overflow: auto; padding: 16px 22px; }

.modal__foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px 18px;
  border-top: var(--border) solid var(--ink);
  background: var(--paper-2);
}
.modal__hint { font-size: 13px; color: var(--ink-3); margin: 0; max-width: 34ch; }
.modal__foot .btn { flex: none; }

/* Pick list -------------------------------------------------------------- */

.picks { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }

.pick {
  display: flex;
  align-items: center;
  gap: 12px;
  border: var(--border) solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  padding: 10px 13px;
  cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
/* The checkbox is the state, not the control — the whole row is the target. */
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick:hover { box-shadow: 2px 2px 0 var(--ink); }
.pick:focus-within { outline: 2px solid var(--tomato); outline-offset: 2px; }
.pick:has(input:checked) { background: var(--ink); color: var(--paper); }

.pick__name { font-size: 16px; font-weight: 600; }

/* Main pane -------------------------------------------------------------- */

.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper); }
.pane__scroll { flex: 1; overflow: auto; padding: 32px 40px 40px; }
.pane__column { max-width: 720px; display: flex; flex-direction: column; gap: 26px; }
.pane__empty { flex: 1; display: grid; place-items: center; padding: 40px; }
.pane__hint { max-width: 420px; border-radius: var(--radius-lg); padding: 28px; }

.hero { display: flex; align-items: center; gap: 14px; }
.hero__name { font-size: 44px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.hero__meta { font-size: 12px; color: var(--ink-3); margin: 4px 0 0; }
.hero__dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ink-4);
  margin-right: 3px;
  vertical-align: 1px;
}
.hero__dot--live { background: var(--leaf); }
.mark--hero { width: 56px; height: 56px; border-radius: 16px; font-size: 28px; }

/* Around now — who in this circle could do something about now. Chips rather
   than a list: it is a glance, not a roster, and it wraps at any width. */
.around { display: flex; flex-wrap: wrap; gap: 10px; }
.around__chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: var(--border) solid var(--paper-3);
  border-radius: 999px;
  background: var(--paper-2);
  padding: 4px 14px 4px 4px;
}
.around__who { position: relative; flex: none; display: flex; }
.around__live {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: var(--border) solid var(--paper-2);
  background: var(--leaf);
}
.around__name { font-size: 14px; font-weight: 600; }
.around__status { font-size: 11px; color: var(--ink-3); }

.nextup {
  display: flex;
  gap: 18px;
  align-items: center;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--acid);
  padding: 20px;
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.nextup:hover { text-decoration: none; transform: translate(-2px, -2px); box-shadow: 10px 10px 0 var(--ink); }
.nextup__body { min-width: 0; flex: 1; }
.nextup__title { display: block; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 4px; }
.nextup__where { display: block; font-size: 12px; color: var(--ink-2); }
.nextup__tally { display: block; font-size: 13px; font-weight: 600; margin-top: 8px; }

.datechip--hero { width: 76px; border-radius: 12px; padding: 10px 0; }
.datechip--hero .datechip__month { font-size: 11px; }
.datechip--hero .datechip__day { font-size: 32px; }
.datechip--sm { width: 46px; border-radius: 9px; padding: 5px 0; }
.datechip--sm .datechip__month { font-size: 9px; }
.datechip--sm .datechip__day { font-size: 18px; }
.datechip--quiet { border-color: var(--paper-3); }
.datechip--quiet .datechip__day { color: var(--ink-3); }

.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.duo__card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 18px;
  color: var(--ink);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.duo__card:hover { text-decoration: none; transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.duo__line { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.duo__big { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.duo__note { font-size: 13px; color: var(--ink-2); }
.duo__go { font-size: 12px; font-weight: 600; color: var(--berry); }

/* Events index ------------------------------------------------------------ */

.events { max-width: 880px; display: flex; flex-direction: column; gap: 22px; }

.events__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.events__title { font-size: 44px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.events__past { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

.ecards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.ecards--past { gap: 10px; }

.ecard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: var(--border) solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  padding: 16px;
  color: var(--ink);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.ecard:hover { text-decoration: none; transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.ecard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ecard__title {
  display: block;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.ecard__where { display: block; font-size: 11px; color: var(--ink-3); }
.ecard__tally { font-size: 12px; color: var(--ink-2); }

.datechip--card { width: 56px; border-radius: 10px; padding: 7px 0; }
.datechip--card .datechip__month { font-size: 10px; }
.datechip--card .datechip__day { font-size: 24px; }

.pastcard {
  display: flex;
  gap: 11px;
  align-items: center;
  border: var(--border) solid var(--paper-3);
  border-radius: 12px;
  background: var(--paper-2);
  padding: 10px 12px;
}
.pastcard__body { min-width: 0; flex: 1; }
.pastcard__title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pastcard__went { display: block; font-size: 10px; color: var(--ink-3); }

.emptybox {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-width: 560px;
  border: var(--border) dashed var(--ink);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
}
.emptybox__title { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.emptybox__body { font-size: 15px; color: var(--ink-2); line-height: 1.6; margin: 0; }

.backpill {
  align-self: flex-start;
  border: var(--border) solid var(--ink);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.backpill:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

/* Thread pane ------------------------------------------------------------ */

.thread-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.thread-pane__head {
  flex: none;
  border-bottom: var(--border) solid var(--ink);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.thread-pane__name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.thread-pane__sub { font-size: 11px; color: var(--ink-3); margin: 0; }
.chat__empty { text-align: center; padding: 40px 0; }

/* --- Flashes ------------------------------------------------------------- */

.flashes:empty { display: none; }
.flash {
  padding: 11px 14px;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper);
  margin-bottom: 16px;
  font-size: 14px;
}
.flash--alert { border-color: var(--berry); color: var(--berry); }

/* --- Buttons ------------------------------------------------------------- */

.btn, button, input[type="submit"], input, textarea, select { font-family: inherit; }

/* The signature press: a hard shadow that collapses under the button, so it
   physically depresses rather than merely changing colour. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 18px;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--berry);
  color: var(--paper);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: box-shadow 0.12s var(--ease), transform 0.12s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { box-shadow: 2px 2px 0 var(--ink); transform: translate(2px, 2px); }
/* A washed-out berry still reads as "press me". A disabled button should
   look like a different thing, not a faded version of the same one. */
.btn:disabled {
  background: var(--paper-3);
  color: var(--ink-3);
  border-color: var(--ink-4);
  cursor: default;
  box-shadow: none;
  transform: none;
}

.btn--secondary { background: var(--paper); color: var(--ink); }
.btn--acid { background: var(--acid); color: var(--ink); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
  box-shadow: none;
}
.btn--ghost:hover { background: var(--paper-2); }
.btn--ghost:active { transform: none; box-shadow: none; }
.btn--danger { background: transparent; color: var(--berry); border-color: var(--berry); box-shadow: none; }
.btn--quiet { background: var(--paper-2); color: var(--ink); }
.btn--quiet:hover { background: var(--ink); color: var(--paper); }
.btn--danger:hover { background: var(--berry); color: var(--paper); }
.btn--sm { padding: 6px 12px; font-size: 13px; box-shadow: 2px 2px 0 var(--ink); }
.btn--sm:active { box-shadow: 0 0 0 var(--ink); }

/* Declared after the size modifiers on purpose: a ghost button is flat at
   every size, and `.btn--sm` would otherwise put the shadow back. */
.btn--ghost, .btn--ghost:active, .btn--ghost.btn--sm,
.btn--danger, .btn--danger:active, .btn--danger.btn--sm,
.btn--quiet, .btn--quiet:active, .btn--quiet.btn--sm {
  box-shadow: none;
  transform: none;
}
.btn--block { width: 100%; }

form.button_to { display: inline; }

/* --- Forms --------------------------------------------------------------- */

.field { margin-bottom: 16px; }
.field__label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.field__hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

input[type="text"], input[type="email"], input[type="datetime-local"],
input[type="number"], input[type="search"], textarea, select {
  width: 100%;
  padding: 11px 13px;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius-sm);
  outline: none;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tomato) 28%, transparent); }
textarea { resize: vertical; min-height: 80px; line-height: 1.45; }
input[type="file"] { font-size: 13px; color: var(--ink-3); border: none; padding: 0; }

.errors {
  border: var(--border) solid var(--berry);
  border-radius: var(--radius-sm);
  color: var(--berry);
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}
.errors ul { margin: 0; padding-left: 18px; }

/* --- Cards --------------------------------------------------------------- */

.card {
  background: var(--paper);
  color: var(--ink);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  padding: 16px;
}
.card--raised { box-shadow: 4px 4px 0 var(--ink); }
.card--acid { background: var(--acid); box-shadow: 4px 4px 0 var(--ink); }
/* These are often wrapped in an <a>; without this the heading and the tally
   inherit the link colour and the card reads as a wall of red. */
a.card, a.card * { color: var(--ink); }
a.card:hover { text-decoration: none; }
.card--sunk { background: var(--paper-2); }
.card--danger { border-color: var(--berry); }
.card--danger h2 { color: var(--berry); }
.card--dashed { border-style: dashed; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; min-width: 0; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.empty { text-align: center; padding: 44px 20px; color: var(--ink-3); }
.empty__title { font-weight: 600; color: var(--ink); margin-bottom: 4px; font-size: 17px; }
.empty__body { font-size: 14px; }
.empty__action { margin-top: 18px; }

/* --- Avatars and marks ---------------------------------------------------- */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: var(--border) solid var(--ink);
  object-fit: cover;
  flex: none;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}
.avatar--sm { width: 30px; height: 30px; font-size: 11px; }
.avatar--md { width: 40px; height: 40px; font-size: 14px; }
.avatar--lg { width: 60px; height: 60px; font-size: 21px; }

.avatar--initials[data-hue="0"]  { background: #C4562F; }
.avatar--initials[data-hue="1"]  { background: #2F8F5C; }
.avatar--initials[data-hue="2"]  { background: #3A6EA5; }
.avatar--initials[data-hue="3"]  { background: #8A4F9E; }
.avatar--initials[data-hue="4"]  { background: #B07D16; }
.avatar--initials[data-hue="5"]  { background: #2F8F7D; }
.avatar--initials[data-hue="6"]  { background: #A34464; }
.avatar--initials[data-hue="7"]  { background: #57692F; }
.avatar--initials[data-hue="8"]  { background: #6A5ACD; }
.avatar--initials[data-hue="9"]  { background: #B3602A; }
.avatar--initials[data-hue="10"] { background: #38796B; }
.avatar--initials[data-hue="11"] { background: #8C5A3C; }

/* The emoji tile that stands for a circle. */
.mark {
  display: inline-grid;
  place-items: center;
  border: var(--border) solid var(--ink);
  border-radius: 12px;
  flex: none;
  line-height: 1;
}
.mark--sm { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; }
.mark--md { width: 40px; height: 40px; font-size: 20px; }
.mark--lg { width: 50px; height: 50px; font-size: 25px; }

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  border: var(--border) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}
.pill--mono {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill--occasion { background: var(--paper); color: var(--tomato); border-color: var(--tomato); }
.pill--closed { background: var(--paper-2); color: var(--ink-3); border-color: var(--ink-4); }
.pill--admin { background: var(--acid); }
.pill--going { background: var(--leaf); color: var(--paper); }
.pill--maybe { background: var(--amber); }
.pill--out { background: var(--paper-2); color: var(--ink-3); border-color: var(--ink-4); }
.pill--rsvp { border-style: dashed; }

/* --- Circle list ---------------------------------------------------------- */

/* minmax(0, 1fr), not 1fr: a bare `1fr` floors the track at the item's
   min-content width, so the nowrap meta line inside a card widened the whole
   list past the edge of a phone instead of ellipsing. Same everywhere below. */
.group-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }

.group-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 13px;
  background: var(--paper);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.group-card:hover {
  text-decoration: none;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.group-card__body { display: block; min-width: 0; flex: 1; }
.group-card__name { display: block; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.group-card__meta {
  display: block;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-card__count { font-family: var(--mono); font-size: 12px; color: var(--ink-3); flex: none; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  border: var(--border) solid var(--ink);
  background: var(--berry);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
}

/* --- Dashboard ------------------------------------------------------------ */

.tiles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 520px) { .tiles { grid-template-columns: minmax(0, 1fr); } }

.tile {
  display: block;
  padding: 15px;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.tile:hover { text-decoration: none; transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.tile__name { display: block; font-size: 17px; font-weight: 600; }
.tile__detail { display: block; font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-top: 4px; }

.datechip {
  flex: none;
  width: 56px;
  text-align: center;
  padding: 8px 0;
  border: var(--border) solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  font-family: var(--mono);
}
.datechip__month { display: block; font-size: 10px; letter-spacing: 0.06em; color: var(--ink-3); text-transform: uppercase; }
.datechip__day { display: block; font-size: 22px; font-weight: 700; line-height: 1.05; }

/* --- Chat ----------------------------------------------------------------- */

.chat__scroll {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 24px;
}

.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 70%; }
/* A poll is a card, not a remark — it needs the room to show its answers. */
.msg:has(.poll) { max-width: min(420px, 88%); }
.msg__avatar { flex: none; }
.msg__body { min-width: 0; }
.msg__head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 3px; padding-left: 2px; }
.msg__author { font-size: 12px; font-weight: 600; color: var(--ink-2); }

/* Your own messages say "You" rather than your own name, which you already
   know. Decided here rather than on the server because the same HTML is
   broadcast to everybody — see the comment in the partial. */
.msg__author--you { display: none; }
.msg--mine .msg__author--them { display: none; }
.msg--mine .msg__author--you { display: inline; }
.msg__time { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }

.msg__bubble {
  border: var(--border) solid var(--ink);
  background: var(--paper);
  border-radius: 14px 14px 14px 4px;
  padding: 9px 13px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Your own messages sit on the right in berry, everyone else's on the left
   on paper — decided in the browser, because a message is rendered once and
   broadcast to the whole conversation. */
.msg--mine { flex-direction: row-reverse; margin-left: auto; }
.msg--mine .msg__avatar { display: none; }
.msg--mine .msg__head { flex-direction: row-reverse; padding: 0 2px 0 0; }
.msg--mine .msg__bubble {
  background: var(--berry);
  color: var(--paper);
  border-radius: 14px 14px 4px 14px;
}
.msg--mine .reactions { justify-content: flex-end; }

.msg__images { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg__images img { border: var(--border) solid var(--ink); border-radius: 10px; max-height: 220px; width: auto; }
.msg__file {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  padding: 7px 11px;
  border: var(--border) solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}

.msg__tools { display: flex; align-items: flex-start; gap: 2px; opacity: 0; transition: opacity 0.12s var(--ease); }
.msg:hover .msg__tools, .msg:focus-within .msg__tools { opacity: 1; }

/* Revealing on hover is no reveal at all on a touch screen: the tools still
   take the tap, so the target is there but invisible. Query the input, not
   the width — a narrow window on a laptop still has a pointer. */
@media (hover: none) { .msg__tools { opacity: 1; } }
/* Revealed by message_controller.js for the author only. */
.msg__own-only { display: none; }
.msg--mine .msg__own-only { display: inline; }

.composer {
  flex: none;
  background: var(--paper-2);
  border-top: var(--border) solid var(--ink);
  padding: 14px 24px;
}
.composer__wrap { position: relative; }

/* `.composer__form`, not `.composer form`: every module's dialog now lives
   inside the composer too, and each of those is a form of its own. A
   descendant selector here laid the poll dialog out as a chat box —
   `align-items: flex-end` pushed its fields into the right-hand half. */
.composer__form { display: flex; gap: 9px; align-items: flex-end; }

/* The textarea and the layer that paints `@everyone` behind it share one
   grid cell, so they are the same box by construction rather than by two
   sets of offsets kept in agreement by hand. Everything that decides where a
   glyph lands is declared once, for both. */
.composer__field { position: relative; display: grid; flex: 1; min-width: 0; }
.composer__field > * { grid-area: 1 / 1; }

.composer textarea, .composer__backdrop {
  min-height: 44px;
  max-height: 160px;
  min-width: 0;
  width: 100%;
  margin: 0;
  border: var(--border) solid var(--ink);
  border-radius: 20px;
  padding: 11px 16px;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: inherit;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.composer textarea {
  /* The box grows to fit what you type (composer_controller.js), so it
     never needs to scroll — and a drag handle on a chat box is nobody's
     idea of a feature. */
  resize: none;
  overflow-y: hidden;
  background: transparent;   /* the paint shows through from behind */
  position: relative;
  z-index: 1;
}

/* Text here is invisible: it exists only to put the <mark> in the same place
   the real glyphs land. The textarea keeps the caret, the selection and the
   IME, which is the whole reason for doing it this way round. */
.composer__backdrop {
  background: var(--paper);
  color: transparent;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}
.composer__backdrop .tag {
  background: var(--acid);
  color: var(--ink);
  border-radius: 4px;

  /* Padding zeroed, not inherited: `.tag` gives a chat bubble 3px either
     side, and horizontal padding on an inline box is part of the inline
     flow — so it pushed everything after the tag 6px right of where the
     textarea put it. The pill covers exactly the tag's own advance width
     instead, and the space after the tag stays a space.

     `font-weight: inherit` undoes the 600 that `.tag` sets for a chat
     bubble, and it is not optional. A heavier face is a *wider* face: at
     600 the backdrop laid `@everyone` out 8px wider than the textarea did,
     so the pill and the glyphs under it drifted apart a little more with
     every letter. A bubble can be bold because nothing has to line up with
     it; this layer cannot.

     The weight comes from a shadow of the glyph on itself instead. Not
     `-webkit-text-stroke`, which is the obvious candidate and measurably
     wrong: Chrome adds the stroke to each glyph's advance, which came to 6px
     across nine letters. `text-shadow` is paint only and moves nothing. No
     blur radius, or the tag looks smudged next to the crisp text around it —
     two hairline copies either side is what reads as weight. */
  padding: 0;
  margin: 0;
  font-weight: inherit;
  text-shadow: 0.3px 0 0 currentColor, -0.3px 0 0 currentColor;
}

.closed-note { font-size: 13px; color: var(--ink-3); text-align: center; padding: 14px 8px; margin: 0; }

/* --- Reactions ------------------------------------------------------------ */

.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.reactions:empty { display: none; }

.reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  border: var(--border) solid var(--paper-3);
  background: var(--paper);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  line-height: 1.6;
}
.reaction:hover { border-color: var(--ink); }
.reaction--mine { border-color: var(--ink); background: var(--acid); color: var(--ink); }

.picker { position: relative; }
.picker__toggle {
  list-style: none;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--ink-3);
  font-size: 13px;
}
.picker__toggle::-webkit-details-marker { display: none; }
.picker__toggle:hover { background: var(--paper-2); color: var(--ink); }
.picker__menu {
  position: absolute;
  right: 0;
  z-index: 10;
  display: flex;
  gap: 2px;
  padding: 5px;
  background: var(--paper);
  border: var(--border) solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
}
.picker__option {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 999px;
}
.picker__option:hover { background: var(--paper-2); }

/* --- Events --------------------------------------------------------------- */

.event-card {
  display: flex;
  gap: 14px;
  padding: 13px;
  background: var(--paper);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.event-card:hover { text-decoration: none; transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.event-card--cancelled .event-card__title { text-decoration: line-through; color: var(--ink-4); }
.event-card > .spacer { display: block; min-width: 0; }
.event-card__title { display: block; font-weight: 600; font-size: 16px; }
.event-card__meta { display: block; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

.rsvp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rsvp__current { box-shadow: none; border-width: 2.5px; }

.tally { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }

.responder-group { margin-bottom: 14px; }
.responder-group__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 7px;
}
.responder { display: flex; align-items: center; gap: 8px; padding: 4px 0; }

.face-stack { display: flex; }
.face-stack .avatar { margin-left: -7px; }
.face-stack .avatar:first-child { margin-left: 0; }

/* --- Members -------------------------------------------------------------- */

.member-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border: var(--border) solid var(--ink);
  border-radius: 12px;
  margin-bottom: 9px;
}
.member-row__name { font-weight: 600; }

.invite-code {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  word-break: break-all;
  padding: 10px 12px;
  background: var(--paper-2);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius-sm);
}

.capacity { height: 6px; border-radius: 999px; background: var(--paper-2); border: var(--border) solid var(--ink); overflow: hidden; }
.capacity__fill { height: 100%; background: var(--tomato); }

/* --- Sign in -------------------------------------------------------------- */

.gate { max-width: 400px; margin: 10vh auto 0; padding: 0 16px; text-align: center; }
.gate__mark {
  width: 60px; height: 60px;
  border-radius: 18px;
  margin: 0 auto 18px;
  background: var(--tomato);
  border: var(--border) solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 26px;
  color: var(--paper);
}
.gate__title { font-family: var(--display); font-size: 34px; margin-bottom: 10px; letter-spacing: -0.03em; }
.gate__lede { color: var(--ink-3); margin-bottom: 26px; }
.gate .card { text-align: left; box-shadow: 4px 4px 0 var(--ink); }

/* --- Circle settings ------------------------------------------------------- */

.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.picker-grid--tints { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }

.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch {
  display: grid;
  place-items: center;
  cursor: pointer;
  border: var(--border) solid var(--paper-3);
  border-radius: 10px;
  transition: border-color 0.12s var(--ease), transform 0.12s var(--ease);
}
.swatch:hover { transform: translateY(-1px); }
.swatch:focus-within { outline: 2px solid var(--tomato); outline-offset: 2px; }
.swatch:has(input:checked) { border-color: var(--ink); border-width: 3px; }

.swatch--emoji { height: 44px; font-size: 20px; background: var(--paper); }
.swatch--emoji:has(input:checked) { background: var(--acid); }

.swatch--tint { height: 38px; background: var(--tint); position: relative; }

/* A thicker border alone is too quiet against eight saturated squares. */
.swatch--tint:has(input:checked)::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 8px;
  border-left: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
  transform: rotate(-45deg) translateY(-2px);
}

/* --- Circle settings page -------------------------------------------------
   Everything about a circle that is not the circle itself: who is in it, how
   someone else gets in, and how it treats you. The circle's own name, mark
   and ending stay on `edit`, behind an admin check. */

.setpage { max-width: 720px; display: flex; flex-direction: column; gap: 32px; }

.micro--lead { font-size: 11px; margin-bottom: 6px; }

.setsec { display: flex; flex-direction: column; gap: 12px; }
.setsec__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.setsec__title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.setsec__leave { align-self: flex-start; }

/* One bordered block with hairline-divided rows, rather than a card per
   person — fifty cards is a wall, fifty rows is a list you can read. */
.mlist {
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}
.mlist__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--paper-3);
}
.mlist__row:last-child { border-bottom: 0; }
.mlist__row--split { justify-content: space-between; padding: 13px 14px; }
.mlist__who { min-width: 0; flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mlist__name { font-size: 15px; font-weight: 600; }
.mlist__note { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.mlist__acts { display: flex; gap: 7px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.mlist__more {
  display: block;
  padding: 10px 14px;
  background: var(--paper-2);
  font-size: 12px;
  color: var(--ink-3);
}

.invitebox {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 14px 16px;
}
.invitebox__code {
  border: var(--border) solid var(--ink);
  border-radius: 10px;
  background: var(--acid);
  padding: 8px 14px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.12em;
  box-shadow: 2px 2px 0 var(--ink);
}
.invitebox__url { flex: 1; min-width: 180px; font-size: 12px; color: var(--ink-2); word-break: break-all; }

/* The switch is the state: the whole row is not the target here, because the
   row also carries the explanation of what muting does. */
.toggle-form { display: flex; flex: none; }
.toggle-btn { border: 0; background: none; padding: 0; cursor: pointer; display: flex; }
.toggle {
  width: 46px;
  height: 26px;
  flex: none;
  border: var(--border) solid var(--ink);
  border-radius: 999px;
  padding: 2px;
  display: flex;
  justify-content: flex-start;
  background: var(--paper-3);
  transition: background 0.12s var(--ease);
}
.toggle--on { justify-content: flex-end; background: var(--leaf); }
.toggle__knob {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--paper);
  border: var(--border) solid var(--ink);
}

/* The status picker on your profile. Radios for real, so keyboard and screen
   readers get the group for free — the input itself is hidden behind the
   chip, which is the thing worth looking at. */
.statuses { display: flex; flex-wrap: wrap; gap: 8px; }
.statuspick {
  display: inline-flex;
  align-items: center;
  border: var(--border) solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.statuspick input { position: absolute; opacity: 0; pointer-events: none; }
.statuspick:hover { background: var(--paper-2); }
/* Checked state in CSS, so the chip lights up on the click rather than
   waiting for the save to come back. */
.statuspick:has(input:checked) { background: var(--acid); }
.statuspick:has(input:focus-visible) { outline: var(--border) solid var(--sky); outline-offset: 2px; }

/* A square button that is only its icon. Used where a label would repeat what
   the thing beside it already says — the invite link, for one. */
.iconbtn {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.iconbtn:hover { background: var(--ink); color: var(--paper); }
.iconbtn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  grid-area: 1 / 1;
}

/* The tick lives in the same grid cell as the copy mark, so swapping them
   cannot change the button's size. */
.iconbtn__done { visibility: hidden; }
.is-copied .iconbtn { background: var(--leaf); color: var(--paper); border-color: var(--ink); }
.is-copied .iconbtn__copy { visibility: hidden; }
.is-copied .iconbtn__done { visibility: visible; }

/* The link is the long thing in the row; everything else holds its width. */
.mlist__link, .mlist__text { min-width: 0; flex: 1; }
.mlist__link .mlist__name { overflow-wrap: anywhere; font-size: 13px; }

/* The magic-link confirmation page, which reuses the sign-in gate. */
.signin__note { margin: 12px 0 0; text-align: center; }


/* `@everyone` in a message body. Acid on the bubble it sits in, so it reads
   as a tag rather than as a typo, on both sides of the conversation. */
.tag {
  border-radius: 5px;
  padding: 0 3px;
  background: var(--acid);
  color: var(--ink);
  font-weight: 600;
}
.msg--mine .tag { background: var(--acid); color: var(--ink); }

/* --- Modules: the slash menu and polls ------------------------------------
   `/` in the composer opens a list of modules. The list is deliberately
   short — a menu you have to read is a menu nobody opens twice.
   ------------------------------------------------------------------------ */

.slash {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--ink);
  overflow: hidden;
}
.slash__head { padding: 10px 14px 6px; margin: 0; }
.slash__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-top: 1px solid var(--paper-3);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s var(--ease);
}
.slash__item:hover, .slash__item--on { background: var(--acid); }
.slash__glyph {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: var(--border) solid var(--ink);
  border-radius: 9px;
  background: var(--paper-2);
  font-size: 14px;
}
.slash__body { min-width: 0; }
.slash__name { display: block; font-family: var(--mono); font-size: 13px; font-weight: 700; }
.slash__summary { display: block; font-size: 12px; color: var(--ink-3); }

/* A poll sits in the thread where a bubble would, but it is not a bubble:
   it belongs to the conversation rather than to the person who asked. */
.poll {
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 13px 14px;
  box-shadow: 3px 3px 0 var(--ink);
  min-width: min(300px, 100%);
}
.poll__head { margin-bottom: 10px; }
.poll__question { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin: 2px 0 0; }
.poll__options { display: flex; flex-direction: column; gap: 7px; }
.poll__foot { font-size: 11px; color: var(--ink-3); margin: 10px 0 0; }

.pollopt__form { display: block; }
.pollopt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: var(--border) solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition: background 0.12s var(--ease);
}
.pollopt:hover { background: var(--paper-2); }
.pollopt:disabled { cursor: default; }

/* The share, drawn behind the label rather than as a separate bar — the row
   is the result, so it does not need a chart beside it. */
.pollopt__fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--paper-3);
  transition: width 0.18s var(--ease);
}
.pollopt--mine .pollopt__fill { background: var(--acid); }
.pollopt--mine { border-width: 2px; }

.pollopt__label { position: relative; flex: 1; min-width: 0; font-weight: 500; }
.pollopt__tally { position: relative; flex: none; font-size: 12px; color: var(--ink-3); }
.pollopt--mine .pollopt__tally { color: var(--ink); font-weight: 700; }

.pollfields { display: flex; flex-direction: column; gap: 8px; }

/* --- Admin -----------------------------------------------------------------
   Deliberately unlike the rest of the app. This is the service, not a circle,
   and it should never be mistaken for one at a glance — hence the ink bar.
   ------------------------------------------------------------------------ */

.adminbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  border-bottom: var(--border) solid var(--ink);
}
.adminbar__brand {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: -0.03em;
  color: var(--paper);
}
.adminbar__brand:hover { text-decoration: none; }
.adminbar__brand .mono { font-family: var(--mono); font-size: 11px; color: var(--acid); }
.adminbar__nav { display: flex; gap: 4px; flex: 1; }
.adminbar__link {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--paper-3);
}
.adminbar__link:hover { text-decoration: none; color: var(--paper); }
.adminbar__link[aria-current="page"] { background: var(--acid); color: var(--ink); }
.adminbar__out { font-size: 12px; color: var(--paper-3); }

.adminstats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.adminstat {
  flex: 1;
  min-width: 96px;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 12px 14px;
}
.adminstat__count {
  display: block;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.adminsec {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 26px 0 8px;
}
.adminsec .faint { font-weight: 400; }

.adminsearch { display: flex; gap: 8px; align-items: center; }
.adminsearch input { width: auto; min-width: 200px; }

.adminconfirm { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.adminconfirm input { flex: 1; min-width: 200px; }
.card--danger { border-color: var(--berry); }

a.mlist__row { color: var(--ink); }
a.mlist__row:hover { background: var(--paper-2); text-decoration: none; }

/* The public pages: privacy, terms, support. Long-form text, which nothing
   else in this app is — so it gets its own measure and rhythm. */
.page--prose { max-width: 620px; }
.prose__head { margin-bottom: 28px; }
.prose__brand {
  display: inline-block;
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 18px;
}
.prose__brand:hover { text-decoration: none; }
.prose__meta { font-size: 12px; color: var(--ink-3); margin: 6px 0 0; }
.page--prose h1 { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.page--prose h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 30px 0 8px;
}
.page--prose h3 { font-size: 15px; font-weight: 600; margin: 20px 0 4px; }
.page--prose p, .page--prose li { font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.page--prose ul { padding-left: 20px; margin: 0 0 12px; }
.page--prose li { margin-bottom: 6px; }
.page--prose strong { color: var(--ink); font-weight: 600; }
.prose__foot {
  margin-top: 44px;
  padding-top: 18px;
  border-top: var(--border) solid var(--paper-3);
  font-size: 13px;
  color: var(--ink-3);
}

.gate__note {
  max-width: 34ch;
  margin: 0 auto 18px;
  padding: 10px 14px;
  border: var(--border) dashed var(--ink-4);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  text-align: center;
}

/* --- Notifications --------------------------------------------------------
   Per circle, and only inside one: the bell counts this circle's news, not
   every circle's, because no screen in Flokk shows more than one at a time
   and a bell that spanned them would be the feed this app does not have.
   ------------------------------------------------------------------------ */

.bell { position: absolute; top: 12px; right: 20px; z-index: 34; }
.bell__button {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: var(--border) solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: box-shadow 0.12s var(--ease), transform 0.12s var(--ease), background 0.12s var(--ease);
}
.bell__button:hover { box-shadow: 0 0 0 var(--ink); transform: translate(2px, 2px); }
.bell__button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bell__badge {
  position: absolute;
  top: -7px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: var(--border) solid var(--paper);
  background: var(--berry);
  color: var(--paper);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

/* Native popover again: light-dismiss and escape for free, in the top layer
   where the pane cannot clip it. */
.belldrop {
  position: fixed;
  top: 62px;
  right: 20px;
  left: auto;
  bottom: auto;
  margin: 0;
  width: 400px;
  max-height: min(560px, calc(100vh - 92px));
  padding: 0;
  border: var(--border) solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
}
.belldrop:popover-open { display: flex; flex-direction: column; }
.belldrop::backdrop { background: rgb(20 17 13 / 18%); }

.belldrop__head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: var(--border) solid var(--ink);
}
.belldrop__title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.belldrop__sub { font-size: 10px; color: var(--ink-3); margin: 0; }
.belldrop__list { flex: 1; min-height: 0; overflow: auto; }
.belldrop__empty { padding: 20px 16px; margin: 0; line-height: 1.5; }
.belldrop__foot {
  flex: none;
  border-top: var(--border) solid var(--ink);
  background: var(--paper-2);
  padding: 10px;
}
.belldrop__all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: var(--border) solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.belldrop__all:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

/* One line of news, at two densities. */
.notif {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--paper-3);
  background: var(--paper);
  color: var(--ink);
  transition: background 0.12s var(--ease);
}
.notif:hover { background: var(--paper-2); text-decoration: none; }
.notif--sm { gap: 12px; align-items: flex-start; padding: 11px 16px; }
.notif--fresh { background: var(--paper-2); }
.notif--fresh:hover { background: var(--paper-3); }
.notif--seen .notif__text { color: var(--ink-3); }
.notif--seen .notif__text strong { color: var(--ink); }

.notif__face { position: relative; flex: none; display: flex; }
.notif__glyph {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: var(--border) solid var(--paper);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}
.notif--fresh .notif__glyph { border-color: var(--paper-2); }

.notif__body { min-width: 0; flex: 1; }
.notif__text { display: block; font-size: 15px; line-height: 1.4; text-wrap: pretty; }
.notif--sm .notif__text { font-size: 13px; }
.notif__quote {
  display: block;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.notif--sm .notif__quote { font-size: 12px; }
.notif__time { flex: none; font-size: 11px; color: var(--ink-3); }
.notif--sm .notif__time { display: block; margin-top: 3px; font-size: 10px; }
.notif__dot { width: 8px; height: 8px; flex: none; border-radius: 999px; background: var(--berry); }
.notif--sm .notif__dot { margin-top: 6px; }

.notiflist {
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}
.notiflist--fresh { box-shadow: 4px 4px 0 var(--ink); }
.notiflist > :last-child .notif, .notiflist > .notif:last-child { border-bottom: 0; }

.micro--new { color: var(--berry); font-weight: 700; }
.acthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

/* The overview lets you dismiss a line without going where it points, so the
   row is a flex wrapper rather than the link itself — a form nested inside
   an <a> is invalid and the browser hoists it out. */
.activity {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--paper-3);
  background: var(--paper);
}
.activity:last-child { border-bottom: 0; }
.activity .notif { flex: 1; min-width: 0; border-bottom: 0; background: transparent; }
.activity__form { display: flex; flex: none; padding-right: 14px; }
.activity__check {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: var(--border) solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: all 0.12s var(--ease);
}
.activity__check:hover {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 0 0 var(--ink);
  transform: translate(2px, 2px);
}
.activity__seen {
  flex: none;
  width: 30px;
  margin-right: 14px;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Narrow screens -------------------------------------------------------
   Two tiers, because they answer different questions.

   Below 860px the *structure* cannot hold: rail plus context is 408px of
   frame before any content, which on a 390px screen pushed the pane clean
   off the side — the chat was unreachable rather than merely cramped. So the
   shell becomes one column, the rail becomes a bottom bar the thumb can
   reach, and the context column is dropped. The one page that leaned on that
   column — the chat list — renders the list in the pane instead.

   Below 620px it is about *room*: 40px gutters are a fifth of a phone
   screen, a two-up card grid gives each card 171px, and a 44px headline
   takes three lines. A tablet at 800px needs the first tier and none of the
   second.

   Note that `max-width` never needs relaxing here — a 720px column already
   shrinks to fit. What does need saying is `minmax(0, 1fr)` on every grid
   track, which is done at the point of declaration rather than down here.
   ------------------------------------------------------------------------ */

.narrow-only { display: none; }

@media (max-width: 860px) {
  :root { --rail-h: 56px; }

  .wide-only { display: none; }
  .narrow-only { display: block; }

  /* One column. dvh, because 100vh on mobile Safari counts the URL bar and
     puts the composer underneath it. */
  .shell, .shell--wide {
    grid-template-columns: minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
  }

  /* Its job is done by the pane at this width. */
  .context { display: none; }

  /* Everything in the pane stays clear of the bar — including the composer,
     which is pinned to the bottom of the pane rather than the window. */
  .pane { padding-bottom: calc(var(--rail-h) + env(safe-area-inset-bottom, 0px)); }

  /* Rail → bottom bar. Fixed, so it leaves the grid flow entirely. */
  .rail {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    flex-direction: row;
    justify-content: space-around;
    gap: 2px;
    height: calc(var(--rail-h) + env(safe-area-inset-bottom, 0px));
    padding: 5px 6px env(safe-area-inset-bottom, 0px);
    border-right: 0;
    border-top: var(--border) solid var(--ink);
  }
  .rail__brand, .rail__rule, .rail__chevron { display: none; }
  .rail__stack {
    flex: 1;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    gap: 2px;
    padding: 0;
    width: auto;
  }
  .rail__nav {
    width: auto;
    min-width: 0;
    flex: 1;
    max-width: 96px;
    padding: 4px 2px 3px;
    gap: 2px;
    font-size: 10px;
    border-radius: 10px;
  }
  .rail__glyph { font-size: 14px; }
  .rail__current { width: 36px; height: 36px; border-radius: 11px; }
  .rail__emoji { font-size: 18px; }
  .rail__me { width: 36px; height: 36px; font-size: 12px; }

  /* The switcher opens from the bar it belongs to, and takes the width. */
  .switcher {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: calc(var(--rail-h) + env(safe-area-inset-bottom, 0px) + 8px);
    width: auto;
  }
  .switcher__list { max-height: 50vh; }

  /* The bell floats over the pane, which on a phone is the whole screen —
     so it sits where a page's own heading is not. */
  .bell { top: 10px; right: 14px; }
  .bell__button { width: 36px; height: 36px; }
  .belldrop {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: calc(var(--rail-h) + env(safe-area-inset-bottom, 0px) + 8px);
    width: auto;
    max-height: min(70vh, calc(100dvh - var(--rail-h) - 80px));
  }

  /* The heading has to clear the bell, or a long circle name runs under it. */
  .setpage > header, .pane__column > .hero { padding-right: 52px; }

  .pane__scroll { padding: 26px 24px 32px; }
  .pane__list { flex: 1; overflow: auto; padding: 12px 14px; }
  .page { padding: 20px 24px 44px; }
  .modal { width: calc(100vw - 24px); }
}

@media (max-width: 620px) {
  /* Gutters. 40px of side padding is a fifth of a phone screen. */
  .pane__scroll { padding: 20px 16px 28px; }
  .page { padding: 18px 16px 40px; }
  .pane__empty { padding: 24px 16px; }

  /* Two-up at 358px gives each card 171px, which wraps the text one word to
     a line. */
  .duo, .ecards { grid-template-columns: minmax(0, 1fr); }

  /* Headlines sized for a 720px column. */
  .hero__name, .events__title { font-size: 32px; }
  .nextup__title { font-size: 21px; }
  .duo__big { font-size: 26px; }
  .emptybox__title { font-size: 23px; }

  /* Anything with a title on one side and buttons on the other has to be
     allowed to stack, or it sets a min-width wider than the screen. */
  .page-head, .events__head, .row--between { flex-wrap: wrap; }

  .nextup { padding: 16px; gap: 13px; box-shadow: 5px 5px 0 var(--ink); }
  .datechip--hero { width: 60px; padding: 8px 0; }
  .datechip--hero .datechip__day { font-size: 26px; }
  .emptybox { padding: 28px 20px; }

  /* The reaction picker is anchored to the message's tools, which sit at
     whichever end of a bubble that message happens to occupy — so `right: 0`
     put a 208px menu off the left edge of a 390px screen. At this width it
     stops being a dropdown and becomes a bar above the composer, which is
     both always on screen and where the thumb already is. */
  .picker__menu {
    position: fixed;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: calc(var(--rail-h) + env(safe-area-inset-bottom, 0px) + 74px);
    flex-wrap: wrap;
    justify-content: center;
    max-width: calc(100vw - 32px);
  }

  /* Chat. A 70% bubble on a phone leaves a margin wider than the message. */
  .thread-pane__head { padding: 12px 14px; gap: 9px; }
  .narrow-only.back-arrow { display: grid; flex: none; }
  .chat__scroll { padding: 16px 14px; gap: 9px; }
  .msg { max-width: 86%; }
  .composer { padding: 10px 14px; }

  .notif { padding: 12px 14px; gap: 11px; }
  .notif--sm { padding: 10px 13px; }
  .notif__text { font-size: 14px; }
  .activity__form, .activity__seen { padding-right: 0; margin-right: 10px; }

  /* Settings and the roster: the buttons drop under the name rather than
     squeezing it to nothing. */
  .mlist__row { flex-wrap: wrap; row-gap: 9px; }
  .mlist__acts { width: 100%; justify-content: flex-start; }

  /* A URL squeezed between two buttons has no width left, and then it breaks
     one character to a line. Give it the row to itself. */
  .mlist__link { flex-basis: 100%; }

  /* The code and the copy button share the top line; the link goes under. */
  .invitebox { padding: 12px 13px; gap: 10px; justify-content: space-between; }
  .invitebox__code { order: 1; }
  .invitebox .iconbtn { order: 2; }
  .invitebox__url { order: 3; flex-basis: 100%; min-width: 0; overflow-wrap: anywhere; }
}
