:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #fffefa;
  --surface-strong: #ffffff;
  --ink: #1f2933;
  --muted: #66717f;
  --line: #ddd8cf;
  --accent: #146b5f;
  --accent-strong: #0f544a;
  --warn: #9a6112;
  --warn-bg: #fff4d8;
  --ok: #1f7a4d;
  --ok-bg: #e6f4ed;
  --error: #a33a32;
  --error-bg: #ffe9e6;
  --blue: #2f5d9f;
  --shadow: 0 12px 32px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 260px),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

button,
input[type="submit"] {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 650;
}

button:hover,
input[type="submit"]:hover {
  background: var(--accent-strong);
}

button:disabled,
input[type="submit"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--surface-strong);
}

textarea {
  resize: vertical;
}

code {
  overflow-wrap: anywhere;
  color: #35475c;
  font-size: 0.88rem;
}

pre {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8f8f5;
  white-space: pre-wrap;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.topbar h1,
.section-heading h2,
.list-item h3,
.draft h3 {
  margin: 0;
}

.topbar h1 {
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard {
  display: grid;
  gap: 18px;
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  color: var(--ink);
  background: rgba(255, 254, 250, 0.82);
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
}

.nav-pill:hover {
  border-color: #b9c7d7;
  background: var(--surface-strong);
}

.nav-pill.active {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.nav-pill-primary {
  color: var(--accent);
}

.inline-link {
  display: inline-flex;
  margin-top: 5px;
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.band {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  background: rgba(255, 254, 250, 0.88);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: 1.28rem;
}

.project-switcher,
.inline-form,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button-row form {
  margin: 0;
}

.project-switcher {
  min-width: min(100%, 420px);
}

.project-switcher label {
  color: var(--muted);
  font-weight: 700;
}

.inline-form input[type="url"] {
  min-width: min(70vw, 560px);
}

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

.setup-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

label span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 750;
}

.wide {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
}

.check-row input {
  width: auto;
}

.check-row span {
  margin: 0;
  color: var(--ink);
}

.form-actions {
  display: flex;
  align-items: end;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: var(--surface-strong);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
  line-height: 1;
}

.control-band {
  border-top: 4px solid var(--accent);
}

.crawl-progress {
  border-top: 4px solid var(--blue);
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  margin-bottom: 14px;
  background: #e5e1d8;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.crawl-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.crawl-stats > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.crawl-stats span,
.crawl-stats small {
  display: block;
  color: var(--muted);
  font-weight: 750;
}

.crawl-stats strong {
  display: inline-block;
  margin-top: 3px;
  font-size: 1.65rem;
  line-height: 1;
}

.crawl-message {
  margin: 14px 0;
}

.crawl-page-table td strong,
.crawl-page-table td code,
.crawl-page-table td small {
  display: block;
}

.hidden {
  display: none;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.stack,
.draft-grid {
  display: grid;
  gap: 12px;
}

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

.list-item,
.draft {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-strong);
}

.list-item h3,
.draft h3 {
  margin-top: 8px;
  font-size: 1rem;
}

.list-item p,
.draft p {
  margin: 8px 0;
  color: var(--muted);
}

.item-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.item-topline small {
  color: var(--muted);
}

.pair-form,
.review-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--muted);
  background: #f5f4ef;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-ok {
  border-color: #b9dfc9;
  color: var(--ok);
  background: var(--ok-bg);
}

.status-warn {
  border-color: #ecd08f;
  color: var(--warn);
  background: var(--warn-bg);
}

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

.scope-note {
  display: block;
  margin-top: 5px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 750;
}

.flash {
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 12px 14px;
  font-weight: 700;
}

.flash-notice {
  color: var(--ok);
  background: var(--ok-bg);
}

.flash-alert,
.error-text {
  color: var(--error);
  background: var(--error-bg);
}

.error-text {
  border-radius: 8px;
  padding: 10px;
}

.discovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.discovery-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.discovery-grid p {
  margin: 0 0 5px;
}

.secondary-button input[type="submit"] {
  background: #6d7480;
}

.scan-result {
  margin-top: 16px;
}

.create-after-scan {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.compact-heading {
  margin-bottom: 12px;
}

.source-scan-form {
  margin-bottom: 16px;
}

.scan-warnings {
  border: 1px solid #ecd08f;
  border-radius: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  color: var(--warn);
  background: var(--warn-bg);
}

.scan-warnings p {
  margin: 0;
}

.scan-warnings p + p {
  margin-top: 6px;
}

.advanced-fields {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfaf6;
}

.advanced-fields summary {
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
}

.advanced-fields .setup-grid {
  margin-top: 12px;
}

.preview-dashboard {
  gap: 16px;
}

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

.preview-fields > div,
.current-crumb {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.preview-fields span,
.current-crumb span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.preview-fields strong,
.preview-fields p,
.current-crumb strong {
  margin: 0;
}

.category-tree {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-tree li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-strong);
}

.category-tree small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 800;
}

.category-tree span {
  align-self: center;
  font-weight: 800;
}

.category-tree code {
  grid-column: 2;
}

.current-crumb {
  margin-top: 12px;
}

.article-preview {
  max-height: 620px;
  font-size: 0.94rem;
}

.structured-preview {
  display: grid;
  gap: 14px;
  max-width: 860px;
}

.structured-preview h2,
.structured-preview h3,
.structured-preview h4,
.structured-preview h5,
.structured-preview h6,
.structured-preview p,
.structured-preview blockquote,
.structured-preview pre,
.structured-preview ul {
  margin: 0;
}

.structured-preview h2 {
  font-size: 1.35rem;
}

.structured-preview h3,
.structured-preview h4,
.structured-preview h5,
.structured-preview h6 {
  font-size: 1.08rem;
}

.structured-preview p,
.structured-preview li,
.structured-preview blockquote {
  color: #2f3a46;
  font-size: 1rem;
}

.structured-preview a {
  color: var(--blue);
  font-weight: 750;
}

.content-block-list {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

.content-block-image {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.asset-list {
  display: grid;
  gap: 14px;
}

.asset-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-strong);
}

.asset-preview {
  display: grid;
  align-items: start;
}

.asset-preview img {
  width: 100%;
  max-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #f8f8f5;
}

.asset-body {
  display: grid;
  gap: 10px;
}

.asset-body p {
  margin: 0;
}

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

@media (max-width: 980px) {
  .topbar,
  .section-heading,
  .project-switcher,
  .inline-form,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-grid,
  .settings-grid,
  .setup-grid.compact,
  .preview-fields,
  .metric-grid,
  .crawl-stats,
  .two-column,
  .draft-grid,
  .discovery-grid,
  .asset-row,
  .asset-form {
    grid-template-columns: 1fr;
  }

  .inline-form input[type="url"] {
    min-width: 0;
  }
}

/* Workspace navigation */

.workspace-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.workspace-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  height: 100vh;
  border-right: 1px solid #dfe3e6;
  padding: 20px 14px;
  background: #f8faf9;
  overflow-y: auto;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup strong {
  color: #17212b;
  font-size: 0.96rem;
}

.brand-lockup small {
  color: var(--muted);
  font-size: 0.72rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.76rem;
  font-weight: 850;
}

.deployment-environment {
  align-self: flex-start;
  border: 1px solid #e5b85b;
  border-radius: 5px;
  margin: 10px 0 0 49px;
  padding: 3px 7px;
  color: #80500d;
  background: #fff5d9;
  font-size: 0.64rem;
  font-weight: 850;
  text-transform: uppercase;
}

.sidebar-project-switcher {
  margin: 26px 2px 20px;
}

.sidebar-project-switcher label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-project-switcher select {
  min-height: 40px;
  background: #ffffff;
  font-weight: 750;
}

.sidebar-nav {
  display: grid;
  gap: 5px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  border-radius: 7px;
  padding: 8px 10px;
  color: #35414d;
  font-size: 0.88rem;
  font-weight: 720;
  text-decoration: none;
}

.sidebar-link:hover {
  color: #17212b;
  background: #eef2f0;
}

.sidebar-link.active {
  color: var(--accent-strong);
  background: #e2f0ec;
}

.sidebar-link > small {
  color: var(--muted);
}

.sidebar-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 9px 7px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.sidebar-section-heading a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--accent);
  font-size: 1.1rem;
  text-decoration: none;
}

.sidebar-section-heading a:hover {
  background: #e2f0ec;
}

.content-group-links {
  display: grid;
  gap: 4px;
}

.content-group-link {
  justify-content: flex-start;
  padding: 8px;
}

.group-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid #cad4d0;
  border-radius: 7px;
  color: var(--accent);
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 850;
}

.group-link-copy {
  min-width: 0;
}

.group-link-copy strong,
.group-link-copy small {
  display: block;
}

.group-link-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: 0.87rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-link-copy small {
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 620;
}

.sidebar-add-link {
  justify-content: flex-start;
  color: var(--accent);
}

.sidebar-category-browser {
  border-top: 1px solid #dfe3e6;
  margin-top: 14px;
  padding-top: 2px;
}

.sidebar-category-browser .sidebar-section-heading {
  margin-top: 10px;
}

.sidebar-category-browser .category-navigation {
  max-height: min(40vh, 360px);
  overflow-y: auto;
}

.sidebar-empty {
  margin: 4px 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.sidebar-footer {
  display: grid;
  gap: 4px;
  border-top: 1px solid #dfe3e6;
  margin-top: auto;
  padding-top: 14px;
}

.workspace-main {
  min-width: 0;
  padding: 26px clamp(20px, 3vw, 44px) 60px;
}

.workspace-content {
  display: grid;
  gap: 20px;
  min-width: 0;
  width: min(100%, 1440px);
  margin: 0 auto;
}

.workspace-content > * {
  min-width: 0;
}

.context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 86px;
}

.context-header h1 {
  margin: 2px 0 6px;
  color: #17212b;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.1;
}

.context-header p {
  margin: 0;
  color: var(--muted);
}

.context-path {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.context-path a {
  color: inherit;
  text-decoration: none;
}

.context-path a:hover {
  text-decoration: underline;
}

.context-separator {
  margin: 0 6px;
  color: #a2aab2;
}

.context-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.context-actions form {
  margin: 0;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.88rem;
  font-weight: 780;
  line-height: 1.2;
  text-decoration: none;
}

.primary-action {
  border: 1px solid var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.primary-action:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.secondary-action {
  border: 1px solid var(--line);
  color: #26333f;
  background: #ffffff;
}

.secondary-action:hover {
  border-color: #aab8c5;
  background: #f7f9fa;
}

.action-menu {
  position: relative;
}

.action-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #35414d;
  background: #ffffff;
  cursor: pointer;
  font-weight: 850;
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu-panel {
  position: absolute;
  z-index: 5;
  top: 46px;
  right: 0;
  display: grid;
  gap: 5px;
  width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.action-menu-panel a,
.action-menu-panel button,
.action-menu-panel input[type="submit"] {
  display: block;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 8px 9px;
  color: #26333f;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 720;
  text-align: left;
  text-decoration: none;
}

.action-menu-panel a:hover,
.action-menu-panel button:hover,
.action-menu-panel input[type="submit"]:hover {
  background: #f0f3f2;
}

.workspace-tabs {
  display: flex;
  gap: 4px;
  max-width: 100%;
  border-bottom: 1px solid #d9dee1;
  overflow-x: auto;
}

.workspace-tabs a {
  flex: 0 0 auto;
  border-bottom: 2px solid transparent;
  padding: 10px 13px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}

.workspace-tabs a:hover {
  color: #26333f;
}

.workspace-tabs a.active {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.crawl-activity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid #b8d8ce;
  border-radius: 8px;
  padding: 10px 14px;
  color: #194f43;
  background: #e7f4f0;
}

.crawl-activity-copy,
.crawl-activity-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crawl-activity-copy strong,
.crawl-activity-copy small {
  display: block;
}

.crawl-activity-copy small {
  margin-top: 1px;
  color: #527169;
  font-size: 0.72rem;
}

.crawl-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(24, 122, 103, 0.14);
}

.crawl-activity-track {
  width: 130px;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(25, 79, 67, 0.16);
}

.crawl-activity-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.crawl-activity.is-complete {
  border-color: #b8d8ce;
}

.crawl-activity.is-complete .crawl-pulse {
  box-shadow: none;
}

.crawl-activity.is-failed {
  border-color: #e5c17c;
  color: #7b4b0e;
  background: #fff5dc;
}

.crawl-activity.is-failed .crawl-pulse {
  background: #b36a08;
  box-shadow: none;
}

.section-description {
  max-width: 760px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.project-metrics {
  margin-top: 2px;
}

.content-group-list {
  display: grid;
}

.content-group-row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(80px, 0.55fr)) minmax(120px, 0.8fr) auto;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 16px 4px;
}

.content-group-row:first-child {
  border-top: 0;
}

.group-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.group-identity h3,
.group-identity p {
  margin: 0;
}

.group-identity h3 {
  font-size: 0.98rem;
}

.group-identity p,
.group-stat span,
.group-last-check span {
  color: var(--muted);
  font-size: 0.75rem;
}

.group-stat strong,
.group-stat span,
.group-last-check strong,
.group-last-check span {
  display: block;
}

.group-stat strong,
.group-last-check strong {
  margin-top: 3px;
  font-size: 0.88rem;
}

.content-group-scan-form,
.setup-scan-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.content-group-scan-form .form-actions {
  align-items: end;
}

.status-summary-list,
.connected-site-list {
  display: grid;
}

.status-summary-list > div,
.connected-site-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.status-summary-list > div:first-child,
.connected-site-list > div:first-child {
  border-top: 0;
}

.status-summary-list span,
.connected-site-list span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.connected-site-list > div {
  display: grid;
  grid-template-columns: minmax(90px, 0.6fr) minmax(0, 1fr) auto;
}

.connected-site-list strong,
.connected-site-list code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connected-site-list.detailed > div {
  grid-template-columns: 110px minmax(0, 1fr);
}

.settings-note {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

.single-column {
  grid-template-columns: 1fr;
}

.work-list,
.pair-list {
  display: grid;
}

.pair-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.pair-row:first-child {
  border-top: 0;
}

.pair-row h3,
.pair-row p {
  margin: 0;
}

.pair-row h3 {
  font-size: 0.94rem;
}

.pair-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.change-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 22px;
}

.change-summary > div {
  display: grid;
  gap: 2px;
  border-left: 1px solid var(--line);
  padding: 14px 18px;
}

.change-summary > div:first-child {
  border-left: 0;
  padding-left: 0;
}

.change-summary strong {
  font-size: 1.25rem;
  line-height: 1.1;
}

.change-summary span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.work-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.work-row:first-child {
  border-top: 0;
}

.work-row-content {
  min-width: 0;
}

.work-row .item-topline {
  justify-content: flex-start;
  margin-bottom: 8px;
}

.work-row h3 {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.35;
}

.work-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.76rem;
}

.work-metadata span + span::before {
  margin-right: 14px;
  color: #a2aab2;
  content: "·";
}

.work-url {
  display: block;
  max-width: 100%;
  margin-top: 7px;
  overflow: hidden;
  color: #38506a;
  font-family: var(--mono);
  font-size: 0.74rem;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-url:hover {
  text-decoration: underline;
}

.work-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.work-actions .secondary-action {
  min-height: 36px;
  padding: 7px 12px;
  white-space: nowrap;
}

.pair-row {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
}

.pair-row .pair-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-self: center;
  margin: 0;
}

.match-score-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.match-score-grid > div {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 7px;
  background: #f8faf9;
}

.match-score-grid > div.coverage-score {
  border-color: #b8d5cc;
  background: #eef7f4;
}

.match-score-grid span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.match-score-grid strong {
  font-size: 0.74rem;
}

.pair-row .match-explanation {
  margin-top: 9px;
  color: #45535f;
  font-size: 0.76rem;
}

.pair-queue-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 20px 0 0;
}

.pair-queue-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-bottom: 3px solid transparent;
  padding: 9px 12px 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}

.pair-queue-tabs a:hover {
  color: #26333f;
  background: #f7f9f8;
}

.pair-queue-tabs a.active {
  border-bottom-color: var(--accent);
  color: var(--accent-strong);
}

.pair-queue-tabs strong {
  min-width: 22px;
  border-radius: 999px;
  padding: 2px 6px;
  background: #eef1f0;
  font-size: 0.68rem;
  text-align: center;
}

.pair-list {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.pair-review-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--surface-strong);
  box-shadow: 0 5px 16px rgba(31, 41, 51, 0.045);
}

.pair-review-row:first-child {
  border-top: 1px solid var(--line);
}

.pair-review-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.pair-review-heading small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.pair-review-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.secondary-action.compact {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.75rem;
}

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

.pair-comparison.single-target {
  grid-template-columns: minmax(0, 1fr);
}

.comparison-pane {
  min-width: 0;
  padding: 4px 24px 4px 0;
}

.comparison-pane + .comparison-pane {
  border-left: 1px solid var(--line);
  padding-right: 0;
  padding-left: 24px;
}

.comparison-label {
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.comparison-pane h3 {
  margin: 7px 0 0;
  font-size: 1rem;
  line-height: 1.35;
}

.comparison-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.comparison-metadata span + span::before {
  margin-right: 13px;
  color: #a2aab2;
  content: "·";
}

.comparison-excerpt {
  display: -webkit-box;
  margin: 12px 0 0;
  overflow: hidden;
  color: #45535f;
  font-size: 0.8rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.comparison-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

.comparison-links a,
.match-candidates a {
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
  text-decoration: none;
}

.comparison-links a:hover,
.match-candidates a:hover {
  text-decoration: underline;
}

.pair-review-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  border: 1px solid #e5e7e3;
  border-radius: 7px;
  margin-top: 20px;
  padding: 14px;
  background: #f7f9f8;
}

.pair-evidence {
  min-width: 0;
}

.pair-review-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.pair-review-actions form {
  margin: 0;
}

.match-candidates {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 12px;
}

.match-candidates summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
}

.match-candidates > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 7px;
  padding-top: 7px;
  font-size: 0.74rem;
}

.match-candidates > div > span:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.match-candidates > div span {
  color: var(--muted);
  text-align: right;
}

.target-selection-form {
  display: none;
}

.target-picker-dialog {
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: #17212b;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(20, 31, 40, 0.25);
}

.target-picker-dialog::backdrop {
  background: rgba(23, 33, 43, 0.46);
}

.target-picker-shell {
  display: grid;
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

.target-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 22px 24px 18px;
}

.target-picker-header h2,
.target-picker-header p {
  margin: 0;
}

.target-picker-header h2 {
  margin-top: 3px;
  font-size: 1.3rem;
}

.target-picker-header > div > p:last-child {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.target-picker-header form {
  margin: 0;
}

.target-picker-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0;
  color: #35414d;
  background: #ffffff;
  font-size: 1.35rem;
  line-height: 1;
}

.target-picker-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  min-height: 0;
}

.target-picker-search {
  min-width: 0;
  padding: 20px 24px 24px;
}

.target-picker-search > label {
  display: block;
  margin-bottom: 7px;
  color: #35414d;
  font-size: 0.78rem;
  font-weight: 800;
}

.target-picker-search input[type="search"] {
  width: 100%;
}

.target-result-count {
  min-height: 18px;
  margin: 7px 0 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.target-result-list {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.target-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 15px 4px;
}

.target-result[hidden] {
  display: none;
}

.target-result.selected {
  border-color: #9fc8bc;
  background: #eef7f4;
}

.target-result-copy {
  min-width: 0;
}

.target-result h3,
.target-result p {
  margin: 0;
}

.target-result h3 {
  font-size: 0.9rem;
  line-height: 1.35;
}

.target-result-metadata {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.target-result-excerpt {
  display: -webkit-box;
  margin-top: 8px;
  overflow: hidden;
  color: #45535f;
  font-size: 0.75rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.target-result .comparison-links {
  margin-top: 8px;
}

.target-result > .secondary-action {
  min-height: 36px;
  padding: 7px 11px;
}

.target-picker-review {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-left: 1px solid var(--line);
  padding: 22px;
  background: #f8faf9;
}

.picker-review-pane + .picker-review-pane {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.picker-review-pane h3 {
  margin: 7px 0 0;
  font-size: 0.96rem;
  line-height: 1.4;
}

.target-picker-prompt {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 18px;
}

.target-picker-prompt strong {
  font-size: 0.84rem;
}

.target-picker-prompt p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.target-picker-confirm {
  width: 100%;
  margin-top: auto;
}

.target-picker-full-compare {
  width: 100%;
  margin-top: auto;
  margin-bottom: 9px;
}

.target-picker-full-compare + .target-picker-confirm {
  margin-top: 0;
}

.target-picker-confirm:disabled {
  border-color: #b9c4c0;
  color: #ffffff;
  background: #9ba9a4;
  cursor: not-allowed;
}

.target-picker-empty {
  border-top: 1px solid var(--line);
  padding: 28px 12px;
  text-align: center;
}

.target-picker-empty p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.comparison-review-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.comparison-review-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 14px max(20px, calc((100vw - 1640px) / 2));
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 3px 14px rgba(31, 41, 51, 0.06);
  z-index: 5;
}

.comparison-review-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 18px;
}

.comparison-review-identity > div {
  min-width: 0;
}

.comparison-review-identity h1,
.comparison-review-identity p {
  margin: 0;
}

.comparison-review-identity h1 {
  font-size: 1.28rem;
  line-height: 1.25;
}

.comparison-review-identity > div > p:last-child {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.comparison-back-link {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.comparison-back-link:hover {
  text-decoration: underline;
}

.comparison-review-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.comparison-review-actions form {
  margin: 0;
}

.comparison-review-main {
  display: grid;
  flex: 1 1 auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  width: min(1640px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 16px;
}

.comparison-review-toolbar {
  display: grid;
  grid-template-columns: auto minmax(340px, 1fr);
  align-items: center;
  gap: 16px;
  padding-bottom: 10px;
}

.comparison-layout-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.comparison-view-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  background: #ffffff;
}

.comparison-view-switch button {
  min-height: 32px;
  border: 0;
  padding: 5px 10px;
  color: var(--muted);
  background: transparent;
  font-size: 0.74rem;
}

.comparison-view-switch button:hover {
  color: var(--ink);
  background: #f2f5f3;
}

.comparison-view-switch button[aria-pressed="true"] {
  color: var(--accent-strong);
  background: #e5f1ed;
}

.comparison-section-controls {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 8px;
}

.comparison-section-controls label {
  width: min(360px, 40vw);
}

.comparison-section-controls label span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
}

.comparison-section-controls select {
  min-height: 34px;
  padding: 5px 9px;
  font-size: 0.76rem;
}

.comparison-section-step {
  min-height: 34px;
  border: 1px solid var(--line);
  padding: 5px 9px;
  color: #35414d;
  background: #ffffff;
  font-size: 0.72rem;
}

.comparison-section-step:hover {
  background: #f2f5f3;
}

.comparison-sync-toggle {
  display: none;
  align-items: center;
  gap: 7px;
  color: #35414d;
  font-size: 0.76rem;
  font-weight: 750;
  white-space: nowrap;
}

[data-view-mode="split"] .comparison-sync-toggle {
  display: inline-flex;
}

.comparison-sync-toggle input {
  width: auto;
}

.full-comparison-frame {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.full-comparison-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.full-comparison-pane + .full-comparison-pane {
  border-left: 1px solid var(--line);
}

.full-comparison-pane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 126px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  background: #fbfcfb;
}

.full-comparison-pane-header > div {
  min-width: 0;
}

.full-comparison-pane-header h2 {
  margin: 5px 0 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.comparison-live-link {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
}

.comparison-live-link:hover {
  text-decoration: underline;
}

.full-comparison-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 22px 72px;
  scrollbar-gutter: stable;
}

.full-comparison-scroll:focus-visible {
  outline: 3px solid rgba(47, 93, 159, 0.3);
  outline-offset: -3px;
}

.comparison-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 18px;
  border-bottom: 1px solid #ece9e2;
  margin-bottom: 20px;
  padding-bottom: 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.comparison-breadcrumbs span + span::before {
  margin-right: 18px;
  color: #a2aab2;
  content: "/";
}

.full-article-content {
  max-width: none;
  gap: 16px;
}

.full-article-content h2 {
  scroll-margin-top: 18px;
  font-size: 1.3rem;
}

.full-article-content h3,
.full-article-content h4,
.full-article-content h5,
.full-article-content h6 {
  scroll-margin-top: 18px;
  font-size: 1.08rem;
}

.full-article-content p,
.full-article-content li,
.full-article-content blockquote {
  color: #283642;
  font-size: 0.92rem;
  line-height: 1.65;
}

.full-article-content .content-block-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 560px;
  margin: 4px auto;
  object-fit: contain;
}

.comparison-evidence-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding-top: 10px;
}

.comparison-evidence-bar .match-score-grid {
  flex: 0 0 auto;
  margin-top: 0;
}

.comparison-evidence-bar > p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-view-mode="source"] .full-comparison-frame,
[data-view-mode="target"] .full-comparison-frame {
  grid-template-columns: minmax(0, 1fr);
}

[data-view-mode="source"] [data-comparison-pane="target"],
[data-view-mode="target"] [data-comparison-pane="source"] {
  display: none;
}

[data-view-mode="target"] .full-comparison-pane.target {
  border-left: 0;
}

.empty-state {
  border: 1px dashed #cbd2d6;
  border-radius: 8px;
  padding: 28px;
  text-align: center;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-state p {
  margin-top: 5px;
  color: var(--muted);
}

.empty-state .primary-action {
  margin-top: 15px;
}

.empty-state.compact {
  padding: 18px;
}

/* Category browser */

.mobile-category-browser {
  display: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 12px;
  background: #ffffff;
}

.content-inventory {
  min-width: 0;
}

.locale-segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 12px;
  padding: 3px;
  background: #f2f4f3;
}

.locale-segmented-control a {
  border-radius: 5px;
  padding: 6px 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.locale-segmented-control a.active {
  color: #1f2c37;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(31, 41, 51, 0.08);
}

.category-navigation,
.category-navigation ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-navigation ul {
  border-left: 1px solid #dce2e0;
  margin-left: 12px;
  padding-left: 8px;
}

.category-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  border-radius: 6px;
  padding: 6px 8px;
  color: #35414d;
  font-size: 0.78rem;
  font-weight: 680;
  text-decoration: none;
}

.category-link:hover {
  background: #f0f3f2;
}

.category-link.active {
  color: var(--accent-strong);
  background: #e2f0ec;
}

.category-link small {
  color: var(--muted);
  font-size: 0.68rem;
}

.category-link.all-content {
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  margin-bottom: 8px;
  padding-bottom: 9px;
}

.content-inventory-table {
  min-width: 720px;
  table-layout: fixed;
}

.content-inventory-table th:nth-child(1) {
  width: 42%;
}

.content-inventory-table th:nth-child(2) {
  width: 13%;
}

.content-inventory-table th:nth-child(3) {
  width: 25%;
}

.content-inventory-table th:nth-child(4) {
  width: 9%;
}

.content-inventory-table th:nth-child(5) {
  width: 11%;
}

.content-inventory-table td strong,
.content-inventory-table td code {
  display: block;
}

.content-inventory-table td code {
  margin-top: 4px;
  font-size: 0.74rem;
  line-height: 1.4;
}

/* New project flow */

.setup-shell {
  min-height: 100vh;
}

.setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #dfe3e6;
  padding: 18px clamp(20px, 4vw, 54px);
  background: #f8faf9;
}

.setup-main {
  width: min(760px, calc(100% - 32px));
  margin: 48px auto;
}

.setup-panel {
  padding: clamp(22px, 4vw, 36px);
}

.setup-panel h1 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
}

.text-link {
  color: var(--blue);
  font-weight: 750;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

@media (max-width: 1120px) {
  .content-group-row {
    grid-template-columns: minmax(210px, 1.5fr) repeat(3, minmax(70px, 0.45fr)) auto;
  }

  .group-last-check {
    display: none;
  }

  .comparison-review-toolbar {
    grid-template-columns: auto minmax(300px, 1fr);
  }
}

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

  .workspace-sidebar {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #dfe3e6;
    padding: 14px 16px;
    overflow: visible;
  }

  .sidebar-project-switcher {
    margin: 14px 0 10px;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
  }

  .sidebar-nav > .sidebar-link,
  .content-group-links .sidebar-link,
  .sidebar-add-link {
    flex: 0 0 auto;
  }

  .sidebar-section-heading,
  .sidebar-footer {
    display: none;
  }

  .sidebar-category-browser {
    display: none;
  }

  .content-group-links {
    display: flex;
    gap: 4px;
  }

  .content-group-link .group-initial,
  .content-group-link small {
    display: none;
  }

  .workspace-main {
    padding: 20px 16px 48px;
  }

  .context-header,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .context-header {
    min-height: 0;
  }

  .context-actions {
    width: 100%;
  }

  .context-actions form,
  .context-actions input[type="submit"] {
    flex: 1;
    width: 100%;
  }

  .metric-grid,
  .content-group-scan-form,
  .setup-scan-form,
  .overview-columns,
  .settings-columns {
    grid-template-columns: 1fr;
  }

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

  .content-group-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .content-group-row .group-stat,
  .content-group-row .group-last-check {
    display: none;
  }

  .mobile-category-browser {
    display: block;
  }

  .mobile-category-browser .category-navigation {
    max-height: 260px;
    overflow-y: auto;
  }

  .crawl-activity {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .crawl-activity-actions {
    justify-content: space-between;
  }

  .pair-row,
  .work-row {
    grid-template-columns: 1fr;
  }

  .pair-comparison,
  .pair-review-footer {
    grid-template-columns: 1fr;
  }

  .comparison-pane {
    padding: 0;
  }

  .comparison-pane + .comparison-pane {
    border-top: 1px solid var(--line);
    border-left: 0;
    margin-top: 18px;
    padding: 18px 0 0;
  }

  .pair-review-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .target-picker-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .target-result-list {
    max-height: 42vh;
  }

  .target-picker-review {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .target-picker-confirm {
    margin-top: 20px;
  }

  .pair-queue-tabs {
    overflow-x: auto;
  }

  .pair-queue-tabs a {
    white-space: nowrap;
  }

  .work-actions {
    justify-content: flex-start;
  }

  .pair-row .pair-form {
    grid-template-columns: 1fr;
  }

  .pair-review-heading {
    align-items: flex-start;
  }

  .pair-review-heading-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .comparison-review-shell {
    min-height: 100vh;
  }

  .comparison-review-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .comparison-review-actions {
    flex-wrap: wrap;
  }

  .comparison-review-main {
    width: calc(100% - 16px);
    padding-top: 8px;
  }

  .comparison-review-toolbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .comparison-view-switch {
    justify-self: start;
  }

  .comparison-layout-controls {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .comparison-section-controls {
    justify-content: stretch;
  }

  .comparison-section-controls label {
    width: auto;
    flex: 1;
  }

  .comparison-sync-toggle {
    align-self: flex-start;
  }

  .full-comparison-frame {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .full-comparison-pane + .full-comparison-pane {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  [data-view-mode="source"] .full-comparison-frame,
  [data-view-mode="target"] .full-comparison-frame {
    grid-template-rows: minmax(0, 1fr);
  }

  .full-comparison-pane-header {
    min-height: 108px;
  }

  .comparison-evidence-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .comparison-evidence-bar > p {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .change-summary {
    grid-template-columns: 1fr;
  }

  .change-summary > div,
  .change-summary > div:first-child {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 10px;
    border-top: 1px solid var(--line);
    border-left: 0;
    padding: 10px 0;
  }

  .change-summary > div:first-child {
    border-top: 0;
  }

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

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

  .target-picker-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .target-picker-shell {
    max-height: calc(100vh - 16px);
  }

  .target-picker-header,
  .target-picker-search,
  .target-picker-review {
    padding-right: 16px;
    padding-left: 16px;
  }

  .target-result {
    grid-template-columns: 1fr;
  }

  .target-result > .secondary-action {
    justify-self: start;
  }

  .pair-review-row {
    padding: 16px;
  }

  .comparison-review-identity {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .comparison-review-actions > *,
  .comparison-review-actions form,
  .comparison-review-actions form input {
    flex: 1;
  }

  .comparison-review-actions .primary-action,
  .comparison-review-actions .secondary-action {
    width: 100%;
    white-space: nowrap;
  }

  .comparison-section-step {
    display: none;
  }

  .full-comparison-pane-header {
    min-height: 96px;
    padding: 12px;
  }

  .full-comparison-scroll {
    padding: 16px 14px 56px;
  }

  .comparison-evidence-bar {
    display: none;
  }

  .brand-lockup small {
    display: none;
  }

  .setup-main {
    margin-top: 24px;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 15px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.button-primary {
  color: #ffffff;
  background: var(--accent);
}

.button-primary:hover {
  color: #ffffff;
  background: var(--accent-strong);
}

.button-secondary {
  border-color: var(--line);
  color: var(--ink);
  background: #ffffff;
}

.button-secondary:hover {
  color: var(--accent-strong);
  background: #f3f7f5;
}

.button-danger {
  border-color: #e4c3bf;
  color: var(--error);
  background: #ffffff;
}

.button-danger:hover {
  color: #ffffff;
  background: var(--error);
}

.button-block {
  width: 100%;
}

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

.field label {
  color: #3d4a57;
  font-size: 0.86rem;
  font-weight: 750;
}

.field small {
  color: var(--muted);
  font-size: 0.78rem;
}

.read-only-field {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: #f4f4f1;
  overflow-wrap: anywhere;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
}

.auth-panel {
  width: min(100%, 480px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 38px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  font-weight: 800;
}

.auth-panel h1 {
  margin: 0 0 10px;
  font-size: 2rem;
  line-height: 1.15;
}

.auth-intro {
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.65;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-secondary-link {
  margin: 22px 0 0;
  text-align: center;
}

.auth-secondary-link a {
  color: var(--accent);
  font-weight: 700;
}

.public-landing {
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  background-image: url("/assets/mugen-hero-2d43ba05.jpg");
  background-position: center;
  background-size: cover;
  place-items: center;
  isolation: isolate;
}

.public-landing-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.public-landing-overlay {
  z-index: -1;
  background: rgba(10, 19, 17, 0.44);
}

.public-landing-content {
  display: grid;
  justify-items: center;
  gap: 30px;
  width: min(100% - 40px, 980px);
  text-align: center;
}

.public-landing-content h1 {
  margin: 0;
  color: #ffffff;
  font-size: 4.8rem;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.02;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.24);
}

.public-landing-content h1 span {
  display: inline-block;
  margin-right: 0.1em;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.public-landing-actions {
  display: flex;
  justify-content: center;
}

.public-primary-action {
  min-width: 126px;
  border-color: #ffffff;
  color: #17332d;
  background: #ffffff;
}

.public-primary-action:hover {
  color: #ffffff;
  background: var(--accent);
}

.public-landing-notice {
  position: absolute;
  top: 24px;
  left: 50%;
  width: min(calc(100% - 32px), 560px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 7px;
  padding: 12px 16px;
  color: #ffffff;
  background: rgba(15, 84, 74, 0.9);
  text-align: center;
  transform: translateX(-50%);
}

.public-photo-credit {
  position: absolute;
  right: 18px;
  bottom: 14px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  text-decoration: none;
}

.public-photo-credit:hover {
  color: #ffffff;
  text-decoration: underline;
}

.form-errors {
  border: 1px solid #e7b9b4;
  border-radius: 7px;
  margin-bottom: 20px;
  padding: 13px 15px;
  color: var(--error);
  background: var(--error-bg);
}

.form-errors ul {
  margin: 7px 0 0;
  padding-left: 20px;
}

.sidebar-team-switcher {
  position: relative;
  margin: 24px 2px 0;
}

.sidebar-team-switcher summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border: 1px solid #dfe3e6;
  border-radius: 7px;
  padding: 8px 11px;
  background: #ffffff;
  cursor: pointer;
  list-style: none;
}

.sidebar-team-switcher summary::-webkit-details-marker {
  display: none;
}

.sidebar-team-switcher summary span:first-child {
  display: grid;
  min-width: 0;
}

.sidebar-team-switcher summary small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-team-switcher summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-switcher-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.team-switcher-menu form {
  margin: 0;
}

.team-switcher-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  border-radius: 5px;
  padding: 8px 9px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.team-switcher-option:hover,
.team-switcher-option.active {
  color: var(--accent-strong);
  background: #eaf3f0;
}

.team-switcher-option small {
  color: var(--muted);
  font-size: 0.72rem;
}

.sidebar-team-switcher + .sidebar-project-switcher {
  margin-top: 14px;
}

.sidebar-account {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 10px 6px 0;
}

.sidebar-account > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.sidebar-account strong,
.sidebar-account small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account strong {
  font-size: 0.8rem;
}

.sidebar-account small {
  color: var(--muted);
  font-size: 0.72rem;
}

.sidebar-sign-out {
  min-height: auto;
  padding: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 0.72rem;
}

.sidebar-sign-out:hover {
  color: var(--error);
  background: transparent;
}

.member-avatar {
  display: inline-grid;
  width: 38px;
  height: 38px;
  border: 1px solid #bfcfc9;
  border-radius: 50%;
  place-items: center;
  color: var(--accent-strong);
  background: #f2f7f5;
  font-weight: 800;
}

.settings-page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.settings-header,
.settings-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.settings-header {
  margin-bottom: 28px;
}

.settings-header h1,
.settings-section h2 {
  margin: 0;
}

.settings-header h1 {
  font-size: 2.4rem;
}

.settings-header p:not(.eyebrow),
.settings-section-heading > p {
  max-width: 540px;
  margin: 7px 0 0;
  color: var(--muted);
}

.settings-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 20px;
  padding: 28px;
  background: var(--surface-strong);
}

.settings-section-compact {
  padding-bottom: 24px;
}

.invite-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 0.7fr) minmax(160px, 0.55fr);
  align-items: end;
  gap: 14px;
  margin-top: 24px;
}

.scoped-invite-form .invite-content-groups,
.scoped-invite-form > .button {
  grid-column: 1 / -1;
}

.invite-content-groups,
.content-group-role-grid {
  border: 0;
  margin: 0;
  padding: 0;
}

.invite-content-groups legend,
.content-group-role-grid legend {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.invite-content-groups legend span {
  font-weight: 500;
}

.invite-group-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #fafaf8;
}

.invite-group-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.invite-group-options input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.invite-group-options label > span {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: 0.9rem;
}

.role-capability-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0 0;
}

.role-capability-list > div {
  border-left: 1px solid var(--line);
  padding: 20px;
}

.role-capability-list > div:first-child {
  border-left: 0;
  padding-left: 0;
}

.role-capability-list dt {
  color: var(--ink);
  font-weight: 800;
}

.role-capability-list dd {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.team-name-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 14px;
  max-width: 650px;
  margin-top: 20px;
}

.workspace-invite-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 14px;
  max-width: 780px;
  margin-top: 20px;
}

.workspace-invite-actions {
  display: flex;
  gap: 8px;
}

.count-label,
.role-label {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  background: #f7f7f4;
  font-size: 0.78rem;
  font-weight: 750;
}

.settings-list {
  margin-top: 20px;
}

.member-access-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.member-access-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafaf8;
}

.member-access-header,
.member-project-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.member-access-header {
  padding: 18px 20px;
}

.member-project-access-list {
  border-top: 1px solid var(--line);
}

.member-project-access {
  border-top: 1px solid var(--line);
  padding: 18px 20px 20px;
  background: var(--surface-strong);
}

.member-project-access:first-child {
  border-top: 0;
}

.member-project-heading small,
.locked-role small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.member-access-form {
  display: grid;
  grid-template-columns: minmax(210px, 0.7fr) minmax(300px, 1.3fr) auto;
  align-items: end;
  gap: 18px;
  margin-top: 16px;
}

.member-access-form .wide-access-field {
  grid-column: 1 / 2;
}

.locked-role {
  min-height: 46px;
  border: 1px solid #b9d8ce;
  border-radius: 6px;
  padding: 8px 11px;
  background: #eff8f5;
}

.content-group-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px;
}

.content-group-role-grid label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.content-group-role-grid:disabled {
  opacity: 0.48;
}

.member-access-actions {
  align-self: end;
}

.whole-project-note {
  grid-column: 2 / -1;
  align-self: end;
  margin: 0 0 10px;
  color: var(--muted);
}

.assigned-group-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.settings-row:first-child {
  border-top: 0;
}

.member-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.member-identity > div,
.invitation-row > div:first-child {
  display: grid;
  min-width: 0;
}

.member-identity small,
.invitation-row small {
  color: var(--muted);
}

.member-actions,
.member-role-form,
.invitation-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-role-form select {
  width: 130px;
}

.invitation-row {
  align-items: flex-start;
}

.invitation-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.invitation-actions form {
  margin: 0;
}

.invitation-link {
  width: min(360px, 38vw);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}

.delivery-warning {
  margin-top: 3px;
  color: var(--warn) !important;
}

.empty-state {
  margin: 20px 0 0;
  color: var(--muted);
}

@media (max-width: 760px) {
  .auth-panel {
    padding: 28px 22px;
  }

  .settings-page {
    width: min(100% - 24px, 1120px);
    padding-top: 24px;
  }

  .settings-header,
  .settings-section-heading,
  .settings-row {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-section {
    padding: 22px 18px;
  }

  .invite-form,
  .team-name-form,
  .workspace-invite-form {
    grid-template-columns: 1fr;
  }

  .role-capability-list {
    grid-template-columns: 1fr;
  }

  .role-capability-list > div,
  .role-capability-list > div:first-child {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding: 16px 0;
  }

  .role-capability-list > div:first-child {
    border-top: 0;
  }

  .member-access-header,
  .member-project-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .member-access-form,
  .content-group-role-grid {
    grid-template-columns: 1fr;
  }

  .member-access-form .wide-access-field,
  .whole-project-note {
    grid-column: 1;
  }

  .content-group-role-grid label {
    grid-template-columns: minmax(0, 1fr) minmax(130px, 0.75fr);
  }

  .member-actions,
  .member-role-form,
  .invitation-actions,
  .workspace-invite-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .member-role-form select,
  .invitation-link {
    width: 100%;
  }

  .sidebar-team-switcher {
    margin-top: 12px;
  }

  .team-switcher-menu {
    position: static;
    margin-top: 6px;
  }

  .sidebar-footer {
    display: grid;
    margin-top: 12px;
  }

  .public-landing-content h1 {
    font-size: 3rem;
  }

  .public-primary-action {
    width: 100%;
  }
}
