/* ==========================================================================
   Bottom Fishing Peak Selling - single stylesheet for the whole workspace.
   Layout rule for every page: the viewport is the canvas. html/body never
   scroll, and no inner region is allowed to draw a scrollbar either, so the
   UI stays a fixed, clean frame at any window size.
   ========================================================================== */

:root {
    --bg: #0b0e13;
    --bg-elev: #11151d;
    --bg-sunken: #0d1117;
    --line: #1e2531;
    --line-soft: #171d27;
    --text: #e7ecf3;
    --text-dim: #c6cfdd;
    --muted: #8b95a7;
    --muted-deep: #61708a;
    --up: #16c784;
    --down: #f0616d;
    --accent: #4c8dff;
    --gold: #ffb02e;
    --radius: 12px;
    --topbar-h: 52px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Hard guarantee: nothing in this app ever shows a scrollbar. */
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    color-scheme: dark;
}

#app,
.shell {
    height: 100%;
}

h1:focus,
button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: none;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
    box-shadow: 0 0 0 3px rgba(76, 141, 255, .25);
}

a {
    color: var(--accent);
}

/* ---------- shell / top bar ---------- */

.shell {
    display: grid;
    grid-template-rows: var(--topbar-h) minmax(0, 1fr);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #121722, #0e1219);
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--text);
    font-weight: 650;
    font-size: 14px;
    letter-spacing: .2px;
    white-space: nowrap;
}

.brand-mark {
    width: 11px;
    height: 11px;
    border-radius: 3px;
    background: linear-gradient(135deg, var(--up), var(--accent));
    box-shadow: 0 0 12px rgba(76, 141, 255, .45);
}

.brand-text em {
    font-style: normal;
    color: var(--muted);
    font-weight: 500;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 11px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 550;
    white-space: nowrap;
    transition: background .12s ease, color .12s ease;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .05);
}

.nav-link.active {
    color: var(--text);
    background: rgba(255, 255, 255, .07);
}

.nav-link.solid {
    background: var(--accent);
    color: #fff;
}

.nav-link.solid:hover,
.nav-link.solid.active {
    background: #3f7ff0;
    color: #fff;
}

.nav-link.account {
    padding: 4px 6px 4px 10px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #233047;
    color: #cfe0ff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
}

.avatar.lg {
    width: 46px;
    height: 46px;
    font-size: 15px;
    flex: 0 0 auto;
}

.plan-chip {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .7px;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.plan-chip.free {
    color: #9aa6ba;
    background: #1a2130;
    border-color: #26303f;
}

.plan-chip.pro {
    color: #201703;
    background: linear-gradient(135deg, #ffd479, var(--gold));
    border-color: #ffc95c;
}

.content {
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

/* ---------- market board ---------- */

.market {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px 14px;
    min-height: 0;
}

.mkt-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 40px;
    flex: 0 0 auto;
    overflow: hidden;
}

.mkt-id {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.mkt-symbol {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: .4px;
}

.mkt-name {
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}

.mkt-venue {
    font-size: 9.5px;
    letter-spacing: .5px;
    color: var(--muted-deep);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 2px 6px;
    white-space: nowrap;
}

.mkt-quote {
    display: flex;
    align-items: baseline;
    gap: 9px;
    white-space: nowrap;
}

.mkt-price,
.mkt-change,
.wl-price,
.wl-chg,
.mkt-stats dd {
    font-variant-numeric: tabular-nums;
}

.mkt-price {
    font-size: 19px;
    font-weight: 700;
}

.mkt-change {
    font-size: 13px;
    font-weight: 600;
}

.up {
    color: var(--up);
}

.down {
    color: var(--down);
}

.flat,
.muted {
    color: var(--muted);
}

.mkt-stats {
    display: flex;
    gap: 16px;
    margin: 0;
    min-width: 0;
    overflow: hidden;
}

.mkt-stats div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mkt-stats dt {
    font-size: 9.5px;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--muted-deep);
}

.mkt-stats dd {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-dim);
}

.mkt-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.seg-group {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 9px;
}

.seg {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}

.seg:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .05);
}

.seg.on {
    background: #233047;
    color: #fff;
}

.seg.quiet {
    padding: 5px 9px;
    font-weight: 550;
}

.seg-badge {
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: .5px;
    padding: 1px 4px;
    border-radius: 4px;
    background: linear-gradient(135deg, #ffd479, var(--gold));
    color: #201703;
}

.upsell {
    margin: 0;
    flex: 0 0 auto;
    font-size: 12.5px;
    color: #ffd479;
    background: rgba(255, 176, 46, .08);
    border: 1px solid rgba(255, 176, 46, .26);
    border-radius: 8px;
    padding: 6px 10px;
}

.upsell a {
    color: #ffd479;
    font-weight: 600;
}

.mkt-body {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 12px;
}

.chart-card,
.watch-card {
    position: relative;
    min-width: 0;
    min-height: 0;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.chart-card {
    overflow: hidden;
}

.chart-host {
    position: absolute;
    inset: 0;
}

.chart-veil {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(11, 14, 19, .82);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    padding: 12px;
}

.chart-veil.err {
    color: var(--down);
}

.watch-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.watch-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
}

.watch-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #9aa6ba;
}

.watch-state {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.watch-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
}

.wl-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}

.wl-row:hover {
    background: rgba(255, 255, 255, .04);
}

.wl-row.sel {
    background: rgba(76, 141, 255, .11);
    border-color: rgba(76, 141, 255, .32);
}

.wl-id,
.wl-num {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.wl-num {
    align-items: flex-end;
}

.wl-sym {
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: .3px;
}

.wl-name {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 168px;
}

.wl-price {
    font-size: 13.5px;
    font-weight: 650;
}

.wl-chg {
    font-size: 11.5px;
    font-weight: 600;
}

.watch-foot {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    font-size: 10.5px;
    color: #5d6a80;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ECharts tooltip (markup is produced in market-chart.js) */
.bfps-tip {
    padding: 8px 10px;
    min-width: 172px;
}

.bfps-tip-head {
    font-size: 12px;
    font-weight: 700;
    color: #e7ecf3;
}

.bfps-tip-head span {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #8b95a7;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1px 5px;
    margin-left: 5px;
}

.bfps-tip-time {
    font-size: 10.5px;
    color: #8b95a7;
    margin-bottom: 6px;
}

.bfps-tip dl {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
}

.bfps-tip dl div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.bfps-tip dt {
    color: #8b95a7;
    font-size: 10.5px;
}

.bfps-tip dd {
    margin: 0;
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
}

/* ---------- auth + profile ---------- */

.auth-wrap {
    height: 100%;
    display: grid;
    place-items: center;
    padding: 18px;
    overflow: hidden;
}

.auth-card,
.panel {
    width: min(370px, 100%);
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
}

.auth-card.center {
    text-align: center;
}

.auth-title {
    margin: 0 0 2px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .2px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field > span {
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #7f8ba0;
}

.field input {
    width: 100%;
    padding: 9px 11px;
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    outline: none;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.field input::placeholder {
    color: #55617a;
}

.field input:focus {
    border-color: #3a5f9e;
}

.btn-primary,
.btn-ghost,
.btn-quiet {
    width: 100%;
    padding: 10px 14px;
    border-radius: 9px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 650;
    cursor: pointer;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.btn-primary {
    border: 1px solid transparent;
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #3f7ff0;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-dim);
}

.btn-ghost:hover:not(:disabled) {
    border-color: #33405a;
    color: var(--text);
}

.btn-quiet {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-weight: 550;
}

.btn-quiet:hover {
    color: var(--down);
}

.btn-primary:disabled,
.btn-ghost:disabled {
    opacity: .6;
    cursor: default;
}

.form-msg {
    margin: 0;
    font-size: 12.5px;
    border-radius: 8px;
    padding: 7px 10px;
}

.form-msg.err {
    color: #ffb3ba;
    background: rgba(240, 97, 109, .1);
    border: 1px solid rgba(240, 97, 109, .28);
}

.auth-alt,
.auth-note {
    margin: 0;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
}

.auth-note {
    font-size: 11px;
    color: #5d6a80;
}

.panel {
    width: min(430px, 100%);
    gap: 16px;
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-id {
    min-width: 0;
    flex: 1 1 auto;
}

.panel-id h1 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.panel-id p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--muted);
    white-space: normal;
    overflow-wrap: anywhere;
}

.panel-id .panel-meta {
    font-size: 11px;
    color: var(--muted-deep);
}

.plan-box {
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: 14px;
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: 11px;
}

.plan-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.plan-name {
    font-size: 14px;
    font-weight: 700;
}

.plan-price {
    font-size: 12.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.plan-feats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.plan-feats li {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    color: var(--text-dim);
}

.plan-feats li::before {
    content: "";
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #1b2432 center/9px 9px no-repeat;
    border: 1px solid #26303f;
}

.plan-feats li.on::before {
    background-color: var(--up);
    border-color: transparent;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.4l2.2 2.1 4.8-5' fill='none' stroke='%23071014' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.plan-feats li.off {
    color: #5d6a80;
}

.plan-feats li.off::before {
    background-color: #161d28;
}

/* ---------- boot + error UI ---------- */

.boot-pad {
    height: 100%;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 50;
    padding: 9px 14px;
    border-radius: 9px;
    background: #2a1420;
    border: 1px solid rgba(240, 97, 109, .4);
    color: #ffd7db;
    font-size: 12.5px;
}

#blazor-error-ui .reload {
    color: #fff;
    margin-left: 8px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    margin-left: 10px;
    color: #ff9aa3;
}

/* ---------- responsive: keep everything inside the viewport ---------- */

@media (max-width: 1080px) {
    .mkt-stats {
        display: none;
    }
}

@media (max-width: 900px) {
    .mkt-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) 156px;
    }

    .watch-list {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .wl-row {
        flex: 0 0 auto;
        min-width: 152px;
    }

    .wl-name {
        max-width: 118px;
    }
}

@media (max-width: 620px) {
    .market {
        padding: 10px;
        gap: 8px;
    }

    /* The toolbar wraps instead of squeezing: a flex item that shrinks below its
       content would otherwise overflow and visually collide with its neighbour. */
    .mkt-bar {
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .mkt-id,
    .mkt-quote {
        flex: 0 0 auto;
    }

    .mkt-id {
        overflow: hidden;
    }

    .mkt-controls {
        flex: 1 1 100%;
        margin-left: 0;
        justify-content: space-between;
        gap: 8px;
    }

    .mkt-name,
    .mkt-venue {
        display: none;
    }

    .brand-text em {
        display: none;
    }
}

@media (max-height: 560px) {
    .auth-card,
    .panel {
        padding: 16px;
        gap: 9px;
    }

    .plan-feats {
        display: none;
    }
}
