* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;
    background: #0a0a0f;
    color: #e0e0e0;
    min-height: 100vh;
    /* Prevent any single wide child (tables, rows) from forcing the whole
       page to scroll sideways on phones. Wide content scrolls inside its
       own container instead (see .trending-table / #trending-list). */
    max-width: 100%;
    overflow-x: hidden;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px 0;
}

header .logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

header h1 {
    font-size: 28px;
    color: #00ff88;
    font-weight: 700;
}

.network-badge {
    background: #1a1a2e;
    color: #00ff88;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid #00ff8844;
}

/* Top-level tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: #12121a;
    border-radius: 12px;
    padding: 4px;
    border: 1px solid #1e1e2e;
}

.tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    color: #666;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.tab:hover {
    color: #aaa;
}

.tab.active {
    background: #00ff88;
    color: #000;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Sub-tabs (Buy/Sell inside Trade) */
.sub-tabs {
    display: flex;
    gap: 4px;
    margin: 16px 0 12px;
    background: #0a0a0f;
    border-radius: 8px;
    padding: 3px;
    border: 1px solid #2a2a3a;
}

.sub-tab {
    flex: 1;
    padding: 8px;
    background: transparent;
    color: #666;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.sub-tab:hover {
    color: #aaa;
}

.sub-tab.active {
    background: #00ff88;
    color: #000;
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

/* Token tab sub-panels (Trending / Pump.Tires / Trench) */
.token-panel {
    display: none;
}

.token-panel.active {
    display: block;
}

/* Trade mode switch: DEX vs pump.tires */
.mode-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 16px;
    background: #0a0a0f;
    border-radius: 8px;
    padding: 3px;
    border: 1px solid #2a2a3a;
}

.mode-tab {
    flex: 1;
    padding: 9px;
    background: transparent;
    color: #888;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.mode-tab:hover {
    color: #ccc;
}

.mode-tab.active {
    background: #00ff88;
    color: #000;
}

/* Hidden when not in DEX mode */
.mode-hidden {
    display: none !important;
}

/* Card */
.card {
    background: #12121a;
    border: 1px solid #1e1e2e;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.card h2 {
    font-size: 16px;
    color: #888;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.form-row {
    display: flex;
    gap: 8px;
}

.form-row input {
    flex: 1;
}

.security-notice {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    padding: 10px;
    background: #0a0a0f;
    border-radius: 6px;
    border-left: 3px solid #ff8800;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 10px 12px;
    background: #0a0a0f;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-family: monospace;
    font-size: 14px;
}

select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select option {
    background: #0a0a0f;
    color: #e0e0e0;
}

input:focus,
select:focus {
    outline: none;
    border-color: #00ff88;
}

/* Buttons */
button {
    padding: 10px 20px;
    background: #00ff88;
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.85;
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

button.loading {
    color: transparent;
    pointer-events: none;
    position: relative;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid #444;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-secondary {
    background: #2a2a3a;
    color: #e0e0e0;
}

.btn-small {
    padding: 4px 10px;
    font-size: 11px;
    background: #2a2a3a;
    color: #888;
}

.btn-small.loading {
    color: transparent;
    pointer-events: none;
    position: relative;
}

.btn-small.loading::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    top: 50%;
    left: 50%;
    margin-top: -6px;
    margin-left: -6px;
    border: 2px solid #444;
    border-top-color: #00ff88;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-remove {
    padding: 4px 8px;
    font-size: 11px;
    background: #ff444422;
    color: #ff4444;
    border: 1px solid #ff444444;
}

.btn-approve {
    background: #4488ff;
    color: #fff;
}

.btn-approve:hover {
    background: #3377ee;
}

.btn-approve:disabled {
    background: #2a5599;
    color: #88aadd;
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-approve.loading {
    color: transparent;
    pointer-events: none;
    position: relative;
}

.btn-approve.loading::after {
    border-top-color: #fff;
}

/* Info boxes */
.info-box {
    background: #0a0a0f;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 8px 0;
    font-size: 13px;
    font-family: monospace;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
}

.info-box span:last-child {
    color: #00ff88;
    font-weight: 600;
}

/* Slider */
input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #2a2a3a;
    border-radius: 3px;
    outline: none;
    margin: 8px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00ff88;
    cursor: pointer;
    border: 2px solid #0a0a0f;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00ff88;
    cursor: pointer;
    border: 2px solid #0a0a0f;
}

/* Gas buttons */
.gas-buttons {
    display: flex;
    gap: 8px;
}

.gas-buttons button {
    flex: 1;
    padding: 8px;
    background: #1a1a2e;
    color: #888;
    border: 1px solid #2a2a3a;
    font-size: 13px;
}

.gas-buttons button.active {
    background: #ff880022;
    border-color: #ff8800;
    color: #ff8800;
}

/* Token info */
.token-info {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    min-height: 18px;
}

.token-info.loaded {
    color: #00ff88;
}

.token-info.error {
    color: #ff4444;
}

/* Token-info row + Trade-tab "Details" button */
.token-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.token-info-row .token-info {
    flex: 1;
    min-width: 0;
}

.btn-pt-details {
    flex: 0 0 auto;
    padding: 3px 10px;
    background: #1a1a2e;
    color: #00ff88;
    border: 1px solid #00ff8844;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-pt-details:hover {
    background: #00ff8811;
}

.btn-pt-details.hidden {
    display: none;
}

/* Wallet table */
.wallet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.wallet-table th {
    text-align: left;
    padding: 8px 4px;
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 1px solid #1e1e2e;
}

.wallet-table td {
    padding: 8px 4px;
    border-bottom: 1px solid #1a1a22;
}

.wallet-table tr:hover {
    background: #1a1a2e;
}

.wallet-table .addr {
    font-family: monospace;
    font-size: 12px;
    color: #aaa;
}

.wallet-table .balance {
    color: #00ff88;
    font-family: monospace;
}

/* Utility */
.hidden {
    display: none !important;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    display: inline-block;
    width: 44px;
    height: 24px;
    background: #2a2a3a;
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #666;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #00ff88;
}

.toggle-switch input:checked + .toggle-slider::after {
    left: 23px;
    background: #000;
}

.toggle-label {
    font-size: 13px;
    color: #888;
    font-weight: 600;
}

.result {
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
    word-break: break-all;
}

.result.success {
    background: #00ff8811;
    border: 1px solid #00ff8844;
    color: #00ff88;
}

.result.error {
    background: #ff444411;
    border: 1px solid #ff444444;
    color: #ff4444;
}

.result a {
    color: #00ff88;
    text-decoration: underline;
}

.error-text {
    color: #ff4444;
}

.empty {
    color: #444;
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* Chart */
.chart-card {
    position: relative;
    height: 70vh;
    padding: 0;
    overflow: hidden;
}

.chart-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #444;
    font-size: 14px;
}

.chart-frame {
    border-radius: 8px;
}

/* pump.tires native candlestick chart */
.pt-chart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: #111;
}

.pt-chart-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #555;
    font-size: 14px;
    z-index: 2;
    pointer-events: none;
}

.pt-chart-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pt-chart-label {
    font-size: 13px;
    color: #00ff88;
    font-weight: 600;
}

.pt-chart-intervals {
    display: flex;
    gap: 4px;
    background: #0a0a0f;
    border-radius: 8px;
    padding: 3px;
    border: 1px solid #2a2a3a;
}

.pt-iv-btn {
    padding: 5px 12px;
    background: transparent;
    color: #888;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s;
}

.pt-iv-btn:hover {
    color: #ccc;
}

.pt-iv-btn.active {
    background: #00ff88;
    color: #000;
}

/* RPC list styles removed — single RPC, no UI needed */

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Log badge on tab */
.log-badge {
    display: inline-block;
    background: #00ff88;
    color: #000;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    padding: 1px 5px;
    margin-left: 2px;
    vertical-align: middle;
    line-height: 14px;
}

/* Log entries */
.log-entry {
    border-bottom: 1px solid #1a1a22;
    padding: 10px 4px;
    font-size: 12px;
    font-family: monospace;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.log-entry-meta {
    color: #555;
    font-size: 11px;
}

.log-entry-detail {
    color: #aaa;
    word-break: break-all;
}

.log-entry-detail a {
    color: #00ff88;
    text-decoration: underline;
}

.status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.status-pending {
    background: #ff880022;
    color: #ff8800;
    border: 1px solid #ff880055;
}

.status-confirmed {
    background: #00ff8822;
    color: #00ff88;
    border: 1px solid #00ff8855;
}

.status-failed {
    background: #ff444422;
    color: #ff4444;
    border: 1px solid #ff444455;
}

.status-error {
    background: #ff444422;
    color: #ff4444;
    border: 1px solid #ff444455;
}

/* Favorites */
.token-input-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.token-input-row input {
    flex: 1;
}

.btn-favorite {
    padding: 8px 10px;
    background: transparent;
    border: 1px solid #2a2a3a;
    color: #666;
    font-size: 16px;
    line-height: 1;
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.btn-favorite:hover {
    border-color: #ff8800;
    color: #ff8800;
    opacity: 1;
}

.btn-favorite.active {
    background: #ff880022;
    border-color: #ff8800;
    color: #ff8800;
}

.favorites-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.fav-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #1a1a2e;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 3px 10px 3px 8px;
    font-size: 12px;
    font-family: monospace;
    cursor: pointer;
    color: #aaa;
    transition: all 0.15s;
}

.fav-pill:hover {
    border-color: #00ff88;
    color: #00ff88;
}

.fav-pill-remove {
    color: #444;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    margin-left: 2px;
    transition: color 0.15s;
}

.fav-pill-remove:hover {
    color: #ff4444;
}

/* Bottom-right live status indicator */
.status-indicator {
    position: fixed;
    bottom: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 20px;
    padding: 6px 12px;
    font-family: monospace;
    font-size: 12px;
    color: #e0e0e0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.status-indicator .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 6px #00ff88;
    animation: status-pulse 2s ease-in-out infinite;
}

.status-indicator.stale .status-dot {
    background: #ff4444;
    box-shadow: 0 0 6px #ff4444;
    animation: none;
}

.status-indicator .status-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.status-indicator #status-gwei {
    color: #888;
    font-size: 11px;
}

.status-indicator #status-pls {
    color: #00ff88;
    font-size: 11px;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Trending tab */
.trending-status {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-family: monospace;
}

.trending-status.error {
    color: #ff4444;
}

/* The Trending / New Pools / Pump.Tires lists render wide multi-column tables
   (.trending-table). On narrow phones they can't fit, so the list container
   scrolls them HORIZONTALLY inside the card (the page itself never overflows
   — see html/body overflow-x). */
#trending-list,
#newpools-list,
#pt-list {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.trending-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.trending-table th {
    text-align: left;
    padding: 8px 4px;
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 1px solid #1e1e2e;
    white-space: nowrap;
}

.trending-table td {
    padding: 8px 4px;
    border-bottom: 1px solid #1a1a22;
    font-family: monospace;
    white-space: nowrap;
}

.trending-table tbody tr {
    cursor: pointer;
}

.trending-table tbody tr:hover {
    background: #1a1a2e;
}

.trending-token {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e0e0e0;
    font-weight: 600;
}

.trending-img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.trending-table .price-up {
    color: #00ff88;
}

.trending-table .price-down {
    color: #ff4444;
}

/* pump.tires tab */
.pt-status {
    font-size: 12px;
    color: #666;
    margin: 8px 0;
    font-family: monospace;
}

.pt-status.error {
    color: #ff4444;
}

.pt-king-card {
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.pt-king-card.clickable {
    cursor: pointer;
}

.pt-king-card.clickable:hover {
    border-color: #00ff88;
}

.pt-king-label {
    font-size: 11px;
    color: #ffb300;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.pt-king-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pt-king-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.pt-king-name {
    font-size: 16px;
    font-weight: 700;
    color: #e0e0e0;
}

.pt-king-name span {
    color: #888;
    font-size: 13px;
    font-weight: 400;
}

.pt-king-meta {
    font-size: 12px;
    color: #aaa;
    font-family: monospace;
    margin-top: 4px;
}

.pt-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.pt-filter-btn {
    padding: 6px 10px;
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #aaa;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.pt-filter-btn:hover {
    border-color: #00ff88;
    color: #e0e0e0;
}

.pt-filter-btn.active {
    background: #00ff8822;
    border-color: #00ff88;
    color: #00ff88;
}

.pt-search {
    margin-bottom: 10px;
}

.pt-detail-toggle {
    margin-bottom: 12px;
}

.pt-trade-bonding {
    margin-top: 8px;
}

.pt-trade-bonding .pt-bonding-bar {
    width: 100%;
    height: 8px;
}

.pt-detail-toggle .toggle-label {
    font-size: 13px;
    color: #aaa;
}

.pt-row-bonding {
    cursor: default;
    opacity: 0.85;
}

.pt-badge-launched {
    display: inline-block;
    padding: 2px 8px;
    background: #00ff8822;
    border: 1px solid #00ff8844;
    border-radius: 10px;
    color: #00ff88;
    font-size: 11px;
}

/* Trench list rows */
.pt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid #1a1a22;
    cursor: pointer;
}

.pt-row:hover {
    background: #1a1a2e;
}

.pt-row-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* Allow this flex child to shrink so long names ellipsize instead of
       pushing into (overlapping) the right-hand value. */
    flex: 1;
    min-width: 0;
}

.pt-row-symbol {
    color: #e0e0e0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pt-row-name {
    color: #888;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pt-row-side {
    text-align: right;
    color: #aaa;
    font-size: 13px;
    font-family: monospace;
    /* Never shrink or wrap the value column; the main column yields instead. */
    flex-shrink: 0;
    white-space: nowrap;
}

.pt-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #ffb30022;
    border: 1px solid #ffb30044;
    border-radius: 10px;
    color: #ffb300;
    font-size: 11px;
}

/* Trench filter/sort groups */
.trench-filter-group {
    display: inline-flex;
    gap: 6px;
    margin-right: 14px;
}

/* Trench list pagination */
.pt-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0 4px;
}

.pt-pager-label {
    color: #888;
    font-size: 13px;
}

.pt-bonding {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pt-bonding-bar {
    width: 48px;
    height: 6px;
    background: #1e1e2e;
    border-radius: 3px;
    overflow: hidden;
}

.pt-bonding-bar span {
    display: block;
    height: 100%;
    background: #ffb300;
}

.pt-bonding small {
    color: #888;
    font-size: 10px;
}

/* ─── pump.tires detail overlay ─── */
.pt-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.pt-detail-overlay.hidden {
    display: none;
}

.pt-detail-modal {
    position: relative;
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px;
}

.pt-detail-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
}

.pt-detail-close:hover {
    color: #fff;
}

.pt-detail-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.pt-detail-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.pt-detail-name {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.pt-detail-name span {
    color: #888;
    font-size: 14px;
    font-weight: 400;
}

.pt-detail-addr {
    font-size: 11px;
    color: #666;
    font-family: monospace;
    word-break: break-all;
}

.pt-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: #ccc;
    margin-bottom: 12px;
    align-items: center;
}

.pt-detail-bonding {
    margin-bottom: 12px;
}

.pt-detail-bonding-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #ffb300;
    margin-bottom: 4px;
}

.pt-detail-bonding-label span {
    font-weight: 600;
}

.pt-detail-bonding .pt-bonding-bar {
    width: 100%;
    height: 8px;
}

.pt-detail-stats {
    width: 100%;
    margin-bottom: 16px;
}

.pt-detail-trade {
    width: 100%;
    padding: 10px;
    background: #00ff88;
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.pt-detail-trade:hover {
    background: #00e67a;
}

/* Top holder distribution (detail modal) */
.pt-holders {
    margin-top: 14px;
}

.pt-holders-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.pt-holders-title {
    font-size: 13px;
    font-weight: 600;
    color: #aaa;
}

.pt-holders-summary {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.pt-conc-low {
    color: #00ff88;
    background: #00ff8811;
    border: 1px solid #00ff8844;
}

.pt-conc-med {
    color: #ffb300;
    background: #ffb30011;
    border: 1px solid #ffb30044;
}

.pt-conc-high {
    color: #ff4444;
    background: #ff444411;
    border: 1px solid #ff444444;
}

.pt-holders-table td:last-child,
.pt-holders-table th:last-child {
    text-align: right;
}

.pt-holder-curve {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #ffb300;
    background: #ffb30011;
    border: 1px solid #ffb30044;
    border-radius: 4px;
    padding: 0 5px;
    margin-left: 4px;
    vertical-align: middle;
}

.pt-detail-note {
    text-align: center;
    padding: 10px;
    background: #ffb30011;
    border: 1px solid #ffb30033;
    border-radius: 8px;
    color: #ffb300;
    font-size: 13px;
}

/* ─── About popup ─── */
.about-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 20px;
}

.about-overlay.hidden {
    display: none;
}

.about-box {
    position: relative;
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    padding: 28px 24px 24px;
    text-align: center;
}

.about-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
}

.about-close:hover {
    color: #fff;
}

.about-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
}

.about-title {
    margin: 10px 0 2px;
    font-size: 22px;
    color: #fff;
}

.about-tagline {
    margin: 0 0 14px;
    color: #00ff88;
    font-size: 13px;
    font-weight: 600;
}

.about-overview {
    margin: 0 0 18px;
    color: #bbb;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

.about-heading {
    margin: 16px 0 8px;
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.about-dex-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
}

.about-dex-pill {
    display: inline-block;
    padding: 4px 10px;
    background: #00ff8822;
    border: 1px solid #00ff8844;
    border-radius: 12px;
    color: #00ff88;
    font-size: 12px;
    font-weight: 600;
}

.about-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.about-features li {
    position: relative;
    padding: 5px 0 5px 20px;
    color: #ccc;
    font-size: 13px;
    line-height: 1.4;
}

.about-features li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: #00ff88;
    font-weight: 700;
}

.about-features li.about-feature-hl {
    color: #fff;
    font-weight: 600;
}

.about-features li.about-feature-hl::before {
    content: '\26A1';
}

.about-ok {
    margin-top: 20px;
    width: 100%;
    padding: 11px;
    background: #00ff88;
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.about-ok:hover {
    background: #00e67a;
}

/* ─── Wallet export/import ─── */

.wallet-io-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-wallet-io {
    flex: 1;
    padding: 9px;
    background: #1a1a2e;
    color: #00ff88;
    border: 1px solid #00ff8844;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-wallet-io:hover:not(:disabled) {
    background: #00ff8811;
}

.btn-wallet-io:disabled {
    color: #555;
    border-color: #2a2a3a;
    cursor: not-allowed;
}

/* Password modal (export/import) */
.pw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 20px;
}

.pw-overlay.hidden {
    display: none;
}

.pw-box {
    position: relative;
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    max-width: 420px;
    width: 100%;
    padding: 24px;
}

.pw-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
}

.pw-close:hover {
    color: #fff;
}

.pw-title {
    margin: 0 0 8px;
    color: #00ff88;
    font-size: 18px;
}

.pw-desc {
    margin: 0 0 16px;
    color: #aaa;
    font-size: 13px;
}

.pw-input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #0a0a0f;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    box-sizing: border-box;
}

.pw-input:focus {
    outline: none;
    border-color: #00ff88;
}

.pw-input.hidden {
    display: none;
}

.pw-warning {
    margin: 4px 0 12px;
    padding: 8px 10px;
    background: #ff880011;
    border-left: 3px solid #ff8800;
    border-radius: 4px;
    color: #ffb066;
    font-size: 12px;
}

.pw-warning.hidden {
    display: none;
}

.pw-error {
    margin: 0 0 12px;
    padding: 8px 10px;
    background: #ff444422;
    border: 1px solid #ff444444;
    border-radius: 6px;
    color: #ff4444;
    font-size: 13px;
}

.pw-error.hidden {
    display: none;
}

.pw-submit {
    width: 100%;
    padding: 11px;
    background: #00ff88;
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.pw-submit:hover:not(:disabled) {
    background: #00e67a;
}

.pw-submit:disabled {
    opacity: 0.7;
    cursor: default;
}

/* ==========================================================================
   Mobile / narrow-screen responsiveness
   The app targets a 600px column; on phones we reclaim horizontal space,
   let the tab bars and filter groups adapt, and make sure nothing forces
   the page to scroll sideways. Wide tables scroll inside their card (1A).
   ========================================================================== */
@media (max-width: 640px) {
    .container {
        padding: 12px;
    }

    .card {
        padding: 14px;
    }

    header {
        gap: 8px;
        margin-bottom: 16px;
        padding: 8px 0;
    }

    header h1 {
        font-size: 22px;
    }

    /* Top-level tabs (Wallet/Token/Trade/Chart/Log): 5 items must fit.
       Shrink them; if still too tight the row scrolls instead of clipping. */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        padding: 9px 6px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* Token sub-tabs (Trending / New Pools / Pump.Tires / Trench): longer
       labels — allow horizontal scroll fallback and tighten spacing. */
    .sub-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sub-tab {
        padding: 8px 6px;
        font-size: 11px;
        white-space: nowrap;
    }

    /* Trench filter/sort groups: wrap onto multiple lines rather than
       overflowing the row on narrow screens. */
    .pt-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .trench-filter-group {
        margin-right: 8px;
    }

    /* Wide discovery tables always scroll within the card on phones. */
    #trending-list,
    #newpools-list,
    #pt-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
