/* Newsmind — single source of truth for all landing-page CSS.
 *
 * Layout:
 *   1. Design tokens          (CSS custom properties)
 *   2. Reset + base
 *   3. Body variants          (no class = marketing; .doc; .auth)
 *   4. Typography helpers     (.muted, .subtle, .lede)
 *   5. Page-nav back link     (.page-nav)
 *   6. Brand block            (.brand, .brand-row, …)
 *   7. Buttons                (.btn-primary, .btn-secondary, .btn-revoke, …)
 *   8. Form fields            (label, input)
 *   9. Inline messages        (.error, .success, .trial-callout, .callout)
 *  10. Code + pre + url-pill + copy buttons
 *  11. Marketing landing      (.hero, .examples-grid, .pricing, …)
 *  12. Install / doc page     (h1, h2, h3 in body.doc; tables, hr)
 *  13. Auth pages             (.alt, .forgot, .sub-card, .pat-row, .danger-zone)
 *  14. Account / tokens       (.spinner, .badge-ok / .badge-warn)
 *  15. Footer
 *  16. Mobile overrides
 *
 * Color tokens flip in @media (prefers-color-scheme: dark) at the top
 * so rules below this point can stay color-mode-agnostic. Components
 * that need a different *shape* in dark mode (card backgrounds, badges)
 * still get their own dark-mode rule next to the light-mode declaration.
 */

/* ─── 1. Design tokens ──────────────────────────────────────────────── */
:root {
  color-scheme: light dark;

  /* Brand */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-soft-bg: rgba(37, 99, 235, 0.1);

  /* Neutrals (light mode) */
  --color-text: #1f2937;
  --color-muted: #4b5563;
  --color-subtle: #6b7280;
  --color-border: #e5e7eb;
  --color-divider: #f3f4f6;
  --color-bg: #fff;
  --color-surface: #f9fafb;
  --color-surface-2: #f3f4f6;
  --color-card: #fff;

  /* Status */
  --color-success-bg: #ecfdf5;
  --color-success-text: #065f46;
  --color-success-border: #a7f3d0;
  --color-success-tint: rgba(34, 197, 94, 0.15);
  --color-success-check: #166534;
  --color-error-bg: #fef2f2;
  --color-error-text: #991b1b;
  --color-error-border: #fecaca;
  --color-warn-bg: #fffbeb;
  --color-warn-text: #92400e;
  --color-warn-border: #fde68a;
  --color-callout-bg: #eff6ff;
  --color-callout-border: #2563eb;
  --color-save-bg: #dcfce7;
  --color-save-text: #166534;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", Monaco, Consolas, "Liberation Mono", monospace;

  /* Layout caps */
  --max-w-form: 380px;       /* auth */
  --max-w-account: 460px;    /* /auth/account widening */
  --max-w-doc: 720px;        /* privacy / terms */
  --max-w-install: 760px;    /* install guide (slightly wider for code blocks) */
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-text: #e5e7eb;
    --color-muted: #d1d5db;
    --color-subtle: #9ca3af;
    --color-border: #1f2937;
    --color-divider: #1f2937;
    --color-bg: #0b0f17;
    --color-surface: #060a12;
    --color-surface-2: #1f2937;
    --color-card: #111827;

    --color-primary: #60a5fa;        /* link blue stays readable */
    --color-primary-hover: #93c5fd;
    --color-primary-soft-bg: rgba(96, 165, 250, 0.15);

    --color-success-bg: #064e3b;
    --color-success-text: #d1fae5;
    --color-success-border: #047857;
    --color-success-tint: rgba(16, 185, 129, 0.18);
    --color-success-check: #d1fae5;

    --color-error-bg: #450a0a;
    --color-error-text: #fca5a5;
    --color-error-border: #7f1d1d;

    --color-warn-bg: #451a03;
    --color-warn-text: #fde68a;
    --color-warn-border: #92400e;

    --color-callout-bg: #172554;
    --color-callout-border: #60a5fa;

    --color-save-bg: #14532d;
    --color-save-text: #bbf7d0;
  }
}

/* ─── 2. Reset + base ───────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  margin: 0;
  line-height: 1.6;
}

a { color: var(--color-primary); }

/* ─── 3. Body variants ──────────────────────────────────────────────── */
/* Marketing landing (index.html) uses no body class — sections handle
 * their own padding. Doc + auth variants center a constrained column. */
body.doc {
  max-width: var(--max-w-install);
  margin: 60px auto;
  padding: 0 24px;
  line-height: 1.7;
}
body.doc--narrow {
  max-width: var(--max-w-doc);
}
body.auth {
  max-width: var(--max-w-form);
  margin: 60px auto;
  padding: 0 20px;
  line-height: 1.5;
}
body.auth.account-page { max-width: var(--max-w-account); }

/* ─── 4. Typography helpers ─────────────────────────────────────────── */
.muted   { color: var(--color-muted); }
.subtle  { color: var(--color-subtle); }
.updated { color: var(--color-subtle); font-size: 14px; }

.lede {
  font-size: 19px; line-height: 1.35;
  color: var(--color-muted);
  max-width: 520px; margin: 0 auto 28px;
}
body.doc .lede { max-width: none; margin: 0 0 28px; }

/* ─── 5. Page-nav back link ─────────────────────────────────────────── */
/* Used at the top of every non-landing page. Gray + no underline by
 * default; blue + underline on hover. The :link/:visited dance plus
 * !important defends against (a) Safari's default visited purple, and
 * (b) any later `a { color }` rule that would override the gray.
 */
.page-nav { margin: 0 0 32px; font-size: 14px; }
.page-nav a:link,
.page-nav a:visited {
  color: var(--color-subtle) !important;
  text-decoration: none;
}
.page-nav a:hover {
  color: var(--color-primary) !important;
  text-decoration: underline;
}

/* ─── 6. Brand block ────────────────────────────────────────────────── */
/* Logo + wordmark + tagline, used on every auth page and the landing
 * hero. The .brand-text column flush-left-aligns the tagline under
 * the wordmark for a clean shared edge. */
.brand { text-align: center; margin-bottom: 40px; }
.brand-row { display: inline-flex; align-items: center; gap: 12px; }
.brand-icon { width: 48px; height: 48px; }
.brand-text { display: flex; flex-direction: column; align-items: flex-start; }
.brand-logo {
  font-size: 48px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.1;
  color: inherit; text-decoration: none;
}
.brand-tagline { font-size: 18px; color: var(--color-muted); line-height: 1.3; }

/* ─── 7. Buttons ────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--color-primary); color: #fff;
  border: 0; padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  display: inline-block;
}
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--color-primary); }

.btn-secondary {
  background: transparent; color: var(--color-primary);
  border: 1px solid var(--color-primary);
  padding: 12px 24px; border-radius: 8px;
  font-size: 16px; font-weight: 500;
  text-decoration: none; display: inline-block;
}

/* Auth-page submit button — full-width, default form-action button. */
body.auth button[type="submit"],
body.auth form button:not(.btn-revoke):not(.btn-danger):not(.pat-reveal-copy) {
  background: var(--color-primary); color: #fff;
  border: 0; padding: 10px 16px; border-radius: 6px;
  font-size: 14px; font-weight: 500;
  cursor: pointer; margin-top: 24px; width: 100%;
}
body.auth button[type="submit"]:hover,
body.auth form button:not(.btn-revoke):not(.btn-danger):not(.pat-reveal-copy):hover {
  background: var(--color-primary-hover);
}

.btn-revoke {
  background: transparent; color: #dc2626;
  border: 1px solid #fca5a5; padding: 4px 10px;
  border-radius: 6px; font-size: 12px; font-weight: 500;
  cursor: pointer; margin: 0; width: auto; flex-shrink: 0;
}
.btn-revoke:hover { background: var(--color-error-bg); }
@media (prefers-color-scheme: dark) {
  .btn-revoke { color: #fca5a5; border-color: #7f1d1d; }
  .btn-revoke:hover { background: #450a0a; }
}

.btn-danger {
  background: var(--color-bg); color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 10px 16px; border-radius: 6px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  width: 100%; margin-top: 16px;
}
.btn-danger:hover:not(:disabled) { background: var(--color-error-bg); color: #991b1b; }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }
@media (prefers-color-scheme: dark) {
  .btn-danger { background: #1f0a0a; color: #fca5a5; border-color: #7f1d1d; }
  .btn-danger:hover:not(:disabled) { background: #2d0e0e; color: #fecaca; }
}

/* ─── 8. Form fields ────────────────────────────────────────────────── */
label {
  display: block;
  font-size: 13px;
  margin-top: 16px; margin-bottom: 4px;
}
input {
  width: 100%; padding: 10px 12px;
  border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 14px;
}
input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
  border-color: transparent;
}
@media (prefers-color-scheme: dark) {
  input { background: var(--color-card); color: var(--color-text); border-color: #374151; }
}

/* ─── 9. Inline messages ────────────────────────────────────────────── */
.error {
  background: var(--color-error-bg); color: var(--color-error-text);
  padding: 8px 12px; border-radius: 6px;
  font-size: 13px; margin-bottom: 16px;
  border: 1px solid var(--color-error-border);
}
.success {
  background: var(--color-success-bg); color: var(--color-success-text);
  padding: 12px 14px; border-radius: 6px;
  font-size: 14px; line-height: 1.5;
  margin-bottom: 16px;
  border: 1px solid var(--color-success-border);
}
.trial-callout {
  background: var(--color-success-bg); color: var(--color-success-text);
  padding: 10px 12px; border-radius: 6px;
  font-size: 13px; margin-bottom: 24px;
  border: 1px solid var(--color-success-border);
}
.callout {
  border-left: 3px solid var(--color-callout-border);
  background: var(--color-callout-bg);
  padding: 16px 20px; border-radius: 4px;
  margin: 24px 0; font-size: 15px;
}

/* ─── 10. Code + pre + url-pill + copy buttons ─────────────────────── */
code {
  font-family: var(--font-mono);
  background: var(--color-surface-2); color: var(--color-text);
  padding: 2px 6px; border-radius: 4px; font-size: 0.9em;
}
pre {
  font-family: var(--font-mono);
  background: var(--color-surface-2); color: var(--color-text);
  padding: 16px 56px 16px 16px;          /* right-pad reserves room for copy button */
  border-radius: 8px; overflow-x: auto;
  font-size: 13px; line-height: 1.5;
  position: relative;
}
pre code {
  background: transparent; padding: 0;
  font-size: inherit; color: inherit;
}

/* "url-box" — hero variant for a single URL standing alone on the page. */
.url-box { font-size: 16px; padding: 14px 56px 14px 18px; }

/* Inline URL pill — JS wraps every inline <code> URL (or .copyable code)
 * in a span.url-pill so the icon visually lives inside the same boxed
 * background rather than dangling beside it. */
.url-pill {
  display: inline-flex;
  align-items: center; gap: 6px;
  background: var(--color-surface-2);
  color: var(--color-text);
  border-radius: 4px; padding: 2px 4px 2px 6px;
  vertical-align: baseline;
  font-size: 0.9em;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.url-pill code {
  background: transparent; padding: 0;
  font-size: inherit; color: inherit;
  overflow-wrap: anywhere; word-break: break-word;
  min-width: 0;
}

/* Copy button — base shared by both pre-block (corner) and inline
 * (in-pill) variants. Transparent icon-only treatment with a soft blue
 * hover and green "copied" state. */
.copy-btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  background: transparent; color: var(--color-primary);
  border: 0; border-radius: 6px;
  cursor: pointer; padding: 0; flex-shrink: 0;
  transition: background-color 120ms ease, color 120ms ease;
}
.copy-btn:hover { background: var(--color-primary-soft-bg); }
.copy-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.copy-btn .icon-check { display: none; }
.copy-btn.copied {
  background: var(--color-success-tint);
  color: var(--color-success-check);
}
.copy-btn.copied .icon-clip { display: none; }
.copy-btn.copied .icon-check { display: inline; }

.copy-btn.copy-btn-pre {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px;
}
.copy-btn.copy-btn-pre svg { width: 18px; height: 18px; }

.copy-btn.copy-btn-inline { width: 24px; height: 24px; }
.copy-btn.copy-btn-inline svg { width: 14px; height: 14px; }

/* Reveal panel — token created, shown once, copy button has a chrome
 * variant since it's a primary action on that screen. */
.pat-reveal-row { display: flex; align-items: center; gap: 8px; }
.pat-reveal-row code {
  flex: 1; min-width: 0;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  font-size: 12px;
  word-break: break-all;
}
@media (prefers-color-scheme: dark) {
  .pat-reveal-row code { background: rgba(255, 255, 255, 0.08); }
}
.pat-reveal-copy {
  background: var(--color-bg); color: var(--color-primary);
  border: 1px solid #d1d5db;
  padding: 6px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 500;
  cursor: pointer; margin: 0;
  width: auto; flex-shrink: 0;
}
.pat-reveal-copy:hover { background: var(--color-primary-soft-bg); }
.pat-reveal-copy.copied {
  background: var(--color-success-tint);
  color: var(--color-success-check);
  border-color: var(--color-success-border);
}
@media (prefers-color-scheme: dark) {
  .pat-reveal-copy { background: var(--color-card); border-color: #374151; }
  .pat-reveal-copy:hover { background: #1e293b; }
}

/* ─── 11. Marketing landing (index.html) ────────────────────────────── */
/* No body class on index.html. Sections handle their own padding. */
.container { max-width: 760px; margin: 0 auto; padding: 0 24px; }
section { padding: 64px 24px; }
section h2 { font-size: 28px; margin-bottom: 24px; }
section p { font-size: 16px; }

/* Hero */
.hero { padding: 80px 24px 48px; text-align: center; }
.hero .brand-row {
  display: inline-flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.hero .hero-icon { width: 96px; height: 96px; }
.hero .hero-text {
  display: flex; flex-direction: column;
  align-items: flex-start; gap: 4px;
}
.hero .logo {
  font-size: 64px; font-weight: 700;
  line-height: 1.1; letter-spacing: -0.03em;
  color: inherit; text-decoration: none;
}
.hero .hero-text h1 { margin: 0; }

/* h1 in marketing context — small, secondary; the wordmark is the real
 * "look". h1 in body.doc gets the bigger treatment further down. */
h1 {
  font-size: 24px; line-height: 1.2;
  margin: 0 0 16px;
  letter-spacing: -0.01em; font-weight: 500;
  color: var(--color-muted);
}

.cta-row {
  display: flex; justify-content: center;
  gap: 12px; margin-top: 12px; flex-wrap: wrap;
}

/* Platforms row under hero */
.platforms {
  margin-top: 32px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
}
.platforms-label { font-size: 13px; color: var(--color-subtle); margin-right: 4px; }
.badge {
  background: var(--color-surface-2); color: var(--color-text);
  padding: 4px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
}
.badge.soon { color: var(--color-subtle); }
.badge.soon small { font-size: 11px; opacity: 0.8; }

/* Examples grid */
.examples { padding: 24px 24px 80px; }
.examples-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; max-width: 720px; margin: 0 auto;
}
.feature {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px; padding: 20px;
}
.feature .quote { font-style: italic; color: var(--color-muted); }
.feature .desc { font-size: 14px; color: var(--color-subtle); margin-top: 8px; }
@media (prefers-color-scheme: dark) {
  .feature { background: var(--color-card); }
  .feature .quote { color: var(--color-text); }
}

.how-it-works ol { padding-left: 24px; }
.how-it-works li { margin-bottom: 12px; font-size: 16px; }

/* Pricing */
.pricing { background: var(--color-surface); }
.pricing h2 { margin-bottom: 8px; }
.pricing-tagline { color: var(--color-muted); margin-bottom: 32px; }

.billing-toggle {
  display: inline-flex;
  background: var(--color-surface-2);
  border-radius: 999px; padding: 4px;
  margin-bottom: 32px;
}
.billing-toggle button {
  background: transparent; border: 0;
  padding: 8px 18px; font-size: 14px; font-weight: 500;
  color: var(--color-subtle);
  cursor: pointer; border-radius: 999px;
  transition: background 0.15s, color 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0; width: auto;
}
.billing-toggle button[aria-pressed="true"] {
  background: var(--color-bg); color: var(--color-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
@media (prefers-color-scheme: dark) {
  .billing-toggle button[aria-pressed="true"] { background: var(--color-card); }
}

.save-badge {
  display: inline-block;
  background: var(--color-save-bg); color: var(--color-save-text);
  font-size: 11px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
  line-height: 1; vertical-align: middle;
}

.pricing-cards {
  display: flex; gap: 20px;
  justify-content: center; flex-wrap: wrap; align-items: stretch;
}
.pricing-card {
  background: var(--color-card);
  border: 1px solid var(--color-border); border-radius: 12px;
  padding: 32px;
  flex: 1 1 320px; max-width: 380px;
  text-align: center;
  display: flex; flex-direction: column;
}
.pricing-card .plan-name { font-weight: 600; font-size: 18px; }
.pricing-card .price-large {
  font-size: 48px; font-weight: 700;
  margin: 16px 0 4px; color: inherit;
}
.pricing-card .price-large .price-suffix {
  font-size: 24px; font-weight: 500;
  color: var(--color-subtle);
}
.pricing-card .price-small { color: var(--color-subtle); font-size: 14px; }
.pricing-card ul {
  text-align: left; padding-left: 0; list-style: none;
  margin: 24px 0; flex: 1;
}
.pricing-card li {
  padding: 6px 0 6px 24px; position: relative;
}
.pricing-card li::before {
  content: "✓"; position: absolute; left: 0;
  color: #16a34a; font-weight: bold;
}
.pricing-card .pricing-cta { display: block; margin-top: auto; }
@media (prefers-color-scheme: dark) {
  .pricing-card li::before { color: #22c55e; }
}

/* ─── 12. Doc page (install / privacy / terms) ──────────────────────── */
body.doc h1 { font-size: 32px; letter-spacing: -0.01em; margin-bottom: 4px; color: inherit; font-weight: 700; }
body.doc h2 { font-size: 22px; margin-top: 48px; padding-top: 8px; }
body.doc h3 { font-size: 17px; margin-top: 32px; }
body.doc p, body.doc li { font-size: 16px; }

body.doc table {
  width: 100%; border-collapse: collapse;
  margin: 16px 0; font-size: 14px;
}
body.doc th, body.doc td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}
body.doc th { font-weight: 600; background: var(--color-surface); }
body.doc td code { font-size: 13px; }

body.doc hr { border: 0; border-top: 1px solid var(--color-border); margin: 48px 0; }

.footer-note { color: var(--color-subtle); font-size: 14px; margin-top: 64px; }

/* ─── 13. Auth-page extras (sign-in/up/forgot/reset) ────────────────── */
body.auth h1 { font-size: 24px; margin: 0 0 8px; color: inherit; font-weight: 700; }
.subtitle { color: var(--color-subtle); margin-bottom: 24px; font-size: 14px; line-height: 1.5; }

.alt {
  margin-top: 16px; font-size: 13px;
  color: var(--color-subtle); text-align: center;
}
.alt a { color: var(--color-primary); text-decoration: none; }
.alt a:hover { text-decoration: underline; }

.forgot { margin-top: 8px; text-align: right; font-size: 13px; }
.forgot a { color: var(--color-subtle); text-decoration: none; }
.forgot a:hover { color: var(--color-primary); text-decoration: underline; }

/* ─── 14. Account / tokens page (account.html, tokens.html) ─────────── */
.sub-card {
  border: 1px solid var(--color-border); border-radius: 8px;
  padding: 4px 16px; margin: 16px 0 8px;
}
@media (prefers-color-scheme: dark) {
  .sub-card { background: var(--color-card); }
}
.sub-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-divider);
  gap: 12px;
}
/* `display: flex` above wins over the user-agent `[hidden] { display: none }`,
 * so the hidden HTML attribute on .sub-row stops working. Restore it. */
.sub-row[hidden] { display: none; }
.sub-row:last-child { border-bottom: 0; }
.sub-label { font-size: 13px; color: var(--color-subtle); }
.sub-value { font-size: 14px; font-weight: 500; text-align: right; }

.section-heading { font-size: 18px; margin: 40px 0 4px; }
.section-subtitle {
  font-size: 13px; color: var(--color-subtle);
  margin: 0 0 16px; line-height: 1.5;
}

.pat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-divider);
  gap: 12px;
}
.pat-row:last-child { border-bottom: 0; }
.pat-row-main { min-width: 0; flex: 1; }
.pat-name { font-size: 14px; font-weight: 500; color: inherit; word-break: break-word; }
.pat-meta { font-size: 12px; color: var(--color-subtle); margin-top: 2px; }
.pat-meta code {
  background: transparent; padding: 0;
  font-size: 12px; color: var(--color-subtle);
}

.pat-create-form { margin-top: 20px; }
.pat-create-form button { margin-top: 12px; }

.danger-zone {
  margin-top: 64px; padding: 20px;
  border: 1px solid #fecaca; border-radius: 8px;
}
.danger-heading { font-size: 16px; color: #991b1b; margin: 0 0 8px; }
@media (prefers-color-scheme: dark) {
  .danger-zone { border-color: #7f1d1d; background: #1a0707; }
  .danger-heading { color: #fca5a5; }
}

/* Status pills (badge-ok / badge-warn) — distinct from .badge.soon
 * used in the marketing-landing platforms row. */
.badge-ok {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: var(--color-success-bg); color: var(--color-success-text);
  border: 1px solid var(--color-success-border);
}
.badge-warn {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: var(--color-warn-bg); color: var(--color-warn-text);
  border: 1px solid var(--color-warn-border);
}

/* Auth loading spinner */
.view-loading { text-align: center; padding: 80px 0; }
.spinner {
  display: inline-block;
  width: 32px; height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 720ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ─── 14b. Account page sections + inline OPML import ───────────────── */
/* The account page now stacks two cards: Billing + Feeds. Each card
   uses .sub-card for the surface; .account-section adds vertical
   rhythm + a heading slot. */
.account-section { margin-bottom: 24px; }
.section-heading {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  margin: 0 0 12px;
}
.results-heading {
  font-size: 14px; font-weight: 600;
  margin: 16px 0 6px; color: inherit;
}

/* "or paste OPML" divider between file picker and textarea. */
.or-divider {
  text-align: center;
  color: var(--color-subtle);
  font-size: 13px;
  margin: 16px 0 8px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

/* Filename + size readout under the file input after a pick. */
.file-info { margin-top: 6px; font-size: 13px; }

/* Standard a11y trick — keep label text in the AT tree but hide it
   visually when the surrounding context already names it. */
.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;
}

/* Upload-progress bar shown while the POST is in flight. */
.import-progress { margin-top: 16px; }
.progress-bar {
  height: 8px;
  background: var(--color-divider);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  transition: width 120ms ease-out;
}

/* Per-bucket result list rendered after a successful import. */
.import-results {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.import-results li {
  padding: 6px 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: 15px;
}
.import-results li:last-child { border-bottom: none; }
.import-results strong { font-variant-numeric: tabular-nums; margin-right: 6px; }

/* OPML import form — used inside the .import-dialog modal on
   /auth/account. Scopes textarea/input styles so they don't bleed
   into the rest of the auth pages. */
.import-dialog textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 180px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 13px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: inherit;
  resize: vertical;
}
.import-dialog input[type="file"] { padding: 8px 0; }
.import-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 24px;
}
.import-actions .btn-primary { width: auto; margin-top: 0; }
.alt-link { color: var(--color-subtle); text-decoration: none; font-size: 14px; cursor: pointer; }
.alt-link:hover { text-decoration: underline; }

/* Action buttons (Manage in Stripe, Import OPML) live BELOW the
   account details card, stacked. Each button gets the .btn-primary
   look. Mobile keeps them stacked; on desktop they could go side-by-
   side, but stacked is fine and matches the page's narrow column. */
.account-actions {
  display: flex; flex-direction: column;
  gap: 8px; margin: 16px 0 24px;
}
.account-actions .btn-primary { width: 100%; }

/* Native <dialog> styles — centered modal over a backdrop. The browser
   handles the layout + ESC-to-close; we just style the surface. */
.import-dialog {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0;
  max-width: 560px;
  width: calc(100% - 32px);
  background: var(--color-bg);
  color: inherit;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.import-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}
.import-dialog-body { padding: 20px 24px; }
.import-dialog-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.import-dialog-header h2,
.import-dialog-title {
  margin: 0 0 12px; font-size: 18px; font-weight: 600;
}
.import-dialog-header h2 { margin-bottom: 0; }
.dialog-close {
  background: none; border: 0;
  font-size: 24px; line-height: 1;
  color: var(--color-subtle); cursor: pointer;
  padding: 4px 8px; margin: -4px -8px;
  width: auto;
}
.dialog-close:hover { color: inherit; }
@media (max-width: 480px) {
  .import-dialog { max-width: none; height: 100%; max-height: 100%; border-radius: 0; }
  .import-dialog-body { padding: 16px; }
}

/* ─── 15. Footer ────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--color-border);
  padding: 32px 24px; text-align: center;
  color: var(--color-subtle); font-size: 14px;
}
footer a { color: inherit; text-decoration: none; margin: 0 8px; }
footer a:hover { text-decoration: underline; }

/* ─── 16. Mobile overrides ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero { padding: 56px 20px 32px; }
  .hero .brand-row { gap: 10px; margin-bottom: 12px; }
  .hero .hero-icon { width: 56px; height: 56px; }
  .hero .logo { font-size: 40px; }
  h1 { font-size: 18px; }
  body.doc h1 { font-size: 24px; }
  code { overflow-wrap: anywhere; }
  .examples-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .copy-btn.copy-btn-inline { width: 32px; height: 32px; }
  .copy-btn.copy-btn-inline svg { width: 16px; height: 16px; }
  .url-pill { flex-wrap: wrap; }
}
