:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: #263346;
  background: #f3f5f7;
  font-size: 16px;
  --blue: #24675f;
  --ink: #203c51;
  --muted: #5f6f80;
  --line: #dfe5e9;
  --paper: #fff;
  --radius: 10px;
  --accent-soft: #eaf3f0;
  --shadow: 0 12px 40px #20364712;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button,
input,
select {
  border-radius: 6px;
}
button {
  border: 1px solid var(--line);
  background: #fff;
  color: inherit;
  padding: 7px 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
button:hover:not(:disabled) {
  background: #edf2f4;
  border-color: #b5c4cc;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #8a9daa;
  outline-offset: 2px;
}
input,
select {
  border: 1px solid #cbd5db;
  background: #fff;
  color: inherit;
  padding: 8px 10px;
  min-width: 0;
  min-height: 36px;
  font-size: 0.875rem;
}
input::placeholder {
  color: #8996a3;
  font-weight: 400;
  opacity: 1;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.8125rem;
  font-weight: 500;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
[hidden] {
  display: none !important;
}
.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}
.primary:hover:not(:disabled) {
  background: #305a6e;
  border-color: #305a6e;
}
.quiet {
  background: transparent;
  border-color: transparent;
  color: #607184;
}
.quiet:hover:not(:disabled) {
  background: #e9eff2;
  border-color: transparent;
  color: #203c51;
}
.eyebrow {
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  margin: 0 0 8px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--ink);
  color: #fff;
  border-radius: 7px;
  font: 500 18px/1 "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  text-align: center;
  flex-shrink: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.error {
  color: #ad3d36;
  font-size: 0.8125rem;
  line-height: 1.6;
  margin: 8px 0;
}
.notice {
  padding: 8px 12px;
  background: #fcf6e9;
  border: 1px solid #ecdebc;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #826027;
  line-height: 1.6;
  flex-shrink: 0;
}
/* Entry */
.login-view {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef2f3;
}
.login-card {
  width: 100%;
  max-width: 460px;
  border: 1px solid #dce4e6;
  border-radius: 14px;
  background: #fff;
  padding: 42px;
  box-shadow: var(--shadow);
}
.login-card > .brand-mark {
  width: 44px;
  height: 44px;
  font-size: 26px;
  margin-bottom: 30px;
}
.login-card h1 {
  font-size: 1.75rem;
  letter-spacing: -0.04em;
  margin: 0 0 14px;
}
.login-description {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.9;
  margin: 0 0 30px;
}
.password-field {
  display: flex;
  border: 1px solid #cbd5db;
  border-radius: 7px;
  margin-top: 8px;
  overflow: hidden;
}
.password-field:focus-within {
  outline: 2px solid #8a9daa;
  outline-offset: 2px;
}
.password-field input {
  border: 0;
  width: 100%;
  min-height: 44px;
  outline: none;
}
.password-field button {
  border-radius: 0;
  flex-shrink: 0;
}
.login-card .primary {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  padding: 12px 16px;
}
.login-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 28px 0 0;
  display: flex;
  justify-content: space-between;
}
/* Application chrome */
.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 360px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  flex-shrink: 0;
  padding: 6px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #203447;
  font-weight: 650;
  font-size: 0.95rem;
  white-space: nowrap;
}
.app-nav {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  gap: 4px;
  margin-right: auto;
  white-space: nowrap;
}
.app-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  font-size: 0.8125rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.nav-icon { width: 17px; height: 17px; flex: 0 0 17px; }
.system-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 32px 36px 50px;
  scrollbar-gutter: stable;
}
.system-connect-link { font-size: 0.8125rem; display: inline-block; padding: 6px 0; }
.app-nav a:hover {
  text-decoration: none;
  color: var(--ink);
  background: #f4f7f7;
}
.app-nav a[aria-current="page"] {
  color: var(--blue);
  font-weight: 650;
  border-bottom-color: var(--blue);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.header-actions button {
  padding: 6px 9px;
}

.sync-status {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
  font-size: 0.75rem;
}
.status-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #368879;
}
.sync-status[data-stale="true"] .status-dot {
  background: #b4873b;
}
.main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  margin: 0;
  padding: 8px 24px 12px;
  gap: 8px;
}
.filter-section {
  flex-shrink: 0;
}
.filter-form {
  display: flex;
  align-items: center;
  gap: 12px;
}
.filter-form label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.filter-form input,
.filter-form select {
  height: 36px;
  padding: 6px 9px;
}




.filter-secondary {
  display: flex;
  flex: 1;
  gap: 12px;
  min-width: 0;
}
.source-control {
  width: 230px;
  flex-shrink: 0;
}
.search-control {
  flex: 1;
  min-width: 150px;
}
.source-control select,
.search-control input {
  flex: 1;
  width: 0;
}
.apply {
  min-height: 36px;
  min-width: 84px;
  padding: 6px 12px;
}
.apply[data-dirty="true"] {
  background: var(--blue);
  border-color: var(--blue);
}






.mobile-filter-toggle {
  display: none;
}
.active-filters {
  display: flex;
  gap: 6px;
  padding-top: 5px;
  flex-wrap: wrap;
}
.active-filters button {
  font-size: 0.75rem;
  padding: 3px 8px;
  background: #fff;
  border-color: #d3dedf;
  color: #345c62;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Reader */
.workspace {
  display: grid;
  grid-template-columns: 345px minmax(0, 1fr);
  flex: 1;
  min-height: 150px;
  background: #fff;
  border: 1px solid #d9e1e5;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px #243c4e04;
}
.list-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}
.list-heading,
.reading-toolbar {
  height: 46px;
  min-height: 46px;
  flex-shrink: 0;
}
.list-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}
.list-heading h2 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 650;
  white-space: nowrap;
}
.list-heading h2 span {
  margin-left: 6px;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.75rem;
}

.article-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.article-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid #e7ecef;
  border-radius: 0;
  background: transparent;
  position: relative;
}
.article-row:last-child {
  border-bottom: 0;
}
.article-row:hover:not(:disabled) {
  background: #f0f5f4;
  border-color: #e7ecef;
}
.article-row.selected {
  background: #e9f2ef;
}
.article-row.selected:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--blue);
}
.row-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.7rem;
  color: #5c6e7f;
  margin-bottom: 7px;
}
.row-source {
  color: #416c66;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 66%;
}
.row-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.9375rem;
  line-height: 1.65;
  font-weight: 550;
  margin: 0;
  color: #263b4d;
}
.row-summary {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1.7;
  color: #617181;
  margin: 7px 0 0;
}
.row-images {
  font-size: 0.7rem;
  color: #556c70;
  margin-top: 8px;
  display: block;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
  font-size: 0.7rem;
  color: #66778a;
  flex-shrink: 0;
}
.pagination > button {
  padding: 5px 10px;
}



.reading-pane {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  background: #fff;
}
.reading-panel {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
  background: #fff;
  scrollbar-gutter: stable;
}
.reading-empty {
  height: 100%;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  color: var(--muted);
}
.empty-symbol {
  font:
    38px "Songti SC",
    "SimSun",
    serif;
  color: #9eb4b4;
  margin-bottom: 8px;
}
.reading-empty h2 {
  font-size: 1.05rem;
  color: #40586a;
  font-weight: 550;
  margin: 10px 0;
}
.reading-empty p {
  font-size: 0.8125rem;
  line-height: 1.8;
  margin: 0;
  max-width: 280px;
}
.reading-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  color: #667c8d;
  position: sticky;
  top: 0;
  background: #ffffffed;
  backdrop-filter: blur(10px);
  z-index: 2;
}
.reading-context {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.reading-context > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reading-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.source-info { position: relative; min-width: 0; }
.source-info-toggle {
  display: flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 6px 0; border: 0; background: transparent; color: #667c8d;
  font-size: inherit; font-weight: 400; text-align: left;
}
.source-info-toggle:hover:not(:disabled) { background: transparent; color: #344e5d; }
.source-info-toggle > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wechat-icon { width: 19px; height: 19px; flex: 0 0 19px; color: #8b969d; }
.source-info-card {
  position: absolute; top: calc(100% + 7px); left: 0;
  width: min(286px, calc(100vw - 100px)); padding: 18px;
  border: 1px solid #e0e6e9; border-radius: 10px; background: #fff;
  box-shadow: 0 8px 28px #2337471a; color: #344e5d; z-index: 4;
  cursor: default; font-size: .75rem;
}
.source-info-card::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.source-info-caption { margin: 0 0 6px; color: #85919a; font-size: .6875rem; }
.source-info-card h2 { margin: 0 0 15px; font-size: .9375rem; line-height: 1.5; overflow-wrap: anywhere; }
.source-info-card dl { margin: 0; display: grid; gap: 11px; }
.source-info-card dl > div { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 10px; line-height: 1.6; }
.source-info-card dt { color: #81909c; }
.source-info-card dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.source-info-note { margin: 15px 0 0; padding-top: 12px; border-top: 1px solid #edf0f2; color: #8b969d; font-size: .6875rem; }
.reading-controls button {
  font-size: 0.75rem;
  padding: 5px 8px;
}

.article-content {
  width: 100%;
  max-width: 800px;
  min-width: 0;
  margin: 0 auto;
  padding: 34px 44px 50px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  color: #718191;
  padding-bottom: 20px;
  margin-bottom: 26px;
  border-bottom: 1px solid #e8edf0;
}
#original-link { margin-left: auto; padding: 4px 0 4px 8px; font-size: .75rem; white-space: nowrap; }
.detail-date {
  font-size: 0.75rem;
  color: #718191;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.article-content > h1 {
  font-size: clamp(1.35rem, 1.8vw, 1.85rem);
  line-height: 1.6;
  margin: 0 0 16px;
  color: #203649;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}
.article-content > h1:focus {
  outline: none;
}
/* Reader typography is scoped to article content, independent of API data. */
.prose {
  font-size: 17px;
  line-height: 1.8;
  letter-spacing: normal;
  color: #343b42;
  text-align: left;
  word-break: normal;
  overflow-wrap: break-word;
}
.prose p { margin: 0 0 1em; }
.prose :is(h1,h2,h3,h4,h5,h6) {
  margin: 1.8em 0 .65em;
  color: #263b49;
  line-height: 1.5;
  letter-spacing: normal;
  font-weight: 600;
  text-wrap: pretty;
}
.prose h1 { font-size: 1.5em; }
.prose h2 { font-size: 1.3em; }
.prose h3 { font-size: 1.15em; }
.prose :is(h4,h5,h6) { font-size: 1em; }
.prose :is(h1,h2,h3,h4,h5,h6) + :is(h2,h3,h4,h5,h6) { margin-top: 1em; }
.prose strong, .prose b { font-weight: 600; }
.prose a { color: #276f66; text-decoration: underline; text-decoration-color: #9bbfb8; text-underline-offset: 3px; overflow-wrap: anywhere; }
.prose a:hover { text-decoration-color: currentColor; }
.prose :is(ul,ol) { padding-left: 1.6em; margin: 1em 0 1.3em; }
.prose li { padding-left: .2em; margin: .4em 0; }
.prose li::marker { color: #647a82; }
.prose li > p { margin: .4em 0; }
.prose li :is(ul,ol) { margin: .4em 0; }
.prose sup, .prose sub { font-size: .75em; line-height: 0; position: relative; vertical-align: baseline; }
.prose sup { top: -.5em; }
.prose sub { bottom: -.2em; }
.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  cursor: zoom-in;
  border-radius: 3px;
  background: #f3f5f6;
}
.prose .prose-image { margin: 1.4em 0; }
.prose .prose-image img { margin: 0 auto; }
.prose .prose-image img + img { margin-top: 18px; }
.prose figure { margin: 1.4em 0; }
.prose figure img { margin: 0 auto; }
.prose figcaption, .prose .prose-image-caption {
  font-size: .8125rem; line-height: 1.65; color: #68747c; text-align: center;
  margin: 8px 0 24px;
}
.prose .prose-image:has(+ .prose-image-caption) { margin-bottom: 8px; }
.prose .prose-source-note { color: #748088; font-size: .8125rem; line-height: 1.65; margin: 0 0 20px; }
.prose-table-scroll { overflow-x: auto; max-width: 100%; margin: 1.5em 0; border: 1px solid #dfe5e8; border-radius: 6px; }
.prose table { border-collapse: collapse; width: 100%; font-size: .875rem; line-height: 1.65; }
.prose td, .prose th { padding: 10px 12px; border: 1px solid #e5e9ec; min-width: 100px; vertical-align: top; }
.prose th { background: #edf3f2; color: #364f59; font-weight: 600; text-align: left; }
.prose tbody tr:nth-child(even) { background: #f8fafb; }
.prose :is(td,th) > :last-child { margin-bottom: 0; }
.prose :is(td,th) p { margin: 0 0 .65em; }
.prose :is(td,th) img { max-width: min(100%, 360px); }
.prose blockquote { margin: 1.4em 0; padding: 14px 20px; border-left: 3px solid #9bbdb5; color: #526269; background: #f4f7f6; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: #f0f3f5; border-radius: 3px; padding: .12em .3em; overflow-wrap: anywhere; }
.prose pre { overflow-x: auto; white-space: pre; background: #f3f6f7; border: 1px solid #e5eaed; border-radius: 6px; padding: 16px; margin: 1.4em 0; font-size: .8125rem; line-height: 1.65; }
.prose pre code { padding: 0; background: none; border-radius: 0; font-size: inherit; overflow-wrap: normal; }
.prose hr { border: 0; border-top: 1px solid #e0e6e9; margin: 28px 0; }
.prose > :first-child { margin-top: 0; }
.prose :is(img,.prose-table-scroll):focus-visible { outline: 2px solid #6eaaa0; outline-offset: 3px; }
.article-end {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--muted);
}
.mobile-back {
  display: none;
}



.list-message {
  padding: 38px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.8;
}
.list-message strong {
  display: block;
  color: #40596b;
  font-size: 1rem;
  margin-bottom: 8px;
}
.list-message button {
  margin-top: 14px;
}
.busy {
  opacity: 0.5;
  pointer-events: none;
}
.loading-line {
  width: 100%;
  height: 3px;
  position: absolute;
  top: 0;
  background: linear-gradient(90deg, transparent, #579286, transparent);
  animation: loading 1.5s ease-in-out infinite;
}
.loading-state {
  position: relative;
}
.loading-state .empty-symbol {
  animation: pulse 1.4s ease-in-out infinite;
}
.prose mark,
.row-title mark,
.row-summary mark {
  background: #e3edbc;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}
/* Dialogs and transient feedback */
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #14293b70;
  backdrop-filter: blur(3px);
}
.status-dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 24px;
  color: #33495a;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.dialog-heading h2 {
  font-size: 1.1rem;
  margin: 0;
}
.dialog-heading button {
  font-size: 22px;
  padding: 0 8px;
}
.status-dialog p {
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--muted);
}
.status-dialog dl {
  margin: 20px 0;
}
.status-dialog dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
}
.status-dialog dt {
  color: var(--muted);
}
.status-dialog dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}
.status-help {
  background: #f3f7f7;
  padding: 12px;
  border-radius: 6px;
}
.image-dialog {
  padding: 56px 20px 20px;
  border: 0;
  border-radius: 10px;
  background: #132333;
  max-width: 96vw;
  max-height: 94dvh;
  overflow: auto;
}
.image-dialog button {
  position: fixed;
  right: 4vw;
  top: 4vh;
  background: #263f51;
  color: #fff;
  border-color: #597080;
  z-index: 3;
}
.image-dialog img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: auto;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #203c51;
  color: #fff;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 0.8125rem;
  box-shadow: var(--shadow);
  z-index: 20;
  max-width: 90vw;
  text-align: center;
}
/* Developer workspace */
.api-view {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
  margin: 0;
}
.api-sidebar {
  padding: 30px 20px 20px;
  border-right: 1px solid var(--line);
  background: #f7f9fa;
  overflow-y: auto;
}
.api-sidebar h1 {
  font-size: 1.125rem;
  margin: 0 0 26px;
  color: #2d475a;
}
.api-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.api-sidebar nav button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 10px;
  color: #6b7b8c;
  font-size: 0.8125rem;
}
.api-sidebar nav button span {
  font:
    11px ui-monospace,
    monospace;
  color: #6d7e8d;
  margin-right: 8px;
}
.api-sidebar nav button[aria-current="page"] {
  color: #235f57;
  background: #e7f0ed;
  font-weight: 650;
}
.download-spec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #345e55;
  background: #fff;
  border: 1px solid #cbd8d3;
  border-radius: 6px;
  margin: 0;
  padding: 9px 10px;
  white-space: nowrap;
}
.download-spec-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.download-spec:hover {
  background: #edf4f1;
  border-color: #8baaa0;
  text-decoration: none;
}
.api-resources { max-width: 1100px; margin: 20px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.api-resources h2 { margin: 0 0 7px; }
.api-resources p { margin: 0; font-size: .75rem; }
.api-resources .download-spec { flex-shrink: 0; }
.api-container {
  min-width: 0;
  overflow-y: auto;
  padding: 30px 36px 50px;
  scrollbar-gutter: stable;
}
.api-section {
  max-width: 1100px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.api-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 4px;
}
.api-intro h2,
.api-intro h1 {
  font-size: 1.55rem;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
  color: #223d50;
}
.api-intro p:not(.eyebrow) {
  margin: 0;
  font-size: 0.8125rem;
  color: #6a7d8b;
  line-height: 1.8;
}
.api-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 24px;
  min-width: 0;
}
.api-card h2,
.api-card h3 {
  font-size: 1rem;
  margin: 0 0 14px;
  color: #284556;
}
.api-card p,
.api-card li {
  font-size: 0.8125rem;
  line-height: 1.85;
  color: #5b6e7f;
}
.api-card p:last-child {
  margin-bottom: 0;
}
.api-card .api-caption {
  font-size: 0.75rem;
  color: #627383;
}
.api-card code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.85em;
  overflow-wrap: anywhere;
}
.api-card p code,
.api-card li code {
  background: #eff4f4;
  padding: 2px 4px;
  border-radius: 3px;
}
.credential-row {
  display: grid;
  grid-template-columns: 85px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #e9eff1;
}
.credential-row > span {
  font-size: 0.8125rem;
  color: var(--muted);
}
.credential-row code {
  font-size: 0.8125rem;
  line-height: 1.7;
  user-select: all;
}
.credential-row button {
  white-space: nowrap;
  padding: 5px 10px;
}
.api-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 10px 0;
}
.api-steps > div {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 5px 10px;
}
.api-steps b {
  grid-row: span 2;
  background: #e5eeeb;
  border: 1px solid #d6e4df;
  color: #39776d;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
}
.api-steps strong {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #3e5867;
}
.api-steps span {
  font-size: 0.75rem;
  color: #5e7180;
}
.api-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.api-card ul {
  padding-left: 20px;
  margin: 0;
}
.api-card li + li {
  margin-top: 10px;
}
.api-workbench {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.api-request-card {
  padding: 20px;
}
.api-example-form,
.api-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 10px;
}
.api-fields,
.api-wide {
  grid-column: 1/-1;
}
.api-example-form input,
.api-example-form select {
  width: 100%;
  font-size: 0.8125rem;
}
.api-example-form label {
  font-size: 0.75rem;
  min-width: 0;
}
.api-example-form button {
  min-height: 36px;
}
.api-example-form > .primary {
  grid-column: 1/-1;
}
.api-output-card {
  padding: 0;
  overflow: hidden;
  position: sticky;
  top: 0;
}
.api-output-tabs {
  display: flex;
  background: #f9fbfb;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
}
.api-output-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 14px 16px;
  color: #738593;
  font-size: 0.8125rem;
}
.api-output-tabs button[aria-selected="true"] {
  border-bottom-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}
.response-meta,
.code-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 12px 16px;
}
.response-meta button {
  font-size: 0.7rem;
  padding: 4px 6px;
}
.response-meta > span[data-success="true"] {
  color: #2d7968;
}
.response-meta > span[data-success="false"] {
  color: #a85543;
}
.api-request-path {
  font:
    11px/1.7 ui-monospace,
    monospace;
  color: #647c8c;
  background: #edf3f5;
  padding: 8px 16px;
  margin: 0;
  overflow-wrap: anywhere;
}
.api-request-path:empty {
  display: none;
}
.api-card pre {
  background: #183044;
  color: #d7e5ed;
  padding: 20px;
  margin: 0;
  overflow: auto;
  font:
    12px/1.8 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  tab-size: 4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-height: 260px;
  max-height: 570px;
}
.api-card pre code {
  font-size: inherit;
  overflow-wrap: inherit;
}
.api-output-card .api-caption {
  margin: 0;
  padding: 0 16px 12px;
}
.api-output-card .notice {
  margin: 10px;
  font-size: 0.75rem;
}
.code-heading select {
  font-size: 0.75rem;
  min-height: 30px;
  padding: 4px 8px;
}
.code-heading button {
  font-size: 0.75rem;
  padding: 5px 8px;
}
.api-table-wrap {
  overflow: auto;
}
.api-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  text-align: left;
  line-height: 1.8;
}
.api-card th {
  color: #718593;
  font-size: 0.75rem;
  font-weight: 500;
  background: #f5f8f8;
  white-space: nowrap;
}
.api-card td,
.api-card th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.api-card td:first-child {
  white-space: nowrap;
}
.api-card td code {
  font-size: 0.75rem;
}
@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}
@keyframes loading {
  50% {
    opacity: 0.3;
  }
}
@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: 380px minmax(0, 1fr);
  }
}
@media (max-width: 1350px) {

  .source-control {
    width: 205px;
  }
  .filter-form,
  .filter-secondary {
    gap: 10px;
  }

}
@media (max-width: 1100px) {
  .topbar {
    padding: 6px 16px;
    gap: 14px;
  }
  .main {
    padding: 8px 16px 10px;
  }
  .sync-status {
    font-size: 0.7rem;
  }



  .source-control {
    width: 175px;
  }
  .filter-form label {
    gap: 6px;
  }
  .search-control {
    min-width: 130px;
  }

  .workspace {
    grid-template-columns: 310px minmax(0, 1fr);
  }
  .article-content {
    padding: 26px 28px 45px;
  }
  .reading-toolbar {
    padding: 0 12px;
  }
  .api-view {
    grid-template-columns: 165px minmax(0, 1fr);
  }
  .api-sidebar {
    padding: 26px 12px;
  }
  .api-container {
    padding: 24px;
  }
  .api-workbench {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 14px;
  }
  .api-request-card {
    padding: 16px;
  }
  .api-steps {
    gap: 8px;
  }
  .api-steps span {
    font-size: 0.7rem;
  }
}
@media (min-width: 721px) and (max-width: 880px) {
  .filter-form {
    flex-wrap: wrap;
  }

  .filter-secondary {
    flex-basis: 100%;
    order: 3;
  }
  .search-control {
    flex: 1;
  }
  .source-control {
    width: 220px;
  }
  .sync-status span:last-child {
    display: none;
  }

  .reading-context > span {
    max-width: 130px;
  }
  .api-workbench {
    grid-template-columns: 1fr;
  }
  .api-output-card {
    position: static;
  }
  .api-steps {
    grid-template-columns: 1fr;
  }
  .api-steps span {
    display: none;
  }
  .api-steps b {
    grid-row: auto;
  }
  .api-two-col {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .topbar {
    padding: 6px 12px;
    gap: 8px;
  }
  .brand > span:last-child {
    display: none;
  }
  .app-nav {
    gap: 0;
  }
  .app-nav a {
    padding: 0 6px;
    gap: 4px;
    font-size: 0.8rem;
  }
  .sync-status {
    display: none;
  }
  .header-actions {
    gap: 0;
  }
  .header-actions button {
    padding: 6px 8px;
    font-size: 0.75rem;
  }
  .main {
    padding: 8px 10px 10px;
    gap: 6px;
  }
  .filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 8px;
  }



  .filter-secondary {
    display: none;
    grid-column: 1/-1;
    flex-direction: column;
    gap: 8px;
    order: 3;
  }
  .filter-secondary.expanded {
    display: flex;
  }
  .source-control,
  .search-control {
    width: 100%;
    min-width: 0;
  }
  .source-control select,
  .search-control input {
    height: 38px;
  }
  .filter-form label {
    font-size: 0.75rem;
  }
  .apply {
    min-width: 0;
    width: 72px;
    padding: 6px;
    font-size: 0.75rem;
  }




  .mobile-filter-toggle {
    display: block;
    order: 2;
    font-size: 0.7rem;
    padding: 6px 4px;
  }






  .active-filters {
    padding-top: 4px;
  }
  .workspace {
    display: flex;
    min-height: 120px;
  }
  .list-panel {
    width: 100%;
    border-right: 0;
  }
  .reading-pane {
    display: none;
    width: 100%;
  }
  .article-row {
    padding: 14px 16px;
  }
  .row-title {
    font-size: 0.9375rem;
    -webkit-line-clamp: 3;
  }
  .row-meta {
    font-size: 0.75rem;
  }
  .row-summary {
    font-size: 0.8rem;
  }
  .pagination {
    font-size: 0.75rem;
    padding: 8px 12px;
  }
  .pagination > button {
    min-height: 34px;
    min-width: 38px;
  }


  .app[data-reading="true"] .filter-section,
  .app[data-reading="true"] .list-panel,
  .app[data-reading="true"] #notice {
    display: none;
  }
  .app[data-reading="true"] .reading-pane {
    display: flex;
  }
  .mobile-back {
    display: block;
    padding: 4px 0;
    white-space: nowrap;
  }
  .reading-toolbar {
    padding: 0 10px;
    gap: 6px;
  }
  .reading-context > span {
    font-size: 0.7rem;
    max-width: 115px;
  }
  .reading-controls {
    gap: 0;
  }
  .reading-controls button {
    padding: 5px 7px;
    min-height: 32px;
  }


  .article-content {
    padding: 24px 20px 40px;
  }
  .article-content > h1 {
    font-size: 1.4rem;
    margin-bottom: 12px;
  }
  .article-meta { padding-bottom: 16px; margin-bottom: 20px; }
  #original-link { font-size: .7rem; }
  .detail-date {
    font-size: 0.7rem;
  }
  .prose {
    font-size: 16px;
    line-height: 1.85;
  }
  .login-card {
    padding: 30px;
  }
  .login-card h1 {
    font-size: 1.6rem;
  }
  .login-description {
    font-size: 0.8125rem;
  }
  .login-note {
    font-size: 0.7rem;
  }
  .image-dialog {
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }
  .toast {
    width: max-content;
    max-width: 90vw;
  }


  .api-view {
    display: flex;
    flex-direction: column;
  }
  .api-sidebar {
    padding: 0 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    overflow: visible;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .api-sidebar > .eyebrow,
  .api-sidebar h1 {
    display: none;
  }
  .api-sidebar nav {
    flex-direction: row;
    gap: 0;
    flex: 1 0 100%;
  }
  .api-sidebar nav button {
    flex: 1;
    text-align: center;
    padding: 13px 10px;
    font-size: 0.75rem;
    border-radius: 0;
  }
  .api-sidebar nav button span {
    display: none;
  }
  .download-spec {
    font-size: 0.7rem;
    margin: 0;
    padding: 8px;
  }
  .api-container {
    padding: 20px 12px 32px;
    min-height: 0;
  }
  .api-section {
    gap: 14px;
  }
  .api-intro {
    align-items: flex-start;
    gap: 12px;
  }
  .api-intro h2,
  .api-intro h1 {
    font-size: 1.3rem;
  }
  .api-intro p:not(.eyebrow) {
    font-size: 0.75rem;
  }
  .api-intro > button {
    font-size: 0.7rem;
    white-space: nowrap;
    padding: 4px;
  }
  .api-card {
    padding: 18px 16px;
  }
  .credential-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
  }
  .credential-row > span {
    grid-column: 1/-1;
    font-size: 0.75rem;
  }
  .credential-row code {
    font-size: 0.75rem;
  }
  .api-steps {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .api-steps b {
    grid-row: span 2;
  }
  .api-steps span {
    font-size: 0.75rem;
  }
  .api-two-col {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .api-card td,
  .api-card th {
    padding: 10px;
    min-width: 100px;
  }
  .api-card td:last-child {
    min-width: 220px;
  }
  .api-workbench {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .api-output-card {
    position: static;
    padding: 0;
  }
  .api-card pre {
    max-height: 430px;
    min-height: 200px;
  }
  .api-example-form label {
    font-size: 0.8rem;
  }
  .api-example-form input,
  .api-example-form select {
    min-height: 40px;
  }
  .api-example-form > .primary {
    min-height: 42px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media (min-width: 881px) {
  .api-output-card pre {
    max-height: max(260px, calc(100dvh - 380px));
  }
}

.boot-view {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.8125rem;
}
.boot-view .brand-mark {
  animation: pulse 1.4s ease-in-out infinite;
}


@media (max-width: 720px) {
  .header-actions .sync-status {
    display: flex;
    justify-content: center;
    min-width: 30px;
    min-height: 32px;
    padding: 6px;
  }
  .sync-status #sync-time {
    display: none;
  }
  .sync-status .status-dot {
    width: 7px;
    height: 7px;
  }
}

/* Unified date range picker */
.date-picker { position: relative; flex-shrink: 0; min-width: 0; }
.date-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; width: 280px; padding: 6px 10px; font-variant-numeric: tabular-nums; }
.date-toggle[aria-expanded="true"] { border-color: var(--blue); background: #f3f8f7; }
.date-toggle > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: 370px; max-width: calc(100vw - 20px); padding: 18px; background: #fff; border: 1px solid #d4dee4; border-radius: 12px; box-shadow: 0 12px 36px #20364924; }
.date-panel-title { margin: 0 0 12px; font-size: .875rem; font-weight: 600; }
.quick-ranges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.quick-ranges button { padding: 6px 10px; font-size: .75rem; background: #f5f7f8; border-color: transparent; }
.quick-ranges button.active { color: #215f56; background: #e1eeea; border-color: #aacdc3; }
.date-controls { display: flex; gap: 8px; align-items: end; }
.date-panel .date-controls label { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: stretch; gap: 6px; font-size: .75rem; color: #596d7b; }
.date-controls input { width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
.date-separator { padding-bottom: 9px; color: #8c9aa8; }
.date-panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #e9eef0; }
.date-panel-footer > span { color: #657586; font-size: .7rem; line-height: 1.7; }
.date-panel-footer button { white-space: nowrap; }
.filter-form > .reset { white-space: nowrap; padding: 6px; font-size: .75rem; }
@media (min-width: 721px) and (max-width: 880px) {
  .date-picker { flex: 1; }
}
@media (max-width: 720px) {
  .date-picker { width: 100%; }
  .date-toggle { width: 100%; font-size: .75rem; gap: 6px; }
  .date-panel { padding: 14px; }
  .date-controls input { padding: 6px; }
  .filter-form > .reset { grid-column: 2; grid-row: 2; font-size: .7rem; padding: 2px; min-height: 28px; }
  .mobile-filter-toggle { grid-column: 1; grid-row: 2; justify-self: start; padding: 4px 0; min-height: 28px; }
  .filter-secondary { order: 0; grid-row: 3; }
}
/* Immediate filters and complete range selection */
.filter-form { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; }
.date-picker { flex: 0 0 auto; }
.date-panel { max-height: calc(100dvh - 120px); overflow-y: auto; }
.source-picker { position: relative; flex: 0 0 220px; min-width: 0; }
.source-toggle { display: flex; width: 100%; min-height: 36px; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 10px; }
.source-toggle > span:first-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.source-toggle[aria-expanded="true"] { background: #f3f8f7; border-color: var(--blue); }
.source-panel { position: absolute; left: 0; top: calc(100% + 8px); z-index: 30; width: 330px; max-width: calc(100vw - 20px); max-height: calc(100dvh - 130px); overflow: auto; padding: 12px; background: #fff; border: 1px solid #d4dee4; border-radius: 12px; box-shadow: 0 12px 36px #20364924; }
.source-panel > input { width: 100%; }
.source-summary { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 8px 0; color: #657586; font-size: .7rem; }
.source-summary button { padding: 4px; font-size: .7rem; }
.source-list { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
.filter-form .source-list label { display: flex; flex-direction: row; white-space: normal; align-items: center; gap: 9px; padding: 9px 8px; border-radius: 6px; cursor: pointer; font-size: .8125rem; }
.source-list label:hover { background: #f0f6f4; }
.source-list label:has(:checked) { background: #eaf3f0; }
.filter-form .source-list input { width: 16px; height: 16px; min-height: 16px; padding: 0; flex-shrink: 0; accent-color: #367567; }
#source-empty { color: #657586; font-size: .8rem; padding: 20px 0; text-align: center; }
.filter-form .search-control { flex: 1; min-width: 100px; }
.filter-form .search-control input { width: 100%; }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; gap: 8px; }
.calendar-heading input { width: 150px; font-size: .875rem; text-align: center; }
.calendar-heading button { min-width: 34px; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.calendar-weekdays { text-align: center; font-size: .7rem; color: #657586; margin-bottom: 8px; }
.calendar-day { padding: 0; height: 36px; border-color: transparent; background: #fff; font-variant-numeric: tabular-nums; border-radius: 6px; }
.calendar-day.outside-month { color: #8997a4; }
.calendar-day[aria-current="date"] { box-shadow: inset 0 0 0 1px #9ebeb3; }
.calendar-day.in-range { background: #e7f2ed; color: #275c4f; }
.calendar-day.range-end { background: #367567; color: #fff; font-weight: 600; }
.calendar-day:hover { border-color: #367567; background: #e1eeea; color: #215f56; }
.calendar-hint { margin: 14px 0 5px; font-size: .75rem; color: #385c53; }
.date-zone { margin: 0; color: #718191; font-size: .7rem; }
.active-filters .clear-conditions { border: 0; background: transparent; text-decoration: underline; text-underline-offset: 3px; color: #657586; }
@media (max-width: 1100px) and (min-width: 721px) {
  .date-toggle { width: 260px; }
  .source-picker { flex-basis: 190px; }
}
@media (max-width: 720px) {
  .filter-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px; }
  .date-picker { grid-column: 1 / -1; width: 100%; }
  .date-toggle { width: 100%; }
  .source-picker { grid-column: 1; grid-row: 2; width: 100%; }
  .source-toggle { font-size: .75rem; }
  .filter-form .search-control { grid-column: 2; grid-row: 2; min-width: 0; width: 100%; }
  .source-panel { width: calc(100vw - 20px); }
}

/* Full sync timestamp remains readable on narrow screens. */
.sync-status #sync-time { display: inline; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .topbar { display: grid; grid-template-columns: auto 1fr auto; height: auto; min-height: 52px; column-gap: 8px; row-gap: 0; }
  .topbar > .brand { grid-column: 1; grid-row: 1; }
  .topbar > .app-nav { grid-column: 2; grid-row: 1; min-height: 34px; }
  .header-actions { display: contents; }
  .header-actions #logout { grid-column: 3; grid-row: 1; }
  .header-actions .sync-status { grid-column: 1 / -1; grid-row: 2; justify-self: end; min-height: 24px; padding: 2px 0; font-size: .7rem; }
}

/* Calm filter controls and a single, readable pagination row. */
.dropdown-chevron { display: block; flex: 0 0 12px; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#query, #source-search { font-weight: 400; }
#query:focus, #source-search:focus, #sort:focus { outline: none; box-shadow: none; }
.keyboard-navigation #query:focus, .keyboard-navigation #source-search:focus, .keyboard-navigation #sort:focus { outline: 1px solid #7d929f; outline-offset: 2px; }
.pagination { gap: 8px; padding: 10px 12px; }
.pagination > button { font-size: .75rem; padding: 6px 10px; white-space: nowrap; }
#page-info { flex: 1; text-align: center; white-space: nowrap; font-size: .75rem; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .system-view { padding: 22px 12px 32px; }
  .app-nav .nav-icon { width: 15px; height: 15px; flex-basis: 15px; }
}
@media (max-width: 380px) {
  .topbar { padding-left: 8px; padding-right: 8px; column-gap: 4px; }
  .app-nav a { padding: 0 4px; gap: 3px; font-size: .75rem; }
  .header-actions #logout { padding-left: 4px; padding-right: 4px; }
}

/* System overview: source → local collection → cloud archive → report delivery. */
.system-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.system-section-heading h2 { margin: 0; }
.system-section-heading > span { font-size: .75rem; color: var(--muted); }
.system-pipeline { list-style: none; padding: 0; margin: 28px 0 24px; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 24px; }
.system-pipeline .system-node { position: relative; margin: 0; min-width: 0; }
.system-icon { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: #edf3f2; color: #497c72; margin-bottom: 14px; }
.system-icon svg { width: 33px; height: 33px; }
.system-node-cloud .system-icon { background: #357a70; color: #fff; }
.system-node-python .system-icon { background: #edf1f8; color: #577899; }
.system-node:last-child .system-icon { background: #edf1f8; color: #577899; }
.system-node:not(:last-child)::after { content: '→'; position: absolute; top: 14px; right: -19px; color: #9bb0af; font-size: 20px; line-height: 24px; }
.system-node-cloud::after { border-top: 1px dashed #9bb0af; width: 22px; top: 26px !important; font-size: 0 !important; }
.system-node-cloud::before { content: ''; position: absolute; right: -19px; top: 23px; width: 6px; height: 6px; border-right: 1px solid #9bb0af; border-top: 1px solid #9bb0af; transform: rotate(45deg); }
.system-step-label { display: block; color: #73858c; font-size: .65rem; margin-bottom: 6px; white-space: nowrap; }
.system-node h3 { font-size: .875rem; margin: 0 0 8px; }
.system-node p { margin: 0; font-size: .75rem; line-height: 1.8; }
.system-integration-label { display: inline-block; margin-top: 8px; font-size: .625rem; line-height: 1.6; color: #836b43; border-bottom: 1px dashed #cebd9e; }
.system-sync-note { border-top: 1px solid var(--line); padding-top: 16px; display: flex; align-items: center; gap: 24px; }
.system-sync-note p { flex: 1; margin: 0; font-size: .75rem; }
.system-sync-note strong { color: #3b5b60; font-weight: 600; }
.system-sync-note button { padding: 4px 0; font-size: .75rem; flex-shrink: 0; }
.system-explain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.system-view .system-kicker { margin: 0 0 7px; font-size: .65rem; letter-spacing: .08em; color: #718a87; }
.system-shared-data { margin: 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); font-size: .75rem !important; color: #71808d; }
.system-twin-entries { padding-top: 18px; display: grid; gap: 22px; }
.system-twin { display: flex; gap: 14px; }
.system-small-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; flex: 0 0 36px; border-radius: 9px; color: #567f78; background: #f0f5f3; }
.system-small-icon svg { width: 23px; height: 23px; }
.system-twin h3 { font-size: .875rem; margin: 0 0 5px; }
.system-twin h3 span { margin-left: 8px; font-size: .65rem; font-weight: 400; color: #758791; }
.system-twin p { margin: 0; font-size: .75rem; }
.system-twin .system-connect-link { font-size: .75rem; padding: 5px 0 0; }
.system-twin-primary .system-small-icon { background: #e1efeb; color: #317569; }
.api-card .system-report-types { display: flex; gap: 6px; flex-wrap: wrap; padding: 0; list-style: none; margin: 0 0 22px; }
.api-card .system-report-types li { margin: 0; padding: 3px 8px; background: #f2f5f7; border-radius: 4px; color: #536b7d; font-size: .65rem; }
.system-deliverables { display: grid; grid-template-columns: minmax(0,1fr) 20px minmax(0,1fr); gap: 12px; }
.system-deliverables .system-small-icon { margin-bottom: 10px; }
.system-deliverables > div:last-child .system-small-icon { background: #edf2f8; color: #567b9d; }
.system-deliverables h3 { font-size: .875rem; margin: 0 0 7px; }
.system-deliverables p { margin: 0; font-size: .75rem; }
.system-output-arrow { color: #91a6ae; padding-top: 42px; }
.system-report-status { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; font-size: .75rem !important; }
.system-report-status strong { font-weight: 600; color: #455f70; }
@media (max-width: 1000px) {
  .system-pipeline { grid-template-columns: 1fr; gap: 26px; margin: 24px 0; }
  .system-pipeline .system-node { padding-left: 72px; min-height: 76px; }
  .system-icon { position: absolute; left: 0; top: 0; margin: 0; }
  .system-step-label { margin: 0 0 3px; }
  .system-node h3 { margin-bottom: 4px; }
  .system-node:not(:last-child)::after { content: '↓'; top: auto; bottom: -26px; left: 17px; right: auto; }
  .system-node-cloud::after { top: auto !important; height: 17px; width: 0; bottom: -21px !important; left: 26px !important; border-top: 0; border-left: 1px dashed #9bb0af; }
  .system-node-cloud::before { top: auto; right: auto; bottom: -21px; left: 23px; transform: rotate(135deg); }
  .system-explain-grid { grid-template-columns: 1fr; }
  .system-integration-label { margin-top: 4px; }
}
@media (max-width: 600px) {
  .system-section-heading > span { display: none; }
  .system-sync-note { display: block; }
  .system-sync-note button { margin-top: 8px; }
  .system-twin h3 span { display: block; margin: 3px 0 0; }
  .system-deliverables { gap: 8px; }
}

@media (max-width: 720px) {
  .api-resources { flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 14px; }
}

/* Reader controls: quiet icons, vertical sequence, discoverable keyboard navigation. */
.control-icon { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-label, .reading-controls button, #end-next { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.search-control { position: relative; }
.search-control > .control-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #8996a4; pointer-events: none; }
.search-control #query { padding-left: 36px; }
.sort-control { position: relative; flex-shrink: 0; }
.pagination { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 6px; row-gap: 2px; padding: 6px 10px; }
.pagination > button { border: 0; background: transparent; box-shadow: none; padding: 6px 4px; min-height: 30px; }
.pagination > button:hover:not(:disabled) { background: #f1f5f4; color: var(--accent); }
@media (max-width: 380px) { #logout { gap: 3px; } #logout .control-icon { width: 14px; height: 14px; flex-basis: 14px; } }

.page-chevron { width: 14px; height: 14px; flex-basis: 14px; }
.reading-controls { position: relative; gap: 4px; }
.article-keyboard-tooltip { position: absolute; right: 0; top: calc(100% + 8px); display: grid; gap: 6px; width: 252px; max-width: calc(100vw - 48px); padding: 12px 14px; border: 1px solid #e2e8eb; border-radius: 7px; background: #fff; color: #66778a; box-shadow: 0 4px 16px #23374714; font-size: .6875rem; line-height: 1.7; white-space: normal; z-index: 4; }
.article-keyboard-tooltip::before { content: ''; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.article-keyboard-tooltip kbd { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 20px; border: 1px solid #e0e6ea; border-bottom-width: 2px; border-radius: 4px; background: #f7f9fa; color: #526776; font-family: inherit; font-size: .75rem; }

.article-arrow { width: 15px; height: 15px; flex-basis: 15px; stroke-width: 1.7; }
.article-keyboard-tooltip strong { font-size: .75rem; font-weight: 550; color: #3d5263; }
.article-keyboard-tooltip small { font-size: .6875rem; color: #82909b; }

/* Consistent click-to-open reader selectors. */
.sort-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px; min-height: 30px; font-size: .75rem; color: #637386; border: 1px solid transparent; border-radius: 6px; }
.sort-toggle[aria-expanded="true"] { background: #f3f8f7; color: var(--blue); }
.sort-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 160px; padding: 6px; background: #fff; border: 1px solid #d4dee4; border-radius: 12px; box-shadow: 0 12px 36px #20364924; }
.sort-menu > button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: #526677; font-size: .75rem; font-weight: 400; }
.sort-menu > button[aria-checked="true"] { color: var(--blue); background: #f3f8f7; }
.sort-menu > button:hover, .sort-menu > button:focus-visible { background: #eaf3f0; outline: none; box-shadow: none; }
.sort-menu > button[aria-checked="false"] .sort-check { visibility: hidden; }
.date-toggle:hover, .source-toggle:hover { background: #f3f8f7; }
:is(.date-toggle, .source-toggle, .sort-toggle) .dropdown-chevron { transition: transform 140ms ease; }
:is(.date-toggle, .source-toggle, .sort-toggle)[aria-expanded="true"] .dropdown-chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { :is(.date-toggle, .source-toggle, .sort-toggle) .dropdown-chevron { transition: none; } }

/* Page endpoints live behind the page count, without extra permanent controls. */
.page-picker { position: relative; min-width: 0; display: flex; justify-content: center; align-items: center; }
.page-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 6px; min-height: 30px; font-size: .75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.page-toggle[aria-expanded="true"] { background: #f3f8f7; color: var(--blue); }
.page-toggle[aria-expanded="true"] .dropdown-chevron { transform: rotate(180deg); }
.page-menu { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 30; width: 194px; padding: 6px; background: #fff; border: 1px solid #d4dee4; border-radius: 12px; box-shadow: 0 8px 28px #20364924; }
.page-menu > button { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: #526677; font-size: .75rem; font-weight: 400; }
.page-menu > button small { color: #84919d; font-size: .6875rem; font-variant-numeric: tabular-nums; }
.page-menu > button:hover:not(:disabled), .page-menu > button:focus-visible { background: #eaf3f0; outline: none; box-shadow: none; }

/* Anchored to the reading pane, independently of its scrolling article. */
.back-to-top-control { position: absolute; right: 26px; bottom: 20px; z-index: 3; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(5px); transition: opacity 160ms ease, transform 160ms ease, visibility 160ms; }
.back-to-top-control[data-visible="true"] { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.back-to-top { display: grid; place-items: center; width: 40px; height: 40px; min-height: 40px; padding: 0; border: 1px solid #dbe4e8; border-radius: 50%; background: #fffffff5; color: #5a6f7c; box-shadow: 0 3px 12px #23374712; }
.back-to-top .control-icon { width: 18px; height: 18px; }
.back-to-top:hover { background: #f0f6f4; color: var(--blue); border-color: #bfcece; }
.back-to-top:active { background: #e7f0ed; }
.back-to-top-tip { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); padding: 7px 12px; border: 1px solid #e2e8eb; border-radius: 999px; background: #fff; color: #5a6f7c; box-shadow: 0 3px 12px #23374712; font-size: .75rem; line-height: 1.5; white-space: nowrap; }
.back-to-top-tip::after { content: ''; position: absolute; left: 100%; top: 0; width: 8px; height: 100%; }
@media (max-width: 720px) { .back-to-top-control { right: 22px; bottom: 14px; } }
