/* The look of the MultiAgency dashboard (github.com/MultiAgency/dashboard,
   ui/src/styles.css): its tokens, square cards, Geist headings over Inter, and
   the dotted background. */

/* Light mode is paper and manila: a pale lemon page drawn from the brand
   yellow, a manila case file in the hero, ink for text. Dark mode keeps the
   dashboard's grays. */
:root {
  --pattern-dot: 18%;
  --background: #FFF8D6;
  --foreground: #1C1A12;
  --card: #FFFDF2;
  --primary: #F5C518;
  --primary-foreground: #3A2E05;
  --muted: #F6EBB8;
  --muted-foreground: #6B6450;
  --destructive: #B3261E;
  --success: #2E7A4B;
  --border: color-mix(in oklab, #1C1A12 14%, transparent);
  --input: color-mix(in oklab, #1C1A12 22%, transparent);
  --ring: #1C1A12;
  --dot: #8A6D12;
  --manila: #EBCB6B;
  --manila-edge: #D4AE45;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-heading: "Geist", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pattern-dot: 4.5%;
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --card: oklch(0.205 0 0);
    --primary: oklch(0.795 0.184 86.047);
    --muted: oklch(0.269 0 0);
    --muted-foreground: oklch(0.708 0 0);
    --destructive: oklch(0.704 0.191 22.216);
    --success: oklch(0.75 0.14 150);
    --border: oklch(1 0 0 / 10%);
    --input: oklch(1 0 0 / 15%);
    --ring: oklch(0.556 0 0);
    --dot: var(--foreground);
    --manila: oklch(0.32 0.04 85);
    --manila-edge: oklch(0.42 0.06 85);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --pattern-dot: 4.5%;
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --primary: oklch(0.795 0.184 86.047);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --success: oklch(0.75 0.14 150);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --dot: var(--foreground);
  --manila: oklch(0.32 0.04 85);
  --manila-edge: oklch(0.42 0.06 85);
  color-scheme: dark;
}

* { box-sizing: border-box; border-color: var(--border); }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* Anchors land below the sticky header. */
section[id], h2[id] { scroll-margin-top: 72px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--foreground);
  font: 14px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  background-color: var(--background);
  background-image: radial-gradient(circle at 1px 1px, color-mix(in oklab, var(--dot) var(--pattern-dot), transparent) 1px, transparent 0);
  background-size: 22px 22px;
  background-attachment: fixed;
}

a { color: inherit; }
p a, li a, dd a { text-underline-offset: 3px; }
code, pre { font-family: var(--font-mono); font-size: 12px; }
code { background: var(--muted); padding: 1px 4px; overflow-wrap: anywhere; }

.container { max-width: 1024px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 75%, transparent);
  backdrop-filter: blur(12px);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font: 600 14px var(--font-heading); letter-spacing: -0.01em; }
.brand svg { width: 24px; height: 24px; }
.brand:hover { opacity: 0.7; }
.nav { display: none; gap: 4px; }
@media (min-width: 640px) { .nav { display: flex; } }
.nav a { padding: 6px 10px; font-size: 12px; font-weight: 500; text-decoration: none; color: var(--foreground); }
.nav a:hover { background: var(--muted); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Buttons and badges */
.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font: 500 12px var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s;
}
.button:hover { background: var(--muted); }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--primary); border-color: transparent; color: var(--primary-foreground); }
.button.primary:hover { background: color-mix(in oklab, var(--primary) 80%, transparent); }
.button.icon { width: 32px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
.button.icon:hover { background: var(--muted); }
.button[aria-disabled] { opacity: 0.5; pointer-events: none; }
.button.file:focus-within { outline: 2px solid var(--foreground); outline-offset: 2px; }
.button svg { width: 14px; height: 14px; }

/* Cards */
.card { background: var(--card); box-shadow: 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent); padding: 16px; font-size: 12px; line-height: 1.65; }
.card h3 { font: 500 14px var(--font-heading); margin: 0 0 4px; }
.card p { margin: 0 0 8px; }
.card p:last-child { margin-bottom: 0; }
.card .muted, .muted { color: var(--muted-foreground); }
.card.highlight { border-left: 2px solid var(--primary); }

/* Hero */
/* Hero: the copy on the left, a real review as a manila case file on the
   right, its seal checked live. The page's one bold element. */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: start; margin-top: 88px; }
@media (max-width: 880px) { .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; margin-top: 40px; } }
.hero h1 { font: 600 clamp(42px, 6.6vw, 68px)/1 var(--font-heading); letter-spacing: -0.04em; margin: 0 0 20px; }
.hero .lede { font-size: 18px; line-height: 1.55; color: var(--muted-foreground); max-width: 30em; margin: 0 0 28px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 8px; }

.casefile { margin: 0; }
.casefile .tab { display: inline-block; background: var(--manila); border-radius: 6px 6px 0 0; padding: 7px 14px 5px; font: 500 12px var(--font-mono); color: var(--foreground); }
.casefile .folder { background: var(--manila); border-top-right-radius: 6px; padding: 14px 14px 18px; box-shadow: inset 0 -2px 0 var(--manila-edge); }
.casefile .page { background: var(--card); padding: 18px 20px 16px; font-size: 13px; line-height: 1.6; box-shadow: 0 1px 0 color-mix(in oklab, var(--foreground) 14%, transparent); }
.casefile .page p { margin: 0 0 6px; }
.finding-label { font: 600 13px var(--font-heading); }
.finding-where code { background: none; padding: 0; color: var(--muted-foreground); }
.casefile .whole { display: inline-block; margin-top: 6px; font-size: 12px; text-underline-offset: 3px; }

.seal-row { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.seal-note { margin: 0; font-size: 12px; line-height: 1.5; max-width: 26em; }
.seal {
  flex: none;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 2px solid var(--foreground);
  outline: 1px solid var(--foreground);
  outline-offset: -8px;
  background: var(--card);
  color: var(--foreground);
  font: 600 12px/1.15 var(--font-heading);
  text-align: center;
  padding: 0 12px;
  cursor: pointer;
}
.seal:hover { background: var(--primary); }
.seal:focus-visible { box-shadow: 0 0 0 3px var(--primary), 0 0 0 5px var(--foreground); }
.seal.checking { cursor: progress; }
.seal.ok { background: var(--success); border-color: var(--success); outline-color: var(--card); color: var(--card); }
.seal.failed { border-color: var(--destructive); outline-color: var(--destructive); color: var(--destructive); }
.seal-checks { list-style: none; margin: 14px 0 0; padding: 14px 16px; background: var(--card); font-size: 12px; line-height: 1.55; display: grid; gap: 6px; }
.seal-checks li { padding-left: 20px; position: relative; overflow-wrap: anywhere; animation: arrive 0.32s ease-out both; animation-delay: calc(var(--i) * 0.22s); }
.seal-checks li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 700; }
.seal-checks strong { margin-right: 4px; }
.seal-checks[hidden] { display: none; }
@keyframes arrive { from { opacity: 0; transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .seal-checks li { animation: none; } }

/* Sections */
section { margin-top: 64px; }
.section-head { margin-bottom: 16px; }
.section-head h2 { font: 600 18px var(--font-heading); letter-spacing: -0.01em; margin: 0 0 4px; }
.section-head p { margin: 0; max-width: 42em; color: var(--muted-foreground); }

.steps { list-style: none; counter-reset: step; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 760px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.steps li { counter-increment: step; border-top: 2px solid var(--foreground); padding-top: 12px; }
.steps li::before { content: counter(step); font: 600 13px var(--font-heading); color: var(--muted-foreground); }
.steps h3 { font: 600 15px var(--font-heading); margin: 4px 0 6px; }
.steps p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted-foreground); }
.step-label { color: var(--muted-foreground); margin-bottom: 4px !important; }

/* Setup */
.fields { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }
.fields label { display: grid; gap: 6px; font-weight: 500; }
.fields input:not([type="checkbox"]) {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--input);
  background: transparent;
  color: var(--foreground);
  font: 12px var(--font-mono);
  outline: none;
}
.fields input:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 1px color-mix(in oklab, var(--ring) 50%, transparent); }
.fields .wide { grid-column: 1 / -1; }
.fields .hint { grid-column: 1 / -1; margin: -4px 0 0; font-size: 12px; }
.fields .checkbox { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-weight: 400; }
.fields input[type="checkbox"] { accent-color: var(--primary); width: 14px; height: 14px; margin: 0; }

.setup { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
.setup .card { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 0 12px; }
.setup .card > .step-label { grid-row: 1 / span 3; }
@media (max-width: 560px) {
  .setup .card { grid-template-columns: minmax(0, 1fr); }
  .setup .card > .step-label { grid-row: auto; }
}
.setup .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }

.code { position: relative; margin-top: 8px; }
.code pre { margin: 0; padding: 12px 14px; background: var(--muted); border: 1px solid var(--border); overflow-x: auto; line-height: 1.5; max-height: 360px; }
.code .button { position: absolute; top: 6px; right: 6px; height: 24px; padding: 0 8px; }

/* Sample review */
.review-head { font: 500 14px var(--font-heading); }
.findings { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.findings .card { box-shadow: none; border: 1px solid var(--border); border-left: 2px solid var(--primary); }
.findings .where { margin-bottom: 4px; }
.findings .where code { background: none; padding: 0; color: var(--muted-foreground); }
.review details { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.review summary { cursor: pointer; font-weight: 500; }
.review details ul { padding-left: 18px; margin: 8px 0 0; }

/* Receipt checker */
.drop { border: 1px dashed var(--ring); padding: 28px 16px; text-align: center; }
.drop.over { background: var(--muted); border-color: var(--foreground); }
.drop p { margin: 0 0 12px; }
.drop .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.result { margin-top: 12px; }
.result.running { color: var(--muted-foreground); }
.result.ok { border-left: 2px solid var(--success); }
.result.failed { border-left: 2px solid var(--destructive); }
.result .verdict { font: 600 14px var(--font-heading); }
.result.ok .verdict { color: var(--success); }
.result.failed .verdict { color: var(--destructive); }
.result.unchecked { border-left: 2px solid var(--muted-foreground); }
.result details { margin-top: 8px; color: var(--muted-foreground); }
.field-error[hidden] { display: none; }
.field-error { display: block; margin-top: 4px; font-size: 12px; color: var(--destructive); }
.result .checks { padding-left: 18px; margin: 8px 0; }
.result .checks li { margin-bottom: 4px; }
.result dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 16px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
.result dt { color: var(--muted-foreground); }
.result dd { margin: 0; min-width: 0; }

.limits { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; }
@media (max-width: 640px) { .limits { grid-template-columns: minmax(0, 1fr); } }
.limits h3 { font: 600 14px var(--font-heading); margin: 0 0 4px; }
.limits p { margin: 0; font-size: 13px; line-height: 1.6; }

footer { margin-top: 80px; border-top: 1px solid var(--border); }
footer .container { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; padding-top: 24px; padding-bottom: 40px; color: var(--muted-foreground); font-size: 12px; }
footer nav { display: flex; gap: 16px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--foreground); }

/* After installing the App: where to go next. */
.banner { scroll-margin-top: 96px; margin: 32px 0 0; padding: 16px 20px; background: var(--card); border-left: 3px solid var(--success); font-size: 15px; line-height: 1.6; }
