/* Pop-up sheets: forms, build details, and the "Trojans Only" sign-in gate. */

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--fg);
  max-width: min(640px,calc(100vw - 32px));
  width: 100%;
  max-height: calc(100dvh - 32px);
}

dialog::backdrop {
  background: rgba(20,20,19,.38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.sheet {
  background: var(--bg-raised);
  border-radius: 20px;
  border: 1px solid var(--line);
  padding: 28px clamp(20px,4vw,32px) 26px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  position: relative;
}

.sheet h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -.015em;
  margin: 0;
  padding-right: 40px;
}

.x {
  position: absolute;
  top: 18px;
  right: 18px;
}

.sheet .hashes {
  margin-top: 10px;
}

.sheet .desc {
  -webkit-line-clamp: unset;
  display: block;
}

.sheet h4 {
  font: 500 11.5px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 24px 0 10px;
}

.how {
  white-space: pre-line;
  font-size: 15px;
  line-height: 1.65;
  margin: 0;
}

.d-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.owner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--fg-muted);
}

.owner .sp {
  flex: 1;
}

.form-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0 0;
  padding: 11px 13px;
  border-radius: 12px;
  background: color-mix(in srgb,var(--accent) 9%,transparent);
  color: var(--fg);
  font-size: 13.5px;
  line-height: 1.45;
}

.form-note svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  color: var(--accent-ink);
}

.form {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 16px 14px;
  margin-top: 22px;
}

.form .full {
  grid-column: 1/-1;
}

.f label,
.f .lbl {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 7px;
}

.f .opt {
  font-weight: 400;
  color: var(--fg-muted);
}

.f input[type=text],
.f input[type=email],
.f input[type=url],
.f textarea {
  width: 100%;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font: 400 15px var(--ui);
  padding: 11px 13px;
}

.f textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

.f input:focus-visible,
.f textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.f .f-hint {
  font-size: 12.5px;
  color: var(--fg-muted);
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.f .err {
  display: none;
  font-size: 13px;
  color: #B3261E;
  margin-top: 6px;
}

.f.bad .err {
  display: block;
}

.f.bad input,
.f.bad textarea {
  border-color: #B3261E;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill {
  position: relative;
}

.pill input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.pill span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  font: 500 13.5px/1 var(--ui);
  color: var(--fg);
  transition: background .15s ease,border-color .15s ease;
}

.pill input:checked+span {
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-color: var(--btn-bg);
}

.pill input:focus-visible+span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.f-actions {
  grid-column: 1/-1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.f-msg {
  margin-right: auto;
  font-size: 13.5px;
  color: #B3261E;
}

.gate {
  max-width: 440px;
}

.gate .sheet {
  text-align: center;
  padding: 40px clamp(22px,5vw,40px) 30px;
}

.gate img {
  width: 84px;
  height: auto;
  image-rendering: pixelated;
  display: block;
  margin: 0 auto;
}

.gate h3 {
  padding: 0;
  margin-top: 22px;
  font-size: 34px;
}

.gate p {
  color: var(--fg-muted);
  margin: 12px auto 0;
  max-width: 24em;
  line-height: 1.55;
}

.g-btn {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding: 15px 20px;
  border-radius: 14px;
  border: 0;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 500 16px var(--ui);
  cursor: pointer;
  transition: transform .15s ease;
}

.g-btn:hover {
  transform: translateY(-1px);
}

.g-btn svg {
  width: 20px;
  height: 20px;
}

.gate .fine {
  font-size: 13.5px;
  margin-top: 16px;
}

.gate .fine b {
  color: var(--fg);
  font-weight: 600;
}

.g-status {
  display: none;
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #FBE9E7;
  color: #8C1D18;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: left;
}

.g-status.show {
  display: block;
}

.g-demo {
  margin-top: 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg-muted);
}

@media (max-width:720px) {
  dialog {
    margin: auto 0 0;
    max-width: 100%;
    width: 100%;
    max-height: 94dvh;
  }

  dialog .sheet {
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    max-height: 94dvh;
    padding-bottom: calc(env(safe-area-inset-bottom,0px) + 24px);
    animation: sheetup .28s cubic-bezier(.2,.8,.2,1);
  }

  .gate {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog .sheet {
    animation: none!important;
  }
}

@media (max-width:560px) {
  .form {
    grid-template-columns: minmax(0,1fr);
  }
}

@keyframes sheetup {
  from {
    transform: translateY(40px);
    opacity: .4;
  }
}

/* Admin panel (js/features/admin.js): who is signed in, what moderation allows, and a build count. */
.admin-who {
  margin: 6px 0 0;
  color: var(--fg-muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.admin-who b {
  color: var(--fg);
  font-weight: 500;
}

.linkish {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.admin-note {
  margin: 4px 0 0;
  color: var(--fg-muted);
  font-size: 13.5px;
}

.admin-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 14.5px;
}

/* Privacy: the notice + consent box in the share form, and the full notice (#dPrivacy). */
.privacy-box {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: var(--bg);
  font-size: 13.5px;
  line-height: 1.55;
}

.privacy-box p {
  margin: 6px 0 0;
  color: var(--fg-muted);
}

.privacy-box p b {
  color: var(--fg);
  font-weight: 600;
}

.privacy-box .privacy-h {
  margin: 0;
  font: 500 11px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.f .consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--fg);
  font-weight: 500;
  font-size: inherit;
  line-height: 1.45;
  margin-bottom: 0;
  cursor: pointer;
}

.f .consent input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent-ink);
  cursor: pointer;
}

.f.bad .privacy-box {
  border-color: #B3261E;
}

.privacy-sheet {
  font-size: 14.5px;
  line-height: 1.6;
}

.privacy-sheet .privacy-updated {
  margin: 4px 0 0;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.privacy-sheet ul {
  margin: 0;
  padding-left: 18px;
}

.privacy-sheet li+li {
  margin-top: 6px;
}

.privacy-sheet a {
  color: var(--accent-ink);
}

.gate .linkish {
  font-size: inherit;
}
