/* Packet A/B pilot — map companion tokens onto splash site.css / brand look.
   Scoped: only affects descendants of .arco-ui (plus light hub-card icon helpers).
   Does not restyle Play/Start Here. */
.arco-ui {
  --arco-bg: var(--bg, #0b0d12);
  --arco-surface: var(--panel, #141820);
  --arco-surface-raised: var(--panel-2, #1a2029);
  --arco-inset: var(--bg-deep, #0e1218);
  --arco-text: var(--ink, #ebe6d8);
  --arco-muted: var(--muted, #9aa3ad);
  --arco-gold: var(--gold, #c9a85c);
  --arco-teal: var(--cyan, #3ec6d8);
  --arco-edge: #667581;
  --arco-line: var(--line, #2a323c);
  --arco-brass: #826c43;
  --arco-focus: var(--cyan, #3ec6d8);
  --arco-radius: var(--radius, 6px);
  font-family: inherit;
}

/* Island spacing vs existing .panel / hub cards — no competing button families. */
.arco-ui.arco-island,
.arco-island.arco-ui {
  margin-block: 1.25rem 0;
}
.community-hub .arco-ui .arco-panel__body .hint { margin-bottom: 0; }
.community-hub .hub-grid { margin-bottom: 0.25rem; }

/* Packet B: brass SVG corners on framed panels (details.css positions .arco-corner). */
.arco-ui .arco-corner > img {
  display: block;
  width: 28px;
  height: 28px;
}

/* Service icons on hub cards (outside .arco-ui — light helper only). */
.hub-card h2 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.hub-card .arco-icon {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--gold, #c9a85c);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
}

/* Wiki: framed primary sits in wiki-main without fighting wiki-side */
.wiki-main > .arco-ui { margin-top: 1rem; }
.wiki-main .arco-ui .wiki-prose > :first-child { margin-top: 0; }

/* Lore / Chronicle prose islands */
.arco-ui.arco-island .prose > :first-child { margin-top: 0; }

/* Reader demo taste (Packet C preview): archive finish, not full reader rewrite */
.arco-ui.arco-reader-chrome .arco-panel--archive .arco-panel__body {
  padding: 0;
}
.arco-ui.arco-reader-chrome .ap-reader-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
}


/* Packet C — public paper reader enlarge + archive dialog hooks */
.arco-ui.arco-reader-chrome .ap-reader-figure {
  cursor: zoom-in;
  position: relative;
}
.arco-ui.arco-reader-chrome .ap-reader-figure::after {
  content: "Enlarge";
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--arco-text, #ebe6d8);
  background: #101316cc;
  border: 1px solid var(--arco-brass, #826c43);
  pointer-events: none;
}
.arco-ui.arco-reader-chrome .ap-reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
}
.arco-ui .ap-archive-gallery a.ap-archive-thumb {
  cursor: zoom-in;
}

/* uistate1 — loading / empty / error splash helpers (works outside .arco-ui islands) */
.ap-ui-state {
  padding: 1.1rem 1.15rem;
  border-inline-start: 2px solid var(--gold, #c9a85c);
  background: rgba(17, 23, 32, 0.92);
  display: grid;
  gap: 0.45rem;
  margin: 0.75rem 0;
  border-radius: 0 4px 4px 0;
}
/* demotaste33 — display:grid must not defeat HTML hidden (false empty under roster) */
.ap-ui-state[hidden] { display: none !important; }

.ap-ui-state--empty { border-inline-start-color: #826c43; }
.ap-ui-state--error { border-inline-start-color: #c98087; }
.ap-ui-state--loading { border-inline-start-color: var(--cyan, #3ec6d8); }
.ap-ui-state--compact { padding: 0.75rem 0.9rem; margin: 0.5rem 0; }
.ap-ui-state__title { margin: 0; font-size: 1rem; font-weight: 600; color: var(--ink, #ebe6d8); }
.ap-ui-state__hint { margin: 0; color: var(--dim, #9aa3ad); font-size: 0.9rem; line-height: 1.4; }
.ap-ui-state__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.15rem; }
.ap-ui-state .ap-empty {
  padding: 0.35rem 0 0;
  justify-items: start;
  text-align: start;
}
.ap-ui-state .ap-empty img { width: min(220px, 64vw); }
.dir-grid > .ap-ui-state { grid-column: 1 / -1; }
.enter-char-list > .ap-ui-state,
.enter-char-list > li.ap-ui-state-wrap { list-style: none; margin: 0; padding: 0; }
.loading-pulse.is-prolonged { flex-wrap: wrap; align-items: flex-start; }
.loading-pulse .ap-loading-recover {
  flex: 1 1 100%;
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  color: var(--dim, #9aa3ad);
  line-height: 1.45;
}
.loading-pulse .ap-loading-recover[hidden] { display: none !important; }
.msg.err.ap-ui-soft {
  border-inline-start: 2px solid #c98087;
  padding: 0.55rem 0.75rem;
  background: rgba(78, 39, 47, 0.28);
  border-radius: 0 4px 4px 0;
}
.msg.ok.ap-ui-soft {
  border-inline-start: 2px solid #9edbc4;
  padding: 0.55rem 0.75rem;
  background: rgba(30, 60, 48, 0.28);
  border-radius: 0 4px 4px 0;
}


/* dept1 — department labels (works outside .arco-ui islands) */
.ap-dept {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  margin: 0 0 0.55rem;
  color: var(--gold, #c9a85c);
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ap-dept > .arco-icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--gold, #c9a85c);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.95;
}
.ap-dept__mark { flex: none; }
.ap-dept__desc {
  flex: none;
  color: var(--dim, #9aa3ad);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: none;
  font-size: 0.78rem;
}
.ap-dept::after {
  content: "";
  height: 1px;
  flex: 1;
  min-width: 16px;
  background: linear-gradient(90deg, #826c43, transparent);
  opacity: 0.78;
}

/* Hero kickers that opt into department chrome */
.ap-section-hero .ap-section-kicker.ap-dept {
  color: rgba(247, 234, 201, 0.88);
  margin: 0 0 0.4rem;
}
.ap-section-hero .ap-section-kicker.ap-dept > .arco-icon {
  color: #e4d19a;
  width: 16px;
  height: 16px;
}
.ap-section-hero .ap-section-kicker.ap-dept .ap-dept__desc {
  color: rgba(247, 234, 201, 0.62);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.ap-section-hero .ap-section-kicker.ap-dept::after {
  background: linear-gradient(90deg, rgba(130, 108, 67, 0.9), transparent);
  opacity: 0.85;
}

/* Portal kickers */
.portal-kicker.ap-dept {
  color: var(--gold, #c9a85c);
}
.portal-kicker.ap-dept .ap-dept__desc {
  color: var(--dim, #9aa3ad);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Wiki page head — dept rail above plain h1 */
.wiki-main > .ap-dept,
.page.wrap > .ap-dept,
main.page > .ap-dept {
  margin: 0.15rem 0 0.65rem;
}
.wiki-crumb + .ap-dept { margin-top: 0.35rem; }
.crumb + .ap-dept { margin-top: 0.35rem; }

/* dept1 — wiki section seams (brass tick divider language) */
.arco-ui .wiki-prose > h2 {
  border-top: 0 !important;
  margin-top: 1.85rem;
  padding-top: 1.15rem;
  position: relative;
  letter-spacing: 0.035em;
}
.arco-ui .wiki-prose > h2:first-of-type {
  margin-top: 1.1rem;
  padding-top: 0.15rem;
}
.arco-ui .wiki-prose > h2:not(:first-of-type)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 9px;
  background:
    linear-gradient(#826c43, #826c43) center / 100% 1px no-repeat,
    linear-gradient(#826c43, #826c43) left center / 1px 9px no-repeat;
  opacity: 0.55;
  pointer-events: none;
}
.arco-ui .wiki-prose > .wiki-toc + h2 {
  margin-top: 1.35rem;
}
.arco-ui .wiki-prose > hr.arco-divider {
  margin: 0.85rem 0 1.1rem;
}
.arco-ui .wiki-prose > .wiki-related,
.wiki-prose > .wiki-related {
  border-top: 0;
  margin-top: 2rem;
  padding-top: 1.25rem;
  position: relative;
}
.arco-ui .wiki-prose > .wiki-related::before,
.wiki-prose > .wiki-related::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 9px;
  background:
    linear-gradient(#826c43, #826c43) center / 100% 1px no-repeat,
    linear-gradient(#826c43, #826c43) left center / 1px 9px no-repeat;
  opacity: 0.5;
  pointer-events: none;
}

/* Account tabs — brass active notch (S polish) */
.acct-subnav {
  border-bottom-color: rgba(130, 108, 67, 0.35);
}
.acct-subnav a.is-active,
.acct-subnav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 #c9a85c, 0 0 12px rgba(201, 168, 92, 0.08);
}
