:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface2: #f2f5fa;
  --ink: #101828;
  --muted: #667085;
  --border: #e4e7ec;
  --brand: #3157d5;
  --brand-hover: #2346b7;
  --shadow: 0 16px 48px rgba(16, 24, 40, .07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--brand); }
.shell { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
header, footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
header { padding: 24px 0; border-bottom: 1px solid var(--border); }
footer { border-top: 1px solid var(--border); padding: 22px 0 32px; color: var(--muted); font-size: 12px; }
.brand { color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 800; display: inline-flex; align-items: center; gap: 11px; }
.brand b { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; color: #fff; background: var(--brand); font-size: 15px; }
header>div { display: flex; align-items: center; gap: 16px; }
select, input, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid #cfd6e2; padding: 10px 12px; border-radius: 10px; max-width: 100%; }
select:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #a9c4ff; outline-offset: 2px; }
button { font: inherit; color: #fff; background: var(--brand); border: 1px solid var(--brand); border-radius: 10px; padding: 11px 17px; cursor: pointer; font-weight: 700; }
button:hover { background: var(--brand-hover); }
button[aria-pressed="false"] { background: #fff; color: var(--brand); }
button[aria-pressed="true"] { background: var(--brand); color: #fff; }
button:disabled { opacity: .55; cursor: not-allowed; }
.hero { padding: 76px 0 36px; text-align: center; }
.hero h1 { font-size: clamp(36px, 5vw, 62px); line-height: 1.09; letter-spacing: -.055em; margin: 17px auto 22px; max-width: 850px; }
.hero p { font-size: 18px; max-width: 760px; margin: 0 auto; }
.muted, .hero p { color: var(--muted); line-height: 1.65; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 18px 0 45px; }
.card { display: flex; flex-direction: column; gap: 15px; min-height: 240px; padding: 26px; color: var(--ink); text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); transition: border-color .15s ease, transform .15s ease; }
.card:hover { border-color: #a7bbfb; transform: translateY(-2px); }
.card strong { font-size: 25px; letter-spacing: -.025em; }
.card>span { color: var(--muted); line-height: 1.55; }
.card em { color: var(--brand); font-size: 30px; font-style: normal; }
.card b { color: var(--brand); margin-top: auto; font-size: 14px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; max-width: 880px; margin: 18px 0; line-height: 1.65; box-shadow: 0 8px 28px rgba(16,24,40,.035); }
.narrow { padding: 48px 0 65px; min-height: 55vh; }
.narrow h1 { font-size: clamp(31px,4vw,43px); letter-spacing: -.045em; }
.back { color: var(--brand); display: inline-block; margin: 12px 0; font-weight: 650; }
.field { display: flex; flex-direction: column; gap: 8px; margin: 18px 0; }
.field input:not([type="checkbox"]) { max-width: 340px; }
textarea { width: 100%; resize: vertical; min-height: 130px; }
.modes { display: flex; flex-wrap: wrap; gap: 12px; }
.providers { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.provider { background: var(--surface); padding: 16px; border-radius: 14px; border: 1px solid var(--border); }
.provider small { display: block; color: var(--muted); line-height: 1.55; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 13px 0; font-size: 14px; }
.check input { accent-color: var(--brand); }
.provider input[type="password"] { width: 100%; }
.index-results { margin-top: 18px; }
.index-entry { margin: 10px 0; overflow-wrap: anywhere; }
.index-entry p { line-height: 1.5; }
.index-entry small { display: block; margin-top: 7px; color: var(--muted); }
.index-entry > a { display: inline-block; margin-top: 10px; font-size: 14px; }
.index-pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; padding: 20px 0 6px; }
.index-pagination button { padding: 8px 13px; }
.index-pagination span { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.final-answer { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.6; max-width: 100%; overflow-x: auto; }
.hidden { display: none!important; }
@media (max-width: 700px) {
 .shell { padding: 0 16px; }
 header { flex-wrap: wrap; }
 header>div { width: 100%; justify-content: space-between; }
 .cards, .providers { grid-template-columns: 1fr; }
 .card { min-height: 190px; }
 .hero { padding: 48px 0 26px; }
 footer { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }

/* Light: two first-party provider work panes, NOT vendor iframes. */
.assistant-duet { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.assistant-pane { border:1px solid var(--border); border-radius:14px; padding:18px; min-height:210px; background:var(--surface2); }
.assistant-pane h3 { margin:0 0 12px; font-size:18px; }
.assistant-pane .final-answer { margin:0; }
@media (max-width:700px) { .assistant-duet { grid-template-columns:1fr; } }

/* Human-readable developer examples: wrap instead of clipping on mobile. */
.developer-code{max-width:100%;overflow-x:auto;white-space:pre-wrap;overflow-wrap:anywhere;background:var(--panel,#f3f6fb);border:1px solid var(--line,#d7e0eb);border-radius:10px;padding:12px;font-size:12px;line-height:1.6}
.developer-code code{white-space:inherit}


/* Index product page: mirror Coster's PC | product identity and horizontal
   rhythm while keeping the current catalogue logic and other routes intact. */
body[data-page="index"] .shell { max-width: 1180px; padding: 0 24px; }
body[data-page="index"] main { min-width: 0; }
.index-topbar {
  display: block; padding: 0;
  position: sticky; top: 0; z-index: 20;
  width: 100%; background: rgba(255,255,255,.98);
  border-bottom: 1px solid var(--border);
}
.index-topbar-inner {
  width: 100%; max-width: 1180px; min-height: 68px; margin: 0 auto; padding: 9px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.index-brand-group { display: flex; align-items: center; gap: 13px; min-width: 0; }
.index-portal-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); font-size: 13px; font-weight: 800; text-decoration: none;
  white-space: nowrap; border-radius: 8px;
}
.index-portal-link:hover { color: var(--brand); }
.index-portal-mark, .index-product-mark {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 9px; color: #fff; background: var(--brand);
}
.index-portal-mark { font-size: 11px; font-weight: 800; }
.index-product-mark { font-size: 15px; font-weight: 800; }
.index-brand-separator { height: 27px; border-left: 1px solid var(--border); }
.index-product-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.index-product-brand strong { font-size: 16px; }
.index-top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.index-subscription { font-size: 13px; color: var(--muted); white-space: nowrap; }
.index-language-label select { padding: 7px 10px; font-size: 12px; color: #344054; border-radius: 9px; }
.index-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.index-layout { width: 100%; max-width: 1020px; margin: 0 auto; min-height: 55vh; padding: 54px 0 70px; }
.index-layout > h1 {
  margin: 0 0 25px; font-size: clamp(32px,4vw,43px);
  line-height: 1.14; letter-spacing: -.04em;
}
.index-layout > .panel {
  width: 100%; max-width: none; margin: 0 0 18px;
  padding: 26px 30px; border-radius: 20px;
}
.index-context-note { color: #475467; font-size: 14px; line-height: 1.65; }
.index-layout .panel h2 { margin: 0 0 7px; font-size: 22px; line-height: 1.3; letter-spacing: -.025em; }
.index-layout .panel > p.muted { margin: 0; font-size: 14px; line-height: 1.65; }
.index-search-form {
  display: grid; grid-template-columns: minmax(0,1fr) auto;
  gap: 12px; align-items: end; margin: 22px 0 15px;
}
.index-search-form .field { min-width: 0; margin: 0; font-size: 13px; font-weight: 650; }
.index-search-form .field input:not([type="checkbox"]) { width: 100%; max-width: none; font-weight: 400; }
.index-search-form button { min-width: 122px; white-space: nowrap; }
.index-layout .index-privacy-notice { font-size: 12px!important; line-height: 1.55!important; }
.index-layout .index-results { min-width: 0; }
.index-bottom-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.index-bottom-links .back { margin: 6px 0; }
@media (max-width: 740px) {
  body[data-page="index"] .shell { padding: 0 16px; }
  .index-topbar-inner { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .index-brand-group { flex-wrap: wrap; gap: 8px; }
  .index-top-actions { width: 100%; justify-content: space-between; }
  .index-layout { padding: 36px 0 52px; }
  .index-layout > .panel { padding: 20px; }
  .index-search-form { grid-template-columns: minmax(0,1fr); }
  .index-search-form button { justify-self: start; }
}
@media (max-width: 420px) {
  .index-brand-separator { display: none; }
  .index-portal-link { font-size: 12px; }
  .index-product-brand strong { font-size: 14px; }
}


/* Shared portal support: wallet implementation stays owned by Coster. */
.portal-support-trigger {
  color: #2445a9; background: #fff; border: 1px solid #d6dfef;
  padding: 9px 13px; font-size: 13px; font-weight: 750;
  border-radius: 10px; white-space: nowrap;
}
.portal-support-trigger:hover { color: #17378f; background: #f1f5ff; }
.portal-support-trigger:disabled { opacity: .65; }
.support-dialog {
  border: 1px solid #d0d5dd; border-radius: 18px; padding: 24px;
  width: min(94vw,610px); max-height: 90vh; overflow: auto;
  background: #fff; color: #101828; box-shadow: 0 22px 80px #10182835;
}
.support-dialog::backdrop { background: #101828a8; }
.support-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.support-head h2 { margin: 4px 0; font-size: 24px; }
.support-eyebrow { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.portal-support-close {
  width: 34px; height: 34px; padding: 4px; flex: 0 0 34px;
  color: var(--ink); background: #fff; border: 1px solid var(--border);
}
.portal-support-close:hover { color: var(--brand); background: #f4f7ff; }
.support-dialog > p { line-height: 1.5; color: #475467; font-size: 14px; }
.support-wallet { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin: 12px 0; display: grid; gap: 9px; }
.support-wallet h3, .support-wallet p { margin: 0; }
.support-wallet p { font-size: 12px; color: var(--muted); }
.support-wallet code { display: block; overflow-wrap: anywhere; user-select: all; font-size: 12px; }
.support-wallet-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.support-wallet-actions button { color: var(--brand); background: #fff; border: 1px solid #cad4e9; font-size: 13px; padding: 8px 12px; }
.support-wallet-actions button:hover { background: #edf3ff; }
.wallet-qr:not([hidden]) { display: block; width: 164px; height: 164px; max-width: 100%; image-rendering: pixelated; border: 8px solid #fff; border-radius: 10px; box-shadow: 0 0 0 1px var(--border); margin: 8px 0; }
.wallet-qr[hidden] { display: none; }
.support-dialog .support-warning { color: #b42318; font-size: 12px; }
@media(max-width: 740px) {
  body[data-page="home"] .shell > header,
  body[data-page="developers"] .shell > header { flex-wrap: wrap; }
  body[data-page="home"] .shell > header > div,
  body[data-page="developers"] .shell > header > div { flex-wrap: wrap; gap: 8px; }
  .index-top-actions { flex-wrap: wrap; gap: 8px; }
  .support-dialog { padding: 16px; }
}

/* Hallmark-informed accessibility polish for portal/Index/Developers. */
:where(summary, [tabindex]):focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Product UI finish 2026-11-04: cards, search hierarchy, responsive controls. */
/* Keep the existing portal identity and make the two actual products prominent. */
body[data-page="home"] .hero { max-width: 880px; margin-inline: auto; }
body[data-page="home"] .card { min-width: 0; padding: 30px; }
body[data-page="home"] .card em {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--surface2); font-size: 25px;
}
body[data-page="home"] .card strong { font-size: clamp(24px, 2.5vw, 28px); }
body[data-page="home"] .card:hover { box-shadow: 0 15px 38px rgba(16,24,40,.10); }

/* Preserve every MCP field; improve scanning long publisher names and results. */
body[data-page="index"] .index-results > p.muted:first-child {
  font-weight: 650; font-variant-numeric: tabular-nums;
}
body[data-page="index"] .index-entry {
  min-width: 0; margin: 14px 0; padding: 20px 22px;
  border-radius: 15px; border-color: var(--border);
}
body[data-page="index"] .index-entry > strong {
  display: block; line-height: 1.35; font-size: 16px;
  color: var(--ink); overflow-wrap: anywhere;
}
body[data-page="index"] .index-entry > p {
  margin: 9px 0 0; font-size: 14px; overflow-wrap: anywhere;
}
body[data-page="index"] .index-entry > p.muted { font-size: 13px; }
body[data-page="index"] .index-entry > small { line-height: 1.5; }
body[data-page="index"] .index-entry > small:first-of-type {
  display: inline-block; padding: 3px 8px; border-radius: 7px;
  background: var(--surface2); margin-top: 11px;
}
body[data-page="index"] .index-entry > a {
  font-weight: 650; text-underline-offset: 3px;
}

/* Align the developer documentation like the accepted centered Index panels. */
body[data-page="developers"] .narrow {
  width: 100%; max-width: 980px; min-width: 0; margin-inline: auto;
}
body[data-page="developers"] .panel { max-width: none; }

@media (max-width: 700px) {
  body[data-page="home"] .card { padding: 22px; }
  body[data-page="index"] .index-entry { padding: 16px; }
}


/* Public homepage operational evidence: 4 modest metrics per product, no invented traction. */
body[data-page="home"] .card { min-width: 0; gap: 14px; }
.home-metric-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 3px 0 6px; }
.home-metric { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 11px 12px; border-radius: 12px; background: var(--surface2); }
.home-metric-value { display: block; color: var(--ink); font-size: clamp(19px,2vw,25px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.home-metric > [data-i18n] { color: var(--muted); font-size: 12px; line-height: 1.4; }
.home-metric-note { max-width: 960px; margin: -25px auto 34px; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
@media (max-width:700px) {
 .home-metric-note { margin-top: -25px; text-align: left; }
 .home-metric-grid { gap: 8px; }
 .home-metric { padding: 10px; }
}
