/* polish.css — 2026-10-02 overhaul. Loaded last on every page (injected by server.js).
   Contrast (WCAG AA), focus-visible, 44px tap targets, mobile nav, reduced motion, and the
   growth components (pro card, tools, pricing, FAQ, footer). Additive only. */

/* ---------- Tokens: AA contrast ---------- */
:root {
  --brand: #c2410c;      /* white on brand 5.2:1 (was #e8590c, 3.6:1) */
  --brand-dark: #9a3412;
  --muted: #5b6977;      /* 5.3:1 on --bg (was 4.1:1) */
  --blue: #1a66c9;       /* 5.2:1 on --bg (was 3.9:1) */
  --red: #c0392b;
  --focus: #1a66c9;
}
.error { color: #a5281b; }

/* ---------- Skip link ---------- */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; text-decoration: none; }

/* ---------- Focus states ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px;
}
.search-form input:focus-visible { outline-offset: -3px; }
.btn:focus-visible { box-shadow: 0 0 0 2px #fff; }

/* ---------- Tap targets (44px) ---------- */
.btn, .btn-ghost, .btn-danger, button.tab, .tab-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-small { min-height: 40px; }
.search-form input[type="search"], .search-form input[type="text"], .search-form button { min-height: 44px; }
.topnav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 4px; }
.topnav a.btn { padding: 0 14px; color: #fff; }
.topnav a.btn:hover { color: #fff; }
.logo { min-height: 44px; display: inline-flex; align-items: center; }
.sidebar nav a { min-height: 44px; display: flex; align-items: center; }
footer nav a, .site-footer nav a { min-height: 44px; display: inline-flex; align-items: center; }
.auth input, .field input, .field select, .field textarea, .tool-form input[type="text"], .tool-form input[type="number"], .tool-form textarea { min-height: 44px; font-size: 16px; }
@media (pointer: coarse) { .btn-small { min-height: 44px; } }

/* ---------- Topbar ---------- */
.topnav { gap: 10px; }
.topnav .nav-account { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 44px; }
@media (max-width: 1000px) { .topnav .nav-extra { display: none; } }

/* ---------- Mobile: sidebar becomes a scrollable nav strip instead of disappearing ---------- */
@media (max-width: 900px) {
  .sidebar, .sidebar.sidebar-grouped { display: block !important; position: static; width: auto; top: auto; bottom: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .sidebar nav { flex-direction: row; flex-wrap: nowrap; white-space: nowrap; }
  .sidebar .nav-group { display: contents; }
  .sidebar .nav-group-label { display: none; }
  .sidebar nav a { border-left: 0; border-bottom: 3px solid transparent; padding: 0 14px; }
  .sidebar nav a.active, .sidebar nav a[aria-current] { border-bottom-color: var(--brand); }
  .topbar .container { padding: 8px 16px; }
  main.landing { padding: 16px 16px 48px; }
}
@media (max-width: 480px) {
  .topnav { gap: 6px; }
  .topnav .nav-account { max-width: 120px; }
  .hero { padding: 32px 0 24px; }
  .hero p { font-size: 16px; }
  .hero .search-form { flex-direction: column; gap: 8px; }
  .hero .search-form input { border-right: 1.5px solid var(--line); border-radius: 8px; }
  .hero .search-form button { border-radius: 8px; width: 100%; }
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
img, svg, video { max-width: 100%; height: auto; }

/* ---------- Growth components ---------- */
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--brand); margin: 0 0 6px; }
.lead { font-size: 17px; color: var(--muted); max-width: 720px; }
.fine { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.page-intro { padding: 28px 0 8px; }
.page-intro h1 { font-size: 34px; letter-spacing: -.5px; margin-bottom: 8px; }
@media (max-width: 640px) { .page-intro h1 { font-size: 26px; } }
.check-list { list-style: none; padding: 0; margin: 12px 0 16px; }
.check-list li { padding: 5px 0 5px 26px; position: relative; }
.check-list li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 10px; height: 6px; border-left: 2px solid #1e7e45; border-bottom: 2px solid #1e7e45; transform: rotate(-45deg); }

.pro-card { background: linear-gradient(135deg, #fff7f2, #ffffff 60%); border: 1.5px solid #f3c9b1; border-radius: var(--radius); padding: 22px 24px; margin: 24px 0; box-shadow: var(--shadow); }
.pro-card h2 { font-size: 21px; margin-bottom: 8px; }
.pro-card .pro-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.mcp-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 20px 0; }
.mcp-card p { margin: 0; flex: 1 1 320px; }
main.app .pro-card, main.app .mcp-card { max-width: none; }

.tools-strip { margin: 36px 0 10px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 14px 0; }
.tool-tile { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); min-height: 44px; box-shadow: var(--shadow); transition: border-color .12s ease, box-shadow .12s ease; }
.tool-tile strong { color: var(--blue); font-size: 15.5px; }
.tool-tile span { color: var(--muted); font-size: 14px; }
.tool-tile:hover { border-color: var(--blue); text-decoration: none; box-shadow: 0 4px 14px rgba(16,30,54,.10); }
.tool-grid-lg .tool-tile { padding: 20px; }

.crumbs { font-size: 14px; color: var(--muted); padding-top: 14px; }
.crumbs a { display: inline-flex; min-height: 44px; align-items: center; }
.tool-card label { display: block; font-weight: 600; margin: 0 0 6px; }
.tool-form textarea, .tool-form input[type="text"], .tool-form input[type="number"] { width: 100%; border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; background: #fff; color: var(--ink); }
.tool-form textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; resize: vertical; }
.tool-form textarea:focus, .tool-form input:focus { border-color: var(--brand); }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.field-row label { font-weight: 600; font-size: 14px; }
.field-row input { margin-top: 6px; }
.ctr-edit { margin: 14px 0 0; }
.ctr-edit summary, .faq summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.ctr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-top: 8px; }
.ctr-grid label { font-weight: 500; font-size: 13px; }
.mod-groups { border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px 10px; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.mod-groups legend { font-weight: 600; padding: 0 4px; }
.mod-groups label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; margin: 0; }
.mod-groups input { width: 20px; height: 20px; accent-color: var(--brand); }
.tool-out { margin-top: 18px; }
.tool-out:empty { display: none; }
.tool-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.tool-summary .chip { font-size: 13px; }
.group-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.group-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fcfcfd; }
.group-box h3 { margin: 0 0 6px; font-size: 15px; }
.group-box ul { margin: 0; padding-left: 18px; font-size: 14px; }
.big-num { font-size: 34px; font-weight: 700; letter-spacing: -.5px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.stat .muted { display: block; }
.out-list { columns: 2 260px; font-size: 14px; padding-left: 20px; }

.faq details { border-top: 1px solid var(--line); padding: 2px 0; }
.faq details:first-of-type { border-top: 0; }
.faq details p { margin: 0 0 12px; color: var(--ink); }
.prose { max-width: 820px; }
.prose h2 { margin-top: 1.4em; }
.metrics-more { text-align: center; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin: 18px 0 20px; }
.plan { position: relative; margin: 0; display: flex; flex-direction: column; }
.plan .btn-block { width: 100%; margin-top: auto; }
.plan-pro { border: 2px solid var(--brand); }
.plan .price { margin: 4px 0 4px; color: var(--muted); }
.plan .price span { font-size: 36px; font-weight: 800; color: var(--ink); letter-spacing: -.5px; margin-right: 4px; }
.badge { position: absolute; top: -12px; right: 18px; margin: 0; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.cmp-table th[scope="row"] { text-align: left; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--card); margin-top: 40px; }
.site-footer .container { display: block; max-width: 1180px; margin: 0 auto; padding: 28px 20px 18px; color: var(--muted); font-size: 14px; }
.footer-cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 24px; }
.footer-cols nav { display: flex; flex-direction: column; }
.footer-cols h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin: 0 0 4px; }
.footer-cols nav a { color: var(--ink); }
.footer-brand p { margin: 8px 0 0; max-width: 300px; }
.footer-xsell { margin: 18px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.footer-legal { margin: 0; font-size: 13px; }
@media (max-width: 760px) { .footer-cols { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
main.app ~ footer.site-footer, main.dashboard ~ footer.site-footer, main.lists ~ footer.site-footer { margin-left: 210px; }
@media (max-width: 900px) { main.app ~ footer.site-footer, main.dashboard ~ footer.site-footer, main.lists ~ footer.site-footer { margin-left: 0; } }

/* ---------- Free-limit upsell banner (upsell.js) ---------- */
.limit-banner { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 300; width: min(640px, calc(100vw - 32px)); background: #1a2733; color: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(16,30,54,.35); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.limit-banner p { margin: 0; flex: 1 1 260px; font-size: 14.5px; }
.limit-banner a.btn { background: #fb923c; color: #1a2733; }
.limit-banner a.btn:hover { background: #fdba74; }
.limit-banner button.close { background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 8px; min-width: 44px; min-height: 44px; cursor: pointer; font-size: 18px; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .metric-card:hover, .features .card:hover, .btn:active { transform: none !important; }
}
