@font-face {
  font-family: "Baloo 2";
  src: url("fonts/baloo2.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ground: #fff7ee;
  --card: #ffffff;
  --shadow: #f0e2d3;
  --line: #efe3d6;
  --rule: #e3d8cb;
  --ink: #1e1a2e;
  --muted: #6b6479;
  --label: #5e566b;
  --accent: #ff5b3a;
  --accent-deep: #b8321b;
  --accent-soft: #ffe3da;
  --link: #e2462a;
  --yellow: #ffc83d;
  --yellow-soft: #fff0c2;
  --blue: #3aa0ff;
  --purple: #7b5cff;
  --green: #2bc48a;
  --sand: #e7dccf;
  --scrim: #1e1a2e73;
  --display: "Baloo 2", system-ui, sans-serif;
}

/* Going from one page to another, the old one stays in sight until the new
   one is ready, and fades into it */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  background: var(--ground);
  max-width: 30rem;
  margin: 0 auto;
  padding: 0 14px 4rem;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button,
.file-picker {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

button:focus-visible,
a:focus-visible,
.file-picker:focus-within {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

main,
#feed,
form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.card {
  background: var(--card);
  border-radius: 24px;
  box-shadow: 0 2px 0 var(--shadow);
}

.empty {
  color: var(--muted);
  text-align: center;
}

.hint {
  margin: 0;
  padding-left: 4px;
  font-size: 13px;
  color: var(--muted);
}

.message {
  margin: 0;
  font-weight: 700;
  color: var(--label);
}

.message:empty {
  display: none;
}

/* Top bar */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
}

.topbar h1,
.topbar h2 {
  flex: 1;
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
}

.wordmark {
  flex: 1;
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  line-height: 1;
  color: var(--accent);
}

.wordmark:hover {
  color: var(--accent);
  text-decoration: none;
}

.icon-button {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 2px 0 var(--shadow);
  font-weight: 800;
  font-size: 20px;
  color: var(--ink);
}

.icon-button:hover {
  color: var(--ink);
  text-decoration: none;
}

.account {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.account-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: inherit;
}

.account-link:hover {
  color: inherit;
}

/* On a phone the avatar alone says who is logged in */
@media (max-width: 28rem) {
  .account-name {
    display: none;
  }
}

.account-name {
  font-weight: 800;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#logout {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--card);
  box-shadow: 0 2px 0 var(--shadow);
  font-weight: 800;
  font-size: 14px;
}

/* Avatars */

.avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  font-weight: 800;
  color: #fff;
  background: var(--purple);
}

.avatar.small {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.avatar.medium {
  width: 36px;
  height: 36px;
  font-size: 15px;
}

.avatar.tiny {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.avatar.large {
  width: 96px;
  height: 96px;
  border: 4px solid var(--card);
  box-shadow: 0 3px 0 var(--shadow);
  font-family: var(--display);
  font-size: 40px;
}

.avatar.huge {
  width: 144px;
  height: 144px;
  border: 5px solid var(--card);
  box-shadow: 0 3px 0 var(--shadow);
  font-family: var(--display);
  font-size: 64px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.tone-0 {
  background: var(--yellow);
  color: var(--ink);
}

.avatar.tone-1 {
  background: var(--blue);
}

.avatar.tone-2 {
  background: var(--accent);
}

.avatar.tone-3 {
  background: var(--purple);
}

.avatar.tone-4 {
  background: var(--green);
}

.avatar.tone-none {
  background: var(--sand);
  color: var(--muted);
}

/* Buttons */

.primary {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--accent);
  box-shadow: 0 3px 0 var(--accent-deep);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}

.primary.wide {
  padding: 16px;
  font-size: 17px;
}

.primary:disabled {
  background: var(--line);
  box-shadow: none;
  color: var(--muted);
}

/* A link that looks like a button */
a.primary {
  display: block;
  text-align: center;
}

a.primary:hover {
  color: #fff;
  text-decoration: none;
}

/* Form fields */

.field {
  display: grid;
  gap: 8px;
}

.field label {
  padding-left: 4px;
  font-weight: 800;
  font-size: 14px;
  color: var(--label);
}

input[type="text"],
input[type="password"] {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: var(--card);
  font-weight: 700;
  font-size: 17px;
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
}

.with-reveal {
  position: relative;
}

.with-reveal input {
  padding-right: 64px;
}

.reveal {
  position: absolute;
  top: 0;
  right: 6px;
  height: 100%;
  border: 0;
  padding: 0 10px;
  background: none;
  font-weight: 800;
  font-size: 14px;
  color: var(--label);
}

.note {
  display: flex;
  gap: 10px;
  margin: 0;
  border-radius: 18px;
  padding: 12px 14px;
  background: var(--yellow-soft);
  font-size: 14px;
}

.note b {
  font-weight: 800;
}

/* The label is the visible control; the input stays reachable by keyboard */
.file-picker input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 18px;
  padding: 14px;
  background: var(--yellow-soft);
  font-weight: 800;
  font-size: 15px;
}

.file-picker.dark {
  display: inline-flex;
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
}

.file-picker.light {
  display: inline-flex;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--card);
  box-shadow: 0 2px 0 var(--shadow);
}

/* Login and invite pages */

.hero {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 72px 4px 36px;
  text-align: center;
}

.hero .wordmark {
  font-size: 40px;
}

.hero p,
.welcome p:last-child {
  margin: 0;
  color: var(--muted);
}

.welcome {
  display: grid;
  gap: 6px;
  padding: 16px 4px 22px;
}

.welcome .wordmark {
  font-size: 24px;
}

.welcome h1 {
  margin: 10px 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1.1;
}

.welcome p:last-child {
  font-size: 15px;
}

#login,
#new-user {
  gap: 20px;
  padding: 0 4px;
}

.picture-field {
  display: flex;
  align-items: center;
  gap: 16px;
}

.picture-field > div {
  display: grid;
  gap: 8px;
  justify-items: start;
}

/* Profile page */

#profile {
  gap: 28px;
  padding: 20px 4px 0;
}

.profile-picture {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.profile-picture-frame {
  position: relative;
}

.camera-badge {
  position: absolute;
  right: 0;
  bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 4px solid var(--ground);
  border-radius: 50%;
  background: var(--accent);
  font-size: 20px;
  cursor: pointer;
}

.picture-choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* Leads from the profile page to the pages only an admin sees */
.secondary {
  display: block;
  margin: 14px 4px 0;
  border-radius: 999px;
  padding: 16px;
  background: var(--card);
  box-shadow: 0 2px 0 var(--shadow);
  font-weight: 800;
  font-size: 17px;
  text-align: center;
  color: var(--ink);
}

.secondary:hover {
  color: var(--ink);
  text-decoration: none;
}

/* Notifications, on the profile page */

.push {
  display: grid;
  gap: 10px;
  padding: 14px 4px 0;
}

.push h2 {
  margin: 0;
  font-size: 17px;
}

.push .secondary {
  margin: 0;
  border: 0;
}

/* Users page */

.dark-pill {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}

.soft-pill {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  background: var(--ground);
  font-weight: 800;
  font-size: 14px;
}

.user-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 14px;
  padding: 14px 0;
}

.user-row + .user-row {
  border-top: 2px solid var(--line);
}

.user-row .avatar {
  width: 44px;
  height: 44px;
}

.user-info {
  flex: 1;
  min-width: 0;
  display: grid;
}

.user-name {
  font-weight: 800;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-seen {
  font-size: 13px;
  color: var(--muted);
}

.sheet-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sheet-person .avatar {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

.sheet-person h2,
.sheet-title h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.1;
}

.sheet-person p,
.sheet-title p {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--muted);
}

input.link-box {
  border: 2px dashed var(--accent);
  background: var(--ground);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 500;
  /* An iPhone zooms in on a focused field with smaller text */
  font-size: 16px;
  text-overflow: ellipsis;
}

input.link-box:focus {
  border-color: var(--accent);
}

/* Password pages */

#new-password {
  gap: 20px;
  padding: 0 4px;
}

/* Composer */

.composer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 22px;
  padding: 12px;
}

.composer-prompt {
  flex: 1;
  border: 0;
  padding: 8px 0;
  background: none;
  text-align: left;
  font-size: 15px;
  color: var(--muted);
}

.tile {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  background: var(--yellow-soft);
  font-size: 18px;
}

dialog.screen {
  width: 100%;
  max-width: 30rem;
  height: 100dvh;
  max-height: none;
  margin: 0 auto;
  border: 0;
  padding: 0 14px 30px;
  background: var(--ground);
  color: inherit;
}

dialog.screen::backdrop {
  background: var(--ground);
}

.compose-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.byline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.byline .name {
  font-weight: 800;
  font-size: 15px;
}

.compose-card textarea {
  width: 100%;
  border: 0;
  padding: 0;
  background: none;
  resize: vertical;
  font-size: 19px;
  line-height: 1.45;
  caret-color: var(--accent);
}

.compose-card textarea:focus {
  outline: none;
}

.image-count {
  margin: 0;
  padding: 0 6px;
  font-weight: 800;
  font-size: 15px;
}

.previews {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.previews:empty {
  display: none;
}

.preview {
  position: relative;
  height: 160px;
  border-radius: 20px;
  overflow: hidden;
}

/* Until the image is uploaded, and if it could not be */
.preview p {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin: 0;
  padding: 44px 12px 12px;
  background: var(--sand);
  color: var(--label);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  overflow-wrap: anywhere;
}

.preview.failed p {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview:first-child::before {
  content: "Forside";
  position: absolute;
  top: 8px;
  left: 8px;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
}

.preview button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #1e1a2ecc;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}

.has-images .file-picker {
  justify-content: center;
  border: 2px dashed var(--rule);
  border-radius: 20px;
  padding: 16px;
  background: none;
  color: var(--label);
}

/* Posts */

.post {
  position: relative;
  overflow: hidden;
}

.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
}

.post-byline {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.post-name {
  margin: 0;
  font-weight: 800;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.permalink {
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}

.permalink:hover {
  color: var(--muted);
}

/* The link covers the whole card, so a click anywhere on it opens the post */
.whole-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Reactions are the one thing on the card that is not the link */
.post .reaction {
  position: relative;
  z-index: 1;
}

.post .text {
  margin: 0;
  padding: 0 14px 12px;
  font-size: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.images {
  display: grid;
  gap: 3px;
}

/* An image has a width of its own, which must not widen its column */
.images > * {
  min-width: 0;
}

.images.pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.images.album {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 120px 120px;
}

.images.album > :first-child {
  grid-row: span 2;
}

.images a,
.images img {
  display: block;
  width: 100%;
  height: 100%;
}

.images img {
  object-fit: cover;
}

.images.pair img {
  aspect-ratio: 1;
}

.images.single img {
  height: auto;
  max-height: 32rem;
}

/* On a post's own page a tap on the images opens them in the lightbox */
.opens-lightbox {
  position: relative;
}

.opens-lightbox img {
  cursor: zoom-in;
}

.opens-lightbox .photo:active img {
  opacity: 0.85;
}

/* Says the images can be opened; a tap on it goes to the image below */
.open-hint {
  position: absolute;
  left: 10px;
  bottom: 10px;
  border-radius: 999px;
  padding: 4px 12px;
  background: #1e1a2ecc;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  pointer-events: none;
}

.more {
  position: relative;
  min-height: 0;
}

.more::after {
  content: attr(data-more);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e1a2e99;
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  pointer-events: none;
}

/* The lightbox: a post's images over the whole screen, to swipe between */

dialog.lightbox {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  background: #000;
  color: #fff;
  /* lightbox.js handles every gesture, so the page itself is never zoomed */
  touch-action: none;
}

dialog.lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

dialog.lightbox::backdrop {
  background: #000;
}

/* What is behind the lightbox stays where it was */
html:has(dialog.lightbox[open]) {
  overflow: hidden;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px;
}

.lightbox-counter {
  margin: 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.lightbox-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #ffffff26;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
}

.lightbox-button:hover {
  background: #ffffff40;
}

/* Only lightbox.js scrolls it, to the image a swipe or a button goes to */
.lightbox-track {
  display: flex;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox-slide {
  position: relative;
  flex: 0 0 100%;
  overflow: hidden;
}

/* As large as fits, at its own shape, in the middle of the slide */
.lightbox-slide img {
  position: absolute;
  inset: 0;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  margin: auto;
  /* Zooming scales it from here; lightbox.js moves it to where it belongs */
  transform-origin: 0 0;
  cursor: zoom-in;
  -webkit-user-drag: none;
}

.lightbox-track.zoomed img {
  cursor: grab;
}

/* A strip of miniatures below the images, the one in view picked out */
.lightbox-thumbs {
  position: relative;
  display: flex;
  gap: 6px;
  padding: 8px 8px 0;
  overflow-x: auto;
  scrollbar-width: none;
  /* Scrolled sideways by a finger, unlike the rest of the lightbox */
  touch-action: pan-x;
}

.lightbox-thumbs::-webkit-scrollbar {
  display: none;
}

.lightbox-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: #ffffff26;
  opacity: 0.5;
  cursor: pointer;
}

/* In the middle when they all fit, from the start when they do not */
.lightbox-thumb:first-child {
  margin-left: auto;
}

.lightbox-thumb:last-child {
  margin-right: auto;
}

.lightbox-thumb:hover {
  opacity: 0.8;
}

.lightbox-thumb[aria-current="true"] {
  border-color: #fff;
  opacity: 1;
}

.lightbox-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
}

/* Arrows for a mouse; on a touch screen the images are swiped instead */
.lightbox-step {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  font-size: 32px;
}

.lightbox-step.previous {
  left: 12px;
}

.lightbox-step.next {
  right: 12px;
}

.lightbox-step:disabled {
  visibility: hidden;
}

@media (hover: none) {
  .lightbox-step {
    display: none;
  }
}

/* Reactions */

.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 14px 14px;
}

.reaction {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--ground);
  font-weight: 800;
  font-size: 15px;
}

.reaction[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.add-reaction {
  border-color: var(--ink);
  padding: 4px 12px;
  background: var(--ink);
  color: #fff;
}

dialog.sheet {
  width: 100%;
  max-width: 30rem;
  margin: auto auto 0;
  border: 0;
  border-radius: 32px 32px 0 0;
  padding: 12px 18px 30px;
  background: var(--card);
  color: inherit;
}

dialog.sheet[open] {
  display: grid;
  gap: 14px;
}

dialog.sheet::backdrop {
  background: var(--scrim);
}

dialog.sheet::before {
  content: "";
  justify-self: center;
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: var(--rule);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.sheet-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
}

.sheet-head p {
  margin: 0;
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
}

.quick-emojis {
  display: flex;
  justify-content: space-between;
}

.emoji-choice {
  border: 0;
  padding: 0;
  background: none;
  font-size: 26px;
  line-height: 1.3;
  border-radius: 12px;
}

.quick-emojis .emoji-choice {
  width: 48px;
  height: 48px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--ground);
}

.emoji-choice[aria-pressed="true"] {
  background: var(--accent-soft);
}

.quick-emojis .emoji-choice[aria-pressed="true"] {
  border-color: var(--accent);
}

.rule-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 800;
  font-size: 14px;
  color: var(--label);
}

.rule-label::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--shadow);
}

/* Holds the room of the picker of every emoji while it loads */
#all-emojis {
  height: min(21rem, 45dvh);
}

#all-emojis p {
  margin: 0;
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
}

/* The picker of every emoji. These reach into it; the rest of how it looks is
   at the end of emoji-picker/picker.css */
emoji-picker {
  width: 100%;
  height: 100%;
  color-scheme: light;
  --background: var(--card);
  --border-size: 0;
  --border-color: var(--shadow);
  --indicator-color: var(--accent);
  --indicator-height: 3px;
  --emoji-size: 26px;
  --emoji-padding: 6px;
  --num-columns: 8;
  --category-font-size: 14px;
  --category-font-color: var(--label);
  --button-hover-background: var(--ground);
  --button-active-background: var(--accent-soft);
  --outline-color: var(--ink);
  --outline-size: 3px;
  --input-border-size: 2px;
  --input-border-color: var(--line);
  --input-border-radius: 18px;
  --input-font-color: var(--ink);
  /* An iPhone zooms in on a focused field with smaller text */
  --input-font-size: 16px;
  --input-line-height: 1.4;
  --input-placeholder-color: var(--muted);
  --skintone-border-radius: 18px;
}

/* On a post in the feed: how many comments the post has */
.comment-total {
  align-self: center;
  margin-left: auto;
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
}

/* Comments */

/* Room to scroll the last comment up from under the comment field */
.comments {
  display: grid;
  gap: 14px;
  padding-bottom: 96px;
}

.comments h2 {
  margin: 0;
  padding: 0 6px;
  font-weight: 800;
  font-size: 15px;
}

.comment-list,
.replies {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A comment scrolled to is not left under the comment field */
.comment-list li {
  scroll-margin-bottom: 120px;
}

.comment-line {
  display: flex;
  gap: 10px;
}

.comment-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: start;
}

.bubble {
  border-radius: 4px 18px 18px 18px;
  padding: 10px 12px;
  background: var(--card);
}

.comment.replying > .comment-line > .comment-body > .bubble {
  box-shadow: 0 0 0 2px var(--accent);
}

.comment-name,
.comment-text {
  margin: 0;
}

.comment-name {
  font-weight: 800;
  font-size: 14px;
}

.comment-text {
  font-size: 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding-left: 4px;
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
}

.reply-to {
  border: 0;
  padding: 0;
  background: none;
  font-weight: 800;
  color: var(--muted);
}

.replies {
  margin-top: 4px;
  border-left: 3px solid var(--line);
  padding-left: 10px;
}

.replies:empty {
  display: none;
}

.replies .comment-line {
  gap: 8px;
}

.replies .comment-body {
  gap: 4px;
}

.replies .bubble {
  border-radius: 4px 16px 16px 16px;
  padding: 8px 12px;
}

/* The comment field stays at the bottom of the screen */
.comment-composer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  max-width: 30rem;
  margin: 0 auto;
  gap: 8px;
  border-top: 2px solid var(--shadow);
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--card);
}

.comment-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.comment-composer-row .avatar {
  margin-bottom: 4px;
}

.comment-composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 160px;
  border: 0;
  border-radius: 22px;
  padding: 10px 16px;
  background: var(--ground);
  font-weight: 700;
  /* iPhones zoom in on a field with smaller text when it is tapped */
  font-size: 16px;
  line-height: 1.4;
  resize: none;
  field-sizing: content;
  caret-color: var(--accent);
}

.comment-composer textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.send {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
}

.send:disabled {
  background: var(--line);
  color: var(--muted);
}

.replying-to {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 0 4px;
  font-weight: 800;
  font-size: 13px;
  color: var(--label);
}

.replying-to[hidden] {
  display: none;
}

.replying-to button {
  border: 0;
  padding: 2px 6px;
  background: none;
  font-weight: 800;
  color: var(--muted);
}

/* What went wrong, said for a little while over the top of the page */
.notice {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 14px;
  left: 14px;
  z-index: 3;
  max-width: 28rem;
  margin: 0 auto;
  border-radius: 16px;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-align: center;
}
