.rhythm-dialog { box-sizing:border-box; width:min(1100px, calc(100vw - 40px)); max-width:none; max-height:calc(100dvh - 48px); padding:0; border:1px solid var(--line,#d9d3c8); border-radius:16px; background:var(--paper,#fffefa); color:var(--text,var(--ink,#292520)); box-shadow:0 24px 90px #0005; font:14px/1.5 Manrope,system-ui,sans-serif; overflow:hidden; }
.rhythm-dialog[open] { display:flex; flex-direction:column; }
.rhythm-dialog::backdrop { background:#17141299; backdrop-filter:blur(3px); }
.rhythm-dialog-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 22px; border-bottom:1px solid var(--line,#d9d3c8); }
.rhythm-dialog-header h2 { margin:0; font:700 24px/1.2 'Source Serif 4',Georgia,serif; }
.rhythm-dialog button { cursor:pointer; font:inherit; }
.rhythm-dialog-close { flex-shrink:0; width:40px; height:40px; padding:0; border:1px solid var(--line,#d9d3c8); border-radius:9px; background:transparent; color:inherit; font-size:26px!important; }
.rhythm-dialog-body { padding:18px 22px 24px; overflow:auto; overscroll-behavior:contain; min-height:0; }
.rhythm-dialog-status { margin:8px 0; color:var(--muted,#81786b); }
.rhythm-dialog-retry { padding:9px 16px; border:1px solid var(--line,#d9d3c8); border-radius:8px; background:var(--paper,#fffefa); color:var(--primary,var(--accent,#8b3f4a)); }
.rhythm-dialog [hidden] { display:none!important; }
.rhythm-dialog-legend { display:flex; flex-wrap:wrap; gap:6px 22px; font-size:12px; color:var(--muted,#81786b); }
.rhythm-dialog-legend-stressed { color:var(--primary,var(--accent,#8b3f4a)); }
.rhythm-dialog-hint { margin:8px 0 18px; color:var(--muted,#81786b); font-size:12px; }
.rhythm-dialog-list { display:grid; gap:12px; }
.rhythm-dialog-row { min-width:0; padding:14px 16px; border:1px solid var(--line,#d9d3c8); border-radius:10px; }
.rhythm-dialog-row.excluded { border-style:dashed; }
.rhythm-dialog-row-header { display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; margin-bottom:8px; font-size:12px; color:var(--muted,#81786b); }
.rhythm-dialog-jump { border:0; padding:0; background:transparent; color:var(--primary,var(--accent,#8b3f4a)); text-decoration:underline; text-underline-offset:3px; }
.rhythm-dialog-text { margin:0 0 12px; white-space:pre-wrap; overflow-wrap:anywhere; font:16px/1.7 'Fira Code',monospace; }
.rhythm-dialog-pattern { display:flex; flex-wrap:wrap; gap:6px 12px; }
.rhythm-dialog-foot { display:inline-flex; gap:3px; position:relative; }
.rhythm-dialog-foot::before { content:''; position:absolute; left:10px; right:10px; top:15px; border-top:1px solid var(--line,#d9d3c8); }
.rhythm-dialog-vowel { position:relative; display:inline-flex; flex-direction:column; align-items:center; min-width:26px; padding:0 3px 3px; border:1px solid transparent; border-radius:6px; background:transparent; color:var(--muted,#81786b); }
.rhythm-dialog-dot { height:30px; line-height:30px; font-size:19px; background:var(--paper,#fffefa); }
.rhythm-dialog-letter { font:12px/1.4 'Fira Code',monospace; }
.rhythm-dialog-vowel.stressed { color:var(--primary,var(--accent,#8b3f4a)); }
.rhythm-dialog-vowel:is(button):hover { border-color:currentColor; }
.rhythm-dialog button:focus-visible { outline:2px solid var(--primary,var(--accent,#8b3f4a)); outline-offset:3px; }
.rhythm-dialog-scansion { margin:8px 0 0; font:12px/1.7 'Fira Code',monospace; color:var(--muted,#81786b); overflow-wrap:anywhere; }
.rhythm-wrap-measure { position:fixed; top:0; left:-100000px; visibility:hidden; pointer-events:none; white-space:pre-wrap; overflow-wrap:break-word; word-break:normal; padding:0; border:0; }
.rhythm-wrap-measure > div { position:relative; margin:0; padding:0; }
.rhythm-dialog-trigger { margin-left:auto; white-space:nowrap; }
@media(max-width:600px) {
  .rhythm-dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); border-radius:12px; }
  .rhythm-dialog-header { padding:10px 14px; }.rhythm-dialog-header h2 { font-size:21px; }
  .rhythm-dialog-body { padding:14px 12px; }.rhythm-dialog-row { padding:12px 10px; }
  .rhythm-dialog-text { font-size:14px; }.rhythm-dialog-foot { max-width:100%; flex-wrap:wrap; }
}
