*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    max-width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f6f4ef 48%, #eef5f2 100%);
    color: #131416;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

.text-up,
.up {
    color: #16823a;
}

.text-down,
.down {
    color: #be123c;
}

.flat {
    color: #74777f;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.app-shell {
    width: 100%;
    max-width: 1180px;
    overflow-x: hidden;
    min-height: 100vh;
    margin: 0 auto;
    padding: 78px 16px 0;
    display: flex;
    flex-direction: column;
}

.main-content {
    min-width: 0;
    overflow-x: hidden;
    flex: 1;
    padding-bottom: 28px;
}

.converter-hero {
    position: relative;
    z-index: 30;
    overflow: visible;
    display: grid;
    grid-template-columns: minmax(0, 0.86fr) minmax(380px, 1.14fr);
    gap: 12px;
    align-items: stretch;
    padding: 18px 0 12px;
}

.hero-copy,
.search-panel,
.empty-state,
.panel {
    max-width: 100%;
    border: 1px solid rgba(19, 20, 22, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 28px rgba(19, 20, 22, 0.05);
}

.hero-copy {
    overflow: hidden;
    min-height: 148px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: #fc6432;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.hero-title {
    color: #131416;
    font-size: clamp(32px, 4.8vw, 52px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.hero-desc {
    max-width: 500px;
    color: #4f5257;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.search-panel {
    position: relative;
    z-index: 80;
    overflow: visible;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.search-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #74777f;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.search-label-row small {
    color: #8a8d93;
    font-size: 10px;
    font-weight: 800;
}

.search-wrap {
    position: relative;
    z-index: 90;
    min-width: 0;
    display: flex;
    align-items: center;
}

.search-ico {
    position: absolute;
    left: 13px;
    color: #74777f;
    font-size: 13px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 48px;
    padding: 0 44px;
    border: 1px solid rgba(19, 20, 22, 0.1);
    border-radius: 8px;
    outline: 0;
    background: #ffffff;
    color: #131416;
    font-size: 14px;
    font-weight: 700;
    box-shadow: none;
}

.search-input:focus {
    border-color: #fc6432;
    box-shadow: 0 0 0 3px rgba(252, 100, 50, 0.11);
}

.search-input:disabled {
    opacity: 0.65;
    cursor: wait;
}

.btn-clear {
    position: absolute;
    right: 9px;
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #74777f;
}

.btn-clear:hover {
    background: #f6f4ef;
    color: #131416;
}

.search-note {
    color: #74777f;
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    right: 0;
    z-index: 200;
    max-height: 310px;
    overflow-y: auto;
    border: 1px solid rgba(19, 20, 22, 0.1);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(19, 20, 22, 0.16);
}

.dd-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 9px 11px;
    border-bottom: 1px solid rgba(19, 20, 22, 0.07);
    cursor: pointer;
}

.dd-item:last-child {
    border-bottom: 0;
}

.dd-item:hover {
    background: #f9f7f3;
}

.dd-item img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(19, 20, 22, 0.08);
}

.dd-info {
    min-width: 0;
}

.dd-name {
    display: block;
    overflow: hidden;
    color: #131416;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dd-symbol {
    color: #74777f;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.dd-rank {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(252, 100, 50, 0.1);
    color: #fc6432;
    font-size: 11px;
    font-weight: 900;
}

.dd-status {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    color: #74777f;
    font-size: 13px;
    text-align: center;
}

.empty-state {
    position: relative;
    z-index: 1;
    overflow: hidden;
    min-height: 136px;
    padding: 18px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

.empty-icon,
.panel-head i {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #131416;
    color: #ffffff;
    flex: 0 0 auto;
}

.empty-state h2 {
    color: #131416;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
}

.empty-state > div {
    min-width: 0;
}

.empty-state p {
    margin-top: 4px;
    color: #74777f;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.empty-examples {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.empty-examples button,
.quick-btn,
.fiat-btn {
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid rgba(19, 20, 22, 0.1);
    border-radius: 8px;
    background: #ffffff;
    color: #4f5257;
    font-size: 12px;
    font-weight: 900;
}

.empty-examples button:hover,
.quick-btn:hover,
.quick-btn.active,
.fiat-btn.active {
    border-color: #131416;
    background: #131416;
    color: #ffffff;
}

.coin-section {
    animation: fadeInUp 220ms ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.88fr);
    gap: 12px;
    align-items: start;
}

.panel {
    min-width: 0;
    overflow: hidden;
    padding: 14px;
}

.token-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.token-top {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.token-logo-wrap {
    display: inline-flex;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(19, 20, 22, 0.08);
    border-radius: 8px;
    background: #f6f4ef;
    overflow: hidden;
    flex: 0 0 auto;
}

.token-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.token-id {
    min-width: 0;
}

.token-name {
    overflow: hidden;
    color: #131416;
    font-size: 23px;
    font-weight: 800;
    line-height: 1.12;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.token-badges {
    display: flex;
    gap: 7px;
    margin-top: 7px;
    flex-wrap: wrap;
}

.token-sym,
.rank-badge,
.change-pill {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.token-sym {
    background: rgba(252, 100, 50, 0.1);
    color: #fc6432;
    text-transform: uppercase;
}

.rank-badge,
.change-pill.flat {
    background: #f2efea;
    color: #74777f;
}

.price-box {
    display: grid;
    gap: 7px;
    padding: 13px;
    border-radius: 8px;
    background: #f6f4ef;
}

.label,
.period-row span,
.conv-block>span,
.stat-item span,
.ath-grid span {
    color: #74777f;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.15;
    text-transform: uppercase;
}

.token-price {
    color: #131416;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    overflow-wrap: anywhere;
}

.change-pill.up {
    background: rgba(22, 130, 58, 0.11);
    color: #16823a;
}

.change-pill.down {
    background: rgba(190, 18, 60, 0.1);
    color: #be123c;
}

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

.period-row div {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(19, 20, 22, 0.08);
    border-radius: 8px;
    background: #ffffff;
    text-align: center;
}

.period-row strong {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.panel-head i {
    width: 34px;
    height: 34px;
    background: #f2efea;
    color: #fc6432;
}

.panel-head h2 {
    color: #131416;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.15;
}

.panel-head p {
    color: #74777f;
    font-size: 12px;
    line-height: 1.25;
}

.converter-panel {
    grid-row: span 2;
}

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

.conv-block {
    display: grid;
    gap: 7px;
}

.conv-input-wrap {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid rgba(19, 20, 22, 0.1);
    border-radius: 8px;
    background: #ffffff;
}

.conv-input-wrap:focus-within {
    border-color: #fc6432;
    box-shadow: 0 0 0 3px rgba(252, 100, 50, 0.11);
}

.conv-output-wrap {
    background: rgba(252, 100, 50, 0.06);
}

.conv-input {
    width: 100%;
    min-width: 0;
    height: 54px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: #131416;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}

.conv-input:focus {
    border: 0;
    box-shadow: none;
}

.conv-input::-webkit-outer-spin-button,
.conv-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.conv-input {
    -moz-appearance: textfield;
}

.conv-input.fiat-out {
    color: #fc6432;
}

.conv-sym {
    color: #74777f;
    font-size: 12px;
    font-weight: 900;
    flex: 0 0 auto;
}

.swap-row {
    display: grid;
    grid-template-columns: 1fr 38px 1fr;
    align-items: center;
    gap: 9px;
}

.swap-row span {
    height: 1px;
    background: rgba(19, 20, 22, 0.1);
}

.btn-swap {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #131416;
    color: #ffffff;
}

.fiat-actions {
    display: flex;
    width: fit-content;
    gap: 5px;
    padding: 4px;
    border: 1px solid rgba(19, 20, 22, 0.1);
    border-radius: 8px;
    background: #f6f4ef;
}

.quick-amounts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.quick-amounts>span {
    color: #74777f;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

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

.stat-item {
    min-width: 0;
    min-height: 74px;
    padding: 10px;
    border: 1px solid rgba(19, 20, 22, 0.08);
    border-radius: 8px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

.stat-item strong {
    color: #131416;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.supply-bar-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.supply-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #ece8e1;
}

.supply-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: #fc6432;
    transition: width 500ms ease;
}

.supply-pct {
    color: #fc6432;
    font-size: 13px;
    font-weight: 900;
}

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

.ath-grid div {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(19, 20, 22, 0.08);
    border-radius: 8px;
    background: #ffffff;
}

.ath-grid strong {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.ath-grid small {
    display: block;
    margin-top: 4px;
    color: #74777f;
    font-size: 11px;
    line-height: 1.3;
}

.cta-btn {
    display: inline-flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    background: #fc6432;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.cta-btn:hover {
    background: #e55a2a;
    color: #ffffff;
    text-decoration: none;
}

.site-footer {
    margin-top: auto;
    padding: 18px 0 24px;
    border-top: 1px solid rgba(19, 20, 22, 0.08);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.cmc-attribution {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #74777f;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}

.cmc-logo {
    height: 124px;
}

.footer-copy {
    color: #74777f;
    font-size: 11px;
}

.crypto-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 9999;
    min-width: 260px;
    max-width: min(360px, calc(100vw - 32px));
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(19, 20, 22, 0.1);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(19, 20, 22, 0.16);
    opacity: 0;
    transform: translateX(-50%) translateY(16px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.crypto-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.crypto-toast__icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fc6432;
    color: #ffffff;
    flex: 0 0 auto;
}

.crypto-toast__title {
    color: #131416;
    font-size: 13px;
    font-weight: 900;
}

.crypto-toast__msg {
    display: block;
    color: #74777f;
    font-size: 12px;
    line-height: 1.35;
}

@media (min-width: 640px) {
    .app-shell {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (min-width: 1024px) {
    .app-shell {
        padding-left: 32px;
        padding-right: 32px;
    }
}

@media (max-width: 1023px) {
    .converter-hero,
    .coin-grid {
        grid-template-columns: 1fr;
    }

    .converter-panel {
        grid-row: auto;
    }
}

@media (max-width: 760px) {
    .app-shell {
        width: 100%;
        padding-top: 58px;
    }

    .converter-hero {
        gap: 8px;
        padding: 12px 0 10px;
    }

    .hero-copy {
        min-height: 112px;
        padding: 14px;
    }

    .hero-title {
        font-size: 30px;
    }

    .hero-desc {
        max-width: 280px;
        font-size: 12px;
    }

    .search-panel,
    .panel {
        padding: 12px;
    }

    .search-note,
    .empty-state p {
        max-width: 280px;
    }

    .search-label-row small {
        display: none;
    }

    .empty-state {
        min-height: 0;
        grid-template-columns: 42px minmax(0, 1fr);
        padding: 14px;
    }

    .empty-examples {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .empty-state h2 {
        font-size: 18px;
    }

    .empty-state p {
        font-size: 12px;
    }

    .token-price {
        font-size: 28px;
    }

    .period-row,
    .stats-grid,
    .ath-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .conv-input {
        font-size: 21px;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 430px) {
    .app-shell {
        padding-left: 12px;
        padding-right: 12px;
    }

    .hero-copy,
    .search-panel,
    .empty-state,
    .panel {
        width: 100%;
    }

    .period-row,
    .stats-grid,
    .ath-grid {
        grid-template-columns: 1fr;
    }

    .token-top {
        align-items: flex-start;
    }

    .token-name {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
