.po {
  --po-bg: #f4f4f5;
  --po-ink: #111518;
  --po-gold: #bfa65c;
  --po-gold-dark: #725a20;
  --po-border: #dedee0;
  --po-surface: #fdfdfd;
  --po-dark: #111518;
  --po-sans: var(--theme-font-family, "Open Sans", system-ui, sans-serif);
  --po-serif: "Libre Baskerville", Georgia, serif;
  color: var(--po-ink);
  font: 16px/1.5 var(--po-sans);
  text-align: left;
}
.po *, .po *::before, .po *::after { box-sizing: border-box; }
.po [hidden] { display: none !important; }
.po .po-shell { background: var(--po-bg); border-radius: 12px; padding: clamp(16px, 4vw, 36px); }
.po h2, .po h3 { font-family: inherit; color: inherit; letter-spacing: normal; margin: 0 0 12px; }
.po h2 { font-family: var(--po-serif); font-size: clamp(30px, 5vw, 48px); font-weight: 400; line-height: 1.2; }
.po h3 { font-size: 17px; }
.po-header { margin-bottom: 24px; }
.po-header::after { content: ""; display: block; width: 52px; height: 3px; background: var(--po-gold); }
.po-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(245px, 1fr); gap: 16px; }
.po-card { background: #fff; padding: 18px; border: 1px solid var(--po-border); border-radius: 10px; }
.po-script { display: flex; flex-direction: column; }
.po label { display: block; font-weight: 650; }
.po textarea, .po select {
  display: block; width: 100%; color: var(--po-ink); background: var(--po-surface);
  border: 1px solid #a9a9ad; border-radius: 8px; padding: 10px; font: inherit;
}
.po textarea { min-height: 250px; margin: 8px 0; resize: vertical; flex: 1; }
.po select { margin-top: 4px; }
.po input[type="range"] { display: block; width: 100%; accent-color: var(--po-gold-dark); margin: 8px 0; padding: 0; }
.po .po-settings label + label, .po .po-nudge + label { margin-top: 12px; }
.po .po-check { display: flex; gap: 8px; align-items: center; }
.po output { font-variant-numeric: tabular-nums; white-space: nowrap; }
.po-settings output { float: right; color: var(--po-gold-dark); font-size: 14px; }
.po-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; color: #3f4245; font-size: 13px; }
.po-preview { margin: 16px 0; color: #fdfdfd; background: var(--po-dark); border: 0; }
.po-preview [data-preview] {
  margin: auto; line-height: 1.35; max-width: var(--po-width, 40ch);
  font-size: var(--po-size, 48px); max-height: 2.7em;
  overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere;
}
.po button {
  appearance: none; font: 650 14px/1.2 var(--po-sans); letter-spacing: normal; text-transform: none;
  min-height: 44px; min-width: 44px; padding: 8px 14px; border-radius: 9px;
  color: var(--po-ink); background: #f4f4f5; border: 1px solid var(--po-border); cursor: pointer;
}
.po button:hover { filter: brightness(.92); }
.po button:disabled { opacity: .5; cursor: default; }
.po .po-primary { color: #180000; background: var(--po-gold); border-color: var(--po-gold); }
.po :focus-visible { outline: 3px solid var(--po-gold-dark); outline-offset: 3px; }
.po-reader {
  position: fixed; inset: 0; z-index: 999999; display: flex; flex-direction: column;
  width: 100%; height: 100%; height: 100dvh; gap: 10px; padding: clamp(10px, 2vw, 24px);
  background: var(--po-dark); color: #fdfdfd;
}
.po-toolbar, .po-controls, .po-speed, .po-progress { display: flex; align-items: center; gap: 8px; }
.po-toolbar, .po-controls { justify-content: space-between; flex-wrap: wrap; }
.po-progress progress { flex: 1; width: 0; accent-color: var(--po-gold); }
.po-window { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.po-track {
  position: relative; z-index: 0; margin: auto; width: min(calc(100% - 34px), var(--po-width, 40ch));
  font-size: var(--po-size, 48px); line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere;
}
.po-marker {
  position: absolute; z-index: 1; inset: 18% 0 auto; border-top: 1px solid #bfa65c80;
  color: var(--po-gold); font-size: 20px; line-height: 1; pointer-events: none;
}
.po-message { position: absolute; z-index: 2; inset: 0; display: grid; place-content: center; gap: 8px; background: #111518f2; text-align: center; font-size: clamp(44px, 12vw, 100px); }
.po-end { font-size: inherit; }
@media (max-width: 650px) {
  .po-grid { grid-template-columns: 1fr; }
  .po-controls { justify-content: center; }
}
.po-immersive .po-toolbar { justify-content: flex-end; }
.po-immersive .po-controls { justify-content: center; }
.po-immersive .po-controls [data-toggle] { min-width: 120px; }
.po-immersive .po-toolbar [data-back],
.po-immersive .po-controls [data-repeat],
.po-immersive .po-speed,
.po-immersive .po-progress { display: none; }

.po-reader :focus-visible { outline-color: var(--po-gold); }
.po .po-check input { accent-color: var(--po-gold-dark); }
