/* Authentic Aion Stigma Planner */
.sp-shell { display: grid; gap: 1rem; }

.sp-toolbar {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem;
    padding: .95rem 1.15rem; background: var(--kb-surface);
    border: 1px solid var(--kb-border); border-top: 2px solid var(--au-gold-line); border-radius: 8px;
}
.sp-toolbar__group { display: grid; gap: .3rem; }
.sp-toolbar__group label, .sp-field-label {
    font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em;
    color: var(--au-muted); display: flex; align-items: center; gap: .45rem;
}
.sp-cap-pill {
    padding: .08rem .42rem; border-radius: 999px; background: #162840; border: 1px solid #355880;
    color: #9ecbff; font-size: .68rem; text-transform: none; letter-spacing: 0;
}
.sp-select, .sp-level-input, .sp-filter-input, .sp-share-box input {
    min-height: 36px; padding: .35rem .65rem; border-radius: 5px;
    border: 1px solid var(--kb-border); background: #09121e; color: var(--au-text);
    color-scheme: dark; font: inherit; font-size: .88rem;
}
.sp-level-input { width: 82px; text-align: center; font-variant-numeric: tabular-nums; }
.sp-faction-toggle { display: inline-flex; border: 1px solid var(--kb-border); border-radius: 5px; overflow: hidden; }
.sp-faction-btn {
    min-height: 36px; padding: .35rem .85rem; border: 0; background: #0a1421; color: var(--au-muted);
    font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer;
}
.sp-faction-btn + .sp-faction-btn { border-left: 1px solid var(--kb-border); }
.sp-faction-btn.is-active[data-sp-race="Elyos"] { background: #18324c; color: #9fe0ff; }
.sp-faction-btn.is-active[data-sp-race="Asmodian"] { background: #2c1c3e; color: #dfb8ff; }

.sp-toolbar__import { min-width: 220px; }
.sp-import-row { display: flex; gap: .4rem; align-items: center; }
.sp-signin-link {
    display: inline-flex; align-items: center; min-height: 36px; font-size: .84rem;
    color: var(--au-gold); text-decoration: none;
}
.sp-signin-link:hover { text-decoration: underline; color: var(--au-gold-hi); }

.sp-toolbar__actions { display: flex; gap: .45rem; margin-left: auto; align-items: center; }
.sp-btn-sm { min-height: 36px; padding: .42rem .9rem; font-size: .78rem; }
.sp-btn-ghost {
    min-height: 36px; padding: .4rem .8rem; border-radius: 5px; border: 1px solid var(--kb-border);
    background: #0d1828; color: var(--au-soft); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.sp-btn-ghost:hover { border-color: var(--au-gold-line); color: var(--au-gold-hi); }

.sp-status-bar {
    padding: .65rem .95rem; border-radius: 6px; border: 1px solid #355880; background: #102136;
    color: #c2e0ff; font-size: .86rem;
}
.sp-status-bar[data-tone="warn"] { border-color: #9e6b24; background: #261c0e; color: #f6cd7d; }
.sp-status-bar[data-tone="ok"] { border-color: #2f7d5b; background: #0f261e; color: #7ae8b2; }

.sp-stage { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 1rem; align-items: start; }

/* Authentic In-Game Stigma Socket Panel (bronze 2x3 + blue 2x3 with locked 6th slot) */
.sp-sockets-card {
    padding: 1.05rem; border-radius: 8px; border: 1px solid #3a3226;
    background: radial-gradient(ellipse at 50% 0, #2c2419 0, #16130f 55%, #0f131b 100%);
    display: grid; gap: .95rem; position: sticky; top: 1rem;
}
.sp-sockets-card__head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sp-sockets-card__head h2 { margin: 0; font-size: 1.05rem; color: var(--au-gold-hi); }
.sp-costs { display: flex; gap: .5rem; }
.sp-cost-chip {
    display: inline-flex; align-items: center; gap: .32rem; padding: .2rem .55rem;
    border-radius: 5px; border: 1px solid #3d3324; background: #13110d;
    font-size: .8rem; font-variant-numeric: tabular-nums;
}
.sp-cost-chip small { color: var(--au-muted); font-size: .7rem; }
.sp-cost-dot { width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); }
.sp-cost-dot--shard { background: linear-gradient(135deg, #a6d8ff, #4c7db8); }
.sp-cost-dot--ap { background: linear-gradient(135deg, #ffe285, #c98c24); border-radius: 50%; transform: none; }

.sp-socket-panels { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.sp-socket-group { display: grid; gap: .45rem; }
.sp-socket-group__label {
    display: flex; justify-content: space-between; font-size: .74rem; color: #c7b89c;
    text-transform: uppercase; letter-spacing: .06em;
}
.sp-socket-grid { display: grid; grid-template-columns: repeat(2, 64px); gap: 10px; justify-content: center; }

/* Ornate Aion diamond/bevel socket matching in-game UI */
.sp-socket {
    position: relative; width: 64px; height: 64px; padding: 0; border: 0; background: transparent;
    cursor: pointer; display: grid; place-items: center;
}
.sp-socket::before {
    content: ""; position: absolute; inset: 0;
    clip-path: polygon(22% 0%, 78% 0%, 100% 22%, 100% 78%, 78% 100%, 22% 100%, 0% 78%, 0% 22%);
    box-shadow: inset 0 0 0 2px #6d5c40, inset 0 0 12px #000;
    background: linear-gradient(145deg, #5c4e38, #2d251a 52%, #4a3f2d);
}
.sp-socket--greater::before {
    box-shadow: inset 0 0 0 2px #4c6c8f, inset 0 0 12px #000;
    background: linear-gradient(145deg, #3c5d80, #162739 52%, #2c4a6b);
}
.sp-socket__inner {
    position: relative; z-index: 1; width: 44px; height: 44px;
    border: 2px solid #8a7859; background: radial-gradient(circle at 50% 42%, #2b241c, #120f0c 72%);
    box-shadow: inset 0 0 8px #000000cc; display: grid; place-items: center; overflow: hidden;
}
.sp-socket--greater .sp-socket__inner {
    border-color: #6b8eb5; background: radial-gradient(circle at 50% 42%, #1d3247, #0c1622 72%);
}
.sp-socket__inner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-socket.is-filled .sp-socket__inner { border-color: #e6c677; box-shadow: 0 0 10px #d9b56c55; }
.sp-socket--greater.is-filled .sp-socket__inner { border-color: #84c5ff; box-shadow: 0 0 12px #5ea8f566; }
.sp-socket__crest {
    width: 24px; height: 24px; border-radius: 50%;
    border: 1px solid #ffffff1c; background: radial-gradient(circle, #ffffff10, transparent 70%);
}
.sp-socket--locked { cursor: not-allowed; }
.sp-socket--locked .sp-socket__inner {
    border-color: #9aa2ab;
    background: radial-gradient(circle at 38% 35%, #d6dadf, #8e959c 55%, #555b62 100%);
    box-shadow: inset 0 2px 4px #ffffff88, inset 0 -4px 8px #00000088;
}
.sp-socket--locked .sp-socket__lock {
    font-size: .68rem; font-weight: 800; letter-spacing: .04em; color: #2b3036;
    text-shadow: 0 1px 0 #ffffff88;
}
.sp-socket__rank {
    position: absolute; left: 2px; bottom: 1px; z-index: 2; padding: 0 3px;
    background: #070b12e6; border: 1px solid #594b34; border-radius: 2px;
    color: #f6dc8d; font-size: .62rem; font-weight: 800; line-height: 1.25;
}
.sp-socket--greater .sp-socket__rank { border-color: #3c6591; color: #9fd4ff; }

.sp-share-box { display: grid; gap: .3rem; }
.sp-share-box label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--au-muted); font-weight: 650; }
.sp-share-box__row { display: flex; gap: .35rem; }
.sp-share-box input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: .76rem; }

.sp-equipped-list-wrap h3 { margin: 0 0 .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--au-muted); }
.sp-equipped-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; max-height: 240px; overflow: auto; }
.sp-equipped-item {
    display: flex; align-items: center; gap: .5rem; padding: .28rem .45rem;
    border-radius: 5px; background: #141923; border: 1px solid #263448; font-size: .8rem;
}
.sp-equipped-item img { width: 24px; height: 24px; border-radius: 3px; }
.sp-equipped-item__tag {
    margin-left: auto; font-size: .66rem; padding: .08rem .35rem; border-radius: 4px;
    background: #232018; color: #e2be76; border: 1px solid #5b4929;
}
.sp-equipped-item__tag--greater { background: #122338; color: #8fc8ff; border-color: #2f5c8a; }
.sp-equipped-empty { color: var(--au-muted); font-size: .82rem; margin: 0; }

/* Greater Stigma Tree (authentic 2-branch horizontal flow with orthogonal connectors) */
.sp-trees-col { display: grid; gap: 1rem; min-width: 0; }
.sp-tree-card, .sp-normal-card {
    padding: 1.05rem 1.2rem; background: var(--kb-surface);
    border: 1px solid var(--kb-border); border-radius: 8px; min-width: 0;
}
.sp-tree-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.sp-tree-card__head h2 { margin: 0; font-size: 1.05rem; color: var(--au-gold-hi); }
.sp-tree-hint { font-size: .78rem; color: var(--au-muted); }

.sp-branches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.sp-branch {
    position: relative; padding: .9rem; border-radius: 8px;
    border: 1px solid #3d3324; background: linear-gradient(180deg, #211c14, #141720);
    overflow-x: auto;
}
.sp-branch__title {
    margin: 0 0 .65rem; font-size: .76rem; text-transform: uppercase; letter-spacing: .1em;
    color: #d6b676; font-weight: 700;
}
.sp-branch__canvas { position: relative; width: 356px; height: 296px; margin: 0 auto; }
.sp-branch__svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sp-branch__svg path { fill: none; stroke: #8c7b58; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sp-branch__svg path.is-met { stroke: #f2cf7c; filter: drop-shadow(0 0 4px #e5bd6488); }

.sp-node {
    position: absolute; width: 52px; height: 52px; padding: 0; border-radius: 4px;
    border: 2px solid #756445; background: #141923; cursor: pointer;
    display: grid; place-items: center; overflow: hidden;
    box-shadow: 0 0 0 2px #0b0e14; transition: transform .12s, border-color .15s, box-shadow .15s;
}
.sp-node--greater { border-color: #4673a3; }
.sp-node img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.75) brightness(.82); }
.sp-node:hover, .sp-node:focus-visible { transform: scale(1.06); border-color: #f3d282; z-index: 3; }
.sp-node.is-equipped { border-color: #f5ce6b; box-shadow: 0 0 0 2px #0b0e14, 0 0 14px #f5ce6b99; }
.sp-node--greater.is-equipped { border-color: #6bc1ff; box-shadow: 0 0 0 2px #0b0e14, 0 0 16px #57b5ffaa; }
.sp-node.is-equipped img { filter: none; }
.sp-node__rank {
    position: absolute; left: 2px; bottom: 1px; padding: 0 3px; border-radius: 2px;
    background: #070a10e8; color: #f6dc8d; font-size: .62rem; font-weight: 800; line-height: 1.25;
}
.sp-node--greater .sp-node__rank { color: #9fd4ff; }
.sp-extra-greater {
    grid-column: 1 / -1; padding: .85rem; border-radius: 8px;
    border: 1px solid #2f4f73; background: #101b2a; display: grid; gap: .6rem;
}
.sp-extra-greater__grid { display: flex; flex-wrap: wrap; gap: .55rem; }
.sp-extra-greater__grid .sp-node { position: relative; }

/* Normal Stigmas Grid */
.sp-normal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .55rem; }
.sp-normal-btn {
    display: flex; align-items: center; gap: .6rem; padding: .48rem .6rem; width: 100%;
    text-align: left; border-radius: 6px; border: 1px solid #26364c; background: #0c1522;
    color: var(--au-text); cursor: pointer; font: inherit;
}
.sp-normal-btn:hover, .sp-normal-btn:focus-visible { border-color: var(--au-gold-line); background: #142236; }
.sp-normal-btn.is-equipped { border-color: var(--au-gold); background: linear-gradient(90deg, #332917, #101c2d); }
.sp-normal-btn img { width: 34px; height: 34px; border-radius: 4px; border: 1px solid #4c412d; flex: none; }
.sp-normal-btn__info { min-width: 0; display: grid; gap: .12rem; }
.sp-normal-btn__name { font-size: .84rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-normal-btn__meta { font-size: .72rem; color: var(--au-muted); }

/* Floating Skill Tooltip */
.sp-tooltip {
    position: fixed; z-index: 900; max-width: 340px; padding: .8rem .95rem;
    border-radius: 8px; border: 1px solid #6c5a3b; background: #0b111cf5;
    box-shadow: 0 12px 32px #000000cc; pointer-events: none; color: var(--au-text); font-size: .82rem;
}
.sp-tooltip__head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .35rem; }
.sp-tooltip__title { font-size: .95rem; font-weight: 700; color: var(--au-gold-hi); }
.sp-tooltip__title--greater { color: #83c9ff; }
.sp-tooltip__meta { display: flex; flex-wrap: wrap; gap: .25rem .7rem; color: var(--au-muted); font-size: .75rem; margin-bottom: .45rem; }
.sp-tooltip__desc { margin: .35rem 0 0; color: var(--au-soft); line-height: 1.45; }
.sp-tooltip__reqs { margin-top: .5rem; padding-top: .45rem; border-top: 1px solid #26354a; font-size: .75rem; color: var(--au-muted); display: grid; gap: .18rem; }
.sp-tooltip__req--met { color: #6ce3a6; }
.sp-tooltip__req--miss { color: #f69898; }

@media (max-width: 1180px) {
    .sp-branches { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
    .sp-stage { grid-template-columns: minmax(0, 1fr); }
    .sp-sockets-card { position: static; }
}
