:root {
    --bg-main: #050608;
    --bg-panel: #101216;
    --bg-panel-alt: #151821;
    --accent: #00ff9c;
    --accent-soft: rgba(0, 255, 156, 0.15);
    --border-soft: #232634;
    --text-main: #f5f5f7;
    --text-muted: #a1a4b3;
    --danger: #ff4a4a;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-main);
    background: radial-gradient(circle at top, #171c24 0, #050608 50%);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.app {
    width: 100%;
    max-width: 1000px;
    background: linear-gradient(135deg, #090b0f, #050608);
    border-radius: 18px;
    border: 1px solid #202331;
    box-shadow:
        0 22px 80px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(255, 255, 255, 0.01);
    padding: 20px 24px 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 20px;
}

/* MOBILE HEADER COMPACT MODE */
@media (max-width: 600px) {
  .header {
    padding: 8px 10px;
    gap: 6px;
  }

  .header .title {
    font-size: 18px;
    line-height: 1.2;
  }

  .header .small {
    font-size: 12px;
    opacity: 0.8;
  }

  .header .badge {
    font-size: 12px;
    padding: 4px 6px;
  }

  .header select {
    font-size: 12px;
    padding: 2px 4px;
  }
}

.header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.title {
    font-size: 18px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

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

.badge {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: radial-gradient(circle at top left, #1e242f 0, #050608 50%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge select {
    background: transparent;
    border: none;
    color: var(--accent);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    outline: none;
}

.panel {
    border-radius: 14px;
    padding: 14px 14px 16px;
    background: radial-gradient(circle at top left, #191f2a 0, #050608 40%);
    border: 1px solid var(--border-soft);
}

.panel.secondary {
    background: radial-gradient(circle at top right, #151822 0, #050608 45%);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.panel-subtitle {
    font-size: 11px;
    color: var(--accent);
    opacity: 0.8;
}

.field-group {
    margin-bottom: 10px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

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

.label-hint {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.8;
}

input,
textarea,
select {
    width: 100%;
    background: rgba(7, 9, 14, 0.9);
    border-radius: 10px;
    border: 1px solid rgba(52, 57, 73, 0.9);
    padding: 8px 10px;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    font-family: var(--font-main);
    transition: border-color 0.14s ease, box-shadow 0.14s ease,
        background-color 0.14s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(0, 255, 156, 0.4);
    background: #050608;
}

textarea {
    min-height: 60px;
    resize: vertical;
    font-size: 12px;
    line-height: 1.3;
}

.readonly {
    font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: 12px;
}

.button-row {
    display: flex;
    gap: 8px;
    margin-top: 2px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

button {
    border-radius: 999px;
    border: 1px solid rgba(65, 72, 90, 0.9);
    background: radial-gradient(circle at top, #141925 0, #050608 70%);
    color: var(--text-main);
    font-size: 12px;
    padding: 7px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 600;
    opacity: 0.92;
    transition: opacity 0.15s ease, border-color 0.15s ease,
        background 0.15s ease, transform 0.06s ease;
}

button:hover {
    opacity: 1;
    border-color: var(--accent);
    transform: translateY(-0.5px);
}

button:active {
    transform: translateY(0.5px) scale(0.99);
}

button.primary {
    background: linear-gradient(135deg, #00ff9c, #00b7ff);
    color: #050608;
    border-color: rgba(0, 0, 0, 0.8);
}

button.danger {
    background: radial-gradient(circle at top, #ff4a4a, #c0122b);
    color: #fff;
    border-color: rgba(0, 0, 0, 0.85);
}

button:disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
    transform: none;
}

.balance {
    font-size: 24px;
    font-weight: 500;
    letter-spacing: 0.06em;
    margin-top: 4px;
    margin-bottom: 2px;
}

.balance span {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
}

.status {
    margin-top: 8px;
    font-size: 11px;
    padding: 7px 9px;
    border-radius: 10px;
    background: radial-gradient(circle at left, #10141e 0, #050608 70%);
    border: 1px solid rgba(46, 52, 70, 0.9);
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    min-height: 32px;
    white-space: pre-line;
}

.status.ok {
    border-color: rgba(0, 255, 156, 0.6);
}

.status.error {
    border-color: rgba(255, 74, 74, 0.7);
    color: #ffd4d4;
}

.status-label {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 10px;
    color: var(--text-muted);
}

.status-text {
    flex: 1;
    text-align: right;
    font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: 11px;
}

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

.copy-icon {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.copy-icon:hover {
    opacity: 1;
}

.qr-button {
    border-radius: 50%;
    width: 26px;
    height: 26px;
    padding: 0;
    font-size: 12px;
    border: 1px solid rgba(65, 72, 90, 0.9);
}

.qr-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.qr-modal {
    background: #050608;
    border-radius: 14px;
    padding: 18px;
    border: 1px solid #202331;
    min-width: 260px;
    max-width: 320px;
    text-align: center;
}

.qr-modal h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 14px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.qr-modal-close {
    margin-top: 10px;
    width: 100%;
}

.token-section-title {
    margin-top: 14px;
    margin-bottom: 4px;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.token-section-divider {
    height: 1px;
    margin: 6px 0 10px;
    border-radius: 999px;
    background: linear-gradient(90deg,
    rgba(0, 255, 156, 0.18),
    rgba(0, 0, 0, 0.7),
    rgba(0, 183, 255, 0.25));
}