html.ls-open {
  overflow: hidden;
}

dialog.mirador-stay {
  --ls-canvas: #15171c;
  --ls-surface: #22252c;
  --ls-control: #2d3038;
  --ls-ink: #f5f1e8;
  --ls-muted: #c4c5c9;
  --ls-line: #484c56;
  --ls-control-line: #81848c;
  --ls-gold: #e6c181;
  color-scheme: dark;
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(35rem, calc(100% - 2rem));
  max-width: none;
  max-height: min(90vh, 48rem);
  max-height: min(90dvh, 48rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ls-ink);
  background: var(--ls-surface);
  border: 1px solid var(--ls-line);
  border-radius: 12px;
  font: 400 1rem/1.5 var(--face, "Instrument Sans", Arial, sans-serif);
  text-align: left;
}

.mirador-stay:not([open]) { display: none; }
.mirador-stay::backdrop { background: rgb(12 14 19 / 82%); }
.mirador-stay *,
.mirador-stay *::before,
.mirador-stay *::after { box-sizing: border-box; }

.mirador-stay :where(button, input, textarea, a) {
  font: inherit;
  color: inherit;
}

.mirador-stay button {
  cursor: pointer;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
}

.mirador-stay :is(button, input, textarea, a):focus-visible {
  outline: 2px solid var(--ls-gold);
  outline-offset: 3px;
}

.ls-box { padding: clamp(1.25rem, 4vw, 2rem); }

.ls-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ls-line);
  margin-bottom: 1.5rem;
}

.ls-brand { color: var(--ls-muted); font-size: .875rem; }

.ls-close {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: .7rem;
  border: 1px solid var(--ls-line);
  background: var(--ls-control);
  border-radius: 50%;
}

.ls-close svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}

.mirador-stay h2,
.mirador-stay h3 {
  margin: 0;
  color: var(--ls-ink);
  font-family: var(--face, "Instrument Sans", Arial, sans-serif);
  font-weight: 500;
  text-transform: none;
  line-height: 1.15;
}

.mirador-stay h2 { font-size: clamp(1.9rem, 4.7vw, 2.5rem); letter-spacing: -.025em; }
.mirador-stay h2:focus { outline: none; }
.mirador-stay .ls-intro {
  margin: .65rem 0 1.5rem;
  max-width: none;
  color: var(--ls-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.ls-form,
.ls-dates {
  display: grid;
  gap: 1rem;
}

.ls-dates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ls-form label { display: grid; gap: .4rem; min-width: 0; font-size: .95rem; }

.ls-form input,
.mirador-stay textarea.ls-message {
  width: 100%;
  min-width: 0;
  color: var(--ls-ink);
  background: var(--ls-control);
  border: 1px solid var(--ls-control-line);
  border-radius: 12px;
  font: inherit;
}

.ls-form input {
  min-height: 3rem;
  padding: .6rem 1rem;
  border-radius: 2rem;
}

.mirador-stay .ls-primary,
.mirador-stay .ls-copy,
.mirador-stay .ls-platform {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.875rem;
  padding: .65rem 1.3rem;
  border-radius: 2rem;
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.mirador-stay .ls-primary {
  color: var(--ls-canvas);
  border: 1px solid var(--ls-gold);
  background: var(--ls-gold);
}

.ls-form .ls-primary { margin-top: .4rem; }
.mirador-stay .ls-copy,
.mirador-stay .ls-platform {
  color: var(--ls-ink);
  background: var(--ls-control);
  border: 1px solid var(--ls-control-line);
}

.mirador-stay .ls-text {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: .4rem 0;
  border: 0;
  background: transparent;
  color: var(--ls-muted);
  font-size: .95rem;
  text-decoration: underline;
  text-underline-offset: .2em;
}

@media (hover: hover) {
  .mirador-stay .ls-primary:hover { color: var(--ls-canvas); background: #f2cf93; }
  .mirador-stay :is(.ls-close, .ls-copy, .ls-platform):hover { border-color: var(--ls-ink); }
  .mirador-stay .ls-text:hover { color: var(--ls-ink); }
}

.ls-message-label { display: block; margin: 0 0 .5rem; font-size: .95rem; }
.mirador-stay textarea.ls-message {
  display: block;
  min-height: 7rem;
  margin-bottom: 1rem;
  padding: .8rem 1rem;
  resize: vertical;
}

.ls-actions,
.ls-platforms { display: flex; flex-wrap: wrap; gap: .6rem; }

.mirador-stay .ls-status {
  margin: .4rem 0;
  color: var(--ls-muted);
  font-size: .875rem;
}

.ls-channels {
  border-top: 1px solid var(--ls-line);
  margin-top: 1.2rem;
  padding-top: 1rem;
}

.ls-channels h3 { margin-bottom: .75rem; font-size: 1.35rem; }
.ls-platforms { margin-bottom: .7rem; }

@media (max-width: 32rem) {
  dialog.mirador-stay { width: calc(100% - 1.25rem); }
  .ls-actions { display: grid; }
}

@media (max-width: 25rem) {
  .ls-dates { grid-template-columns: 1fr; }
}
