* { box-sizing: border-box; }
html { font-family: system-ui, sans-serif; color: #111; background: #fff; }
body { margin: 0; }
main { width: min(100%, 960px); margin: 0 auto; padding: 8px; }
h1 { font-size: 1.5rem; margin: 24px 0 8px; }
h2 { font-size: 1.05rem; margin: 12px 0 4px; }
h3 { font-size: .95rem; margin: 8px 0 2px; }
p { margin: 4px 0; line-height: 1.45; }
#display { display: block; padding: 4px; font: 700 clamp(2.2rem, 12vw, 5rem)/1 ui-monospace, monospace; letter-spacing: .01em; white-space: nowrap; margin: 32px 0; overflow: hidden; }
.inputs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
label { font-size: .8rem; }
input, select { display: block; width: 100%; min-height: 40px; padding: 4px; border: 1px solid #777; border-radius: 0; background: #fff; color: #111; font: inherit; font-size: 1rem; }
input[type="color"] { padding: 2px; }
.buttons { display: flex; gap: 4px; margin-top: 4px; }
button { flex: 1; min-height: 42px; padding: 4px 8px; border: 1px solid #555; border-radius: 0; background: #f3f3f3; color: #111; font: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid #0563c1; outline-offset: 1px; }
#status { min-height: 1.45em; font-size: .9rem; }
details { margin-top: 4px; border: 1px solid #aaa; padding: 4px; }
summary { cursor: pointer; font-weight: 600; }
.settings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 4px; }
.sound-toggle, .audio-file, #audio-help { grid-column: 1 / -1; }
.sound-toggle { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.sound-toggle input { width: auto; min-height: auto; }
.related-tools { margin-top: 24px; }
.related-tools ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.related-tools a { display: block; min-height: 100%; padding: 10px; border: 1px solid #afa; color: #0563c1; font-weight: 600; text-decoration: none; }
.related-tools a:hover { text-decoration: underline; }
.related-tools a:focus-visible { outline: 2px solid #0563c1; outline-offset: 1px; }
.related-tools span { display: block; margin-top: 2px; color: #444; font-size: .8rem; font-weight: 400; line-height: 1.35; }
footer {
  margin-top: 24px;
}
#audio-help { line-height: 1.35; }
@media (max-width: 420px) {
  .inputs { grid-template-columns: repeat(2, 1fr); }
  .settings { grid-template-columns: repeat(2, 1fr); }
  .related-tools ul { grid-template-columns: 1fr; }
  .settings > label:nth-child(3), .sound-toggle, .audio-file, #audio-help { grid-column: 1 / -1; }
  #display { font-size: 12vw; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
