/* ===== Polygon USDT Staking dApp theme ===== */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
    --primary: #0052ff;
    --primary-dark: #0038c9;
    --bg: #f4f6fa;
    --card: #ffffff;
    --text: #1d212c;
    --grey: #8a919e;
    --line: #eef1f6;
    --green: #16b364;
    --orange: #ff8a00;
}

html, body {
    background: #e9ecf3;
    color: var(--text);
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

.app-wrap {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    padding-bottom: 66px;
}

/* ===== Top bar ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(244, 246, 250, 0.92);
    backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 16px; }
.brand img { width: 22px; height: 22px; }
.chain-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; color: var(--primary);
    background: rgba(0, 82, 255, 0.08);
    padding: 3px 8px; border-radius: 999px; font-weight: 600;
}
.chain-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

.connect-btn {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    max-width: 140px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}
.connect-btn.connected { background: var(--primary); color: #fff; }

/* ===== Hero ===== */
.hero {
    margin: 6px 14px 14px;
    border-radius: 18px;
    padding: 22px 18px;
    color: #fff;
    background: linear-gradient(135deg, #2b6bff 0%, #0052ff 55%, #0038c9 100%);
    box-shadow: 0 10px 24px rgba(0, 82, 255, 0.28);
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    right: -50px; top: -50px;
    width: 170px; height: 170px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}
.hero h1 { font-size: 21px; font-weight: 800; letter-spacing: .3px; }
.hero p { margin-top: 8px; font-size: 13px; opacity: .9; line-height: 1.6; }
.hero .hero-actions { display: flex; gap: 10px; margin-top: 18px; position: relative; z-index: 1; }
.hero .demo-tag {
    position: absolute; top: 14px; right: 14px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 10px; padding: 3px 8px; border-radius: 6px; font-weight: 700;
    letter-spacing: .5px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: 12px;
    padding: 12px 18px;
    font-size: 14px; font-weight: 700;
    cursor: pointer; text-decoration: none;
    transition: transform .08s ease, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-white { background: #fff; color: var(--primary); }
.btn-outline { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.7); }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 9px; }

/* ===== Cards ===== */
.card {
    background: var(--card);
    border-radius: 16px;
    margin: 0 14px 14px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.05);
}
.card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.card-sub { font-size: 12px; color: var(--grey); margin-top: 3px; }
.more-link { font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 600; }

/* ===== Stat grids ===== */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stat-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px; padding: 11px 12px;
}
.stat-item .k { font-size: 11px; opacity: .85; }
.stat-item .v { font-size: 15px; font-weight: 800; margin-top: 5px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.metric { text-align: center; }
.metric .k { font-size: 11px; color: var(--grey); }
.metric .v { font-size: 13px; font-weight: 700; margin-top: 6px; color: var(--text); word-break: break-all; }
.metric .v.blue { color: var(--primary); }
.metric .v.green { color: var(--green); }

/* ===== Asset summary on home ===== */
.asset-row { display: flex; gap: 10px; margin-top: 14px; }
.asset-pill {
    flex: 1; border-radius: 12px;
    background: #f7f9fd; border: 1px solid var(--line);
    padding: 11px; text-align: center;
}
.asset-pill .k { font-size: 11px; color: var(--grey); }
.asset-pill .v { font-size: 14px; font-weight: 800; margin-top: 5px; color: var(--primary); }
.action-row { display: flex; gap: 10px; margin-top: 14px; }
.action-row .btn { flex: 1; }

/* ===== Plans ===== */
.plan-row {
    display: flex; align-items: center; justify-content: space-between;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 13px 14px;
    margin-top: 10px;
    cursor: pointer;
}
.plan-row.selected { border-color: var(--primary); background: rgba(0, 82, 255, 0.04); }
.plan-row .term { font-weight: 700; font-size: 14px; }
.plan-row .term small { display: block; color: var(--grey); font-weight: 400; font-size: 11px; margin-top: 2px; }
.plan-row .apy { color: var(--primary); font-weight: 800; font-size: 16px; }

/* ===== Form inputs ===== */
.input-card {
    background: #f7f9fd;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    margin-top: 12px;
}
.input-line { display: flex; align-items: center; }
.input-line .label { font-size: 13px; color: var(--grey); width: 42px; }
.input-line input {
    flex: 1; border: none; background: transparent; outline: none;
    font-size: 20px; font-weight: 800; color: var(--text);
    min-width: 0;
}
.input-line .unit { display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 14px; }
.input-line .unit img { width: 20px; height: 20px; }
.max-btn {
    color: var(--primary); font-size: 12px; font-weight: 700;
    background: rgba(0, 82, 255, 0.08);
    border: none; border-radius: 7px; padding: 5px 9px; cursor: pointer;
    margin-left: 8px;
}
.estimate { display: flex; justify-content: space-between; font-size: 12px; color: var(--grey); margin-top: 10px; }
.estimate b { color: var(--text); font-weight: 600; }

/* ===== Tabs ===== */
.seg-tabs { display: flex; background: #eef1f7; border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg-tabs a, .seg-tabs span.tab {
    flex: 1; text-align: center; padding: 9px 0;
    font-size: 13px; font-weight: 700; color: var(--grey);
    border-radius: 9px; text-decoration: none; cursor: pointer;
}
.seg-tabs .active { background: #fff; color: var(--primary); box-shadow: 0 2px 6px rgba(16,24,40,.08); }

/* ===== Ticker ===== */
.ticker {
    height: 168px; overflow: hidden; margin-top: 12px;
    position: relative;
    border-radius: 12px;
}
.ticker ul { list-style: none; }
.ticker li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 4px; border-bottom: 1px dashed var(--line);
    font-size: 12px;
}
.ticker .addr { color: var(--primary); font-family: monospace; }
.ticker .amt { font-weight: 700; }
.ticker .amt .coin { color: var(--grey); font-weight: 500; margin-left: 3px; }
.tag-in, .tag-out {
    font-size: 10px; border-radius: 5px; padding: 2px 6px;
    margin-right: 7px; font-weight: 700;
}
.tag-in { background: rgba(22,179,100,.12); color: var(--green); }
.tag-out { background: rgba(255,138,0,.12); color: var(--orange); }

/* ===== FAQ ===== */
.faq-item { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item summary { font-weight: 700; font-size: 13px; list-style: none; cursor: pointer; display: flex; justify-content: space-between; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary .arrow { transform: rotate(180deg); }
.faq-item .arrow { transition: transform .2s; color: var(--grey); }
.faq-item p { font-size: 12px; color: var(--grey); line-height: 1.7; margin-top: 8px; }

/* ===== Records list ===== */
.list-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 2px; border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: none; }
.list-row .left .top { font-weight: 700; font-size: 13px; display: flex; align-items: center; }
.list-row .left .bot { font-size: 11px; color: var(--grey); margin-top: 4px; font-family: monospace; }
.list-row .right { text-align: right; }
.list-row .right .v { font-weight: 800; font-size: 13px; }
.list-row .right .t { font-size: 11px; color: var(--grey); margin-top: 4px; }
.status-pill { font-size: 10px; padding: 2px 7px; border-radius: 5px; font-weight: 700; margin-left: 7px; }
.status-active { background: rgba(0,82,255,.1); color: var(--primary); }
.status-done { background: rgba(22,179,100,.12); color: var(--green); }

.filter-tags { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-tags span {
    font-size: 12px; padding: 5px 12px; border-radius: 999px;
    background: #eef1f7; color: var(--grey); font-weight: 600; cursor: pointer;
}
.filter-tags span.on { background: var(--primary); color: #fff; }

.empty { text-align: center; padding: 40px 0; color: var(--grey); font-size: 13px; }

/* ===== Referral ===== */
.share-hero {
    border-radius: 18px;
    padding: 22px 18px;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #6d39e8);
    margin-bottom: 14px;
}
.share-hero h2 { font-size: 20px; font-weight: 800; }
.share-hero p { font-size: 12px; opacity: .9; margin-top: 6px; }
.share-link-box { display: flex; gap: 8px; margin-top: 16px; }
.share-link-box input {
    flex: 1; min-width: 0; border: none; border-radius: 10px;
    padding: 11px 12px; font-size: 12px; outline: none;
    background: rgba(255,255,255,.16); color: #fff;
}
.share-link-box input::placeholder { color: rgba(255,255,255,.7); }
.share-link-box .btn { border-radius: 10px; background: #fff; color: #6d39e8; }

.steps { display: flex; justify-content: space-between; text-align: center; }
.steps .step { flex: 1; }
.steps .step img { width: 46px; height: 46px; }
.steps .step h4 { font-size: 12px; margin-top: 8px; }

.rebate-card {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 8px; margin-top: 14px; text-align: center;
}
.rebate-card .cell .k { font-size: 11px; color: rgba(255,255,255,.85); }
.rebate-card .cell .v { font-size: 15px; font-weight: 800; margin-top: 5px; }

.team-block { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.team-block .box {
    background: #f7f9fd; border: 1px solid var(--line);
    border-radius: 12px; padding: 14px;
}
.team-block .box h3 { font-size: 20px; font-weight: 800; color: var(--primary); }
.team-block .box h4 { font-size: 12px; color: var(--grey); margin-top: 5px; font-weight: 500; }

/* ===== Toast ===== */
.toast {
    position: fixed; left: 50%; top: 38%;
    transform: translateX(-50%);
    background: rgba(20, 24, 33, .9);
    color: #fff; font-size: 13px;
    padding: 11px 18px; border-radius: 10px;
    z-index: 999; max-width: 80%; text-align: center;
    opacity: 0; transition: opacity .2s;
    pointer-events: none;
}
.toast.show { opacity: 1; }

/* ===== Tab bar ===== */
.tabbar {
    position: fixed; bottom: 0;
    width: 100%; max-width: 500px;
    left: 50%; transform: translateX(-50%);
    background: #fff;
    display: flex;
    border-top: 1px solid var(--line);
    padding: 6px 0 8px;
    z-index: 60;
}
.tabbar a {
    flex: 1; text-align: center;
    text-decoration: none; color: var(--grey);
    font-size: 11px;
}
.tabbar a .ic { height: 22px; display: block; margin-bottom: 2px; }
.tabbar a .ic svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--primary); font-weight: 700; }

.page-pad { padding-top: 4px; }
.back-link { color: var(--primary); font-size: 13px; text-decoration: none; font-weight: 600; }

/* ===== Wallet not detected overlay ===== */
.wallet-overlay {
    position: fixed; inset: 0;
    background: rgba(10, 14, 25, .62);
    z-index: 300;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    opacity: 0; pointer-events: none;
    transition: opacity .2s;
}
.wallet-overlay.show { opacity: 1; pointer-events: auto; }
.wallet-overlay .wo-sheet {
    width: 100%; max-width: 340px;
    background: #fff; border-radius: 18px;
    padding: 24px 20px 18px; text-align: center;
    transform: translateY(16px); transition: transform .2s;
}
.wallet-overlay.show .wo-sheet { transform: translateY(0); }
.wallet-overlay .wo-close {
    position: absolute; top: 8px; right: 8px;
    width: 30px; height: 30px; line-height: 30px;
    padding: 0; border: none; border-radius: 50%;
    background: rgba(15, 20, 35, .06); color: #6b7688;
    font-size: 20px; font-weight: 600; cursor: pointer;
    z-index: 1; -webkit-tap-highlight-color: transparent;
}
.wallet-overlay .wo-close:hover,
.wallet-overlay .wo-close:active { background: rgba(15, 20, 35, .12); color: #303a4d; }
.wallet-overlay .wo-sheet { position: relative; }
.wallet-overlay .wo-ill { display: block; width: 84px; margin: 0 auto; }
.wallet-overlay h3 { font-size: 16px; font-weight: 800; margin-top: 12px; }
.wallet-overlay p { font-size: 12px; color: var(--grey); line-height: 1.8; margin-top: 8px; }
.wallet-overlay .wo-link { margin-top: 14px; }
.wallet-overlay .wo-link input {
    width: 100%; border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 12px; font-size: 11px; color: var(--grey);
    background: #f7f9fd; outline: none; text-overflow: ellipsis;
}
.wallet-overlay .wo-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.wallet-overlay .wo-actions .btn { width: 100%; }
.wallet-overlay .wo-recheck {
    background: none; border: none; cursor: pointer;
    font-size: 12px; color: var(--grey); margin-top: 10px;
}

/* ===== Hero split with illustration ===== */
.hero-split { display: flex; align-items: center; gap: 4px; }
.hero-split .hero-txt { flex: 1; min-width: 0; position: relative; z-index: 1; }
.hero-ill { width: 116px; flex: none; position: relative; z-index: 1; margin: -6px -2px -22px 0; }

/* ===== Card title icon ===== */
.tt-ic { width: 24px; height: 24px; object-fit: contain; flex: none; }
.inl-ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

/* ===== FAQ arrow image ===== */
.faq-item summary .faq-arrow { width: 14px; transition: transform .2s; }
.faq-item[open] summary .faq-arrow { transform: rotate(180deg); }

/* ===== Account menu rows with icons ===== */
.menu-row { align-items: center; }
.menu-row .left { display: flex; align-items: center; }
.menu-row .menu-ic { width: 22px; height: 22px; margin-right: 10px; flex: none; }
.menu-row .go-ic { width: 15px; opacity: .45; }

/* ===== Empty state illustration ===== */
.empty-img { width: 112px; display: block; margin: 0 auto 10px; opacity: .9; }

/* ===== Share hero with illustration ===== */
.share-hero { display: flex; align-items: center; overflow: hidden; }
.share-hero .share-txt { flex: 1; min-width: 0; position: relative; z-index: 1; }
.share-ill { width: 118px; flex: none; margin: -8px -6px -20px 0; position: relative; z-index: 1; }
