/* One compact side rail for comparison and the account shortlist. */
body[data-selection-theme="shangan"] .sel-side-tools {
    position: fixed;
    top: 50%;
    right: 14px;
    z-index: 1000;
    display: grid;
    gap: 4px;
    width: 56px;
    margin: 0;
    padding: 5px;
    transform: translateY(-50%);
    border: 1px solid #f0e2e5;
    border-radius: 18px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 6px 20px rgba(35, 49, 70, .1);
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    isolation: isolate;
}

body[data-selection-theme="shangan"] .sel-side-tools::before {
    content: "";
    position: absolute;
    inset: -3px;
    z-index: -1;
    border: 1px solid rgba(230, 0, 18, .1);
    border-radius: 21px;
    pointer-events: none;
    animation: sel-side-breathe 5.5s ease-in-out infinite;
}

@keyframes sel-side-breathe {
    0%, 100% { opacity: .35; box-shadow: 0 0 0 0 rgba(230, 0, 18, 0); }
    50% { opacity: .8; box-shadow: 0 0 0 3px rgba(230, 0, 18, .025); }
}

body[data-selection-theme="shangan"] .sel-side-tools .sel-side-button,
body[data-selection-theme="shangan"] .sel-side-tools .sel-entry {
    position: relative;
    inset: auto;
    z-index: auto;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 44px;
    height: 48px;
    min-height: 0;
    margin: 0;
    padding: 4px 0;
    transform: none;
    border: 0;
    border-radius: 13px;
    background: #fff4f5;
    color: #cc1b30;
    box-shadow: none;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

body[data-selection-theme="shangan"] .sel-side-tools .sel-side-compare {
    background: #f3f6fb;
    color: #526b89;
}

body[data-selection-theme="shangan"] .sel-side-tools .sel-side-button:hover,
body[data-selection-theme="shangan"] .sel-side-tools .sel-side-button[aria-expanded="true"] {
    background: #ffe8eb;
    color: #d31429;
}

body[data-selection-theme="shangan"] .sel-side-tools .sel-side-compare.has-items {
    background: #eef4fc;
    color: #2f6db7;
}

body[data-selection-theme="shangan"] .sel-side-tools .sel-side-button:focus-visible {
    outline: 2px solid #d31429;
    outline-offset: 2px;
}

.sel-side-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.sel-side-icon svg { width: 18px; height: 18px; }
.sel-side-label { font-size: 10px; font-weight: 600; line-height: 1.2; }

.sel-side-count {
    position: absolute;
    top: 1px;
    right: 0;
    display: grid;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    place-items: center;
    border: 1px solid #fff;
    border-radius: 9px;
    background: #d91d32;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    box-sizing: border-box;
}

.sel-side-compare .sel-side-count { background: #376fab; }

body[data-selection-theme="shangan"] .sel-side-panel {
    top: 50%;
    right: 82px;
    bottom: auto;
    width: min(320px, calc(100vw - 94px));
    max-width: none;
    max-height: calc(100dvh - 130px);
    transform: translateY(-50%);
    margin: 0;
    padding: 16px;
    border: 1px solid #e7eaf0;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(35, 49, 70, .15);
    overscroll-behavior: contain;
    box-sizing: border-box;
}

body[data-selection-theme="shangan"] .sel-side-panel .sel-drawer-head {
    margin-bottom: 12px;
    padding-bottom: 10px;
}

body[data-selection-theme="shangan"] .sel-side-panel .sel-drawer-head h2 {
    padding: 0;
    font-size: 16px;
}

body[data-selection-theme="shangan"] .sel-side-panel .sel-drawer-icon { width: 28px; height: 28px; }
body[data-selection-theme="shangan"] .sel-side-panel .sel-drawer-icon svg { width: 16px; height: 16px; }

.sel-side-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px;
    border-radius: 10px;
    background: #f3f5f8;
}

.sel-side-tabs button {
    min-width: 0;
    padding: 7px 3px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #6b7b90;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.sel-side-tabs button[aria-selected="true"] {
    background: #fff;
    color: #ca1830;
    box-shadow: 0 2px 6px rgba(35, 49, 70, .06);
}

.sel-side-tabs span { margin-left: 3px; font-size: 10px; }
.sel-side-tabs button:focus-visible { outline: 2px solid #d31429; outline-offset: 1px; }

.sel-side-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sel-side-summary strong { color: #2b2f35; font-size: 13px; }
.sel-side-summary em { margin-left: 3px; color: #d41a30; font-size: 21px; font-style: normal; }
.sel-side-summary strong > span { color: #8b97a7; font-size: 11px; font-weight: 400; }

.sel-side-clear {
    padding: 4px 0 4px 7px;
    border: 0;
    background: transparent;
    color: #8b97a7;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.sel-side-clear:disabled { opacity: .5; cursor: default; }
.sel-side-job-list { display: grid; gap: 7px; margin-top: 10px; }

.sel-side-job {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 5px;
    padding: 9px 6px 9px 8px;
    border: 1px solid #edf0f4;
    border-radius: 10px;
    background: #fafbfe;
}

.sel-side-job-index { color: #8795a7; font-size: 10px; }
.sel-side-job a { color: #2b2f35; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; text-decoration: none; }
.sel-side-job a:hover { color: #d31429; }
.sel-side-job button {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: #fff;
    color: #96a1b0;
    font-size: 17px;
    cursor: pointer;
}
.sel-side-job button:hover { background: #fff0f2; color: #d31429; }
body[data-selection-theme="shangan"] .sel-side-panel .sel-side-empty { margin: 0; padding: 17px 7px; border: 1px dashed #e8ecf2; border-radius: 10px; color: #8794a6; font-size: 12px; text-align: center; }
body[data-selection-theme="shangan"] .sel-side-panel .sel-side-hint { margin: 10px 0 12px; color: #8b97a7; font-size: 11px; line-height: 1.5; }
.sel-side-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 7px; }
body[data-selection-theme="shangan"] .sel-side-actions .sel-button { min-width: 0; padding: 6px 4px; font-size: 11px; }
body[data-selection-theme="shangan"] .sel-side-actions .sel-primary { width: auto; margin: 0; }
body[data-selection-theme="shangan"] .sel-side-actions .sel-primary:disabled { background: #f2f4f7; border-color: #e5e9ef; color: #99a4b3; opacity: 1; cursor: default; }

body[data-selection-theme="shangan"] .sel-side-tools[hidden],
body[data-selection-theme="shangan"] .sel-side-panel[hidden],
body[data-selection-theme="shangan"] .sel-side-tools [hidden] { display: none !important; }

@media (max-width: 700px) {
    body[data-selection-theme="shangan"] .sel-side-tools { right: 8px; width: 50px; padding: 4px; gap: 3px; border-radius: 16px; }
    body[data-selection-theme="shangan"] .sel-side-tools .sel-side-button,
    body[data-selection-theme="shangan"] .sel-side-tools .sel-entry { width: 40px; height: 44px; border-radius: 11px; }
    .sel-side-icon { width: 18px; height: 18px; }
    .sel-side-icon svg { width: 16px; height: 16px; }
    .sel-side-label { font-size: 9px; }
    body[data-selection-theme="shangan"] .sel-side-panel { right: 66px; width: min(300px, calc(100vw - 78px)); padding: 13px; max-height: calc(100dvh - 130px); }
    body[data-selection-theme="shangan"] .sel-side-panel .sel-drawer-stat { padding: 11px 7px 9px; }
    body[data-selection-theme="shangan"] .sel-side-panel .sel-drawer-stat > span { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    body[data-selection-theme="shangan"] .sel-side-tools::before { animation: none; opacity: .35; }
}

@media print {
    body[data-selection-theme="shangan"] .sel-side-tools,
    body[data-selection-theme="shangan"] .sel-side-panel { display: none !important; }
}

/* Comparison rail matches the green detail action, including expanded state. */
body[data-selection-theme="shangan"] .sel-side-tools .sel-side-compare{background:#f0faf5;color:#24815c}
body[data-selection-theme="shangan"] .sel-side-tools .sel-side-compare.has-items{background:#e4f6ec;color:#13845c}
body[data-selection-theme="shangan"] .sel-side-tools .sel-side-compare:hover,
body[data-selection-theme="shangan"] .sel-side-tools .sel-side-compare[aria-expanded="true"]{background:#d5efdf;color:#116c4d}
body[data-selection-theme="shangan"] .sel-side-tools .sel-side-compare .sel-side-count{background:#13845c;color:#fff}
body[data-selection-theme="shangan"] .sel-side-tools .sel-side-compare:focus-visible{outline-color:#13845c}

/* Mobile: one quiet entry, actions appear only on demand. */
body[data-selection-theme="shangan"] .sel-mobile-toggle{display:none}
@media(max-width:700px){
body[data-selection-theme="shangan"] .sel-side-tools{top:auto;bottom:var(--sel-mobile-bottom,84px);right:8px;transform:none;width:36px;padding:0;gap:6px;border:0;background:transparent;box-shadow:none;border-radius:14px}
body[data-selection-theme="shangan"] .sel-side-tools:before{display:none}
body[data-selection-theme="shangan"] .sel-mobile-toggle{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:36px;height:48px;min-height:44px;box-sizing:border-box;border:1px solid #f0e1e5;border-radius:12px 6px 12px 12px;background:#fffffff2;color:#a84454;box-shadow:0 3px 12px #35435c10;padding:5px 0;cursor:pointer;order:3;-webkit-tap-highlight-color:transparent}
body[data-selection-theme="shangan"] .sel-mobile-toggle svg{width:18px;height:18px}
body[data-selection-theme="shangan"] .sel-mobile-toggle>span{font-size:10px;line-height:1.2;font-weight:600}
body[data-selection-theme="shangan"] .sel-mobile-count{position:absolute;top:-4px;right:-3px;min-width:16px;height:16px;box-sizing:border-box;padding:0 3px;display:grid;place-items:center;border-radius:9px;background:#e60012;border:1px solid #fff;color:#fff;font-size:9px;line-height:1;font-weight:700}
body[data-selection-theme="shangan"] .sel-mobile-toggle[aria-expanded="true"]{background:#fff1f3;border-color:#f3b5c0;color:#e60012}
body[data-selection-theme="shangan"] .sel-mobile-toggle:focus-visible{outline:2px solid #e60012;outline-offset:2px}
body[data-selection-theme="shangan"] .sel-side-tools:not(.is-mobile-expanded) .sel-side-button{display:none!important}
body[data-selection-theme="shangan"] .sel-side-tools.is-mobile-expanded .sel-side-button{width:36px;height:48px;box-sizing:border-box;border:1px solid #f4dce2;box-shadow:0 3px 12px #35435c0b}
body[data-selection-theme="shangan"] .sel-mobile-toggle:before,body[data-selection-theme="shangan"] .sel-side-tools.is-mobile-expanded .sel-side-button:before{content:"";position:absolute;inset:0 -4px;background:transparent}
body[data-selection-theme="shangan"] .sel-side-tools.is-mobile-expanded .sel-side-compare{border-color:#cbe9d8}
body[data-selection-theme="shangan"] .sel-side-panel{top:auto;bottom:calc(var(--sel-mobile-bottom,84px) + 58px);left:12px;right:12px;width:auto;transform:none;max-height:min(420px,calc(100dvh - var(--sel-mobile-bottom,84px) - 80px));border-radius:18px;padding:16px;box-sizing:border-box;overscroll-behavior:contain}
}

@media(max-width:700px){body[data-selection-theme="shangan"] .sel-mobile-toggle{touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}body[data-selection-theme="shangan"] .sel-side-tools.is-dragging .sel-mobile-toggle{cursor:grabbing;box-shadow:0 5px 18px #35435c24}}
