/* Vestmark component library. Values come from the Figma components;
   hover/press/focus states are derived so every control feels alive. */

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px 0 16px;
  border-radius: var(--vm-radius-md);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background-color var(--dur-2) ease, box-shadow var(--dur-3) var(--ease-out), transform var(--dur-1) ease, color var(--dur-2) ease, opacity var(--dur-2) ease;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn.is-disabled { opacity: 0.4; pointer-events: none; }
.btn-primary { background: var(--vm-surface-inverse); color: var(--vm-text-on-inverse); }
.btn-primary:hover { background: #2f2d2a; box-shadow: var(--vm-shadow-hover-dark); }
.btn-secondary { background: var(--vm-surface-card); color: var(--vm-text-primary); }
.btn-secondary:hover { background: #e9e8e5; }
.btn-white { background: var(--vm-surface-page); color: var(--vm-text-primary); box-shadow: var(--vm-shadow-control); }
.btn-white:hover { box-shadow: var(--vm-shadow-hover); }
.btn-ghost { background: transparent; color: var(--vm-text-primary); }
.btn-ghost:hover { background: var(--vm-surface-card); }
.btn-danger { background: var(--vm-surface-card); color: var(--vm-text-danger); }
.btn-danger:hover { background: var(--vm-tint-red); }
.btn-danger.is-solid { background: var(--vm-text-danger); color: #fff; }
.btn-danger.is-solid:hover { background: #a92a08; box-shadow: 0 1px 2px rgba(196, 50, 10, 0.1), 0 4px 10px -4px rgba(196, 50, 10, 0.2), 0 12px 24px -12px rgba(196, 50, 10, 0.36); }
.btn-lg { height: 48px; }
.btn-md { height: 42px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn .ic { --s: 16px; }

/* Square icon buttons (Search, Notifications, Menu, Close) */
.btn-icon {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: var(--vm-radius-md);
  background: var(--vm-surface-card); color: var(--vm-text-primary);
  transition: background-color var(--dur-2) ease, transform var(--dur-1) ease, box-shadow var(--dur-2) ease;
}
.btn-icon:hover { background: #e9e8e5; }
.btn-icon:active { transform: scale(0.94); }
.btn-icon.is-white { background: var(--vm-surface-page); }
.btn-icon.is-white:hover { background: var(--vm-surface-card); }
.btn-icon.is-dark { background: var(--vm-surface-inverse); color: #fff; }
.btn-icon.is-dark:hover { background: #2f2d2a; }
.btn-icon.is-active { background: #e5e4e1; }
.btn-icon.sm { width: 32px; height: 32px; border-radius: 10px; }
.btn-icon .unread {
  position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--vm-accent-primary); box-shadow: 0 0 0 2px var(--vm-surface-card);
  transition: transform var(--dur-2) var(--ease-spring), opacity var(--dur-2) ease;
}
.btn-icon .unread.is-gone { transform: scale(0); opacity: 0; }

/* ---------- Icon hover motion ----------
   One quiet language everywhere (sidebar, buttons, rows, menus, tiles): when something clickable is hovered
   its icon makes a small, smooth move — a couple of px or degrees, eased over 420ms — and every kind of icon
   moves its own way. No zooms, wobbles, springs or flips.
     --hm  the pose the icon eases into while hovered
     --ha  a short one-off (only nod / hop / ring, all small); `none` for most icons
   Icons get an ic-<name> class from VM.icon() / VM.initUI(); a hoverable container opts in with
   `transform: var(--hm); animation: var(--ha);`. */
.ic { --hm: rotate(-6deg); --ha: none; }                                                     /* default: tilts left */
.ic-home, .ic-bank, .ic-bank-sm, .ic-landmark, .ic-building, .ic-user, .ic-users, .ic-monitor, .ic-id-card, .ic-passport, .ic-mail, .ic-upload { --hm: translateY(-1.5px); }  /* lifts */
.ic-transactions, .ic-list, .ic-units { --hm: translateX(2px); }                           /* slides along */
.ic-updates, .ic-percent, .ic-coin, .ic-euro, .ic-banknote, .ic-chart-column { --hm: rotate(6deg); }  /* tilts right */
.ic-documents, .ic-file, .ic-file-check, .ic-book-open, .ic-receipt, .ic-rules, .ic-calendar, .ic-calendar-sm, .ic-shield, .ic-shield-check { --hm: none; --ha: vm-nod 560ms var(--ease-out); }  /* nods */
.ic-help, .ic-help-circle, .ic-chat, .ic-info, .ic-map-pin, .ic-smartphone { --hm: none; --ha: vm-hop 560ms var(--ease-out); }  /* hops */
.ic-settings, .ic-sun, .ic-compass { --hm: rotate(40deg); }                                  /* turns */
.ic-arrow, .ic-arrow-right, .ic-arrow-sm, .ic-chevron-right, .ic-chevron-right-lg, .ic-chevron-right-thin, .ic-chevron-right-row { --hm: translateX(2px); }  /* points the way */
.ic-log-out { --hm: translateX(1.5px); }
.ic-arrow-left, .ic-back, .ic-chevron-left-lg, .ic-chevron-left-thin { --hm: translateX(-2px); }
.ic-arrow-up-right, .ic-arrow-ur, .ic-trending-up, .ic-trending-up-sm, .ic-price-up, .ic-copy { --hm: translate(1.5px, -1.5px); }
.ic-download, .ic-chevron-down, .ic-chevron-down-sm { --hm: translateY(1.5px); }
.ic-pen, .ic-pen-sm, .ic-pen-lg, .ic-pencil { --hm: rotate(-8deg) translate(1px, -1px); }   /* writes */
.ic-plus, .ic-plus-sm, .ic-x, .ic-x-sm, .ic-close { --hm: rotate(90deg); }                   /* turns a quarter */
.ic-repeat { --hm: rotate(180deg); }
.ic-search, .ic-search-sm { --hm: rotate(-8deg) scale(1.06); }
.ic-bell, .ic-bell-sm { --hm: none; --ha: vm-ring 600ms var(--ease-out); }                   /* rings */

.hover-nudge:hover .ic-arrow, .link:hover .ic, .btn:hover .ic, .btn-icon:hover .ic { transform: var(--hm); animation: var(--ha); }
a:hover > .ic-arrow-ur { transform: translate(1.5px, -1.5px); }
@keyframes vm-ring { 0% { transform: rotate(0); } 20% { transform: rotate(12deg); } 40% { transform: rotate(-10deg); } 60% { transform: rotate(6deg); } 80% { transform: rotate(-3deg); } 100% { transform: rotate(0); } }
@keyframes vm-nod { 0% { transform: none; } 35% { transform: rotate(-7deg); } 70% { transform: rotate(3deg); } 100% { transform: none; } }
@keyframes vm-hop { 0% { transform: none; } 35% { transform: translateY(-2.5px); } 65% { transform: translateY(0); } 82% { transform: translateY(-1px); } 100% { transform: none; } }

/* Text link with arrow (View all, About the fund) */
.link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; font-weight: 500; color: var(--vm-text-info);
  transition: color var(--dur-2) ease;
}
.link:hover { color: #1b36a3; }
.link .ic { --s: 14px; }

/* ---------- Cards & tiles ---------- */
.card { background: var(--vm-surface-card); border-radius: var(--vm-radius-xl); }
.card-pad { padding: 20px; }
.card-link { transition: background-color var(--dur-2) ease, transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) ease; }
.card-link:hover { background: var(--vm-surface-card-hover); }

.icon-badge {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: var(--vm-radius-md);
  background: var(--vm-surface-page); color: var(--vm-text-primary);
}
.icon-badge .ic { --s: 21px; }
.icon-badge.sm { width: 36px; height: 36px; }
.icon-badge.sm .ic { --s: 18px; }

/* Stat card (v7/Stat inline) */
.stat { display: flex; align-items: center; gap: 14px; padding: 18px; min-width: 0; }
.stat-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; white-space: nowrap; }
.stat-label { font-size: 14px; color: var(--vm-text-secondary); }
.stat-value { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; font-weight: 500; color: var(--vm-text-secondary); }
.stat-sub.is-up { color: var(--vm-text-positive); }

/* Operation type tile (36px) */
.tile {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: var(--vm-radius-md);
  background: var(--vm-surface-card); color: var(--vm-text-primary);
  transition: background-color var(--dur-3) ease;
}
.tile .ic { --s: 18px; }

/* Date tile (Upcoming dates) */
.date-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
  width: 46px; height: 50px; border-radius: var(--vm-radius-md); background: var(--vm-surface-card);
}
.date-tile b { font-size: 16px; font-weight: 600; }
.date-tile span { font-size: 12px; color: var(--vm-text-secondary); }

/* ---------- Chips & badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 8px; border-radius: var(--vm-radius-sm);
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--vm-surface-card); color: var(--vm-text-secondary);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.chip.no-dot::before { display: none; }
.chip-amber { background: var(--vm-tint-amber); color: var(--vm-text-warning); }
.chip-blue { background: var(--vm-tint-blue); color: var(--vm-text-info); }
.chip-green { background: var(--vm-tint-green); color: var(--vm-text-positive); }
.chip-violet { background: var(--vm-tint-violet); color: var(--vm-text-violet); }
.chip-neutral { background: #e9e8e5; color: var(--vm-text-secondary); }
.chip-white { background: var(--vm-surface-page); color: var(--vm-text-primary); }
.chip-red { background: var(--vm-tint-red); color: var(--vm-text-danger); }
.chip-amber.is-live::before { animation: vm-blink 1.6s ease-in-out infinite; }
@keyframes vm-blink { 50% { opacity: 0.35; } }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; padding: 1px 6px; border-radius: var(--vm-radius-xs);
  background: var(--vm-accent-primary); color: #fff; font-size: 12px; font-weight: 500;
}
.badge-soft { background: var(--vm-tint-blue); color: var(--vm-text-info); }

/* Status dot (live / verified) */
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--vm-accent-positive); flex-shrink: 0; }
.dot.live { width: 7px; height: 7px; animation: vm-pulse 2.4s ease-out infinite; }
.dot.warn { background: #d18a00; }

/* ---------- Segmented control (range, filters, one-off/monthly) ----------
   <div class="seg" data-seg><button class="is-on">1Y</button>...</div> — app.js adds the sliding thumb */
.seg {
  position: relative; display: inline-flex; gap: 2px; padding: 3px;
  background: var(--vm-surface-card); border-radius: var(--vm-radius-md);
  isolation: isolate;
}
.seg > button {
  position: relative; z-index: 1;
  padding: 5px 11px; border-radius: 9px;
  font-size: 12px; font-weight: 500; color: var(--vm-text-secondary); white-space: nowrap;
  transition: color var(--dur-2) ease;
}
.seg > button:hover { color: var(--vm-text-primary); }
.seg > button.is-on { color: var(--vm-text-primary); }
.seg > button .count { margin-left: 4px; color: var(--vm-text-tertiary); font-weight: 400; }
.seg-thumb {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0;
  background: var(--vm-surface-page); border-radius: 9px; box-shadow: var(--vm-shadow-control);
  transition: transform var(--dur-3) var(--ease-out), width var(--dur-3) var(--ease-out);
}
.seg:not(.is-ready) > button.is-on { background: var(--vm-surface-page); box-shadow: var(--vm-shadow-control); }
.seg.lg > button { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.seg.lg .seg-thumb { border-radius: 10px; }
.seg.full { display: flex; width: 100%; }
.seg.full > button { flex: 1; }

/* ---------- Dividers, progress ---------- */
.divider { height: 1px; background: var(--vm-border-default); width: 100%; flex-shrink: 0; }
.progress { height: 6px; border-radius: 3px; background: var(--vm-border-default); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 3px; background: var(--vm-accent-primary); width: var(--p, 0%); transform-origin: left; animation: vm-grow 900ms var(--ease-out) 200ms both; }
@keyframes vm-grow { from { transform: scaleX(0); } }
.steps-bar { display: flex; gap: 4px; }
.steps-bar > i { flex: 1; height: 3px; border-radius: 2px; background: var(--vm-border-default); position: relative; overflow: hidden; }
.steps-bar > i::after { content: ""; position: absolute; inset: 0; background: var(--vm-surface-inverse); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-4) var(--ease-out); }
.steps-bar > i.is-done::after { transform: scaleX(1); }

/* ---------- Section headers ---------- */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sec-title { font-size: 16px; font-weight: 600; }

/* ---------- Data table (desktop) ---------- */
.tbl { width: 100%; }
.tbl-head, .tbl-row { display: flex; align-items: center; gap: 14px; padding: 0 14px; }
.tbl-head { background: var(--vm-surface-card); border-radius: var(--vm-radius-md); padding-top: 9px; padding-bottom: 9px; font-size: 12px; font-weight: 500; color: var(--vm-text-secondary); }
.tbl-row { padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--vm-border-subtle); position: relative; }
.tbl-row.is-link { cursor: pointer; transition: background-color var(--dur-3) ease; border-radius: 0; }
.tbl-row.is-link:hover { background: var(--vm-hover-row); transition-duration: var(--dur-2); }
.tbl-row.is-selected { background: var(--vm-tint-blue); }
/* Stacked rows (the mobile list layout) run edge to edge with no side padding, so their hover / tap tint is
   drawn on ::before, 10px wider than the row. Mobile breakpoints switch it on with --row-tint: 1. */
.tbl-row.is-link { isolation: isolate; }
.tbl-row.is-link::before {
  content: ""; position: absolute; inset: 0 -10px; z-index: -1; pointer-events: none;
  border-radius: var(--vm-radius-md); background: var(--vm-hover-row);
  opacity: var(--row-tint, 0); transition: opacity var(--dur-2) ease;
}
.tbl-row .col-grow, .tbl-head .col-grow { flex: 1; min-width: 0; }
.tbl .r { text-align: right; justify-content: flex-end; }
.op { display: flex; align-items: center; gap: 12px; min-width: 0; }
.op-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.op-title { font-size: 14px; font-weight: 500; transition: color var(--dur-2) ease; }
.op-sub { font-size: 14px; color: var(--vm-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-row.is-link:hover .tile { background: #e9e8e5; }
.tbl-row.is-link:hover .tile .ic { transform: var(--hm); animation: var(--ha); }

/* Simple list row (Upcoming dates, settings rows) */
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--vm-border-subtle); }
.list-row:last-child { border-bottom: 0; }
.list-row .text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.list-row .title { font-size: 14px; font-weight: 500; transition: color var(--dur-2) ease; }
.list-row .sub { font-size: 14px; color: var(--vm-text-secondary); }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-size: 14px; font-weight: 500; }
.hint { font-size: 12px; color: var(--vm-text-secondary); }
.input {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--vm-surface-card); border: 1px solid transparent; border-radius: 10px;
  font-size: 14px; color: var(--vm-text-primary); outline: none;
  transition: border-color var(--dur-2) ease, background-color var(--dur-2) ease, box-shadow var(--dur-2) ease;
}
.input::placeholder { color: var(--vm-text-tertiary); }
.input:hover { background-color: #efeeeb; }
.input:focus, .vm-select.is-active { background-color: var(--vm-surface-page); border-color: var(--vm-text-primary); box-shadow: 0 0 0 3px rgba(26, 25, 23, 0.06); }
.input.is-error { border-color: var(--vm-text-danger); }
/* Touch devices: 16px stops iOS from zooming the page when a field gets focus */
@media (hover: none) and (pointer: coarse) { .input, textarea.input, select.input { font-size: 16px; } }
select.input { appearance: none; }

/* ---------- Select (app.js turns every select.input / select.code-select into this) ----------
   Trigger keeps the field look; the list opens in a popover styled like the notifications panel. */
.vs-native { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; clip-path: inset(50%); }
.vm-select { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; padding-right: 12px; }
.vm-select:focus-visible { outline: none; background-color: var(--vm-surface-page); border-color: var(--vm-text-primary); box-shadow: 0 0 0 3px rgba(26, 25, 23, 0.06); }
.vm-select[disabled] { opacity: 0.5; cursor: default; }
.vs-value { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.vs-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-select .vs-chev { color: var(--vm-text-secondary); }
.vm-select:hover .vs-chev { color: var(--vm-text-primary); }
.vm-select.is-active .vs-chev { transform: rotate(180deg); color: var(--vm-text-primary); }
/* Round flag (18px), with a hairline ring so white flags keep their edge */
.vs-flag { position: relative; width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; overflow: hidden; }
.vs-flag img { width: 100%; height: 100%; object-fit: cover; }
.vs-flag::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(26, 25, 23, 0.1); }

.popover.vs-pop { min-width: 0; border-radius: var(--vm-radius-lg); animation: vs-in 240ms var(--ease-out) both; }
.popover.vs-pop.is-closing { animation: vs-out 160ms ease forwards; }
@keyframes vs-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
@keyframes vs-out { to { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.popover.vs-pop.is-up { animation-name: vs-in-up; }
@keyframes vs-in-up { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
.vs-menu { display: flex; flex-direction: column; gap: 2px; padding: 6px; overflow-y: auto; overscroll-behavior: contain; }
.vs-opt {
  position: relative; display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  min-height: 40px; padding: 0 10px; border-radius: 10px;
  font-size: 14px; text-align: left; color: var(--vm-text-primary);
  transition: background-color var(--dur-2) ease;
}
.vs-opt:hover, .vs-opt:focus-visible { background: var(--vm-surface-card); outline: none; }
.vs-opt:active { background: #edece9; }
.vs-opt[disabled] { opacity: 0.4; pointer-events: none; }
.vs-opt-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-opt-meta { font-size: 14px; color: var(--vm-text-secondary); font-variant-numeric: tabular-nums; }
.vs-opt.is-on { font-weight: 500; }
.vs-tick { display: grid; place-items: center; width: 16px; height: 16px; flex-shrink: 0; color: var(--vm-text-primary); opacity: 0; transform: scale(0.6); transition: opacity var(--dur-2) ease, transform var(--dur-3) var(--ease-spring); }
.vs-tick svg { width: 14px; height: 14px; }
.vs-opt.is-on .vs-tick { opacity: 1; transform: none; }
@media (pointer: coarse) { .vs-opt { min-height: 44px; } }

/* Radio / selectable card (Pay with, questionnaire answers) */
.choice {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: var(--vm-radius-lg);
  background: var(--vm-surface-card); border: 1px solid transparent;
  transition: border-color var(--dur-2) ease, background-color var(--dur-2) ease, transform var(--dur-1) ease;
  cursor: pointer;
}
.choice:hover { background: #efeeeb; }
.choice:active { transform: scale(0.99); }
.choice.is-on { border-color: var(--vm-border-strong); background: var(--vm-surface-card); }
.radio {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  background: var(--vm-surface-page); border: 1px solid var(--vm-border-default);
  display: grid; place-items: center;
  transition: border-color var(--dur-2) ease, background-color var(--dur-2) ease;
}
.radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform var(--dur-3) var(--ease-spring); }
.is-on > .radio, .radio.is-on { background: var(--vm-surface-inverse); border-color: var(--vm-surface-inverse); }
.is-on > .radio::after, .radio.is-on::after { transform: scale(1); }
.check {
  width: 18px; height: 18px; border-radius: 6px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--vm-surface-page); border: 1px solid var(--vm-border-default); color: #fff;
  transition: background-color var(--dur-2) ease, border-color var(--dur-2) ease;
}
.check svg { width: 12px; height: 12px; stroke-dasharray: 14; stroke-dashoffset: 14; transition: stroke-dashoffset var(--dur-3) var(--ease-out) 60ms; }
.is-on > .check, .check.is-on { background: var(--vm-surface-inverse); border-color: var(--vm-surface-inverse); }
.is-on > .check svg, .check.is-on svg { stroke-dashoffset: 0; }

/* Toggle switch */
/* Toggle switch — Figma: 36×20, accent blue when on */
.switch { position: relative; width: 36px; height: 20px; border-radius: 10px; background: #a5a7ac; flex-shrink: 0; transition: background-color var(--dur-2) ease; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); transition: transform var(--dur-3) var(--ease-spring), width var(--dur-2) ease; }
.switch.is-on { background: var(--vm-accent-primary); }
.switch.is-on::after { transform: translateX(16px); }

/* ---------- Accordion ----------
   <div class="acc is-open" data-acc><button class="acc-head">Title <span class="ic acc-chev"></span></button>
   <div class="acc-body"><div>...</div></div></div> */
.acc { border-bottom: 1px solid var(--vm-border-subtle); }
.acc-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 20px 0; text-align: left; font-size: 16px; font-weight: 600; }
.acc-chev { --s: 18px; transition: transform var(--dur-3) var(--ease-out), color var(--dur-2) ease; transform: rotate(180deg); }
.acc.is-open .acc-chev { transform: rotate(0deg); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-3) var(--ease-out); }
.acc-body > div { overflow: hidden; }
.acc.is-open .acc-body { grid-template-rows: 1fr; }
.acc-body > div > * { transition: opacity var(--dur-3) ease, color var(--dur-2) ease; opacity: 0; }
.acc.is-open .acc-body > div > * { opacity: 1; }

/* ---------- Tooltip ([data-tip]) ---------- */
.vm-tip {
  position: fixed; z-index: 90; max-width: 260px; pointer-events: none;
  padding: 8px 12px; border-radius: var(--vm-radius-md);
  background: var(--vm-surface-inverse); color: #fff; font-size: 12px; line-height: 1.45;
  opacity: 0; transform: translateY(4px); transition: opacity var(--dur-2) ease, transform var(--dur-2) var(--ease-out);
}
.vm-tip.is-on { opacity: 1; transform: none; }

/* ---------- Popover (notifications, user menu, dropdowns) — one surface: hairline border + soft layered shadow ---------- */
.popover {
  position: absolute; z-index: 60; min-width: 220px;
  background: var(--vm-surface-page); border-radius: var(--vm-radius-lg); box-shadow: var(--vm-shadow-menu);
  border: 1px solid var(--vm-border-default);
  transform-origin: top right; animation: vm-pop var(--dur-3) var(--ease-out);
}
.popover.is-closing { animation: vm-pop var(--dur-2) ease reverse forwards; }
.menu-list { padding: 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; font-size: 14px; font-weight: 500; text-align: left; transition: background-color var(--dur-2) ease, color var(--dur-2) ease; }
.menu-item:hover { background: var(--vm-surface-card); }
.menu-item .ic { --s: 18px; color: var(--vm-text-secondary); }
.menu-item:hover .ic { transform: var(--hm); animation: var(--ha); color: var(--vm-text-primary); }

/* ---------- Overlay layer: scrim, drawer, modal, sheet ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 70; background: var(--vm-scrim);
  animation: vm-fade var(--dur-3) ease both;
  backdrop-filter: saturate(0.9);
}
.scrim.is-closing { animation: vm-fade var(--dur-3) ease reverse forwards; }

/* Right-hand drawer (Invest, Redeem, Transaction details) */
.drawer {
  position: fixed; z-index: 71; top: 12px; right: 12px; bottom: 12px;
  width: min(480px, calc(100vw - 24px));
  display: flex; flex-direction: column;
  background: var(--vm-surface-page); border-radius: var(--vm-radius-xl);
  box-shadow: 0 2px 6px rgba(26, 26, 23, 0.05), 0 12px 36px -8px rgba(26, 26, 23, 0.12); /* Figma Elevation/Drawer */
  animation: vm-drawer-in 460ms var(--ease-out) both;
  overflow: hidden;
}
.drawer.is-closing { animation: vm-drawer-out 280ms var(--ease-in-out) forwards; }
/* the panel itself takes focus when opened by mouse or on page load — no ring around the whole panel */
.drawer:focus, .modal:focus { outline: none; }
@keyframes vm-drawer-in { from { transform: translateX(calc(100% + 24px)); } to { transform: none; } }
@keyframes vm-drawer-out { to { transform: translateX(calc(100% + 24px)); } }
.drawer-head { padding: 20px 28px 0; flex-shrink: 0; }
.drawer-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-title { font-size: 16px; font-weight: 600; }
.drawer-sub { font-size: 12px; color: var(--vm-text-secondary); margin-top: 4px; }
.drawer-head .steps-bar { margin-top: 16px; }
.drawer-head.has-border { border-bottom: 1px solid var(--vm-border-default); padding-bottom: 16px; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 24px 28px; }
.drawer-foot { flex-shrink: 0; padding: 16px 28px 24px; border-top: 1px solid var(--vm-border-default); background: var(--vm-surface-page); }
/* Step change animation inside drawers/modals: add .step-fwd or .step-back to the new step's root */
.step-fwd { animation: vm-step-fwd var(--dur-4) var(--ease-out) both; }
.step-back { animation: vm-step-back var(--dur-4) var(--ease-out) both; }
@keyframes vm-step-fwd { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes vm-step-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

/* Centered modal (Add bank account, Ondato, confirmations) */
.modal-wrap { position: fixed; inset: 0; z-index: 71; display: grid; place-items: center; padding: 24px; pointer-events: none; }
.modal {
  pointer-events: auto; width: min(440px, 100%); max-height: calc(100dvh - 48px); overflow: auto;
  background: var(--vm-surface-page); border-radius: var(--vm-radius-2xl); box-shadow: var(--vm-shadow-pop);
  animation: vm-modal-in 420ms var(--ease-out) both;
}
.modal.is-closing { animation: vm-modal-in 220ms ease reverse forwards; }
@keyframes vm-modal-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }

/* Phones: drawers become full-screen sheets that slide up (Figma "Mobile — Invest · …") */
@media (max-width: 639px) {
  .drawer { inset: 0; width: 100%; border-radius: 0; animation-name: vm-sheet-up; }
  .drawer.is-closing { animation-name: vm-sheet-down; }
  .drawer-head { padding: 16px 20px 0; }
  .drawer-body { padding: 20px; }
  .drawer-foot { padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); }
  /* Modals go full screen too (KYC, documents, forms); only short yes/no confirmations stay a bottom sheet */
  .modal-wrap { padding: 0; align-items: stretch; }
  .modal {
    width: 100%; height: 100dvh; max-height: none; border-radius: 0; box-shadow: none;
    display: flex; flex-direction: column; padding-top: env(safe-area-inset-top);
    animation-name: vm-sheet-up;
  }
  .modal.is-closing { animation: vm-sheet-down 240ms ease forwards; }
  .modal > .fm-swap, .modal > .fm, .fm-swap > .fm { flex: 1 0 auto; display: flex; flex-direction: column; }
  .modal .fm-foot, .modal .flow-doc-foot { margin-top: auto; }
  .modal-wrap:has(.confirm-modal) { padding: 12px; align-items: end; }
  .modal.confirm-modal { height: auto; max-height: calc(100dvh - 24px); padding-top: 0; border-radius: var(--vm-radius-2xl); box-shadow: var(--vm-shadow-pop); display: block; }
}
@keyframes vm-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes vm-sheet-down { to { transform: translateY(100%); } }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 95; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px 11px 12px;
  background: var(--vm-surface-inverse); color: #fff; border-radius: 14px; font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.4);
  animation: vm-toast-in 420ms var(--ease-spring) both;
}
.toast.is-closing { animation: vm-toast-out 240ms ease forwards; }
.toast .t-ok, .toast .t-info { width: 20px; height: 20px; border-radius: 50%; background: var(--vm-accent-positive); display: grid; place-items: center; flex-shrink: 0; }
.toast .t-info { background: rgba(255, 255, 255, 0.16); font-size: 12px; font-weight: 600; font-style: normal; }
@keyframes vm-toast-in { from { opacity: 0; transform: translateY(16px) scale(0.95); } }
@keyframes vm-toast-out { to { opacity: 0; transform: translateY(8px) scale(0.97); } }

/* ---------- Skeleton / loading ---------- */
.skel { background: linear-gradient(90deg, #edece9 0%, #f7f6f4 50%, #edece9 100%); background-size: 200% 100%; animation: vm-shimmer 1.4s linear infinite; border-radius: 8px; }
/* Loader: a soft grey track with a solid arc in the text colour (black on light, white on dark buttons) */
.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(26, 25, 23, 0.14); border-color: color-mix(in srgb, currentColor 18%, transparent); border-top-color: currentColor;
  animation: vm-spin 700ms linear infinite;
}

/* Animated success check (payment received, request sent) */
.success-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--vm-tint-green); color: var(--vm-text-positive); display: grid; place-items: center; animation: vm-pop-in 520ms var(--ease-spring) both; }
.success-mark svg { width: 28px; height: 28px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: vm-draw 520ms var(--ease-out) 260ms forwards; }
@keyframes vm-pop-in { from { transform: scale(0.4); opacity: 0; } }
@keyframes vm-draw { to { stroke-dashoffset: 0; } }

/* ---------- Area chart (js/chart.js) ---------- */
.chart { position: relative; width: 100%; height: 240px; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.chart-svg { position: absolute; left: 0; top: 0; overflow: visible; cursor: crosshair; }
.chart-grid line { stroke: var(--vm-border-default); stroke-dasharray: 3 4; }
.chart-line { fill: none; stroke: var(--vm-accent-primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-cursor { stroke: var(--vm-accent-primary); stroke-opacity: 0.35; stroke-dasharray: 3 4; transition: x1 140ms var(--ease-out), x2 140ms var(--ease-out), y1 140ms var(--ease-out); }
.chart-dot { fill: #fff; stroke: var(--vm-accent-primary); stroke-width: 3; transition: cx 140ms var(--ease-out), cy 140ms var(--ease-out), r 200ms var(--ease-spring); }
.chart.is-hover .chart-dot { r: 6.5; }
.chart-y span, .chart-x span { position: absolute; font-size: 12px; color: var(--vm-text-tertiary); white-space: nowrap; transition: color var(--dur-2) ease, opacity var(--dur-2) ease; }
.chart-x { position: absolute; left: 0; right: 0; height: 16px; }
.chart-x span.is-on { color: var(--vm-text-primary); font-weight: 500; }
.chart-tip {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: var(--vm-radius-md);
  background: var(--vm-surface-inverse); color: #fff; white-space: nowrap;
  transition: transform 160ms var(--ease-out), opacity var(--dur-2) ease;
}
.chart-tip b { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.chart-tip span { display: flex; gap: 6px; font-size: 12px; }
.chart-tip i { font-style: normal; opacity: 0.65; }
.chart-tip em { font-style: normal; font-weight: 500; color: var(--vm-text-positive-on-inverse); }
.chart-tip em.is-down { color: #f2917f; }
.chart:not(.is-drawn) .chart-tip, .chart:not(.is-drawn) .chart-dot, .chart:not(.is-drawn) .chart-cursor { opacity: 0; }
.chart.is-drawn .chart-tip, .chart.is-drawn .chart-dot, .chart.is-drawn .chart-cursor { animation: vm-fade 300ms ease both; }
.chart.is-morphing .chart-tip, .chart.is-morphing .chart-dot, .chart.is-morphing .chart-cursor, .chart.is-morphing .chart-x, .chart.is-morphing .chart-y { opacity: 0; transition: opacity 120ms ease; }

/* ---------- Avatar ---------- */
.avatar { width: 34px; height: 34px; border-radius: 17px; background: var(--vm-surface-inverse); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 500; flex-shrink: 0; }

/* ---------- Photo frames ---------- */
.photo { position: relative; overflow: hidden; border-radius: var(--vm-radius-lg); background: #dfe3e8; }
.photo > img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.card-link:hover .photo > img { transform: scale(1.04); }
