/* Small Shop Agents — one stylesheet, no framework. Palette from the brand kit. */
:root {
  --navy: #14213D; --navy-2: #1d2d52; --navy-3: #0e1830;
  --teal: #14B8A6; --teal-dark: #0f766e;
  --amber: #F59E0B; --amber-dark: #b45309; --amber-soft: #fef3c7;
  --ink: #0f172a; --body: #334155; --muted: #64748b; --line: #e2e8f0;
  --bg: #ffffff; --bg-soft: #f8fafc; --bg-warm: #fffbeb;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1120px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; font: 18px/1.65 var(--font); color: var(--body); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-dark); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); font-weight: 800; margin-top: 1.6em; }
h3 { font-size: 1.25rem; font-weight: 750; }
p, ul, ol { margin: 0 0 1em; }
code, kbd { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; background: #f1f5f9; padding: .1em .35em; border-radius: 6px; color: var(--ink); overflow-wrap: anywhere; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--amber); color: var(--navy); padding: 8px 14px; border-radius: 8px; z-index: 100; font-weight: 700; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

/* Header */
.site-header { background: var(--navy); position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.1rem; }
.brand img { border-radius: 10px; }
.brand:hover { color: #fff; }
.site-nav { display: flex; gap: 6px; }
.site-nav a { color: #dbe4f3; text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 1rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.1); }
.nav-toggle { display: none; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 10px; padding: 8px 14px; font: 600 1rem var(--font); min-height: 44px; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy); flex-direction: column; padding: 8px 20px 16px; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; font-size: 1.05rem; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 24px; border-radius: 14px; font: 700 1.05rem/1.2 var(--font); text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-amber { background: var(--amber); color: var(--navy); box-shadow: 0 6px 18px rgba(245,158,11,.35); }
.btn-amber:hover { background: #fbbf24; color: var(--navy); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--bg-soft); color: var(--navy); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Hero */
.hero { background: radial-gradient(1200px 500px at 85% -10%, rgba(20,184,166,.22), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(245,158,11,.16), transparent 60%), var(--navy); color: #dbe4f3; padding: 56px 0 64px; overflow: hidden; }
.hero h1 { color: #fff; }
.hero .lead { font-size: 1.2rem; color: #cbd5e1; max-width: 36em; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero-art { animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.eyebrow { display: inline-block; font-weight: 700; font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); margin-bottom: 12px; }
.hero-note { font-size: .95rem; color: #9fb0c8; margin-top: 18px; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding: 36px 0 44px; } .hero-art { max-width: 460px; margin: 0 auto; } }

.page-hero { background: var(--navy); color: #cbd5e1; padding: 44px 0 40px; }
.page-hero h1 { color: #fff; }
.page-hero .lead { font-size: 1.15rem; max-width: 40em; }
.crumbs { font-size: .9rem; margin-bottom: 12px; }
.crumbs a { color: #9fb0c8; }

/* Sections & cards */
section { padding: 56px 0; }
.section-soft { background: var(--bg-soft); }
.section-warm { background: var(--bg-warm); }
.section-intro { max-width: 46em; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.icon-badge { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; background: var(--amber-soft); margin-bottom: 14px; }

.auto-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.auto-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(15,23,42,.06), 0 16px 36px rgba(15,23,42,.12); }
.auto-card .art { background: var(--navy); padding: 18px; }
.auto-card .art img { margin: 0 auto; max-height: 220px; width: auto; }
.auto-card .body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.auto-card h3 { margin: 0; font-size: 1.3rem; }
.auto-card dl { margin: 0; display: grid; gap: 10px; }
.auto-card dt { font-weight: 750; color: var(--ink); font-size: .95rem; }
.auto-card dd { margin: 0; font-size: .97rem; }
.auto-card .btn-row { margin-top: auto; padding-top: 10px; }
.auto-card .btn { flex: 1 1 auto; min-height: 48px; font-size: 1rem; padding: 10px 16px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: #ccfbf1; color: #115e59; }
.pill-amber { background: var(--amber-soft); color: #92400e; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* How it works */
.how { counter-reset: how; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 0; list-style: none; }
.how li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.how li::before { counter-increment: how; content: counter(how); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; margin-bottom: 10px; }
@media (max-width: 900px) { .how { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .how { grid-template-columns: 1fr; } }

/* Tutorial layout */
.guide { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 44px; padding-top: 36px; padding-bottom: 56px; }
.toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; font-size: .95rem; }
.toc p { font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc a { display: block; padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--body); }
.toc a:hover { background: var(--bg-soft); color: var(--navy); }
.guide-body > section { padding: 0 0 12px; scroll-margin-top: 84px; }
.guide-body h2 { padding-top: 18px; border-top: 1px solid var(--line); }
.guide-body > section:first-child h2 { border-top: 0; padding-top: 0; margin-top: 0; }
.section-letter { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--amber); color: var(--navy); font-size: 1rem; margin-right: 8px; vertical-align: 4px; }
@media (max-width: 960px) {
  .guide { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; max-height: none; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 28px; }
  .toc ol { columns: 2; }
}
@media (max-width: 560px) { .toc ol { columns: 1; } }

.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 26px 0 0; }
.summary-strip div { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 14px 16px; }
.summary-strip dt { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: #9fb0c8; }
.summary-strip dd { margin: 2px 0 0; color: #fff; font-weight: 700; }
@media (max-width: 760px) { .summary-strip { grid-template-columns: 1fr 1fr; } }

.steps { list-style: none; padding: 0; margin: 0; }
.step { border-left: 3px solid var(--line); padding: 0 0 22px 22px; margin-left: 18px; position: relative; }
.step h3 { display: flex; align-items: flex-start; gap: 12px; margin-left: -42px; }
.step-n { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 1rem; font-weight: 800; }
.step:last-child { border-left-color: transparent; }
.step ul, .step ol { padding-left: 1.2em; }

.fig { margin: 18px 0 22px; }
.fig img { border-radius: var(--radius-sm); border: 1px solid var(--line); box-shadow: var(--shadow); background: #fff; }
.fig-diagram img, .fig-illustration img { border: 0; box-shadow: none; background: transparent; }
.fig figcaption { font-size: .93rem; color: var(--muted); margin-top: 10px; }
.fig-kind { display: inline-block; font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: #e2e8f0; color: #334155; margin-right: 6px; vertical-align: 1px; }
.fig-result .fig-kind { background: #dcfce7; color: #166534; }
.fig-zoom { display: block; }

.box { border-radius: var(--radius-sm); padding: 16px 18px; margin: 16px 0; border: 1px solid; }
.box p:last-child, .box ul:last-child { margin-bottom: 0; }
.box-title { font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.box-note { background: #f0f9ff; border-color: #bae6fd; }
.box-warn { background: #fff7ed; border-color: #fed7aa; }
.box-safe { background: #f0fdf4; border-color: #bbf7d0; }
.term-explain { color: var(--muted); }

table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: .97rem; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { background: var(--bg-soft); color: var(--ink); font-weight: 750; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.table-scroll table { margin: 0; }
@media (max-width: 640px) {
  .stack-table thead { display: none; }
  .stack-table tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .stack-table td { display: block; border: 0; padding: 4px 14px; }
  .stack-table td::before { content: attr(data-label); display: block; font-size: .8rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
}

.reco { margin: 28px 0; border-radius: var(--radius); background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #dbe4f3; padding: 24px 26px; }
.reco-title { color: #fff; font-weight: 800; font-size: 1.2rem; margin-bottom: 6px; }
.reco .disclosure { font-size: .92rem; color: #cbd5e1; border-top: 1px solid rgba(255,255,255,.15); padding-top: 12px; margin: 6px 0 0; }
.reco .disclosure a { color: #fcd34d; }

.download { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; background: var(--bg-warm); border: 2px dashed #fcd34d; border-radius: var(--radius); padding: 20px 22px; margin: 16px 0; }
.download .file { font: 700 1rem ui-monospace, Menlo, monospace; color: var(--ink); overflow-wrap: anywhere; }

details.advanced { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 16px; margin: 14px 0; background: #fff; }
details.advanced summary { cursor: pointer; padding: 14px 0; font-weight: 750; color: var(--navy); min-height: 44px; }
details.advanced[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }

.check-list { list-style: none; padding: 0; }
.check-list li { padding-left: 32px; position: relative; margin-bottom: 8px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: #dcfce7; color: #166534; font-weight: 800; display: grid; place-items: center; font-size: .85rem; }
.x-list li::before { content: "✋"; background: var(--amber-soft); color: var(--amber-dark); }

.faq dt { font-weight: 750; color: var(--ink); margin-top: 14px; }
.faq dd { margin: 4px 0 0; }

.cta-band { background: var(--navy); color: #cbd5e1; border-radius: var(--radius); padding: 34px; text-align: center; }
.cta-band h2 { color: #fff; margin-top: 0; }

/* Test tool */
.tool { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.tool label { display: block; font-weight: 700; color: var(--ink); margin: 14px 0 6px; }
.tool input, .tool textarea, .tool select { width: 100%; font: 1rem var(--font); padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 12px; min-height: 48px; }
.tool textarea { min-height: 120px; }
.tool output { display: block; white-space: pre-wrap; background: var(--bg-soft); border-radius: 12px; padding: 14px; margin-top: 14px; font: .92rem ui-monospace, Menlo, monospace; overflow-wrap: anywhere; min-height: 3em; }

/* Footer */
.site-footer { background: var(--navy-3); color: #9fb0c8; padding: 44px 0 26px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.site-footer a { color: #dbe4f3; display: block; padding: 5px 0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-h { color: #fff; font-weight: 800; margin-bottom: 6px; }
.brand-footer { margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 26px; padding-top: 18px; }
.footer-bottom a { display: inline; padding: 0; text-decoration: underline; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

.prose { max-width: 760px; }
.prose h2 { font-size: 1.5rem; }

.codeblock { position: relative; margin: 12px 0 18px; }
.codeblock pre { background: var(--navy-3); color: #e2e8f0; border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto; font-size: .85rem; line-height: 1.55; max-height: 420px; margin: 0 0 10px; }
.codeblock pre code { background: none; color: inherit; padding: 0; overflow-wrap: normal; white-space: pre; }
.codeblock .btn { min-height: 44px; padding: 8px 16px; font-size: .95rem; }
.step-note { list-style: none; margin-left: 18px; padding-left: 22px; border-left: 3px solid var(--line); }
/* Grid children must be allowed to shrink below their content width (code blocks, tables) */
.guide > *, .grid-2 > *, .grid-3 > *, .hero-grid > * { min-width: 0; }
@media (max-width: 960px) { .guide { grid-template-columns: minmax(0, 1fr); } }
.site-footer .muted { color: #b6c3d6; }
