/* ══════════════════════════════════════════════════════════════════════════
   CLANS — Clan panel (spec 016). Ink/gold card on desktop; full-screen on
   the mobile shell (body.kw-shell). #clan-panel must be display:none when
   closed — mobile-shell.js watchOverlays() reads computed display.
   ══════════════════════════════════════════════════════════════════════════ */

.clan-backdrop {
  display: none; position: fixed; inset: 0; z-index: 4100;
  background: rgba(8,5,2,.62); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.clan-backdrop.open { display: flex; animation: fadeIn .2s ease; }

.clan-card {
  position: relative;
  width: 520px; max-width: 95vw; max-height: 86vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(160deg, #1c1610 0%, #110e09 100%);
  border: 1px solid rgba(200,148,26,.3);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
  color: #f2e6c9; font-family: 'Crimson Pro', Georgia, serif;
}

.clan-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(200,148,26,.18);
}
.clan-head-banner:empty { display: none; }
.clan-head-text { flex: 1; min-width: 0; }
.clan-title {
  font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700;
  color: #f4c95d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.clan-sub { font-size: 13px; color: rgba(192,221,151,.65); }
.clan-close {
  background: transparent; border: none; cursor: pointer;
  color: rgba(244,201,93,.6); font-size: 18px; padding: 6px; line-height: 1;
}
.clan-close:hover { color: #f4c95d; }

.clan-tabs { display: flex; gap: 4px; padding: 0 14px; border-bottom: 1px solid rgba(200,148,26,.12); }
.clan-tabs:empty { display: none; }
.clan-tab {
  background: none; border: none; cursor: pointer;
  padding: 10px 12px 9px; font: inherit; font-size: 14px;
  color: rgba(242,230,201,.6); border-bottom: 2px solid transparent;
}
.clan-tab.on { color: #f4c95d; border-bottom-color: #f4c95d; }

.clan-body { flex: 1; overflow-y: auto; padding: 14px 18px 18px; -webkit-overflow-scrolling: touch; }
.clan-sec { padding: 12px 0; border-bottom: 1px solid rgba(200,148,26,.1); }
.clan-sec:last-child { border-bottom: none; }
.clan-sec h3 {
  margin: 0 0 8px; font-family: 'Playfair Display', serif; font-size: 15px;
  color: #e8d0a0; letter-spacing: .02em;
}
.clan-muted { color: rgba(242,230,201,.55); font-size: 13px; }
.clan-empty { text-align: center; font-style: italic; color: rgba(242,230,201,.6); padding: 18px 8px; }
.clan-desc { margin: 10px 0; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Banner: two-colour pennant with the emblem glyph */
.clan-banner {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: linear-gradient(180deg, var(--c1) 0 62%, var(--c2) 62% 100%);
  clip-path: polygon(0 0, 100% 0, 100% 84%, 50% 100%, 0 84%);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.25);
}
.clan-banner-glyph { transform: translateY(-12%); filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }

.clan-overview-top { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.clan-level { font-family: 'Playfair Display', serif; font-size: 22px; color: #f4c95d; }
.clan-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; margin: 4px 0; }
.clan-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #BA7517, #f4c95d); }
.clan-unlocks { list-style: none; padding: 0; margin: 8px 0; font-size: 14px; }
.clan-unlocks li { padding: 2px 0; color: rgba(242,230,201,.7); }
.clan-unlocks li.ok { color: #C0DD97; }

/* Buttons & forms */
.clan-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 500;
  background: linear-gradient(180deg, #c8941a, #9a6d12); color: #1c1812;
  border: 1px solid rgba(244,201,93,.5);
}
.clan-btn:hover { filter: brightness(1.08); }
.clan-btn.ghost { background: transparent; color: #f2e6c9; border-color: rgba(242,230,201,.25); }
.clan-btn.danger { background: transparent; color: #e98a6b; border-color: rgba(233,138,107,.45); }
.clan-btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.clan-btn.block { display: flex; width: 100%; margin-top: 8px; }
.clan-danger { display: flex; flex-wrap: wrap; gap: 8px; }

.clan-form input, .clan-form textarea, .clan-inline-form input {
  width: 100%; box-sizing: border-box; padding: 9px 10px; border-radius: 8px;
  background: rgba(0,0,0,.35); color: #f2e6c9; border: 1px solid rgba(242,230,201,.2);
  font: inherit; font-size: 16px; /* 16px stops iOS zoom-on-focus */
}
.clan-form textarea { resize: vertical; }
.clan-inline-form { display: flex; gap: 8px; }
.clan-inline-form input { flex: 1; min-width: 0; }
.clan-label { display: block; margin: 12px 0 5px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: #EF9F27; }
.clan-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.clan-preview { display: flex; justify-content: center; padding: 6px 0 2px; }

/* Swatch / emblem picker — tap targets ≥ 40px */
.clan-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 7px; }
.clan-pick {
  position: relative; height: 44px; border-radius: 8px; cursor: pointer;
  border: 2px solid rgba(242,230,201,.15); background: rgba(255,255,255,.05);
  font-size: 22px; line-height: 1; padding: 0;
}
.clan-pick.on { border-color: #f4c95d; box-shadow: 0 0 0 2px rgba(244,201,93,.35); }
.clan-pick.locked { opacity: .45; }
.clan-lock { position: absolute; right: 2px; bottom: 1px; font-size: 11px; }

/* Lists */
.clan-list, .clan-roster, .clan-invites { list-style: none; margin: 8px 0 0; padding: 0; }
.clan-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; }
.clan-member {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 6px; min-height: 48px; cursor: pointer; color: inherit; font: inherit;
  background: none; border: none; border-bottom: 1px solid rgba(200,148,26,.08);
}
.clan-member:hover, .clan-member:active { background: rgba(244,201,93,.06); }
.clan-rank-ic { width: 26px; text-align: center; font-size: 18px; }
.clan-member-main, .clan-inv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.clan-member-name { font-size: 16px; color: #f2e6c9; overflow-wrap: anywhere; }
.clan-member-pts { font-size: 13px; color: #f4c95d; }
.clan-invites li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.clan-inv-actions { display: flex; gap: 6px; }

/* Action / confirm sheet inside the card */
.clan-sheet-wrap { display: none; position: absolute; inset: 0; z-index: 2; }
.clan-sheet-wrap.open { display: block; }
.clan-sheet-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.clan-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  background: #1c1610; border-top: 1px solid rgba(200,148,26,.35);
  border-radius: 14px 14px 0 0; animation: slideUp .18s ease;
}
.clan-sheet-title { font-family: 'Playfair Display', serif; font-size: 17px; color: #f4c95d; }
.clan-sheet-msg { margin: 6px 0 4px; color: rgba(242,230,201,.8); line-height: 1.45; }

/* Pending-invite dot on the comm-btn (desktop) */
.comm-btn.has-dot { position: relative; }
.comm-btn.has-dot::after {
  content: ''; position: absolute; top: 4px; right: 4px;
  width: 7px; height: 7px; border-radius: 50%; background: #d8642f;
}

/* ── Mobile shell: full-screen panel ── */
body.kw-shell #clan-panel { align-items: stretch; justify-content: stretch; backdrop-filter: none; }
body.kw-shell #clan-panel .clan-card {
  width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none;
  border-radius: 0; border: none;
  padding-top: env(safe-area-inset-top, 0px);
}
body.kw-shell #clan-panel .clan-body { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
body.kw-shell .kw-item.has-dot { position: relative; }
body.kw-shell .kw-item.has-dot::after {
  content: ''; position: absolute; top: 6px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%; background: #d8642f;
}

/* Activity feed */
.clan-feed { list-style: none; margin: 0; padding: 0; }
.clan-feed li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(200,148,26,.08); line-height: 1.4; }
.clan-feed-ic { width: 22px; text-align: center; flex-shrink: 0; }
.clan-feed-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.clan-feed-text b { color: #f4c95d; font-weight: 600; }
.clan-feed-when { display: block; font-size: 12px; color: rgba(242,230,201,.45); }

/* Territory */
.clan-terr-count { font-family: 'Playfair Display', serif; font-size: 34px; color: #f4c95d; min-width: 64px; text-align: center; }
.clan-terr-count span { font-size: 16px; color: rgba(242,230,201,.5); }
.clan-chip {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 18px; height: 22px; font-size: 11px;
  background: linear-gradient(180deg, var(--c1) 0 62%, var(--c2) 62% 100%);
  clip-path: polygon(0 0, 100% 0, 100% 84%, 50% 100%, 0 84%);
}
.clan-link { color: #f4c95d; text-decoration: underline; text-underline-offset: 2px; }
.clan-claim-btn { width: 100%; margin: 8px 0 4px; }
.clan-claim-na { margin: 8px 0 4px; font-size: 13px; color: rgba(242,230,201,.6); font-style: italic; }
.td-actions { margin: 10px 0 4px; }

/* ── Public clan profile (#clan-profile) — above the leaderboard ── */
.cp-backdrop { z-index: 100002; }
.cp-card { width: 560px; }
.cp-close { position: absolute; top: 10px; right: 10px; z-index: 2; }
.cp-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.cp-hero {
  display: flex; align-items: center; gap: 16px; padding: 22px 48px 18px 20px;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(17,14,9,.95) 100%),
    linear-gradient(120deg, color-mix(in srgb, var(--c1) 55%, transparent), color-mix(in srgb, var(--c2) 30%, transparent));
  border-bottom: 1px solid rgba(200,148,26,.2);
}
.cp-hero-text { min-width: 0; }
.cp-name { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; color: #f4c95d; overflow-wrap: anywhere; line-height: 1.15; }
.cp-sub { font-size: 14px; color: rgba(242,230,201,.75); margin-top: 2px; }
.cp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cp-tags:empty { display: none; }
.cp-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 11px; font-size: 12.5px;
  background: rgba(0,0,0,.35); border: 1px solid rgba(242,230,201,.2); color: #f2e6c9;
}
.cp-tag.mine { border-color: rgba(244,201,93,.55); color: #f4c95d; }
.cp-tag.rec { border-color: rgba(192,221,151,.5); color: #C0DD97; }
.cp-body { padding: 6px 18px 18px; }
.cp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 4px; }
.cp-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; text-align: center;
  border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(200,148,26,.14);
}
.cp-stat-v { font-family: 'Playfair Display', serif; font-size: 20px; color: #f4c95d; line-height: 1.1; }
.cp-stat-v small { font-size: 13px; color: rgba(242,230,201,.5); }
.cp-stat-k { font-size: 11.5px; letter-spacing: .04em; color: rgba(242,230,201,.6); }
.cp-honors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cp-honors.stub { opacity: .45; }
.cp-hint { margin-top: 6px; font-style: italic; }
.cp-group, .clan-roster .cp-group {
  list-style: none; padding: 10px 4px 3px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #EF9F27;
}
.cp-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
@media (max-width: 520px) { .cp-stats { grid-template-columns: repeat(2, 1fr); } }
body.kw-shell #clan-profile { align-items: stretch; justify-content: stretch; backdrop-filter: none; }
body.kw-shell #clan-profile .clan-card {
  width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; border: none;
  padding-top: env(safe-area-inset-top, 0px);
}
body.kw-shell #clan-profile .cp-body { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }

/* ── Roster polish ── */
.clan-roster-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.clan-sort { font-size: 13px; color: rgba(242,230,201,.6); display: inline-flex; align-items: center; gap: 6px; }
.clan-sort select {
  min-height: 34px; padding: 3px 8px; border-radius: 8px; font: inherit; font-size: 14px;
  background: rgba(0,0,0,.35); color: #f2e6c9; border: 1px solid rgba(242,230,201,.2);
}
.clan-search {
  width: 100%; box-sizing: border-box; margin-bottom: 4px; padding: 8px 10px; border-radius: 8px;
  background: rgba(0,0,0,.35); color: #f2e6c9; border: 1px solid rgba(242,230,201,.2); font: inherit; font-size: 16px;
}
.clan-rank-ic { position: relative; }
.clan-presence {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: 1px;
  background: rgba(242,230,201,.22); box-shadow: 0 0 0 2px #15110b;
}
.clan-presence.on { background: #7fd08a; }
.clan-rank-ic .clan-presence { position: absolute; right: -1px; bottom: 1px; }
.cp-roster .clan-presence { flex-shrink: 0; margin: 0 4px 0 2px; }
.clan-online { color: #9fdca8; }
.clan-title-chip {
  display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 9px; vertical-align: 2px;
  font-size: 11.5px; font-style: italic; color: #f4c95d; background: rgba(244,201,93,.1); border: 1px solid rgba(244,201,93,.3);
}
.clan-member-pts { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; white-space: nowrap; }
.clan-share { display: block; width: 54px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.clan-share > span { display: block; height: 100%; background: #c8941a; }
.clan-sheet-note { margin-top: 8px; }
.clan-btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.clan-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; cursor: pointer; line-height: 1.35; }
.clan-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: #c8941a; flex-shrink: 0; }

/* Clan line on player profiles */
.pm-clan { margin-top: 4px; }
.pm-clan-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 6px; border-radius: 14px; cursor: pointer;
  background: rgba(0,0,0,.3); border: 1px solid rgba(200,148,26,.35);
  color: #e8dcc0; font-family: 'Crimson Pro', Georgia, serif; font-size: 13.5px; line-height: 1.3; text-align: left;
}
.pm-clan-btn b { color: #f4c95d; font-weight: 600; }
.pm-clan-btn:hover { border-color: rgba(244,201,93,.65); background: rgba(244,201,93,.08); }

/* Profile modals: taller before they scroll, and no native scrollbar
   squeezed inside the ornate frame (wheel / touch still scroll). */
.profile-modal-box { max-height: 92vh; scrollbar-width: none; }
.profile-modal-box::-webkit-scrollbar { display: none; }

/* ── Unlocks timeline ── */
.clan-tl-intro { margin: 2px 0 14px; }
.clan-tl { list-style: none; margin: 0; padding: 0 0 4px; position: relative; }
.clan-tl-node { position: relative; display: flex; gap: 14px; padding-bottom: 14px; }
/* Track segment from this node down to the next */
.clan-tl-node::before {
  content: ''; position: absolute; left: 17px; top: 36px; bottom: -2px; width: 3px; border-radius: 2px;
  background: rgba(242,230,201,.12);
}
.clan-tl-node:last-child::before { display: none; }
.clan-tl-node.done::before { background: linear-gradient(180deg, #f4c95d, #c8941a); }
.clan-tl-node.current::before { background: linear-gradient(180deg, #c8941a, rgba(242,230,201,.12)); }
.clan-tl-dot {
  flex-shrink: 0; width: 37px; height: 37px; border-radius: 50%; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-weight: 700; font-size: 16px;
  background: #1a1510; color: rgba(242,230,201,.35); border: 2px solid rgba(242,230,201,.15);
}
.clan-tl-node.done .clan-tl-dot { background: linear-gradient(160deg, #f4c95d, #b07f16); color: #2a1a05; border-color: #f4c95d; }
.clan-tl-node.current .clan-tl-dot {
  background: linear-gradient(160deg, #ffe08a, #d9a326); color: #2a1a05; border-color: #fff1c4;
  box-shadow: 0 0 0 4px rgba(244,201,93,.18), 0 0 18px rgba(244,201,93,.55);
  animation: clanTlPulse 2.4s ease-in-out infinite;
}
.clan-tl-node.next .clan-tl-dot { color: #f4c95d; border-color: rgba(244,201,93,.55); border-style: dashed; }
@keyframes clanTlPulse { 50% { box-shadow: 0 0 0 7px rgba(244,201,93,.08), 0 0 24px rgba(244,201,93,.7); } }
.clan-tl-card {
  flex: 1; min-width: 0; padding: 9px 12px 10px; border-radius: 10px;
  background: rgba(255,255,255,.025); border: 1px solid rgba(242,230,201,.08);
}
.clan-tl-node.done .clan-tl-card { background: rgba(244,201,93,.06); border-color: rgba(244,201,93,.25); }
.clan-tl-node.current .clan-tl-card {
  background: linear-gradient(135deg, rgba(244,201,93,.16), rgba(244,201,93,.05)); border-color: rgba(244,201,93,.6);
}
.clan-tl-node.next .clan-tl-card { border-color: rgba(244,201,93,.3); border-style: dashed; }
.clan-tl-node.locked .clan-tl-card, .clan-tl-node.next .clan-tl-card { filter: saturate(.25); }
.clan-tl-node.locked .clan-tl-card { opacity: .5; }
.clan-tl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.clan-tl-title { font-family: 'Playfair Display', serif; font-size: 16px; color: #f2e6c9; }
.clan-tl-node.done .clan-tl-title, .clan-tl-node.current .clan-tl-title { color: #f4c95d; }
.clan-tl-badge { font-size: 12px; color: #C0DD97; }
.clan-tl-badge.here { color: #fff1c4; font-weight: 600; }
.clan-tl-badge.lock { color: rgba(242,230,201,.6); }
.clan-perks { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0 3px; }
.clan-perk {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 16px; font-size: 13.5px;
  background: rgba(0,0,0,.28); border: 1px solid rgba(242,230,201,.14); color: #f2e6c9;
}
.clan-perk-ic {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,.06); font-size: 14px;
}
.clan-tl-node.done .clan-perk, .clan-tl-node.current .clan-perk { border-color: rgba(244,201,93,.35); }
.clan-tl-node.done .clan-perk-ic, .clan-tl-node.current .clan-perk-ic { background: rgba(244,201,93,.2); }
.clan-tl-node.locked .clan-perk-ic, .clan-tl-node.next .clan-perk-ic { filter: grayscale(1); }
.clan-tl-grow { font-size: 12.5px; color: rgba(242,230,201,.55); margin-top: 3px; }
.clan-tl-card .clan-bar { margin-top: 8px; }

/* Next-unlock teaser on Overview */
.clan-next-unlock {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 12px 0 6px; padding: 10px 12px; text-align: left;
  border-radius: 10px; cursor: pointer; font: inherit; color: #f2e6c9;
  background: linear-gradient(135deg, rgba(244,201,93,.1), rgba(244,201,93,.02)); border: 1px dashed rgba(244,201,93,.4);
}
.clan-next-unlock:hover { border-style: solid; }
.clan-next-ic { font-size: 22px; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.3); filter: grayscale(.6); }
.clan-next-go { margin-left: auto; font-size: 13px; color: #f4c95d; white-space: nowrap; }
.clan-tab-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #d8642f; vertical-align: 2px; margin-left: 2px; }

/* Recruitment */
.clan-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin-bottom: 8px;
  border-radius: 10px; background: rgba(0,0,0,.3); border: 1px solid rgba(242,230,201,.12); }
.clan-seg-btn {
  min-height: 40px; padding: 6px 6px; border-radius: 7px; cursor: pointer; border: 1px solid transparent;
  background: transparent; color: rgba(242,230,201,.7); font: inherit; font-size: 14px;
}
.clan-seg-btn:hover { color: #f2e6c9; background: rgba(255,255,255,.04); }
.clan-seg-btn.on { color: #2a1a05; background: linear-gradient(180deg, #f4c95d, #c8941a); font-weight: 600; }
.clan-policy-line { margin-bottom: 4px; }
.clan-subhead { margin: 14px 0 4px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #EF9F27; font-weight: 500; }
.clan-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #d8642f; color: #fff; font-size: 11px; letter-spacing: 0; vertical-align: 1px;
}
.clan-requests { list-style: none; margin: 4px 0 0; padding: 0; }
.clan-requests li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(200,148,26,.08); }
.clan-req-msg { font-style: italic; font-size: 14px; color: rgba(242,230,201,.8); overflow-wrap: anywhere; }

/* Public profile join area */
.cp-ask { display: flex; flex-direction: column; gap: 8px; }
.cp-ask textarea {
  width: 100%; box-sizing: border-box; padding: 9px 10px; border-radius: 8px; resize: vertical;
  background: rgba(0,0,0,.35); color: #f2e6c9; border: 1px solid rgba(242,230,201,.2); font: inherit; font-size: 16px;
}
.cp-pending { padding: 9px 12px; border-radius: 8px; background: rgba(192,221,151,.08); border: 1px solid rgba(192,221,151,.3); color: #C0DD97; }
@media (max-width: 420px) { .clan-seg-btn { font-size: 12.5px; } }

/* Six tabs: let the bar scroll sideways on narrow screens */
.clan-tabs { overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.clan-tabs::-webkit-scrollbar { display: none; }
.clan-tab { white-space: nowrap; flex-shrink: 0; }

/* ── Clan quests (Quests tab) ── */
.cq-intro { margin: 0 0 4px; }
.cq-h-note { font-family: 'Crimson Pro', Georgia, serif; font-size: 12.5px; font-weight: 400; margin-left: 6px; }
.cq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.cq-card, .cq-run {
  display: flex; flex-direction: column; gap: 6px; padding: 11px 12px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(200,148,26,.2);
}
.cq-card.locked { opacity: .5; filter: saturate(.3); }
.cq-run { margin-bottom: 10px; }
.cq-run.forming { border-color: rgba(192,221,151,.4); background: rgba(192,221,151,.05); }
.cq-run.active { border-color: rgba(244,201,93,.4); }
.cq-card-head { display: flex; align-items: flex-start; gap: 10px; }
.cq-ic {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 19px; background: rgba(0,0,0,.3); border: 1px solid rgba(244,201,93,.25);
}
.cq-ic.sm { width: 22px; height: 22px; font-size: 12px; }
.cq-title { font-family: 'Playfair Display', serif; font-size: 15.5px; color: #f4c95d; line-height: 1.2; }
.cq-desc { margin: 0; font-size: 14px; line-height: 1.4; color: rgba(242,230,201,.8); }
.cq-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.cq-chip { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: rgba(0,0,0,.3); border: 1px solid rgba(242,230,201,.15); }
.cq-rewards { font-size: 13px; color: #C0DD97; }
.cq-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 2px; }
.cq-foot .cq-rewards { margin-right: auto; }
.cq-state { font-size: 13px; }
.cq-state.lock { color: rgba(242,230,201,.6); }
.cq-state.done { color: #C0DD97; }
.cq-state.run { color: #f4c95d; }
.cq-eta { margin-left: auto; font-family: 'Playfair Display', serif; color: #f4c95d; white-space: nowrap; }
.cq-roles { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.cq-role {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 8px;
  background: rgba(0,0,0,.22); border: 1px dashed rgba(242,230,201,.2);
}
.cq-role.filled { border-style: solid; border-color: rgba(244,201,93,.3); }
.cq-role.mine { background: rgba(244,201,93,.08); }
.cq-role-name { font-weight: 600; min-width: 64px; color: #e8d0a0; }
.cq-role-who { flex: 1; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.cq-recent { list-style: none; margin: 0; padding: 0; }
.cq-recent li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: 14px; border-bottom: 1px solid rgba(200,148,26,.08); }
.cq-recent-completed .cq-ic { color: #9fdca8; }
.cq-recent-failed .cq-ic, .cq-recent-expired .cq-ic { color: rgba(242,230,201,.5); }

/* Citizen picker (inside the panel's action sheet) */
.clan-sheet { max-height: 80%; overflow-y: auto; }
.cq-role-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 4px; padding: 4px; margin: 6px 0;
  border-radius: 10px; background: rgba(0,0,0,.3); }
.cq-pick { list-style: none; margin: 8px 0 0; padding: 0; }
.cq-pick-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 8px 10px; text-align: left; cursor: pointer;
  background: none; border: none; border-bottom: 1px solid rgba(200,148,26,.1); color: #f2e6c9; font: inherit;
}
.cq-pick-btn:hover:not([disabled]) { background: rgba(244,201,93,.07); }
.cq-pick-btn[disabled] { opacity: .45; cursor: default; }
.cq-pick-name { font-size: 16px; }
.cq-pick-chance { margin-left: auto; font-family: 'Playfair Display', serif; color: #f4c95d; }
.cq-pick-btn .clan-muted { margin-left: 4px; }

/* Quest admin (Dev Tools): clan fields */
.ce-grid--5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 520px) { .ce-grid--5 { grid-template-columns: repeat(3, 1fr); } }
.qa-src-tag { font-size: 9.5px; padding: 0 5px; border-radius: 6px; margin-left: 4px; background: rgba(244,201,93,.14); color: #f4c95d; vertical-align: 1px; }
.qa-hint { margin-top: 6px; font-size: 10.5px; line-height: 1.4; color: rgba(192,221,151,.55); font-style: italic; }

/* Clan quests: rotation, teasers, battles */
.cq-rotation {
  display: inline-block; margin: 2px 0 6px; padding: 4px 11px; border-radius: 14px; font-size: 13px;
  background: rgba(244,201,93,.08); border: 1px solid rgba(244,201,93,.25); color: #e8d0a0;
}
.cq-rotation b { color: #f4c95d; font-weight: 600; }
.cq-chip.danger { border-color: rgba(233,138,107,.45); color: #f0a488; background: rgba(233,138,107,.08); }
.cq-locked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 0 2px; font-size: 13px; }
.cq-locked-item { padding: 2px 9px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px dashed rgba(242,230,201,.18); color: rgba(242,230,201,.6); filter: saturate(.3); }
.cq-battle { font-size: 13.5px; padding: 6px 9px; border-radius: 8px; }
.cq-battle.won { background: rgba(192,221,151,.08); color: #C0DD97; }
.cq-battle.lost { background: rgba(233,138,107,.08); color: #f0a488; }
.cq-won { font-size: 12.5px; color: #C0DD97; margin-left: 4px; }
.cq-log { margin-top: 4px; font-size: 12.5px; color: rgba(242,230,201,.75); }
.cq-log summary { cursor: pointer; color: rgba(244,201,93,.8); width: max-content; }
.cq-log ol { margin: 6px 0 0; padding-left: 20px; max-height: 200px; overflow-y: auto; }
.cq-log li { padding: 1px 0; }
