:root {
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-alt: #ffffff;
  --surface-muted: #ffffff;
  --text: #15171a;
  --text-soft: #2e3238;
  --muted: #5f6670;
  --border: #d9dadc;
  --border-strong: #c9cbcf;
  --brand: #b23a22;
  --brand-strong: #8a2b1e;
  --brand-deep: #5a1d12;
  --brand-soft: #fdf4f1;
  --link: #1d4ed8;
  --link-hover: #1e3a8a;
  --brand-ink: #ffffff;
  --focus: #a83324;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.75rem;
  --radius-sm: 0.25rem;
  --radius: 0.25rem;
  --radius-lg: 0.4rem;
  --shadow-sm: 0 1px 2px rgba(20, 20, 18, 0.08);
  --shadow: 0 1px 2px rgba(20, 20, 18, 0.04);
  --font-base: "IBM Plex Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-base);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-underline-offset: 0.14em;
}

a:hover {
  color: var(--link-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.inline-form {
  margin: 0;
}

/* Same column as the topic pages: 1200px wide, content in the left 760px. */
.app-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 96px;
  box-sizing: border-box;
  display: grid;
  gap: var(--space-5);
}

.left-rail,
.right-rail {
  display: none;
}

.main-content {
  min-width: 0;
  max-width: 760px;
  width: 100%;
}

.card {
  background: var(--surface);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.main-content > .card + .card,
.main-content > .stack {
  margin-top: var(--space-4);
}

.page-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0 0 var(--space-4);
}

.page-header h1,
.card > h1:first-child {
  margin: 0.15rem 0 var(--space-3);
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-family: var(--font-serif);
  font-weight: 600;
}

.feed-item h2,
.panel h2,
.card h2,
.card h3 {
  font-family: var(--font-serif);
  letter-spacing: -0.01em;
}

.eyebrow {
  margin: 0;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-strong);
  font-size: 0.72rem;
  font-weight: 500;
}

.muted,
.meta {
  color: var(--muted);
}

.meta {
  font-size: 0.8125rem;
  line-height: 1.5;
}

.stack {
  display: grid;
  gap: 0;
  margin-top: var(--space-4);
}

.feed-item h2 {
  margin-top: 0;
  margin-bottom: var(--space-2);
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lead-item h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.feed-stream .feed-item {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0 1.6rem;
}

.feed-stream .feed-item:first-child {
  padding-top: 0.3rem;
}

.standfirst {
  margin: var(--space-2) 0 0;
  color: #4a4945;
}

.source-line {
  margin-top: var(--space-3);
  border-left: 2px solid #d8d7d3;
  padding: 0.2rem 0 0.2rem 0.75rem;
  color: #4a4945;
  font-size: 0.92rem;
}

.pill {
  display: inline;
  border: 0;
  background: transparent;
  color: #111110;
  border-radius: 0;
  font-size: 0.86rem;
  padding: 0;
  text-decoration: none;
}

.identity-badge {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid #9bb0cf;
  padding: 0.05rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  vertical-align: middle;
}

.identity-badge-anonymous {
  background: #f5f7fb;
  color: #334155;
}

.identity-badge-email_verified {
  background: #e8f6ff;
  border-color: #9bd1f3;
  color: #0f4f7a;
}

.identity-badge-identity_verified {
  background: #e7f8ef;
  border-color: #9fd4b4;
  color: #1e5f3a;
}

.identity-badge-public_figure_official {
  background: #fff4dc;
  border-color: #e3c27c;
  color: #694b0c;
}

.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: var(--space-3);
}

.reaction-form {
  margin: 0;
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.7rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  border-left: 3px solid #d0cfcb;
  padding-left: 0.55rem;
}

.reaction-button {
  min-width: 0;
  border-radius: 0;
  font-size: 0.95rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4a4945;
  border-left: 3px solid #d0cfcb;
  padding-left: 0.55rem;
}

.reaction-button.is-active {
  color: #111110;
  font-weight: 600;
}

.reaction-form:nth-child(1) .reaction-button,
.reaction-pill:nth-child(1) {
  border-left-color: var(--brand);
}

.reaction-form:nth-child(2) .reaction-button,
.reaction-pill:nth-child(2) {
  border-left-color: var(--brand-deep);
}

.grid-two {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
  margin-top: var(--space-4);
}

.list {
  margin: var(--space-2) 0 0;
  padding-left: 1rem;
}

.list li + li {
  margin-top: var(--space-2);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--brand-ink);
  border-radius: 999px;
  min-height: 44px;
  padding: 0 20px;
  font: 500 15px var(--font-base);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.button:hover {
  background: #000000;
  border-color: #000000;
  color: var(--brand-ink);
}

.button-ghost {
  border-color: var(--border-strong);
  background: #ffffff;
  color: var(--text);
}

.button-ghost:hover {
  background: #f3f2ee;
  border-color: var(--text);
  color: var(--text);
}

.participation-gate {
  margin-top: var(--space-3);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  border-radius: 0.5rem;
  padding: var(--space-3);
}

.participation-gate p {
  margin-top: 0;
}

.participation-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.inline-participation-gate {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.callout {
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
}

.callout-notice {
  background: #eef3fd;
}

.callout-error {
  background: #fdecea;
  color: #7a1f12;
}

.callout-warning {
  background: #faf2e8;
  border-color: #d9c09f;
}

.form-card h1 {
  margin-top: 0;
}

.stacked-form {
  display: grid;
  gap: var(--space-3);
}

.stacked-form > .button,
.stacked-form > .form-actions {
  margin-top: var(--space-2);
}

.stacked-form label {
  display: grid;
  gap: var(--space-2);
  font-weight: 600;
}

.stacked-form input,
.stacked-form textarea,
.stacked-form select {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  background: #ffffff;
}

.stacked-form input,
.stacked-form select {
  min-height: 44px;
}

.admin-inline-action {
  margin-top: var(--space-2);
}

.report-details {
  position: relative;
  margin-top: var(--space-3);
  width: fit-content;
}

.report-details > summary {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 500;
  list-style: none;
}

.report-details > summary::-webkit-details-marker {
  display: none;
}

.report-details > summary:hover,
.report-details > summary:focus-visible {
  background: var(--surface-muted);
  color: var(--text);
  border-color: var(--border);
}

.report-details > form {
  min-width: min(32rem, calc(100vw - 4rem));
  margin-top: var(--space-2);
  border: 1px solid var(--border);
  padding: var(--space-3);
  background: #ffffff;
}

.report-details h3 {
  margin: 0;
}

.report-note {
  margin: 0;
}

.post-edit-link {
  margin-left: var(--space-2);
}

.post-actions {
  margin-top: var(--space-4);
}

.post-media-gallery {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.post-media-gallery-compact {
  margin-top: var(--space-2);
}

.post-media-image,
.post-media-video {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.post-media-frame-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}

.post-media-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.form-actions,
.section-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.form-actions .button {
  text-decoration: none;
}

.section-heading {
  justify-content: space-between;
}

.section-heading h2 {
  margin: 0;
}

.tag-intro-entry p {
  margin-top: 0;
}

.tag-intro-entry p:last-child {
  margin-bottom: 0;
}

.source-preview {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.source-preview p {
  margin: var(--space-1) 0;
}

.source-preview-image,
.tag-intro-embed-image {
  margin-top: var(--space-2);
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 12px 10px;
  vertical-align: top;
}

.admin-table th:first-child,
.admin-table td:first-child {
  padding-left: 0;
}

.search-bar {
  margin-top: var(--space-3);
  display: grid;
  gap: var(--space-2);
}

.search-bar label {
  font-weight: 600;
}

.search-bar input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.625rem;
  font-size: 1rem;
  min-height: var(--space-7);
}

.search-bar select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.625rem;
  font-size: 1rem;
  min-height: var(--space-7);
  background: #ffffff;
}

.profile-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
}

.profile-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  display: grid;
  place-items: center;
}

.profile-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-fallback {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.profile-header-main h1 {
  margin-bottom: var(--space-1);
}

.profile-party-logo {
  max-height: 2rem;
  max-width: 8rem;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.15rem;
  background: #ffffff;
}

.profile-header-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.profile-network-links {
  grid-column: 1 / -1;
  margin: 0;
}

.profile-stand-for {
  font-size: 1.05rem;
}

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.profile-tab {
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.5rem;
  color: var(--text);
}

.profile-tab.is-active {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--brand-strong);
}

.profile-network-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.thread {
  display: grid;
  gap: var(--space-3);
}

.thread-item {
  border-left: 3px solid var(--border);
  padding-left: var(--space-3);
}

.thread-item.depth-1 {
  margin-left: 20px;
}

.thread-item.depth-2 {
  margin-left: 40px;
}

.notification-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.notification-item + .notification-item {
  border-top: 1px solid var(--border);
}

.notification-item {
  padding: var(--space-2) 0;
}

.notification-link {
  display: block;
  text-decoration: none;
  color: var(--text);
}

.notification-new-label {
  display: inline-block;
  margin-right: var(--space-2);
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--brand-strong);
  color: var(--brand-ink);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notification-divider {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font: 500 0.72rem/1 "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.reply-to-comment {
  margin-top: var(--space-2);
}

.reply-to-comment summary {
  cursor: pointer;
  color: var(--brand-strong);
}

.notifications li {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

@media (min-width: 800px) {

  .grid-two {
    grid-template-columns: 1fr 1fr;
  }

}

@media (max-width: 799px) {
  .app-layout {
    padding: 24px 16px 72px;
  }

  .thread-item.depth-1 {
    margin-left: 0.6rem;
  }

  .thread-item.depth-2 {
    margin-left: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.001ms !important;
  }
}

/* Editor tools (/admin). Full page width, so the edges line up with the site header. */
.main-content-wide {
  max-width: none;
}

/* The menu: three labelled rows (newsroom, readers, sources and AI) whose links wrap, so
   every page is always in view. The current page is a dark pill. */
.admin-bar {
  margin: -16px 0 var(--space-6);
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--border);
}

.admin-nav {
  display: grid;
  gap: 4px;
}

.admin-nav-group {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  align-items: center;
  gap: 12px;
}

.admin-nav-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
}

.admin-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.admin-nav a:hover {
  background: #f1f1ef;
  color: var(--text);
}

.admin-nav a[aria-current="page"] {
  background: var(--text);
  color: #ffffff;
  font-weight: 600;
}

@media (max-width: 700px) {
  .admin-nav {
    gap: 10px;
  }

  .admin-nav-group {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .admin-nav-links {
    margin-left: -12px;
  }
}

/* Status filters inside a page (Comments, Reader questions) and jump links: small segments. */
.admin-tabs,
.admin-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-5);
}

.admin-tabs a,
.admin-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.admin-tabs a:hover,
.admin-jump a:hover {
  border-color: var(--border-strong);
  background: #f6f6f4;
  color: var(--text);
}

.admin-tabs a[aria-current="page"] {
  border-color: var(--text);
  background: var(--text);
  color: #ffffff;
}

/* The page title, with the language switch on the right */
.admin-head {
  margin-bottom: var(--space-6);
}

.admin-head-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
}

.admin-head h1 {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.admin-head .muted {
  margin: var(--space-2) 0 0;
  max-width: 68ch;
}

.admin-language {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.admin-language label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-language select {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: 14px var(--font-base);
}

.admin-language .button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

/* Each block of a page is a light card. */
.admin-section {
  margin-bottom: var(--space-5);
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.admin-section h2 {
  margin: 0 0 var(--space-3);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
}

.admin-section > :last-child {
  margin-bottom: 0;
}

.admin-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: var(--space-3);
}

.admin-section-head h2 {
  margin: 0;
}

.admin-section-head a {
  font-size: 14px;
}

@media (max-width: 600px) {
  .admin-bar {
    margin: -24px -16px var(--space-5);
    padding: 12px 16px;
  }

  .admin-section {
    padding: 16px;
  }
}

.admin-columns {
  display: grid;
  gap: 0 var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.admin-tiles {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  margin-bottom: var(--space-6);
}

.admin-tile,
.admin-tile:hover {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
}

.admin-tile:hover {
  border-color: var(--border-strong);
}

.admin-tile-count {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
}

.admin-tile-active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.admin-tile-active .admin-tile-count {
  color: var(--brand);
}

/* Inbox: nothing waiting, and the accounts summary, which is information rather than work. */
.admin-all-clear {
  border-style: dashed;
}

.admin-all-clear h2 {
  margin-bottom: var(--space-1);
}

.admin-section-quiet {
  background: transparent;
}

.admin-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.admin-item:last-child {
  border-bottom: 0;
}

.admin-item-removed .admin-item-body {
  color: var(--muted);
  text-decoration: line-through;
}

.admin-item-meta {
  margin: 0 0 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 14px;
  color: var(--muted);
}

.admin-item-meta strong {
  color: var(--text);
}

.admin-item-body {
  margin: 0 0 8px;
  white-space: pre-line;
}

.admin-item-note {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text-soft);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.admin-actions > details[open] {
  flex-basis: 100%;
  order: 2;
}

.admin-inline {
  margin: 0;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-reject select {
  min-height: 44px;
  max-width: 260px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #ffffff;
  font: 15px var(--font-base);
}

.button-danger {
  border-color: var(--brand);
  background: #ffffff;
  color: var(--brand);
}

.button-danger:hover {
  border-color: var(--brand-strong);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  white-space: nowrap;
}

.admin-badge + .admin-badge {
  margin-left: 4px;
}

.admin-badge-ok {
  border-color: #b7dfc8;
  background: #ecf8f1;
  color: #155c36;
}

.admin-badge-warning {
  border-color: #e8c79a;
  background: #fff1de;
  color: #7a3e06;
}

.admin-badge-danger {
  border-color: #f0c2b8;
  background: #fdecea;
  color: #7a1f12;
}

.admin-badge-info {
  border-color: #c3d3f5;
  background: #eef3fd;
  color: #1d4ed8;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px 20px;
  margin: 12px 0;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.admin-field-wide,
.admin-form .admin-help,
.admin-form-actions,
.admin-check {
  grid-column: 1 / -1;
}

.admin-label {
  font-size: 14px;
  font-weight: 600;
}

.admin-hint {
  font-size: 13px;
  color: var(--muted);
}

.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form input[type="datetime-local"],
.admin-form select,
.admin-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: 16px var(--font-base);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(21, 23, 26, 0.08);
  outline: none;
}

.admin-form textarea {
  line-height: 1.5;
  resize: vertical;
}

.admin-form input[readonly] {
  background: #f3f2ee;
  color: var(--muted);
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.admin-check input {
  width: 20px;
  height: 20px;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Fields side by side with their labels on one line; the button under them. */
.admin-create {
  grid-template-columns: minmax(240px, 2fr) minmax(200px, 1fr) auto;
  align-items: start;
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .admin-create {
    grid-template-columns: 1fr;
  }
}

.admin-add,
.admin-edit {
  margin: 8px 0;
}

.admin-add > summary,
.admin-edit > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  font: 500 15px var(--font-base);
  list-style: none;
}

.admin-add > summary::-webkit-details-marker,
.admin-edit > summary::-webkit-details-marker {
  display: none;
}

.admin-add > summary::before {
  content: "+";
  margin-right: 8px;
  font-weight: 600;
}

.admin-add[open] > summary,
.admin-edit[open] > summary {
  border-color: var(--text);
}

.admin-add[open],
.admin-edit[open] {
  padding: 0 0 8px;
}

.admin-help {
  padding: 10px 14px;
  border-radius: 10px;
  background: #f3f2ee;
  font-size: 14px;
}

.admin-help summary {
  cursor: pointer;
  font-weight: 500;
}

.admin-help ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.admin-help code {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 13px;
}

.admin-simple-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-simple-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.admin-simple-list li:last-child {
  border-bottom: 0;
}

.admin-empty {
  margin: 0;
  color: var(--muted);
}

.admin-topic-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--space-4);
}

.admin-topic-bar p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-quote {
  margin: 8px 0;
  padding: 10px 14px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-soft);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table th {
  padding-top: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.admin-table td {
  vertical-align: middle;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover td {
  background: #fafaf8;
}

.admin-table td a {
  color: var(--text);
  text-decoration: none;
}

.admin-table td a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* Visitor counts (/admin/visits): the number with a bar behind it */
.visit-table td:first-child {
  overflow-wrap: anywhere;
}

.visit-path {
  display: block;
  color: var(--muted);
  font-size: 0.85em;
  word-break: break-all;
}

.visit-share {
  width: 4.5em;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Kinds of reader: small tables side by side, and page views per hour as 24 bars */
.visit-cards {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.visit-card h3 {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
}

.visit-card .visit-bar-cell {
  width: auto;
  min-width: 90px;
}

.visit-card-wide {
  margin-top: var(--space-5);
}

.visit-hours {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  height: 140px;
  padding-bottom: 1.4rem;
}

.visit-hour {
  position: relative;
  display: flex;
  align-items: flex-end;
}

.visit-hour-bar {
  width: 100%;
  border-radius: 2px 2px 0 0;
  background: var(--brand);
  opacity: 0.75;
}

.visit-hour-label {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.visit-bar-cell {
  position: relative;
  width: 55%;
  min-width: 120px;
}

.visit-bar {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 14px;
  max-width: calc(100% - 28px);
  border-radius: 3px;
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px #f3d8d0;
}

.visit-bar-value {
  position: relative;
  padding-left: 8px;
  font-variant-numeric: tabular-nums;
}

[hidden] {
  display: none !important;
}

/* Review controls stay together instead of stretching buttons in the form grid. */
.publication-checks { grid-column: 1 / -1; display: grid; gap: 12px; }
.publication-checks label { display: flex; align-items: flex-start; gap: 10px; }
.publication-checks input[type="checkbox"] { flex: 0 0 auto; width: auto; margin-top: 6px; }

/* Finishing touches, matching the topic pages (tokens and motion rules in site.css): form
   fields with a soft halo while typing, buttons that answer a hover. */
.stacked-form input,
.stacked-form textarea,
.stacked-form select {
  border-radius: 10px;
  transition: border-color var(--ct-fast) ease, box-shadow var(--ct-fast) ease;
}

.stacked-form input:hover,
.stacked-form textarea:hover,
.stacked-form select:hover {
  border-color: #9aa0a8;
}

.stacked-form input:focus,
.stacked-form textarea:focus,
.stacked-form select:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 4px rgba(21, 23, 26, 0.08);
}

.button {
  transition: background-color var(--ct-fast) ease, border-color var(--ct-fast) ease, box-shadow var(--ct-fast) ease, transform var(--ct-fast) ease;
}

.button:hover {
  box-shadow: 0 4px 14px rgba(21, 23, 26, 0.18);
}

.button-ghost:hover {
  box-shadow: none;
}

/* The desk overview (src/desk/pages.js): one board per topic, six columns from research to
   published. The columns scroll sideways on narrow screens. */
.desk-links {
  margin: 0 0 var(--space-4);
}

.desk-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: start;
}

.desk-column {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
}

.desk-column h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 17px;
}

.desk-column h3 {
  margin: 0 0 4px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.desk-count {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

/* The Tasks box on Desk (src/desk/tasks.js): a late or failed task stands out. */
.desk-tasks td form {
  margin: 0;
}

.desk-task-warn td {
  background: var(--brand-soft);
}

.desk-task-warning {
  color: var(--brand-strong);
}

.desk-card,
.desk-block {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.desk-card p,
.desk-block p {
  margin: 0 0 4px;
}

.desk-card-meta {
  color: var(--muted);
  font-size: 13px;
}

.desk-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.desk-list,
.desk-checks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.desk-list li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.desk-list li:last-child {
  border-bottom: 0;
}

.desk-checks li {
  font-size: 13px;
}

.desk-checks .desk-open {
  color: var(--muted);
}

.desk-checks .desk-done {
  color: var(--text);
}

.desk-inbox-line {
  margin: 0 0 var(--space-6);
}

/* Interview rounds (src/desk/round-pages.js): eight stage columns, card actions and warnings. */
.desk-board-wide {
  grid-template-columns: repeat(8, minmax(210px, 1fr));
}

.desk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}

.desk-actions .button {
  padding: 4px 10px;
  font-size: 13px;
}

.desk-warnings {
  margin: 6px 0;
  padding-left: 18px;
  color: #7a1f12;
  font-size: 13px;
}

.desk-dossier,
.desk-edit {
  margin: 6px 0 0;
  font-size: 13px;
}

.desk-dossier summary,
.desk-edit summary {
  cursor: pointer;
  color: var(--muted);
}

.desk-question {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.desk-question legend {
  padding: 0 6px;
  font-weight: 600;
}

/* The steps of a round and the angle choice (src/desk/round-pages.js). */
.desk-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--space-4) 0 var(--space-3);
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.desk-steps li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}

.desk-steps li span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text);
  font-size: 12px;
}

.desk-steps .desk-step-done {
  color: var(--text-soft);
}

.desk-steps .desk-step-done span {
  background: #1f7a3d;
  color: #fff;
}

.desk-steps .desk-step-now {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--text);
  font-weight: 600;
}

.desk-steps .desk-step-now span {
  background: var(--brand);
  color: var(--brand-ink);
}

.desk-now {
  margin: 0 0 var(--space-5);
}

.desk-angle h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.desk-angle .admin-inline {
  margin-top: 8px;
}

.desk-angle-chosen {
  border-color: var(--brand);
}
