/* Styles for the plain server-rendered public pages (server/pages/).
   One file, no build step. Colours follow theme.json (primary #ff5100). */

:root {
  --orange: #f97316;
  --orange-dark: #ea580c;
  --orange-soft: #fff7ed;
  --ink: #111827;
  --text: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #fafaf9;
  --card: #ffffff;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--orange-dark); }
a:hover { color: var(--orange); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1120px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.site-header .bar {
  max-width: 1200px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand img { height: 38px; }
.brand-name, .brand-tag { display: block; }
.brand-name { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: #1f2937; line-height: 1.2; }
.brand-tag { font-size: 10px; color: var(--orange-dark); line-height: 1.2; }
.site-nav { display: flex; gap: 6px; }
.site-nav a {
  font-size: 14px; font-weight: 500; text-decoration: none; color: #4b5563;
  padding: 6px 12px; border-radius: 8px;
}
.site-nav a:hover { background: #f9fafb; color: var(--orange-dark); }
.site-nav a.signin { color: var(--orange-dark); border: 1px solid #fed7aa; }
.site-nav a { white-space: nowrap; }
@media (max-width: 480px) {
  .brand > span { display: none; }
  .site-nav { gap: 2px; }
  .site-nav a { padding: 6px 8px; }
}

/* Document page */
.back { display: inline-block; margin: 28px 0 18px; font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--orange); }

.card {
  background: var(--card); border: 1px solid #f3f4f6; border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,.04); margin-bottom: 20px; overflow: hidden;
}
.card-body { padding: 24px; }
.card-actions {
  padding: 14px 24px; background: #f9fafb; border-top: 1px solid #f3f4f6;
  display: flex; flex-wrap: wrap; gap: 10px;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag { font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: #f3f4f6; color: #4b5563; }
.tag.cat { background: #eff6ff; color: #1d4ed8; }

h1 { font-size: clamp(1.3rem, 1rem + 1.4vw, 1.6rem); line-height: 1.3; color: var(--ink); margin: 0 0 12px; }
.chapter { margin: 0 0 10px; color: var(--muted); }
.dates { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 13px; color: #9ca3af; margin: 0; }

.btn {
  display: inline-block; font-size: 14px; font-weight: 600; text-decoration: none;
  padding: 8px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--text);
}
.btn:hover { background: #f3f4f6; color: var(--text); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-dark); }

.label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }

/* Text that comes from the library's markdown */
.prose { overflow-wrap: anywhere; }
.prose h3, .prose h4, .prose h5, .prose h6 { color: var(--ink); line-height: 1.35; margin: 1.4em 0 .5em; font-size: 1.05rem; }
.prose h3 { font-size: 1.15rem; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 .9em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 .9em; }
.prose li { margin-bottom: .35em; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.prose > :last-child { margin-bottom: 0; }

details.full-text > summary { cursor: pointer; list-style: none; }
details.full-text > summary::-webkit-details-marker { display: none; }
details.full-text > summary .label::after { content: "  ▸ show"; letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--orange-dark); }
details.full-text[open] > summary .label::after { content: "  ▾ hide"; }

.cta { background: var(--orange-soft); border-color: #ffedd5; }
.cta h2 { margin: 0 0 6px; font-size: 1.15rem; color: var(--ink); }
.cta p { margin: 0 0 14px; }

/* Breadcrumbs */
.crumbs { margin: 24px 0 16px; font-size: 13px; color: #9ca3af; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--orange); }

.lead { font-size: 1.05rem; color: #4b5563; margin: 0 0 18px; }
main > h1 { margin-top: 4px; }

/* Topic chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.chip {
  font-size: 14px; text-decoration: none; color: var(--text); background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
}
.chip b { font-weight: 600; color: #9ca3af; margin-left: 2px; }
.chip:hover { border-color: #fdba74; color: var(--orange-dark); }
.chip.on { background: var(--orange-soft); border-color: #fdba74; color: var(--orange-dark); }

/* Filter / search bar */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 6px; }
.filters input[type=search] {
  flex: 1 1 260px; min-width: 0; font: inherit; padding: 9px 12px;
  border: 1px solid #d1d5db; border-radius: 12px; background: #fff;
}
.filters input[type=search]:focus { outline: 2px solid #fed7aa; border-color: var(--orange); }
.filters select { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 12px; background: #fff; max-width: 100%; }
.filters .check { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.filters button { font: inherit; cursor: pointer; }
.count { font-size: 13px; color: #9ca3af; margin: 0 0 12px; }

/* Document lists */
.docs { list-style: none; padding: 0; margin: 0 0 24px; }
.doc, .memo { background: #fff; border: 1px solid #f3f4f6; border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; }
.doc > a, .memo > a { display: block; font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.4; }
.doc > a:hover, .memo > a:hover { color: var(--orange-dark); }
.meta { display: block; font-size: 12px; color: #9ca3af; margin-top: 3px; }
.related .meta, .start-list .meta { display: inline; margin: 0; }
.snip { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }
.repealed { color: #b91c1c; }
.tag.repealed { background: #fef2f2; color: #b91c1c; }
a.tag { text-decoration: none; }

h2.group { font-size: 1rem; color: var(--ink); margin: 28px 0 10px; display: flex; align-items: baseline; gap: 10px; }
h2.group span { font-size: 13px; color: #9ca3af; font-weight: 500; }
h2.group a { font-size: 13px; font-weight: 500; margin-left: auto; text-decoration: none; }

.start-list { margin: 0; padding-left: 1.3em; }
.start-list li { margin-bottom: 6px; }
.start-list a { text-decoration: none; font-weight: 500; }
.related { list-style: none; padding: 0; margin: 0; }
.related li { padding: 6px 0; border-bottom: 1px solid #f3f4f6; }
.related li:last-child { border-bottom: 0; }
.related a { text-decoration: none; }
.label.gap { margin-top: 22px; }
details.more summary { cursor: pointer; font-size: 14px; color: var(--orange-dark); margin-top: 8px; }

.cite p { margin: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }

/* Library: thin Browse format */
.lead.thin { font-size: .95rem; margin-bottom: 12px; }
.lib-top {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  padding: 8px 0 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line);
}
.stats { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.stats b { color: var(--ink); font-size: 15px; }
.lib-search { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.qbox { position: relative; flex: 2 1 320px; min-width: 0; }
.qbox input {
  width: 100%; font: inherit; font-size: 15px; padding: 9px 112px 9px 14px;
  border: 2px solid #fed7aa; border-radius: 999px; background: #fff;
}
.qbox input:focus { outline: 2px solid #fdba74; border-color: var(--orange); }
.qbox .ai {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap;
  background: var(--orange-soft); color: var(--orange-dark); padding: 6px 11px; border-radius: 999px;
}
.qbox .ai:hover { background: #ffedd5; }
.lib-search > input, .lib-search select {
  flex: 1 1 150px; min-width: 0; font: inherit; font-size: 13px; padding: 7px 10px;
  border: 1px solid #d1d5db; border-radius: 10px; background: #fff;
}
.chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 4px; }
.chip-label { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9ca3af; margin: 0 2px 0 6px; }
.chip-label:first-child { margin-left: 0; }
.chip-t {
  font: inherit; font-size: 11px; cursor: pointer; border: 0; border-radius: 6px; padding: 3px 7px;
  background: var(--orange-soft); color: var(--orange-dark);
}
.chip-t b { font-weight: 500; opacity: .6; }
.chip-t.ty { background: #eef2ff; color: #4f46e5; }
.chip-t.on { background: var(--orange); color: #fff; font-weight: 600; }
.chip-t.ty.on { background: #6366f1; color: #fff; }
.lib-note { font-size: 11px; color: #9ca3af; margin: 2px 0 0; }
.lib-note #count { color: var(--text); font-weight: 600; }
.lib-note #clear { margin-left: 6px; }

.rows { list-style: none; padding: 0; margin: 0 0 20px; }
.row {
  border: 1px solid #dcfce7; border-left: 3px solid #86efac; background: #f7fdf9;
  border-radius: 8px; padding: 6px 10px; margin-bottom: 4px;
}
.row.rep { border-color: #fee2e2; border-left-color: #fca5a5; background: #fff8f8; }
.row-main { display: flex; align-items: baseline; gap: 10px; }
.row-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink); text-decoration: none; }
.row-title:hover { color: var(--orange-dark); }
.row-acts { display: flex; gap: 4px; flex-shrink: 0; }
.act {
  font-size: 11px; font-weight: 600; text-decoration: none; white-space: nowrap;
  padding: 2px 8px; border-radius: 6px; border: 1px solid #d1d5db; background: #fff; color: #4b5563;
}
.act:hover { border-color: #9ca3af; color: var(--ink); }
.act.read:hover { border-color: #34d399; color: #047857; }
.act.ask { background: var(--orange); border-color: var(--orange); color: #fff; }
.act.ask:hover { background: var(--orange-dark); color: #fff; }
.row-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.t { font-size: 10.5px; line-height: 1.5; padding: 0 6px; border-radius: 999px; background: #f3f4f6; color: #4b5563; white-space: nowrap; }
.t-date { background: #f3e8ff; color: #6b21a8; font-weight: 600; }
.t-ok { background: #dcfce7; color: #166534; }
.t-rep { background: #fee2e2; color: #991b1b; }
.t-type { background: #dbeafe; color: #1e40af; }
.t-ch { background: #ffedd5; color: #9a3412; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.t-w { background: transparent; color: #9ca3af; padding: 0 2px; }
.t-eff { background: transparent; color: var(--ink); font-weight: 500; padding: 0 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.c-ct { background: #dbeafe; color: #1e40af; }
.c-vat { background: #dcfce7; color: #166534; }
.c-ex { background: #ffe4e6; color: #9f1239; }
.c-tp { background: #fef3c7; color: #92400e; }
.c-ei { background: #f3e8ff; color: #6b21a8; }
.row-more { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #d1d5db; font-size: 12.5px; line-height: 1.55; }
.row-more p { margin: 0 0 4px; color: var(--text); }
.row-more ul, .row-more ol { margin: 0 0 4px; }
.peek-more { font-size: 12px; }
.peek {
  font-size: 10.5px; line-height: 1.5; padding: 0 4px; margin-left: 2px; white-space: nowrap;
  color: var(--orange-dark); text-decoration: none; font-weight: 600;
}
.peek:hover, .peek.on { text-decoration: underline; }
.ask-ai { display: flex; gap: 4px; align-items: center; }
.ask-ai .act { font-size: 12px; padding: 6px 10px; }
.other-topics { font-size: 13px; color: var(--muted); }
@media (max-width: 560px) {
  .row-main { flex-direction: column; gap: 4px; }
  .row-acts { align-self: flex-start; }
  .lib-top { position: static; }
}

/* Document page */
.doc-head { padding: 4px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.doc-head h1 { font-size: clamp(1.15rem, 1rem + .9vw, 1.45rem); margin: 8px 0 10px; }
.doc-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-acts .act { font-size: 12px; padding: 4px 10px; cursor: pointer; font-family: inherit; }
a.t { text-decoration: none; }
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.sec { margin-bottom: 22px; }
.prose.small { font-size: 14px; line-height: 1.6; }
.prose.small ul, .prose.small ol { padding-left: 1.15em; }
.prose.small li { margin-bottom: .3em; }
.doc-side { font-size: 13px; position: sticky; top: 12px; }
.doc-side .label { margin: 18px 0 6px; font-size: 11px; }
.doc-side .label:first-child { margin-top: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; padding: 12px; background: #fff; border: 1px solid #f3f4f6; border-radius: 10px; }
.facts dt { color: #9ca3af; }
.facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.doc-side .related li { padding: 4px 0; }
.doc-side .related a { font-size: 13px; line-height: 1.35; }
.side-more { margin: 6px 0 0; }
.cite-text { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .doc-grid { grid-template-columns: 1fr; }
  .doc-side { position: static; }
}

/* About / Use with AI */
.small-print { font-size: 14px; }
.muted { color: #9ca3af; }
.about-list { columns: 2; font-size: 14px; padding-left: 1.1em; margin: 0 0 12px; }
.founder { display: flex; gap: 20px; align-items: flex-start; background: #fff; border: 1px solid #f3f4f6; border-radius: 14px; padding: 20px; margin: 8px 0 22px; }
.founder img { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; flex-shrink: 0; }
.founder blockquote { margin: 0 0 10px; font-size: 14px; color: var(--text); font-style: italic; }
.founder .who { margin: 8px 0 2px; font-size: 14px; }
.tagline-big { margin: 0; color: var(--orange-dark); font-style: italic; }
.examples { list-style: none; padding: 0; margin: 0; }
.examples li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0; border-top: 1px solid #f3f4f6; font-size: 14px; }
.examples li span { flex: 1 1 260px; }
.connector { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
.connector code { font-size: 14px; background: #f3f4f6; padding: 6px 10px; border-radius: 8px; overflow-wrap: anywhere; }
.connector .act { cursor: pointer; font-family: inherit; }
@media (max-width: 560px) {
  .founder { flex-direction: column; }
  .about-list { columns: 1; }
}

/* Home */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(1.6rem, 1.1rem + 2.4vw, 2.3rem); line-height: 1.15; margin-bottom: 12px; }
.search-big { display: flex; gap: 8px; margin: 18px 0 8px; }
.search-big input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; padding: 12px 14px;
  border: 1px solid #d1d5db; border-radius: 14px; background: #fff;
}
.search-big input:focus { outline: 2px solid #fed7aa; border-color: var(--orange); }
.search-big button { font: inherit; cursor: pointer; padding: 0 20px; }
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 18px 0 8px; }
.topic {
  background: #fff; border: 1px solid #f3f4f6; border-radius: 12px; padding: 14px; text-decoration: none;
  display: flex; flex-direction: column; gap: 2px;
}
.topic b { color: var(--ink); }
.topic span { font-size: 13px; color: #9ca3af; }
.topic:hover { border-color: #fdba74; }

/* Memos */
.kicker { font-size: 13px; color: #9ca3af; margin: 0 0 6px; }
.followup { font-weight: 600; color: var(--ink); }
.memo-text { margin-top: 12px; }
.disclaimer { font-size: 13px; color: #9ca3af; margin: 22px 0 0; }

.topics-line { margin: 0 0 8px; }

/* Footer */
.site-footer { text-align: center; font-size: 13px; color: #9ca3af; padding: 32px 16px 40px; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--orange-dark); }
.site-footer .tagline { color: var(--orange); font-weight: 500; }

/* Use in ChatGPT & Claude */
.site-nav .short { display: none; }
@media (max-width: 480px) {
  .site-nav .long { display: none; }
  .site-nav .short { display: inline; }
}
.try input {
  width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; margin: 2px 0 10px;
  border: 2px solid #fed7aa; border-radius: 14px; background: #fff;
}
.try input:focus { outline: 2px solid #fdba74; border-color: var(--orange); }
.try-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.try-acts .btn { font-size: 15px; padding: 10px 18px; }
.examples-line { font-size: 12px; color: var(--muted); margin: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.steps h3 { font-size: 14px; margin: 0 0 6px; color: var(--ink); }
.steps ol { margin: 0; padding-left: 1.2em; font-size: 14px; }
.steps li { margin-bottom: 4px; }
.faq details { border-top: 1px solid var(--line); padding: 8px 0; font-size: 14px; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.faq p { margin: 6px 0 0; color: var(--text); }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }
