@keyframes lsModalGlow {
  0%, 100% {
    box-shadow:
      inset 0 0 0 1px rgba(230, 211, 162, .22),
      0 0 0 1px rgba(198, 161, 90, .50),
      0 0 26px rgba(198, 161, 90, .36),
      0 0 70px rgba(198, 161, 90, .18),
      0 18px 50px rgba(0, 0, 0, .58);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(244, 236, 220, .30),
      0 0 0 1px rgba(230, 211, 162, .65),
      0 0 34px rgba(198, 161, 90, .50),
      0 0 84px rgba(198, 161, 90, .28),
      0 18px 50px rgba(0, 0, 0, .58);
  }
}

.ls-modal[hidden] { display: none !important; }
.ls-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}
.ls-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 4, 3, .78);
  backdrop-filter: blur(7px);
}
.ls-modal-shell {
  position: relative;
  z-index: 1;
  width: min(40rem, 100%);
  max-height: min(780px, 86vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--parchment);
  color-scheme: dark;
  background: #100e0c;
  border: 1px solid rgba(198, 161, 90, .72);
  border-radius: 16px;
  background-clip: padding-box;
  animation: lsModalGlow 3.2s ease-in-out infinite;
}
.ls-modal-shell.is-wide,
.ls-modal-shell.is-split { width: min(52rem, calc(100% - .4rem)); }
.ls-modal-shell.is-split {
  height: auto;
  max-height: calc(100vh - 2.4rem);
}
.ls-modal-shell.is-wizard { min-height: min(560px, 86vh); }
.ls-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  flex-shrink: 0;
}
.ls-modal-head-main { flex: 1; min-width: 0; }
.ls-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ls-modal-title h2,
.ls-modal-shell h2 {
  margin: 0;
  font-family: Cinzel, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.2;
  color: var(--parchment);
}
.ls-modal-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(198, 161, 90, .18);
  color: var(--gold-bright);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  font-family: Cinzel, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1;
}
.ls-modal-badge svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.ls-modal-kicker {
  margin: 8px 0 0;
  color: var(--gold);
  font-family: Cinzel, "Times New Roman", serif;
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.ls-modal-progress { display: flex; gap: 6px; margin-top: 12px; }
.ls-modal-progress span {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(198, 161, 90, .22);
}
.ls-modal-progress span.on { background: #c6a15a; }
.ls-modal-x {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(16, 14, 12, .92);
  border: 1px solid rgba(198, 161, 90, .35);
  color: var(--parchment);
  font-size: 22px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  flex: 0 0 30px;
}
.ls-modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 16px 16px;
  overflow: hidden;
}
.ls-modal-main { flex: 1; min-height: 0; overflow-y: auto; }
.ls-modal-card {
  background: #07080b;
  border: 1px solid rgba(198, 161, 90, .28);
  border-radius: 14px;
  padding: 16px;
}
.ls-modal-card .stack-form,
.ls-modal-card .ls-step {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .55rem;
  width: 100%;
  margin-top: 0;
}
.ls-split {
  display: grid;
  grid-template-columns: minmax(168px, 210px) minmax(0, 1fr);
  gap: .55rem .85rem;
  align-items: start;
}
.ls-split.is-even { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.ls-split > div,
.ls-preview-col,
.ls-fields-col {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-width: 0;
}
.ls-modal-card .field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .45rem .65rem;
  width: 100%;
}
.ls-modal-card .field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .16rem;
  width: auto;
  max-width: 100%;
  align-self: flex-start;
  box-sizing: border-box;
}
.ls-modal-card .field-row .field { align-self: flex-end; }
.ls-modal-card label,
.ls-modal-card .field-label {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.2;
}
.ls-modal-card .w-long,
.ls-modal-card .w-text,
.ls-modal-card .link-preview,
.ls-modal-card .auth-copy,
.ls-modal-card .auth-note { align-self: stretch; width: 100%; }
.ls-modal-card .w-mid { width: min(18rem, 100%); }
.ls-modal-card .w-slug { width: min(22rem, 100%); }
.ls-modal-card .w-type { width: min(12.5rem, 100%); }
.ls-modal-card .w-date { width: min(10.5rem, 100%); }
.ls-modal-card .w-year { width: 7rem; }
.ls-modal-card .w-part { width: 4.8rem; }
.ls-modal-card .w-series { flex: 1 1 14rem; width: auto; min-width: min(14rem, 100%); }
.ls-modal-card .w-file { width: auto; }
.ls-modal-card input,
.ls-modal-card textarea,
.ls-modal-card select {
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  background: #100e0c;
  color: var(--parchment);
  border: 1px solid rgba(198, 161, 90, .35);
  border-radius: 8px;
  color-scheme: dark;
}
.ls-modal-card .field input,
.ls-modal-card .field select,
.ls-modal-card .field textarea {
  width: 100%;
  padding: .38rem .55rem;
  line-height: 1.25;
  text-transform: none;
}
.ls-modal-card .w-file input,
.ls-modal-card input[type="file"] { width: auto; }
.ls-modal-card .w-text textarea { min-height: 4.2rem; }
.ls-modal-card .w-review { width: min(32rem, 100%); }
.ls-modal-card .w-review textarea { min-height: 4.6rem; }
.ls-modal-card select[hidden] { display: none !important; }
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
}
.chip-row button {
  border: 1px solid rgba(198, 161, 90, .55);
  background: rgba(198, 161, 90, .08);
  color: var(--gold-bright);
  border-radius: 8px;
  padding: .22rem .48rem;
  font-family: Cinzel, "Times New Roman", serif;
  font-size: .6rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1.2;
  cursor: pointer;
}
.chip-row button.is-on {
  background: #c6a15a;
  color: #1a140c;
  border-color: #c6a15a;
}
.ls-modal-shell.is-split .ls-modal-head { padding: 12px 14px 8px; }
.ls-modal-shell.is-split .ls-modal-body { padding: 0 12px 10px; }
.ls-modal-shell.is-split .ls-modal-card { padding: 12px; }
.ls-modal-shell.is-split .ls-modal-body { flex: 0 1 auto; }
.ls-modal-shell.is-split .ls-modal-main { flex: 0 1 auto; overflow-y: auto; }
.ls-modal-shell.is-split .ls-modal-foot { margin-top: 8px; }
.ls-modal-card .auth-link { align-self: flex-start; }
.ls-modal-card .auth-tabs { justify-content: flex-start; }
.ls-modal-card .auth-tabs button { flex: 0 0 auto; width: auto; }
.ls-modal .btn { width: auto; }
.ls-modal-card input:focus,
.ls-modal-card textarea:focus,
.ls-modal-card select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold-bright);
}
.ls-modal-card .auth-copy { margin-top: 0; }
.ls-modal-card .link-preview { margin: 0; }
.ls-modal-card .link-preview-status { margin: 0; font-size: .75rem; line-height: 1.3; }
.ls-modal-card .link-preview-status:empty,
.ls-modal-card .link-preview-status[hidden] { display: none; }
.ls-modal-card .link-card.is-large { grid-template-columns: 1fr; }
.ls-modal-card .link-card.is-large img {
  width: 100%;
  height: 112px;
  object-fit: cover;
}
.ls-modal-card .link-card.is-large div { padding: .4rem .5rem .45rem; }
.ls-modal-card .link-card.is-large strong { font-size: .78rem; }
.ls-modal-card .link-card.is-large em,
.ls-modal-card .link-card.is-large span { font-size: .7rem; margin-top: .12rem; }
.who-line {
  margin: 0;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.3;
}
.who-line:empty { display: none; }
.suggest-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .45rem;
}
.suggest-row[hidden] { display: none !important; }
.suggest-chip,
.tag-row .suggest-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid rgba(198, 161, 90, .55);
  background: rgba(198, 161, 90, .14);
  color: var(--gold-bright);
  border-radius: 8px;
  padding: .18rem .45rem;
  font-family: Cinzel, "Times New Roman", serif;
  font-size: .62rem;
  letter-spacing: .04em;
  line-height: 1.2;
  cursor: pointer;
}
.suggest-x { font-size: .85rem; line-height: 1; }
.tag-row { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag-row[hidden] { display: none !important; }
.series-offer {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.series-offer[hidden] { display: none !important; }
.series-offer-q {
  margin: 0;
  color: var(--parchment);
  font-size: .78rem;
  line-height: 1.35;
}
.series-chips,
.series-missing {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.ls-modal-card .series-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid rgba(198, 161, 90, .45);
  background: rgba(198, 161, 90, .08);
  border-radius: 8px;
  padding: .15rem .45rem .15rem .2rem;
  color: var(--parchment);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.2;
}
.ls-modal-card .series-chip input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: #c6a15a;
}
.series-chip img {
  width: 64px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  background: #07080b;
}
.series-miss {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  color: var(--muted);
  font-size: .68rem;
}
.ls-modal-card .series-miss input {
  width: 14rem;
  max-width: 100%;
  padding: .32rem .5rem;
}
.more-details {
  border-top: 1px solid rgba(198, 161, 90, .22);
  padding-top: .35rem;
}
.more-details summary {
  cursor: pointer;
  color: var(--gold);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  list-style: none;
}
.more-details summary::-webkit-details-marker { display: none; }
.more-fields {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-top: .45rem;
}
.ls-step[hidden] { display: none !important; }
.ls-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  margin-top: 12px;
}
.ls-modal-foot-left,
.ls-modal-foot-right { display: flex; align-items: center; gap: 8px; }
.ls-modal-foot-right { margin-left: auto; }
.ls-modal-foot .btn { width: auto; min-height: 38px; }
.ls-modal-foot [hidden] { display: none !important; }
.ls-modal-back {
  background: rgba(198, 161, 90, .10);
  border: 1px solid rgba(198, 161, 90, .55);
  color: var(--gold-bright);
}
.ls-modal-back:hover { background: rgba(198, 161, 90, .18); }

.ar-drawer .ls-modal-head { padding: 14px 5.4rem 10px 14px; }
.ar-drawer .ls-modal-card { margin: 0 12px 14px; }
.tl-panel .ls-modal-card { margin: 0 12px 16px; }
.lightbox-card img {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  background: #07080b;
  display: block;
}
.lightbox-card p { margin: .75rem 0 0; color: var(--muted); }

@media (max-width: 720px) {
  .ls-split,
  .ls-split.is-even { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .ls-modal-card .field-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .ls-modal-card .w-series { width: 100%; flex-basis: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .ls-modal-shell { animation: none; }
}
