/* TradeCraftly · profile.php styles (colour tokens are in base.css) */
* {
    box-sizing: border-box
}

html,
body {
    background: var(--bg)
}

body {
    margin: 0;
    color: var(--fg);
    font-family: var(--ui);
    font-size: 14px;
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

a {
    color: var(--link)
}

a:hover {
    color: #b8ccff
}

button,
input,
select {
    font: inherit;
    color: inherit
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.mono {
    font-family: var(--mono)
}

/* ---------- top bar ---------- */
.brandbar {
    padding: 10px 28px;
    background: #0f1420;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10
}

.brandin {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--fg);
    min-width: 0
}

.brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover
}

.brand b {
    display: block;
    font-size: 15px
}

.brand small {
    display: block;
    font-size: 11px;
    color: var(--muted)
}

.navlinks {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--input-line);
    border-radius: 8px;
    color: var(--fg);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap
}

.pill:hover {
    border-color: var(--accent);
    color: var(--fg)
}

/* ---------- page ---------- */
main {
    width: 100%;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex: 1
}

h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0
}

.card.solo {
    max-width: 440px;
    width: 100%;
    margin: 40px auto
}

.card h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600
}

.card p {
    margin: 0;
    color: var(--fg2);
    font-size: 13px;
    line-height: 1.55
}

.card p.lead {
    max-width: 640px
}

.phead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap
}

.phead > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 260px
}

.card p.sub {
    color: var(--muted)
}

.dim {
    color: var(--dim)
}

.center {
    text-align: center
}

/* ---------- header card ---------- */
.hero {
    padding: 0;
    gap: 0;
    overflow: hidden
}

.htop {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px
}

.who {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0
}

.av {
    flex: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700
}

.wtxt {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0
}

.nm {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap
}

.em {
    font-size: 14px;
    color: var(--fg2);
    overflow-wrap: anywhere
}

.since {
    font-size: 12px;
    color: var(--muted)
}

.since b {
    color: var(--fg2);
    font-weight: 500
}

.badge {
    padding: 2px 8px;
    border-radius: 5px;
    background: rgba(124, 156, 255, .16);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase
}

.badge.pro {
    background: rgba(61, 220, 132, .14);
    color: var(--call)
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    background: #0f1420
}

.stat {
    padding: 14px 24px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-right: 1px solid var(--line2);
    min-width: 0
}

.stat:last-child {
    border-right: 0
}

.sl {
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted)
}

.sv {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap
}

.sv b {
    font-size: 18px;
    font-weight: 700
}

.sv small {
    font-size: 12px;
    color: var(--dim)
}

.g1 {
    color: var(--call)
}

.g3 {
    color: var(--amber)
}

.g4 {
    color: var(--put)
}

/* ---------- tabs ---------- */
.layout {
    display: flex;
    align-items: flex-start;
    gap: 24px
}

.tabs {
    flex: 0 0 220px;
    position: sticky;
    top: 76px;
    display: flex;
    flex-direction: column;
    gap: 4px
}

.tabs button {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer
}

.tabs button:hover {
    background: var(--panel)
}

.tabs button b {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg3)
}

.tabs button span {
    font-size: 12px;
    color: var(--muted)
}

.tabs button.on {
    background: var(--panel);
    border-color: var(--input-line)
}

.tabs button.on b {
    color: var(--fg)
}

.panels {
    flex: 1 1 560px;
    min-width: 0
}

.panel {
    display: flex;
    flex-direction: column;
    gap: 20px
}

/* ---------- forms ---------- */
form {
    margin: 0
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.lbl {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px
}

.lbl:first-child {
    margin-top: 0
}

.opt {
    color: var(--dim)
}

.row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap
}

.row .txt {
    flex: 1 1 200px;
    width: auto
}

.txt {
    width: 100%;
    min-width: 0;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--fg);
    outline: none
}

.txt::placeholder {
    color: var(--dim)
}

.txt:focus {
    border-color: var(--accent)
}

select.txt {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    padding-right: 32px
}

.up {
    text-transform: uppercase
}

.up::placeholder {
    text-transform: uppercase
}

.btn {
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid var(--input-line);
    background: transparent;
    color: var(--fg);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap
}

.btn:hover {
    border-color: var(--accent);
    color: var(--fg)
}

.btn.main {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
    padding: 10px 18px
}

.btn.main:hover {
    background: #93adff;
    color: var(--on-accent)
}

.btn.wide {
    width: 100%;
    margin-top: 12px
}

.btn.sm {
    padding: 6px 12px;
    font-size: 12.5px
}

.btn.out:hover {
    border-color: var(--put);
    color: var(--put)
}

.btn.danger {
    border-color: var(--put);
    color: var(--put)
}

.btn.danger:hover {
    background: rgba(255, 107, 107, .08)
}

.btn.danger.solid {
    background: var(--put);
    color: #1a0a0a
}

.btn.ghost {
    border-color: transparent;
    color: var(--muted)
}

.btn:disabled {
    opacity: .5;
    cursor: wait
}

.msg {
    font-size: 12.5px;
    color: var(--put);
    min-height: 0
}

.msg:empty {
    display: none
}

.msg.ok {
    color: var(--call)
}

.fine {
    font-size: 12px;
    color: var(--muted)
}

.card p.fine {
    font-size: 12px;
    color: var(--muted)
}

/* ---------- status tags ---------- */
.tagx {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: rgba(138, 147, 166, .14);
    color: var(--muted);
    white-space: nowrap
}

.tagx.active {
    background: rgba(61, 220, 132, .14);
    color: var(--call)
}

.tagx.queued {
    background: rgba(124, 156, 255, .16);
    color: var(--accent)
}

.tagx.ended {
    background: rgba(138, 147, 166, .12);
    color: var(--muted)
}

/* ---------- plan & billing ---------- */
.mcards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px
}

.mcard {
    background: #0f1420;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch
}

.mcard .btn {
    align-self: flex-start
}

.mtop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px
}

.mk {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted)
}

.mplan {
    display: flex;
    flex-direction: column;
    gap: 2px
}

.mplan b {
    font-size: 17px;
    font-weight: 700
}

.mplan span {
    font-size: 13px;
    color: var(--fg2)
}

.mcard.free .mplan span {
    color: var(--muted)
}

.mbar {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.meter {
    height: 5px;
    border-radius: 3px;
    background: var(--line2);
    overflow: hidden
}

.meter i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--call)
}

.meter.warn i {
    background: #ffb86b
}

.left {
    font-size: 12px;
    color: var(--muted)
}

.left.warn {
    color: #ffb86b
}

.paybox {
    padding: 14px 16px;
    background: #0f1420;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 14px
}

.payrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

.card .payrow p {
    flex: 1 1 360px;
    text-wrap: pretty
}

#payForm {
    border-top: 1px solid var(--line2);
    padding-top: 14px
}

.grid3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px
}

.grid3 > div {
    display: flex;
    flex-direction: column;
    gap: 8px
}

#payForm .row {
    margin-top: 4px
}

.hist {
    display: flex;
    flex-direction: column
}

.cap {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 8px
}

.hrow {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.6fr);
    gap: 12px;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--line2);
    font-size: 13px
}

.hrow.hh {
    padding: 8px 0;
    border-bottom-color: var(--line);
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--dim)
}

.hrow > span:last-child {
    text-align: right
}

.hp {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.hp b {
    font-weight: 600
}

.hm {
    color: var(--muted)
}

.hd {
    font-size: 12px;
    color: var(--fg3)
}

/* ---------- security ---------- */
.devs {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden
}

.dev {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-top: 1px solid var(--line)
}

.dev:first-child {
    border-top: 0
}

.dev .ic {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--line2);
    color: var(--fg3);
    display: flex;
    align-items: center;
    justify-content: center
}

.dev .d {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px
}

.dev .d b {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.dev .d span {
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.dev .cur {
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(124, 156, 255, .16);
    color: var(--accent) !important;
    font-size: 10px !important;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase
}

.grid2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px
}

.strength {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px
}

.strength i {
    height: 3px;
    border-radius: 2px;
    background: var(--line)
}

.strength.s1 i:nth-child(-n+1) {
    background: var(--put)
}

.strength.s2 i:nth-child(-n+2) {
    background: #ffb86b
}

.strength.s3 i:nth-child(-n+3) {
    background: var(--amber)
}

.strength.s4 i {
    background: var(--call)
}

/* ---------- account ---------- */
.card.danger {
    border-color: rgba(255, 107, 107, .4)
}

.card.danger h2 {
    color: var(--put)
}

/* ---------- footer ---------- */
footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    padding: 22px 28px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--muted)
}

/* ---------- smaller screens ---------- */
@media (max-width: 900px) {
    .layout {
        flex-direction: column;
        align-items: stretch
    }

    .tabs {
        position: static;
        flex: none;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr))
    }

    .tabs button span {
        display: none
    }

    .tabs button {
        align-items: center;
        text-align: center;
        padding: 10px 8px
    }

    .panels {
        flex: none
    }

    .grid3 {
        grid-template-columns: 1fr
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .stat:nth-child(2n) {
        border-right: 0
    }

    .stat:nth-child(-n+2) {
        border-bottom: 1px solid var(--line2)
    }
}

@media (max-width: 640px) {
    .brandbar {
        padding: 10px 16px
    }

    .brand small {
        display: none
    }

    main {
        padding: 16px;
        gap: 16px
    }

    .card {
        padding: 18px 16px;
        gap: 16px
    }

    .card.hero {
        padding: 0;
        gap: 0
    }

    .htop {
        padding: 18px 16px
    }

    .stat {
        padding: 12px 16px
    }

    .av {
        width: 48px;
        height: 48px;
        font-size: 20px
    }

    .who {
        gap: 14px
    }

    h1 {
        font-size: 19px
    }

    .tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .tabs button b {
        font-size: 13px
    }

    .grid2 {
        grid-template-columns: 1fr;
        gap: 16px
    }

    .hrow {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px
    }

    .hrow.hh {
        display: none
    }

    .hrow > span:last-child {
        text-align: left
    }

    .hm {
        font-size: 12px
    }

    .phead .btn {
        width: 100%
    }

    footer {
        padding: 18px 16px;
        flex-direction: column
    }
}
