/*
 * /dex-reader — page-scoped styles.
 *
 * Everything here is the frame: the header band, the consent form, and the box
 * the reader sits in. The reader styles itself inside a shadow root, so nothing
 * in this file reaches it and nothing in it reaches out — which is the whole
 * reason it is mounted that way.
 */

/*
 * The consent fields and the "what you chose" line are toggled with the hidden
 * attribute, and a `display` of our own beats the browser's own [hidden] rule.
 * Without this they are visible from the moment the page loads.
 */
.dexp-body [hidden],
.dexp-consent [hidden] {
  display: none !important;
}

.dexp-head {
  padding: 3.2rem 0 1.6rem;
  background: var(--paper-deep);
  border-bottom: 1px solid var(--line);
}

.dexp-lead {
  max-width: 62ch;
  margin: 0.9rem 0 0;
  font-size: 1.18rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.dexp-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
}

.dexp-facts li {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.dexp-facts strong {
  color: var(--ink);
}

.dexp-body {
  padding: 2.4rem 0 4rem;
}

/* ----------------------------------------------------------------- consent */

.dexp-consent {
  max-width: 820px;
  margin: 0 auto 2.6rem;
  padding: 1.8rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dexp-consent.is-settled {
  padding: 1rem 1.4rem;
}

.dexp-consent__intro h2 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--ink);
}

.dexp-consent__intro p {
  margin: 0 0 1.6rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.dexp-choice {
  margin: 0 0 1.4rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.dexp-choice__legend {
  padding: 0;
  width: 100%;
}

.dexp-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 1.03rem;
  color: var(--ink);
}

.dexp-check input {
  margin-top: 0.25rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--signal);
  flex: none;
}

.dexp-choice__why {
  margin: 0.6rem 0 0 1.7rem;
  font-size: 0.95rem;
  line-height: 1.68;
  color: var(--ink-soft);
}

.dexp-details {
  margin: 0.8rem 0 0 1.7rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.dexp-details > summary {
  cursor: pointer;
  color: var(--steel);
  font-weight: 600;
}

.dexp-details ul {
  margin: 0.7rem 0;
  padding-left: 1.2rem;
  line-height: 1.6;
}

.dexp-details li {
  margin-bottom: 0.35rem;
}

.dexp-details code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

/* ------------------------------------------------------------------ fields */

.dexp-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.9rem 1.1rem;
  margin: 1.1rem 0 0 1.7rem;
}

.dexp-field--wide {
  grid-column: 1 / -1;
}

.dexp-field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}

.dexp-hint {
  font-weight: 400;
  color: var(--ink-faint);
}

.dexp-field input,
.dexp-field select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.dexp-field input:focus,
.dexp-field select:focus {
  outline: 2px solid var(--steel);
  outline-offset: 1px;
  border-color: var(--steel);
}

/* ----------------------------------------------------------------- actions */

.dexp-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.4rem;
  margin-top: 1.4rem;
}

.dexp-form__note {
  flex: 1 1 280px;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-faint);
}

.dexp-form__status {
  margin: 0.9rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.dexp-form__status.is-bad {
  color: var(--signal-deep);
}

.dexp-consent__revisit {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0;
  font-size: 0.93rem;
  color: var(--ink-soft);
}

.dexp-linkbutton {
  padding: 0;
  font: inherit;
  color: var(--steel);
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}

.dexp-linkbutton:hover {
  color: var(--signal);
}

/* ------------------------------------------------------------------ reader */

.dexp-sectiontitle {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--ink);
}

/*
 * The reader is an instrument and wants the width. It is also the one element
 * on this page whose insides we do not style: the height is its own, and the
 * border is the site's frame around it.
 */
.dexp-reader {
  min-height: 640px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.dexp-uploadstatus:empty {
  display: none;
}

.dexp-uploadstatus {
  margin: 0.8rem 0 0;
  padding: 0.6rem 0.9rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
  background: var(--signal-tint);
  border-radius: var(--radius-sm);
}

.dexp-provenance {
  margin: 0.8rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.dexp-provenance code {
  font-family: var(--font-mono);
}

.dexp-callout {
  max-width: 820px;
  margin: 1.6rem auto;
  padding: 1rem 1.2rem;
  font-size: 0.97rem;
  line-height: 1.7;
  color: var(--ink-soft);
  background: var(--signal-tint);
  border-left: 3px solid var(--signal);
  border-radius: var(--radius-sm);
}

.dexp-prose {
  margin-top: 3rem;
}

@media (max-width: 700px) {
  .dexp-consent {
    padding: 1.2rem;
  }

  .dexp-choice__why,
  .dexp-details,
  .dexp-fields {
    margin-left: 0;
  }

  .dexp-reader {
    min-height: 520px;
  }
}
