:root {
  --ink: #20242a;
  --muted: #646d78;
  --line: #cfd6da;
  --paper: #f4f0e8;
  --panel: #ffffff;
  --surface-sidebar: #e7dccb;
  --surface-topbar: rgba(250, 247, 239, 0.94);
  --surface-list: #ebf3f1;
  --surface-detail: #fffaf1;
  --surface-raised: #ffffff;
  --surface-muted: #f7f4ed;
  --surface-active: #dbeceb;
  --accent: #2f6f73;
  --accent-dark: #204d50;
  --warm: #b95f3b;
  --soft: #e1efed;
  --shadow: 0 18px 40px rgba(20, 28, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(rgba(244, 240, 232, 0.64), rgba(244, 240, 232, 0.88)),
    url("https://images.unsplash.com/photo-1511988617509-a57c8a288659?auto=format&fit=crop&w=1600&q=80")
      center/cover;
}

.auth-panel {
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: center;
  padding: 42px;
  background: linear-gradient(90deg, rgba(255, 250, 241, 0.94) 0 52%, rgba(235, 246, 244, 0.94) 52% 100%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.auth-panel > div:first-child {
  grid-row: 1 / span 2;
}

.auth-panel > * {
  min-width: 0;
}

.auth-tabs,
.auth-panel .login-form {
  grid-column: 2;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--warm);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.auth-panel h1,
.brand-block h1 {
  margin-bottom: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.auth-panel h1 {
  font-size: 4.6rem;
  line-height: 0.95;
}

.lede {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 520px;
}

.login-form,
.modal-panel {
  display: grid;
  gap: 12px;
}

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

.auth-tab {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.auth-tab.active {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent-dark);
}

.field-block {
  display: grid;
  gap: 12px;
}

.field-block .field-block {
  gap: 8px;
}

label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

select {
  cursor: pointer;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 115, 0.14);
}

button[type="submit"],
#newArticleButton {
  min-height: 44px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 0 18px;
}

button[type="submit"]:hover,
#newArticleButton:hover {
  background: var(--accent-dark);
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: #a53c2f;
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 20px;
  border-right: 1px solid var(--line);
  background: var(--surface-sidebar);
}

.brand-block h1 {
  font-size: 2.1rem;
  line-height: 1;
}

.nav-stack {
  display: grid;
  gap: 6px;
}

.nav-item,
.quiet-button,
.user-block button,
.secondary-button,
.icon-button {
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.nav-item {
  padding: 11px 12px;
  font-weight: 800;
}

.nav-item.active,
.nav-item:hover {
  background: var(--surface-raised);
  box-shadow: inset 3px 0 0 var(--accent);
}

.quiet-button,
.user-block button {
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  font-weight: 800;
}

.user-block {
  margin-top: auto;
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-row,
.approval-user {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
}

.profile-avatar img,
img.profile-avatar {
  object-fit: cover;
}

.small-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.82rem;
}

.link-button {
  margin-top: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 850;
}

.content-shell {
  min-width: 0;
  background: var(--surface-detail);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-topbar);
  backdrop-filter: blur(10px);
}

.search-wrap {
  display: grid;
  gap: 6px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  min-height: calc(100vh - 91px);
}

.article-list-panel {
  border-right: 1px solid var(--line);
  background: var(--surface-list);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding: 22px 20px 12px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.1rem;
}

#resultCount {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.group-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 14px;
}

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.chip.active {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent-dark);
}

.member-options,
.selected-members,
.selected-tags,
.tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.selected-members:empty,
.selected-tags:empty,
.member-options:empty,
.tag-suggestions:empty {
  display: none;
}

.member-choice,
.selected-member,
.tag-choice,
.selected-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.member-choice,
.tag-choice {
  background: #fff;
  color: var(--muted);
}

.member-choice.active,
.selected-member,
.tag-choice.active,
.selected-tag {
  border-color: var(--accent);
  background: #e7f1f2;
  color: #24585c;
}

.tag-choice.active,
.selected-tag {
  background: #f2eee7;
  color: #654f3f;
}

.selected-member,
.selected-tag {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.remove-member,
.remove-tag {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(36, 88, 92, 0.12);
  color: #24585c;
  line-height: 1;
}

.remove-tag {
  background: rgba(101, 79, 63, 0.12);
  color: #654f3f;
}

.add-member-row,
.tag-entry-row,
.date-entry-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.date-entry-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.date-entry-row > div {
  display: grid;
  gap: 8px;
}

.article-list {
  display: grid;
}

.timeline-year-heading {
  position: sticky;
  top: 91px;
  z-index: 1;
  padding: 14px 20px 8px;
  border-top: 1px solid var(--line);
  background: var(--surface-list);
}

.timeline-year-heading span {
  color: var(--warm);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-card {
  display: grid;
  width: 100%;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.article-card:hover,
.article-card.active {
  background: var(--surface-active);
}

.article-card h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.25;
}

.article-card-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.article-card-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.article-card-topic {
  margin: 0 0 5px;
  color: var(--warm);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.article-card-count {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.article-card-excerpt {
  margin: 0;
  color: #38424c;
  line-height: 1.55;
}

.article-card-meta,
.match-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.article-card-tags {
  margin-top: 1px;
}

.match-row span {
  border-radius: 999px;
  background: #fff7d6;
  color: #705a10;
  padding: 4px 8px;
}

.search-highlight {
  border-radius: 3px;
  background: #ffe987;
  color: inherit;
  padding: 0 2px;
}

.meta-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.tag {
  border-radius: 999px;
  background: #edf0f3;
  color: #4d5965;
  padding: 4px 8px;
  font-weight: 750;
}

.topic-tag {
  background: #f2eee7;
  color: #654f3f;
}

.person-tag {
  background: #e7f1f2;
  color: #24585c;
}

.article-detail {
  min-width: 0;
  padding: 34px clamp(22px, 5vw, 64px);
  background: var(--surface-detail);
}

.article-detail h2 {
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.2rem;
  line-height: 1.05;
}

.detail-heading {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.detail-title-row,
.entry-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.detail-actions,
.utility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.detail-title-row h2 {
  margin: 0;
}

.compact-button,
.text-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.compact-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
}

.back-to-list-button {
  display: none;
}

.text-button {
  padding: 7px 10px;
  font-size: 0.82rem;
}

.compact-button:hover,
.text-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.danger-button {
  border-color: #d9aaa2;
  color: #9d382e;
}

.danger-button:hover {
  border-color: #9d382e;
  color: #7f2e27;
}

.detail-meta {
  margin-bottom: 22px;
}

.memory-entry {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.memory-entry h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.entry-tools,
.entry-actions,
.annotation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.entry-actions {
  justify-content: flex-end;
}

.memory-entry p {
  color: #333a42;
  line-height: 1.78;
  white-space: pre-wrap;
}

.memory-body {
  user-select: text;
}

.annotation-mark {
  border-radius: 3px;
  padding: 1px 2px;
  cursor: text;
  pointer-events: none;
  user-select: text;
}

.note-mark {
  background: #fff0b8;
}

.suggestion-mark {
  background: #dcefe6;
}

.annotation-card {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.annotation-viewer-content {
  display: grid;
  gap: 10px;
}

.annotation-card.closed {
  background: var(--surface-muted);
}

.annotation-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.annotation-type,
.annotation-status,
.suggestion-preview span,
.selected-quote-block span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.annotation-status {
  color: var(--accent-dark);
}

.annotation-meta,
.annotation-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.annotation-card blockquote,
.suggestion-preview,
.selected-quote-block {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--soft);
}

.annotation-card blockquote,
.suggestion-preview p,
.selected-quote-block p {
  color: #333a42;
  line-height: 1.55;
  white-space: pre-wrap;
}

.suggestion-preview {
  border-left-color: var(--warm);
  background: #fbf3ee;
}

.suggestion-preview p,
.selected-quote-block p {
  margin: 5px 0 0;
}

.contribution-form {
  display: grid;
  gap: 10px;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.utility-view {
  display: grid;
  gap: 16px;
}

.utility-view h2,
.person-page h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3rem;
  line-height: 1.05;
}

.person-page {
  display: grid;
  gap: 18px;
}

.person-page-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

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

.person-stat {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.person-stat strong {
  font-size: 1.65rem;
  line-height: 1;
}

.person-stat span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.person-page-section {
  display: grid;
  gap: 10px;
}

.person-page-section h3 {
  margin: 0;
}

.person-memory-list {
  display: grid;
  gap: 10px;
}

.person-memory-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.utility-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.utility-list {
  display: grid;
  gap: 10px;
}

.utility-section {
  display: grid;
  gap: 10px;
}

.utility-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.utility-section-heading h3 {
  margin: 0;
}

.utility-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.utility-card.unread {
  border-color: var(--accent);
  background: var(--soft);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.legacy-link-actions {
  align-items: stretch;
}

.legacy-link-actions select {
  min-width: 190px;
}

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

.tag-management-panel {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.tag-management-panel h4 {
  margin: 0;
}

.tag-management-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.admin-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.managed-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.managed-tag {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px 7px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.managed-tag-actions {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.rename-stored-tag-button {
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 850;
}

.remove-stored-tag-button {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(157, 56, 46, 0.12);
  color: #9d382e;
  line-height: 1;
}

.utility-card h3 {
  margin-bottom: 6px;
}

.utility-card p {
  margin-bottom: 6px;
  color: #333a42;
  line-height: 1.5;
}

.utility-card span,
.utility-section-heading span,
.utility-actions span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.role-note {
  justify-self: end;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
}

.empty-state {
  padding: 32px 20px;
  color: var(--muted);
  line-height: 1.6;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(18, 24, 31, 0.48);
}

.modal-panel {
  width: min(720px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-heading,
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.modal-heading h2 {
  margin: 0;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid var(--line);
}

.secondary-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  font-weight: 800;
}

@media (max-width: 1180px) {
  .workspace {
    display: block;
    min-height: calc(100vh - 91px);
  }

  .article-list-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-shell:not(.detail-open):not(.utility-view-active) .article-detail,
  .app-shell.detail-open .article-list-panel,
  .app-shell.utility-view-active .article-list-panel {
    display: none;
  }

  .back-to-list-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    margin-bottom: 2px;
  }

  .article-detail {
    padding: 30px 38px 42px;
  }

  .article-detail h2,
  .utility-view h2,
  .person-page h2 {
    font-size: 2.65rem;
    line-height: 1.08;
  }
}

@media (max-width: 920px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-block h1 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1.08;
  }

  .brand-block .eyebrow {
    margin-bottom: 4px;
  }

  .nav-stack {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.74);
    white-space: nowrap;
  }

  .nav-item.active,
  .nav-item:hover {
    border-color: var(--accent);
    background: var(--soft);
    box-shadow: none;
  }

  .quiet-button {
    min-height: 44px;
    text-align: center;
  }

  .user-block {
    grid-column: 1 / -1;
    margin-top: 0;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
  }

  #signedInAs {
    display: block;
    max-width: min(560px, calc(100vw - 160px));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar {
    gap: 12px;
    padding: 14px 16px;
  }

  .workspace {
    min-height: auto;
  }

  .article-detail {
    padding: 24px 18px 34px;
  }

  .timeline-year-heading {
    top: 0;
  }

  .article-detail h2,
  .utility-view h2,
  .person-page h2 {
    font-size: 2.15rem;
    line-height: 1.08;
  }

  .panel-heading {
    padding: 18px 16px 10px;
  }

  .group-filters {
    padding: 0 16px 12px;
  }

  .article-card {
    padding: 17px 16px;
  }

  .compact-button,
  .text-button,
  .chip {
    min-height: 44px;
  }

  .text-button {
    padding: 10px 12px;
  }
}

@media (max-width: 760px) {
  .auth-panel {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px;
    background: linear-gradient(180deg, rgba(255, 250, 241, 0.94) 0 45%, rgba(235, 246, 244, 0.94) 45% 100%);
  }

  .auth-panel > div:first-child,
  .auth-tabs,
  .auth-panel .login-form {
    grid-column: auto;
    grid-row: auto;
  }

  .auth-panel h1 {
    font-size: 3.4rem;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  #newArticleButton {
    width: 100%;
  }

  .detail-title-row,
  .entry-heading,
  .person-page-heading,
  .utility-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-actions,
  .entry-actions,
  .account-actions {
    justify-content: flex-start;
  }

  .account-actions .text-button {
    flex: 1 1 130px;
    text-align: center;
  }

  .legacy-link-actions select {
    flex: 1 1 180px;
    min-width: 0;
  }

  .tag-management-grid {
    grid-template-columns: 1fr;
  }

  .add-member-row,
  .tag-entry-row,
  .date-entry-row {
    grid-template-columns: 1fr;
  }

  .person-stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .auth-shell {
    min-height: 100svh;
    place-items: stretch;
    padding: 0;
  }

  .auth-panel {
    width: 100%;
    min-height: 100svh;
    align-content: center;
    border: 0;
    padding: 22px;
  }

  .auth-panel h1 {
    max-width: 8.4ch;
    font-size: 2.65rem;
    line-height: 1;
  }

  .lede {
    font-size: 1rem;
    line-height: 1.55;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .quiet-button {
    width: 100%;
  }

  .user-block {
    display: grid;
    align-items: stretch;
  }

  #signedInAs {
    max-width: calc(100vw - 96px);
  }

  .article-detail {
    padding: 20px 16px 30px;
  }

  .article-detail h2,
  .utility-view h2,
  .person-page h2 {
    font-size: 1.9rem;
  }

  .article-card-heading {
    grid-template-columns: 1fr;
  }

  .article-card-count {
    width: max-content;
  }

  .modal {
    padding: 0;
    place-items: stretch;
  }

  .modal-panel {
    width: 100%;
    min-height: 100svh;
    max-height: 100svh;
    border-radius: 0;
    padding: 18px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal-actions button {
    width: 100%;
  }

  .utility-section-heading {
    display: grid;
    gap: 4px;
  }

  .tag-management-heading {
    display: grid;
    justify-content: stretch;
  }

  .tag-management-heading .text-button,
  .admin-action-row .text-button {
    width: 100%;
  }
}
