/* shangan: position search shortcuts, shortlist dock, and shortlist page. */

.positions-mobile-page .m-position-quick-actions {
    position: sticky;
    top: 52px;
    z-index: 49;
    display: flex;
    gap: 7px;
    max-width: 480px;
    padding: 8px 10px;
    margin: 0 auto;
    background: rgba(246, 247, 250, .97);
    border-bottom: 1px solid #e9edf2;
    box-shadow: 0 5px 12px rgba(35, 49, 70, .035);
}

.positions-mobile-page .m-position-quick-actions a {
    display: inline-flex;
    flex: 1 1 0;
    min-width: 0;
    height: 36px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 4px;
    border: 1px solid #e5e9f0;
    border-radius: 10px;
    background: #fff;
    color: #2b2f35;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.positions-mobile-page .m-position-quick-actions .m-position-quick-help {
    border-color: #e60012;
    background: linear-gradient(135deg, #e60012, #ff3548);
    color: #fff;
}

.positions-mobile-page .m-position-quick-actions .m-position-quick-report {
    border-color: #ffc7ce;
    color: #d50016;
    background: #fff6f7;
}

.positions-mobile-page .m-position-quick-actions .ui-icon {
    flex: 0 0 auto;
    font-size: 13px;
}

body[data-selection-theme="shangan"] {
    --sel-ink: #2b2f35;
    --sel-accent: #e60012;
    --sel-soft: #fff1f3;
    --sel-line: #e7ebf1;
    --sel-muted: #748196;
}

body[data-selection-theme="shangan"] .sel-button,
body[data-selection-theme="shangan"] .sel-select {
    border-radius: 10px;
}

body[data-selection-theme="shangan"] .sel-primary,
body[data-selection-theme="shangan"] .sel-primary:hover {
    border-color: #e60012;
    background: linear-gradient(135deg, #e60012, #ff3548);
    color: #fff;
}

body[data-selection-theme="shangan"] .sel-toast {
    border-radius: 10px;
    background: #343a40;
    box-shadow: 0 8px 24px rgba(23, 38, 60, .2);
}

body[data-selection-theme="shangan"] .sel-entry {
    gap: 4px;
    border: 1px solid #ffd4d9;
    border-radius: 11px;
    background: #fff;
    color: #cf1528;
    font-weight: 800;
    box-shadow: 0 5px 18px rgba(34, 48, 69, .08);
}

body[data-selection-theme="shangan"] .sel-drawer {
    border-color: #e8ecf2;
    border-radius: 15px;
    box-shadow: 0 16px 40px rgba(24, 40, 65, .15);
}

body[data-selection-theme="shangan"] .sel-dock {
    inset-inline: auto;
    left: 50%;
    bottom: 16px;
    width: min(760px, calc(100% - 32px));
    min-height: 60px;
    transform: translateX(-50%);
    padding: 9px 12px;
    border: 1px solid #f4c8ce;
    border-radius: 16px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 14px 36px rgba(35, 48, 68, .17);
    color: #2b2f35;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

body[data-selection-theme="shangan"] .sel-dock > span {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    margin-right: auto;
}

body[data-selection-theme="shangan"] .sel-dock b {
    color: #e60012;
    font-size: 22px;
    line-height: 1;
}

body[data-selection-theme="shangan"] .sel-dock .sel-button,
body[data-selection-theme="shangan"] .sel-drawer .sel-button {
    min-height: 36px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

body[data-selection-theme="shangan"] .sel-dock .sel-primary,
body[data-selection-theme="shangan"] .sel-drawer .sel-primary {
    border-color: #e60012;
    background: linear-gradient(135deg, #e60012, #ff3548);
    color: #fff;
}

body[data-selection-theme="shangan"] .sel-dock .sel-primary:disabled {
    border-color: #e4e9ef;
    background: #f2f4f7;
    color: #95a0ae;
    opacity: 1;
}

body[data-selection-theme="shangan"].pool-page .sel-entry,
body[data-selection-theme="shangan"].pool-mobile-page .sel-entry,
body[data-selection-theme="shangan"].positions-pc-page .sel-entry {
    display: none !important;
}

/* The pool uses the shangan page shell; data and controls remain shared. */
.pool-page .pool-hero-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 30px;
    border: 1px solid #f6dfe3;
    border-radius: 18px;
    background: linear-gradient(110deg, #fff5f6 0%, #fff 68%);
}

.pool-page .pool-hero-card h1 {
    margin: 3px 0 7px;
    color: #2b2f35;
    font-size: 30px;
}

.pool-page .pool-hero-card p {
    margin: 0;
    color: #64758c;
    font-size: 14px;
}

.pool-page .pool-hero-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.pool-page .pool-guide {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 13px 18px;
    margin-top: 14px;
    border: 1px solid #e8ecf2;
    border-radius: 13px;
    background: #fff;
    color: #2b2f35;
    font-size: 13px;
}

.pool-page .pool-guide span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    white-space: nowrap;
}

.pool-page .pool-guide i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e60012;
}

.pool-page .pool-guide span:nth-child(2) i { background: #2b79d7; }
.pool-page .pool-guide span:nth-child(3) i { background: #8a95a5; }

.pool-page .pool-guide p {
    margin: 0 0 0 auto;
    color: #8a96a6;
}

.pool-board {
    margin-top: 14px;
}

body[data-selection-theme="shangan"] .pool-board #selection-page > h1,
body[data-selection-theme="shangan"] .m-pool-board #selection-page > h1 {
    display: none;
}

body[data-selection-theme="shangan"] .pool-board #selection-page > .sel-muted,
body[data-selection-theme="shangan"] .m-pool-board #selection-page > .sel-muted {
    margin: 0 2px 12px;
}

body[data-selection-theme="shangan"] .pool-board .sel-tabs,
body[data-selection-theme="shangan"] .m-pool-board .sel-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    max-width: 540px;
    margin: 0 0 14px;
    padding: 5px;
    border-radius: 12px;
    background: #f1f3f7;
}

body[data-selection-theme="shangan"] .pool-board .sel-tabs button,
body[data-selection-theme="shangan"] .m-pool-board .sel-tabs button {
    min-height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

body[data-selection-theme="shangan"] .pool-board .sel-tabs button[aria-pressed="true"],
body[data-selection-theme="shangan"] .m-pool-board .sel-tabs button[aria-pressed="true"] {
    background: #fff;
    color: #dc172b;
    box-shadow: 0 3px 10px rgba(34, 48, 69, .08);
}

body[data-selection-theme="shangan"] .pool-board .sel-card,
body[data-selection-theme="shangan"] .m-pool-board .sel-card {
    padding: 19px 21px;
    margin: 0 0 12px;
    border: 1px solid #e7ebf0;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(38, 52, 79, .04);
}

body[data-selection-theme="shangan"] .pool-board .sel-card h2,
body[data-selection-theme="shangan"] .m-pool-board .sel-card h2 {
    color: #2b2f35;
    font-size: 18px;
    line-height: 1.4;
}

body[data-selection-theme="shangan"] .pool-board .sel-card h2 a:hover,
body[data-selection-theme="shangan"] .m-pool-board .sel-card h2 a:hover {
    color: #e60012;
}

body[data-selection-theme="shangan"] .pool-board .sel-tag,
body[data-selection-theme="shangan"] .m-pool-board .sel-tag {
    padding: 4px 9px;
    border-radius: 999px;
    background: #fff1f3;
    color: #d32939;
    font-weight: 800;
}

body[data-selection-theme="shangan"] .pool-board .sel-metrics,
body[data-selection-theme="shangan"] .m-pool-board .sel-metrics {
    gap: 8px;
    padding: 12px 0;
    border-color: #edf0f4;
}

body[data-selection-theme="shangan"] .pool-board .sel-metrics > div,
body[data-selection-theme="shangan"] .m-pool-board .sel-metrics > div {
    min-width: 0;
    padding: 9px 11px;
    border-radius: 10px;
    background: #f7f9fc;
}

body[data-selection-theme="shangan"] .pool-board .sel-metrics b,
body[data-selection-theme="shangan"] .m-pool-board .sel-metrics b {
    overflow-wrap: anywhere;
    color: #2b2f35;
    font-size: 18px;
}

body[data-selection-theme="shangan"] .pool-board .sel-metrics > div:last-child,
body[data-selection-theme="shangan"] .m-pool-board .sel-metrics > div:last-child {
    background: #fff5ed;
}

body[data-selection-theme="shangan"] .pool-board .sel-metrics > div:last-child b,
body[data-selection-theme="shangan"] .m-pool-board .sel-metrics > div:last-child b {
    color: #dc6c17;
}

body[data-selection-theme="shangan"] .pool-board .sel-tools,
body[data-selection-theme="shangan"] .m-pool-board .sel-tools {
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #edf0f4;
}

body[data-selection-theme="shangan"] .pool-board .sel-select,
body[data-selection-theme="shangan"] .m-pool-board .sel-select,
body[data-selection-theme="shangan"] .pool-board .sel-button,
body[data-selection-theme="shangan"] .m-pool-board .sel-button {
    border-radius: 9px;
    font-weight: 700;
}

body[data-selection-theme="shangan"] .pool-board .sel-empty,
body[data-selection-theme="shangan"] .m-pool-board .sel-empty {
    border: 1px dashed #e2e7ee;
    border-radius: 13px;
    background: #fff;
    color: #65758a;
}

.pool-mobile-page .m-pool-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 0;
    padding: 14px;
    border-color: #f7dfe2;
    background: linear-gradient(120deg, #fff5f6, #fff);
}

.pool-mobile-page .m-pool-head h2 {
    margin: 3px 0 4px;
    color: #2b2f35;
    font-size: 20px;
}

.pool-mobile-page .m-pool-head p {
    margin: 0;
    color: #728197;
    font-size: 12px;
}

.pool-mobile-page .m-pool-head .btn {
    flex: 0 0 auto;
    padding: 0 9px;
    font-size: 12px;
}

.pool-mobile-page .m-pool-board {
    padding: 10px;
}

.pool-mobile-page .m-pool-footlinks {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 14px 0 10px;
    color: #d21b2b;
    font-size: 12px;
    font-weight: 800;
}

body[data-selection-theme="shangan"] .m-pool-board .sel-card {
    padding: 13px;
}

body[data-selection-theme="shangan"] .m-pool-board .sel-card h2 {
    font-size: 15px;
}

body[data-selection-theme="shangan"] .m-pool-board .sel-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

body[data-selection-theme="shangan"] .m-pool-board .sel-metrics > div {
    padding: 8px 6px;
}

body[data-selection-theme="shangan"] .m-pool-board .sel-metrics b {
    font-size: 15px;
}

body[data-selection-theme="shangan"] .m-pool-board .sel-card .sel-muted {
    overflow-wrap: anywhere;
}

@media (max-width: 700px) {
    body[data-selection-theme="shangan"] .sel-entry {
        position: fixed;
        top: 50%;
        right: 12px;
        z-index: 1000;
        display: flex;
        width: 50px;
        height: 50px;
        min-height: 50px;
        margin: 0;
        padding: 0;
        transform: translateY(-50%);
        border: 1px solid rgba(255, 255, 255, .85);
        border-radius: 17px;
        background: linear-gradient(145deg, #ef172b, #d8061c);
        color: #fff;
        box-shadow: 0 9px 22px rgba(207, 16, 34, .24), 0 2px 6px rgba(36, 54, 78, .12);
    }

    body[data-selection-theme="shangan"] .sel-entry:hover,
    body[data-selection-theme="shangan"] .sel-entry[aria-expanded="true"] {
        background: linear-gradient(145deg, #db0d22, #bd0618);
        color: #fff;
    }

    body[data-selection-theme="shangan"] .sel-entry-symbol {
        font-size: 27px;
        line-height: 1;
    }

    body[data-selection-theme="shangan"] .sel-entry-label {
        display: none;
    }

    body[data-selection-theme="shangan"] .sel-entry-count {
        position: absolute;
        top: -6px;
        right: -6px;
        display: grid;
        min-width: 20px;
        height: 20px;
        place-items: center;
        padding: 0 4px;
        border: 2px solid #fff;
        border-radius: 999px;
        background: #e60012;
        color: #fff;
        font-size: 10px;
        line-height: 1;
    }

    body[data-selection-theme="shangan"] .sel-drawer {
        top: 50%;
        right: 12px;
        bottom: auto;
        width: min(300px, calc(100vw - 24px));
        max-height: min(440px, calc(100dvh - 140px));
        transform: translateY(-50%);
        padding: 18px;
        border-radius: 18px;
        box-shadow: 0 18px 46px rgba(27, 43, 67, .22);
    }

    body[data-selection-theme="shangan"] .sel-drawer h2 {
        padding: 3px 0 11px;
        font-size: 17px;
    }

    body[data-selection-theme="shangan"] .sel-drawer p {
        margin: 7px 0;
    }

    body[data-selection-theme="shangan"] .sel-drawer .sel-primary {
        width: 100%;
        margin-top: 12px;
    }

    body[data-selection-theme="shangan"] .sel-dock {
        bottom: calc(62px + env(safe-area-inset-bottom) + 8px);
        width: min(460px, calc(100% - 20px));
        min-height: 50px;
        gap: 5px;
        padding: 6px;
        border-radius: 13px;
    }

    body[data-selection-theme="shangan"] .sel-dock > span {
        font-size: 11px;
    }

    body[data-selection-theme="shangan"] .sel-dock b {
        font-size: 16px;
    }

    body[data-selection-theme="shangan"] .sel-dock .sel-button {
        min-height: 34px;
        padding: 5px 7px;
        font-size: 11px;
    }

    body[data-selection-theme="shangan"].sel-has-selection {
        padding-bottom: 142px !important;
    }

    .pool-mobile-page .m-pool-board .sel-tabs {
        max-width: none;
    }
}

@media (max-width: 360px) {
    body[data-selection-theme="shangan"] .sel-dock .sel-button {
        padding: 4px 5px;
        font-size: 10px;
    }

    .positions-mobile-page .m-position-quick-actions a {
        font-size: 11px;
    }

    .positions-mobile-page .m-position-quick-actions .ui-icon {
        font-size: 12px;
    }
}

/* Compact account shortlist panel: three categories with count badges. */
body[data-selection-theme="shangan"] .sel-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}

body[data-selection-theme="shangan"] .sel-drawer-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    font-size: 16px;
    line-height: 1.4;
}

body[data-selection-theme="shangan"] .sel-drawer-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 9px;
    background: #fff0f2;
    color: #df1730;
}

body[data-selection-theme="shangan"] .sel-drawer-icon svg {
    width: 17px;
    height: 17px;
}

body[data-selection-theme="shangan"] .sel-drawer-close {
    display: grid;
    width: 28px;
    height: 28px;
    padding: 0;
    place-items: center;
    flex: 0 0 28px;
    border: 0;
    border-radius: 9px;
    background: #f3f5f8;
    color: #7d8a9b;
    font-family: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

body[data-selection-theme="shangan"] .sel-drawer-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

body[data-selection-theme="shangan"] .sel-drawer-stat {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 50px;
    padding: 13px 4px 9px;
    place-items: center;
    border: 1px solid var(--pool-stat-border);
    border-radius: 11px;
    background: var(--pool-stat-background);
    color: var(--pool-stat-color);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

body[data-selection-theme="shangan"] .sel-drawer-stat--focus {
    --pool-stat-border: #ffd5dc;
    --pool-stat-background: #fff4f6;
    --pool-stat-color: #d92643;
    --pool-stat-badge: #e12c47;
}

body[data-selection-theme="shangan"] .sel-drawer-stat--backup {
    --pool-stat-border: #d5e4fb;
    --pool-stat-background: #f2f7ff;
    --pool-stat-color: #3771ba;
    --pool-stat-badge: #4681d3;
}

body[data-selection-theme="shangan"] .sel-drawer-stat--excluded {
    --pool-stat-border: #e2e7ed;
    --pool-stat-background: #f5f7fa;
    --pool-stat-color: #7b8798;
    --pool-stat-badge: #8794a7;
}

body[data-selection-theme="shangan"] .sel-drawer-badge {
    position: absolute;
    top: -8px;
    right: 5px;
    display: grid;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--pool-stat-badge);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

body[data-selection-theme="shangan"] .sel-drawer .sel-drawer-manage {
    float: none;
    width: 100%;
    margin-top: 16px;
}
