/* ============================================================
   루드라 통합디코 — 공용 컴포넌트
   ============================================================ */

/* ---------- App shell ---------- */
.app {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top right, rgba(139, 126, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(94, 226, 245, 0.05) 0%, transparent 50%),
    var(--bg-base);
  color: var(--text);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  background: color-mix(in srgb, var(--bg-base) 80%, transparent);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--s-6);
  height: 56px;
  display: flex;
  align-items: center;
  gap: var(--s-6);
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: -0.02em;
  font-size: 14px;
}
.site-header__brand .mark {
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  background: var(--accent-grad);
  border-radius: 6px;
  color: #0B0D1A;
  font-weight: 900;
  font-size: 13px;
  box-shadow: 0 0 20px rgba(139,126,255,0.35);
  position: relative;
}
.site-header__brand .mark::after {
  /* 판타지 모티프: 내부 다이아몬드 */
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(11,13,26,0.5);
  transform: rotate(45deg);
  border-radius: 2px;
}
.site-header__env {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  color: var(--accent-amber);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.site-header__nav {
  display: flex;
  gap: var(--s-1);
  flex: 1;
  margin-left: var(--s-6);
}
.site-header__nav a {
  padding: 7px 12px;
  border-radius: var(--r-sm);
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--dur-fast) var(--ease);
  position: relative;
  white-space: nowrap;
  word-break: keep-all;
}
.site-header__nav a:hover { color: var(--text-hi); background: var(--bg-raised); }
.site-header__nav a.active {
  color: var(--text-hi);
  background: var(--bg-raised);
}
.site-header__nav a.active::before {
  content: '';
  position: absolute;
  left: 10px; right: 10px;
  bottom: -1px;
  height: 2px;
  background: var(--accent-grad);
  border-radius: 2px 2px 0 0;
}

/* ---- Header nav: grouped dropdown (admin) ----
   The trigger button is styled to match the flat nav anchors so the row
   stays visually uniform whether an item is a direct link or a group.
   The menu is absolutely positioned and only displayed when the group
   has the .is-open class (toggled by app.js). */
.nav-group { position: relative; display: inline-flex; }
.nav-group__trigger {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  word-break: keep-all;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--dur-fast) var(--ease);
}
.nav-group__trigger:hover { color: var(--text-hi); background: var(--bg-raised); }
.nav-group__trigger.is-active,
.nav-group.is-open > .nav-group__trigger {
  color: var(--text-hi);
  background: var(--bg-raised);
}
.nav-group__chev {
  font-size: 9px;
  opacity: 0.65;
  transition: transform var(--dur-fast) var(--ease);
}
.nav-group.is-open .nav-group__chev { transform: rotate(180deg); }

.nav-group__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.4));
  padding: 4px;
  z-index: 100;
}
/* `hidden` attribute alone is defeated by the absolute-positioned class
   above (same display-property gotcha as the notification bell badge);
   force display:none here to keep the menu actually closed. */
.nav-group__menu[hidden] { display: none !important; }
.nav-group__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.nav-group__item:hover { color: var(--text-hi); background: var(--bg-base); }
.nav-group__item.active {
  color: var(--text-hi);
  background: var(--bg-base);
  position: relative;
}
.nav-group__item.active::before {
  content: '';
  position: absolute;
  left: 4px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--accent-grad);
  border-radius: 2px;
}
.site-header__right {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  /* `margin-left: auto` pushes the right rail to the right edge even when the
     nav (which carries `flex: 1`) is hidden — e.g. on mobile (≤720px). On
     desktop the nav already absorbs all spare space so this is a no-op. */
  margin-left: auto;
}

/* ---------- Role switcher (4-tier) ---------- */
.role-switcher {
  display: inline-flex;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 2px;
  gap: 1px;
}
.role-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  border-radius: 3px;
  white-space: nowrap;
  word-break: keep-all;
  flex-shrink: 0;
  transition: all var(--dur-fast);
}
.role-switcher__btn:hover {
  color: var(--text-hi);
  background: rgba(255,255,255,0.03);
}
.role-switcher__btn.is-active {
  background: var(--bg-elevated);
  color: var(--text-hi);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2),
              inset 0 0 0 1px var(--role-color, var(--accent-cyan));
}
.role-switcher__glyph {
  font-size: 11px;
  line-height: 1;
}
.role-switcher__label {
  letter-spacing: 0.2px;
  white-space: nowrap;
  word-break: keep-all;
}
@media (max-width: 1200px) {
  .role-switcher__label {
    display: none;
  }
  .role-switcher__btn {
    padding: 4px 7px;
  }
  .role-switcher__glyph {
    font-size: 13px;
  }
}

/* ---------- User menu button ---------- */
.usermenu {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  /* Match the notif/theme button corner radius so the right rail reads as
     a single visual family (was 999px pill — felt mismatched next to the
     small-radius alert square). */
  border-radius: var(--r-sm);
  transition: all var(--dur-fast);
}
.usermenu:hover { border-color: var(--line-strong); background: var(--bg-raised); }
.usermenu .avatar {
  width: 24px; height: 24px;
  /* Same `--r-sm` family — small rounded square — so the avatar matches
     the bell's silhouette instead of being a perfect circle. */
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--accent-grad);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #0B0D1A;
}
.usermenu .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.usermenu .name { font-size: 12px; color: var(--text); font-weight: 500; display: inline-flex; gap: 4px; align-items: baseline; }
.usermenu__class { font-size: 10px; color: var(--text-muted); font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-mid);
  transition: all var(--dur-fast);
}
.theme-toggle:hover { color: var(--text-hi); border-color: var(--line-strong); }

/* ---------- Page frame ---------- */
.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--s-8) var(--s-6) var(--s-16);
}
.page--narrow { max-width: 1100px; }
.page--wide { max-width: 1600px; }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
  margin-bottom: var(--s-8);
  flex-wrap: wrap;
}

/* ---- Atmospheric banner variant ----
   Adds a wide background image with multi-layer gradient overlays so the
   banner fades into the page bg on the bottom + sides. The banner sits in
   its own clipping container (::before) under the text content (::after =
   gradient mask), so the eyebrow/title/subtitle stay crisply legible.
   Per-page background is set via a modifier class (e.g. .page-header--banner-rift). */
.page-header--banner {
  position: relative;
  isolation: isolate;
  align-items: flex-start;
  padding: 28px 28px 24px;
  margin-bottom: var(--s-6);
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 180px;
  /* 좌우 끝선이 페이지 컨텐츠(투표 카드, 리스트) 와 정확히 같은 폭으로 맞춰
     수직 정렬이 깨지지 않게 음수 margin 사용 안 함. */
}
.page-header--banner > * { position: relative; z-index: 2; }
.page-header--banner::before {
  content: "";
  position: absolute; inset: 0;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: brightness(0.85) saturate(1.1);
  z-index: 0;
  /* Gentle parallax-ish scale so blurred edges don't show seams. */
  transform: scale(1.08);
}
.page-header--banner::after {
  content: "";
  position: absolute; inset: 0;
  background:
    /* Bottom-fade: banner blends into page bg-base. */
    linear-gradient(180deg,
      rgba(11, 13, 26, 0.05) 0%,
      rgba(11, 13, 26, 0.45) 55%,
      var(--bg-base) 100%),
    /* Right-fade: title sits on the left, banner light on the right. */
    linear-gradient(90deg,
      rgba(11, 13, 26, 0.85) 0%,
      rgba(11, 13, 26, 0.45) 35%,
      rgba(11, 13, 26, 0.10) 65%,
      rgba(11, 13, 26, 0.00) 100%);
  z-index: 1;
}
:root[data-theme="light"] .page-header--banner::after {
  background:
    linear-gradient(180deg,
      rgba(245, 246, 251, 0.08) 0%,
      rgba(245, 246, 251, 0.55) 55%,
      var(--bg-base) 100%),
    linear-gradient(90deg,
      rgba(245, 246, 251, 0.92) 0%,
      rgba(245, 246, 251, 0.55) 35%,
      rgba(245, 246, 251, 0.15) 65%,
      rgba(245, 246, 251, 0.00) 100%);
}
.page-header--banner-artisan::before {
  background-image: image-set(
    url('/static/img/banners/banner-artisan.webp') type('image/webp'),
    url('/static/img/banners/banner-artisan.png')  type('image/png')
  );
  /* Fallback for browsers that don't grok image-set's type() */
  background-image: url('/static/img/banners/banner-artisan.png');
  background-image: -webkit-image-set(
    url('/static/img/banners/banner-artisan.webp') 1x,
    url('/static/img/banners/banner-artisan.png')  1x
  );
}
.page-header--banner-rift::before {
  background-image: image-set(
    url('/static/img/banners/banner-rift.webp') type('image/webp'),
    url('/static/img/banners/banner-rift.png')  type('image/png')
  );
  background-image: url('/static/img/banners/banner-rift.png');
  background-image: -webkit-image-set(
    url('/static/img/banners/banner-rift.webp') 1x,
    url('/static/img/banners/banner-rift.png')  1x
  );
}
@media (max-width: 720px) {
  .page-header--banner {
    padding: 20px 16px 18px;
    min-height: 140px;
  }
  .page-header--banner::after {
    background:
      linear-gradient(180deg,
        rgba(11, 13, 26, 0.12) 0%,
        rgba(11, 13, 26, 0.55) 55%,
        var(--bg-base) 100%),
      /* On mobile the title fills the row — keep more darken across the
         whole banner so text never battles a busy spot. */
      linear-gradient(90deg,
        rgba(11, 13, 26, 0.78) 0%,
        rgba(11, 13, 26, 0.45) 100%);
  }
}
.page-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-hi);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.page-title .glyph {
  color: var(--accent-violet);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 400;
  opacity: 0.7;
}
.page-subtitle {
  color: var(--text-mid);
  margin-top: var(--s-2);
  font-size: 13px;
}
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-violet);
  margin-bottom: var(--s-2);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.page-eyebrow::before {
  content: '';
  width: 16px;
  height: 1px;
  background: var(--accent-violet);
}

/* ---------- Card ---------- */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
  position: relative;
  transition: border-color var(--dur-fast);
}
.card--sheen { background: var(--bg-raised) var(--panel-sheen); background-repeat: no-repeat; background-size: 100% 60px; }
.card--hover:hover { border-color: var(--line-strong); }
.card__head {
  padding: var(--s-4) var(--s-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  border-bottom: 1px solid var(--line-soft);
}
/* When a card supplies its own outer padding via inline style="padding: ..."
   (a project convention used heavily on /app/me + party detail), the
   .card__head's own horizontal padding ends up doubled — title text drifts
   ~20px right of body content. Zero out head's horizontal padding (and the
   body separator) so head and body share the same left/right column.
   Vertical padding kept so head still has breathing room above title. */
.card[style*="padding"] > .card__head {
  padding-left: 0;
  padding-right: 0;
  border-bottom: none;
}
.card__head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-hi);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.card__head h3 .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-violet);
  box-shadow: 0 0 8px var(--accent-violet);
}
.card__body { padding: var(--s-5); }
.card__foot {
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--text-mid);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0 14px;
  height: 34px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all var(--dur-fast);
  border: 1px solid transparent;
  white-space: nowrap;
  word-break: keep-all;
}
.site-header__brand,
.usermenu .name,
.page-title,
.hero__title,
.party-card__title,
.empty__title {
  word-break: keep-all;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn--lg { height: 40px; padding: 0 20px; font-size: 14px; }
.btn--icon { width: 34px; padding: 0; }

.btn--primary {
  background: var(--accent-violet);
  color: #0B0D1A;
  border-color: var(--accent-violet);
  position: relative;
  overflow: hidden;
}
.btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-grad);
  z-index: 0;
}
.btn--primary > * { position: relative; z-index: 1; }
.btn--primary:hover { filter: brightness(1.1); box-shadow: 0 0 20px rgba(139,126,255,0.35); }
.btn--primary:active { filter: brightness(0.95); }

.btn--secondary {
  background: var(--bg-raised);
  color: var(--text-hi);
  border-color: var(--line-strong);
}
.btn--secondary:hover { background: var(--bg-elevated); border-color: var(--line-accent); }

.btn--ghost {
  color: var(--text-mid);
}
.btn--ghost:hover { background: var(--bg-raised); color: var(--text-hi); }

.btn--danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(242, 109, 109, 0.3);
}
.btn--danger:hover { background: rgba(242, 109, 109, 0.12); border-color: var(--danger); }

.btn--discord {
  background: #5865F2;
  color: white;
  border-color: #5865F2;
}
.btn--discord:hover { background: #6971F5; }

/* ---- Guild-invite CTA (landing hero) ----
   "강력한" 진입 버튼 — Discord brand blurple + soft glow + 미세 광택
   pulse 로 시각적 우선권. 다른 버튼들 옆에 같은 행에 배치되어도 한눈에
   "이게 가장 중요" 임이 보이도록 약간 키운 폰트/패딩.
*/
.btn--guild {
  position: relative; overflow: hidden;
  height: 38px; padding: 0 18px;
  background: linear-gradient(135deg, #5865F2 0%, #404EED 100%);
  color: #fff !important;
  border: 1px solid #4752C4;
  font-size: 14px; font-weight: 700;
  box-shadow:
    0 6px 20px -4px rgba(88, 101, 242, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  text-decoration: none;
  transition: all var(--dur-fast);
}
.btn--guild:hover {
  background: linear-gradient(135deg, #6971F5 0%, #5765F2 100%);
  border-color: #5865F2;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -6px rgba(88, 101, 242, 0.6);
}
.btn--guild:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px -4px rgba(88, 101, 242, 0.5);
}
/* Slow shimmer band — subtle "이게 핵심 CTA" 신호. 아티쟁 추천 버튼과
   동일한 nudge-shimmer 키프레임 재사용. */
.btn--guild::before {
  content: '';
  position: absolute; top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg,
    transparent 0%, rgba(255,255,255,0) 30%,
    rgba(255,255,255,0.32) 50%, rgba(255,255,255,0) 70%, transparent 100%);
  transform: skewX(-22deg);
  animation: nudge-shimmer 4.2s ease-in-out infinite;
  pointer-events: none;
}
.btn--guild > * { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .btn--guild::before { animation: none; }
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Sync-button cooldown — visually distinct from generic disabled. The
   button stays interactive-looking but inert; the label becomes a live
   "X초" remaining counter so the user can see when the next sync is
   allowed. Used by the home (profile) sync forms + landing/artisan AJAX
   sync. Targets `.btn.is-cooldown` and `[data-pvp-sync].is-cooldown` so
   both styles converge on one rule. */
.btn.is-cooldown,
[data-pvp-sync].is-cooldown {
  opacity: 0.7;
  color: var(--text-mid);
  cursor: not-allowed;
  font-variant-numeric: tabular-nums;
}

/* Invisible placeholder — keeps the action-cluster width identical between
   rows that have ★/🗑 buttons (alts) and rows that don't (rep). Same
   .btn--sm sizing so layout calc treats it identically; hidden with
   `visibility: hidden` so screen readers + click handlers ignore it. */
.sync-slot-placeholder {
  visibility: hidden;
  pointer-events: none;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  height: 22px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--r-xs);
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.badge--role-admin { background: rgba(255, 107, 107, 0.12); color: #FF6B6B; border-color: rgba(255, 107, 107, 0.35); }
.badge--role-order { background: rgba(255, 181, 71, 0.12); color: #FFB547; border-color: rgba(255, 181, 71, 0.35); }
.badge--role-gundanjang { background: rgba(91, 229, 232, 0.12); color: var(--accent-cyan); border-color: rgba(91, 229, 232, 0.35); }
.badge--role-member { background: rgba(139, 126, 255, 0.12); color: var(--role-member); border-color: rgba(139, 126, 255, 0.3); }
.badge--role-guest { background: rgba(98, 106, 146, 0.15); color: var(--role-guest); border-color: rgba(98, 106, 146, 0.3); }

/* ---------- Role badge + popover ---------- */
.role-badge-wrap {
  position: relative;
  display: inline-block;
}
.role-badge {
  border: 1px solid currentColor;
  background: transparent;
  font-family: inherit;
  padding: 3px 8px;
  transition: all var(--dur-fast);
}
.role-badge--multi {
  padding-right: 4px;
}
.role-badge--multi:hover,
.role-badge.is-open {
  filter: brightness(1.15);
  box-shadow: 0 0 0 2px currentColor inset;
}
.role-badge__plus {
  margin-left: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  background: currentColor;
  border-radius: 3px;
  line-height: 1;
}
.role-badge__plus::before {
  content: '';
}
.role-badge__plus {
  color: var(--bg-base);
}
.role-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 1000;
  animation: role-pop .12s ease-out;
}
@keyframes role-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.role-popover__head {
  padding: 8px 12px;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
  background: var(--bg-inset);
  border-radius: var(--r) var(--r) 0 0;
}
.role-popover__list {
  padding: 4px 0;
}
.role-popover__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
}
.role-popover__item + .role-popover__item {
  border-top: 1px dashed var(--line);
}
.role-popover__item.is-primary {
  background: var(--bg-inset);
}
.role-popover__glyph {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.4;
  flex: none;
  width: 20px;
  text-align: center;
}
.role-popover__body { flex: 1; min-width: 0; }
.role-popover__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-hi);
  display: flex;
  align-items: center;
  gap: 8px;
}
.role-popover__tag {
  font-size: 9px;
  letter-spacing: 1px;
  padding: 1px 5px;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  border-radius: 3px;
  font-weight: 500;
}
.role-popover__desc {
  font-size: 11px;
  color: var(--text-mid);
  margin-top: 2px;
  word-break: keep-all;
}

.badge--status-open { background: rgba(93, 210, 159, 0.12); color: var(--ok); border-color: rgba(93, 210, 159, 0.3); }
.badge--status-closed { background: rgba(98, 106, 146, 0.15); color: var(--text-mid); border-color: rgba(98, 106, 146, 0.3); }
.badge--status-cancel { background: rgba(242, 109, 109, 0.12); color: var(--danger); border-color: rgba(242, 109, 109, 0.3); }
.badge--status-pending { background: rgba(232, 178, 74, 0.12); color: var(--warn); border-color: rgba(232, 178, 74, 0.3); }

.badge--neutral { background: var(--bg-inset); color: var(--text-mid); border-color: var(--line); }
.badge--accent { background: var(--accent-grad-soft); color: var(--accent-violet-strong); border-color: var(--line-accent); }

/* ---------- Legion badge (hash based) ---------- */
.legion {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 6px;
  height: 22px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--r-xs);
  color: var(--legion-fg, var(--text-hi));
  background: var(--legion-bg, rgba(148,163,220,0.1));
  border: 1px solid var(--legion-border, var(--line));
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
  flex-shrink: 0;
}
.legion::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: var(--legion-accent, currentColor);
  flex-shrink: 0;
}

/* ---------- Class chip (직업) ---------- */
.cls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px 2px 5px;
  height: 20px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--r-xs);
  border: 1px solid;
  font-family: var(--font-sans);
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;
  flex-shrink: 0;
}
.cls__glyph {
  width: 14px; height: 14px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  border-radius: 3px;
  color: inherit;
}
.cls--tank { color: var(--cls-tank); background: var(--cls-tank-bg); border-color: rgba(79,169,255,0.3); }
.cls--dps { color: var(--cls-dps); background: var(--cls-dps-bg); border-color: rgba(255,122,89,0.3); }
.cls--support { color: var(--cls-support); background: var(--cls-support-bg); border-color: rgba(93,210,159,0.3); }

/* ---------- Inputs ---------- */
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  color: var(--text-hi);
  border-radius: var(--r-sm);
  padding: 0 12px;
  height: 36px;
  font-size: 13px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(139,126,255,0.15);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239099C4' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.field-error { font-size: 11px; color: var(--danger); margin-top: 4px; display: flex; align-items: center; gap: 4px; }

/* ---------- Radio chips ---------- */
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--dur-fast);
  user-select: none;
  white-space: nowrap;
  word-break: keep-all;
}
.chip-radio:hover { color: var(--text-hi); border-color: var(--line-strong); }
.chip-radio.is-active {
  color: var(--text-hi);
  background: var(--bg-elevated);
  border-color: var(--line-accent);
  box-shadow: inset 0 0 0 1px rgba(139,126,255,0.15);
}
.chip-radio .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

/* ---------- Avatar ---------- */
.avatar {
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  color: #0B0D1A;
  background: var(--accent-grad);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  font-family: var(--font-sans);
}
.avatar--xs { width: 20px; height: 20px; font-size: 9px; }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar--md { width: 36px; height: 36px; font-size: 12px; }
.avatar--lg { width: 48px; height: 48px; font-size: 16px; border-radius: 10px; }

/* ---------- KPI ---------- */
.kpi {
  padding: var(--s-5);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--accent-grad-line);
  opacity: 0;
  transition: opacity var(--dur);
}
.kpi:hover::before { opacity: 1; }
.kpi__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: var(--s-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kpi__value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 600;
  color: var(--text-hi);
  letter-spacing: -0.03em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.kpi__value .unit {
  font-size: 14px;
  color: var(--text-mid);
  font-weight: 500;
}
.kpi__trend {
  margin-top: var(--s-3);
  font-size: 11px;
  color: var(--text-mid);
  font-family: var(--font-mono);
}
.kpi__trend.up { color: var(--ok); }
.kpi__trend.down { color: var(--danger); }

/* ---------- Table ---------- */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-raised);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data thead th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-inset);
  color: var(--text-mid);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background var(--dur-fast); }
table.data tbody tr:hover { background: var(--bg-elevated); }

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed;
  right: var(--s-6);
  bottom: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  z-index: 90;
  max-width: 360px;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-hi);
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  box-shadow: var(--shadow-lg);
  animation: toast-in 280ms var(--ease-out);
  min-width: 260px;
}
.toast .icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast--ok { border-left: 3px solid var(--ok); }
.toast--ok .icon { color: var(--ok); }
.toast--err { border-left: 3px solid var(--danger); }
.toast--err .icon { color: var(--danger); }
.toast--info { border-left: 3px solid var(--accent-violet); }
.toast--info .icon { color: var(--accent-violet); }
.toast__msg { font-size: 12px; color: var(--text-mid); margin-top: 2px; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 15, 0.7);
  backdrop-filter: blur(6px);
  z-index: 80;
  display: grid;
  place-items: center;
  padding: var(--s-4);
  animation: fade-in 200ms ease;
}
.modal {
  width: 100%;
  max-width: 440px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  animation: modal-in 240ms var(--ease-out);
}
.modal__head { padding: var(--s-5) var(--s-5) 0; display: flex; justify-content: space-between; align-items: center; }
.modal__head h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text-hi); }
.modal__body { padding: var(--s-4) var(--s-5); color: var(--text); font-size: 13px; line-height: 1.55; }
.modal__foot { padding: var(--s-3) var(--s-5) var(--s-5); display: flex; gap: var(--s-2); justify-content: flex-end; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---------- Empty state ---------- */
.empty {
  padding: var(--s-10);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r);
}
.empty__glyph {
  width: 56px; height: 56px;
  margin: 0 auto var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  color: var(--text-faint);
  font-size: 22px;
  background: var(--bg-inset);
  position: relative;
}
.empty__glyph::after {
  /* 판타지 모티프: 모서리 마커 */
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid var(--line-accent);
  border-radius: var(--r);
  opacity: 0.2;
  pointer-events: none;
}
.empty__title { font-size: 14px; font-weight: 600; color: var(--text-hi); margin-bottom: 4px; }
.empty__msg { font-size: 12px; color: var(--text-mid); max-width: 320px; margin: 0 auto var(--s-4); }

/* ---------- Progress / meter ---------- */
.meter {
  height: 6px;
  background: var(--bg-inset);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
}
.meter__seg { height: 100%; transition: width var(--dur-slow) var(--ease); }
.meter__seg--tank { background: var(--cls-tank); }
.meter__seg--dps { background: var(--cls-dps); }
.meter__seg--support { background: var(--cls-support); }
.meter__seg--ok { background: var(--ok); }
.meter__seg--warn { background: var(--warn); }
.meter__seg--violet { background: var(--accent-violet); }
.meter__seg--cyan { background: var(--accent-cyan); }
.meter__seg--mid { background: var(--text-mid); opacity: 0.5; }

/* ---------- Icon button ---------- */
.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--text-mid);
  transition: all var(--dur-fast);
  border: 1px solid transparent;
}
.icon-btn:hover { color: var(--text-hi); background: var(--bg-raised); border-color: var(--line); }

.tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--bg-inset);
  padding: 3px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.tab {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  border-radius: var(--r-xs);
  transition: all var(--dur-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  word-break: keep-all;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text-hi); background: var(--bg-elevated); box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.tab .count {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  background: var(--bg-base);
  border-radius: 999px;
  color: var(--text-mid);
}

/* ---------- Mobile tabbar (유저) ---------- */
.mobile-tabbar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: color-mix(in srgb, var(--bg-base) 90%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 50;
  height: 60px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.mobile-tabbar__inner { display: grid; grid-template-columns: repeat(4, 1fr); height: 100%; }
.mobile-tabbar a,
.mobile-tabbar__more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  color: var(--text-mid);
  border-radius: var(--r-sm);
  /* Reset button defaults so .mobile-tabbar__more matches the anchor look. */
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 2px;
}
.mobile-tabbar a.active { color: var(--accent-violet); }
.mobile-tabbar a svg,
.mobile-tabbar__more svg { width: 20px; height: 20px; }
body.is-admin-drawer-open .mobile-tabbar__more { color: var(--accent-violet); }

/* ---- Admin drawer (mobile) ----
   Slides in from the right with a scrim. Only visible at <=768px;
   above that, the desktop dropdown nav covers the same surface. The
   drawer markup is always in the DOM so we can just toggle a body class
   to open it without rerendering anything. */
.admin-drawer { display: none; }
.admin-drawer[hidden] { display: none; }
@media (max-width: 768px) {
  .admin-drawer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
  }
  body.is-admin-drawer-open .admin-drawer { pointer-events: auto; }
  body.is-admin-drawer-open .admin-drawer[hidden] {
    /* Override the SSR `hidden` once the user opens the drawer — we keep
       the attribute on by default so non-JS / pre-hydration loads don't
       flash the panel into view. */
    display: block !important;
  }

  .admin-drawer__scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 180ms var(--ease, ease);
  }
  body.is-admin-drawer-open .admin-drawer__scrim { opacity: 1; }

  .admin-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(86vw, 320px);
    background: var(--bg-base);
    border-left: 1px solid var(--line);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.4);
    transform: translateX(100%);
    transition: transform 220ms var(--ease, ease);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
  }
  body.is-admin-drawer-open .admin-drawer__panel { transform: translateX(0); }
}

.admin-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.admin-drawer__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-amber);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.admin-drawer__close {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-mid);
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  border-radius: var(--r-sm);
}
.admin-drawer__close:hover { color: var(--text-hi); background: var(--bg-raised); }

.admin-drawer__nav {
  flex: 1;
  padding: 8px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-drawer__group {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-drawer__group:first-of-type { border-top: 0; padding-top: 0; margin-top: 8px; }
.admin-drawer__group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px 4px;
}
.admin-drawer__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text-mid);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.admin-drawer__link:hover { color: var(--text-hi); background: var(--bg-raised); }
.admin-drawer__link.active {
  color: var(--text-hi);
  background: var(--bg-raised);
  font-weight: 600;
}
.admin-drawer__link--danger { color: var(--danger); }
.admin-drawer__bullet { color: var(--text-dim); font-size: 14px; }

.admin-drawer__foot {
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .site-header__inner { padding: 0 var(--s-4); gap: var(--s-3); }
  .site-header__nav { display: none; }
  .site-header__env { display: none; }
  .page { padding: var(--s-5) var(--s-4) 80px; }
  .page-title { font-size: 22px; }
  .mobile-tabbar { display: block; }
  .usermenu .name { display: none; }
  .kpi__value { font-size: 26px; }
}

/* ---------- Utility ---------- */
.stack { display: flex; flex-direction: column; }
.stack--2 { gap: var(--s-2); }
.stack--3 { gap: var(--s-3); }
.stack--4 { gap: var(--s-4); }
.stack--5 { gap: var(--s-5); }
.stack--6 { gap: var(--s-6); }
.row { display: flex; align-items: center; }
.row--2 { gap: var(--s-2); }
.row--3 { gap: var(--s-3); }
.row--4 { gap: var(--s-4); }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.text-mid { color: var(--text-mid); }
.text-dim { color: var(--text-dim); }
.text-hi { color: var(--text-hi); }
.meta { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Consent flow (pre-auth gate page) ---------- */
.consent-page { max-width: 880px; }
.consent-form { display: flex; flex-direction: column; gap: var(--s-3); }

/* Two bulk options side by side. "전체 동의" gets a sparkle/shimmer
   treatment to draw the eye without heavy-handed marketing copy; the
   "필수만" button is a neutral ghost so the choice still feels open.

   Grid (instead of flex) guarantees the two columns split evenly even
   with the sparkle/shadow ornaments on the gradient button — flex was
   measuring intrinsic content width and tilting the split. */
.consent-bulk-choice { padding: var(--s-4) var(--s-5); }
.consent-bulk-choice__buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
.consent-bulk-choice__btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

/* Two-row legend underneath. Plain typography, no chips — the previous
   chip styling clashed with the dark card background and broke the
   center-aligned wrap. */
.consent-bulk-choice__notes {
  list-style: none; padding: 0;
  margin: var(--s-4) auto 0;
  max-width: 60ch;
  display: flex; flex-direction: column; gap: var(--s-2);
}
.consent-bulk-choice__note-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: baseline;
  gap: var(--s-3);
  font-size: 12px; line-height: 1.65;
  color: var(--text-mid);
}
.consent-bulk-choice__note-label {
  display: inline-flex; align-items: center; justify-content: center;
  height: 18px; padding: 0 6px;
  border-radius: var(--r-xs);
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  text-align: center;
}
.consent-bulk-choice__note-label--optional {
  color: var(--text-mid);
  background: rgba(98,106,146,0.12);
  border: 1px solid var(--line);
}
.consent-bulk-choice__note-label--core {
  color: var(--accent-cyan);
  background: rgba(94,234,212,0.10);
  border: 1px solid rgba(94,234,212,0.25);
}
.consent-bulk-choice__note-text { word-break: keep-all; overflow-wrap: break-word; }

/* "전체 동의" button — shimmer band sweeps across, sparkles flicker, and
   the box-shadow softly breathes. No copy upsell, just visual delight. */
.consent-bulk-choice__btn--all {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-violet) 0%, var(--accent-cyan) 100%);
  border: none;
  color: #0B0D1A;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 18px rgba(139,126,255,0.32), 0 0 0 1px rgba(139,126,255,0.4);
  animation: consent-all-breathe 2.6s ease-in-out infinite;
}
.consent-bulk-choice__btn--all:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
/* Shimmer band — diagonal white sheen sweeping left → right every 3s. */
.consent-bulk-choice__btn--all::before {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255,255,255,0) 30%,
    rgba(255,255,255,0.55) 50%,
    rgba(255,255,255,0) 70%,
    transparent 100%
  );
  transform: skewX(-22deg);
  animation: consent-all-shimmer 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes consent-all-breathe {
  0%, 100% {
    box-shadow: 0 4px 18px rgba(139,126,255,0.32), 0 0 0 1px rgba(139,126,255,0.4);
  }
  50% {
    box-shadow: 0 6px 28px rgba(139,126,255,0.55), 0 0 0 1px rgba(139,126,255,0.6);
  }
}
@keyframes consent-all-shimmer {
  0%   { left: -120%; }
  60%  { left: 120%; }
  100% { left: 120%; }
}

/* Twinkling sparkle stars on either side of the label. */
.consent-shimmer__spark {
  display: inline-block;
  font-size: 11px;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 0 6px rgba(255,255,255,0.7), 0 0 10px rgba(94,234,212,0.5);
  animation: consent-spark-twinkle 1.6s ease-in-out infinite;
  margin-right: 2px;
}
.consent-shimmer__spark--right {
  margin-right: 0; margin-left: 2px;
  animation-delay: 0.8s;
}
@keyframes consent-spark-twinkle {
  0%, 100% { opacity: 0.45; transform: scale(0.85) rotate(0deg); }
  50%      { opacity: 1;    transform: scale(1.15) rotate(180deg); }
}

@media (prefers-reduced-motion: reduce) {
  .consent-bulk-choice__btn--all,
  .consent-bulk-choice__btn--all::before,
  .consent-shimmer__spark { animation: none; }
}

.btn--xl { height: 48px; padding: 0 28px; font-size: 15px; font-weight: 700; }

/* One-shot pulse fired on the submit button right after the bulk-check
   trigger fires — the page just scrolled to it, this attracts the eye for
   ~1.8s so the user knows what to click next. */
.btn.is-flash {
  animation: consent-submit-flash 0.6s ease-in-out 3;
}
@keyframes consent-submit-flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,126,255,0.0), 0 4px 16px rgba(139,126,255,0.2); transform: scale(1); }
  50%      { box-shadow: 0 0 0 8px rgba(139,126,255,0.18), 0 6px 28px rgba(139,126,255,0.45); transform: scale(1.03); }
}

.consent-check { display: inline-flex; align-items: flex-start; gap: var(--s-2); cursor: pointer; user-select: none; font-size: 13px; line-height: 1.5; }
.consent-check input[type="checkbox"] { margin-top: 2px; cursor: pointer; }
.consent-check--doc { padding: var(--s-3) var(--s-4); border-top: 1px dashed var(--line); margin-top: 0; }

.consent-doc { padding: 0; overflow: hidden; }
.consent-doc[open] { border-color: var(--line-strong); }
.consent-doc__head {
  list-style: none; cursor: pointer;
  padding: var(--s-3) var(--s-4);
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-3);
}
.consent-doc__head::-webkit-details-marker { display: none; }
.consent-doc__title-wrap { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.consent-doc__badge {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: var(--r-xs);
  letter-spacing: 0.04em;
}
.consent-doc__badge.is-required { background: rgba(255,107,107,0.15); color: #FF6B6B; border: 1px solid rgba(255,107,107,0.3); }
.consent-doc__badge.is-optional { background: rgba(98,106,146,0.12); color: var(--text-mid); border: 1px solid var(--line); }
.consent-doc__title { font-weight: 600; color: var(--text-hi); font-size: 14px; }
.consent-doc__status { font-size: 11px; padding: 2px 6px; border-radius: var(--r-xs); display: inline-flex; align-items: center; gap: 3px; }
.consent-doc__status.is-agreed { color: var(--accent-cyan); background: rgba(94,234,212,0.1); }
.consent-doc__status.is-stale  { color: #E8B24A; background: rgba(232,178,74,0.1); }
.consent-doc__status.is-revoked { color: var(--text-mid); background: rgba(98,106,146,0.1); }
.consent-doc__chev { font-size: 12px; color: var(--text-mid); transition: transform 120ms ease; }
.consent-doc[open] .consent-doc__chev { transform: rotate(180deg); }

.consent-doc__body { border-top: 1px solid var(--line); }
.consent-doc__scroll {
  max-height: 360px; overflow-y: auto;
  padding: var(--s-4) var(--s-5);
  font-size: 13px; line-height: 1.7; color: var(--text);
  background: var(--bg);
}
.consent-doc__scroll h1, .consent-doc__scroll h2, .consent-doc__scroll h3, .consent-doc__scroll h4 {
  color: var(--text-hi); margin-top: var(--s-4); margin-bottom: var(--s-2);
}
.consent-doc__scroll h1 { font-size: 16px; }
.consent-doc__scroll h2 { font-size: 14px; padding-bottom: var(--s-2); border-bottom: 1px solid var(--line); }
.consent-doc__scroll h3 { font-size: 13px; }
.consent-doc__scroll p { margin: var(--s-2) 0; }
.consent-doc__scroll table { width: 100%; border-collapse: collapse; margin: var(--s-3) 0; font-size: 12px; }
.consent-doc__scroll th, .consent-doc__scroll td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.consent-doc__scroll th { background: var(--bg-raised); color: var(--text-hi); font-weight: 600; }
.consent-doc__scroll ul, .consent-doc__scroll ol { padding-left: var(--s-5); margin: var(--s-2) 0; }
.consent-doc__scroll li { margin: 2px 0; }
.consent-doc__scroll a { color: var(--accent); }

.consent-form__actions { display: flex; gap: var(--s-3); justify-content: center; margin-top: var(--s-5); flex-wrap: wrap; }
.consent-form__hint { text-align: center; margin-top: var(--s-3); font-size: 12px; }
.consent-form__hint a { color: var(--accent); }

@media (max-width: 640px) {
  .consent-doc__scroll { max-height: 260px; padding: var(--s-3); }
  .consent-bulk-choice__buttons { grid-template-columns: 1fr; }
  .consent-bulk-choice { padding: var(--s-3); }
  .consent-bulk-choice__notes { margin-top: var(--s-3); }
}

/* ---------- Consent admin table pills ---------- */
.consent-table { width: 100%; }
.consent-table__col { text-align: center; white-space: nowrap; min-width: 78px; }
.consent-table__cell { text-align: center; }
.consent-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  border: 1px solid transparent;
}
.consent-pill.is-agreed  { color: var(--accent-cyan); background: rgba(94,234,212,0.10); border-color: rgba(94,234,212,0.3); }
.consent-pill.is-stale   { color: #E8B24A;            background: rgba(232,178,74,0.10);  border-color: rgba(232,178,74,0.3); }
.consent-pill.is-revoked { color: var(--text-mid);    background: rgba(98,106,146,0.10);  border-color: var(--line); }
.consent-pill.is-missing { color: #FF6B6B;            background: rgba(255,107,107,0.08); border-color: rgba(255,107,107,0.25); }

/* ---------- Profile consent list ---------- */
.profile-consent-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.profile-consent-item {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg);
}
.profile-consent-item__title { display: inline-flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.profile-consent-item__status { display: inline-flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
@media (max-width: 640px) {
  .profile-consent-item { flex-direction: column; align-items: flex-start; }
}

/* ---------- Rift past archive (collapsible) ---------- */
.rift-past__summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: var(--s-3);
}
.rift-past__summary::-webkit-details-marker { display: none; }
.rift-past__chev {
  margin-left: auto;
  color: var(--text-mid); font-size: 13px;
  transition: transform 160ms ease;
}
.rift-past[open] .rift-past__chev { transform: rotate(180deg); }
.rift-past__item { opacity: 0.85; }
.rift-past__item:hover { opacity: 1; }

/* ---------- Rift detail vote bar ----------
   Inline voting affordance on the rift detail page so users don't have
   to bounce to /app/rift to switch sides. Mutation routes broadcast on
   the same WebSocket the detail page already subscribes to, so everyone
   else's view updates within ~200ms. */
.rift-vote-bar {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.rift-vote-bar__notice {
  display: flex; align-items: center; gap: var(--s-2);
  color: var(--warn, #E8B24A);
  font-size: 13px;
}
.rift-vote-bar__notice-icon { font-size: 16px; }
.rift-vote-bar__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
/* 좌측 묶음 — [참가] + ⓘ 한 단위로 붙어 보이도록 inline-flex. 아티쟁 페이지의
   .awd-vote-bar__head-lead 와 동일 패턴. */
.rift-vote-bar__head-lead { display: inline-flex; align-items: center; gap: 6px; }
/* "참가" 라벨 — 아티쟁(.awd-vote-bar__label) 과 동일 위계.
   같은 페이지 다른 섹션 타이틀(14-16px) 과 자연스럽게 어우러짐. */
.rift-vote-bar__label { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--text-hi); }
.rift-vote-bar__actions { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
/* 디코방 입장 — 같은 행의 끝(우측)으로 밀어 [공/방 + 취소] 묶음과 시각 분리.
   좁은 화면에선 actions 가 column 으로 stack 되므로 margin-left 자동 무효. */
.rift-vote-bar__voice { margin-left: auto; }
.rift-vote-bar__btn {
  flex: 0 1 auto;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 14px;
}
.rift-vote-bar__btn:disabled { opacity: 0.55; cursor: not-allowed; }
.rift-vote-bar__btn.is-active {
  background: var(--accent-grad-soft);
  border-color: var(--accent-violet);
  color: var(--text-hi);
  cursor: default;
  opacity: 1;
}
.rift-vote-bar__btn.is-active:disabled { opacity: 1; }
.rift-vote-bar__check { color: var(--accent-cyan); font-weight: 700; }
.rift-vote-bar__hint { margin: 0; font-size: 11px; color: var(--text-dim); }
@media (max-width: 640px) {
  .rift-vote-bar__actions { flex-direction: column; align-items: stretch; }
  .rift-vote-bar__btn { width: 100%; justify-content: center; }
}

/* ---------- Artisan detail vote bar ----------
   Mirrors .rift-vote-bar — tones tweaked for the artisan trio (하층/중층/
   불참). Same realtime model: every mutation broadcasts on the WebSocket
   that the detail page's script subscribes to, so peer votes appear in
   under a second. */
.awd-vote-bar {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.awd-vote-bar__notice {
  display: flex; align-items: center; gap: var(--s-2);
  color: var(--warn, #E8B24A);
  font-size: 13px;
}
.awd-vote-bar__notice-icon { font-size: 16px; }
.awd-vote-bar__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
/* 좌측 묶음 — ⓘ + "참가" 라벨이 한 단위로 붙어 보이도록 inline-flex.
   `space-between` 부모에서도 두 요소가 분리되지 않고 함께 정렬됨. */
.awd-vote-bar__head-lead { display: inline-flex; align-items: center; gap: 6px; }
/* "참가" 라벨 — 같은 페이지의 댓글/명단 섹션 타이틀(14-16px) 과 시각적
   위계가 맞도록 키움. uppercase 는 한글에 의미 없어 제거. */
.awd-vote-bar__label { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--text-hi); }
.awd-vote-bar__deadline { color: var(--accent-cyan); font-size: 11px; }
.awd-vote-bar__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.awd-vote-bar__btn {
  flex: 0 1 auto;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 14px;
}
.awd-vote-bar__btn:disabled { opacity: 0.55; cursor: not-allowed; }
.awd-vote-bar__btn.is-active {
  background: var(--accent-grad-soft);
  border-color: var(--accent-violet);
  color: var(--text-hi);
  cursor: default;
  opacity: 1;
}
.awd-vote-bar__btn.is-active:disabled { opacity: 1; }
.awd-vote-bar__check { color: var(--accent-cyan); font-weight: 700; }
.awd-vote-bar__hint { margin: 0; font-size: 11px; color: var(--text-dim); }
@media (max-width: 640px) {
  .awd-vote-bar__actions { flex-direction: column; align-items: stretch; }
  .awd-vote-bar__btn { width: 100%; justify-content: center; }
}

/* ---------- Rift force invite panel ----------
   Now a `<details>` collapsible: a compact 1-line summary with an
   inline "수정" trigger on the right; expanding reveals the full
   guidance + leader-edit form. Lives BELOW the parties grid so the
   force card stays slim at the top, keeping drag-from-roster easy.

   Three states: configured / missing / leader-edit. Visible to all
   force members so they know when to expect their in-game invite. */
.rift-invite {
  margin: 12px 0 4px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  overflow: hidden;
}
.rift-invite.is-mine {
  border-color: var(--line-accent, var(--line-strong));
}
.rift-invite.is-missing {
  border-color: rgba(232,178,74,0.55);
  background:
    linear-gradient(180deg, rgba(232,178,74,0.10), transparent 70%),
    var(--bg);
  animation: rift-invite-pulse 2.4s ease-in-out infinite;
}
@keyframes rift-invite-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,178,74,0.0); }
  50%      { box-shadow: 0 0 0 4px rgba(232,178,74,0.18); }
}

/* Compact summary — single horizontal line, full-width <button> so the
   whole row is clickable. Reset native button chrome. */
.rift-invite__summary {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  user-select: none;
}
.rift-invite__summary:hover { background: rgba(255,255,255,0.02); }
.rift-invite__summary-chev {
  flex-shrink: 0;
  color: var(--text-mid);
  font-size: 14px;
  transition: transform 160ms ease;
  margin-left: 4px;
}
.rift-invite__summary-icon {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: var(--r-xs);
  background: rgba(94,234,212,0.10);
  color: var(--accent-cyan);
  border: 1px solid rgba(94,234,212,0.20);
  flex-shrink: 0;
}
.rift-invite__summary-icon--warn {
  color: #E8B24A;
  background: rgba(232,178,74,0.18);
  border-color: rgba(232,178,74,0.45);
}
.rift-invite__summary-text { flex: 1; min-width: 0; line-height: 1.5; }
.rift-invite__summary-warn { color: #E8B24A; font-weight: 700; }
.rift-invite__summary-mode { font-weight: 700; }
.rift-invite__summary-mode--scheduled { color: var(--accent-cyan); font-size: 14px; letter-spacing: 0.02em; }
.rift-invite__summary-mode--realtime { color: var(--accent-violet); }
.rift-invite__summary-edit {
  flex-shrink: 0;
  pointer-events: none;  /* the entire <summary> is the click target */
}
.rift-invite.is-open .rift-invite__summary-edit {
  border-color: var(--accent-violet);
  color: var(--accent-violet);
  background: var(--accent-grad-soft);
}
.rift-invite.is-open .rift-invite__summary-chev { transform: rotate(180deg); }

/* Expanded body — only shows when .is-open is set on the wrapper. */
.rift-invite__body {
  padding: 12px 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--line);
}
.rift-invite:not(.is-open) .rift-invite__body { display: none; }

.rift-invite__notice {
  padding: 10px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  font-size: 13px; line-height: 1.65;
  color: var(--text);
}
.rift-invite.is-missing .rift-invite__notice {
  background: rgba(232,178,74,0.06);
  border-color: rgba(232,178,74,0.28);
}
.rift-invite__notice-line { margin: 0; }
.rift-invite__notice-line + .rift-invite__notice-sub {
  margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.rift-invite__notice-sub { margin: 0; font-size: 12px; color: var(--text-mid); line-height: 1.6; }
.rift-invite__notice strong { color: var(--text-hi); font-weight: 700; }
/* Mini button-glyphs used inline in the leader hint to point at the
   slot's ✓ / × buttons. Sized to match the actual buttons visually. */
.rift-invite__notice-pill {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px;
  border-radius: 3px;
  font-size: 11px; font-weight: 800; line-height: 1;
  vertical-align: middle;
  margin: 0 1px;
}
.rift-invite__notice-pill--check {
  color: var(--bg-base);
  background: var(--ok, #5DD29F);
  border: 1px solid var(--ok, #5DD29F);
}
.rift-invite__notice-pill--x {
  color: var(--danger, #FF5D8F);
  background: rgba(255,93,143,0.10);
  border: 1px solid rgba(255,93,143,0.45);
}

.rift-invite__form {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 0 0 0;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}
.rift-invite__form-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text-mid); text-transform: uppercase;
}
.rift-invite__form-label--time { margin-top: 4px; }

.rift-invite__modes {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.rift-invite__mode-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--bg);
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.rift-invite__mode-card:hover { border-color: var(--line-strong); }
.rift-invite__mode-card input[type="radio"] { margin-top: 3px; cursor: pointer; }
.rift-invite__mode-card:has(input:checked) {
  border-color: var(--accent-violet);
  background: var(--accent-grad-soft);
}
.rift-invite__mode-card-body { display: flex; flex-direction: column; gap: 2px; }
.rift-invite__mode-card-title { font-size: 13px; font-weight: 700; color: var(--text-hi); }
.rift-invite__mode-card-sub { font-size: 11px; color: var(--text-mid); }
.rift-invite__mode-card--locked {
  cursor: not-allowed; opacity: 0.45;
  background: var(--bg-inset);
}
.rift-invite__mode-card--locked .rift-invite__mode-card-title { color: var(--text-mid); }

.rift-invite__time-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rift-invite__date-fixed {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  color: var(--text-mid);
  font-size: 12px;
  cursor: not-allowed;
}
.rift-invite__time-input {
  background: var(--bg-elevated);
  color: var(--text-hi);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  padding: 6px 10px;
  font-size: 14px; font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  min-width: 120px;
}
.rift-invite__time-input:focus {
  outline: none;
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 2px var(--accent-grad-soft);
}
.rift-invite__save { margin-left: auto; }
.rift-invite__form-hint {
  margin: 0;
  font-size: 11px; color: var(--text-mid);
  padding: 6px 10px;
  background: rgba(94,234,212,0.05);
  border-left: 2px solid var(--accent-cyan);
  border-radius: 2px;
}
.rift-invite__form-hint strong { color: var(--text-hi); }

.rift-invite__form[data-mode="realtime"] .rift-invite__form-label--time,
.rift-invite__form[data-mode="realtime"] .rift-invite__time-row,
.rift-invite__form[data-mode="realtime"] .rift-invite__form-hint {
  opacity: 0.4; pointer-events: none;
}

@media (max-width: 640px) {
  .rift-invite__modes { grid-template-columns: 1fr; }
  .rift-invite__time-row { flex-direction: column; align-items: stretch; }
  .rift-invite__date-fixed { justify-content: center; }
  .rift-invite__time-input { width: 100%; }
  .rift-invite__save { margin-left: 0; width: 100%; justify-content: center; }
}

/* ============================================================
   Admin schedule/rules pages (artisan + rift). Shared so both
   /admin/artifact-war and /admin/rift get identical chrome.
   ============================================================ */

/* ---- Top-level tabs (일정관리 / 규칙관리) ---- */
.aw-tabs {
  display: flex; gap: 4px;
  margin: 16px 0 18px;
  border-bottom: 1px solid var(--line);
}
.aw-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; margin-bottom: -1px;
  background: transparent;
  border: none; border-bottom: 2px solid transparent;
  color: var(--text-mid); font-size: 13px; font-weight: 500;
  text-decoration: none;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.aw-tab:hover { color: var(--text-hi); }
.aw-tab.is-active {
  color: var(--accent-violet);
  border-bottom-color: var(--accent-violet);
  font-weight: 600;
}
.aw-panel { display: block; }

/* ---- Rules form ---- */
.aw-rules { display: flex; flex-direction: column; gap: 18px; }
.aw-rules__group { padding: 20px 22px; }
.aw-rules__group-head { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.aw-rules__group-title { font-size: 15px; font-weight: 700; margin: 0 0 4px; color: var(--text-hi); }
.aw-rules__group-sub { font-size: 12px; margin: 0; line-height: 1.5; color: var(--text-mid); }
.aw-rules__field { margin-top: 14px; }
.aw-rules__field:first-of-type { margin-top: 0; }

/* Weekday pill row — Mon..Sun checkboxes */
.aw-weekday-row { display: flex; gap: 6px; flex-wrap: wrap; }
.aw-weekday {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 8px 14px;
  background: var(--bg-inset); border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; color: var(--text-mid);
  cursor: pointer; user-select: none;
  transition: all var(--dur-fast);
}
.aw-weekday:hover { border-color: var(--line-strong); color: var(--text-hi); }
.aw-weekday input { display: none; }
.aw-weekday.is-active,
.aw-weekday:has(input:checked) {
  background: color-mix(in oklab, var(--accent-violet) 18%, var(--bg-inset));
  border-color: var(--accent-violet); color: var(--text-hi);
}

/* Per-floor edit cards (artisan-only) */
.aw-floors-edit { display: flex; flex-direction: column; gap: 14px; }
.aw-floor-edit {
  padding: 14px 16px;
  background: var(--bg-inset); border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.aw-floor-edit__key {
  padding: 8px 12px;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13px; color: var(--text-dim);
}
.aw-floor-edit textarea.input {
  font-family: inherit; line-height: 1.5; resize: vertical; min-height: 96px;
}

/* ---- Admin event list (full-width rows on desktop, stacked cards on mobile) ---- */
.aw-event-row-wrap { display: flex; align-items: stretch; gap: 8px; }
.aw-event-row-wrap .aw-event-row { flex: 1; min-width: 0; }
.aw-event-row__delete { display: flex; align-items: center; }
.aw-event-row__delete .btn {
  height: 100%;
  color: var(--danger);
  border-color: rgba(255, 93, 143, 0.3);
}
.aw-event-row__delete .btn:hover {
  background: rgba(255, 93, 143, 0.08);
  border-color: var(--danger);
}
.aw-event-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.aw-event-row {
  --row-fg: var(--text-mid);
  --row-soft: var(--ar-neutral-soft);
  --row-line: var(--line);

  position: relative; display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px; align-items: center;
  padding: 18px 24px 18px 28px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: inherit; text-decoration: none;
  transition: all var(--dur-fast);
  overflow: hidden;
}
.aw-event-row:hover {
  border-color: var(--row-line);
  background: var(--bg-elevated);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -10px var(--row-fg);
}
.aw-event-row:active { transform: scale(0.997); }
.aw-event-row:focus-visible { outline: 2px solid var(--accent-violet); outline-offset: 2px; }

.aw-event-row__rail {
  position: absolute; top: 0; left: 0; bottom: 0; width: 4px;
  background: var(--row-fg);
}

.aw-event-row.is-done     { --row-fg: var(--ar-win-fg);  --row-soft: var(--ar-win-soft);  --row-line: var(--ar-win-line); }
.aw-event-row.is-past     { --row-fg: var(--ar-tie-fg);  --row-soft: var(--ar-tie-soft);  --row-line: var(--ar-tie-line); }
.aw-event-row.is-upcoming { --row-fg: var(--accent-cyan); --row-soft: rgba(94,226,245,0.10); --row-line: rgba(94,226,245,0.30); }
:root[data-theme="light"] .aw-event-row.is-upcoming {
  --row-fg: #0891A8; --row-soft: rgba(8,145,168,0.08); --row-line: rgba(8,145,168,0.28);
}

.aw-event-row__when { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.aw-event-row__date {
  font-size: 18px; font-weight: 700; color: var(--text-hi);
  letter-spacing: -0.01em;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
.aw-event-row__day { font-size: 12px; color: var(--text-mid); }

.aw-event-row__status {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.aw-event-row__badge {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--row-fg); background: var(--row-soft);
  border: 1px solid var(--row-line); border-radius: 999px;
  white-space: nowrap;
}
.aw-event-row__score {
  font-size: 13px; font-weight: 700; color: var(--row-fg);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.aw-event-row__cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  color: var(--text-mid);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: all var(--dur-fast);
}
.aw-event-row:hover .aw-event-row__cta {
  color: var(--accent-violet);
  border-color: var(--line-accent);
  background: var(--bg-inset);
}
.aw-event-row__cta-label { font-size: 12px; font-weight: 600; }

@media (max-width: 720px) {
  .aw-event-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 18px 16px 22px;
  }
  .aw-event-row__date { font-size: 16px; }
  .aw-event-row__status { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .aw-event-row__cta {
    justify-content: center;
    padding: 10px;
    background: var(--bg-inset);
  }
  .aw-event-row__cta-label { display: none; }
  .aw-event-row__cta::after { content: "관리하기"; font-size: 12px; font-weight: 600; }
}

/* ---- Rift rules — admin-tunable timing deltas ---- */

/* 24-hour grid for picking which KST slot times the rift planner should
   auto-create. 8 cols on desktop (3 rows × 8), drops to 4 on narrow. */
.rift-hours-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
@media (max-width: 720px) {
  .rift-hours-grid { grid-template-columns: repeat(4, 1fr); }
}
.rift-hour-cell {
  display: flex; align-items: baseline; justify-content: center;
  gap: 1px;
  padding: 10px 0;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer; user-select: none;
  transition: all var(--dur-fast);
}
.rift-hour-cell input { display: none; }
.rift-hour-cell:hover { border-color: var(--line-strong); }
.rift-hour-cell__num { font-size: 14px; font-weight: 700; color: var(--text-mid); }
.rift-hour-cell__suffix { font-size: 10px; color: var(--text-dim); }
.rift-hour-cell.is-active,
.rift-hour-cell:has(input:checked) {
  background: color-mix(in oklab, var(--accent-violet) 18%, var(--bg-inset));
  border-color: var(--accent-violet);
}
.rift-hour-cell.is-active .rift-hour-cell__num,
.rift-hour-cell:has(input:checked) .rift-hour-cell__num {
  color: var(--text-hi);
}
.rift-hour-cell.is-active .rift-hour-cell__suffix,
.rift-hour-cell:has(input:checked) .rift-hour-cell__suffix {
  color: var(--accent-violet);
}

.rift-rules__delta-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft, var(--line));
}
.rift-rules__delta-row:first-of-type { border-top: none; }
.rift-rules__delta-label {
  display: flex; flex-direction: column; gap: 2px;
}
.rift-rules__delta-side {
  font-size: 13px; font-weight: 700;
  color: var(--text-hi);
}
.rift-rules__delta-side--attack { color: #F26D6D; }
.rift-rules__delta-side--defense { color: var(--accent-cyan); }

.rift-rules__delta-pair {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
}
.rift-rules__delta-input {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 140px;
}
.rift-rules__delta-input .input { font-size: 13px; }
.rift-rules__delta-sep {
  font-size: 18px; color: var(--text-dim); font-family: var(--font-mono);
  align-self: center; margin-bottom: 8px;
}

@media (max-width: 720px) {
  .rift-rules__delta-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .rift-rules__delta-sep { display: none; }
}

/* ---- Member-list consent cells ---- */
.consent-cell {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  font-size: 11px; font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}
.consent-cell--ok {
  color: var(--accent-cyan);
  background: rgba(94,234,212,0.10);
  border-color: rgba(94,234,212,0.28);
}
.consent-cell--missing {
  color: #FF6B6B;
  background: rgba(255,107,107,0.08);
  border-color: rgba(255,107,107,0.30);
}
.consent-cell--marketing-on {
  color: var(--accent-violet);
  background: var(--accent-grad-soft);
  border-color: var(--line-accent, var(--accent-violet));
}
.consent-cell--marketing-off {
  color: var(--text-mid);
  background: rgba(98,106,146,0.10);
  border-color: var(--line);
}

/* ---- Admin rift schedule sub-tabs (다가오는 / 지난) ---- */
.rift-subtab-strip {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin-bottom: 12px;
}
.rift-subtab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  font-size: 13px; font-weight: 600;
  color: var(--text-mid);
  border-radius: var(--r-xs);
  text-decoration: none;
  transition: all var(--dur-fast);
}
.rift-subtab:hover { color: var(--text-hi); background: var(--bg-raised); }
.rift-subtab.is-active {
  color: var(--text-hi);
  background: var(--bg-elevated);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2),
              inset 0 0 0 1px var(--accent-violet);
}
.rift-subtab__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; padding: 0 6px; height: 18px;
  background: var(--bg-base); border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  color: var(--text-mid);
}
.rift-subtab.is-active .rift-subtab__count {
  color: var(--accent-violet);
  border-color: var(--accent-violet);
}

/* ============================================================
   ENGAGEMENT UPLIFT — applied 2026-04-27
   #2 nudge / #5 ws feedback / #9 admin toolbar / #10 micro-rewards
   ============================================================ */

/* ---- #2 Nudge — orderer-recommended vote button ----
   Loud violet→cyan gradient + small "오더 추천" badge so the eye
   gravitates here without us touching the underlying vote logic. */
.awd-vote-bar__btn.is-recommended,
.rift-vote-bar__btn.is-recommended {
  background: linear-gradient(135deg, var(--accent-violet) 0%, var(--accent-cyan) 100%);
  color: #0B0D1A;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(139,126,255,0.28), 0 0 0 1px rgba(139,126,255,0.45);
  position: relative;
  overflow: hidden;
}
.awd-vote-bar__btn.is-recommended:hover,
.rift-vote-bar__btn.is-recommended:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
/* Slow shimmer band so it reads as "recommended now". Pure cosmetic. */
.awd-vote-bar__btn.is-recommended::before,
.rift-vote-bar__btn.is-recommended::before {
  content: '';
  position: absolute; top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg,
    transparent 0%, rgba(255,255,255,0) 30%,
    rgba(255,255,255,0.45) 50%, rgba(255,255,255,0) 70%, transparent 100%);
  transform: skewX(-22deg);
  animation: nudge-shimmer 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes nudge-shimmer {
  0%   { left: -120%; }
  60%  { left: 120%; }
  100% { left: 120%; }
}
/* Won't-fight active state — user has already voted on this floor. */
.awd-vote-bar__btn.is-recommended.is-active,
.rift-vote-bar__btn.is-recommended.is-active {
  /* Keep the active treatment dominant when it's also the user's choice. */
  background: var(--accent-grad-soft);
  color: var(--text-hi);
  box-shadow: none;
}
.awd-vote-bar__btn.is-recommended.is-active::before,
.rift-vote-bar__btn.is-recommended.is-active::before { display: none; }
.awd-vote-bar__nudge,
.rift-vote-bar__nudge {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(11,13,26,0.25);
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.04em;
}
@media (prefers-reduced-motion: reduce) {
  .awd-vote-bar__btn.is-recommended::before,
  .rift-vote-bar__btn.is-recommended::before { animation: none; }
}

/* "불참" demoted — when not the user's pick, fade to the side. */
.awd-vote-bar__btn.is-demoted {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--line);
  opacity: 0.85;
}
.awd-vote-bar__btn.is-demoted:hover {
  color: var(--text-mid);
  border-color: var(--line-strong);
  background: var(--bg-inset);
}

/* ---- #5 Realtime feedback ----
   - WS connection pill (top-right of detail pages)
   - Cyan flash on swap-in elements after a peer broadcast */

.ws-status {
  position: fixed;
  /* Bottom-LEFT so it never collides with the toast stack at
     bottom-right. Single source of "ambient" floating UI on each side. */
  bottom: 16px; left: 16px;
  z-index: 35;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  font-size: 11px; font-weight: 600;
  color: var(--text-mid);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all var(--dur-fast);
}
.ws-status__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}
.ws-status.is-connected {
  border-color: rgba(94,234,212,0.40);
  color: var(--accent-cyan);
}
.ws-status.is-connected .ws-status__dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: ws-dot-pulse 2.4s ease-in-out infinite;
}
.ws-status.is-reconnecting {
  border-color: rgba(232,178,74,0.45);
  color: #E8B24A;
}
.ws-status.is-reconnecting .ws-status__dot { background: #E8B24A; }
@keyframes ws-dot-pulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* Disconnect band — full-width amber strip when WS is down for >5s */
.ws-disconnect-band {
  position: fixed;
  top: 56px; left: 0; right: 0;  /* below the site header */
  z-index: 30;
  padding: 8px 16px;
  background: rgba(232,178,74,0.18);
  border-bottom: 1px solid rgba(232,178,74,0.45);
  color: #E8B24A;
  font-size: 12px; font-weight: 600;
  text-align: center;
}

/* Cyan glow on elements that just changed via WS broadcast. The
   `is-ws-flash` class is added by the swap helper for ~2.4s. */
.is-ws-flash {
  animation: ws-flash 2.4s ease-out 1;
}
@keyframes ws-flash {
  0%   { box-shadow: 0 0 0 0 rgba(94,234,212,0.0), 0 0 0 0 rgba(94,234,212,0.0) inset; }
  18%  { box-shadow: 0 0 24px 4px rgba(94,234,212,0.45), 0 0 0 1px rgba(94,234,212,0.65) inset; }
  100% { box-shadow: 0 0 0 0 rgba(94,234,212,0.0), 0 0 0 0 rgba(94,234,212,0.0) inset; }
}

/* ---- #9 Operator toolbar visual separation ----
   Wraps admin-only actions (직위 해제, 강제 임명) in a tinted bar with
   a "운영진 도구" label so plain members never confuse them with
   their own affordances. */
.admin-toolbar {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-inset);
  border: 1px dashed rgba(232,178,74,0.35);
  border-radius: var(--r-sm);
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.admin-toolbar__label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.10em;
  color: #E8B24A;
  text-transform: uppercase;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.admin-toolbar__label::before {
  content: '◆'; opacity: 0.7; font-size: 9px;
}
.admin-toolbar__actions {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-left: auto;
}

/* ---- #10 Micro-interactions — vote-success ripple / sparkle ----
   Brief sheen + soft ring sweeps out from the active vote button after
   a successful submit. Triggered by `is-just-voted` class which the
   swap helper adds for ~1.2s. */
.is-just-voted {
  animation: just-voted-ring 1.2s ease-out 1;
  position: relative;
}
@keyframes just-voted-ring {
  0%   { box-shadow: 0 0 0 0 rgba(94,234,212,0.65); }
  60%  { box-shadow: 0 0 0 14px rgba(94,234,212,0.0); }
  100% { box-shadow: 0 0 0 0 rgba(94,234,212,0.0); }
}
.is-just-voted::after {
  content: '✦';
  position: absolute;
  top: -8px; right: -8px;
  font-size: 14px;
  color: var(--accent-cyan);
  text-shadow: 0 0 6px rgba(94,234,212,0.7);
  animation: just-voted-spark 1.2s ease-out 1;
  pointer-events: none;
}
@keyframes just-voted-spark {
  0%   { opacity: 0; transform: scale(0.4) rotate(0deg); }
  40%  { opacity: 1; transform: scale(1.2) rotate(180deg); }
  100% { opacity: 0; transform: scale(0.6) rotate(360deg); }
}

/* ============================================================
   #8 Members table — mobile card view (≤640px)
   Below the breakpoint, the 10-col table doesn't fit. Each row
   becomes a card with: hero strip (이름·직업·전투력) → meta strip
   (레기온·역할) → collapsible details (동의·동기화·액션).
   Implemented via :before pseudo-elements that pull the column
   header label from `data-label` so we don't ship per-cell labels.
   ============================================================ */
@media (max-width: 640px) {
  table.data.members-table { border: none; background: transparent; }
  table.data.members-table thead { display: none; }
  table.data.members-table,
  table.data.members-table tbody,
  table.data.members-table tr,
  table.data.members-table td { display: block; width: 100%; }

  table.data.members-table tbody tr {
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    margin-bottom: 12px;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    overflow: hidden;
  }
  table.data.members-table tbody tr:hover { background: var(--bg-raised); }

  /* Cell defaults — flat row with the column label as a faint prefix. */
  table.data.members-table tbody td {
    padding: 0;
    border: none;
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    font-size: 13px;
  }
  table.data.members-table tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 10px; letter-spacing: 0.06em;
    color: var(--text-dim); text-transform: uppercase;
    font-family: var(--font-mono);
    flex-shrink: 0;
  }

  /* Hero — character/discord identity full-width, no label prefix. */
  table.data.members-table tbody td.cell-member {
    grid-column: 1 / -1;
    display: block;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--line);
  }
  table.data.members-table tbody td.cell-member::before { display: none; }

  /* Action cluster aligns with the rest. */
  table.data.members-table tbody td.cell-actions {
    grid-column: 1 / -1;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
    display: flex; justify-content: stretch;
  }
  table.data.members-table tbody td.cell-actions::before { display: none; }
  table.data.members-table tbody td.cell-actions .row {
    width: 100%; justify-content: stretch;
  }
  table.data.members-table tbody td.cell-actions .btn {
    flex: 1; justify-content: center;
  }

  /* Spotlight 직업 + 레벨 + 전투력 in one strip (right-aligned values). */
  table.data.members-table tbody td[data-label="직업"] { order: 1; }
  table.data.members-table tbody td[data-label="레벨"] { order: 2; }
  table.data.members-table tbody td[data-label="전투력"] { order: 3; }
  table.data.members-table tbody td[data-label="레기온"] { order: 4; }
  table.data.members-table tbody td[data-label="역할"] { order: 5; }
  table.data.members-table tbody td[data-label="필수 약관"] { order: 6; }
  table.data.members-table tbody td[data-label="마케팅"] { order: 7; }
  table.data.members-table tbody td[data-label="최근 동기화"] { order: 8; }

  /* Sort header links live-only on desktop. */
  table.data.members-table .sort-link { pointer-events: none; }
}

/* ============================================================
   Phase 2 engagement uplift — 2026-04-27
   #1 social proof feed / #3 team-joined / #6 achievements / #7 welcome-back
   ============================================================ */

/* ---- #7 Welcome-back banner ---- */
.welcome-back {
  margin-bottom: var(--s-4);
  padding: var(--s-4) var(--s-5);
  display: flex; align-items: center; gap: var(--s-4);
  background:
    linear-gradient(135deg, rgba(94,234,212,0.10), rgba(139,126,255,0.06) 60%, transparent),
    var(--bg-raised);
  border: 1px solid rgba(94,234,212,0.30);
  border-radius: var(--r);
}
.welcome-back__icon {
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: var(--accent-grad);
  color: #0B0D1A;
  font-size: 18px; font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 18px rgba(139,126,255,0.30);
}
.welcome-back__title { font-size: 15px; font-weight: 700; color: var(--text-hi); }
.welcome-back__msg { font-size: 13px; color: var(--text-mid); margin-top: 2px; line-height: 1.55; }
.welcome-back__msg strong { color: var(--accent-cyan); font-family: var(--font-mono); }
.welcome-back__link {
  color: var(--accent-violet);
  font-weight: 600;
  margin-left: 4px;
  white-space: nowrap;
}
.welcome-back__link:hover { color: var(--text-hi); }

/* ---- #6 Achievement badges ---- */
.achievements-card .card__head { gap: var(--s-3); flex-wrap: wrap; }
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: var(--s-3);
}
.achievement-badge {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.achievement-badge--violet { border-color: rgba(139,126,255,0.35); background: rgba(139,126,255,0.06); }
.achievement-badge--cyan   { border-color: rgba(94,234,212,0.35); background: rgba(94,234,212,0.06); }
.achievement-badge--amber  { border-color: rgba(232,178,74,0.35); background: rgba(232,178,74,0.06); }
.achievement-badge__glyph {
  font-size: 22px; line-height: 1;
  flex-shrink: 0;
}
.achievement-badge__label { font-size: 13px; font-weight: 700; color: var(--text-hi); }
.achievement-badge__count { font-size: 11px; color: var(--text-mid); margin-top: 2px; }
.achievements-counts {
  font-size: 11px; color: var(--text-dim);
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: var(--s-2);
  border-top: 1px dashed var(--line);
}
.achievements-counts strong { color: var(--text-hi); }

/* ---- #3 Team-joined panel (post-vote) ---- */
.team-joined-panel {
  position: fixed;
  bottom: 60px; right: 16px;
  z-index: 40;
  width: min(340px, calc(100vw - 32px));
  background: var(--bg-elevated);
  border: 1px solid rgba(94,234,212,0.40);
  border-radius: var(--r);
  padding: 12px 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.4), 0 0 0 4px rgba(94,234,212,0.08);
  opacity: 0; transform: translateY(8px);
  transition: opacity 240ms ease, transform 240ms ease;
}
.team-joined-panel.is-shown { opacity: 1; transform: translateY(0); }
.team-joined-panel__head { display: flex; align-items: center; gap: 8px; }
.team-joined-panel__icon {
  width: 22px; height: 22px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: var(--accent-cyan); color: #0B0D1A;
  font-size: 12px; font-weight: 800;
}
.team-joined-panel__title { font-size: 13px; color: var(--text); }
.team-joined-panel__title strong { color: var(--text-hi); }
.team-joined-panel__count {
  margin-left: auto;
  font-size: 11px; font-weight: 700;
  color: var(--accent-cyan);
}
.team-joined-panel__chips {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 8px 0 6px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 8px;
}
.team-joined-panel__msg { font-size: 11px; color: var(--text-mid); line-height: 1.55; }

/* ---- #1 Activity feed (rolling list, top-right) ---- */
.rift-feed {
  position: fixed;
  top: 70px; right: 16px;
  z-index: 30;
  display: flex; flex-direction: column; gap: 6px;
  max-width: 320px;
  pointer-events: none;
}
.rift-feed__item {
  background: rgba(11,13,26,0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(94,234,212,0.30);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font-size: 12px; color: var(--text);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex; align-items: center; gap: 6px;
  opacity: 0; transform: translateX(20px);
  transition: opacity 240ms ease, transform 240ms ease;
}
.rift-feed__item.is-shown { opacity: 1; transform: translateX(0); }
.rift-feed__icon {
  color: var(--accent-cyan);
  font-weight: 800;
  font-size: 11px;
  flex-shrink: 0;
}
.rift-feed__klass {
  color: var(--accent-violet);
  font-size: 11px; font-weight: 700;
  margin-right: 2px;
}
.rift-feed__body strong { color: var(--text-hi); }
:root[data-theme="light"] .rift-feed__item { background: rgba(255,255,255,0.95); }
@media (max-width: 640px) {
  .rift-feed { right: 8px; left: 8px; max-width: none; }
  .ws-status { bottom: 60px; }
  .team-joined-panel { right: 8px; left: 8px; bottom: 70px; width: auto; }
}

/* ============================================================
   Phase 3 — Admin engagement dashboard widgets
   ============================================================ */
.engagement-card { padding: 0; overflow: hidden; }
.engagement-card .card__head { padding: 14px 16px; border-bottom: 1px solid var(--line-soft, var(--line)); }
.engagement-list {
  list-style: none; margin: 0; padding: 4px 0;
  display: flex; flex-direction: column;
}
.engagement-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px dashed var(--line);
}
.engagement-item:last-child { border-bottom: none; }
.engagement-item__rank {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--bg-inset);
  color: var(--text-mid);
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.engagement-item__rank--gold {
  background: rgba(232,178,74,0.18);
  color: #E8B24A;
}
.engagement-item__name {
  display: inline-flex; align-items: center; gap: 6px;
  flex: 1; min-width: 0;
}
.engagement-item__name strong { color: var(--text-hi); font-weight: 700; }
.engagement-item__count {
  font-size: 12px; font-weight: 700;
  color: var(--accent-violet);
  white-space: nowrap;
}
.engagement-list--pulse .engagement-item__pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--pulse, var(--accent-cyan));
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--pulse, var(--accent-cyan));
  animation: engagement-pulse 2.4s ease-in-out infinite;
}
@keyframes engagement-pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .engagement-list--pulse .engagement-item__pulse { animation: none; }
}

/* ---- #1 Social proof — list page participation pulse ---- */
.participation-pulse {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(94,234,212,0.10);
  border: 1px solid rgba(94,234,212,0.30);
  color: var(--accent-cyan);
  font-size: 12px; font-weight: 600;
}
.participation-pulse__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
  animation: participation-pulse-dot 2.4s ease-in-out infinite;
}
.participation-pulse__num { color: var(--text-hi); font-weight: 700; }
.participation-pulse__lbl { color: var(--accent-cyan); }
@keyframes participation-pulse-dot {
  0%, 100% { opacity: 0.55; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .participation-pulse__dot { animation: none; }
}

/* ---- Profile activity stats (replaces achievement milestones) ---- */
.stat-box {
  padding: 14px 16px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-align: center;
}
.stat-box__num {
  font-size: 24px; font-weight: 700;
  color: var(--text-hi);
  letter-spacing: -0.02em;
}
.stat-box__lbl {
  font-size: 11px; color: var(--text-mid);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

/* ---- Dormant widget — softer tone ---- */
.engagement-list--gentle .engagement-item__since {
  color: var(--text-dim);  /* warn 톤 X */
  font-size: 11px;
}
.engagement-card__hint {
  padding: 10px 16px;
  border-top: 1px dashed var(--line);
  font-size: 11px; color: var(--text-mid);
  background: rgba(94,234,212,0.04);
}

/* ---- Member-side label dispute affordance ----
   Subtle collapsible on ended rifts. Soft amber so it reads as
   "rights/recourse" rather than "alert". */
.dispute-affordance {
  margin: 12px 0 16px 0;
  border: 1px solid rgba(232,178,74,0.30);
  border-radius: var(--r-sm);
  background: rgba(232,178,74,0.04);
  overflow: hidden;
}
.dispute-affordance__summary {
  list-style: none;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px; color: var(--text-mid);
  user-select: none;
}
.dispute-affordance__summary::-webkit-details-marker { display: none; }
.dispute-affordance__icon { color: #E8B24A; }
.dispute-affordance__chev { margin-left: auto; transition: transform 160ms ease; color: var(--text-dim); }
.dispute-affordance[open] .dispute-affordance__chev { transform: rotate(180deg); }
.dispute-affordance__form {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(232,178,74,0.20);
  display: flex; flex-direction: column; gap: 8px;
}
.dispute-affordance__label { font-size: 12px; color: var(--text-mid); }
.dispute-affordance__textarea {
  font-family: inherit; line-height: 1.55; resize: vertical;
  background: var(--bg-inset);
}
.dispute-affordance__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- Notification preferences (profile section) ---- */
.notif-prefs { display: flex; flex-direction: column; gap: var(--s-4); }
.notif-prefs__group {
  padding: var(--s-3) var(--s-4);
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.notif-prefs__group-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text-mid); text-transform: uppercase;
  margin-bottom: var(--s-2);
}
.notif-prefs__toggle {
  display: grid;
  grid-template-columns: 18px auto 1fr;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px dashed var(--line);
  cursor: pointer;
  font-size: 13px;
  align-items: baseline;
}
.notif-prefs__toggle:first-of-type { border-top: none; }
.notif-prefs__toggle input[type="checkbox"] { margin-top: 3px; cursor: pointer; }
.notif-prefs__toggle > span:nth-child(2) { font-weight: 600; color: var(--text-hi); }
.notif-prefs__hours {
  display: flex; align-items: flex-end; gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.notif-prefs__hours label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--text-mid); }
.notif-prefs__hours .input { width: 80px; font-family: var(--font-mono); }
.notif-prefs__hours-sep { padding-bottom: 6px; color: var(--text-dim); font-family: var(--font-mono); }

/* ============================================================
   관전 UX — momentum strip / spectator banner / role pips
   ============================================================ */

/* ---- Participation overview strip (above side tabs) ----
   공격/방어는 같은 길드의 두 가지 참가 옵션 — VS 비교가 아닌 둘 다
   "오늘 시공의 참여 현황" 으로 프레이밍. 라벨 + sub copy 로 컨텐츠
   차이를 명확히. */
.momentum-strip {
  margin: 0 0 var(--s-4);
  padding: 14px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.momentum-strip__head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.momentum-strip__title {
  font-size: 13px; font-weight: 700; color: var(--text-hi);
  letter-spacing: -0.01em;
}
.momentum-strip__sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.momentum-side {
  padding: 12px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
  border-left: 3px solid var(--line);
}
.momentum-side--attack { border-left-color: var(--ar-lose-fg, #F26D6D); }
.momentum-side--defense { border-left-color: var(--accent-cyan); }
.momentum-side.is-mine {
  background: var(--accent-grad-soft);
  border-color: var(--accent-violet);
  border-left-color: var(--accent-violet);
}
.momentum-side__head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.momentum-side__glyph { font-size: 18px; }
.momentum-side__label { font-size: 14px; font-weight: 700; color: var(--text-hi); }
.momentum-side__count {
  font-size: 12px; font-weight: 700;
  color: var(--text-hi);
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--bg-base);
  border: 1px solid var(--line);
}
.momentum-side__mine {
  margin-left: auto;
  font-size: 10px; font-weight: 700;
  color: var(--accent-violet);
  letter-spacing: 0.04em;
  padding: 2px 8px;
  background: rgba(139,126,255,0.18);
  border-radius: 999px;
}
.momentum-side__sub { font-size: 11px; line-height: 1.5; }
.momentum-side__metrics {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
  margin-top: 4px;
}
.momentum-side__cp { font-size: 11px; color: var(--accent-cyan); }
.momentum-side__roles { display: flex; gap: 4px; flex-wrap: wrap; }
.momentum-side__empty {
  font-size: 11px; color: var(--text-dim); font-style: italic;
  padding-top: 4px; border-top: 1px dashed var(--line); margin-top: 4px;
}

/* Role pips — tank/dps/support distribution badges */
.role-pip {
  display: inline-flex; align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  font-family: var(--font-mono);
  border: 1px solid transparent;
}
.role-pip--tank    { color: var(--cls-tank);    background: rgba(94,234,212,0.10); border-color: rgba(94,234,212,0.35); }
.role-pip--dps     { color: var(--cls-dps, #F26D6D); background: rgba(242,109,109,0.10); border-color: rgba(242,109,109,0.35); }
.role-pip--support { color: var(--cls-support); background: rgba(232,178,74,0.10); border-color: rgba(232,178,74,0.35); }

@media (max-width: 720px) {
  .momentum-strip__sides { grid-template-columns: 1fr; }
  .momentum-strip { padding: 10px 12px; }
}

/* ---- Spectator-mode banner ----
   For non-voted members on a non-ended event. Soft cyan tone — invites
   without demanding. */
.spectator-banner {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: var(--s-4);
  padding: 12px 16px;
  background:
    linear-gradient(135deg, rgba(94,234,212,0.08), transparent 60%),
    var(--bg-raised);
  border: 1px solid rgba(94,234,212,0.28);
  border-radius: var(--r);
}
.spectator-banner__icon {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: rgba(94,234,212,0.15);
  border: 1px solid rgba(94,234,212,0.35);
  font-size: 18px;
  flex-shrink: 0;
}
.spectator-banner__title {
  font-size: 13px; font-weight: 700; color: var(--accent-cyan);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.spectator-banner__msg {
  font-size: 13px; color: var(--text-mid); line-height: 1.55;
  margin-top: 2px;
}
.spectator-banner__msg strong { color: var(--text-hi); }

/* Force-header role pips strip */
.rift-force__roles { display: inline-flex; gap: 4px; align-items: center; }

/* LIVE pulse — stronger ping on the live-dot for spectator clarity */
.live-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: #FF4D6D;
  margin-right: 5px;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(255,77,109,0.7);
  animation: live-pulse 1.6s ease-out infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,77,109,0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(255,77,109,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,77,109,0); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ============================================================
   "곧 공개" — 임시 비공개 카드 treatment
   파티 모집 / 레기온 처럼 운영 안정화 전까지 잠가두는 기능에 적용.
   카드는 클릭 불가 + 살짝 dim + 우상단 회전된 stamp.
   ============================================================ */
.is-coming-soon {
  position: relative;
  cursor: not-allowed;
  opacity: 0.78;
  filter: saturate(0.6);
  pointer-events: none;  /* nested links/buttons disabled too */
  transition: opacity var(--dur-fast);
}
.is-coming-soon:hover { opacity: 0.86; }

/* 살짝 사선 격자 오버레이로 "잠금 상태" 시각화. 너무 강하지 않게. */
.is-coming-soon::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(139,126,255,0.04) 0 8px,
      transparent 8px 18px
    );
  border-radius: inherit;
}

/* 메인 stamp — 카드 우상단에 회전된 띠. 보라 그라데이션. */
.coming-soon-stamp {
  position: absolute;
  top: 14px; right: -28px;
  z-index: 2;
  padding: 4px 36px;
  background: var(--accent-grad);
  color: #0B0D1A;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  transform: rotate(28deg);
  box-shadow: 0 4px 14px rgba(139,126,255,0.40);
  pointer-events: none;
}

/* 작은 bento 타일 같은 곳에선 stamp 도 작게. */
.coming-soon-stamp--corner {
  top: 10px; right: -22px;
  padding: 3px 28px;
  font-size: 10px;
  letter-spacing: 0.06em;
}

/* ============================================================
   Info tooltip (ⓘ) — reusable inline help icon.
   Shows a bubble on hover, focus, or tap. Click-outside / ESC closes
   open bubbles (handled by app.js). One unified design across the
   whole app so help affordances feel consistent.
   ============================================================ */
.info-tip {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: help;
  vertical-align: middle;
  border-radius: 50%;
  transition: color var(--dur-fast), background var(--dur-fast);
  flex-shrink: 0;
}
.info-tip:hover,
.info-tip:focus-visible,
.info-tip[data-open] {
  color: var(--accent-cyan);
  background: rgba(94, 226, 245, 0.10);
  outline: none;
}
.info-tip__icon { display: inline-flex; }
.info-tip__icon svg { display: block; }

/* Bubble — hidden by default, fades in on hover/focus/[data-open]. */
.info-tip__bubble {
  position: absolute;
  z-index: 100;
  min-width: 220px; max-width: 320px;
  padding: 12px 14px;
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--accent-cyan) 6%, var(--bg-elevated)) 0%,
    var(--bg-elevated) 70%);
  border: 1px solid var(--line-accent);
  border-radius: var(--r-md);
  box-shadow:
    0 12px 32px -10px rgba(0,0,0,0.55),
    0 0 0 1px rgba(94, 226, 245, 0.06) inset;
  font-size: 12px; font-weight: 500; line-height: 1.6;
  color: #FFFFFF;
  letter-spacing: -0.005em; word-break: keep-all;
  white-space: normal; text-align: left;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transform: translateY(2px);
  transition: opacity var(--dur-fast), visibility var(--dur-fast), transform var(--dur-fast);
}
/* One line per `info_tip` list item. Thin divider between lines so multi-
   context tips read as a clear list, not a mashed sentence. */
.info-tip__line {
  display: block;
  padding: 4px 0;
}
.info-tip__line + .info-tip__line {
  border-top: 1px dashed color-mix(in oklab, var(--line-accent) 60%, transparent);
  margin-top: 2px;
}
.info-tip__line:first-child { padding-top: 0; }
.info-tip__line:last-child  { padding-bottom: 0; }
.info-tip:hover .info-tip__bubble,
.info-tip:focus-visible .info-tip__bubble,
.info-tip[data-open] .info-tip__bubble {
  opacity: 1; visibility: visible; transform: translateY(0);
  pointer-events: auto;
}
/* Bubble positions — right (default), left, top. The arrow is built
   from two stacked pseudo-elements (border + fill) so it tracks the
   bubble's border + background colors. */
.info-tip--right .info-tip__bubble {
  top: 50%; left: calc(100% + 8px); transform: translateY(-50%) translateX(2px);
}
.info-tip--right:hover .info-tip__bubble,
.info-tip--right:focus-visible .info-tip__bubble,
.info-tip--right[data-open] .info-tip__bubble {
  transform: translateY(-50%) translateX(0);
}
.info-tip--right .info-tip__bubble::before,
.info-tip--right .info-tip__bubble::after {
  content: ""; position: absolute; top: 50%; right: 100%;
  transform: translateY(-50%);
  border: 5px solid transparent;
}
.info-tip--right .info-tip__bubble::before { border-right-color: var(--line-accent); }
.info-tip--right .info-tip__bubble::after  {
  border: 4px solid transparent; border-right-color: var(--bg-elevated);
  margin-right: -1px; margin-top: -4px; top: 50%;
}

.info-tip--left .info-tip__bubble {
  top: 50%; right: calc(100% + 8px); transform: translateY(-50%) translateX(-2px);
}
.info-tip--left:hover .info-tip__bubble,
.info-tip--left:focus-visible .info-tip__bubble,
.info-tip--left[data-open] .info-tip__bubble {
  transform: translateY(-50%) translateX(0);
}
.info-tip--left .info-tip__bubble::before,
.info-tip--left .info-tip__bubble::after {
  content: ""; position: absolute; top: 50%; left: 100%;
  transform: translateY(-50%);
  border: 5px solid transparent;
}
.info-tip--left .info-tip__bubble::before { border-left-color: var(--line-accent); }
.info-tip--left .info-tip__bubble::after  {
  border: 4px solid transparent; border-left-color: var(--bg-elevated);
  margin-left: -1px; margin-top: -4px; top: 50%;
}

.info-tip--top .info-tip__bubble {
  bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(2px);
}
.info-tip--top:hover .info-tip__bubble,
.info-tip--top:focus-visible .info-tip__bubble,
.info-tip--top[data-open] .info-tip__bubble {
  transform: translateX(-50%) translateY(0);
}
.info-tip--top .info-tip__bubble::before,
.info-tip--top .info-tip__bubble::after {
  content: ""; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
}
.info-tip--top .info-tip__bubble::before { border-top-color: var(--line-accent); }
.info-tip--top .info-tip__bubble::after  {
  border: 4px solid transparent; border-top-color: var(--bg-elevated);
  margin-top: -1px; margin-left: -4px; left: 50%;
}

/* Mobile — bubble fits within the viewport. If a right-aligned bubble
   would overflow, the JS toggle will add `data-flipped` (handled by
   app.js). For now, narrower bubble on small screens. */
@media (max-width: 540px) {
  .info-tip__bubble { min-width: 160px; max-width: min(72vw, 280px); }
}
