* { box-sizing: border-box; }
body { margin: 0; padding: 28px 20px 64px; color: #171717; background: #fff; font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
main { max-width: 1040px; margin: auto; }
header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 34px; }
a { color: inherit; text-underline-offset: 4px; }
header a { color: #666; text-decoration: none; font-size: 16px; }
h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.2; margin: 0; letter-spacing: -.04em; }
h2 { font-size: 22px; margin: 32px 0 12px; letter-spacing: -.025em; }
p { max-width: 760px; }
.experiment { display: flex; align-items: center; gap: 18px; padding: 22px 0; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; text-decoration: none; }
h1 + .experiment, h1 + textarea { margin-top: 28px; }
.experiment:hover strong { text-decoration: underline; }
.experiment > :last-child { margin-left: auto; }
textarea { width: 100%; min-height: 180px; resize: vertical; border: 1px solid #ddd; border-radius: 14px; padding: 16px; font: inherit; color: inherit; background: #fafafa; }
.status { min-height: 26px; color: #666; font-size: 16px; margin: 12px 0; overflow-wrap: anywhere; }
button { min-height: 48px; padding: 0 18px; border: 1px solid #ddd; border-radius: 10px; background: #fff; color: #171717; font: inherit; font-weight: 600; cursor: pointer; }
button:hover { background: #fafafa; }
button:disabled { color: #999; cursor: default; }
#speak { width: 100%; }
audio { width: 100%; margin-top: 14px; }
#timing { color: #555; font-size: 16px; white-space: pre-line; }
.vocabulary { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); grid-auto-rows: 44px; max-height: 354px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; border: 1px solid #ddd; border-radius: 14px; margin: 0; background: #fafafa; }
.vocabulary > div { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid #eee; }
dt { font: 14px/1.4 ui-monospace, monospace; font-weight: 600; overflow-wrap: anywhere; }
dd { margin: 0; color: #666; font-size: 14px; overflow-wrap: anywhere; }
.vocabulary:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid #171717; outline-offset: 4px; }
.caption { color: #666; font-size: 14px; margin: 10px 0 0; }
.writeup { border-top: 1px solid #ddd; margin-top: 40px; padding-top: 4px; }
.writeup ul, .writeup ol { max-width: 760px; padding-left: 24px; }
.writeup li + li { margin-top: 8px; }
code, pre { font-family: ui-monospace, monospace; font-size: .9em; }
pre { padding: 18px; background: #fafafa; border: 1px solid #ddd; border-radius: 10px; overflow-x: auto; }
.setup { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 0; }
.setup .node { border: 1px solid #ddd; border-radius: 10px; padding: 12px 16px; }
.setup small { display: block; color: #666; }
@media (max-width: 520px) {
  body { padding-top: 20px; }
  .vocabulary { grid-template-columns: 1fr; }
  .setup { flex-direction: column; align-items: stretch; }
  .setup .arrow { align-self: center; transform: rotate(90deg); }
}
