* {
    box-sizing: border-box;
    font-family: "Fira Code", Consolas, monospace;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #050505;
    color: #00ff9c;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
}

#app-shell {
    width: min(1200px, 100%);
}

header {
    text-align: center;
    border: 1px solid #0f0;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: #0e0e0e;
}

.notice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    border: 1px dashed #1affb5;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    background: #040404;
    font-size: 0.85rem;
    color: #bfffe4;
}

.app-header {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    text-align: left;
}

#access-summary {
    border: 1px solid #1affb5;
    padding: 0.75rem 1rem;
    min-width: 260px;
    background: #050505;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.cost-hint {
    font-size: 0.8rem;
    color: #8affc1;
    margin-top: 0.4rem;
}

.cost-hint.small {
    margin-top: 0.6rem;
}

.panel {
    border: 1px solid #00a86b;
    padding: 1.5rem;
    background: #0c0c0c;
    margin-bottom: 1.5rem;
}

.panel h2 {
    margin-top: 0;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.credits-panel {
    border: 1px solid #1affb5;
    padding: 1rem;
    background: #050505;
}

.credit-balance-pill {
    border: 1px solid #8affc1;
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    margin: 0.5rem 0 0.75rem;
}

.credit-balance-pill span {
    font-size: 1.6rem;
    color: #ffffff;
}

.helper-text {
    font-size: 0.8rem;
    color: #8affc1;
    margin: 0.3rem 0;
}

.mono {
    font-family: "Fira Code", Consolas, monospace;
}

.subtle {
    font-size: 0.85rem;
    color: #bfffe480;
}

.purchase-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.8rem 0;
}

.purchase-option {
    border: 1px solid #ffaa00;
    text-transform: none;
    letter-spacing: normal;
}

.wallet-actions {
    display: flex;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.wallet-actions button {
    flex: 1;
}

button.secondary {
    background: transparent;
    border: 1px solid #8affc1;
    color: #8affc1;
}

.wallet-actions button:disabled,
button.secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#token-search {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

label {
    display: block;
    margin: 0.8rem 0 0.2rem;
    color: #8affc1;
}

.label-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.8rem 0 0.2rem;
    color: #8affc1;
}

.pattern-section {
    border-top: 1px solid #044;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.6rem 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #8affc1;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #022;
    border: 1px solid #1affb5;
    transition: background 0.2s ease;
    border-radius: 20px;
}

.slider::before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: #bfffe4;
    transition: transform 0.2s ease;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background: #00a86b;
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

.info-tip {
    border: 1px solid #1affb5;
    border-radius: 50%;
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    font-size: 0.8rem;
    text-align: center;
    line-height: 1rem;
    cursor: help;
    position: relative;
}

.info-tip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: 140%;
    transform: translateX(-50%);
    width: 220px;
    background: #022;
    border: 1px solid #1affb5;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: #bfffe4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.info-tip:hover::after {
    opacity: 1;
}

input,
select,
button {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #1affb5;
    background: #111;
    color: #bfffe4;
}

button {
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    transition: border 0.2s ease;
}

button:hover {
    border-color: #fff;
}

.button-row {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.button-row button {
    flex: 1;
}

.feedback {
    min-height: 1.2rem;
    color: #ffab40;
}

.hidden {
    display: none;
}

.results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.terminal-block {
    background: #050505;
    border: 1px solid #00a86b;
    padding: 1rem;
    min-height: 150px;
    overflow: auto;
}

.terminal-block pre {
    white-space: pre-wrap;
}

.plots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.plots-grid a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.plots-grid img,
.plots-grid iframe {
    width: 100%;
    border: 1px solid #1affb5;
    background: #000;
}

.plot-label {
    display: block;
    text-align: center;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #8affc1;
}

.metric-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px dashed #023;
    padding-bottom: 0.15rem;
}

.metric-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #1affb5;
}

.metric-value {
    font-size: 1rem;
    text-align: right;
    color: #bfffe4;
}

.extreme-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.extreme-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.extreme-list li {
    margin-bottom: 0.4rem;
}

details {
    margin-top: 0.8rem;
}

details summary {
    cursor: pointer;
    color: #bfffe4;
}

.table-scroll {
    overflow-x: auto;
    border: 1px solid #00a86b;
    margin-top: 1rem;
}

.table-scroll table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table-scroll th,
.table-scroll td {
    border: 1px solid #044;
    padding: 0.4rem 0.6rem;
}

.table-scroll th {
    background: #022;
}
