/* Amigo secreto online: page-only layout (loaded only on /amigo-secreto-online/) */

.site-main:has(.as-stage) {
  overflow-x: clip;
}

.as-stage {
  --as-ink: #10233f;
  --as-body: #475569;
  --as-muted: #64748b;
  --as-line: #e1e7ef;
  --as-orange: #ff5a1f;
  /* Wider than the shared post container; breaks out of it evenly on both sides. */
  --as-w: min(1320px, calc(100vw - 48px));
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) minmax(210px, 250px);
  gap: 30px;
  align-items: stretch;
  width: var(--as-w);
  margin: 4px 0 40px calc((100% - var(--as-w)) / 2);
  padding: 18px 0 8px;
}

.as-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -24px;
  bottom: -40px;
  left: calc(50% - 50vw);
  width: 100vw;
  background:
    radial-gradient(560px 420px at calc(50% - 560px) 82%, rgba(255, 228, 188, 0.8), transparent 70%),
    radial-gradient(520px 420px at calc(50% + 560px) 20%, rgba(255, 228, 188, 0.75), transparent 70%),
    linear-gradient(180deg, #f4f7fb 0%, #f8fafc 70%, #fff 100%);
  -webkit-mask-image: linear-gradient(#000 82%, transparent);
  mask-image: linear-gradient(#000 82%, transparent);
  pointer-events: none;
}

.as-stage [hidden] {
  display: none !important;
}

.as-stage svg {
  flex: none;
}

/* Decorative sparkles */
.as-spark {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  fill: #f2b233;
}

.as-spark.is-dot {
  fill: #f97316;
}

.as-spark.is-red {
  fill: #ef4444;
}

/* Left intro */
.as-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 12px;
}

.as-title {
  margin: 0 0 16px;
  font-size: clamp(2.3rem, 3.2vw, 2.95rem);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--as-ink);
}

.as-sub {
  margin: -4px 0 14px;
  color: #e2531b;
  font-size: 0.98rem;
  font-weight: 750;
  line-height: 1.3;
}

.as-lead {
  margin: 0 0 22px;
  color: var(--as-body);
  font-size: 0.95rem;
  line-height: 1.5;
}

.as-lead strong {
  color: var(--as-ink);
}

.as-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.as-points li {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0;
  color: var(--as-body);
  font-size: 0.92rem;
  line-height: 1.3;
}

.as-points li::before {
  display: none;
}

.as-points strong {
  display: block;
  font-weight: 700;
  color: var(--as-ink);
}

.as-points span:not(.as-ico) {
  display: block;
  margin-top: 2px;
  color: var(--as-muted);
  font-size: 0.8rem;
}

.as-stage picture {
  display: block;
  pointer-events: none;
  user-select: none;
}

.post-content .as-stage img.as-gifts {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.as-intro > picture {
  width: calc(100% + 100px);
  margin: auto 0 -10px -120px;
  padding-top: 28px;
}

/* Icon badges */
.as-ico {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}

.as-ico svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.as-ico-blue { background: #e6efff; color: #2f6fed; }
.as-ico-lilac { background: #eee8ff; color: #6d4ae8; }
.as-ico-pink { background: #ffe6ea; color: #ef3e5c; }
.as-ico-gold { background: #fff2cc; color: #f0a500; }
.as-ico-green { background: #e3f6e9; color: #16a34a; }
.as-ico-purple { background: #f1e6ff; color: #8b3fd9; }

/* Card */
.as-stage .as-card {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 24px 26px 22px;
  border: 1px solid #e6ebf2;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(16, 35, 63, 0.08), 0 2px 6px rgba(16, 35, 63, 0.04);
  align-self: start;
}

.as-stage .sort-body {
  padding: 0;
  gap: 18px;
}

.as-field {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.as-label-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-height: 22px;
  margin: 0 0 8px;
}

.as-label-row label,
.as-field .sort-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.93rem;
  font-weight: 750;
  color: var(--as-ink);
}

.as-help {
  display: inline-grid;
  place-items: center;
  color: #64748b;
  cursor: help;
}

.as-help svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.as-stage .sort-input,
.as-stage .sort-textarea {
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid #dde4ee;
  border-radius: 12px;
  background: #fff;
  color: var(--as-ink);
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.as-stage .sort-input::placeholder,
.as-stage .sort-textarea::placeholder {
  color: #94a3b8;
}

.as-stage .sort-input:focus,
.as-stage .sort-textarea:focus {
  outline: none;
  border-color: #93b8f8;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.14);
}

.as-stage .sort-textarea {
  min-height: 92px;
}

.as-stage .sort-textarea-sm {
  min-height: 70px;
}

.as-stage .sort-hint {
  margin: 8px 0 0;
  color: var(--as-muted);
  font-size: 0.78rem;
}

.as-label-row .sort-hint {
  margin: 0;
}

/* Name list buttons */
.as-stage .sort-list-bar {
  gap: 10px;
  margin-top: 12px;
}

.as-stage .sort-list-bar .sort-link,
.as-stage .sort-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #dde4ee;
  border-radius: 10px;
  background: #f1f4f8;
  color: #1e293b;
  font-size: 0.86rem;
  font-weight: 700;
}

.as-stage .sort-list-bar .sort-link:hover {
  color: #1e293b;
  background: #e8edf3;
}

.as-stage .sort-file-btn {
  border-color: #9ec2fb;
  background: #eef5ff;
  color: #1d5fd6;
}

.as-stage .sort-file-btn:hover {
  background: #e3eeff;
}

.as-stage .sort-list-bar svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* Restrictions (shown by JS once names exist) */
.as-stage .sort-ex-wrap {
  padding-top: 0;
}

.as-stage .sort-ex-wrap .sort-hint {
  margin: 0 0 10px;
}

.as-stage .sort-ex-row .sort-btn-ghost {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid #dde4ee;
  border-radius: 12px;
  background: #f1f4f8;
  color: #1e293b;
  font-size: 0.88rem;
  font-weight: 700;
}

.as-stage .sort-check {
  margin-top: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--as-body);
}

/* Budget + date row */
.as-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.as-money {
  position: relative;
}

.as-money .sort-input {
  padding-right: 40px;
}

.as-step {
  position: absolute;
  top: 5px;
  right: 6px;
  bottom: 5px;
  display: flex;
  flex-direction: column;
  width: 26px;
}

.as-step button {
  appearance: none;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.as-step button:hover {
  background: #f1f4f8;
  color: var(--as-ink);
}

.as-step svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.as-stage input[type="date"] {
  color: var(--as-ink);
}

/* Actions */
.as-stage .sort-actions {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.as-stage .sort-actions .sort-btn {
  gap: 10px;
}

.as-stage .sort-actions #sort-run {
  position: relative;
  min-height: 56px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ff6a26, #ff4f16);
  box-shadow: 0 12px 26px rgba(255, 90, 31, 0.28);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.as-stage .sort-actions #sort-run:disabled {
  opacity: 0.7;
  cursor: wait;
}

.as-stage .sort-actions #sort-run svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.as-stage .sort-actions #sort-run .as-run-chev {
  width: 20px;
  height: 20px;
  margin-left: 2px;
}

.as-stage .sort-actions .sort-btn-ghost {
  min-height: 50px;
  border: 1px solid #e1e7ef;
  border-radius: 12px;
  background: #f3f6fa;
  color: #1e293b;
  font-weight: 750;
}

.as-stage .sort-actions .sort-btn-ghost:hover {
  background: #eaeff5;
  filter: none;
}

.as-stage .sort-actions .sort-btn-ghost svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

/* Result */
.as-stage .sort-app {
  --sort-accent: var(--as-orange);
}

@media (min-width: 981px) {
  .as-stage:has(.as-res-head) {
    grid-template-columns: minmax(190px, 220px) minmax(0, 1fr) minmax(200px, 220px);
    gap: 24px;
  }

  .as-stage:has(.as-res-head) .as-card {
    padding: 18px;
  }
}

.as-stage .sort-result {
  padding: 0;
  container-type: inline-size;
}

.as-stage .sort-result .sort-btn {
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}

.as-stage .sort-result .sort-btn-ghost {
  border: 1px solid #e1e7ef;
  background: #f3f6fa;
  color: #1e293b;
}

.as-stage .sort-result .sort-btn-ghost:hover {
  background: #eaeff5;
  filter: none;
}

.as-bi {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: none;
}

.as-tone-0 { --tone: #e5484d; --tone-bg: #ffe8ea; }
.as-tone-1 { --tone: #2f6fed; --tone-bg: #e3edff; }
.as-tone-2 { --tone: #7c4ddb; --tone-bg: #eee7ff; }
.as-tone-3 { --tone: #1f9d55; --tone-bg: #dcf4e5; }
.as-tone-4 { --tone: #e59a00; --tone-bg: #fff0c9; }

.as-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--tone, #2f6fed);
}

.as-av svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Group header */
.as-res-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #e6ebf2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(16, 35, 63, 0.05);
}

.as-res-ico {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: #e6efff;
  color: #2f6fed;
}

.as-res-ico svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.as-res-title {
  flex: 1;
  min-width: 0;
}

.as-stage .as-res-name {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--as-ink);
}

.as-res-name > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.as-res-pencil {
  appearance: none;
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #2f6fed;
  cursor: pointer;
}

.as-res-pencil:hover {
  background: #eef4ff;
}

.as-res-pencil svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.as-stage .as-res-sub {
  margin: 2px 0 0;
  color: var(--as-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.as-stage .sort-result .as-res-edit {
  flex: none;
  min-height: 42px;
  padding: 0 16px;
  border-color: #bcd3fb;
  border-radius: 12px;
  background: #eef5ff;
  color: #1d5fd6;
}

.as-stage .sort-result .as-res-edit:hover {
  background: #e3eeff;
}

.as-stage .sort-result .as-res-edit .as-bi {
  width: 18px;
  height: 18px;
}

/* Two paths */
.as-stage .sort-result .as-res-paths {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}

@container (min-width: 580px) {
  .as-stage .sort-result .as-res-paths {
    grid-template-columns: minmax(0, 4.2fr) minmax(0, 7.8fr);
  }
}

.as-stage .sort-result .as-away {
  container-type: inline-size;
}

@container (max-width: 350px) {
  .as-stage .sort-result .sort-share-actions .as-bl {
    display: none;
  }
  .as-stage .sort-result .sort-share-actions .sort-btn {
    width: 36px;
    padding: 0;
  }
}

.as-stage .sort-result .sort-path {
  padding: 16px 14px;
  border: 0;
  border-radius: 18px;
}

.as-stage .sort-result .as-room {
  background: #f0f5fe;
}

.as-stage .sort-result .as-away {
  background: #f4f7fb;
}

.as-stage .sort-result .sort-path h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--as-ink);
}

.as-stage .sort-result .sort-path h3::before,
.as-stage .sort-result .sort-path h3::after {
  display: none;
}

.as-hi {
  width: 20px;
  height: 20px;
  flex: none;
  fill: #2f6fed;
}

.as-stage .sort-result .sort-path .sort-hint {
  margin: 0 0 14px;
  font-size: 0.8rem;
  line-height: 1.45;
}

/* Na sala: name pills */
.as-stage .sort-result .sort-people {
  display: grid;
  gap: 10px;
}

.as-stage .sort-result .sort-person {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 6px 14px 6px 8px;
  border: 0;
  border-radius: 999px;
  background: var(--tone-bg);
  color: var(--as-ink);
  font-size: 0.95rem;
  font-weight: 750;
  text-align: left;
  transition: transform 0.12s, box-shadow 0.12s;
}

.as-stage .sort-result .sort-person:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(16, 35, 63, 0.08);
}

.as-stage .sort-result .sort-person.is-seen {
  color: var(--as-ink);
  opacity: 0.7;
}

.as-pname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.as-stage .sort-result .sort-seen {
  width: 22px;
  height: 22px;
  margin-left: auto;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-size: 0.7rem;
}

/* Reveal card + organizer list */
.as-stage .sort-result .sort-reveal {
  margin-top: 14px;
  padding: 14px 10px;
  border: 1px solid #fed7aa;
  border-radius: 16px;
  background: #fff7ed;
}

.as-stage .sort-result .sort-reveal p {
  margin: 0;
}

.as-stage .sort-result .sort-reveal .sort-reveal-from {
  font-size: 0.85rem;
}

.as-stage .sort-result .sort-reveal .sort-reveal-to {
  margin: 4px 0 6px;
  color: var(--as-ink);
  font-size: 1.6rem;
  overflow-wrap: anywhere;
}

.as-stage .sort-result .sort-reveal .sort-reveal-meta,
.as-stage .sort-result .sort-reveal .sort-reveal-hint {
  margin-top: 4px;
  font-size: 0.8rem;
}

.as-stage .sort-result .sort-reveal .sort-result-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.as-stage .sort-result .sort-reveal .sort-btn {
  min-width: 0;
  min-height: 36px;
  padding: 6px 8px;
  font-size: 0.8rem;
  line-height: 1.2;
  white-space: normal;
}

.as-stage .sort-result .sort-reveal a.sort-btn-ghost {
  border-color: #bfe8cd;
  background: #e7f7ed;
  color: #15803d;
}

.as-stage .sort-result .sort-reveal .sort-list li {
  background: #fff;
}

/* Longe: link rows */
.as-stage .sort-result .sort-share-list {
  margin: 0;
  padding: 0;
  gap: 10px;
}

.as-stage .sort-result .sort-share-list li {
  flex-wrap: nowrap;
  gap: 10px;
  margin: 0;
  padding: 8px 8px 8px 10px;
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  background: #fff;
}

.as-stage .sort-result .sort-share-list li::before {
  display: none;
}

.as-stage .sort-result .sort-share-list .as-av {
  width: 36px;
  height: 36px;
  background: var(--tone-bg);
}

.as-stage .sort-result .sort-share-list .sort-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.93rem;
}

.as-stage .sort-result .sort-share-actions {
  flex: none;
  flex-wrap: nowrap;
  gap: 6px;
}

.as-stage .sort-result .sort-share-actions .sort-btn {
  min-height: 34px;
  padding: 0 9px;
  gap: 6px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 700;
}

.as-stage .sort-result .sort-share-actions .as-bi {
  width: 14px;
  height: 14px;
}

.as-stage .sort-result .as-wa {
  border-color: #bfe8cd;
  background: #e7f7ed;
  color: #15803d;
}

.as-stage .sort-result .as-wa:hover {
  background: #d9f2e2;
}

.as-stage .sort-result .as-away-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e3e9f1;
}

.as-stage .sort-result .as-away-actions .sort-btn {
  min-height: 44px;
  padding: 0 8px;
  gap: 6px;
  border-radius: 12px;
  background: #fff;
  font-size: 0.8rem;
  white-space: nowrap;
}

.as-stage .sort-result .as-away-actions .as-wa-group {
  grid-column: 1 / -1;
  background: #e7f7ed;
}

/* Footer */
.as-stage .sort-result .as-res-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.as-stage .sort-result .as-res-foot [data-again] {
  border: 0;
  background: linear-gradient(180deg, #ff6a26, #ff4f16);
  box-shadow: 0 8px 18px rgba(255, 90, 31, 0.25);
  color: #fff;
}

.as-stage .sort-result .as-res-foot .as-bi {
  width: 18px;
  height: 18px;
}

/* Right side */
.as-side {
  position: relative;
  display: flex;
  flex-direction: column;
}

.as-side > picture {
  width: calc(100% + 70px);
  margin: -30px -100px 22px 30px;
}

.as-tips {
  position: relative;
  z-index: 1;
  padding: 18px 18px 16px;
  border: 1px solid #fbe7bd;
  border-radius: 18px;
  background: #fff8e7;
}

.as-tips h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--as-ink);
}

.as-tips h2::before,
.as-tips h2::after {
  display: none;
}

.as-tips-bulb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffe7a1;
  color: #e09a00;
}

.as-tips-bulb svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.as-tips ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.as-tips li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  font-size: 0.86rem;
  line-height: 1.4;
  color: #334155;
}

.as-tips li::before {
  display: none;
}

.as-check {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f5b400;
  color: #fff;
  flex: none;
}

.as-check svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

/* Dark theme */
.as-stage .as-status {
  margin: 0 0 12px;
  color: var(--as-body);
  font-size: .85rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.as-stage .as-status:empty { display: none; }
.as-stage .as-status.is-error { color: #b42318; border-left: 3px solid currentColor; padding-left: 10px; }
.as-storage-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 18px; color: var(--as-muted); font-size: .78rem; }
.as-storage-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.as-stage .as-storage-bar .sort-file-btn { padding: 7px 10px; font-size: .78rem; cursor: pointer; }
.as-storage-bar input[type="file"] { width: 1px; height: 1px; position: absolute; opacity: 0; }
.as-storage-bar .sort-file-btn:focus-within { outline: 2px solid #2f6fed; outline-offset: 3px; }
.as-stage .as-edit-banner { margin: 0 0 12px; padding: 14px; border: 1px solid #bcd3fb; background: #eef5ff; border-radius: 12px; }
.as-stage .as-edit-banner p { margin: 0 0 10px; font-size: .85rem; }
.as-stage .as-edit-banner .sort-check { margin-bottom: 12px; }
.as-progress { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; font-size: .8rem; color: var(--as-body); }
.as-progress progress { width: 140px; height: 8px; border: 0; border-radius: 20px; overflow: hidden; accent-color: #1f9d55; }
.as-progress progress::-webkit-progress-bar { background: #e1e7ef; }
.as-progress progress::-webkit-progress-value { background: #1f9d55; }
.as-view-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 12px; background: #eef2f7; }
.as-view-tabs button { display: flex; gap: 7px; align-items: center; justify-content: center; min-height: 44px; border: 0; border-radius: 9px; padding: 8px; color: var(--as-body); background: transparent; font: inherit; font-size: .86rem; font-weight: 700; cursor: pointer; }
.as-view-tabs button[aria-selected="true"] { color: var(--as-orange); background: white; box-shadow: 0 1px 5px #10233f15; }
.as-stage .sort-result .sort-share-list { max-height: 510px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; scrollbar-width: thin; }
.as-stage .sort-result .sort-share-list li { display: flex; flex-direction: column; align-items: stretch; gap: 9px; padding: 12px; }
.as-recipient { display: flex; align-items: center; gap: 8px; min-width: 0; }
.as-stage .as-recipient .sort-name { white-space: normal; overflow-wrap: anywhere; flex: 1; }
.as-recipient small { display: block; margin-top: 3px; color: var(--as-muted); font-size: .73rem; font-weight: 400; }
.as-stage .sort-result .sort-share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.as-stage .sort-result .sort-share-actions .sort-btn { padding: 7px 10px; font-size: .78rem; }
.as-stage .sort-result .sort-share-actions .as-select-link { font-size: .72rem; padding-inline: 7px; }
.as-sent-label { display: flex; align-items: center; gap: 7px; width: 100%; font-size: .78rem; color: var(--as-body); cursor: pointer; overflow-wrap: anywhere; }
.as-sent-label input { flex: none; accent-color: #1f9d55; width: 17px; height: 17px; }
.as-stage .sort-result .as-link-input { width: 100%; min-width: 0; font-size: .78rem; }
.as-filter-label { display: block; margin: 12px 0 6px; font-size: .8rem; color: var(--as-body); }
.as-stage .as-test-note { padding: 10px; border-radius: 10px; background: #fff6e5; color: #805b16; font-size: .8rem; line-height: 1.5; }
.as-stage .sort-result .as-organizer-actions { gap: 8px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--as-line); }
.as-stage .sort-result .as-invite-actions { flex-wrap: wrap; gap: 8px; }
.as-dialog { box-sizing: border-box; width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 26px; border: 1px solid #e1e7ef; border-radius: 18px; box-shadow: 0 24px 90px #0004; background: #fff; color: #10233f; overflow-y: auto; }
.as-dialog::backdrop { background: #06152bcc; backdrop-filter: blur(3px); }
.as-stage .as-dialog h2 { margin: 0 0 14px; font-size: 1.35rem; line-height: 1.3; overflow-wrap: anywhere; }
.as-stage .as-dialog p { font-size: .92rem; line-height: 1.6; overflow-wrap: anywhere; }
.as-dialog .sort-result-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.as-dialog #as-reveal-close { margin-top: 16px; width: 100%; }
.as-stage .as-dialog .sort-reveal-to, .as-stage .as-direct-card .sort-reveal-to { font-size: 2rem; line-height: 1.2; font-weight: 800; color: var(--as-orange); margin: 18px 0; overflow-wrap: anywhere; }
.as-all-pairs { padding-left: 22px; line-height: 1.8; overflow-wrap: anywhere; }
.as-stage .as-direct-card { text-align: center; padding: 10px 0; overflow-wrap: anywhere; }
.as-direct-card > .as-res-ico { margin: 0 auto 20px; }
.as-stage .as-direct-card h2 { font-size: 1.6rem; margin: 0 0 20px; }
.as-stage .as-direct-card p { color: var(--as-body); font-size: .95rem; line-height: 1.6; }
.as-direct-card .sort-btn { display: inline-flex; margin: 8px 4px; }
.as-copy-fallback { position: fixed; width: 1px; height: 1px; opacity: 0; }
.as-stage :is(button, a, input, select, textarea):focus-visible { outline: 3px solid #2f6fed; outline-offset: 3px; }
.as-stage .sort-input[aria-invalid="true"], .as-stage .sort-textarea[aria-invalid="true"] { border-color: #c13d32; }
html[data-theme="dark"] .as-stage .as-status.is-error { color: #fca5a5; }
html[data-theme="dark"] .as-stage .as-edit-banner { background: #1d2b42; border-color: #3b5b8f; }
html[data-theme="dark"] .as-stage .as-view-tabs { background: #111827; }
html[data-theme="dark"] .as-stage .as-view-tabs button[aria-selected="true"] { background: #273449; color: #ff8a57; }
html[data-theme="dark"] .as-stage .as-dialog { background: #192436; color: #e8eef6; border-color: #3b4c64; }
html[data-theme="dark"] .as-stage .as-test-note { background: #2a2517; color: #f8ce76; }
html[data-theme="dark"] .as-stage .as-organizer-actions { border-color: var(--dica-border); }
@media (max-width: 640px) {
  .as-view-tabs button { font-size: .78rem; }
  .as-stage .sort-result .sort-share-list { max-height: 480px; }
  .as-stage .sort-result .as-organizer-actions { flex-direction: column; }
  .as-dialog { padding: 20px; }
}

html[data-theme="dark"] .as-stage {
  --as-ink: var(--dica-ink, #e8eef6);
  --as-body: var(--dica-body, #cbd5e1);
  --as-muted: var(--dica-muted, #94a3b8);
}

html[data-theme="dark"] .as-stage::before {
  background:
    radial-gradient(560px 420px at calc(50% - 560px) 82%, rgba(255, 190, 90, 0.09), transparent 70%),
    radial-gradient(520px 420px at calc(50% + 560px) 20%, rgba(255, 190, 90, 0.08), transparent 70%);
}

html[data-theme="dark"] .as-stage .as-card {
  border-color: var(--dica-border);
  background: var(--dica-surface);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .as-stage .sort-input,
html[data-theme="dark"] .as-stage .sort-textarea {
  border-color: var(--dica-border);
  background: var(--dica-surface-soft, #111827);
}

html[data-theme="dark"] .as-stage .sort-list-bar .sort-link,
html[data-theme="dark"] .as-stage .sort-actions .sort-btn-ghost {
  border-color: var(--dica-border);
  background: var(--dica-surface-soft, #1f2937);
  color: var(--as-ink);
}

html[data-theme="dark"] .as-stage .sort-file-btn {
  border-color: #3b5b8f;
  background: rgba(47, 111, 237, 0.14);
  color: #93b8f8;
}

html[data-theme="dark"] .as-step button:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .as-tips {
  border-color: #4a3f22;
  background: #2a2517;
}

html[data-theme="dark"] .as-tips li {
  color: var(--as-body);
}

html[data-theme="dark"] .as-stage input[type="date"] {
  color-scheme: dark;
}

html[data-theme="dark"] .as-sub {
  color: #ff8a57;
}

html[data-theme="dark"] .as-stage [class*="as-tone-"] {
  --tone-bg: color-mix(in srgb, var(--tone) 20%, transparent);
}

html[data-theme="dark"] .as-stage .sort-result .as-res-head,
html[data-theme="dark"] .as-stage .sort-result .sort-share-list li,
html[data-theme="dark"] .as-stage .sort-result .as-away-actions .sort-btn {
  border-color: var(--dica-border);
  background: var(--dica-surface-soft, #1f2937);
  box-shadow: none;
}

html[data-theme="dark"] .as-stage .sort-result .as-room,
html[data-theme="dark"] .as-stage .sort-result .as-away {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .as-stage .sort-result .sort-btn-ghost {
  border-color: var(--dica-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--as-ink);
}

html[data-theme="dark"] .as-stage .sort-result .as-res-edit,
html[data-theme="dark"] .as-res-ico {
  border-color: #3b5b8f;
  background: rgba(47, 111, 237, 0.16);
  color: #93b8f8;
}

html[data-theme="dark"] .as-stage .sort-result .as-wa,
html[data-theme="dark"] .as-stage .sort-result .as-away-actions .as-wa-group,
html[data-theme="dark"] .as-stage .sort-result .sort-reveal a.sort-btn-ghost {
  border-color: #245c3a;
  background: rgba(34, 197, 94, 0.14);
  color: #6ee7a0;
}

html[data-theme="dark"] .as-stage .sort-result .sort-reveal {
  border-color: #6b3a1c;
  background: rgba(255, 106, 38, 0.1);
}

html[data-theme="dark"] .as-stage .sort-result .sort-reveal .sort-list li {
  background: var(--dica-surface-soft, #1f2937);
}

/* Tablet / mobile */
@media (max-width: 1120px) {
  .as-stage {
    grid-template-columns: minmax(190px, 220px) minmax(0, 1fr) minmax(200px, 230px);
    gap: 22px;
  }
  .as-stage .as-card {
    padding: 20px 20px 18px;
  }
}

@media (max-width: 980px) {
  .as-stage {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 6px;
  }
  .as-spark,
  .as-stage picture {
    display: none;
  }
  .as-intro {
    padding-top: 0;
  }
  .as-title {
    margin-bottom: 10px;
    font-size: 2rem;
  }
  .as-lead {
    margin-bottom: 16px;
  }
  .as-points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .as-points li {
    font-size: 0.84rem;
  }
}

@media (max-width: 640px) {
  .as-stage {
    --as-w: calc(100vw - 20px);
  }
  .as-points {
    grid-template-columns: 1fr;
  }
  .as-stage .sort-result .sort-path {
    padding: 14px 10px;
  }
  .as-res-name > span {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .as-stage .as-card {
    padding: 16px 12px;
    border-radius: 18px;
  }
  .as-field {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
  }
  .as-field > .as-ico {
    width: 36px;
    height: 36px;
  }
  .as-field > .as-ico svg {
    width: 18px;
    height: 18px;
  }
  .as-meta {
    grid-template-columns: 1fr;
  }
  .as-label-row {
    flex-wrap: wrap;
  }
  .as-res-head {
    flex-wrap: wrap;
    gap: 10px 12px;
  }
  .as-res-ico {
    width: 44px;
    height: 44px;
  }
  .as-stage .sort-result .as-res-edit {
    width: 100%;
  }
  .as-stage .sort-result .as-away-actions {
    grid-template-columns: 1fr;
  }
  .as-stage .sort-result .as-res-foot {
    flex-direction: column-reverse;
  }
}
