:root {
  color-scheme: light;
  font-family: system-ui, "Yu Gothic UI", "Hiragino Sans", sans-serif;
  background: #f9fbfa;
  color: #1a302a;
  font-weight: 400;
  --muted: #425b51;
  --line: #cfddd6;
  --accent: #08674d;
  --surface: #fff;
  --code-bg: #132822;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.6; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: .22em; }
.wrap { width: min(1120px, calc(100% - 3rem)); margin-inline: auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 62px; display: flex; align-items: center; justify-content: space-between; column-gap: 1.5rem; }
.brand { color: #174b3d; font-size: 1.12rem; font-weight: 750; text-decoration: none; }
.nav-links, .resource-links, .related-grid { list-style: none; margin: 0; padding: 0; }
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1.05rem; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 590; white-space: nowrap; }
.nav-links a:hover { text-decoration: underline; }
.hero {
  background: radial-gradient(ellipse at top left, #e0f2e8, transparent 42rem), #f2f7f4;
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem); padding-block: clamp(2.5rem, 6vw, 5.5rem);
}
h1 { font-size: clamp(1.95rem, 4.4vw, 4rem); line-height: 1.16; letter-spacing: -.045em; margin: 0; }
.hero-copy p { margin: 1rem 0 1.3rem; color: var(--muted); max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.action {
  display: inline-block; padding: .5rem .9rem; background: var(--surface); color: var(--accent);
  border: 1px solid #8daea0; border-radius: 8px; font-weight: 650; text-decoration: none;
}
.action:hover { background: #e5f3eb; }
.action-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.action-primary:hover { background: #07523e; }
.code-block {
  margin: 0; background: var(--code-bg); color: #edf8f0; border-radius: 12px;
  padding: 1rem 1.1rem; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere;
  font: .9rem/1.65 ui-monospace, Consolas, monospace;
}
.hero .code-block { box-shadow: 0 14px 30px #13282222; }
.page-section { padding-block: clamp(1.75rem, 4vw, 3.25rem); scroll-margin-top: 1rem; }
.page-section + .page-section { border-top: 1px solid var(--line); }
.section-title { margin: 0 0 .8rem; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.3; }
.section-description { margin: 0 0 1.1rem; color: var(--muted); }
.panel > h3 { font-size: 1.23rem; margin: 0 0 1rem; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(1rem, 3vw, 1.6rem); }
.summary-panel { background: #fbfdfb; }
label { display: block; font-size: .92rem; font-weight: 650; margin-bottom: .3rem; }
input, select, textarea, button { font: inherit; }
input:not([type="checkbox"]), select, textarea {
  color: inherit; display: block; width: 100%; padding: .52rem .65rem; background: #fff;
  border: 1px solid #9cb4a9; border-radius: 8px; min-block-size: 2.65rem;
}
textarea { resize: vertical; }
textarea[readonly] { background: #f3f6f4; }
:focus-visible { outline: 3px solid #158067; outline-offset: 2px; }
.note { color: var(--muted); font-size: .87rem; margin: .3rem 0 .9rem; overflow-wrap: anywhere; }
.samples { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
button {
  cursor: pointer; border: 1px solid #a1b8ad; border-radius: 7px; color: #174b3d;
  background: #edf5f0; padding: .25rem .65rem; font-size: .88rem; font-weight: 600;
}
button:hover { background: #dbece2; }
.fields { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: .65rem; }
details { border-top: 1px solid var(--line); margin-top: 1.1rem; padding-top: .65rem; }
summary { cursor: pointer; font-size: .92rem; font-weight: 650; }
details label { margin-top: .65rem; }
.checkbox { font-weight: 400; display: flex; align-items: baseline; gap: .35rem; }
.status { padding: .5rem .7rem; background: #e5f3e9; color: #14543b; border-radius: 8px; font-weight: 650; margin-top: 0; }
.status[data-state="invalid"] { background: #faece6; color: #832d23; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; margin: 1rem 0; }
.metrics div { border-bottom: 1px solid var(--line); padding: .35rem 0; min-width: 0; }
dt { color: var(--muted); font-size: .85rem; }
dd { margin: 0; font-size: 1.55rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.findings, .record-panel { margin-top: 1rem; }
.findings h3 { margin-bottom: .2rem; }
.table-region { overflow-x: auto; }
.record-panel .table-region { margin: .8rem 0; }
.record-table code { white-space: pre-wrap; overflow-wrap: anywhere; }
table { border-collapse: collapse; width: 100%; text-align: start; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--line); padding: .6rem .55rem; text-align: start; vertical-align: middle; }
th { background: #eaf2ed; white-space: nowrap; }
td:first-child { min-width: 5.6rem; }
.numeric { font-family: ui-monospace, Consolas, monospace; white-space: nowrap; }
.issue { margin: .15rem 0; }
.issue[data-severity="error"] { color: #8b2a25; }
.issue[data-severity="warning"] { color: #684a13; }
.extensions { color: var(--muted); font-size: .82rem; }
.candidate { display: grid; justify-items: start; gap: .1rem; }
.candidate + .candidate { margin-top: .4rem; }
.docs-section {
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.25fr);
  gap: clamp(1rem, 4vw, 3.5rem); align-items: start;
}
.docs-section p { margin: 0 0 .8rem; color: var(--muted); }
.snippet { display: grid; gap: .55rem; }
.snippet button { justify-self: start; }
.resource-links { display: grid; gap: .3rem; }
.api-list { margin: 0; }
.api-list div + div { border-top: 1px solid var(--line); margin-top: .7rem; padding-top: .7rem; }
.api-list dt { color: var(--accent); font-size: .9rem; font-weight: 650; overflow-wrap: anywhere; }
.api-list dd { color: var(--muted); font-size: .9rem; font-weight: 400; margin-top: .1rem; }
.related-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.related-card { display: flex; flex-direction: column; padding: 1rem; border-radius: 12px; }
.related-card h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.related-card p { margin: .3rem 0 0; font-size: .88rem; color: var(--muted); }
.related-links { display: flex; flex-wrap: wrap; gap: .7rem; padding-top: .55rem; margin-top: auto; font-size: .88rem; }
.copy-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; clip-path: inset(50%); overflow: hidden; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.footer-inner, .footer-licenses { display: flex; column-gap: .8rem; row-gap: .35rem; flex-wrap: wrap; }
.footer-inner { justify-content: space-between; padding-block: 1.3rem; font-size: .84rem; }

@media (max-width: 720px) {
  .wrap { width: calc(100% - 1.5rem); }
  .header-inner { align-items: start; flex-direction: column; justify-content: center; gap: .35rem; padding-block: .6rem; }
  .hero-inner, .workspace, .docs-section { grid-template-columns: minmax(0, 1fr); }
  .hero-break { display: none; }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .related-grid { grid-template-columns: minmax(0, 1fr); }
  .findings .table-region { overflow: visible; }
  .findings table, .findings tbody { display: block; }
  .findings thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .findings tbody tr {
    display: grid; grid-template-columns: minmax(1.5rem, .5fr) minmax(4.3rem, 1fr) .8fr 1.15fr;
    column-gap: .4rem; padding: .7rem 0; border-bottom: 1px solid var(--line);
  }
  .findings td { border: 0; padding: .1rem 0; }
  .findings td:first-child { min-width: 0; font-size: 1.1rem; }
  .findings td:nth-child(3)::before, .findings td:nth-child(4)::before {
    display: block; color: var(--muted); font: .68rem/1.3 system-ui, sans-serif; white-space: normal;
  }
  .findings td:nth-child(3)::before { content: "UTF-16位置"; }
  .findings td:nth-child(4)::before { content: "コードポイント位置"; }
  .findings td:nth-child(5), .findings td:nth-child(6) { grid-column: 1 / -1; }
  .findings td.no-candidate { display: none; }
}
