:root {
  --bg: #f7f8fa; --surface: #fff; --text: #1a1f2b; --muted: #556070; --line: #dde2ea;
  --brand: #0b5cad; --brand-ink: #fff; --ok: #1d7a3a; --warn: #8a5a00; --off: #6b7280;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.55; color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); }
a { color: var(--brand); }
:focus-visible { outline: 3px solid #f0a500; outline-offset: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 9; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 64px; position: relative; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 800;
  display: grid; place-items: center; font-size: 1.05rem; }
.brand-text { font-size: 1.15rem; letter-spacing: 0.01em; } .brand-text strong { color: var(--text); font-weight: 800; }
.menu-btn { font-size: 1.4rem; background: none; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  width: 40px; height: 40px; color: var(--text); }
#nav { display: none; flex-direction: column; gap: 12px; position: absolute; left: 0; right: 0; top: 64px; background: var(--surface);
  border: 1px solid var(--line); padding: 12px; border-radius: 10px; z-index: 5; }
#nav.open { display: flex; }
.nav-links { display: flex; flex-direction: column; gap: 2px; }
.nav-links a { text-decoration: none; color: var(--text); padding: 8px 12px; border-radius: 6px; font-weight: 500; }
.nav-links a:hover { background: #eef3f9; }
.nav-links a[aria-current="page"] { color: var(--brand); background: #e8f0fa; }
.auth-area { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 12px 4px; border-top: 1px solid var(--line); }
.auth-area a { color: var(--muted); text-decoration: none; font-size: 0.9rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 860px) {
  .menu-btn { display: none; }
  #nav { display: flex; flex-direction: row; align-items: center; gap: 24px; position: static; border: 0; padding: 0; flex: 1; justify-content: space-between; margin-left: 40px; }
  .nav-links { flex-direction: row; gap: 4px; }
  .auth-area { border: 0; padding: 0; }
}

main { padding: 0 16px 48px; }
main > :first-child { margin-top: 24px; }
h1 { font-size: 1.9rem; line-height: 1.2; } h2 { margin-top: 2rem; }
.hero { margin-bottom: 40px; padding: clamp(28px, 6vw, 56px) clamp(20px, 5vw, 48px); border: 1px solid var(--line);
  border-radius: 16px; background: var(--surface); }
.eyebrow { color: var(--brand); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); letter-spacing: -0.02em; margin: 0.2em 0 0.3em; }
.hero .lead { max-width: 640px; }
.lead { font-size: 1.15rem; color: var(--muted); }
.btn-lg { padding: 12px 22px; font-weight: 600; }
.highlights { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.highlights li { border-left: 3px solid var(--brand); padding-left: 12px; }
.highlights strong, .highlights span { display: block; }
.highlights span { color: var(--muted); font-size: 0.95rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-head h2 { margin-top: 0; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column;
  transition: border-color .15s; }
.card:hover { border-color: #b7c3d3; }
.card.muted .icon { filter: grayscale(1); opacity: .6; }
.card h3 { margin: 2px 0 6px; font-size: 1.15rem; } .card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--brand); }
.card .desc { color: var(--muted); margin: 0 0 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.icon { font-size: 1.4rem; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: #eef3f9; }
.card .cat { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.chip { display: inline-block; font-size: 0.8rem; padding: 2px 10px; border-radius: 6px; background: #eef3f9; color: var(--text); }
.card-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.foot-note { color: var(--off); font-size: 0.9rem; padding: 8px 0; }
.cat, .muted-text { color: var(--muted); font-size: 0.9rem; margin: 2px 0; }
.page-head { margin-bottom: 24px; } .page-head h1 { margin: 0.1em 0 0.2em; } .page-head .lead { margin: 0; max-width: 640px; }
.count { color: var(--muted); font-size: 0.9rem; margin: 16px 0 12px; }

.badge { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid currentColor; }
.s-available { color: var(--ok); } .s-beta { color: var(--brand); } .s-coming_soon, .s-unavailable { color: var(--off); } .s-maintenance { color: var(--warn); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn { display: inline-block; background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); border-radius: 6px;
  padding: 8px 14px; font: inherit; text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.small { padding: 4px 10px; font-size: 0.9rem; }
.btn:disabled, .btn.disabled { background: #e5e7eb; color: var(--off); border-color: #d1d5db; cursor: not-allowed; }

.notice { background: #eef5fd; border-left: 4px solid var(--brand); padding: 12px 14px; border-radius: 4px; }
.notice.warn { background: #fdf6e8; border-left-color: var(--warn); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--muted); flex: 1 1 160px; }
.filters label.grow { flex: 3 1 240px; }
.filters input, .filters select { padding: 9px 10px; border-color: var(--line); color: var(--text); font-weight: 400; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid #9aa4b2; border-radius: 6px; background: #fff; max-width: 100%; }
textarea { width: 100%; }

.facts dt { font-weight: 600; margin-top: 12px; } .facts dd { margin-left: 0; }
.kv { border-collapse: collapse; width: 100%; background: var(--surface); }
.kv th, .kv td { text-align: left; border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; overflow-wrap: anywhere; }
pre { background: #10151f; color: #e6edf3; padding: 12px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.92rem; margin-top: 24px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); padding-top: 40px; padding-bottom: 32px; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand p { margin: 12px 0 0; max-width: 300px; }
.site-footer nav { display: flex; flex-direction: column; gap: 8px; }
.site-footer nav a { color: var(--muted); text-decoration: none; } .site-footer nav a:hover { color: var(--brand); }
.footer-title { margin: 0 0 4px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 16px; padding-bottom: 20px;
  border-top: 1px solid var(--line); font-size: 0.85rem; }

/* technology detail */
.crumbs { font-size: 0.9rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.detail-head { display: flex; gap: 20px; align-items: flex-start; margin: 16px 0 28px; }
.detail-head h1 { margin: 0.1em 0 0.2em; }
.detail-head .lead { margin: 0 0 12px; max-width: 680px; }
.icon-lg { width: 64px; height: 64px; font-size: 2rem; flex: none; border-radius: 14px; }
.tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.detail { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .detail { grid-template-columns: minmax(0, 1fr) 320px; } .detail-side { position: sticky; top: 84px; } }
.detail-main { display: flex; flex-direction: column; gap: 20px; }
.detail-main .notice { margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; }
.panel h2 { margin: 0 0 12px; font-size: 1.15rem; }
.panel h3 { margin: 0 0 4px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.panel ul { margin: 0; padding-left: 20px; } .panel p { margin: 0; }
.checks { list-style: none; padding: 0 !important; }
.checks li { padding-left: 26px; position: relative; margin-bottom: 6px; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.io { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0 0 16px; font-size: 0.95rem; }
.summary dt { color: var(--muted); } .summary dd { margin: 0; text-align: right; font-weight: 500; }
.side-note { font-size: 0.85rem; color: var(--muted); margin: 0 0 12px !important; }
.side-actions { display: flex; flex-direction: column; gap: 8px; }
.side-actions .btn { text-align: center; }
@media (max-width: 560px) { .detail-head { flex-direction: column; gap: 12px; } }

/* playground */
.tag-link { font-size: 0.9rem; text-decoration: none; margin-left: 4px; }
.pg { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .pg { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pg-feedback { grid-column: 1 / -1; } }
.pg .panel > h2 { display: flex; align-items: center; gap: 10px; }
.step { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 0.85rem; display: grid; place-items: center; }
.pg .notice { margin: 0 0 12px; }
.empty { border: 1px dashed #c3ccd8; border-radius: 10px; padding: 32px 16px; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 12px; } .empty p:last-child { margin: 0; }
.consent { border: 1px solid #ecd9b0; background: #fdf8ee; border-radius: 10px; padding: 16px; }
.consent h3 { margin: 0 0 8px; font-size: 0.95rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.consent p { font-size: 0.9rem; margin: 0 0 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 0.9rem; margin-bottom: 12px; }
#pg-form { display: flex; flex-direction: column; gap: 12px; }
.drop { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 20px 16px 4px; border: 1px dashed #9fb2c8;
  border-bottom: 0; border-radius: 10px 10px 0 0; background: #f6f9fc; text-align: center; cursor: pointer; margin-bottom: -12px; }
.drop span { color: var(--muted); font-size: 0.85rem; }
#file { width: 100%; max-width: 100%; padding: 8px 16px 20px; border: 1px dashed #9fb2c8; border-top: 0; border-radius: 0 0 10px 10px;
  background: #f6f9fc; cursor: pointer; text-align: center; }
#preview { display: block; max-width: 100%; max-height: 300px; margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; }
#submit { align-self: stretch; }
.pg-status { margin: 12px 0 0 !important; font-size: 0.9rem; color: var(--muted); }
.pg-status:empty { display: none; }
.pg-output .kv { margin-bottom: 12px; font-size: 0.95rem; }
.pg-output .kv th { width: 35%; color: var(--muted); font-weight: 500; background: #f8fafc; }
.raw summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }
.raw pre { max-height: 320px; overflow: auto; margin: 0; }
.pg-output .actions { margin: 12px 0; }
.pg-feedback summary { cursor: pointer; font-weight: 600; }
.pg-feedback[open] summary { margin-bottom: 8px; }
.pg-feedback textarea { margin: 4px 0 12px; display: block; }

/* API docs */
.docs { display: grid; gap: 32px; grid-template-columns: 1fr; margin-top: 24px; }
@media (min-width: 900px) { .docs { grid-template-columns: 220px minmax(0, 1fr); } .docs-nav { position: sticky; top: 84px; align-self: start; } }
.docs-nav { display: flex; flex-direction: column; gap: 2px; font-size: 0.92rem; }
.docs-nav a { color: var(--text); text-decoration: none; padding: 6px 10px; border-radius: 6px; display: flex; align-items: center; gap: 8px; }
.docs-nav a:hover { background: #eef3f9; }
.docs-nav a[aria-current="page"] { background: #e3edf9; color: var(--brand); font-weight: 600; }
.docs-nav-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 16px 10px 6px; }
.docs-nav-title:first-child { margin-top: 0; }
@media (max-width: 899px) { .docs-nav { flex-direction: row; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
  .docs-nav-title { display: none; } }
.docs-body { min-width: 0; max-width: 820px; }
.doc-head h1 { margin: 0.1em 0 0.2em; } .doc-head .lead { margin: 0 0 12px; }
.doc-section { margin-top: 40px; } .doc-section h2 { margin: 0 0 12px; font-size: 1.3rem; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.doc-section > p { margin: 0 0 12px; }
.method { font-family: ui-monospace, Consolas, monospace; font-size: 0.7rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; color: #fff; }
.method.post { background: #1d7a3a; } .method.get { background: var(--brand); }
.endpoint { display: flex; align-items: center; gap: 12px; margin-top: 24px; padding: 12px 16px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); flex-wrap: wrap; }
.endpoint code { font-size: 1rem; flex: 1; overflow-wrap: anywhere; }
.endpoint .method { font-size: 0.8rem; padding: 3px 8px; }
.callout { margin-top: 24px; padding: 16px 20px; border: 1px solid #c9daf0; background: #f1f6fd; border-radius: 10px; }
.callout p { margin: 4px 0 0; color: var(--muted); }
.code-card { border-radius: 10px; overflow: hidden; border: 1px solid #1f2937; margin-bottom: 12px; background: #10151f; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: #1a2130;
  color: #aab4c3; font-size: 0.8rem; border-bottom: 1px solid #1f2937; }
.code-card pre { margin: 0; border-radius: 0; }
.copy-btn { font: inherit; font-size: 0.78rem; padding: 3px 10px; border-radius: 5px; border: 1px solid #3a4558; background: transparent; color: #d6dde8; cursor: pointer; }
.endpoint .copy-btn { border-color: var(--line); color: var(--muted); }
.http-ok { color: #6fd08c; font-weight: 600; margin-right: 6px; }
.doc-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  border-collapse: separate; border-spacing: 0; font-size: 0.92rem; }
.doc-table th, .doc-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-table thead th:first-child { border-top-left-radius: 10px; } .doc-table thead th:last-child { border-top-right-radius: 10px; }
.doc-table thead th { background: #f6f8fb; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table td { overflow-wrap: break-word; }
.req { font-size: 0.72rem; color: #b42318; font-weight: 600; }
.limits { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 12px; }
.limits div { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 14px 16px; }
.limits strong { display: block; font-size: 1.3rem; } .limits span { color: var(--muted); font-size: 0.85rem; }
.svc-list { display: flex; flex-direction: column; gap: 10px; }
.svc { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); text-decoration: none; color: var(--text); flex-wrap: wrap; }
.svc:hover { border-color: #b7c3d3; }
.svc > span:nth-child(2) { flex: 1; min-width: 160px; }
.svc strong, .svc small { display: block; } .svc small { color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.svc-tags { display: flex; gap: 6px; align-items: center; }

/* account */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.acct { display: flex; flex-direction: column; gap: 20px; max-width: 820px; }
#acct-login { max-width: 820px; background: var(--surface); padding: 48px 16px; }
.profile { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 1.4rem; font-weight: 600;
  display: grid; place-items: center; flex: none; }
.profile-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.profile-info strong { font-size: 1.15rem; }
.profile-info > span:not(.chip) { color: var(--muted); overflow-wrap: anywhere; }
.profile-info .chip { margin-top: 6px; }
.access-list { list-style: none; padding: 0 !important; margin: 0 0 12px !important; }
.access-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.access-row:first-child { padding-top: 0; }
.access-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.access-info span { color: var(--muted); font-size: 0.9rem; }
.panel .summary { margin-bottom: 12px; }

/* about */
.about { display: flex; flex-direction: column; gap: 28px; max-width: 900px; }
.about-h { margin: 0 0 12px; font-size: 1.15rem; }
.link-card { text-decoration: none; color: var(--text); }
.link-card .icon { margin-bottom: 12px; }
.link-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.link-card:hover h3 { color: var(--brand); }
.principles { list-style: none; padding: 0 !important; display: grid; gap: 16px 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.principles li { border-left: 3px solid var(--brand); padding-left: 12px; }
.principles strong, .principles span { display: block; }
.principles span { color: var(--muted); font-size: 0.92rem; }
.roadmap { list-style: none; padding: 0 !important; margin: 0; }
.roadmap li { position: relative; padding: 0 0 20px 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.roadmap li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid #9aa4b2; }
.roadmap li::after { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.roadmap li:last-child { padding-bottom: 0; } .roadmap li:last-child::after { display: none; }
.roadmap li.now::before { background: var(--ok); border-color: var(--ok); }
.roadmap span:not(.badge) { color: var(--muted); font-size: 0.92rem; }
.cta-panel { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  background: var(--brand); color: #fff; border-radius: 12px; padding: 28px; }
.cta-panel h2 { margin: 0 0 4px; } .cta-panel p { margin: 0; color: #d6e6f8; }
.cta-panel .actions { margin: 0; }
.cta-panel .btn { background: #fff; color: var(--brand); border-color: #fff; }
.cta-panel .btn.ghost { background: transparent; color: #fff; border-color: #fff; }

/* privacy */
.warn-callout { border-color: #ecd9b0; background: #fdf8ee; }
.doc-section .checks { margin: 0; }
.doc-section .checks li { margin-bottom: 10px; }
.doc-section[id], .docs-body { scroll-margin-top: 16px; }
.limits.wide { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* 404 */
.notfound { max-width: 620px; margin: 48px auto; padding: clamp(28px, 6vw, 48px); text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.notfound-code { font-size: clamp(4rem, 14vw, 6rem); font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: #dbe5f1; margin: 0 0 8px; }
.notfound h1 { margin: 0.2em 0 0.3em; }
.notfound .actions { justify-content: center; margin-top: 20px; }
.notfound-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--line); font-size: 0.92rem; }
.notfound-links a { text-decoration: none; }
