:root {
    color-scheme: light;
    --tg-bg: #f3f4f6;
    --tg-text: #17181a;
    --tg-muted: #687078;
    --surface: #ffffff;
    --surface-soft: #f7f8fa;
    --line: #e3e6e9;
    --line-strong: #cbd1d6;
    --brand: #b4232a;
    --brand-dark: #861a20;
    --brand-soft: #fff0f1;
    --gold: #a56b08;
    --gold-soft: #fff6dc;
    --green: #18794e;
    --green-soft: #e9f8f0;
    --blue: #2463a7;
    --blue-soft: #edf5ff;
    --danger: #b4232a;
    --shadow: 0 5px 18px rgba(22, 28, 34, 0.08);
    --chrome-bg: rgba(255, 255, 255, 0.97);
    --ball-bg: #ffffff;
    --green-border: #b7dfc9;
    --danger-border: #efc3c6;
    --gold-border: #ead397;
    --avatar-border: #f0d6a5;
    --focus-ring: rgba(180, 35, 42, 0.12);
    --modal-overlay: rgba(15, 18, 20, 0.46);
    --preview-text: #51400f;
    --skeleton: #e7e9ec;
    --ball-red: #cf2e36;
    --ball-blue: #2771bd;
    --ball-green: #23855a;
    --wave-red-text: #a51f27;
    --wave-red-soft: #fff0f1;
    --wave-blue-text: #1d5c9b;
    --wave-blue-soft: #edf5ff;
    --wave-green-text: #18794e;
    --wave-green-soft: #e9f8f0;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --nav-height: 66px;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --tg-bg: #0f1114;
    --tg-text: #f3f4f6;
    --tg-muted: #9ba3ad;
    --surface: #191c20;
    --surface-soft: #20242a;
    --line: #2d3239;
    --line-strong: #424a54;
    --brand: #c93c45;
    --brand-dark: #dc4f57;
    --brand-soft: #351a1d;
    --gold: #e7b95d;
    --gold-soft: #2d281a;
    --green: #62d095;
    --green-soft: #183328;
    --blue: #72abe4;
    --blue-soft: #172a3c;
    --danger: #ff737a;
    --shadow: 0 7px 22px rgba(0, 0, 0, 0.28);
    --chrome-bg: rgba(25, 28, 32, 0.97);
    --ball-bg: #20242a;
    --green-border: #285a40;
    --danger-border: #663137;
    --gold-border: #5b4a24;
    --avatar-border: #8b6a32;
    --focus-ring: rgba(211, 75, 82, 0.24);
    --modal-overlay: rgba(0, 0, 0, 0.68);
    --preview-text: #f0d28a;
    --skeleton: #282d33;
    --ball-red: #ff626a;
    --ball-blue: #6aaef0;
    --ball-green: #5ac98d;
    --wave-red-text: #ff858b;
    --wave-red-soft: #3a1c20;
    --wave-blue-text: #86bdf2;
    --wave-blue-soft: #172a3c;
    --wave-green-text: #78d9a6;
    --wave-green-soft: #183328;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--tg-bg);
}

body {
    min-width: 300px;
    min-height: 100vh;
    margin: 0;
    color: var(--tg-text);
    background: var(--tg-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

button,
input,
textarea,
select {
    color: inherit;
    font: inherit;
    letter-spacing: 0;
}

input::placeholder,
textarea::placeholder {
    color: var(--tg-muted);
    opacity: 0.78;
}

button {
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.app-shell {
    min-height: 100vh;
    padding-top: var(--safe-top);
}

.topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    min-height: 60px;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--chrome-bg);
    backdrop-filter: blur(12px);
}

.brand-lockup {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.brand-lockup > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.brand-lockup strong {
    overflow: hidden;
    font-size: 16px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-lockup span:last-child {
    color: var(--tg-muted);
    font-size: 11px;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 2px solid var(--avatar-border);
    border-radius: 50%;
    color: #fff;
    background: var(--brand);
    font-size: 20px;
    font-weight: 850;
}

.icon-button {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.icon-button:active,
.secondary-button:active,
.primary-button:active {
    transform: translateY(1px);
}

#main-content {
    min-height: calc(100vh - 60px);
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 18px);
}

.view {
    display: none;
}

.view.is-active {
    display: block;
}

.view-content {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 12px;
}

.section-band {
    margin: 0 -12px;
    padding: 14px 12px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.section-band + .section-band {
    margin-top: 10px;
}

.panel,
.list-panel,
.modal-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel {
    padding: 14px;
}

.panel + .panel,
.list-panel + .panel,
.panel + .list-panel,
.list-panel + .list-panel {
    margin-top: 10px;
}

.hero-account {
    overflow: hidden;
    border-top: 4px solid var(--brand);
}

.panel-heading,
.list-row,
.metric-row,
.action-row,
.result-heading,
.request-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.action-row {
    flex-wrap: wrap;
}

.action-row > button {
    flex: 1 1 120px;
}

.issue-block {
    min-width: 0;
}

.eyebrow,
.field-label,
.metric-label {
    display: block;
    color: var(--tg-muted);
    font-size: 11px;
    font-weight: 650;
}

.issue-number {
    display: inline-block;
    overflow: hidden;
    margin-top: 2px;
    font-size: 18px;
    font-weight: 820;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.issue-status-line {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.countdown {
    min-width: 74px;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
    font-size: 22px;
    font-weight: 850;
    text-align: right;
}

.status-chip {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    justify-content: center;
    padding: 3px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.status-open,
.status-completed,
.status-won {
    border-color: var(--green-border);
    color: var(--green);
    background: var(--green-soft);
}

.status-closed,
.status-lost,
.status-failed,
.status-rejected {
    border-color: var(--danger-border);
    color: var(--danger);
    background: var(--brand-soft);
}

.status-sync,
.status-pending {
    border-color: var(--gold-border);
    color: var(--gold);
    background: var(--gold-soft);
}

.balance-primary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.balance-value {
    display: block;
    margin-top: 4px;
    font-size: 30px;
    font-weight: 860;
    line-height: 1;
}

.balance-value small {
    margin-left: 4px;
    color: var(--tg-muted);
    font-size: 12px;
    font-weight: 650;
}

.balance-support-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 16px;
    margin-top: 11px;
    color: var(--tg-muted);
    font-size: 11px;
}

.balance-support-row strong {
    margin-left: 3px;
    color: var(--tg-text);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.home-bet-action {
    display: grid;
    width: 100%;
    min-height: 54px;
    grid-template-columns: 34px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    color: #fff;
    background: var(--brand);
    text-align: left;
}

.home-bet-action > svg {
    width: 18px;
    height: 18px;
}

.home-bet-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.home-bet-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.home-bet-copy strong {
    font-size: 15px;
}

.home-bet-copy small {
    overflow: hidden;
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-runtime-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.countdown-block {
    flex: 0 0 auto;
    text-align: right;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 14px;
}

.quick-action {
    display: flex;
    min-width: 0;
    min-height: 66px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    font-size: 12px;
    font-weight: 680;
}

.home-quick-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 10px 0;
}

.home-quick-actions .quick-action {
    min-height: 56px;
    background: var(--surface);
    box-shadow: none;
}

.quick-action svg {
    width: 21px;
    height: 21px;
    color: var(--brand);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.metric {
    min-width: 0;
    padding: 11px 9px;
    background: var(--surface);
}

.metric strong {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-benefit-link {
    display: grid;
    width: 100%;
    min-height: 44px;
    grid-template-columns: minmax(0, 1fr) auto 18px;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    color: var(--tg-text);
    background: var(--gold-soft);
    text-align: left;
}

.home-benefit-link span {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
}

.home-benefit-link span svg {
    width: 18px;
    height: 18px;
    color: var(--gold);
}

.home-benefit-link strong {
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

.home-benefit-link > svg {
    width: 16px;
    height: 16px;
    color: var(--tg-muted);
}

.panel-heading {
    margin-bottom: 10px;
}

.panel-heading h2,
.panel-heading h3 {
    margin: 0;
    font-size: 15px;
}

.text-button {
    padding: 4px 0;
    color: var(--brand);
    background: transparent;
    font-size: 12px;
    font-weight: 700;
}

.draw-numbers {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.draw-ball-wrap {
    min-width: 0;
    text-align: center;
}

.draw-ball {
    display: grid;
    width: 100%;
    max-width: 40px;
    aspect-ratio: 1;
    margin: 0 auto;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: var(--ball-bg);
    font-size: 14px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.draw-ball.red {
    color: var(--ball-red);
}

.draw-ball.blue {
    color: var(--ball-blue);
}

.draw-ball.green {
    color: var(--ball-green);
}

.draw-ball-wrap small {
    display: block;
    margin-top: 3px;
    color: var(--tg-muted);
    font-size: 10px;
}

.draw-ball-wrap.special {
    padding-left: 4px;
    border-left: 1px dashed var(--line-strong);
}

.draw-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    color: var(--tg-muted);
    font-size: 11px;
}

.draw-history-row {
    padding: 11px 12px;
    border-top: 1px solid var(--line);
}

.draw-history-row:first-child {
    border-top: 0;
}

.draw-history-row .result-heading {
    margin-bottom: 8px;
}

.draw-history-row .draw-numbers {
    gap: 4px;
}

.draw-history-row .draw-ball {
    max-width: 32px;
    font-size: 11px;
}

.bottom-nav {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    min-height: calc(var(--nav-height) + var(--safe-bottom));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 5px 8px calc(5px + var(--safe-bottom));
    border-top: 1px solid var(--line);
    background: var(--chrome-bg);
    backdrop-filter: blur(14px);
}

.bottom-nav button {
    display: flex;
    min-width: 0;
    height: 54px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 8px;
    color: var(--tg-muted);
    background: transparent;
    font-size: 10px;
}

.bottom-nav button svg {
    width: 21px;
    height: 21px;
}

.bottom-nav button.is-active {
    color: var(--brand);
    background: var(--brand-soft);
    font-weight: 750;
}

.bet-header-band {
    position: sticky;
    z-index: 20;
    top: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.bet-header-band strong {
    display: block;
    margin-top: 1px;
    font-size: 17px;
}

.play-tabs {
    display: grid;
    width: min(100%, 760px);
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0 auto;
    padding: 8px 12px 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.play-tabs button {
    height: 39px;
    border-bottom: 3px solid transparent;
    color: var(--tg-muted);
    background: transparent;
    font-weight: 680;
}

.play-tabs button.is-active {
    border-bottom-color: var(--brand);
    color: var(--brand);
}

.bet-builder {
    width: min(100%, 760px);
    min-height: 430px;
    margin: 0 auto;
    padding: 12px 12px 104px;
}

.builder-section + .builder-section {
    margin-top: 14px;
}

.builder-heading {
    display: flex;
    min-height: 28px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

.builder-heading strong {
    font-size: 14px;
}

.builder-heading span {
    color: var(--tg-muted);
    font-size: 11px;
}

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

.number-button {
    display: grid;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: var(--tg-text);
    background: var(--surface);
    font-weight: 780;
    font-variant-numeric: tabular-nums;
}

.number-button.is-selected {
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
    box-shadow: 0 0 0 2px var(--focus-ring);
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.selection-button,
.amount-chip {
    min-width: 0;
    min-height: 42px;
    padding: 7px 5px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    font-weight: 700;
}

.selection-button.is-selected {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-soft);
}

.selection-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.selection-button small {
    margin-top: 3px;
    color: var(--tg-muted);
    font-size: 10px;
    font-weight: 600;
}

.selection-button.is-selected small {
    color: currentColor;
}

.selection-button[data-wave="红波"].is-selected {
    border-color: var(--ball-red);
    color: var(--wave-red-text);
    background: var(--wave-red-soft);
}

.selection-button[data-wave="蓝波"].is-selected {
    border-color: var(--ball-blue);
    color: var(--wave-blue-text);
    background: var(--wave-blue-soft);
}

.selection-button[data-wave="绿波"].is-selected {
    border-color: var(--ball-green);
    color: var(--wave-green-text);
    background: var(--wave-green-soft);
}

.zodiac-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.zodiac-grid .selection-button {
    aspect-ratio: 1;
    min-height: 0;
    border-radius: 50%;
    font-size: 15px;
}

.segmented-control {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
}

.segmented-control button {
    min-height: 38px;
    border-left: 1px solid var(--line);
    color: var(--tg-muted);
    background: transparent;
    font-size: 12px;
    font-weight: 680;
}

.segmented-control button:first-child {
    border-left: 0;
}

.segmented-control button.is-active {
    color: #fff;
    background: var(--brand);
}

.amount-row {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) 2fr;
    gap: 8px;
}

.input-wrap {
    display: flex;
    min-width: 0;
    height: 44px;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
}

.input-wrap:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--focus-ring);
}

.input-wrap input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.input-wrap span {
    flex: 0 0 auto;
    color: var(--tg-muted);
    font-size: 12px;
}

.amount-chips {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.amount-chip {
    min-height: 44px;
    color: var(--brand);
    background: var(--brand-soft);
}

.raw-bet-input {
    width: 100%;
    min-height: 260px;
    resize: vertical;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    outline: none;
    background: var(--surface);
    font-family: "SFMono-Regular", Consolas, "Microsoft YaHei", monospace;
    font-size: 15px;
    line-height: 1.7;
}

.raw-bet-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--focus-ring);
}

.bet-preview {
    padding: 10px 12px;
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
    color: var(--preview-text);
    background: var(--gold-soft);
    white-space: pre-wrap;
    word-break: break-word;
}

.bet-submit-bar {
    position: fixed;
    z-index: 35;
    right: 0;
    bottom: calc(var(--nav-height) + var(--safe-bottom));
    left: 0;
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    background: var(--chrome-bg);
    backdrop-filter: blur(12px);
}

.bet-submit-bar > div {
    display: flex;
    min-width: 86px;
    flex-direction: column;
}

.bet-submit-bar span {
    color: var(--tg-muted);
    font-size: 11px;
}

.bet-submit-bar strong {
    color: var(--brand);
    font-size: 21px;
    font-variant-numeric: tabular-nums;
}

.primary-button,
.secondary-button,
.danger-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 8px;
    font-weight: 750;
}

.primary-button {
    color: #fff;
    background: var(--brand);
}

.primary-button:hover {
    background: var(--brand-dark);
}

.secondary-button {
    border: 1px solid var(--line-strong);
    color: var(--tg-text);
    background: var(--surface);
}

.danger-button {
    border: 1px solid var(--danger-border);
    color: var(--danger);
    background: var(--brand-soft);
}

.wide-button {
    width: 100%;
}

.section-toolbar {
    position: sticky;
    z-index: 20;
    top: 60px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--tg-bg);
}

.list-panel {
    overflow: hidden;
    box-shadow: none;
}

.list-row {
    min-height: 62px;
    align-items: flex-start;
    padding: 11px 12px;
    border-top: 1px solid var(--line);
}

.list-row:first-child {
    border-top: 0;
}

button.list-row {
    width: 100%;
    text-align: left;
    background: var(--surface);
}

.list-main {
    min-width: 0;
    flex: 1;
}

.list-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    font-weight: 730;
}

.list-title > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-subtitle {
    overflow: hidden;
    margin-top: 3px;
    color: var(--tg-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-value {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    font-weight: 760;
    text-align: right;
}

.list-value small {
    display: block;
    margin-top: 3px;
    color: var(--tg-muted);
    font-size: 10px;
    font-weight: 500;
}

.money-in {
    color: var(--green);
}

.money-out {
    color: var(--danger);
}

.empty-state {
    display: flex;
    min-height: 220px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: var(--tg-muted);
    text-align: center;
}

.empty-state svg {
    width: 36px;
    height: 36px;
}

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

.benefit-action {
    display: flex;
    min-width: 0;
    min-height: 82px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    text-align: left;
}

.benefit-action svg {
    color: var(--brand);
}

.benefit-action strong {
    font-size: 14px;
}

.benefit-action span {
    overflow: hidden;
    width: 100%;
    color: var(--tg-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-track {
    overflow: hidden;
    width: 100%;
    height: 8px;
    margin-top: 10px;
    border-radius: 4px;
    background: var(--line);
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    display: grid;
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    place-items: center;
    border: 2px solid var(--avatar-border);
    border-radius: 50%;
    color: #fff;
    background: var(--brand);
    font-size: 20px;
    font-weight: 850;
}

.profile-header h2 {
    overflow: hidden;
    margin: 0;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-header p {
    margin: 2px 0 0;
    color: var(--tg-muted);
    font-size: 12px;
}

.key-value-list {
    margin: 12px 0 0;
}

.key-value-list > div {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--line);
}

.key-value-list dt {
    color: var(--tg-muted);
}

.key-value-list dd {
    overflow: hidden;
    margin: 0;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toast-region {
    position: fixed;
    z-index: 100;
    top: calc(var(--safe-top) + 70px);
    right: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 7px;
    pointer-events: none;
}

.toast {
    width: min(100%, 460px);
    padding: 11px 13px;
    border: 1px solid #393d42;
    border-radius: 8px;
    color: #fff;
    background: #24272a;
    box-shadow: var(--shadow);
    animation: toast-in 160ms ease-out;
}

.toast.success {
    border-color: #2f8c62;
    background: #176341;
}

.toast.error {
    border-color: #d24a52;
    background: #8f2026;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
}

.modal-backdrop {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 14px 12px calc(14px + var(--safe-bottom));
    background: var(--modal-overlay);
}

.modal-panel {
    width: min(100%, 540px);
    max-height: min(82vh, 760px);
    overflow: auto;
    padding: 15px;
    border-radius: 8px;
}

.modal-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.modal-heading h2 {
    margin: 0;
    font-size: 17px;
}

.modal-heading p {
    margin: 3px 0 0;
    color: var(--tg-muted);
    font-size: 11px;
}

.modal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 15px;
}

.modal-actions .single {
    grid-column: 1 / -1;
}

.form-field + .form-field {
    margin-top: 12px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    color: var(--tg-muted);
    font-size: 12px;
    font-weight: 680;
}

.form-field input,
.form-field select {
    width: 100%;
    height: 46px;
    padding: 0 11px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    outline: 0;
    background: var(--surface);
    font-size: 16px;
}

.form-field input:focus,
.form-field select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--focus-ring);
}

.summary-box {
    padding: 11px 12px;
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    background: var(--gold-soft);
}

.summary-box pre {
    margin: 7px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "SFMono-Regular", Consolas, "Microsoft YaHei", monospace;
    font-size: 13px;
}

.usdt-address-block {
    display: grid;
    gap: 7px;
    margin-top: 12px;
    padding: 11px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface-soft);
}

.usdt-qr-card {
    display: flex;
    align-items: center;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #ffffff;
    color: #171717;
    flex-direction: column;
    text-align: center;
}

.usdt-payment-qr {
    display: grid;
    width: 220px;
    max-width: 100%;
    min-height: 220px;
    place-items: center;
}

.usdt-payment-qr canvas,
.usdt-payment-qr img {
    display: block;
    width: 220px !important;
    max-width: 100%;
    height: auto !important;
}

.usdt-qr-card strong {
    margin-top: 9px;
    font-size: 14px;
}

.usdt-qr-card > span {
    margin-top: 3px;
    color: #666666;
    font-size: 11px;
}

.qr-fallback {
    display: grid;
    min-height: 220px;
    padding: 18px;
    color: #666666;
    font-size: 12px;
    line-height: 1.6;
    place-items: center;
}

.usdt-address-block span {
    color: var(--tg-muted);
    font-size: 12px;
    font-weight: 680;
}

.usdt-address-block code {
    overflow-wrap: anywhere;
    color: var(--tg-text);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
    line-height: 1.55;
}

.payment-warning {
    margin: 12px 0 0;
    color: var(--danger);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.6;
}

.order-reuse-note {
    margin: 12px 0 0;
    color: var(--tg-muted);
    font-size: 13px;
    line-height: 1.65;
}

.order-reuse-note strong {
    color: var(--danger);
}

.blocking-loader {
    position: fixed;
    z-index: 120;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
    background: var(--tg-bg);
}

.blocking-loader.is-hidden {
    display: none;
}

.loader-panel {
    display: flex;
    width: min(100%, 320px);
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    color: var(--tg-muted);
    text-align: center;
}

.loader-panel strong {
    color: var(--tg-text);
    font-size: 16px;
}

.spinner {
    width: 34px;
    height: 34px;
    margin-bottom: 4px;
    border: 3px solid var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.skeleton-stack {
    display: grid;
    gap: 10px;
}

.skeleton {
    height: 110px;
    border-radius: 8px;
    background: var(--skeleton);
    animation: pulse 1.2s ease-in-out infinite alternate;
}

.skeleton.tall {
    height: 230px;
}

@keyframes pulse {
    to {
        opacity: 0.55;
    }
}

.detail-items {
    overflow: hidden;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.bet-batch-detail + .bet-batch-detail {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.batch-detail-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.batch-detail-heading strong {
    flex: 0 0 auto;
    font-size: 13px;
}

.batch-detail-heading span {
    min-width: 0;
    color: var(--tg-muted);
    font-size: 11px;
    line-height: 1.5;
    text-align: right;
}

.detail-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--line);
}

.detail-item:first-child {
    border-top: 0;
}

.detail-item strong {
    display: block;
    font-size: 13px;
}

.detail-item span {
    color: var(--tg-muted);
    font-size: 11px;
}

@media (min-width: 640px) {
    .view-content,
    .bet-builder {
        padding-right: 18px;
        padding-left: 18px;
    }

    .number-grid {
        grid-template-columns: repeat(10, minmax(0, 1fr));
    }

    .selection-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .zodiac-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .benefit-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .quick-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .home-quick-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 359px) {
    .quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-quick-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .home-quick-actions .quick-action {
        min-height: 54px;
        font-size: 11px;
    }

    .home-runtime-row {
        gap: 8px;
    }

    .issue-status-line {
        gap: 5px;
    }

    .issue-number {
        font-size: 15px;
    }

    .issue-status-line .status-chip {
        min-height: 24px;
        padding-right: 7px;
        padding-left: 7px;
        font-size: 11px;
    }

    .number-grid {
        gap: 5px;
    }

    .selection-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .amount-row {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
