/* Plot guides — scoped styles using site design tokens */

.plots-page {
  margin: 0;
  min-height: 100vh;
  background: var(--bg, #f6f4ef);
  color: var(--text, #0f172a);
  font-family: var(--font-sans, "Segoe UI", system-ui, sans-serif);
  line-height: 1.55;
  overflow-x: hidden;
}

.plots-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border, rgba(15, 23, 42, 0.1));
  background: var(--surface, #fffcf8);
}

.plots-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text, #0f172a);
  text-decoration: none;
}
.plots-brand:hover {
  color: var(--accent, #0891b2);
}

.plots-topbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  font-size: 0.95rem;
}
.plots-topbar-links a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}
.plots-topbar-links a:hover {
  text-decoration: underline;
  color: #1d4ed8;
}
.plots-topbar-links a[aria-current="page"] {
  color: #0e7490;
}
.plots-lib {
  color: #0e7490;
}

.plots-main {
  width: 100%;
  max-width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px 16px 64px;
  overflow-x: hidden;
  box-sizing: border-box;
}

.plots-main--narrow {
  max-width: 760px;
}

.plots-footer {
  margin-top: 2.5rem;
  color: var(--muted, #4a5568);
  font-size: 0.9rem;
}
.plots-footer a {
  color: #2563eb;
}

.plots-lede,
.plots-intro,
.plots-note {
  color: var(--text-soft, #475569);
  max-width: 70ch;
  margin: 8px 0 18px;
  font-size: 1.05rem;
}

.plots-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  color: var(--muted, #4a5568);
  font-size: 0.92rem;
  margin-bottom: 18px;
}
.plots-stats b {
  color: var(--text, #0f172a);
}

/* Landing cards */
.plots-landing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 28px;
}
@media (min-width: 720px) {
  .plots-landing-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.plots-landing-card {
  display: block;
  background: var(--surface, #fffcf8);
  border: 1px solid var(--border, rgba(15, 23, 42, 0.1));
  border-radius: 10px;
  padding: 22px 22px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.plots-landing-card:hover {
  border-color: var(--accent, #0891b2);
  box-shadow: var(--shadow-md, 0 12px 40px rgba(15, 23, 42, 0.08));
}
.plots-landing-card h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  color: var(--accent, #0891b2);
}
.plots-landing-card p {
  margin: 0;
  color: var(--text-soft, #475569);
  font-size: 0.98rem;
}

/* Section nav (cheat sheet) */
.plots-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg, #f6f4ef);
  padding: 10px 0;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--border, rgba(15, 23, 42, 0.1));
}
.plots-section-nav a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft, #475569);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
}
.plots-section-nav a:hover,
.plots-section-nav a:focus-visible {
  color: var(--accent, #0891b2);
  background: var(--accent-soft, rgba(8, 145, 178, 0.12));
  outline: none;
}

.plots-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.plots-filter--sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg, #f6f4ef);
  padding: 10px 0;
}
.plots-filter input,
.plots-filter select {
  font: inherit;
  color: var(--text, #0f172a);
  background: var(--surface, #fffcf8);
  border: 1px solid var(--border-strong, #ddd8ce);
  border-radius: 6px;
  padding: 8px 12px;
}
.plots-filter input {
  flex: 1 1 240px;
  min-width: 0;
}
.plots-count {
  color: var(--muted, #4a5568);
  font-size: 0.9rem;
  margin-left: auto;
}

.plots-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.plots-chip {
  font: 600 0.82rem inherit;
  border: 1px solid var(--border-strong, #ddd8ce);
  background: var(--surface, #fffcf8);
  color: var(--muted, #4a5568);
  border-radius: 999px;
  padding: 4px 11px;
  cursor: pointer;
}
.plots-chip[aria-pressed="true"] {
  background: var(--accent, #0891b2);
  border-color: var(--accent, #0891b2);
  color: #fff;
}

.plots-section {
  margin-top: 36px;
}
.plots-section h2 {
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent, #0891b2);
  color: var(--accent, #0891b2);
  font-size: 1.3rem;
}

.plots-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 700px) {
  .plots-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
@media (min-width: 1024px) {
  .plots-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }
  .plots-grid--atlas {
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  }
}

.plots-card {
  background: var(--surface, #fffcf8);
  border: 1px solid var(--border, rgba(15, 23, 42, 0.1));
  border-radius: 8px;
  padding: 16px 18px;
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}
.plots-card-title,
.plots-card h3 {
  margin: 0;
  font-size: 1.15rem;
}
.plots-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.plots-cat {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent, #0891b2);
  font-weight: 600;
  white-space: nowrap;
}
.plots-q {
  font-style: italic;
  color: var(--muted, #4a5568);
  margin: 0;
}
.plots-row {
  margin: 2px 0;
  font-size: 0.95rem;
}
.plots-row span:first-child {
  display: inline-block;
  min-width: 92px;
  font-weight: 600;
  color: var(--muted, #4a5568);
}
.plots-row--no {
  color: #8b3414;
}

.plots-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 8px;
  min-width: 0;
  max-width: 100%;
}
.plots-pair > * {
  min-width: 0;
  max-width: 100%;
}
.plots-label {
  margin: 8px 0 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #4a5568);
  font-weight: 600;
}

.plots-tbl {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.plots-tbl table {
  border-collapse: collapse;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  max-width: none; /* allow internal scroll, not page scroll */
}
.plots-tbl th,
.plots-tbl td {
  padding: 3px 9px;
  border-bottom: 1px solid var(--border, rgba(15, 23, 42, 0.1));
  text-align: right;
  white-space: nowrap;
}
.plots-tbl th {
  color: var(--muted, #4a5568);
  font-weight: 600;
}

.plots-figure {
  margin: 0;
  background: #fff;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.1));
  border-radius: 6px;
  padding: 8px;
  max-width: 100%;
  box-sizing: border-box;
}
.plots-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
.plots-figure figcaption {
  font-size: 0.75rem;
  color: var(--muted, #4a5568);
  text-align: center;
  margin-top: 4px;
}

.plots-code-wrap {
  position: relative;
  min-width: 0;
}
.plots-copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  font: 600 0.75rem inherit;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-strong, #ddd8ce);
  background: var(--surface, #fffcf8);
  color: var(--text-soft, #475569);
  cursor: pointer;
}
.plots-copy-btn:hover,
.plots-copy-btn.is-ok {
  background: var(--accent-soft, rgba(8, 145, 178, 0.12));
  color: var(--accent, #0891b2);
}
.plots-code {
  background: var(--bg-subtle, #efece5);
  border-radius: 6px;
  padding: 10px 12px;
  padding-right: 64px;
  font-family: ui-monospace, Consolas, Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  overflow-x: auto;
  margin: 0;
  white-space: pre;
  max-width: 100%;
}

.plots-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 5px 10px;
  font-size: 0.92rem;
}
.plots-dl dt {
  color: var(--muted, #4a5568);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 3px;
}
.plots-dl dd {
  margin: 0;
}
.plots-avoid {
  color: #8b3414;
}

.plots-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.plots-tag {
  font-size: 0.74rem;
  background: var(--accent-soft, rgba(8, 145, 178, 0.12));
  color: var(--accent, #0891b2);
  border-radius: 4px;
  padding: 1px 7px;
}

.plots-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border, rgba(15, 23, 42, 0.1));
  margin-bottom: 18px;
}
.plots-tabs button {
  font: 600 0.95rem inherit;
  background: none;
  border: 0;
  color: var(--muted, #4a5568);
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.plots-tabs button[aria-selected="true"] {
  color: var(--accent, #0891b2);
  border-bottom-color: var(--accent, #0891b2);
}
.plots-tabs button:focus-visible,
.plots-filter input:focus-visible,
.plots-filter select:focus-visible,
.plots-chip:focus-visible,
.plots-copy-btn:focus-visible {
  outline: 2px solid var(--accent, #0891b2);
  outline-offset: 2px;
}

.plots-tablewrap {
  overflow-x: auto;
  background: var(--surface, #fffcf8);
  border: 1px solid var(--border, rgba(15, 23, 42, 0.1));
  border-radius: 8px;
  margin-bottom: 14px;
  max-width: 100%;
}
.plots-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
.plots-table th,
.plots-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border, rgba(15, 23, 42, 0.1));
  vertical-align: top;
}
.plots-table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #4a5568);
  background: var(--bg-subtle, #efece5);
  white-space: nowrap;
}
.plots-table tr:last-child td {
  border-bottom: 0;
}
.plots-table td:first-child {
  font-weight: 600;
}

.plots-twocol {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 720px) {
  .plots-twocol {
    grid-template-columns: 1fr 1fr;
  }
}
.plots-panel {
  background: var(--surface, #fffcf8);
  border: 1px solid var(--border, rgba(15, 23, 42, 0.1));
  border-radius: 8px;
  padding: 16px 18px;
}
.plots-panel h3 {
  font-size: 1.05rem;
  margin: 0 0 8px;
}
.plots-panel ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 0.93rem;
}

.plots-rules {
  padding-left: 24px;
}
.plots-rules li {
  margin-bottom: 6px;
}

.plots-empty {
  color: var(--muted, #4a5568);
  padding: 20px 0;
}

.plots-setup {
  margin-bottom: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Cheat sheet: side-by-side code+chart on mid widths; 2/3 card cols on larger */
@media (min-width: 640px) {
  #plots-cheat-root .plots-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  #plots-cheat-root .plots-pair {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}
@media (min-width: 900px) {
  #plots-cheat-root .plots-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  #plots-cheat-root .plots-pair {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (min-width: 1200px) {
  #plots-cheat-root .plots-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}
