:root {
  color-scheme: light;
  --paper: #ffffff;
  --background: #f5f7f8;
  --ink: #203039;
  --muted: #586b75;
  --line: #d6e0e5;
  --accent: #16636b;
  --accent-light: #edf5f5;
  --error: #9b3435;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); font-size: 15px; line-height: 1.7; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--accent); text-underline-offset: 3px; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
code, .wordmark { font-family: "Cascadia Code", Consolas, "SFMono-Regular", monospace; }
.page-width { width: min(1080px, calc(100% - 64px)); margin-inline: auto; }
.visually-hidden, .search-output:is([data-state="empty"], [data-state="typing"]) .status-line { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: 8px; left: 16px; z-index: 10; padding: 8px 16px; background: var(--paper); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.site-header { display: flex; align-items: center; gap: 20px; padding-block: 24px; border-bottom: 1px solid var(--line); }
.wordmark { color: var(--ink); font-size: 23px; font-weight: 700; letter-spacing: -.8px; text-decoration: none; }
.wordmark span { color: var(--accent); }
.site-purpose { color: var(--muted); font-size: 13px; }
.search-section { padding-block: 36px 26px; }
#search-form label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 700; }
.search-row { display: flex; gap: 10px; }
.input-wrap { position: relative; flex: 1; min-width: 0; }
#query { width: 100%; height: 56px; border: 1px solid #aebfc7; border-radius: 7px; padding: 12px 48px; background: var(--paper); color: var(--ink); font-size: 16px; }
#query::placeholder { color: #75858d; opacity: 1; }
#query:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.search-icon { position: absolute; width: 21px; height: 21px; top: 17px; left: 17px; stroke: var(--muted); stroke-width: 1.8; pointer-events: none; }
.clear-button { position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: var(--muted); }
.clear-button:hover { background: var(--background); color: var(--ink); }
.clear-button svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; }
.primary-button { min-width: 128px; height: 56px; border: 1px solid var(--accent); border-radius: 7px; padding-inline: 24px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; }
.primary-button:hover:not(:disabled) { background: #0f5057; }
.primary-button:disabled { border-color: var(--line); background: #e5ecef; color: #61727b; }
.input-help { display: flex; justify-content: flex-end; margin-top: 9px; color: var(--muted); font-size: 12px; }
#query-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.examples { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; font-size: 13px; }
.examples > span { color: var(--muted); }
.examples button, .text-button { min-height: 40px; border: 0; padding: 8px 0; background: transparent; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.examples button:hover, .text-button:hover { color: #0d444b; }
.view-controls { display: flex; gap: 8px; margin-bottom: 12px; }
.view-button { min-height: 44px; border: 1px solid transparent; border-radius: 5px; padding: 8px 14px; background: transparent; color: var(--accent); font-size: 13px; }
.view-button:hover { background: #eaf0f2; }
.view-button[aria-pressed="true"] { border-color: #aecdd0; background: var(--accent-light); }
.favorite-status { margin-bottom: 12px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.favorite-status:empty { display: none; }
.search-output { border-top: 1px solid var(--line); min-height: 120px; }
.search-output:is([data-state="empty"], [data-state="typing"]) { min-height: 0; border-top: 0; }
.search-output:is([data-state="empty"], [data-state="typing"]) + .site-footer { margin-top: 0; }
.status-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 18px; padding-block: 20px; }
#search-status { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
[data-state="error"] #search-status { color: var(--error); }
[data-state="loading"] #search-status::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 9px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
.results-layout { display: grid; grid-template-columns: minmax(240px, 32%) minmax(0, 1fr); border-top: 1px solid var(--line); padding-block: 24px 8px; }
.candidate-section { min-width: 0; padding-right: 24px; }
.list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.list-heading h2 { font-size: 15px; font-weight: 700; }
#result-count { color: var(--muted); font-size: 12px; }
.candidate-list { list-style: none; margin: 0; padding: 0; }
.candidate-list li + li { margin-top: 6px; }
.candidate-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 4px; align-items: start; }
.favorite-button { display: grid; place-items: center; width: 44px; height: 44px; margin-top: 6px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--accent); }
.favorite-button:hover { background: #eaf0f2; }
.favorite-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.favorite-button[aria-pressed="true"] svg { fill: currentColor; }
.candidate-button { width: 100%; border: 1px solid transparent; border-radius: 5px; padding: 14px; background: transparent; color: var(--ink); text-align: left; }
.candidate-button:hover { background: #eaf0f2; }
.candidate-button[aria-pressed="true"] { border-color: #aecdd0; background: var(--accent-light); }
.candidate-name { display: block; overflow-wrap: anywhere; font-family: "Cascadia Code", Consolas, "SFMono-Regular", monospace; font-size: 15px; font-weight: 600; line-height: 1.5; }
.candidate-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.candidate-summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.detail { min-width: 0; padding-left: 32px; border-left: 1px solid var(--line); }
.detail-header { margin-bottom: 26px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.detail-meta span { min-width: 0; overflow-wrap: anywhere; }
#detail-title { font-family: "Cascadia Code", Consolas, "SFMono-Regular", monospace; font-size: clamp(20px, 2.3vw, 26px); font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
#detail-title:focus { outline: none; }
#detail-title:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
.language-note { margin-top: 10px; color: var(--muted); font-size: 12px; }
.detail-section { margin-bottom: 25px; }
.detail-section h3 { margin-bottom: 8px; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.detail-section p { max-width: 72ch; overflow-wrap: anywhere; white-space: pre-line; }
.signature { display: block; padding: 13px 15px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.example-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; }
.example-heading h3 { min-width: 0; }
.copy-button { flex-shrink: 0; min-height: 36px; border: 1px solid #b9cbd1; border-radius: 4px; padding: 6px 10px; background: var(--paper); color: var(--accent); font-size: 12px; white-space: nowrap; }
.copy-button:hover { background: var(--accent-light); }
.code-example { max-width: 100%; margin: 0; padding: 17px 18px; border: 1px solid var(--line); border-radius: 4px; background: #eaf0f3; font-size: 13px; line-height: 1.8; overflow-x: auto; tab-size: 4; }
.code-example code { white-space: pre; }
.copy-status { margin-top: 6px !important; color: var(--muted); font-size: 12px; }
.output-label { margin-top: 12px !important; color: var(--muted); font-size: 12px; }
.example-output { margin: 4px 0 0; padding: 12px 16px; border-left: 3px solid var(--line); background: var(--paper); font-family: "Cascadia Code", Consolas, "SFMono-Regular", monospace; font-size: 13px; line-height: 1.7; white-space: pre; overflow-x: auto; }
.example-explanation { margin-top: 10px !important; }
.documentation-section { margin-bottom: 20px; border-block: 1px solid var(--line); }
.documentation-section summary { padding-block: 12px; color: var(--accent); font-size: 13px; font-weight: 700; cursor: pointer; overflow-wrap: anywhere; }
.documentation-section[open] { padding-bottom: 16px; }
.documentation-section p { margin-bottom: 12px; overflow-wrap: anywhere; white-space: pre-line; }
.documentation-section p:last-child { margin-bottom: 0; }
.documentation-section .code-example { margin-block: 12px; }
.documentation-note { color: var(--muted); font-size: 12px; }
.parameter-definition { margin: 0 0 16px; }
.parameter-definition:last-child { margin-bottom: 0; }
.parameter-definition dt { margin-bottom: 5px; font-family: "Cascadia Code", Consolas, "SFMono-Regular", monospace; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.parameter-definition dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.documentation-list { margin-block: 8px; padding-left: 22px; overflow-wrap: anywhere; }
.detail-source { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; }
.detail-source a { display: inline-flex; align-items: center; gap: 5px; }
.source-version-note { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.search-guidance { margin-block: 10px 24px; }
.search-guidance h2 { margin-bottom: 6px; font-size: 14px; }
.search-guidance p { color: var(--muted); font-size: 13px; }
.guidance-example { margin-top: 4px; }
.site-footer { margin-top: 30px; padding-block: 22px 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.9; }
.scope-label { margin-bottom: 3px; color: var(--ink); font-size: 12px; font-weight: 700; }
.source-note { margin-top: 7px; }
.noscript-message { margin-bottom: 24px; color: var(--error); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .results-layout { grid-template-columns: minmax(0, 1fr); padding-top: 18px; }
  .candidate-section { padding-right: 0; }
  .candidate-list { display: flex; flex-direction: column; }
  .candidate-button { padding: 12px; }
  .candidate-summary { -webkit-line-clamp: 1; }
  .detail { margin-top: 24px; padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .detail-header { margin-bottom: 22px; }
  .detail-section { margin-bottom: 22px; }
}

@media (max-width: 540px) {
  .page-width { width: calc(100% - 32px); }
  .site-header { gap: 14px; padding-block: 18px; }
  .search-section { padding-block: 26px 22px; }
  .search-row { flex-direction: column; gap: 10px; }
  .primary-button { width: 100%; height: 48px; }
  .input-help { font-size: 11px; }
  .examples { gap: 2px 16px; font-size: 12px; }
  .examples > span { flex-basis: 100%; }
  .examples button, .text-button, .copy-button { min-height: 44px; }
  .signature, .code-example, .example-output { padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  [data-state="loading"] #search-status::before { animation: none; }
}
