/* Desire DB. The app for people. It sits on site.css and home.css: the same type, rules, ad, fields, and marker. */

/* ---------- Masthead and the identity line ---------- */
.app-nav ul {
  gap: 0.25rem 1.5rem;
}
.app-nav .away {
  margin-left: 0.6rem;
  padding-left: 1.4rem;
  border-left: 1px solid var(--rule);
}
.count {
  display: inline-block;
  min-width: 1.35em;
  padding: 0 0.35em;
  border-radius: 1em;
  background: var(--marker);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
  vertical-align: 0.15em;
}
.app-line #slot-note {
  padding: 0 0.45em;
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 0.72rem;
  color: var(--ink);
}
.app-line #backup-note {
  color: var(--ink);
  font-weight: 600;
}
.app-line #backup-note::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.45em;
  background: var(--marker);
  vertical-align: 0.08em;
}

/* ---------- Views ---------- */
.view {
  padding-bottom: 3rem;
}
.view-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: end;
  padding-block: 1.4rem 1.2rem;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--ink);
}
.view-head h1 {
  font-size: clamp(2.6rem, 4.6vw, 4.4rem);
  padding-right: var(--gutter);
  margin-left: -0.03em;
}
.view-intro {
  padding-left: var(--gutter);
  border-left: 1px solid var(--ink);
}
.view-intro p {
  max-width: 40rem;
  font-size: 1.02rem;
}
.view-intro p + p {
  margin-top: 0.5rem;
}
.quiet {
  color: var(--ink-soft);
}
.small {
  font-size: 0.85rem;
}
.done {
  font-weight: 600;
}
.error {
  font-weight: 600;
}
button.link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
button.link:hover {
  text-decoration-thickness: 2px;
}
.button.small {
  min-height: 2.2rem;
  padding: 0.3rem 0.8rem;
  border-width: 1px;
  font-size: 0.86rem;
}
.button.small.primary {
  border-width: 1px;
}
.button.danger:hover {
  background: var(--marker);
  color: var(--ink);
}
.more {
  margin-top: 1.2rem;
}

/* ---------- Public and sealed: said where the person types ---------- */
.scope {
  display: inline-block;
  margin-left: 0.4em;
  padding: 0.02em 0.45em 0.06em;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: 0.12em;
  letter-spacing: 0.01em;
}
.scope-public {
  border: 1px solid var(--ink);
}
.scope-sealed {
  background: var(--sealed);
  color: var(--paper);
}
.scope-plain {
  border: 1px dashed var(--ink-soft);
  color: var(--ink-soft);
}
.scope-note {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  max-width: 36rem;
}
.public-block > label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.sealed-block {
  margin: 1.6rem 0 0;
  padding: 0.9rem 1rem 1rem 1.1rem;
  border: 0;
  border-left: 4px solid var(--sealed);
  background: rgb(14 75 79 / 0.06);
}
.sealed-block legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 0.1rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.sealed-block .scope-note {
  clear: both;
  margin-top: 0.15rem;
  margin-bottom: 0.7rem;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 1rem;
}
.contact-grid label:last-child {
  grid-column: 1 / -1;
}
.contact-grid label,
label.stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.contact-grid input,
.contact-grid textarea,
label.stack input,
label.stack textarea,
label.stack select {
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: #fbf9f3;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
}
.sealed-block input,
.sealed-block textarea {
  border-color: var(--sealed);
}
.sealed-block input:focus-visible,
.sealed-block textarea:focus-visible {
  outline-color: var(--sealed);
}
.post-actions {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink);
}
/* The form is the grid, so the tab order runs sentence, Read, the fields, the contact, Post. The slip stands in the right column beside all of the left. */
#post-form {
  padding-right: 0;
}
#post-form > :not(.slip) {
  grid-column: 1;
  padding-right: var(--gutter);
}
#post-form > .slip {
  grid-column: 2;
  grid-row: 1 / span 6;
}

/* ---------- The editable record ---------- */
.slip-sentence.is-empty {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 1.05rem;
}
.slip-sentence.is-stale {
  color: var(--ink-soft);
}
.slip-sentence.is-stale::after {
  content: "You changed the sentence. Read it again to fill the fields from the new one.";
  display: block;
  margin-top: 0.3rem;
  font-family: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
}
.desire-link {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.edit-fields .field-row {
  grid-template-columns: 7rem minmax(0, 1fr);
  padding: 0.45rem 0;
}
.edit-fields dd {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.edit-fields input,
.edit-fields select,
.edit-fields textarea {
  width: 100%;
  padding: 0.18rem 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--ink);
  transition: border-color 0.15s;
}
.edit-fields textarea {
  resize: vertical;
  line-height: 1.4;
}
.edit-fields input:focus-visible,
.edit-fields select:focus-visible,
.edit-fields textarea:focus-visible {
  outline: none;
  border-bottom-color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--marker);
}
.edit-fields input::placeholder,
.edit-fields textarea::placeholder {
  color: #8a867b;
  font-weight: 400;
  text-transform: none;
}
.edit-fields input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--ink);
}
.edit-fields select {
  appearance: none;
  padding-right: 1.2rem;
  background: linear-gradient(45deg, transparent 50%, var(--ink) 50%) right 0.35rem center / 0.4rem 0.4rem no-repeat,
    linear-gradient(135deg, var(--ink) 50%, transparent 50%) right 0 center / 0.4rem 0.4rem no-repeat;
  cursor: pointer;
}
.row-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
}
.part {
  display: flex;
  flex-direction: column;
  flex: 1 1 6rem;
  min-width: 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.part.check {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  align-self: end;
  padding-bottom: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
}
.part input[type="date"] {
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 0.82rem;
}
.row-note {
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.row-note:empty {
  display: none;
}
.row-drift {
  color: var(--ink);
}
/* The row an error names carries the marker, as a field of the front page does, until the person types in it. So does the sentence. */
.public-block textarea[aria-invalid="true"],
.edit-fields .field-row:has([aria-invalid="true"]) {
  box-shadow: inset 0 -4px 0 var(--marker);
}
.edit-fields .field-row:has([aria-invalid="true"]) .row-drift {
  font-weight: 600;
}
.field-row[data-filled] dt {
  color: var(--ink);
  font-weight: 600;
}
.edit-more {
  display: none;
  margin-top: 0.6rem;
  font-size: 0.85rem;
}

/* ---------- After a post ---------- */
.post-result {
  margin-top: 2.4rem;
  padding-top: 1.4rem;
  border-top: 4px solid var(--ink);
}
/* In the place of the form, the heading above already closes with a rule. */
.post-result.is-in-place {
  margin-top: 0;
  border-top: 0;
}
.post-result h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-bottom: 0.6rem;
}
.post-result .lede {
  max-width: 44rem;
  font-size: 1.05rem;
}
.post-result .lede + .lede {
  margin-top: 0.3rem;
}
.post-result .record-actions {
  margin-top: 1rem;
}
.post-result .app-results {
  margin-top: 1.4rem;
}

/* ---------- Ads with actions ---------- */
/* A grid, not newspaper columns: a block that opens a panel grows alone, and its neighbours stay put. */
.app-results {
  --ad-columns: 3;
  /* The .ads columns are off, and so is their rule: Chrome paints a column rule in the gaps of a grid too. */
  columns: auto;
  column-rule: none;
  display: grid;
  grid-template-columns: repeat(var(--ad-columns), minmax(0, 1fr));
  padding: 1px 0 0 1px;
}
.app-results:empty {
  padding: 0;
}
.app-results .ad {
  border-right: 0;
}
/* Each block draws its own four rules and overlaps its neighbours' by a pixel, so an empty track draws nothing. */
.ad-block {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
}
.app-results > .ad-block {
  margin: -1px 0 0 -1px;
}
/* The reveal form needs the width of the page, not of one column. */
.app-results > .ad-block:has(.ad-panel:not(:empty)) {
  grid-column: 1 / -1;
}
/* The ad keeps its own height, so the marker circles the words and not the space under them. The actions sit at the foot. */
.ad-block .ad {
  border-bottom: 0;
}
.ad-block .ad-actions {
  margin-top: auto;
}
.app-results .ad {
  font-size: 0.92rem;
  padding: 0.7rem 0.8rem 0.4rem;
}
.ad-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  padding: 0.3rem 0.8rem 0.7rem;
  font-size: 0.85rem;
}
.ad-panel:not(:empty) {
  padding: 0 0.8rem 0.9rem;
}
.button[aria-expanded="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.asked {
  font-weight: 600;
}
.asked a {
  font-weight: 500;
}

/* ---------- The reveal request ---------- */
.reveal-panel {
  max-width: 44rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  font-size: 0.92rem;
}
.reveal-panel h3 {
  font-size: 1rem;
  font-weight: 700;
}
.reveal-panel > .scope-note {
  margin-bottom: 0.8rem;
}
.reveal-panel label.stack {
  margin-top: 0.7rem;
}
.reveal-panel label.stack .scope-note {
  margin-top: 0.1rem;
}
.reveal-panel .sealed-block {
  margin-top: 1rem;
}
.reveal-panel .record-actions {
  margin-top: 0.9rem;
}
.reveal-panel .done {
  font-size: 1rem;
}

/* ---------- The opened card ---------- */
.contact-card {
  margin: 0.4rem 0 0;
  border-top: 1px solid var(--sealed);
}
.contact-row {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 0 0.8rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}
.contact-row dt {
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 0.7rem;
  line-height: 1.9;
  color: var(--sealed);
}
.contact-row dd {
  min-width: 0;
  overflow-wrap: anywhere;
}
.contact-row .redact {
  display: inline-block;
  max-width: 100%;
}

/* ---------- Mine ---------- */
.mine-list {
  border-top: 1px solid var(--ink);
}
.mine-item {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  border-bottom: 1px solid var(--rule);
}
.mine-item > .ad {
  font-size: 1rem;
  padding: 0.9rem var(--gutter) 0.9rem 0;
  border-bottom: 0;
}
.mine-item[data-status]:not([data-status="open"]) > .ad .ad-text {
  color: var(--ink-soft);
}
.mine-side {
  padding: 0.9rem 0 0.9rem var(--gutter);
  border-left: 1px solid var(--rule);
  min-width: 0;
}
.mine-state {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.mine-state[data-status="open"]::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.45em;
  border-radius: 50%;
  background: var(--marker);
  vertical-align: 0.08em;
}
.mine-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
}
.mine-panel:not(:empty) {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule);
}
.mine-panel .app-results {
  --ad-columns: 2;
  margin-top: 0.4rem;
}
.mine-panel h3 {
  font-size: 0.95rem;
  font-weight: 700;
}
.mine-panel .fields {
  margin-top: 0.4rem;
}
.mine-panel .field-row {
  font-size: 0.9rem;
}

/* A campaign: an intermediary looking for the other side of one desire. A rule on its left sets it apart from the desire's own actions. */
.mine-campaigns {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.7rem;
}
.campaign {
  padding: 0.1rem 0 0.1rem 0.8rem;
  border-left: 3px solid var(--rule);
}
.campaign[data-status="proposed"],
.campaign[data-status="running"] {
  border-left-color: var(--marker);
}
.campaign h3 {
  font-size: 0.95rem;
  font-weight: 700;
}
.campaign code {
  font-size: 0.82rem;
}
.campaign-fee {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.3rem;
}
.campaign-state {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}
.campaign .record-actions {
  margin-top: 0.5rem;
}
.campaign .record-status:empty {
  display: none;
}
.event-body > .campaign {
  margin-top: 0.6rem;
}

/* ---------- Inbox ---------- */
.events {
  border-top: 1px solid var(--ink);
}
.event {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0 var(--gutter);
  padding: 1rem 0 1.1rem;
  border-bottom: 1px solid var(--rule);
}
.event.is-new {
  animation: ad-arrive 1.6s var(--ease-out);
}
.event-when {
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.event-type {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink);
}
.event-body {
  min-width: 0;
}
.event-body > p {
  max-width: 44rem;
}
.event-body > p + p,
.event-body > .ad-block,
.event-body > .contact-card,
.event-body > .record-actions,
.event-body > .reveal-panel {
  margin-top: 0.6rem;
}
.event-body .ad-block {
  max-width: 34rem;
  border: 1px solid var(--rule);
}
.event-quote {
  padding: 0.5rem 0.8rem;
  border-left: 3px solid var(--ink);
  font-size: 1rem;
  font-weight: 500;
  max-width: 40rem;
}
.event-body .contact-card {
  max-width: 34rem;
}
.event-state {
  font-weight: 600;
}
.event-state.is-approved {
  color: var(--sealed);
}
.empty {
  padding: 2rem 0 3rem;
  max-width: 40rem;
  color: var(--ink-soft);
}
.empty a {
  color: var(--ink);
}

/* ---------- Threads: the sealed conversation ---------- */
.thread {
  max-width: 44rem;
  padding: 0.9rem 1rem 1rem 1.1rem;
  border-left: 4px solid var(--sealed);
  background: rgb(14 75 79 / 0.06);
  font-size: 0.95rem;
}
.event-panel:not(:empty) {
  margin-top: 0.7rem;
}
.thread-with {
  font-weight: 700;
}
.thread-with code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 500;
}
.thread-state {
  margin-left: 0.6em;
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 0.7rem;
  color: var(--ink-soft);
}
.thread-sealed {
  margin-top: 0.2rem;
  color: var(--ink-soft);
}
.thread-sealed .scope {
  margin-left: 0;
  margin-right: 0.3em;
}
/* Their contact: a row like the contact card's, the label in mono, then the bar, then the words. */
.thread-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
  margin-top: 0.4rem;
  color: var(--ink-soft);
}
.thread-contact-label {
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 0.7rem;
  color: var(--sealed);
}
.thread-contact .redact {
  font-size: 0.72rem;
  padding: 0 0.6em;
}
.thread-report:not(:empty) {
  margin-top: 0.8rem;
}
.report-form {
  padding: 0.8rem 0.9rem 0.9rem;
  border: 1px solid var(--sealed);
  background: var(--paper);
}
.report-form h3 {
  font-size: 0.95rem;
  font-weight: 700;
}
.report-form label.stack {
  margin-top: 0.6rem;
}
.report-form .record-actions {
  margin-top: 0.6rem;
}
.thread-head .contact-card {
  max-width: 30rem;
}
.thread-messages {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  border-top: 1px solid var(--sealed);
}
.msg {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0 0.9rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}
.msg-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 0.68rem;
  line-height: 1.7;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.msg-who {
  color: var(--ink);
  font-weight: 700;
}
.msg.is-mine .msg-who {
  color: var(--marker);
}
.msg.is-system .msg-who,
.msg.is-system .msg-text {
  color: var(--ink-soft);
}
.msg.is-system .msg-text {
  font-size: 0.85rem;
}
.msg.is-system .msg-text::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.5em;
  background: var(--sealed);
  vertical-align: 0.1em;
}
.msg-text {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.msg-text .redact {
  font-size: 0.8rem;
}
.thread-empty {
  padding: 0.6rem 0;
}
.thread-compose {
  margin-top: 0.8rem;
}
.thread-compose label.stack textarea {
  border-color: var(--sealed);
  resize: vertical;
}
.thread-compose label.stack textarea:focus-visible {
  outline-color: var(--sealed);
}
.thread-compose .record-actions {
  margin-top: 0.6rem;
}
.thread + .record-status:not(:empty) {
  margin-top: 0.4rem;
}
.thread-list {
  margin-top: 0.5rem;
}
.thread-item + .thread-item {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--rule);
}
.thread-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
}
.thread-row code {
  font-size: 0.82rem;
}

/* ---------- Watches ---------- */
.watch-status:empty {
  display: none;
}
/* An empty status line takes no room, so the rule under the head is the only rule above a list. A list that holds only its empty note draws no rule of its own. */
.view:not(#view-search) > .search-status:empty {
  display: none;
}
.view-head ~ .search-status:empty + :is(.mine-list, .events, .watches),
:is(.mine-list, .events, .watches):has(> .empty) {
  border-top: 0;
}
.watches {
  border-top: 1px solid var(--ink);
}
.watch {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0 var(--gutter);
  padding: 1rem 0 1.1rem;
  border-bottom: 1px solid var(--rule);
}
.watch-when {
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.watch-hits {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink);
}
.watch-body {
  min-width: 0;
}
.watch-body > p {
  max-width: 44rem;
}
.watch-body > p + p {
  margin-top: 0.3rem;
}
.watch-query {
  font-size: 1.1rem;
  font-weight: 700;
}
.watch-body .record-actions {
  margin-top: 0.6rem;
}

/* ---------- Keys ---------- */
.keys-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}
.keys-col:first-child {
  padding-right: var(--gutter);
}
.keys-col:last-child {
  padding-left: var(--gutter);
  border-left: 1px solid var(--ink);
}
.keys-col h2 {
  font-size: 1.02rem;
  font-weight: 700;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--ink);
}
.keys-col h2 + p,
.keys-col p + p {
  margin-top: 0.6rem;
}
.keys-col h2:not(:first-child) {
  margin-top: 2.2rem;
}
.keys-col p {
  max-width: 40rem;
}
.keys-facts .field-row {
  grid-template-columns: 6rem minmax(0, 1fr);
}
.keys-facts dd {
  overflow-wrap: anywhere;
}
.keys-facts code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}
.profile-form {
  margin-top: 1.4rem;
}
.profile-form .record-actions {
  margin-top: 0.6rem;
}
.import-form {
  margin-top: 0.8rem;
}
.import-form textarea {
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 0.78rem;
}
.import-form .record-actions {
  margin-top: 0.6rem;
}
.file-button {
  position: relative;
  cursor: pointer;
}
/* The file input is hidden to the eye and stays in the tab order, so the label shows its focus. */
.file-button:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.keys-col .record-actions {
  margin-top: 0.9rem;
}

/* ---------- Search form extras ---------- */
.app-search {
  flex-wrap: wrap;
}
/* The nine filters after the place. Wider than a phone they are open, and the summary is gone. */
.search-filters {
  flex: 1 1 100%;
  border-top: 1px solid var(--ink);
}
.search-filters summary {
  display: none;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.search-filters summary::-webkit-details-marker {
  display: none;
}
.search-filters summary::before {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-right: 0.6em;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: translateY(-0.15em) rotate(45deg);
}
.search-filters[open] summary::before {
  transform: translateY(0.05em) rotate(225deg);
}
.search-filters[open] .when-closed,
.search-filters:not([open]) .when-open {
  display: none;
}
.search-filter-row {
  display: flex;
  flex-wrap: wrap;
}
.app-search .field {
  min-width: 9rem;
  border-bottom: 1px solid var(--ink);
}
.app-search .field.narrow {
  min-width: 6.5rem;
  flex: 0 1 8rem;
}
/* Every line of filters fills the width, so no empty bordered cell closes a line at any width. */
.app-search .search-filter-row > .field {
  flex-grow: 1;
}
.app-search .field.grow {
  flex: 1 1 22rem;
}
.app-search .check-field .check-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  padding-top: 0.15rem;
}
.app-search .check-field input {
  width: auto;
  accent-color: var(--ink);
}
.app-search .button {
  flex: 0 0 auto;
  min-width: 9rem;
}

/* ---------- Narrow screens ---------- */
@media (max-width: 1180px) {
  .app-results {
    --ad-columns: 2;
  }
}
@media (max-width: 900px) {
  .view-head,
  .keys-grid,
  .mine-item {
    grid-template-columns: minmax(0, 1fr);
  }
  /* One column reads: the sentence, the record it becomes, the contact, then the post. The rows the server left empty fold away, so the contact and Post stay near the record. */
  #post-form > :not(.slip) {
    grid-column: auto;
    padding-right: 0;
  }
  #post-form > .slip {
    grid-column: auto;
    grid-row: auto;
  }
  .edit-more {
    display: block;
  }
  .edit-fields.is-folded .field-row[data-fold] {
    display: none;
  }
  .view-head h1 {
    padding-right: 0;
    margin-bottom: 0.8rem;
  }
  .view-intro,
  .keys-col:last-child,
  .mine-side {
    padding-left: 0;
    border-left: 0;
  }
  .keys-col:first-child {
    padding-right: 0;
  }
  .keys-col:last-child {
    margin-top: 2.2rem;
  }
  .mine-item > .ad {
    padding-right: 0;
    padding-bottom: 0.3rem;
  }
  .mine-side {
    padding-top: 0.2rem;
  }
  .event,
  .watch {
    grid-template-columns: minmax(0, 1fr);
  }
  .watch-when {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    margin-bottom: 0.4rem;
  }
  .watch-hits {
    margin-top: 0;
  }
  .event-when {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    margin-bottom: 0.4rem;
  }
  .event-type {
    margin-top: 0;
  }
}
@media (max-width: 640px) {
  .app-nav {
    width: 100%;
  }
  .masthead nav.app-nav ul {
    gap: 0.1rem 1.2rem;
  }
  .app-nav .away {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
  /* The front page drops its in-page links on a phone. Here they are the app's navigation, so they stay. */
  .masthead nav.app-nav li:has(a[href^="#"]):not(:has(a[href="#start"])) {
    display: block;
  }
  .app-line > :nth-child(n + 3) {
    display: inline;
  }
  .app-line > * + * {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
  .app-line #backup-note {
    display: block;
    width: 100%;
    margin-top: 0.15rem;
  }
  .view-head h1 {
    font-size: 13vw;
  }
  .app-results {
    --ad-columns: 1;
  }
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .edit-fields .field-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .edit-fields .field-row dt {
    line-height: 1.4;
  }
  .mine-panel .app-results {
    --ad-columns: 1;
  }
  .app-search .field,
  .app-search .field.narrow {
    flex: 1 1 45%;
    min-width: 0;
  }
  .app-search .field.grow,
  .app-search > .field {
    flex-basis: 100%;
    border-right: 0;
  }
  .app-search .button {
    flex-basis: 100%;
  }
  .msg {
    grid-template-columns: minmax(0, 1fr);
  }
  .msg-meta {
    flex-direction: row;
    gap: 0.7rem;
  }
  .search-filters summary {
    display: block;
  }
  .search-filters:not([open]) {
    border-bottom: 0;
  }
}
