@font-face {
    font-family: Manrope;
    src: url("/fonts/manrope.woff2") format("woff2");
    font-weight: 400 800;
    font-display: swap;
}

@font-face {
    font-family: "Noto Sans Thai";
    src: url("/fonts/noto-sans-thai.woff2") format("woff2");
    font-weight: 400 800;
    font-display: swap;
    unicode-range: U+0E01-0E5B;
}

:root {
    color-scheme: dark;
    font-family: Manrope, "Noto Sans Thai", system-ui, sans-serif;
    color: #edf5ff;
    --muted: #a4b8ce;
    --page-width: 1000px;
    --side-blue: #9bb9da;
    background: linear-gradient(
        to right,
        #f8fbff,
        var(--side-blue) calc(50% - var(--page-width) / 2),
        var(--side-blue) calc(50% + var(--page-width) / 2),
        #f8fbff
    );
    --content-inset: 1.5rem;
    --cyan: #76ddf8;
}

* { box-sizing: border-box; }
body {
    position: relative;
    max-width: var(--page-width);
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    isolation: isolate;
    -webkit-user-select: none;
    user-select: none;
    background: #071321;
}

body::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 0 auto;
    aspect-ratio: 1000 / 450;
    background: url("/currencybackground.webp?v=4137e4dfceba") center top / 100% auto no-repeat;
    opacity: .72;
    mask-image: linear-gradient(black 80%, transparent);
    pointer-events: none;
}
button, input { font: inherit; }
input { -webkit-user-select: text; user-select: text; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.site-width { width: min(100%, var(--page-width)); padding-inline: var(--content-inset); margin-inline: auto; }
.masthead { min-height: 5.25rem; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; justify-self: start; text-decoration: none; font-size: 1.6rem; font-weight: 780; }
.brand span span { color: var(--cyan); }
.view-switch, .filters { display: flex; padding: .23rem; gap: .2rem; background: #102238; border-radius: .72rem; }
.view-switch a, .filters button { display: inline-flex; justify-content: center; align-items: center; gap: .4rem; border: 0; padding: .48rem .8rem; border-radius: .47rem; background: transparent; color: var(--muted); font-weight: 620; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.view-switch a[aria-current], .filters button[aria-pressed="true"] { color: #eefaff; background: #294d6b; }
.view-switch a:hover, .filters button:hover { color: white; }
.rounding-toggle::before {
    content: "";
    width: .56rem;
    height: .56rem;
    flex: none;
    border-radius: 50%;
    background: #889db3;
}
.rounding-toggle[aria-pressed="true"]::before { background: var(--cyan); }
.language-button { justify-self: end; display: flex; align-items: center; gap: .3rem; padding: .42rem .5rem; border-radius: .55rem; background: #162e47; color: var(--muted); border: 0; }
.flag { display: block; flex: none; width: 1.5rem; aspect-ratio: 4 / 3; height: auto; border-radius: .18rem; }
.language-button svg { width: .9rem; }
.language-panel { background: #142b42; }
.language-options { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; padding: .62rem 1rem; }
.language-options a { display: flex; align-items: center; gap: .5rem; padding: .48rem .72rem; border-radius: .5rem; text-decoration: none; }
.language-options a:hover, .language-options [aria-current] { background: #264966; }

.hero { min-height: 15.5rem; padding-top: 1.15rem; display: flex; align-items: center; margin-bottom: 1rem; }
.hero-copy { padding: 1.45rem 0; max-width: 36rem; }
.feed { display: inline-flex; align-items: center; gap: .48rem; margin: 0 0 .85rem; padding: .33rem .63rem; background: #153b53; color: #a4e8fb; border-radius: 2rem; font-size: .88rem; font-weight: 620; }
.feed-dot { width: .43rem; height: .43rem; border-radius: 50%; background: #79e1f7; }
h1 { margin: 0; font-size: clamp(2.15rem, 5vw, 3.75rem); line-height: 1.12; font-weight: 750; text-wrap: balance; }
.hero h1 + p { max-width: 27rem; margin: .85rem 0 0; color: #c1d5e9; line-height: 1.55; }

.workspace { background: #101f31; border-radius: 1.15rem; overflow: clip; }
.workspace-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1.2rem 1.75rem; padding: 1.15rem 1.35rem; background: #162b42; }
h2 { margin: 0; font-size: 1.26rem; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.currency-sort {
    display: grid;
    place-items: center;
    width: 2.45rem;
    height: 2.45rem;
    border: 0;
    border-radius: .65rem;
    background: #102238;
    color: #a4b8ce;
}
.currency-sort:hover, .currency-sort[data-state="asc"], .currency-sort[data-state="desc"] {
    background: #294d6b;
    color: var(--cyan);
}
.currency-sort svg path { display: none; }
.currency-sort:not([data-state]) .sort-original,
.currency-sort[data-state="original"] .sort-original,
.currency-sort[data-state="asc"] .sort-asc,
.currency-sort[data-state="desc"] .sort-desc { display: initial; }

.search { display: flex; align-items: center; gap: .38rem; padding: .51rem .65rem; border-radius: .65rem; color: var(--muted); background: #0e2035; }
.search:focus-within { background: #223f5b; }
.search input { width: min(13rem, 20vw); background: transparent; border: 0; color: #edf5ff; outline: 0; font-size: 1rem; }
.search input::placeholder { color: #a4b8ce; font-size: .89rem; }
svg { width: 1.12rem; height: 1.12rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.table-head { display: flex; justify-content: space-between; padding: .66rem 4.6rem .66rem 4.35rem; background: #20374f; color: #c4d2e3; font-size: .86rem; font-weight: 650; }
.currency-row { display: grid; grid-template-columns: 1.8rem minmax(0, 1fr) 14ch 2.4rem; gap: .6rem; align-items: center; padding: .48rem 1.33rem; min-height: 3.66rem; background: #132337; }
.currency-row:nth-child(even) { background: #182b41; }
.currency-row.is-base { background: #214766; }
.currency-row.is-dragging { opacity: .46; }
.currency-row.will-drop { background: #2a5976; }
.identity { min-width: 0; display: flex; align-items: center; gap: .7rem; color: inherit; }
button.identity { width: 100%; text-align: start; background: transparent; border: 0; padding: .21rem 0; border-radius: .3rem; }
button.identity:hover .code { color: var(--cyan); }
.currency-symbol { flex: 0 0 2.35rem; height: 2rem; display: grid; place-items: center; background: #223952; border-radius: .5rem; }
.code { font-weight: 730; letter-spacing: .01em; }
.currency-name { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.currency-description { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .4rem; min-width: 0; }
.rate-heading-code { color: #a4d5f5; }
.base-marker { color: var(--cyan); font-size: .8rem; white-space: nowrap; }
.amount-field, .quote { width: 100%; text-align: end; font-variant-numeric: tabular-nums; font-weight: 500; color: #edf5ff; }
.amount-field { border: 1px solid #6a9cbb; border-radius: .5rem; padding: .47rem .6rem; background: #203b55; }
.extra-decimals { font-weight: 400; color: #a4d5f5; }
.precise-amount { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.precise-amount > * { grid-area: 1 / 1; min-width: 0; }
.show-extra-decimals .amount-field:not(:focus) { color: transparent; }
.currency-row.converter-row { grid-template-columns: 1.8rem minmax(0, 1fr) 19ch 2.4rem; }
.amount-display {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-inline: calc(.6rem + 1px);
    white-space: nowrap;
    overflow: hidden;
    pointer-events: none;
    color: #edf5ff;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
.amount-display > span { flex: 0 0 auto; }
.currency-list:not(.show-extra-decimals) .amount-display,
.amount-field:focus + .amount-display { visibility: hidden; }
.amount-field[aria-invalid="true"] + .amount-display { color: #ffc0c3; }
.amount-field:focus { background: #2b4d68; outline: none; }
.amount-field[aria-invalid="true"] { color: #ffc0c3; }
.amount-field[aria-invalid="true"]:is(:hover, :focus) { background: #442a3b; }
.quote { display: grid; grid-template-columns: minmax(0, 1fr) 1rem; align-items: center; gap: .3rem; padding-inline-end: .6rem; }
.quote > :first-child { overflow-wrap: anywhere; }
.rate-trend { text-align: center; font-weight: 750; }
.rate-up { color: #87e7b5; }
.rate-down { color: #ffabae; }
.is-base .quote { color: var(--cyan); }
.icon-button { display: grid; place-items: center; height: 2.1rem; border: 0; border-radius: .55rem; background: transparent; color: #93adc7; padding: 0; }
.icon-button:hover { background: #29445f; }
.converter-row > .star { grid-column: 4; grid-row: 1; position: relative; z-index: 1; }
.star.selected, .filters [data-filter="favorites"] svg { color: #81def9; }
.star.selected svg, .filters [data-filter="favorites"][aria-pressed="true"] svg { fill: currentColor; }
.handle { touch-action: none; cursor: grab; }
.handle:active { cursor: grabbing; }
.handle svg { fill: currentColor; stroke: none; width: .83rem; }
.empty, .sort-hint, .input-error { padding: .78rem 1.35rem; margin: 0; color: var(--muted); }
.empty { padding-block: 1.35rem; }
.sort-hint { background: #162b42; font-size: .86rem; }
.input-error { color: #ffc0c3; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem; padding: .8rem .75rem; background: #162b42; }
.pagination a, .pagination [aria-current] { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; min-height: 2.25rem; padding: .33rem .56rem; border-radius: .45rem; color: #d3e2f1; font-size: .88rem; font-weight: 650; text-decoration: none; }
.pagination a:hover, .pagination a.will-drop, .pagination [aria-current] { background: #294d6b; color: #f2faff; }
.pagination .page-gap { padding: 0 .1rem; color: var(--muted); }
#list-title, .currency-row { scroll-margin-block-start: 1rem; }
.footer { display: grid; justify-items: center; gap: .85rem; padding: 1.2rem .25rem 1.75rem; color: var(--muted); font-size: .86rem; text-align: center; }
.rate-source { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: .35rem 1rem; }
.copyright { margin: 0; }
.refresh-countdown { display: grid; justify-items: center; gap: .38rem; color: #e6eff9; }
.refresh-ring {
    position: relative;
    width: 1.65rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: conic-gradient(#fff var(--remaining, 100%), #ffffff30 0);
}
.refresh-ring::before {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: inherit;
    background: #101f31;
}
.refresh-ring span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.rate-source a { color: #b4e5f6; text-underline-offset: .2em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.demo-ad { display: none; }

@media (min-width: 1180px) and (min-height: 420px) {
    .demo-ad {
        position: fixed;
        inset-block-start: 6rem;
        width: min(160px, calc((100% - var(--page-width)) / 2 - 1.25rem));
        height: min(600px, calc(100svh - 8rem));
        display: grid;
        place-items: center;
        padding: .5rem;
        border-radius: .75rem;
        background: #64e1ef;
        color: #0b3747;
        font-size: .875rem;
        font-weight: 750;
        overflow-wrap: anywhere;
        text-align: center;
    }
    .demo-ad-left {
        left: calc((100% - var(--page-width)) / 4);
        transform: translateX(-50%);
    }
    .demo-ad-right {
        right: calc((100% - var(--page-width)) / 4);
        transform: translateX(50%);
    }
}

@media (max-width: 45rem) {
    :root { --content-inset: .75rem; }
    .masthead { min-height: 4.2rem; gap: .45rem; }
    .hero { min-height: 13.4rem; padding-top: 1.65rem; }
    body::before { opacity: .53; }
    .workspace-toolbar { flex-wrap: wrap; padding: .9rem; }
    .tools { width: 100%; }
    .search { flex: 1; min-width: 0; }
    .search input { width: 100%; min-width: 0; }
    .currency-row { grid-template-columns: 1.45rem minmax(0, 1fr) clamp(6.5rem, 33%, 14ch) 2rem; gap: .35rem; padding-inline: .62rem; }
    .currency-row.converter-row { grid-template-columns: 1.45rem minmax(0, 1fr) clamp(7rem, 38%, 19ch) 2rem; }
    .identity { gap: .44rem; }
    .currency-symbol { flex-basis: 1.85rem; height: 1.75rem; }
    .currency-symbol .flag { width: 1.3rem; }
    .table-head { padding-inline: 2.42rem 3.05rem; }
    .sort-hint { padding-inline: .9rem; }
}

@media (max-width: 32rem) {
    .masthead { grid-template-columns: 1fr auto; padding-block: .62rem; }
    .view-switch { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
    .view-switch a { flex: 1; }
    .language-button { grid-column: 2; grid-row: 1; }
    .identity { display: grid; grid-template-columns: 1.85rem minmax(0, 1fr); gap: 0 .4rem; }
    .currency-symbol { grid-row: span 2; }
    .currency-name { font-size: .8rem; }
    .amount-field, .quote { padding-inline: .35rem; }
    .amount-display { margin-inline: calc(.35rem + 1px); }
    .tools { flex-wrap: wrap; }
    .tools .search { flex-basis: 100%; }
    .filters { flex-wrap: wrap; }
    .filters button { padding-inline: .48rem; }
}

.hero:has(+ .history-article) .hero-copy { width: 100%; max-width: none; container-type: inline-size; }
.hero:has(+ .history-article) h1 { font-size: clamp(1.25rem, 6.6cqi, 3.75rem); text-wrap: nowrap; }

.history-article {
    padding: clamp(1.15rem, 3.5vw, 2.75rem);
    border-radius: 1.15rem;
    background: #132337;
    color: #d3e2f1;
    line-height: 1.7;
}

.history-article > * { max-width: 46rem; margin-inline: auto; }
.history-article h2 { margin-top: 2rem; color: #edf5ff; font-size: clamp(1.3rem, 3vw, 1.7rem); line-height: 1.3; }
.history-article h2:first-child { margin-top: 0; }
.history-article > p:has(> a) { font-size: .8rem; }
.history-article a { color: #a4e8fb; text-decoration: none; text-underline-offset: .2em; }
.history-article a:hover { text-decoration: underline; }
.history-article table { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: .65rem; overflow: hidden; background: #192f46; }
.history-article th, .history-article td { padding: .5rem .85rem; text-align: start; }
.history-article thead { background: #244766; color: #edf5ff; }
.history-article th:last-child, .history-article td:last-child { text-align: end; font-variant-numeric: tabular-nums; }
.history-article tr:nth-child(even) { background: #1d3852; }

@media (max-width: 32rem) {
    .view-switch a { min-width: 0; padding-inline: .35rem; white-space: normal; text-align: center; }
}

.history-watch { margin-block-start: 2rem; }
.watch-list { margin-block-start: 1.65rem; }
.watch-list h2 { margin-block-end: .75rem; }
.history-article .watch-table { font-size: .9rem; }
.history-article .watch-table :is(th, td) { padding: .5rem .65rem; }
.history-article .watch-table :is(th, td):is(:first-child, :nth-child(n + 3)) {
    text-align: end;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.watch-table th[scope="row"] { font-weight: 650; }
.watch-table th[scope="row"] a { color: #edf5ff; }
.watch-year { color: var(--muted); font-weight: 500; white-space: nowrap; }
.history-article .watch-imdb { color: #f5c518; }
.history-article .watch-tomatoes { color: #ffabae; }
@media (max-width: 32rem) {
    .history-article .watch-table { font-size: .8rem; }
    .history-article .watch-table :is(th, td) { padding-inline: .28rem; }
}
