#polyglot-lab { --pg-ink: var(--font-color, #43394b); --pg-paper: var(--card-bg, #fffaf7); --pg-line: #b29aa96b; max-width: 920px; margin: auto; color: var(--pg-ink); }
#polyglot-lab [hidden] { display: none !important; }
#polyglot-lab :is(h2,h3,h4,p) { margin: 0; color: inherit; }
#polyglot-lab .pg-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-size: .86rem; }
#polyglot-lab .pg-nav a, #polyglot-lab .pg-notes a { text-decoration: underline; text-underline-offset: .22em; }
#polyglot-lab .pg-intro { display: grid; grid-template-columns: 1fr .95fr; align-items: center; background: #39344d; color: #fff5eb; padding: clamp(1.2rem, 3vw, 2.1rem); border-radius: 18px; gap: 1.5rem; overflow: hidden; }
#polyglot-lab .pg-intro-copy > * + * { margin-top: .65rem; }
#polyglot-lab .pg-intro h2 { color: #fff4e7; font: 700 clamp(1.65rem, 3.4vw, 2.4rem)/1.25 "Songti SC", SimSun, serif; }
#polyglot-lab .pg-eyebrow { display: block; font: 700 .69rem ui-monospace, monospace; letter-spacing: .14em; }
#polyglot-lab .pg-intro .pg-eyebrow { color: #f3c6b5; }
#pg-art { display: block; width: 100%; height: auto; border-radius: 6px; transform: rotate(2deg); box-shadow: 0 9px 20px #20182b55; }
#polyglot-lab .pg-panel { margin-top: 1rem; padding: clamp(1rem, 3vw, 1.65rem); border: 1px solid var(--pg-line); border-radius: 15px; background: var(--pg-paper); }
#polyglot-lab .pg-panel h3 { margin-top: .4rem; font-size: 1.32rem; }
#polyglot-lab .pg-panel p { margin: .35rem 0 .8rem; }
#polyglot-lab .pg-fields, #polyglot-lab .pg-output-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin: .9rem 0; }
#polyglot-lab .pg-fields label { display: flex; flex-direction: column; padding: .75rem; gap: .25rem; border: 1px dashed var(--pg-line); border-radius: 9px; font-weight: 600; min-width: 0; }
#polyglot-lab .pg-fields small, #polyglot-lab .pg-note { font-size: .8rem; font-weight: normal; }
#polyglot-lab input[type=file] { width: 100%; font-size: .8rem; color: inherit; }
#polyglot-lab :is(.pg-primary,.pg-secondary) { display: inline-block; padding: .4rem .9rem; border: 1px solid #76536c; border-radius: 99px; font: 600 .89rem/1.6 system-ui, sans-serif; cursor: pointer; text-decoration: none; }
#polyglot-lab .pg-primary { background: #64445d; color: #fff9ee; }
#polyglot-lab .pg-intro .pg-primary, #polyglot-lab .pg-secondary { background: #f4e1d6; color: #523b4e; }
#polyglot-lab button:disabled { opacity: .65; cursor: progress; }
#pg-status { padding: .7rem 0 0; font-size: .88rem; }
#polyglot-lab .pg-downloads { display: flex; gap: .5rem; flex-wrap: wrap; }
#polyglot-lab #pg-preview { display: block; max-width: 100%; width: auto; max-height: 255px; object-fit: contain; margin: .3rem 0; border-radius: 7px; }
#pg-list { list-style: none; padding: 0; margin: .3rem 0; }
#pg-list li { display: flex; gap: .5rem; align-items: baseline; justify-content: space-between; padding: .25rem 0; border-bottom: 1px solid var(--pg-line); font-size: .87rem; }
#pg-list span { overflow-wrap: anywhere; }
#pg-list small { flex: none; }
#pg-audio { width: 100%; min-width: 0; max-width: 100%; margin: .55rem 0; }
#polyglot-lab .pg-notes { border-top: 1px solid var(--pg-line); margin-top: 1rem; padding: .7rem 0; font-size: .89rem; }
#polyglot-lab .pg-notes p { margin-top: .55rem; }
#polyglot-lab summary { cursor: pointer; font-weight: 600; }
#polyglot-lab :focus-visible { outline: 3px solid #ae5983; outline-offset: 3px; }
@media (max-width: 640px) {
  #polyglot-lab .pg-intro, #polyglot-lab .pg-fields, #polyglot-lab .pg-output-grid { grid-template-columns: 1fr; }
  #polyglot-lab .pg-intro { gap: 1rem; }
  #pg-art { max-width: 360px; justify-self: center; }
}
