/* Swap: one card with "You pay" and "You get" and a flip button between them, the balances and the last swaps beside
   it, a check step before anything moves. Colours and fonts come from /css/txlist.css (.ycp), like the Transfer,
   History and Stats pages. */
body { background-color: #11141A; }

.sw { padding: 30px 32px 70px; max-width: 1180px; }
.sw-head { margin-bottom: 24px; }
.sw-head h1 { margin: 0; font-family: "titles", sans-serif !important; font-weight: 400; font-size: 32px; color: #E4E8EF; }
.sw-head p { margin: 8px 0 0; font-size: 15px; color: #A5ACB9; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; min-width: 0; }
.card h3 { margin: 0 0 12px; font-size: 15.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card h3 .linkish { margin-left: auto; font-size: 12.5px; }
.ycp .linkish { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--link); font-size: inherit; font-weight: 500; }
.ycp .linkish:hover { text-decoration: underline; }
.ycp .btn.big { width: 100%; height: 52px; font-size: 15.5px; font-weight: 600; border-radius: 13px; }
.ycp .btn.primary[disabled] { box-shadow: none; filter: grayscale(.6); opacity: .5; }
.fine { margin: 12px 0 0; text-align: center; font-size: 12px; color: var(--muted-2); }
.num { font-variant-numeric: tabular-nums; }
/* Fields show focus on their box, so the page-wide ring is not drawn on the input itself. */
.ycp input:focus-visible { outline: 0; }
.ycp input::placeholder { color: var(--muted-2); }
/* .ycp [hidden] only reaches inside a .ycp box; the list and the dialog are .ycp boxes themselves. */
.ycp[hidden] { display: none !important; }

/* Could not load */
.off-card { display: flex; gap: 14px; align-items: flex-start; max-width: 600px; margin-bottom: 16px; }
.off-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(255, 122, 122, .12); color: #FF9A9A; }
.off-card b { display: block; font-size: 15.5px; font-weight: 600; color: var(--text); }
.off-card p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.off-card .btn { margin-top: 12px; }

.rows { margin: 0; }
.rows div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13.5px; }
.rows dt { color: var(--muted); white-space: nowrap; }
.rows dd { margin: 0; min-width: 0; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rows dd small { display: block; font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.rows .total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 12px; }
.rows .total dt { color: var(--text); font-weight: 600; }
.rows .total dd { font-size: 17px; font-weight: 700; }

.note { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.45; }
.note > .i { flex: none; margin-top: 1px; }
.note.info { color: #CBD5FF; background: rgba(110, 168, 255, .08); border: 1px solid rgba(110, 168, 255, .22); }
.note.bad { color: #FFC9C9; background: rgba(255, 122, 122, .08); border: 1px solid rgba(255, 122, 122, .25); }

.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap; color: var(--muted); background: rgba(138, 146, 165, .14); }

/* Green dot in front of the live rate */
.live { display: inline-flex; align-items: center; gap: 7px; }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--in); box-shadow: 0 0 0 3px rgba(61, 214, 140, .15); }

/* The swap card */
.x-grid { display: grid; grid-template-columns: minmax(0, 600px) 360px; gap: 24px; align-items: start; }
.x-card { padding: 18px; border-radius: 22px; background: linear-gradient(180deg, rgba(155, 123, 255, .07), rgba(155, 123, 255, 0) 180px), var(--surface); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.x-box { padding: 14px 16px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line-2); transition: border-color .15s, box-shadow .15s; }
.x-box:focus-within { border-color: #6B6BFF; box-shadow: 0 0 0 3px rgba(107, 107, 255, .16); }
.x-box.bad { border-color: rgba(255, 122, 122, .55); }
.x-r1 { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.x-r1 label { font-weight: 500; color: var(--text-2); }
.x-bal .linkish { font-size: 13px; }
.x-r2 { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.ycp .x-r2 input { flex: 1; min-width: 0; height: 52px; padding: 0; border: 0; background: none; color: var(--text); font-size: 34px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.x-box.stale input { color: var(--muted); }
.x-box.bad input { color: #FF9A9A; }

.ycp .cur-btn { flex: none; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 10px 0 7px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-size: 15px; font-weight: 600; }
.ycp .cur-btn:hover, .ycp .cur-btn.open { border-color: #4A5370; background: var(--surface-3); }
.cur-btn .i { color: var(--muted); }

.x-chips { display: flex; gap: 6px; margin-top: 10px; }
.ycp .x-chips button { height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; }
.ycp .x-chips button:hover { color: var(--text); border-color: #3A4257; }
.ycp .x-chips button.on { color: #fff; border: 1px solid transparent; background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--grad) border-box; }

.x-flip { display: flex; justify-content: center; height: 8px; position: relative; z-index: 1; }
.ycp .x-flip button { margin-top: -17px; width: 42px; height: 42px; border-radius: 14px; padding: 0; border: 4px solid var(--surface); background: var(--surface-3); color: var(--text); display: flex; align-items: center; justify-content: center; transition: transform .2s; }
.ycp .x-flip button:hover { background: #2B3248; }
.ycp .x-flip button.spin { transform: rotate(180deg); }

.x-msg { margin-top: 12px; }
.x-rows { margin: 14px 4px 16px; }
.x-rows div { padding: 7px 0; }

/* Beside the card */
.x-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.x-bals { list-style: none; margin: 0; padding: 0; }
.ycp .x-bals button { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; width: calc(100% + 16px); border: 0; border-radius: 12px; background: none; text-align: left; }
@media (hover: hover) { .ycp .x-bals button:hover { background: var(--surface-2); } }
.x-bals .t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.x-bals .t b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.x-bals .t span { font-size: 12px; color: var(--muted); }
.x-bals .v { font-size: 13.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.x-bals .zero .v { color: var(--muted-2); font-weight: 500; }
.x-bals li.on button { background: var(--surface-2); box-shadow: inset 2px 0 0 #9B7BFF; }

.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.recent li:first-child { border-top: 0; padding-top: 2px; }
.pair { position: relative; flex: none; width: 40px; height: 32px; }
.pair img:first-child { position: absolute; left: 0; top: 0; }
.pair img:last-child { position: absolute; right: 0; bottom: 0; box-shadow: 0 0 0 2px var(--surface); }
.recent .t { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.recent .t b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.recent .t span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.recent .a { text-align: right; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recent .a .in { color: var(--in); font-weight: 600; }
.recent .a .out { color: var(--muted); }
.ycp .again { flex: none; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); display: flex; align-items: center; justify-content: center; padding: 0; }
.ycp .again:hover { color: #fff; border-color: #3A4257; }
.recent .empty { font-size: 13px; color: var(--muted); padding: 4px 0; border: 0; }

/* Currency list */
.cur-menu { position: absolute; z-index: 1400; width: 280px; padding: 6px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
.cur-menu .h { padding: 8px 10px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.cur-menu.ycp button { width: 100%; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border: 0; border-radius: 11px; background: none; text-align: left; }
.cur-menu.ycp button.on { background: var(--surface-3); }
@media (hover: hover) { .cur-menu.ycp button:hover { background: var(--surface-3); } }
.cur-menu .t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cur-menu .t b { font-size: 14px; font-weight: 600; color: var(--text); }
.cur-menu .t span { font-size: 12px; color: var(--muted); }
.cur-menu .v { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cur-menu .ck { color: #A9B8FF; display: flex; }

/* Check step and done: a dialog, a bottom sheet on phones */
.scrim { position: fixed; inset: 0; z-index: 1500; background: rgba(5, 6, 10, .62); display: flex; align-items: center; justify-content: center; padding: 20px; }
.dlg { width: 460px; max-width: 100%; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; padding: 22px 24px 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.dlg-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dlg-top h2 { margin: 0; font-size: 19px; font-weight: 600; color: var(--text); }
.ycp .x-close { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); display: flex; align-items: center; justify-content: center; padding: 0; }
.dlg-actions { display: flex; gap: 10px; margin-top: 18px; }
.dlg-actions .btn { flex: 1; height: 50px; font-size: 15px; font-weight: 600; border-radius: 13px; }
.dlg-actions .btn.primary { flex: 1.6; }
.dlg .rows { margin: 4px 0 14px; }
.dlg .note + .note { margin-top: 10px; }
body.locked { overflow: hidden; }

.rv-pair { display: flex; align-items: stretch; gap: 8px; margin-bottom: 10px; }
.rv-side { flex: 1; min-width: 0; padding: 14px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line-2); }
.rv-side > span { font-size: 12px; color: var(--muted); }
.rv-side > div { display: flex; align-items: center; gap: 9px; margin-top: 8px; }
.rv-side b { font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.15; }
.rv-side em { font-style: normal; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rv-arrow { flex: none; display: flex; align-items: center; color: var(--muted); }

.done-ic { width: 64px; height: 64px; margin: 6px auto 14px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 12px 30px rgba(94, 123, 255, .35); }
.done-h { text-align: center; margin: 0; font-size: 20px; font-weight: 600; color: var(--text); }
.done-s { text-align: center; margin: 6px 0 16px; font-size: 14px; color: var(--muted); }
.done-s b { color: var(--in); font-weight: 600; }

@media (max-width: 1100px) {
    .x-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
}
@media (max-width: 920px) {
    .x-grid { grid-template-columns: minmax(0, 1fr); }
    .x-card, .x-side { max-width: 600px; }
}
@media (max-width: 750px) {
    .sw { padding: 22px 16px 40px; }
    .sw-head { text-align: center; margin-bottom: 18px; }
    .sw-head h1 { font-size: 28px; }
    .sw-head p { font-size: 14px; }
    .card { padding: 16px; border-radius: 16px; }
    .x-card { padding: 12px; border-radius: 20px; max-width: none; }
    .x-side { max-width: none; }
    .x-box { padding: 12px 12px 12px 14px; }
    .ycp .x-r2 input { font-size: 28px; height: 46px; }
    .ycp .cur-btn { height: 42px; font-size: 14px; }
    .x-rows { margin: 12px 2px 14px; }
    .cur-menu { position: fixed; left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto; border-radius: 22px 22px 0 0; padding: 10px 10px 30px; box-shadow: 0 0 0 100vmax rgba(5, 6, 10, .62); }
    .cur-menu::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto 6px; }
    .cur-menu.ycp button { padding: 11px 10px; }
    .scrim { align-items: flex-end; padding: 0; }
    .dlg { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; border-bottom: 0; padding: 10px 18px 26px; }
    .dlg::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto 12px; }
    .rv-pair { flex-direction: column; gap: 0; }
    .rv-arrow { justify-content: center; height: 6px; position: relative; z-index: 1; }
    .rv-arrow .i { transform: rotate(90deg); background: var(--surface-3); border: 3px solid var(--surface); border-radius: 10px; width: 32px; height: 32px; padding: 5px; margin-top: -13px; box-sizing: border-box; }
}
