:root {
  color-scheme: light;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: #243d48;
  background: #edf3f5;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, textarea { font: inherit; }
.page { max-width: 1220px; margin: auto; padding: clamp(24px, 5vw, 64px); }
.site-header { margin-bottom: 48px; }
.library-name { margin: 0 0 16px; color: #166a76; font-size: .88rem; font-weight: 700; letter-spacing: .06em; }
h1 { margin: 0; font-size: clamp(1.125rem, 2.75vw, 2.25rem); line-height: 1.25; letter-spacing: -.06em; white-space: nowrap; }
.header-details { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(290px, 1fr); align-items: baseline; gap: 20px; margin-top: 18px; }
.intro { max-width: 35em; margin: 0; line-height: 1.8; }
.library-info p { margin: 0 0 8px; font-size: .88rem; font-weight: 700; }
.library-info code { display: block; padding: 12px 16px; border: 1px solid #c8d9de; border-radius: 8px; background: #fff; font-size: .82rem; white-space: nowrap; }
nav { display: flex; gap: 18px; margin-top: 12px; }
a { color: #166a76; font-weight: 700; text-underline-offset: 3px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(290px, 1fr); gap: 20px; align-items: start; }
.editor, .options { min-width: 0; padding: clamp(20px, 3vw, 32px); border: 1px solid #d5e3e6; border-radius: 16px; background: #fff; }
.section-heading { margin-bottom: 20px; }
h2 { margin: 0; font-size: 1.3rem; }
.section-heading p { margin: 6px 0 0; color: #55717b; font-size: .88rem; line-height: 1.6; }
textarea { display: block; width: 100%; min-height: 390px; resize: vertical; padding: 18px; border: 1px solid #abc3ca; border-radius: 10px; color: inherit; background: #fbfdfe; line-height: 1.85; }
textarea::placeholder { color: #708891; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
button { min-height: 44px; padding: 10px 16px; border: 1px solid #a9c3c9; border-radius: 8px; color: #20545f; background: #fff; font-weight: 700; cursor: pointer; }
button:hover { background: #eaf3f5; }
button.primary { border-color: #176e7b; color: #fff; background: #176e7b; }
button.primary:hover { background: #0e5661; }
:is(button, textarea, a, input):focus-visible { outline: 3px solid #f3a944; outline-offset: 3px; }
.status { min-height: 1.5em; margin: 14px 0 0; color: #166a76; font-size: .9rem; font-weight: 700; }
.option-list { border-top: 1px solid #e1eaed; }
.option { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 64px; padding: 12px 0; border-bottom: 1px solid #e1eaed; line-height: 1.5; cursor: pointer; }
.option > span:first-child { flex: 1; }
.option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch { position: relative; flex: 0 0 44px; width: 44px; height: 26px; border-radius: 99px; background: #849da4; transition: background .15s ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.option input:checked + .switch { background: #176e7b; }
.option input:checked + .switch::after { transform: translateX(18px); }
.option input:focus-visible + .switch { outline: 3px solid #f3a944; outline-offset: 3px; }
@media (max-width: 800px) {
  .site-header { margin-bottom: 28px; }
  .header-details { grid-template-columns: 1fr; gap: 24px; }
  .workspace { grid-template-columns: 1fr; }
  textarea { min-height: 320px; }
}
@media (max-width: 480px) {
  .page { padding: 20px 14px 32px; }
  h1 { font-size: min(clamp(1.125rem, 5vw, 1.1875rem), calc(6.25vw - 2px)); }
  .editor, .options { padding: 20px 16px; }
  .actions button { width: 100%; }
  .library-info { max-width: 100%; }
  .library-info code { max-width: 100%; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .switch, .switch::after { transition: none; }
}
