:root {
    --panel: rgba(8, 12, 24, 0.975);
    --panel-2: rgba(12, 17, 31, 0.98);
    --card: rgba(10, 15, 29, 0.94);
    --control: rgba(22, 28, 42, 0.96);
    --control-hover: rgba(31, 39, 57, 0.98);
    --line: rgba(115, 130, 165, 0.26);
    --line-soft: rgba(115, 130, 165, 0.15);
    --text: #f6f8ff;
    --muted: #aab2c7;
    --dim: #7d879f;
    --purple: #a24cff;
    --purple-2: #7d4dff;
    --blue: #3aa9ff;
    --yellow: #ffbd00;
}

* {
    box-sizing: border-box;
    user-select: none;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: transparent;
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

.hidden {
    display: none !important;
}

#app {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.deal-panel {
    pointer-events: auto;
    position: absolute;
    top: 3.2vh;
    right: 2.2vw;
    width: clamp(360px, 21vw, 410px);
    padding: 16px 16px 13px;
    border: 1px solid transparent;
    border-radius: 12px;
    background:
        linear-gradient(var(--panel), var(--panel)) padding-box,
        linear-gradient(135deg, rgba(161, 69, 255, .96), rgba(64, 153, 255, .88) 53%, rgba(182, 70, 255, .92)) border-box;
    box-shadow:
        0 18px 55px rgba(0, 0, 0, .58),
        0 0 24px rgba(137, 73, 255, .18),
        inset 0 1px 0 rgba(255, 255, 255, .035);
    overflow: hidden;
    animation: panel-in 150ms ease-out;
}

@keyframes panel-in {
    from { opacity: 0; transform: translateX(12px) scale(.992); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.edge-glow {
    position: absolute;
    inset: -100px auto auto -90px;
    width: 230px;
    height: 230px;
    border-radius: 999px;
    background: rgba(132, 58, 255, .12);
    filter: blur(62px);
    pointer-events: none;
}

.deal-header {
    position: relative;
    display: grid;
    grid-template-columns: 34px 1fr 36px;
    gap: 10px;
    align-items: center;
    min-height: 38px;
}

.brand-icon {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 28%, #6e4fff 0 13%, #201335 14% 45%, #070b16 46% 100%);
    border: 1px solid rgba(161, 76, 255, .42);
    box-shadow: 0 0 13px rgba(147, 68, 255, .32);
    overflow: hidden;
}

.brand-icon .planet {
    position: absolute;
    width: 21px;
    height: 21px;
    left: 4px;
    top: 5px;
    border-radius: 50%;
    background: linear-gradient(145deg, #5937ad, #10172d 72%);
    box-shadow: inset 4px 3px 7px rgba(173, 80, 255, .28);
}

.brand-icon .orbit {
    position: absolute;
    width: 34px;
    height: 11px;
    left: -2px;
    top: 12px;
    border: 2px solid rgba(139, 84, 255, .9);
    border-top-color: transparent;
    border-left-color: transparent;
    border-radius: 50%;
    transform: rotate(-14deg);
}

.deal-header h1 {
    margin: 0;
    font-size: 21px;
    line-height: 1;
    font-weight: 720;
    letter-spacing: -.025em;
    white-space: nowrap;
}

.deal-header h1 span {
    color: var(--purple);
}

.close-button {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0 0 2px;
    border-radius: 7px;
    border: 1px solid rgba(138, 151, 180, .35);
    outline: none;
    background: rgba(26, 32, 47, .88);
    color: #cdd3e1;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: 120ms ease;
}

.close-button:hover {
    background: #273044;
    color: white;
    border-color: rgba(163, 174, 199, .62);
}

.buyer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 6px 13px;
    color: #b8bfd0;
    font-size: 11px;
}

.buyer-meta,
.risk-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.buyer-meta svg,
.risk-meta svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.buyer-meta svg { stroke: var(--purple); }
.risk-meta svg { stroke: var(--yellow); }
.risk-meta strong { color: var(--yellow); font-weight: 650; }

.drug-tabs {
    display: flex;
    gap: 6px;
    margin: -2px 0 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.drug-tabs::-webkit-scrollbar { display: none; }

.drug-tab {
    flex: 0 0 auto;
    border: 1px solid rgba(120, 133, 162, .22);
    border-radius: 7px;
    background: rgba(19, 25, 39, .88);
    color: #8f98ad;
    padding: 7px 10px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: 120ms ease;
}

.drug-tab:hover {
    color: #dce2ee;
    background: rgba(27, 34, 51, .94);
}

.drug-tab.active {
    color: #f7f2ff;
    border-color: rgba(157, 74, 255, .62);
    background: linear-gradient(135deg, rgba(139, 69, 255, .21), rgba(45, 136, 255, .15));
    box-shadow: inset 0 0 12px rgba(140, 64, 255, .08);
}

.product-card {
    position: relative;
    min-height: 108px;
    display: grid;
    grid-template-columns: 68px 1fr 78px;
    gap: 13px;
    align-items: center;
    padding: 12px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    background:
        linear-gradient(120deg, rgba(15, 20, 35, .98), rgba(9, 14, 28, .96)) padding-box,
        linear-gradient(120deg, rgba(164, 67, 255, .92), rgba(47, 158, 255, .82)) border-box;
    box-shadow:
        inset 0 0 22px rgba(72, 80, 158, .05),
        0 6px 20px rgba(0, 0, 0, .18);
    overflow: hidden;
}

.drug-icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    border: 1px solid rgba(93, 111, 151, .46);
    background: linear-gradient(145deg, rgba(9, 15, 29, .98), rgba(12, 20, 36, .92));
    color: #dff1ff;
    box-shadow: inset 0 0 24px rgba(74, 154, 255, .08);
}

.drug-icon svg {
    width: 49px;
    height: 49px;
    filter: drop-shadow(0 0 8px rgba(105, 179, 255, .22));
}

.product-copy {
    min-width: 0;
    z-index: 1;
}

.product-copy h2 {
    margin: 0 0 5px;
    font-size: 17px;
    line-height: 1.08;
    font-weight: 760;
}

.available {
    color: #9e5eff;
    font-size: 12px;
    margin-bottom: 6px;
}

.unit-price {
    color: #c8cedd;
    font-size: 12px;
}

.card-planet {
    position: absolute;
    right: -3px;
    top: 6px;
    width: 105px;
    height: 105px;
    opacity: .42;
    pointer-events: none;
}

.card-planet span {
    position: absolute;
    width: 66px;
    height: 66px;
    right: 13px;
    top: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, rgba(65, 73, 126, .9), rgba(10, 14, 30, .35) 66%, transparent 68%);
    box-shadow: inset 7px 3px 16px rgba(146, 77, 255, .18);
}

.card-planet::after {
    content: "";
    position: absolute;
    width: 87px;
    height: 23px;
    right: 2px;
    top: 39px;
    border: 2px solid rgba(136, 65, 255, .72);
    border-top-color: transparent;
    border-left-color: transparent;
    border-radius: 50%;
    transform: rotate(-22deg);
}

.quantity-section {
    padding: 18px 3px 0;
}

.section-label {
    color: #adb5c8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .19em;
}

.quantity-controls {
    display: grid;
    grid-template-columns: 48px 1fr 48px 78px;
    gap: 7px;
    margin-top: 10px;
}

.qty-button,
.max-button,
.quantity-input,
.cancel-button {
    height: 40px;
    border: 1px solid rgba(113, 126, 154, .28);
    border-radius: 6px;
    background: var(--control);
    outline: none;
}

.qty-button,
.max-button,
.cancel-button {
    cursor: pointer;
    transition: 120ms ease;
}

.qty-button {
    font-size: 22px;
    color: #eef1f7;
}

.qty-button:hover,
.max-button:hover,
.cancel-button:hover {
    background: var(--control-hover);
    border-color: rgba(145, 160, 193, .44);
}

.quantity-input {
    width: 100%;
    padding: 0 10px;
    text-align: center;
    color: white;
    font-size: 18px;
    font-weight: 650;
    appearance: textfield;
    -moz-appearance: textfield;
    user-select: text;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.max-button {
    color: #c1c8d8;
    font-size: 12px;
    font-weight: 700;
}

.estimate-card {
    margin-top: 16px;
    padding: 14px 13px 13px;
    border: 1px solid rgba(99, 114, 146, .28);
    border-radius: 7px;
    background: linear-gradient(150deg, rgba(11, 16, 30, .96), rgba(9, 13, 25, .98));
}

.estimated-total {
    margin-top: 7px;
    font-size: 27px;
    line-height: 1.05;
    font-weight: 760;
    letter-spacing: -.03em;
    color: transparent;
    background: linear-gradient(90deg, #ab43ff 0%, #765dff 52%, #3daaff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 0 18px rgba(124, 86, 255, .16);
}

.estimate-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 11px;
    color: #a3abbe;
    font-size: 11px;
}

.info-icon {
    width: 14px;
    height: 14px;
    display: grid;
    place-items: center;
    border: 1px solid #939bae;
    border-radius: 50%;
    color: #c1c7d4;
    font-size: 9px;
    font-weight: 800;
}

.offer-button {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    border: 1px solid rgba(195, 121, 255, .88);
    border-radius: 6px;
    outline: none;
    background: linear-gradient(105deg, #9428e8 0%, #7647ed 50%, #34a8f7 100%);
    box-shadow:
        0 0 18px rgba(116, 72, 255, .24),
        inset 0 1px 0 rgba(255, 255, 255, .28);
    color: white;
    font-size: 16px;
    font-weight: 650;
    cursor: pointer;
    transition: 130ms ease;
}

.offer-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
}

.offer-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 0 25px rgba(103, 106, 255, .34);
}

.offer-button:active { transform: translateY(0); }

.offer-button:disabled {
    opacity: .62;
    cursor: default;
    transform: none;
    filter: none;
}

.cancel-button {
    width: 100%;
    margin-top: 8px;
    color: #d2d7e2;
    font-size: 12px;
}

.deal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 3px 0;
    border-top: 1px solid rgba(109, 123, 153, .25);
    color: #9099ad;
    font-size: 10px;
}

.deal-footer > div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-mark {
    color: #aab4c8;
    font-size: 10px;
}

.trust {
    color: #ad4fff;
}

@media (max-width: 900px) {
    .deal-panel {
        top: 2vh;
        right: 2vw;
        width: min(390px, 94vw);
    }
}


/* Drug class + live acceptance chance */
.product-meta-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.product-meta-line .available {
    margin-bottom: 0;
}

.drug-class-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 3px 7px;
    border: 1px solid rgba(166, 82, 255, .42);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(150, 64, 255, .13), rgba(53, 151, 255, .10));
    color: #c89aff;
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .08em;
    white-space: nowrap;
}

.chance-card {
    margin-top: 16px;
    padding: 13px;
    border: 1px solid rgba(110, 126, 160, .28);
    border-radius: 7px;
    background: linear-gradient(150deg, rgba(13, 18, 34, .97), rgba(8, 13, 26, .98));
    box-shadow: inset 0 0 20px rgba(114, 74, 255, .035);
}

.chance-topline,
.chance-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sale-chance {
    color: #c486ff;
    font-size: 18px;
    line-height: 1;
    font-weight: 820;
    letter-spacing: -.02em;
    text-shadow: 0 0 15px rgba(158, 78, 255, .18);
}

.chance-track {
    width: 100%;
    height: 7px;
    margin-top: 11px;
    overflow: hidden;
    border: 1px solid rgba(116, 130, 160, .22);
    border-radius: 999px;
    background: rgba(25, 31, 46, .92);
}

.chance-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    transition: width 130ms ease, background 130ms ease;
    box-shadow: 0 0 13px currentColor;
}

.chance-fill.good { background: linear-gradient(90deg, #36d88c, #50e8b2); color: #44dfa0; }
.chance-fill.fair { background: linear-gradient(90deg, #aa52ff, #4aa8ff); color: #8b6cff; }
.chance-fill.risky { background: linear-gradient(90deg, #ffb52e, #ff7d4d); color: #ff9b3d; }
.chance-fill.extreme { background: linear-gradient(90deg, #ff4f72, #ff3153); color: #ff3f62; }

.chance-details {
    margin-top: 9px;
    color: #909aaf;
    font-size: 10px;
}

.chance-details strong,
.risk-meta strong {
    font-weight: 760;
}

.chance-details strong.good,
.risk-meta strong.good { color: #56e5ad; }
.chance-details strong.fair,
.risk-meta strong.fair { color: #b37aff; }
.chance-details strong.risky,
.risk-meta strong.risky { color: #ffb34f; }
.chance-details strong.extreme,
.risk-meta strong.extreme { color: #ff607b; }
