:root {
  color-scheme: light;
  --paper: #f4f7fc;
  --ink: #18243a;
  --subtle: #506078;
  --blue: #174eab;
  --line: #cdd8e7;
  --muted: #edf3fa;
  font-family: "Yu Gothic UI", "Hiragino Sans", Meiryo, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.shell { width: min(100% - 3rem, 70rem); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 1; background: #13284b; color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; gap: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: #fff; font-weight: 700; letter-spacing: .01em; text-decoration: none; }
.brand-mark {
  display: inline-block;
  width: 1.08rem;
  height: 1.27rem;
  border: 2px solid #91bfff;
  border-radius: .2rem;
  background: linear-gradient(#91bfff, #91bfff) center 35% / 50% 2px no-repeat,
    linear-gradient(#91bfff, #91bfff) center 65% / 50% 2px no-repeat;
}
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.15rem; }
.site-nav a { color: #e1ebff; text-decoration: none; font-size: .875rem; font-weight: 600; }
.site-nav a:hover, .brand:hover { text-decoration: underline; text-underline-offset: .25em; }
.site-header :focus-visible { outline-color: #a8ceff; }
h1, h2, h3, h4, p, dl { margin: 0; }
h1 { font-size: clamp(2rem, 4.5vw, 3.3rem); line-height: 1.24; letter-spacing: -.035em; }
h3 { font-size: 1.08rem; line-height: 1.4; margin-bottom: .45rem; }
h4 { font-size: 1rem; margin-bottom: .4rem; }
.hero {
  background: radial-gradient(ellipse at 18% 0%, #deebff 0%, transparent 65%), #f8fbff;
  border-bottom: 1px solid var(--line);
}
.hero-inner { display: grid; grid-template-columns: 1.12fr 1fr; align-items: center; gap: clamp(1.4rem, 5vw, 4.5rem); padding-block: clamp(2.8rem, 7vw, 5.6rem); }
.hero p { margin-top: 1.1rem; max-width: 31rem; color: var(--subtle); font-size: 1.05rem; }
.hero .hero-actions { margin-top: 1.35rem; }
.hero-actions .button-link { padding: .62rem .95rem; }
.hero .code-block { padding: 1.35rem; border-radius: .65rem; box-shadow: 0 12px 30px #13284b20; }
.code-keyword { color: #abd3ff; }
.code-string { color: #b9e9c7; }
.code-comment { color: #b1bfd3; }
.section-title { font-size: clamp(1.5rem, 3vw, 1.9rem); line-height: 1.3; }
.page-section { padding-block: clamp(1.9rem, 4.5vw, 3.3rem); scroll-margin-top: 4rem; }
.guide-section { border-top: 1px solid var(--line); }
.section-description, .intro p { margin-top: .5rem; color: var(--subtle); }
.section-description { max-width: 50rem; margin-bottom: 1.15rem; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.15rem; }
.card > h3 { font-size: 1.2rem; margin-bottom: 1rem; }
.card-description { color: var(--subtle); }
.card-description { margin: -.65rem 0 1rem; }
.profile { flex: 0 0 min(16rem, 38%); }
.workspace { display: grid; grid-template-columns: 5fr 6fr; align-items: start; gap: 1.15rem; }
.file-tools { display: grid; gap: 1.15rem; }
.card { padding: 1.4rem; border: 1px solid var(--line); border-radius: .75rem; background: #fff; box-shadow: 0 3px 14px #142d5010; min-width: 0; }
.kana-card { border-top: 3px solid var(--blue); }
label, dt { display: block; font-size: .875rem; font-weight: 650; margin-bottom: .3rem; }
textarea, select, input, button, .button-link { font: inherit; }
textarea, select, input[type="file"] { width: 100%; border: 1px solid #aabbd2; border-radius: .4rem; color: var(--ink); background-color: #fff; }
textarea { display: block; resize: vertical; min-height: 5.5rem; padding: .65rem .75rem; line-height: 1.5; }
select {
  appearance: none;
  min-height: 2.6rem;
  padding: .45rem 2rem .45rem .65rem;
  background-image: linear-gradient(45deg, transparent 50%, #465973 50%), linear-gradient(135deg, #465973 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
input[type="file"] { display: block; padding: .38rem; }
input::file-selector-button { color: var(--ink); background: var(--muted); padding: .38rem .6rem; border: 0; border-radius: .25rem; margin-right: .55rem; cursor: pointer; }
.generation-options { display: flex; align-items: end; flex-wrap: wrap; gap: .8rem 1.2rem; margin-bottom: .9rem; }
.generation-options select { min-width: 9rem; }
.check { display: flex; align-items: center; gap: .4rem; min-height: 2.6rem; margin: 0; }
.check input { accent-color: var(--blue); }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-top: .85rem; }
button, .button-link {
  display: inline-block;
  border: 1px solid var(--blue);
  border-radius: .4rem;
  padding: .47rem .8rem;
  background: var(--blue);
  color: #fff;
  font-weight: 650;
  font-size: .94rem;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button-link:hover { background: #103c8a; }
.secondary, .button-link { background: #fff; color: var(--blue); }
.secondary:hover, .button-link:hover { background: var(--muted); }
.button-link.primary { background: var(--blue); color: #fff; }
.button-link.primary:hover { background: #103c8a; }
button:disabled { background: #e9edf3; border-color: #d5deeb; color: #526078; cursor: default; }
:focus-visible { outline: 3px solid #3372d8; outline-offset: 3px; }
.status { font-size: .9rem; color: var(--subtle); margin-top: .65rem; }
.status:empty { display: none; }
.status[data-kind="success"] { color: #11704b; }
.status[data-kind="error"], .errors { color: #9b282a; }
.kana-card > .status { margin: .55rem 0 1rem; }
.kana-preview { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
output { display: block; padding: .6rem .7rem; background: var(--muted); border-radius: .35rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.changes, .errors { margin: .55rem 0 0; padding-left: 1.15rem; font-size: .875rem; overflow-wrap: anywhere; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-top: .75rem; }
.summary div { padding: .55rem .65rem; border-radius: .35rem; background: var(--muted); overflow-wrap: anywhere; }
dt { color: var(--subtle); margin: 0; }
dd { margin: .18rem 0 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.code-block {
  min-width: 0;
  margin: 0;
  padding: .75rem 1rem;
  overflow-x: auto;
  border-radius: .4rem;
  background: #14233c;
  color: #f0f5ff;
  font: .875rem/1.65 "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}
code { font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace; }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; align-items: start; }
.copy-row:has(button[hidden]) { grid-template-columns: minmax(0, 1fr); }
.copy-row button { min-height: 2.6rem; }
#install .copy-row { max-width: 36rem; }
.guide-note { margin-top: 1rem; }
p.guide-note { color: var(--subtle); }
.api-grid, .cdn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.api-grid dt { display: flex; flex-wrap: wrap; gap: .3rem .65rem; margin: 0; color: var(--ink); }
.api-grid dt code { overflow-wrap: anywhere; }
.api-grid dd { margin: .55rem 0 0; color: var(--subtle); font-weight: 400; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.related-card { display: flex; flex-direction: column; }
.related-card > h3 { margin-bottom: .35rem; overflow-wrap: anywhere; }
.related-card p { color: var(--subtle); }
.related-links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: auto; padding-top: .85rem; }
.related-links a, .footer a { color: var(--blue); text-underline-offset: .18em; }
.footer { border-top: 1px solid var(--line); background: #fff; color: var(--subtle); font-size: .875rem; }
.footer-inner { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .55rem 1.25rem; padding-block: 1.15rem; }

@media (max-width: 48rem) {
  .shell { width: min(100% - 1.5rem, 37rem); }
  .site-header { position: static; }
  .header-inner { align-items: start; flex-direction: column; justify-content: center; padding-block: .75rem; }
  .hero-inner, .workspace, .api-grid, .cdn-grid, .related-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-break { display: none; }
  .hero .code-block { padding: .85rem; }
  .page-section { scroll-margin-top: 0; }
  .intro { align-items: stretch; flex-direction: column; gap: 1.05rem; }
  .profile { flex-basis: auto; }
  .card { padding: 1rem; }
}
