body:has(dialog[open]) { overflow: hidden; }

:where(.icon) {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex: none;
}

.button-outline { display: inline-flex; align-items: center; gap: .5rem; justify-content: center; min-height: 42px; border: 1px solid var(--form-input-border, #c9c1ce); border-radius: var(--form-radius, 8px); background: var(--white); padding: .5rem .9rem; color: var(--plum); font-size: .86rem; font-weight: 630; }
.button-outline:hover { background: var(--mist); }
.button-primary { background: var(--plum); color: var(--white); justify-self: start; min-height: 43px; border: 1px solid var(--plum); border-radius: var(--form-radius, 8px); padding: .52rem .9rem; font-size: .86rem; font-weight: 650; }
.button-primary:hover { background: var(--form-accent-hover, #493954); }
.button-primary:disabled, .button-outline:disabled { opacity: .68; cursor: wait; }

.card-meta { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.card-meta time { white-space: nowrap; }

:where(#post-dialog, .settings-dialog, .compose-dialog, .admin-dialog) {
  width: min(720px, 100% - 32px);
  max-height: min(90dvh, 100% - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--form-dialog-radius, 16px);
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--form-shadow, 0 22px 80px #19132155);
}
:where(#post-dialog, .settings-dialog, .compose-dialog, .admin-dialog)::backdrop { background: rgb(33 24 43 / 64%); }
.dialog-top { position: sticky; z-index: 1; top: 0; background: var(--white); display: flex; justify-content: space-between; align-items: center; padding: .65rem clamp(1.1rem, 4vw, 2.25rem); border-bottom: 1px solid var(--line); font-size: .9rem; font-weight: 680; }
.icon-button { display: grid; place-items: center; border: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--paper); }
.icon-button:hover { background: var(--mist); }
.post-detail h1, .post-detail h2, .submission-preview-post h3 { margin: .63rem 0 1rem; font: 400 clamp(2rem, 5vw, 3.25rem)/1.02 var(--display); letter-spacing: -.035em; overflow-wrap: anywhere; }
.detail-image { border-radius: var(--form-radius, 9px); max-height: 56vh; width: 100%; object-fit: contain; background: var(--paper); margin-bottom: 1.05rem; }
.post-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.post-text a { color: var(--form-text-link, #5d3f77); text-decoration: underline; text-underline-offset: .17em; }
.post-text a:hover { color: var(--plum); }
.detail-block { border-radius: var(--form-radius, 8px); background: var(--paper); margin-block: .85rem; padding: .8rem 1rem; }
.detail-block h3 { font-size: 1rem; margin-bottom: .3rem; }
.detail-block ul { padding-left: 1.35rem; margin-block: .4rem 0; }
.detail-block time, .event-place { display: block; }
.event-calendar { display: inline-block; padding-block: .45rem; color: var(--plum); font-size: .88rem; font-weight: 650; text-decoration: underline; text-underline-offset: .18em; }
.event-editor { border-block: 1px solid var(--line); min-width: 0; }
.event-editor summary { cursor: pointer; padding: .75rem 0; font-size: .88rem; font-weight: 650; }
.event-fields { display: grid; gap: .7rem; padding-bottom: .85rem; min-width: 0; }
.event-fields input { min-width: 0; max-width: 100%; }
.settings-dialog { width: min(485px, 100% - 32px); }
.settings-body { padding: 1.4rem clamp(1.1rem, 4vw, 2.25rem) 1.85rem; }
.settings-body h2 { font: 400 clamp(2rem, 6vw, 2.8rem)/1.02 var(--display); letter-spacing: -.035em; }
.settings-form { display: grid; gap: .9rem; margin-top: 1rem; }
.settings-form p { color: var(--muted); font-size: .91rem; overflow-wrap: anywhere; }
.field { display: grid; gap: .28rem; font-size: .85rem; font-weight: 670; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 43px; padding: .5rem .7rem; border: 1px solid var(--form-input-border, #ccc3cf); border-radius: var(--form-radius, 7px);
  background: var(--white); color: var(--ink); font-size: 1rem; font-weight: 400;
}
.frequencies { display: grid; gap: .38rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.frequencies legend { padding: 0 0 .45rem; font-size: .85rem; font-weight: 670; }
.frequency {
  display: flex; align-items: center; gap: .6rem; min-height: 52px; padding: .46rem .62rem;
  border: 1px solid var(--line); border-radius: var(--form-radius, 7px); cursor: pointer;
}
.frequency:hover { border-color: var(--form-choice-border, #b8adc0); }
.frequency:has(input:checked) { background: var(--mist); border-color: var(--form-choice-border, #b8adc0); }
.frequency input { flex: none; margin: 0; accent-color: var(--plum); }
.frequency span { display: grid; }
.frequency strong { font-size: .86rem; }
.frequency small { font-size: .78rem; color: var(--muted); }
.mail-topics { min-width: 0; margin: 0; padding: 0; border: 0; }
.mail-topics legend { padding: 0 0 .4rem; font-size: .85rem; font-weight: 670; }
.topic-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem; }
.topic-choice { display: flex; align-items: center; gap: .42rem; min-height: 34px; padding: .25rem .42rem; font-size: .79rem; cursor: pointer; border-radius: var(--form-radius, 6px); }
.topic-choice:has(input:checked) { background: var(--mist); }
.topic-choice:has(input:disabled) { color: var(--muted); cursor: default; }
.topic-choice input { flex: none; margin: 0; accent-color: var(--plum); }
.topic-all { margin-bottom: .3rem; font-weight: 650; }
.settings-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.subscription-end-options { padding-top: .4rem; border-top: 1px solid var(--line); }
.subscription-end-options .button-link { color: var(--muted); font-weight: 500; }
.button-link { justify-self: start; min-height: 42px; padding: .4rem .25rem; border: 0; background: transparent; color: var(--plum); font-size: .86rem; font-weight: 630; text-decoration: underline; text-underline-offset: .17em; }
.button-link:hover { color: var(--form-accent-hover, #69508d); }
.button-danger-link, .button-danger-link:hover { color: #a23339; }
.button-danger { background: #a23339; border-color: #a23339; }
.button-danger:hover { background: #81292f; border-color: #81292f; }
.form-status { margin-top: .85rem; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.form-status:empty { margin: 0; }
.form-status.form-error { color: #a23339; }
.field textarea { resize: vertical; }
.post-edit-form .field { min-width: 0; }
.published-article-editor { margin-block: 1rem; font-family: var(--sans, sans-serif); }
.published-article-editor .post-edit-form { margin-bottom: 1.5rem; }
.field-hint { margin-top: -.55rem; font-size: .78rem; color: var(--muted); }
.compose-dialog { width: min(620px, 100% - 32px); }
.writing-assistant { min-width: 0; padding: .2rem .85rem; border-radius: var(--form-radius, 7px); background: var(--paper); }
.writing-assistant summary { padding: .55rem 0; cursor: pointer; font-weight: 650; font-size: .9rem; }
.writing-tools, .writing-result { display: grid; gap: .65rem; min-width: 0; }
.writing-tools { padding: .15rem 0 .65rem; }
.writing-tools > button { justify-self: start; }
.writing-tools .form-status { margin: 0; }
.writing-tools .form-status:empty { display: none; }
.writing-result { padding: .9rem; border: 1px solid var(--line); border-radius: var(--form-radius, 7px); background: var(--white); }
.writing-result h3 { margin: 0; color: var(--muted); font-size: .83rem; }
.writing-result h4 { margin: 0; font: 600 1.35rem/1.2 var(--display); overflow-wrap: anywhere; }
.writing-result ul { margin: .25rem 0 0; padding-inline-start: 1.25rem; }
.writing-result a { color: var(--form-text-link, #5d3f77); text-decoration: underline; overflow-wrap: anywhere; }
.writing-result strong, #writing-note { font-size: .85rem; }
#reporter-tools small, #reporter-note { color: var(--muted); font-size: .8rem; }
#reporter-tools p, #reporter-loading { margin-block: .15rem; }
#reporter-tools a { color: var(--form-text-link, var(--plum)); text-decoration: underline; }
#reporter-playback :is(audio, video) { display: block; width: 100%; max-height: 13rem; }
#reporter-filename { overflow-wrap: anywhere; font-size: .85rem; }
.reporter-consent { display: flex; align-items: flex-start; gap: .5rem; line-height: 1.45; font-size: .85rem; }
.reporter-consent input { flex: none; margin-top: .22rem; accent-color: var(--plum); }
.reporter-frames { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(6.5rem, 100%), 1fr)); gap: .5rem; }
.reporter-frame { display: grid; align-content: start; gap: .25rem; cursor: pointer; font-size: .78rem; }
.reporter-frame img { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: var(--paper); }
.reporter-frame input { accent-color: var(--plum); }
.reporter-frame:has(input:checked) img { outline: 2px solid var(--plum); outline-offset: -2px; }
.link-photo { display: grid; gap: .5rem; min-width: 0; padding: .75rem; border: 1px solid var(--line); border-radius: var(--form-radius, 7px); }
.link-photo img { width: auto; max-width: 100%; height: auto; max-height: 110px; justify-self: start; }
.link-photo button { justify-self: start; }
.submission-preview-post { padding: clamp(1rem, 4vw, 1.5rem); border: 1px solid var(--line); border-radius: var(--form-radius, 9px); }
#submission-preview:not([hidden]) ~ .own-submissions { display: none; }
.admin-dialog { width: min(860px, 100% - 32px); }
.own-submissions { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.own-submissions h3, .review-card h3 { font-size: 1rem; }
.admin-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.admin-tools [aria-pressed=true] { background: var(--plum); color: var(--white); border-color: var(--plum); }
#admin-refresh { margin-inline-start: auto; }
.admin-panel { display: grid; gap: .7rem; margin-top: 1rem; }
.admin-note { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.review-card { display: grid; gap: .6rem; padding: .8rem; border: 1px solid var(--line); border-radius: var(--form-radius, 9px); }
.review-image { width: min(100%, 380px); max-height: 230px; object-fit: contain; object-position: left; border-radius: var(--form-radius, 6px); }
.review-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.queue-meter { display: grid; gap: .4rem; padding: .8rem; border-radius: var(--form-radius, 8px); background: var(--mist); color: var(--plum); }
.queue-meter progress { width: 100%; height: 10px; accent-color: var(--plum); }
.queue-meter span { font-size: .82rem; }
.queue-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; margin: 0; }
.queue-counts-limited { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.queue-counts div { padding: .5rem; background: var(--paper); border-radius: var(--form-radius, 6px); }
.queue-counts dt { font-size: .78rem; }
.queue-counts dd { margin: 0; font-weight: 680; }
.queue-lines { padding: 0; margin: .2rem 0 0; list-style: none; }
.queue-lines li { display: grid; gap: .13rem; padding: .55rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; font-size: .9rem; }
.queue-lines small { color: var(--muted); }
.queue-lines a { text-decoration: underline; }
.admin-load-more { justify-self: start; }
.user-tools, .user-page, .user-row { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.user-tools .field { flex: 1 1 12rem; }
.user-tools { align-items: end; }
.user-list { padding: 0; margin: 0; list-style: none; }
.user-row { justify-content: space-between; border-bottom: 1px solid var(--line); padding: .65rem 0; }
.user-row div { flex: 1 1 11rem; min-width: 0; overflow-wrap: anywhere; }
.user-row small, .user-row strong { display: block; }
.user-row small { color: var(--muted); }
.user-page { justify-content: space-between; }

@media (max-width: 570px) {
  .card-meta { font-size: .72rem; }
  .queue-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .topic-choices { grid-template-columns: 1fr; gap: 0; }
}

/* The newspaper uses its own ink colors and typography for the shared forms. */
.newspaper {
  --display: var(--serif);
  --body: var(--sans);
  --plum: var(--accent);
  --mist: #eee7da;
  --white: #fffdf7;
  --form-input-border: #aaa496;
  --form-choice-border: #987766;
  --form-accent-hover: #632a21;
  --form-text-link: var(--accent);
  --form-dialog-radius: 0;
  --form-radius: 2px;
  --form-shadow: 0 14px 52px rgb(47 40 27 / 22%);
}
.newspaper :is(.settings-dialog, .compose-dialog, .admin-dialog)::backdrop { background: rgb(29 25 20 / 55%); }
.newspaper :is(.settings-dialog, .compose-dialog, .admin-dialog) {
  font: 400 1rem/1.5 var(--body);
  border-top: 3px double var(--ink);
}
.newspaper .dialog-top { color: var(--muted); }
.newspaper .settings-body h2 { font-weight: 600; }
.newspaper .settings-form input, .newspaper .settings-form select, .newspaper .settings-form textarea { font-family: var(--body); }
.newspaper dialog :is(input, select, textarea, button, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.newspaper .field { min-width: 0; }
.newspaper .queue-counts dt { overflow-wrap: anywhere; }

.editorial-section > summary, .editorial-section details > summary { cursor: pointer; font-weight: 650; padding: .5rem 0; }
.editorial-section .settings-actions { align-items: end; }
.editorial-section .review-card { margin-block: .65rem; }
.editorial-section a { text-decoration: underline; text-underline-offset: .15em; overflow-wrap: anywhere; }
.editorial-links { list-style: none; padding: 0; margin: .6rem 0; }
.editorial-links li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.editorial-links small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.editorial-links input { margin-right: .5rem; }
.editorial-evidence { display: grid; gap: .6rem; }
.editorial-source { min-width: 0; display: grid; gap: .55rem; padding: .75rem; border: 1px solid var(--line); }
.editorial-source legend { padding-inline: .25rem; }
.editorial-form .button-outline { justify-self: start; }
