/* ============================================================
   Coinverter — design system  ·  Diva sub-app palette
   ============================================================ */

:root {
  color-scheme: light dark;

  /* Brand — indigo → violet, in the Diva family */
  --brand: #4b57e0;
  --brand-2: #8a5cf0;
  --brand-ink: #1b1f3b;
  --grad: linear-gradient(135deg, var(--brand), var(--brand-2));

  /* Light palette (default) — cool greys */
  --bg: #f4f5fb;
  --bg-2: #e9ebf6;
  --surface: #ffffff;
  --surface-2: #f2f3fb;
  --border: #e2e3f0;
  --text: #191c2e;
  --text-soft: #575c78;
  --text-mute: #888da8;
  --up: #1f9d6b;
  --down: #df574c;

  --shadow: 0 1px 2px rgba(25, 28, 46, .05), 0 14px 34px -14px rgba(40, 44, 92, .22);
  --shadow-sm: 0 1px 2px rgba(25, 28, 46, .05), 0 5px 16px -10px rgba(40, 44, 92, .2);
  --radius: 20px;
  --radius-sm: 13px;
  --ring: 0 0 0 3px rgba(107, 116, 245, .35);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", var(--font);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e1a;
    --bg-2: #12152a;
    --surface: #171a2d;
    --surface-2: #1f2338;
    --border: #2b2f4d;
    --text: #eef0fa;
    --text-soft: #a8adc9;
    --text-mute: #71769a;
    --brand: #7b87ff;
    --brand-2: #ab88f6;
    --up: #37c08a;
    --down: #ec7b70;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 20px 44px -18px rgba(0, 0, 0, .7);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 24px -14px rgba(0, 0, 0, .6);
    --ring: 0 0 0 3px rgba(123, 135, 255, .4);
  }
}

:root[data-theme="dark"] {
  --bg: #0c0e1a;
  --bg-2: #12152a;
  --surface: #171a2d;
  --surface-2: #1f2338;
  --border: #2b2f4d;
  --text: #eef0fa;
  --text-soft: #a8adc9;
  --text-mute: #71769a;
  --brand: #7b87ff;
  --brand-2: #ab88f6;
  --up: #37c08a;
  --down: #ec7b70;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 20px 44px -18px rgba(0, 0, 0, .7);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 24px -14px rgba(0, 0, 0, .6);
  --ring: 0 0 0 3px rgba(123, 135, 255, .4);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(36rem 22rem at 92% -6%, rgba(138, 92, 240, .18), transparent 60%),
    radial-gradient(28rem 20rem at -4% 102%, rgba(75, 87, 224, .14), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input, output { font: inherit; color: inherit; }
::selection { background: var(--brand); color: #fff; }

/* ============================================================
   Shell
   ============================================================ */

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(14px, 4vw, 20px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 2px 10px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(var(--bg) 62%, transparent);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand__mark { width: 34px; height: 32px; display: block; }
.brand__mark svg { width: 100%; height: 100%; overflow: visible; }
.brand__mark .bar:nth-child(1) { fill: var(--brand); }
.brand__mark .bar:nth-child(2) { fill: color-mix(in srgb, var(--brand), var(--brand-2)); }
.brand__mark .bar:nth-child(3) { fill: var(--brand-2); }
.bar { transform-origin: 50% 100%; animation: bar-rise .5s var(--ease) backwards; }
.bar:nth-child(1) { animation-delay: .02s; }
.bar:nth-child(2) { animation-delay: .1s; }
.bar:nth-child(3) { animation-delay: .18s; }
.brand:hover .bar { animation: bar-nudge .5s var(--ease); }
.brand:hover .bar:nth-child(2) { animation-delay: .06s; }
.brand:hover .bar:nth-child(3) { animation-delay: .12s; }

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.16rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--text-soft);
  transition: background .18s, color .18s, transform .18s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
/* sun / moon toggle */
.theme-icon { transition: transform .55s var(--ease); }
.theme-icon .ti-cut { transition: transform .5s var(--ease); }
.theme-icon .ti-rays {
  opacity: 0;
  transform: scale(.35);
  transform-origin: 12px 12px;
  transition: transform .5s var(--ease), opacity .3s;
}
.is-sun .theme-icon { transform: rotate(180deg); }
.is-sun .theme-icon .ti-cut { transform: translateX(9px); }
.is-sun .theme-icon .ti-rays { opacity: 1; transform: scale(1); }
.is-sun #themeToggle { color: #f5b524; }
.is-sun #themeToggle:hover { color: #e0a010; }

/* ============================================================
   Views + tabbar
   ============================================================ */

.views { flex: 1; padding: 6px 0 10px; }
.view { animation: view-in .3s var(--ease); }
.view[hidden] { display: none; }

/* minimalist dark-violet scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--brand-2) 50%, transparent) transparent;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--brand-2) 45%, transparent);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--brand-2) 70%, transparent);
  background-clip: padding-box;
}

/* footer / copyright */
.credit {
  text-align: center;
  padding: 8px 14px 0;
  color: var(--text-mute);
  font-size: .72rem;
  line-height: 1.55;
  margin-bottom: calc(86px + env(safe-area-inset-bottom));
}
.credit strong { color: var(--text-soft); font-weight: 700; }
.credit a { color: var(--text-soft); text-decoration: none; }
.credit a:hover { color: var(--brand); }
.credit__by {
  font-weight: 700;
  color: var(--brand) !important;
  letter-spacing: .01em;
}
.credit__by:hover { text-decoration: underline; }
.credit__fine { margin-top: 3px; opacity: .82; max-width: 44ch; margin-inline: auto; }

.stack { display: flex; flex-direction: column; gap: 15px; }

.view__title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-top: 4px;
}
.view__title .muted { font-weight: 500; color: var(--text-mute); font-family: var(--font); font-size: .85rem; }
.view__title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.tabbar {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 452px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 6px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 13px;
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-mute);
  transition: color .18s, background .18s;
}
.tab svg { opacity: .8; transition: transform .26s var(--ease), color .18s; }
.tab.is-active { color: var(--text); background: var(--surface-2); }
.tab.is-active svg { color: var(--brand); opacity: 1; transform: translateY(-1px); }
.tab:active svg { transform: scale(.9); }

/* ============================================================
   Card + converter
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.converter { padding: 6px 15px 16px; position: relative; }

.market-picker { padding: 12px 2px 4px; }
.market-picker__label {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-mute);
  margin-bottom: 8px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
  transition: background .18s, color .18s, border-color .18s, transform .12s;
}
.chip.is-active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}
.chip:active { transform: scale(.95); }

.field { padding: 14px 2px 4px; }
.field--result {
  background: var(--surface-2);
  margin: 4px -15px -16px;
  padding: 14px 17px 18px;
  border-radius: 0 0 var(--radius) var(--radius);
  border-top: 1px solid var(--border);
}
.field__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field__label {
  font-size: .76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-mute);
}

.picker {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  font-size: .92rem;
  max-width: 62%;
  transition: border-color .18s, transform .12s;
}
.picker:hover { border-color: var(--brand); }
.picker:active { transform: scale(.97); }
.picker svg { color: var(--text-mute); margin-left: -2px; flex: 0 0 auto; }
.picker__flag { font-size: 1.1rem; line-height: 1; flex: 0 0 auto; }
.picker__code { letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; }

.amount {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 9px;
}
.amount__sym {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-mute);
  flex: 0 0 auto;
}
.amount__input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none;
  background: none;
  outline: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 7vw, 2.1rem);
  letter-spacing: -.02em;
  color: var(--text);
}
.amount__input::placeholder { color: var(--text-mute); opacity: .5; }
.amount__input--out { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field.is-focus .amount__sym { color: var(--brand); }

.field__hint {
  margin-top: 7px;
  font-size: .78rem;
  color: var(--text-soft);
  min-height: 1.05em;
}

.swap {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: -4px auto -16px;
  border-radius: 13px;
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .38s var(--ease);
}
.swap:hover { transform: rotate(180deg); }
.swap.is-spun { transform: rotate(180deg); }
.swap:active { transform: scale(.9); }

.rate-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 0 6px;
  font-size: .85rem;
  color: var(--text-soft);
  font-weight: 500;
}
.rate-line strong { color: var(--text); font-weight: 700; }
.rate-line .sep { color: var(--text-mute); }

.converter-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.save-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--grad);
  color: #fff;
  font-size: .84rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform .12s, opacity .18s, filter .18s;
}
.save-btn:hover { filter: brightness(1.06); }
.save-btn:active { transform: scale(.96); }
.save-btn:disabled {
  opacity: .45;
  box-shadow: none;
  cursor: not-allowed;
  filter: grayscale(.3);
}
.save-btn.is-saved { background: var(--up); }

.ghost-btn {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-soft);
  transition: color .18s, border-color .18s, transform .12s;
}
.ghost-btn:hover { color: var(--text); border-color: var(--brand); }
.ghost-btn:active { transform: scale(.96); }
.ghost-btn--sm { padding: 6px 12px; font-size: .77rem; }
.ghost-btn.is-spinning svg { animation: spin .8s linear infinite; }

/* ============================================================
   Quotes grid
   ============================================================ */

.search-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-mute);
}
.search-pill input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-size: .92rem;
  color: var(--text);
}
.search-pill input::placeholder { color: var(--text-mute); }

.quote-section { display: flex; flex-direction: column; gap: 10px; }
.quote-section[hidden] { display: none; }

.cotiz-empty {
  text-align: center;
  color: var(--text-mute);
  font-size: .86rem;
  padding: 10px 0 2px;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.quote[hidden] { display: none; }
.quote {
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  animation: reveal .38s var(--ease) backwards;
  min-width: 0;
}
.quote--accent { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.quote__name {
  font-size: .82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.quote__ic { font-size: 1rem; line-height: 1; flex: 0 0 auto; }
.quote__tag {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-mute);
  flex: 0 0 auto;
}
.quote__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 4.6vw, 1.3rem);
  letter-spacing: -.02em;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quote__sub {
  font-size: .73rem;
  color: var(--text-mute);
  margin-top: 3px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   History
   ============================================================ */

.history { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.history__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  animation: reveal .3s var(--ease) backwards;
  transition: transform .12s, border-color .18s;
}
.history__item:hover { border-color: var(--brand); }
.history__item:active { transform: scale(.99); }
.history__pair { font-weight: 700; font-size: .9rem; }
.history__body { flex: 1; min-width: 0; }
.history__calc { font-size: .77rem; color: var(--text-soft); margin-top: 2px; }
.history__meta { text-align: right; font-size: .71rem; color: var(--text-mute); white-space: nowrap; }
.history__market {
  display: inline-block;
  margin-top: 3px;
  font-size: .63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--brand);
}

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-soft);
}
.empty__icon {
  width: 68px; height: 68px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-mute);
}
.empty p { margin-top: 4px; }
.muted { color: var(--text-mute); font-size: .85rem; }

.updated-note {
  text-align: center;
  font-size: .73rem;
  color: var(--text-mute);
  padding: 4px 0 8px;
  line-height: 1.5;
}

/* ============================================================
   Currency sheet
   ============================================================ */

.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet[hidden] { display: none; }
.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 24, .55);
  backdrop-filter: blur(2px);
  animation: fade .2s ease;
}
.sheet__panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  box-shadow: 0 -20px 50px -12px rgba(0, 0, 0, .35);
  animation: sheet-up .3s var(--ease);
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.sheet__handle {
  width: 38px; height: 4px;
  border-radius: 999px;
  background: var(--border);
  margin: 10px auto 4px;
}
.sheet__search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-mute);
}
.sheet__search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-size: 1rem;
  color: var(--text);
}
.sheet__list { list-style: none; overflow-y: auto; padding: 6px; -webkit-overflow-scrolling: touch; }
.sheet__opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  text-align: left;
  transition: background .14s;
}
.sheet__opt:hover, .sheet__opt.is-active { background: var(--surface-2); }
.sheet__opt[aria-selected="true"] { color: var(--brand); }
.sheet__opt-flag { font-size: 1.3rem; line-height: 1; width: 26px; text-align: center; flex: 0 0 auto; }
.sheet__opt-code { font-weight: 700; width: 46px; flex: 0 0 auto; }
.sheet__opt-name { color: var(--text-soft); font-size: .9rem; flex: 1; min-width: 0; }
.sheet__opt-check { opacity: 0; flex: 0 0 auto; }
.sheet__opt[aria-selected="true"] .sheet__opt-check { opacity: 1; }
.sheet__group {
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-mute);
  padding: 12px 14px 5px;
}

/* ============================================================
   Toast + spinner
   ============================================================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(10px);
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--brand-ink);
  color: #fff;
  font-size: .83rem;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity .22s, transform .22s var(--ease);
  pointer-events: none;
}
:root[data-theme="dark"] .toast { background: #2a2f52; }
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  animation: spin .7s linear infinite;
  flex: 0 0 auto;
}

/* ============================================================
   Animations  (kept subtle)
   ============================================================ */

@keyframes bar-rise {
  from { transform: scaleY(0); opacity: 0; }
  to { transform: scaleY(1); opacity: 1; }
}
@keyframes bar-nudge {
  0%, 100% { transform: scaleY(1); }
  45% { transform: scaleY(.78); }
}
@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

.reveal { animation: reveal .42s var(--ease) backwards; }
.reveal:nth-child(2) { animation-delay: .05s; }
.reveal:nth-child(3) { animation-delay: .1s; }
.reveal:nth-child(4) { animation-delay: .15s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ============================================================
   Tablet
   ============================================================ */

@media (min-width: 680px) {
  .app-shell { max-width: 600px; padding-inline: 26px; }
  .topbar { padding-top: 22px; }
  .brand__mark { width: 38px; height: 36px; }
  .brand__name { font-size: 1.28rem; }
  .converter { padding: 8px 20px 20px; }
  .field--result { margin-inline: -20px; padding-inline: 22px; }
  .amount__input { font-size: clamp(1.9rem, 5vw, 2.4rem); }
  .quote-grid { grid-template-columns: repeat(3, 1fr); }
  .view__title { font-size: 1.1rem; }
}

/* ============================================================
   Desktop — no bottom menu. Everything lives in one centered box:
   converter + historial on the left, cotizaciones on the right.
   ============================================================ */

@media (min-width: 1040px) {
  .app-shell {
    max-width: 980px;
    padding-inline: 30px;
    justify-content: center;
  }
  .topbar { position: static; background: none; }

  .views {
    flex: none;
    display: grid;
    grid-template-columns: 348px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 18px 22px;
    height: calc(100dvh - 168px);
    min-height: 480px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: color-mix(in srgb, var(--surface) 45%, transparent);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }
  .credit { margin-bottom: 0; padding-top: 14px; }

  #view-convertir[hidden], #view-cotizaciones[hidden], #view-historial[hidden] { display: block; }
  .view { animation: none; }

  #view-convertir   { grid-area: 1 / 1 / 2 / 2; }
  #view-historial   { grid-area: 2 / 1 / 3 / 2; min-height: 0; overflow-y: auto; padding-right: 5px; scrollbar-width: thin; }
  #view-cotizaciones { grid-area: 1 / 2 / 3 / 3; min-height: 0; overflow-y: auto; padding-right: 5px; scrollbar-width: thin; }

  .converter { padding: 10px 20px 20px; }
  .field--result { margin-inline: -20px; padding-inline: 22px; }

  .quote-grid { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); }
  #view-cotizaciones .search-pill { position: sticky; top: 0; z-index: 5; }
  #historyList { max-height: none; }

  .tabbar { display: none; }
  .toast { bottom: 28px; }
}

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
