/* ═══════════════════════════════════════════════════════════════════════
   Medallion XLN — Components v2.0
   /community/assets/css/xln.css
   
   Requires tokens.css to be loaded first.
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── APP SHELL ───────────────────────────────────────────────────── */
.xln-app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
}
.xln-app__nav {
    background: var(--surface-1);
    border-right: 1px solid var(--border-subtle);
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.xln-app__main {
    min-width: 0;
    padding: 32px;
}
@media (max-width: 900px) {
    .xln-app { grid-template-columns: 1fr; }
    .xln-app__nav { display: none; }
    .xln-app__main { padding: 16px; }
}

/* ─── HERO ────────────────────────────────────────────────────────── */
.xln-hero {
    background: linear-gradient(135deg, var(--surface-1) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 28px 32px;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}
.xln-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
    opacity: 0.5;
}
.xln-hero__eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}
.xln-hero__title {
    font-family: var(--font-display);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    color: var(--text-primary);
}
.xln-hero__subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 0;
    max-width: 60ch;
}

/* ─── PULSE BAR (metric strip) ────────────────────────────────────── */
.xln-pulse {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.xln-metric {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color var(--t-base);
}
.xln-metric:hover { border-color: var(--border-default); }
.xln-metric__label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--text-tertiary);
}
.xln-metric__value {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.xln-metric__delta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}
.xln-metric__delta--up { color: var(--success); }
.xln-metric__delta--down { color: var(--danger); }

/* ─── ROLE PILLS ──────────────────────────────────────────────────── */
.xln-role {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-family: var(--font-body);
    line-height: 1;
    white-space: nowrap;
}
.xln-role__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.xln-role--operator    { background: var(--role-operator-soft);    color: var(--role-operator); }
.xln-role--operator    .xln-role__dot { background: var(--role-operator); }
.xln-role--steward     { background: var(--role-steward-soft);     color: var(--role-steward); }
.xln-role--steward     .xln-role__dot { background: var(--role-steward); }
.xln-role--verifier    { background: var(--role-verifier-soft);    color: var(--role-verifier); }
.xln-role--verifier    .xln-role__dot { background: var(--role-verifier); }
.xln-role--builder     { background: var(--role-builder-soft);     color: var(--role-builder); }
.xln-role--builder     .xln-role__dot { background: var(--role-builder); }
.xln-role--participant { background: var(--role-participant-soft); color: var(--text-secondary); }
.xln-role--participant .xln-role__dot { background: var(--text-tertiary); }
.xln-role--candidate   { background: var(--role-candidate-soft);   color: var(--text-tertiary); border: 1px dashed var(--border-default); }
.xln-role--candidate   .xln-role__dot { background: var(--text-quaternary); }

/* ─── AVATAR ──────────────────────────────────────────────────────── */
.xln-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    color: var(--surface-0);
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    flex-shrink: 0;
    user-select: none;
}
.xln-avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.xln-avatar--lg { width: 48px; height: 48px; font-size: 18px; }
.xln-avatar--xl { width: 72px; height: 72px; font-size: 26px; }

.xln-avatar-stack { display: inline-flex; }
.xln-avatar-stack > * { margin-left: -8px; border: 2px solid var(--surface-1); box-shadow: 0 0 0 1px var(--border-subtle); }
.xln-avatar-stack > *:first-child { margin-left: 0; }

/* ─── BUTTONS ─────────────────────────────────────────────────────── */
.xln-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--t-fast);
    text-decoration: none;
    white-space: nowrap;
}
.xln-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.xln-btn--primary {
    background: var(--accent);
    color: var(--surface-0);
    border-color: var(--accent);
}
.xln-btn--primary:hover:not(:disabled) {
    background: var(--xln-gold-bright);
    box-shadow: var(--glow-sm);
}
.xln-btn--secondary {
    background: var(--surface-2);
    color: var(--text-primary);
    border-color: var(--border-default);
}
.xln-btn--secondary:hover:not(:disabled) {
    background: var(--surface-3);
    border-color: var(--border-strong);
}
.xln-btn--ghost {
    background: transparent;
    color: var(--text-secondary);
}
.xln-btn--ghost:hover:not(:disabled) {
    background: var(--surface-2);
    color: var(--text-primary);
}
.xln-btn--sm { padding: 6px 10px; font-size: 12px; }
.xln-btn--lg { padding: 14px 20px; font-size: 15px; }

/* ─── CARDS ───────────────────────────────────────────────────────── */
.xln-card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--card-pad);
    transition: border-color var(--t-base), transform var(--t-base);
}
.xln-card:hover { border-color: var(--border-default); }
.xln-card--clickable { cursor: pointer; }
.xln-card--clickable:hover { transform: translateY(-2px); border-color: var(--accent); }

.xln-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.xln-card__title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
}

/* ─── BOUNTY CARD (signature pattern 1) ───────────────────────────── */
.xln-bounty {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: grab;
    transition: all var(--t-base);
    position: relative;
}
.xln-bounty:hover {
    border-color: var(--border-default);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.xln-bounty:active { cursor: grabbing; }
.xln-bounty__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.xln-bounty__title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
}
.xln-bounty__payout {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.xln-bounty__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}
.xln-bounty__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.xln-bounty__chain {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-hairline);
}
.xln-bounty__chain-stages {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.xln-bounty__chain-arrow { color: var(--text-quaternary); }

/* ─── KANBAN ──────────────────────────────────────────────────────── */
.xln-kanban {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 1100px) {
    .xln-kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .xln-kanban { grid-template-columns: 1fr; }
}
.xln-kanban__col {
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    padding: 12px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.xln-kanban__col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 8px;
    border-bottom: 1px solid var(--border-hairline);
    margin-bottom: 4px;
}
.xln-kanban__col-title {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
}
.xln-kanban__col-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    background: var(--surface-3);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
}

/* ─── GOVERNANCE BAR (signature pattern 2) ────────────────────────── */
.xln-vote {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.xln-vote__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.xln-vote__title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px;
    line-height: 1.3;
}
.xln-vote__id {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.10em;
}
.xln-vote__deadline {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--warning);
    white-space: nowrap;
}
.xln-vote__bar {
    height: 8px;
    background: var(--surface-3);
    border-radius: var(--radius-pill);
    overflow: hidden;
    display: flex;
    margin-bottom: 10px;
}
.xln-vote__bar-yes { background: var(--success); height: 100%; transition: width var(--t-slow); }
.xln-vote__bar-no  { background: var(--danger);  height: 100%; transition: width var(--t-slow); }
.xln-vote__bar-abstain { background: var(--text-quaternary); height: 100%; transition: width var(--t-slow); }
.xln-vote__stats {
    display: flex;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    margin-bottom: 16px;
}
.xln-vote__stat-yes { color: var(--success); }
.xln-vote__stat-no  { color: var(--danger); }
.xln-vote__stat-abstain { color: var(--text-tertiary); }
.xln-vote__quorum {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.xln-vote__quorum-met { color: var(--success); }
.xln-vote__actions { display: flex; gap: 8px; }
.xln-vote__actions .xln-btn { flex: 1; }

/* ─── CONTRIBUTION LOG (signature pattern 3) ──────────────────────── */
.xln-log {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.xln-log__row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: var(--row-pad-y) 16px;
    border-bottom: 1px solid var(--border-hairline);
    transition: background var(--t-fast);
}
.xln-log__row:last-child { border-bottom: 0; }
.xln-log__row:hover { background: var(--surface-2); }
.xln-log__icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.xln-log__icon--task     { background: var(--success-soft); color: var(--success); }
.xln-log__icon--vote     { background: var(--role-steward-soft); color: var(--role-steward); }
.xln-log__icon--post     { background: var(--info-soft); color: var(--info); }
.xln-log__icon--join     { background: var(--accent-soft); color: var(--accent); }
.xln-log__icon--proposal { background: var(--role-steward-soft); color: var(--role-steward); }
.xln-log__body { min-width: 0; }
.xln-log__title {
    font-size: 13px;
    color: var(--text-primary);
    margin: 0 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.xln-log__title strong { color: var(--text-primary); font-weight: 600; }
.xln-log__meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}
.xln-log__time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
}
.xln-log__hash {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-quaternary);
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* ─── COMPOSER ────────────────────────────────────────────────────── */
.xln-composer {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 24px;
}
.xln-composer__modes {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    padding: 4px;
    background: var(--surface-2);
    border-radius: var(--radius-md);
}
.xln-composer__mode {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--t-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.xln-composer__mode:hover { color: var(--text-secondary); }
.xln-composer__mode--active {
    background: var(--surface-1);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}
.xln-composer__field {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color var(--t-fast);
}
.xln-composer__field:focus {
    outline: none;
    border-color: var(--accent);
}
.xln-composer__field--textarea {
    resize: vertical;
    min-height: 80px;
    font-family: var(--font-body);
}
.xln-composer__row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.xln-composer__row .xln-composer__field { flex: 1; }
.xln-composer__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-hairline);
}
.xln-composer__hint {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ─── MEMBER ROW ──────────────────────────────────────────────────── */
.xln-member {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: var(--row-pad-y) 16px;
    border-bottom: 1px solid var(--border-hairline);
    transition: background var(--t-fast);
}
.xln-member:hover { background: var(--surface-2); }
.xln-member__name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 2px;
}
.xln-member__handle {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ─── COMMUNITY CARD (browser) ────────────────────────────────────── */
.xln-community {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--t-base);
    display: flex;
    flex-direction: column;
}
.xln-community:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}
.xln-community__cover {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
    background-size: cover;
    background-position: center;
    position: relative;
}
.xln-community__cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.6) 100%);
}
.xln-community__body { padding: 16px; }
.xln-community__name {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text-primary);
}
.xln-community__desc {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 0 0 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.xln-community__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ─── NAV ─────────────────────────────────────────────────────────── */
.xln-nav__brand {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 24px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.xln-nav__brand-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}
.xln-nav__section {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-quaternary);
    margin: 16px 0 8px 12px;
}
.xln-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--t-fast);
    margin-bottom: 2px;
}
.xln-nav__item:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}
.xln-nav__item--active {
    background: var(--accent-soft);
    color: var(--accent);
}
.xln-nav__item-badge {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10px;
    background: var(--surface-3);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    color: var(--text-tertiary);
}

/* ─── UTILITIES ───────────────────────────────────────────────────── */
.xln-section { margin-bottom: 24px; }
.xln-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.xln-section-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--text-secondary);
    margin: 0;
}
.xln-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
@media (max-width: 900px) { .xln-grid-2 { grid-template-columns: 1fr; } }

.xln-stack { display: flex; flex-direction: column; gap: var(--gap-cozy); }
.xln-stack--tight { gap: var(--gap-tight); }
.xln-stack--loose { gap: var(--gap-loose); }
.xln-row { display: flex; align-items: center; gap: var(--gap-cozy); }
.xln-spacer { flex: 1; }

.xln-muted { color: var(--text-tertiary); }
.xln-mono { font-family: var(--font-mono); }

/* Community cards — display font uniformity (matches invite page) */
.xln-community__name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.xln-community__desc { font-family: 'Inter', sans-serif; }
.xln-community__foot { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.xln-section-title { font-family: 'Space Grotesk', sans-serif; }
