:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.55;
  color: #263348;
  background: #f3f5f9;
  --paper: #fff;
  --ink: #152236;
  --muted: #68778e;
  --line: #e1e6ef;
  --primary: #5143d7;
  --soft: #eeecff;
  --surface: #f8f9fc;
  --green: #126343;
  --amber: #8b5b09;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 11px 12px;
  border: 1px solid #cbd4e1;
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
}
textarea {
  resize: vertical;
}
label,
legend {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin: 20px 0 7px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 18px 0;
  min-width: 0;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 2rem;
  letter-spacing: -0.045em;
  line-height: 1.2;
  margin-bottom: 9px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
h2 {
  font-size: 1.04rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 14px;
}
h3 {
  font-size: 1rem;
  color: var(--ink);
}
p {
  font-size: 0.92rem;
}
small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}
strong {
  color: var(--ink);
}
.workspace {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #111d31;
  color: #d4deee;
  padding: 28px 17px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: inherit;
  text-decoration: none !important;
}
.brand small {
  font-size: 0.67rem;
  letter-spacing: 0;
  font-weight: 400;
  color: #9dabc2;
  margin-top: 2px;
}
.brand-mark {
  background: #6c5ae5;
  color: #fff;
  border-radius: 9px;
  width: 34px;
  height: 37px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 800;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 38px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #adbbd0;
  border-radius: 7px;
  padding: 11px 14px;
  font-size: 0.87rem;
}
.sidebar nav a span {
  font-size: 1.1rem;
  width: 18px;
  text-align: center;
}
.sidebar nav a[aria-current] {
  background: #2b3556;
  color: #fff;
  font-weight: 600;
}
.sidebar nav a:hover {
  background: #25304a;
  color: #fff;
  text-decoration: none;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 22px 10px 0;
  border-top: 1px solid #2b3750;
}
.sidebar-bottom p {
  font-size: 0.78rem;
  color: #8d9db7;
  margin: 9px 0;
}
.sidebar-bottom a {
  font-size: 0.76rem;
  color: #c7bdff;
}
.small-label {
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #8d9db7;
}
.workspace-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 72px;
  padding: 0 36px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  background: var(--paper);
  font-size: 0.79rem;
}
.workspace-label {
  color: var(--muted);
}
.account-links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.account-links a {
  color: var(--ink);
}
.account-links form {
  margin: 0;
}
.link-button {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 6px 0;
  font-size: 0.79rem;
}
.main {
  padding: 35px 36px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.eyebrow {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  margin-bottom: 10px;
}
.subtitle {
  color: var(--muted);
  font-size: 0.89rem;
  margin: 0;
  max-width: 75ch;
}
.heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 7px;
  font-size: 0.79rem;
  font-weight: 650;
  padding: 10px 16px;
  border: 1px solid transparent;
  min-height: 40px;
  text-decoration: none !important;
}
.button.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 3px #30257015;
}
.button.secondary {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}
.button.small {
  padding: 7px 12px;
  min-height: 32px;
  font-size: 0.72rem;
}
.button:hover {
  filter: brightness(0.96);
}
.full {
  width: 100%;
  margin-top: 15px;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 24px;
  min-width: 0;
  margin-bottom: 24px;
  box-shadow: 0 2px 3px #283d5c03;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.panel-heading h2 {
  margin: 0;
}
.panel-heading a,
.panel-heading > span {
  font-size: 0.76rem;
}
.panel-note,
.field-help {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.7;
  margin: 12px 0 16px;
}
.field-help {
  margin: 7px 0 15px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 25px;
}
.stat {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 10px;
  padding: 20px;
}
.stat > span {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 550;
}
.stat > strong {
  display: block;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  margin: 7px 0;
}
.stat small {
  font-size: 0.68rem;
}
.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr);
  gap: 24px;
}
.stack .panel:last-child {
  margin-bottom: 0;
}
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  color: inherit;
  text-decoration: none !important;
}
.list-row:first-of-type {
  padding-top: 4px;
}
.list-row:last-child {
  border-bottom: 0;
}
.list-row strong {
  font-size: 0.84rem;
  font-weight: 600;
}
.list-row small {
  margin-top: 4px;
}
.list-row:hover strong {
  color: var(--primary);
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 650;
  padding: 4px 8px;
  white-space: nowrap;
}
.badge.green {
  background: #e7f6ee;
  color: #176143;
}
.badge.amber {
  background: #fff4da;
  color: #8b5b09;
}
.badge.neutral {
  background: #eef1f6;
  color: #5a6980;
}
.status-list {
  margin: 0;
}
.status-list > div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  font-size: 0.8rem;
}
.status-list dt {
  color: var(--muted);
}
.status-list dd {
  font-weight: 650;
  color: var(--ink);
  margin: 0;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.mini-tool {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  color: inherit;
}
.mini-tool strong {
  display: block;
  font-size: 0.84rem;
  margin: 13px 0 3px;
  overflow-wrap: anywhere;
}
.tool-icon {
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--primary);
  border-radius: 9px;
  width: 35px;
  height: 35px;
  font-size: 1rem;
  font-weight: 700;
}
.cards .tool-card {
  margin: 0;
}
.tool-card h2 {
  margin-top: 19px;
}
.tool-card h2 a {
  color: var(--ink);
}
.tool-card p {
  font-size: 0.76rem;
  color: var(--muted);
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.domain-line {
  overflow-wrap: anywhere;
  min-height: 25px;
}
.card-actions {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 17px;
  font-size: 0.76rem;
}
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 24px;
}
.filter-bar input {
  max-width: 330px;
  flex: 1;
  min-width: 150px;
}
.filter-bar select {
  width: auto;
  max-width: 260px;
}
.filter-bar a {
  font-size: 0.8rem;
}
.table-panel {
  padding: 0;
  overflow: hidden;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.79rem;
}
th {
  background: var(--surface);
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 600;
  padding: 15px 22px;
  white-space: nowrap;
}
td {
  border-top: 1px solid var(--line);
  padding: 17px 22px;
  vertical-align: middle;
}
td small {
  margin-top: 4px;
}
td .strong {
  font-weight: 600;
  color: var(--ink);
}
.empty {
  text-align: center;
  padding: 34px 18px;
  color: var(--muted);
}
.empty h3 {
  margin-bottom: 9px;
}
.empty p {
  font-size: 0.8rem;
}
.empty a {
  font-size: 0.83rem;
}
.notice {
  border: 1px solid var(--line);
  padding: 14px 17px;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-bottom: 24px;
}
.notice.success {
  background: #ebf8f0;
  border-color: #b6dfc8;
  color: #176143;
}
.notice.error {
  background: #fff0ef;
  border-color: #efc1bd;
  color: #9b302b;
}
.notice.neutral {
  background: #f0f0fd;
  border-color: #d8d4f7;
  color: #4c4981;
}
.notice ul {
  padding-left: 20px;
  margin: 7px 0 0;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 25px 0;
  font-size: 0.8rem;
}
.detail-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 25px;
}
.form-panel {
  max-width: 820px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-grid label {
  margin-top: 0;
}
.check-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.81rem;
  margin: 5px 0;
}
.check-row input {
  width: auto;
  accent-color: var(--primary);
}
.form-actions {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 30px;
  font-size: 0.8rem;
}
.connection {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 15px;
  margin-top: 22px;
  font-size: 0.84rem;
}
.connection summary {
  cursor: pointer;
  font-weight: 600;
}
.code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 24px;
}
.editor-form {
  padding: 28px;
}
.read-only {
  padding: 10px 0;
  margin-bottom: 0;
  font-size: 0.86rem;
}
.block-heading {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.content-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  margin: 16px 0 22px;
  background: var(--surface);
}
.content-block legend {
  padding: 0 6px;
  font-size: 0.69rem;
  margin: 0;
  color: var(--muted);
}
.block-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.block-toolbar label {
  margin: 0;
  font-size: 0.7rem;
}
.block-toolbar select {
  font-size: 0.78rem;
  margin-top: 5px;
  padding: 7px 10px;
}
.block-actions {
  display: flex;
  gap: 5px;
}
.icon-button {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 9px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.9rem;
}
.content-block label {
  font-size: 0.75rem;
  margin-top: 13px;
}
.content-block textarea {
  font-size: 0.87rem;
}
.capabilities {
  margin-top: 24px;
}
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 18px 0 5px;
  margin-top: 25px;
}
.save-state {
  font-size: 0.69rem;
  color: var(--muted);
}
.local-preview {
  border-top: 1px solid var(--line);
  padding-top: 25px;
  margin-top: 25px;
}
.local-preview h2 {
  font-size: 1.4rem;
}
.local-preview p {
  white-space: pre-wrap;
}
.local-preview ol {
  padding-left: 25px;
}
.history-row {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.history-row strong {
  font-size: 0.75rem;
}
.history-row small {
  font-size: 0.65rem;
  margin-top: 3px;
}
.article-preview {
  max-width: 850px;
  padding: 40px;
}
.article-preview h1 {
  font-size: 2.3rem;
}
.article-preview .lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 32px;
}
.article-preview h2 {
  font-size: 1.4rem;
  margin-top: 30px;
}
.preserve {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.callout {
  background: var(--soft);
  padding: 18px;
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  margin: 22px 0;
  white-space: pre-wrap;
}
.chips {
  display: flex;
  gap: 7px;
}
.stack.compact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.workspace-footer {
  border-top: 1px solid var(--line);
  padding: 20px 36px;
  display: flex;
  gap: 15px;
  justify-content: space-between;
  font-size: 0.67rem;
  color: var(--muted);
}
.muted {
  color: var(--muted);
}
.fineprint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 20px 0 0;
}
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 25px;
  background: radial-gradient(at 20% 20%, #e7e4ff, transparent 55%), #f3f5f9;
}
.login-card {
  width: 100%;
  max-width: 435px;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  box-shadow: 0 18px 70px #25365312;
}
.login-card .brand {
  margin-bottom: 40px;
  color: var(--ink);
}
.login-card h1 {
  font-size: 1.8rem;
}
.login-card label {
  font-size: 0.79rem;
}
.login-card .full {
  margin-top: 26px;
}
.skip {
  position: absolute;
  left: -10000px;
}
.skip:focus {
  left: 15px;
  top: 15px;
  z-index: 100;
  background: var(--paper);
  padding: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid #8975ef;
  outline-offset: 3px;
}
@media (max-width: 1150px) {
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .editor-grid > aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .two-column {
    grid-template-columns: minmax(0, 1fr);
  }
  .main {
    padding: 28px 25px;
  }
  .topbar {
    padding: 0 25px;
  }
}
@media (max-width: 750px) {
  .workspace {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 17px;
  }
  .sidebar .brand {
    font-size: 1rem;
  }
  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 17px;
    gap: 4px;
  }
  .sidebar nav a {
    padding: 8px 10px;
    font-size: 0.75rem;
    gap: 7px;
  }
  .sidebar nav a span {
    display: none;
  }
  .sidebar-bottom {
    display: none;
  }
  .topbar {
    height: auto;
    min-height: 58px;
    padding: 14px 20px;
    flex-wrap: wrap;
  }
  .main {
    padding: 25px 18px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
  h1 {
    font-size: 1.75rem;
  }
  .tool-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .stats-grid {
    gap: 11px;
  }
  .stat {
    padding: 15px;
  }
  .stat strong {
    font-size: 1.9rem;
  }
  .panel {
    padding: 20px;
  }
  .table-panel {
    padding: 0;
  }
  .editor-form {
    padding: 18px;
  }
  .editor-grid > aside {
    display: block;
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .filter-bar select {
    width: 100%;
    max-width: 100%;
  }
  .filter-bar input {
    max-width: 100%;
  }
  .workspace-footer {
    padding: 18px;
    flex-direction: column;
    gap: 6px;
  }
  .article-preview {
    padding: 22px;
  }
  .login-card {
    padding: 26px;
  }
  .block-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .card-top .badge {
    white-space: normal;
  }
  .list-row {
    flex-wrap: wrap;
  }
  .detail-bar {
    gap: 12px;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    background: #151b27;
    color: #c0c9d8;
    --paper: #1d2635;
    --ink: #edf1fa;
    --muted: #99a7bd;
    --line: #334055;
    --primary: #baacff;
    --soft: #342f53;
    --surface: #202a3b;
  }
  .sidebar {
    background: #101827;
  }
  .button.primary {
    background: #8670e7;
    color: #fff;
  }
  .badge.green {
    background: #203d32;
    color: #94dbb6;
  }
  .badge.amber {
    background: #443823;
    color: #ebc67a;
  }
  .badge.neutral {
    background: #303c50;
    color: #c0cbdd;
  }
  .notice.neutral {
    background: #2c2c48;
    border-color: #45406c;
    color: #c6c0ef;
  }
  .notice.success {
    background: #1c3b30;
    border-color: #2b674a;
    color: #9ad7b2;
  }
  .notice.error {
    background: #492c2c;
    border-color: #6f4141;
    color: #f6b7b0;
  }
  .login-body {
    background: radial-gradient(at 20% 20%, #2e2547, transparent 55%), #151b27;
  }
  input,
  select,
  textarea {
    border-color: #495670;
  }
}

.stat-link { color: inherit; text-decoration: none; }
.stat-link:hover, .stat-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.queue-heading { padding: 1.25rem 1.5rem 0; }
.queue-note { padding: 0 1.5rem; }
.queue-homes { display: flex; flex-direction: column; gap: .5rem; white-space: nowrap; }
#export-checklist { scroll-margin-top: 1.5rem; }

.queue-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 750px) {
  .queue-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .queue-stats .stat:last-child { grid-column: 1 / -1; }
}
