/* Self-hosted (no request to Google's servers - see privacy note in memory).
   Each family ships as one variable-font file covering its whole weight
   range, exactly like Google's own CSS does internally. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300 400;
  font-display: swap;
  src: url('/fonts/roboto-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto Condensed';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/roboto-condensed-normal.woff2') format('woff2');
}

:root {
  --blue: #519cbd;
  --hair: rgba(0, 0, 0, 0.22);
  --cream: #fffad9;
  --cream-line: #111111;
  --ink: #000000;
  --muted: #727272;
  --panel-on-blue: rgba(0, 0, 0, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--blue);
  background-image:
    radial-gradient(ellipse 900px 500px at 50% -10%, rgba(0, 0, 0, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.08) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- links ----------
   Plain text links (footer, inline prose) use the brand blue, same as
   .sys-id - but blue text is invisible directly on the blue page background,
   so --link-color defaults to cream (the same swap .back-link already makes
   for blue backgrounds) and flips to blue inside every cream-background
   container below. No underline, ever - a small arrow icon in the same
   color marks a link instead. More specific components (.cta, .btn,
   .back-link, .field-link, a.sys-card, nav links, icon-only buttons, ...)
   already have their own affordance and opt out of the icon so it doesn't
   double up. */
:root { --link-color: var(--cream); }
.card, .sys-card, .detail-code-badge, .demo-panel.on-cream, .demo-panel.on-cream-gray,
.icon-card, form.auth-form, .result-table,
.systems-list li {
  --link-color: var(--blue);
}
a { color: var(--link-color); text-decoration: none; font-weight: inherit; }
a:hover { text-decoration: none; }
a::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: .2em;
  background-color: var(--link-color);
  vertical-align: -0.14em;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'/%3E%3Cpolyline points='7 7 17 7 17 17'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'/%3E%3Cpolyline points='7 7 17 7 17 17'/%3E%3C/svg%3E") center / contain no-repeat;
}
.cta::after, .btn::after, button::after, .back-link::after, .field-link::after,
a.sys-card::after, .icon-btn::after, .wordmark::after, .navlink::after,
.nav-dropdown a::after, .lang-switch a::after, .fav-star::after {
  content: none;
}

h1, h2, h3, .wordmark, .navlink, .btn, button, .tag, .eyebrow {
  font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif;
}
/* Three-tier hierarchy: logo (.wordmark .name, 2.5rem) is the top level and
   lives entirely in the header; h1/h2 (page title, 2.1rem) and h3 (section
   heading, 1.4rem) are unscoped so every page gets consistent sizing whether
   or not the title sits inside a .hero wrapper. h1 itself is currently
   unused sitewide (kept as a safety net, same treatment as h2) since every
   former page-title h1 was converted to h2 to leave exactly one visual
   "biggest heading" tier below the logo. */
h1, h2 {
  font-family: 'Roboto', -apple-system, 'Segoe UI', sans-serif; font-weight: 300;
  margin: 0; text-wrap: balance; font-size: 2.1rem; color: var(--cream); line-height: 1.15;
}
h3 {
  font-family: 'Roboto', -apple-system, 'Segoe UI', sans-serif; font-weight: 400;
  font-size: 1.4rem; color: var(--cream); margin: 0 0 14px;
}

/* ---------- page shell ----------
   Keeps the whole page (header + content + footer) inside a comfortable
   max-width instead of stretching edge-to-edge on wide screens - same idea
   as html5up's #wrapper, without the permanent sidebar. */
.page-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 736px) { .page-shell { padding: 0 20px; } }
@media (max-width: 480px) { .page-shell { padding: 0 16px; } }

/* ---------- header ----------
   Full-bleed sticky bar (own background + bottom accent line), independent
   of .page-shell, so it stays put while the page scrolls underneath it.
   An inner wrapper mirrors .page-shell's max-width so logo/icons line up
   with the content below. */
.site-header-bar {
  position: sticky; top: 0; z-index: 800;
  background: var(--blue);
}
.site-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 3px solid var(--cream);
}
@media (max-width: 736px) { .site-header { padding: 14px 20px; } }
@media (max-width: 480px) { .site-header { padding: 12px 16px; } }

/* Both lines of the wordmark are flush to the right edge of the block. */
.wordmark, .wordmark:hover { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; text-decoration: none; }
.wordmark .name {
  font-family: 'Roboto', -apple-system, 'Segoe UI', sans-serif;
  font-weight: 300; font-size: 2.5rem; letter-spacing: .2px; color: var(--cream);
}
.wordmark .by { font-weight: 400; font-size: 1.0rem; color: var(--ink); opacity: .62; margin-top: 2px; }

.inline-form { display: inline; }

/* ---------- header icon row (profile / instagram / menu) ---------- */
.header-icons { display: flex; align-items: center; gap: 14px; }

.icon-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  background: none; border: none; padding: 0; cursor: pointer; text-decoration: none;
}
.icon-btn img { width: 24px; height: 24px; display: block; }
.icon-btn:hover { background: rgba(0, 0, 0, 0.14); }

/* Logged-in marker on the "My Pages" icon - bottom-right badge. */
.icon-badge {
  position: absolute; bottom: -2px; right: -2px;
  width: 14px; height: 14px; line-height: 0;
  border-radius: 50%;
}

/* ---------- menu button + dropdown ---------- */
.menu-wrap { position: relative; }

.menu-button {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  width: 34px; height: 34px; padding: 0; border-radius: 8px;
  background: var(--panel-on-blue); border: 1px solid var(--hair); cursor: pointer;
}
.menu-button span { display: block; width: 17px; height: 2px; margin: 0 auto; background: var(--cream); }
.menu-button:hover { background: rgba(0, 0, 0, 0.14); }

/* Opens right under the hamburger icon, not a full side panel. */
.nav-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 950;
  min-width: 220px;
  background: var(--cream); border: 1.5px solid var(--cream-line); border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  padding: 10px;
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.lang-switch {
  display: flex; gap: 6px;
  padding: 2px 6px 10px; margin-bottom: 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.lang-switch a {
  font-size: .74rem; font-weight: 700; letter-spacing: .03em;
  padding: 4px 9px; border-radius: 6px;
  color: var(--muted); text-decoration: none;
}
.lang-switch a:hover { background: rgba(0, 0, 0, 0.06); color: var(--blue); }
.lang-switch a.active { background: var(--blue); color: var(--cream); }

.nav-dropdown a,
.nav-dropdown .link-button {
  font-weight: 600; font-size: .98rem; color: var(--muted);
  text-decoration: none; padding: 9px 10px; border-radius: 6px;
  background: none; border: none; text-align: left; cursor: pointer; font-family: inherit;
}
.nav-dropdown a:hover,
.nav-dropdown .link-button:hover { background: rgba(0, 0, 0, 0.06); color: var(--blue); }

body.is-menu-open .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

/* Collapses the admin links into one "Admin" toggle so the dropdown doesn't
   grow with every new admin page - expands in place, not a flyout, so it
   still works the same on touch and desktop. */
.nav-submenu-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 8px; }
.nav-submenu-toggle .chevron { flex: 0 0 auto; transition: transform .15s ease; }
.nav-submenu.is-open .nav-submenu-toggle .chevron { transform: rotate(180deg); }
.nav-submenu-panel {
  display: none; flex-direction: column; gap: 2px;
  padding-left: 12px; margin: 2px 0 2px 10px;
  border-left: 2px solid rgba(0, 0, 0, 0.12);
}
.nav-submenu.is-open .nav-submenu-panel { display: flex; }

/* No max-width here - .page-shell already caps the overall width (1100px);
   .container just adds bottom spacing. Individual text elements (like .hero p)
   get their own narrower max-width for readability where it matters. */
.container { padding: 28px 0 88px; }

/* ---------- hero ----------
   Overrides the generic `section { margin-top: 48px }` gap - the hero sits
   directly under the sticky header's cream line and needs a tighter gap. */
.hero { margin-top: 0; padding: 0 0 24px; max-width: 660px; }
.hero p { font-size: 1.02rem; color: var(--ink); opacity: .78; max-width: 52ch; margin-top: 14px; line-height: 1.55; }

.cta, .btn, button[type="submit"], button {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue); color: var(--cream); font-weight: 700; font-size: .95rem;
  border: none; border-radius: 9px; padding: 10px 18px; cursor: pointer;
  text-decoration: none; font-family: 'Roboto Condensed', sans-serif;
}
.cta:hover, .btn:hover, button:hover { filter: brightness(.92); }

/* ---------- cards ---------- */
.card {
  background: var(--cream);
  border: 1.5px solid var(--cream-line);
  border-radius: 16px;
  padding: 26px 28px;
}
.card + .card { margin-top: 18px; }
.card p { color: var(--ink); line-height: 1.6; margin: 0; }

section { margin-top: 48px; }
/* .hero already has its own bottom padding for breathing room - a section
   right after it doesn't need to stack its own margin-top on top of that. */
.hero + section { margin-top: 0; }
section > .section-note {
  color: var(--ink); opacity: .68; font-style: italic; font-weight: 400;
  font-size: .92rem; max-width: 58ch; margin: 0 0 18px;
}

/* Regular-size text for results copy (Check a Draw) - the muted italic
   .section-note is too small and faint for text that carries the result. */
.check-note { color: var(--ink); font-size: 1rem; line-height: 1.5; margin: 0 0 14px; }

/* ---------- admin dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat {
  background: var(--cream); border: 1.5px solid var(--cream-line); border-radius: 14px;
  padding: 14px 16px;
}
.stat-value { font-size: 1.9rem; font-weight: 300; color: var(--blue); line-height: 1.1; }
.stat-label { margin-top: 4px; font-size: .88rem; color: var(--ink); opacity: .75; }

/* ---------- fill-in guide ---------- */
.fill-toggle { display: flex; gap: 8px; margin-bottom: 18px; }
.fill-toggle button { opacity: .6; }
.fill-toggle button.is-active { opacity: 1; box-shadow: 0 0 0 2px var(--cream); }

/* One single column, so it's always clear which row you're on. */
.fill-list { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.fill-list[hidden], #fillSlip[hidden] { display: none; }
.fill-row { margin: 0; padding: 12px 18px; display: flex; align-items: center; gap: 18px; }
.fill-row + .fill-row { margin-top: 0; }
.fill-row-title { font-weight: 700; flex: 0 0 64px; }
.fill-balls { display: flex; flex-wrap: wrap; gap: 8px; }
.fill-ball { width: 56px; height: 56px; display: block; }

.slip-nav { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.slip-nav button:disabled { opacity: .4; cursor: default; filter: none; }
.slip-nav #slipCounter { color: var(--cream); }
.slip { max-width: 480px; }
.slip:focus { outline: none; }
.slip-grid { display: grid; grid-template-columns: repeat(var(--cols, 7), 1fr); gap: 8px; }
.slip-cell {
  aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .05); color: var(--muted); font-size: .85rem;
}
.slip-cell.ticked { background: none; }
.slip-cell img { width: 100%; height: 100%; display: block; border-radius: 50%; box-shadow: 0 0 0 3px var(--blue); }

/* ---------- system cards ---------- */
.systems { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .systems { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .systems { grid-template-columns: 1fr; } }

.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 24px; }
.pagination[hidden] { display: none; }
.pagination button:disabled { opacity: .4; cursor: default; filter: none; }
.pagination #pageInfo { color: var(--cream); font-size: .9rem; }

.sys-card {
  background: var(--cream); border: 1.5px solid var(--cream-line); border-radius: 16px;
  padding: 20px 22px; display: flex; flex-direction: column; gap: 10px;
}
.sys-card-top { display: flex; align-items: center; gap: 6px; }
.sys-id { color: var(--blue); font-size: .95rem; font-weight: 500; }
.sys-card h3 { color: var(--ink); font-size: 1.1rem; font-weight: 300; margin: 0; }
.sys-card .meta { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.sys-card .footer-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(0, 0, 0, .12);
}
.example-tag {
  font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--blue);
}

.filter-form { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-end; }
.filter-form #resetFilters { margin-left: auto; align-self: flex-end; }
/* The global `button { align-self: flex-start }` would otherwise pin a submit
   button to the top of the row instead of lining it up with the inputs. */
.filter-form button { align-self: flex-end; }
.filter-form select { min-width: 140px; }

a.sys-card {
  text-decoration: none; color: inherit;
  transition: box-shadow .15s ease, transform .15s ease;
}
a.sys-card:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, .18); transform: translateY(-2px); text-decoration: none; }

/* ---------- favorite star ---------- */
.fav-star {
  background: none; border: none; padding: 2px; margin: 0; cursor: pointer;
  color: var(--blue); display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.fav-star svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.fav-star.favorited svg { fill: currentColor; }
.fav-star:hover { opacity: .75; }

/* ---------- system grid (X/blank matrix, book style) ---------- */
.system-grid { border-collapse: collapse; margin-top: .5rem; }
.system-grid th, .system-grid td { padding: 5px 10px; text-align: center; }
.system-grid thead th { border-bottom: 2px solid var(--cream-line); height: 10px; }
.system-grid tbody th {
  border-right: 2px solid var(--cream-line); color: var(--ink); font-weight: 700; font-size: .85rem;
}
.system-grid td { border: none; color: var(--ink); font-weight: 700; }
.system-grid td.shade, .system-grid th.shade { background: rgba(0, 0, 0, .08); }

.detail-columns { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.detail-columns > div { overflow-x: auto; }

.guarantee-tables-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.guarantee-tables-row .card { margin-top: 0; }

.guarantee-table { border-collapse: collapse; }
.guarantee-table th, .guarantee-table td {
  padding: 4px 10px; text-align: center; font-size: .85rem; border: none;
}
.guarantee-table th:last-child, .guarantee-table td:last-child { text-align: right; }

.back-link { color: var(--cream); text-decoration: none; font-weight: 600; }
.back-link:hover { text-decoration: underline; }

/* ---------- My Pages dashboard ---------- */
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.section-header h3 { margin: 0; }
.section-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.pill-blue { background: rgba(81, 156, 189, .15); color: var(--blue); }
.pill-owned { background: rgba(46, 125, 50, .15); color: #2e7d32; }
.pill-book { background: rgba(0, 0, 0, .08); color: var(--muted); }

/* Reuses the header's circular icon-button look for compact row actions
   (delete, unfavorite) inside result tables. */
.result-table .icon-btn { display: inline-flex; width: 30px; height: 30px; color: var(--muted); }
.result-table .icon-btn.fav-star { color: var(--blue); }
.result-table .icon-btn.delete-btn:hover { background: rgba(192, 57, 43, .14); color: #c0392b; }

.detail-code-badge {
  display: inline-flex; background: var(--cream); border: 1.5px solid var(--cream-line);
  border-radius: 10px; padding: 8px 14px;
}
.hero .detail-code-badge h2 {
  color: var(--blue); font-size: .95rem; font-weight: 500; line-height: 1.3;
}
.guarantee-table thead th { border-bottom: 1.5px solid rgba(0, 0, 0, .2); color: var(--ink); }
.guarantee-table tbody td { color: var(--muted); }
.guarantee-table caption { text-align: left; font-weight: 700; color: var(--ink); margin-bottom: 6px; caption-side: top; }

/* ---------- contrast demo ---------- */
.demo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .demo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .demo-grid { grid-template-columns: 1fr; } }

.demo-panel {
  border-radius: 16px; padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 8px;
  min-height: 160px;
}
.demo-panel .demo-label { font-weight: 700; font-size: .68rem; letter-spacing: .07em; text-transform: uppercase; }
.demo-panel .sample-title { font-weight: 300; font-size: 1rem; font-family: 'Roboto', sans-serif; }
.demo-panel .sample-body { font-size: .84rem; line-height: 1.45; }

.demo-panel.avoid, .demo-panel.on-blue { background: var(--blue); }
.demo-panel.avoid .demo-label { color: var(--ink); opacity: .75; }
.demo-panel.avoid .sample-title { color: var(--ink); }
.demo-panel.avoid .sample-body { color: var(--muted); }

.demo-panel.on-blue .demo-label { color: var(--cream); opacity: .85; }
.demo-panel.on-blue .sample-title { color: var(--cream); font-size: 1.2rem; }
.demo-panel.on-blue .sample-body { color: var(--ink); }

.demo-panel.on-cream, .demo-panel.on-cream-gray { background: var(--cream); border: 1.5px solid var(--cream-line); }
.demo-panel.on-cream .demo-label { color: var(--blue); }
.demo-panel.on-cream .sample-title { color: var(--blue); font-size: 1.2rem; }
.demo-panel.on-cream .sample-body { color: var(--ink); }

.demo-panel.on-cream-gray .demo-label { color: var(--ink); opacity: .7; }
.demo-panel.on-cream-gray .sample-title { color: var(--ink); }
.demo-panel.on-cream-gray .sample-body { color: var(--muted); }

.ratio { margin-top: auto; padding-top: 8px; font-size: .74rem; display: flex; justify-content: space-between; }
.demo-panel.avoid .ratio { color: var(--ink); border-top: 1px solid rgba(0, 0, 0, .28); }
.demo-panel.on-blue .ratio { color: var(--cream); opacity: .85; border-top: 1px solid rgba(255, 250, 217, .3); }
.demo-panel.on-cream .ratio { color: var(--blue); border-top: 1px solid rgba(0, 0, 0, .12); }
.demo-panel.on-cream-gray .ratio { color: var(--ink); opacity: .7; border-top: 1px solid rgba(0, 0, 0, .12); }

/* ---------- token legend ---------- */
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.swatch { background: var(--panel-on-blue); border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; }
.swatch .fill { height: 48px; }
.swatch .info { padding: 10px 12px; }
.swatch .role { font-weight: 300; font-size: .88rem; color: var(--ink); }
.swatch .hex { font-size: .78rem; color: var(--ink); opacity: .68; margin-top: 2px; }
.swatch .usage { font-size: .76rem; color: var(--ink); opacity: .68; margin-top: 5px; line-height: 1.4; }

/* ---------- icons ---------- */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 14px; }
.icon-card {
  background: var(--cream); border: 1.5px solid var(--cream-line); border-radius: 12px;
  padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.icon-card img { width: 60px; height: 60px; }
.icon-card span { font-size: .72rem; color: var(--ink); opacity: .7; }

/* ---------- narrow form pages (login, register, verify-code) ----------
   Centers the heading/hints/links around the centered form box below them. */
.auth-page { text-align: center; }
.auth-page form { text-align: left; }

/* ---------- forms ---------- */
form.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  background: var(--cream);
  border: 1.5px solid var(--cream-line);
  border-radius: 16px;
  padding: 26px 28px;
}

label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--ink); }
input, textarea {
  width: 100%; box-sizing: border-box;
  padding: 0.55rem 0.7rem; border: 1px solid rgba(0, 0, 0, 0.28); border-radius: 6px;
  font-size: 1rem; font-family: 'Inter', sans-serif; background: #fff;
}
textarea { resize: vertical; }
.checkbox-label { flex-direction: row; align-items: center; gap: .5rem; }
.checkbox-label input[type="checkbox"] { width: auto; padding: 0; border: none; background: none; }

altcha-widget {
  display: block; width: 100%;
  --altcha-max-width: 100%;
  --altcha-color-base: var(--blue);
  --altcha-color-base-content: var(--cream);
  --altcha-border-color: var(--cream);
  --altcha-checkbox-border-color: var(--cream);
}

button { align-self: flex-start; }

.error { color: #7a1f1f; font-weight: 600; }
.hint { color: var(--ink); opacity: .68; font-style: italic; }
.muted { color: var(--muted); font-size: 0.85rem; margin-left: 0.5rem; }

.table-scroll { overflow-x: auto; }
.result-table { margin-top: 1rem; width: 100%; border-collapse: collapse; background: var(--cream); border: 1.5px solid var(--cream-line); border-radius: 12px; overflow: hidden; }
.result-table td { padding: 0.5rem 1rem; border-bottom: 1px solid rgba(0, 0, 0, 0.12); color: var(--ink); }
.result-table th {
  padding: 0.5rem 1rem; text-align: left; color: var(--ink);
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.2); font-weight: 700;
}
.result-table .table-action { text-align: right; }
.result-table .nowrap { white-space: nowrap; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

select {
  padding: 0.55rem 0.7rem; border: 1px solid rgba(0, 0, 0, 0.28); border-radius: 6px;
  font-size: 1rem; font-family: 'Inter', sans-serif; background: #fff; color: var(--ink);
}

/* ---------- number picker (Saved Numbers) ---------- */
.picker-label { max-width: 320px; }
.picker-col { width: 400px; max-width: 100%; margin-left: auto; margin-right: auto; }
.card-compact { padding: 20px 28px; }

.picker-header { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.picker-max { max-width: 100px; }
.picker-count { font-size: .9rem; color: var(--muted); padding-bottom: .55rem; }
.picker-count strong { color: var(--blue); font-size: 1.05rem; }

.order-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  min-height: 56px;
  padding: 10px; border: 2px dashed rgba(0, 0, 0, 0.3);
}
.order-strip.drag-over { background: rgba(0, 0, 0, 0.06); border-color: var(--blue); }
.order-strip-empty { margin: 0; color: var(--ink); opacity: .55; font-style: italic; font-size: .85rem; }

.order-chip {
  display: flex; align-items: center; gap: 2px;
  background: var(--blue); color: var(--cream);
  border-radius: 20px; padding: 5px 6px 5px 12px;
  font-weight: 700; font-size: .85rem; cursor: grab;
}
.order-chip:active { cursor: grabbing; }
.order-chip button {
  background: none; border: none; color: var(--cream); opacity: .75;
  cursor: pointer; font-size: 1rem; line-height: 1; padding: 3px 6px;
}
.order-chip button:hover { opacity: 1; }

.ball-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.ball {
  position: relative; width: 100%; aspect-ratio: 1; padding: 0;
  background: none; border: none; border-radius: 50%; cursor: pointer;
}
.ball img { width: 100%; height: 100%; display: block; transition: filter .12s ease, transform .12s ease; }
.ball.selected img { filter: brightness(.7) saturate(.5); transform: scale(.93); }
.ball.selected::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, .5), inset 0 -2px 3px rgba(255, 255, 255, .15);
  pointer-events: none;
}
.ball:hover img { filter: brightness(.92); }
@media (max-width: 480px) {
  .ball-grid { grid-template-columns: repeat(5, 1fr); }
}

.picker-actions { display: flex; justify-content: center; gap: 10px; }

.random-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.random-row label { flex: 0 0 auto; font-size: .9rem; color: var(--ink); white-space: nowrap; }
.random-row input[type="number"] { width: 80px; flex: 0 0 auto; }
.random-row button { flex: 0 0 auto; }

.systems-list { list-style: none; padding: 0; }
.systems-list li {
  padding: 18px 22px; margin-top: 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--cream); border: 1.5px solid var(--cream-line); border-radius: 16px;
}
.systems-list li > details { flex-basis: 100%; }
.qr { border-radius: 6px; }

.site-footer { text-align: center; padding: 1.5rem; color: var(--cream); opacity: .75; font-size: 0.85rem; }
.site-footer a { color: var(--cream); }

.mono { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; letter-spacing: -.01em; }

/* ---------- Typography reference (Styleguide) ---------- */
.type-row {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px 0; flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, .16);
}
.type-row:first-child { border-top: none; }
.card .type-row { border-top-color: rgba(0, 0, 0, .12); }
.type-row .type-sample,
.type-row > *:first-child { flex: 1 1 320px; min-width: 0; }
.type-row .type-meta { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.type-meta .type-name { font-weight: 700; font-size: .78rem; letter-spacing: .02em; color: var(--cream); }
.type-meta .type-spec { font-size: .72rem; color: var(--cream); opacity: .72; }
.card .type-meta .type-name { color: var(--ink); }
.card .type-meta .type-spec { color: var(--muted); opacity: 1; }
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.field-link { font-size: .78rem; font-weight: 600; color: var(--blue); text-decoration: none; }
.field-link:hover { text-decoration: underline; }
