/* ==========================================================================
   Components — buttons, inputs, cards, badges, tables, tabs, toasts, modals,
   skeletons, segmented controls, switches, progress, KPI, empty / error states.
   ========================================================================== */

/* ---------- Logo ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-1); font-family: var(--font-display); font-weight: 600; font-size: var(--fs-16); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--bg-3); --btn-fg: var(--text-1); --btn-line: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 40px; padding: 0 var(--s-5); border-radius: var(--r-full);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-line);
  font-size: var(--fs-14); font-weight: 550; line-height: 1; white-space: nowrap;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
  user-select: none; text-decoration: none !important;
}
.btn:hover { background: var(--bg-4); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { --btn-bg: var(--accent); --btn-fg: var(--text-inverse); --btn-line: transparent; box-shadow: 0 0 0 1px rgba(255,255,255,.35) inset, 0 10px 30px -10px var(--accent-glow); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: transparent; }
.btn-ghost { --btn-bg: transparent; --btn-line: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-3); color: var(--text-1); border-color: transparent; }
.btn-outline { --btn-bg: var(--glass-bg); --btn-line: var(--glass-line-hi); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn-buy { --btn-bg: var(--gain); --btn-fg: #04140b; --btn-line: transparent; }
.btn-buy:hover { background: #45e192; }
.btn-sell { --btn-bg: var(--loss); --btn-fg: #1a0306; --btn-line: transparent; }
.btn-sell:hover { background: #ff8290; }
.btn-danger { --btn-bg: transparent; --btn-fg: var(--loss); --btn-line: var(--loss-line); }
.btn-danger:hover { background: var(--loss-soft); border-color: var(--loss); }
.btn-sm { height: 32px; padding: 0 var(--s-3); font-size: var(--fs-13); }
.btn-lg { height: 48px; padding: 0 var(--s-6); font-size: var(--fs-15); }
.btn-xl { height: 56px; padding: 0 var(--s-7); font-size: var(--fs-16); }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--btn-fg) transparent var(--btn-fg) transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Form controls ---------- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: var(--s-4); }
.label { font-size: var(--fs-13); font-weight: 550; color: var(--text-2); }
.hint { font-size: var(--fs-12); color: var(--text-3); }
.field-error { font-size: var(--fs-12); color: var(--loss); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 var(--s-3);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-md);
  color: var(--text-1); font-size: var(--fs-14);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), background var(--dur-1);
}
.textarea { height: auto; min-height: 96px; padding: var(--s-3); resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.input[aria-invalid="true"] { border-color: var(--loss-line); }
.input-mono { font-family: var(--font-mono); font-size: var(--fs-13); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a9b0be' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-group { display: flex; align-items: stretch; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--r-md); transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.input-group:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-group .input { border: 0; background: transparent; box-shadow: none !important; }
.input-group .addon { display: flex; align-items: center; padding: 0 var(--s-3); color: var(--text-3); font-size: var(--fs-13); font-weight: 600; }
.input-group .btn { margin: 4px; height: 32px; }
.check { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--fs-14); color: var(--text-2); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }

/* Switch — iOS-like pill, label on the left, used in option lists */
.switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); cursor: pointer; font-size: var(--fs-14); color: var(--text-1); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { order: 2; flex: none; width: 44px; height: 26px; border-radius: 99px; background: var(--bg-5); border: 1px solid var(--line-2); position: relative; transition: background var(--dur-2), border-color var(--dur-2); }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); transition: transform var(--dur-2) var(--ease); }
.switch input:checked + .track { background: var(--gain); border-color: var(--gain); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:disabled + .track { opacity: .4; }
.switch input:disabled ~ * { color: var(--text-3); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.toggle-list { display: grid; border: 1px solid var(--glass-line); border-radius: var(--r-lg); background: var(--glass-bg); overflow: hidden; }
.opt-toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); width: 100%; padding: 12px var(--s-4); border-bottom: 1px solid var(--line-1); color: var(--text-1); font-size: var(--fs-14); text-align: left; transition: background var(--dur-1); }
.opt-toggle:last-child { border-bottom: 0; }
.opt-toggle:hover { background: var(--accent-soft); }
.opt-toggle:disabled { color: var(--text-3); cursor: not-allowed; }
.opt-toggle:disabled:hover { background: transparent; }
.opt-state { flex: none; min-width: 84px; text-align: center; padding: 5px 12px; border-radius: var(--r-full); font-family: var(--font-mono); font-size: var(--fs-11); letter-spacing: .12em; text-transform: uppercase; background: var(--bg-4); color: var(--text-3); border: 1px solid var(--line-2); }
.opt-toggle[aria-checked="true"] .opt-state { background: var(--gain); color: #04140b; border-color: var(--gain); }
.opt-toggle:focus-visible { outline: 2px solid var(--accent-text); outline-offset: -2px; }

/* Segmented control */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-3); border: 1px solid var(--line-1); border-radius: var(--r-md); }
.segmented button, .segmented a { height: 30px; padding: 0 var(--s-3); border-radius: 7px; font-size: var(--fs-13); font-weight: 550; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.segmented button:hover { color: var(--text-1); }
.segmented [aria-pressed="true"], .segmented [aria-selected="true"], .segmented .is-active { background: var(--bg-5); color: var(--text-1); box-shadow: var(--shadow-1); }
.segmented.buy-sell [data-side="buy"][aria-pressed="true"] { background: var(--gain-soft); color: var(--gain); }
.segmented.buy-sell [data-side="sell"][aria-pressed="true"] { background: var(--loss-soft); color: var(--loss); }

/* ---------- Cards ---------- */
.card { background: var(--glass-bg); border: 1px solid var(--glass-line); border-radius: var(--r-xl); box-shadow: var(--shadow-1); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); }
.card-pad { padding: var(--s-5); }
@media (min-width: 720px) { .card-pad { padding: var(--s-6); } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line-1); }
.card-title { font-family: var(--font-sans); font-size: var(--fs-14); font-weight: 600; letter-spacing: -0.005em; color: var(--text-1); }
.card-body { padding: var(--s-5); }
.card-foot { padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line-1); }
.card-interactive { transition: border-color var(--dur-2), transform var(--dur-2) var(--ease); }
.card-interactive:hover { border-color: var(--glass-line-hi); background: rgba(255,255,255,.05); }

/* ---------- KPI ---------- */
.kpi { display: grid; gap: 6px; min-width: 0; }
.kpi-label { font-family: var(--font-mono); font-size: var(--fs-11); color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.16em; }
.kpi-value { font-family: var(--font-display); font-size: var(--fs-24); font-weight: 600; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; line-height: 1.1; overflow-wrap: anywhere; }
.kpi-value.xl { font-size: clamp(var(--fs-30), 5vw, var(--fs-48)); }
.kpi-sub { font-size: var(--fs-13); color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-full); font-size: var(--fs-11); font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; background: var(--bg-4); color: var(--text-2); border: 1px solid var(--line-1); white-space: nowrap; }
.badge-accent { background: var(--accent-soft); color: var(--text-1); border-color: var(--accent-line); }
.badge-gain { background: var(--gain-soft); color: var(--gain); border-color: var(--gain-line); }
.badge-loss { background: var(--loss-soft); color: var(--loss); border-color: var(--loss-line); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(245,181,71,.35); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: rgba(90,184,255,.35); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge .dot.live { animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Simulation mark — always visible near results */
.sim-badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-xs); font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--warn); background: var(--warn-soft); border: 1px dashed rgba(245,181,71,.45); white-space: nowrap; }
.demo-banner { position: sticky; top: 0; z-index: calc(var(--z-nav) + 5); display: flex; align-items: center; justify-content: center; gap: var(--s-2); padding: 6px var(--s-4); background: repeating-linear-gradient(-45deg, #2a1f05, #2a1f05 10px, #231a04 10px, #231a04 20px); color: var(--warn); font-family: var(--font-mono); font-size: var(--fs-12); font-weight: 700; letter-spacing: 0.1em; border-bottom: 1px solid rgba(245,181,71,.35); text-align: center; }

/* PnL pill */
.pnl { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.pnl-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--r-sm); font-variant-numeric: tabular-nums; font-size: var(--fs-13); font-weight: 600; }
.pnl-pill.gain { background: var(--gain-soft); }
.pnl-pill.loss { background: var(--loss-soft); }
.pnl-pill.flat { background: var(--bg-4); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { font-size: var(--fs-14); font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-family: var(--font-mono); font-size: var(--fs-11); font-weight: 500; color: var(--text-3); padding: 10px var(--s-3); border-bottom: 1px solid var(--line-1); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.14em; position: sticky; top: 0; background: var(--bg-1); }
.table td { padding: 12px var(--s-3); border-bottom: 1px solid var(--line-1); white-space: nowrap; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur-1); }
.table tbody tr:hover { background: rgba(255,255,255,.015); }
.table .num, .table th.num { text-align: right; }
.token-cell { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.token-avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; letter-spacing: 0; }
.token-meta { display: grid; line-height: 1.25; min-width: 0; }
.token-sym { font-weight: 600; }
.token-addr { font-family: var(--font-mono); font-size: var(--fs-12); color: var(--text-3); }

/* Responsive list cards (tables collapse on mobile) */
@media (max-width: 719px) {
  .table.responsive thead { display: none; }
  .table.responsive tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px var(--s-4); padding: var(--s-4); border-bottom: 1px solid var(--line-1); }
  .table.responsive td { border: 0; padding: 0; white-space: normal; text-align: left !important; display: grid; }
  .table.responsive td[data-label]::before { content: attr(data-label); font-size: var(--fs-11); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 550; }
  .table.responsive td.cell-primary { grid-column: 1 / -1; }
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--line-1); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; height: 42px; padding: 0 var(--s-3); color: var(--text-2); font-size: var(--fs-14); font-weight: 550; white-space: nowrap; text-decoration: none !important; display: inline-flex; align-items: center; }
.tab:hover { color: var(--text-1); }
.tab[aria-selected="true"] { color: var(--text-1); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: var(--s-3); right: var(--s-3); bottom: -1px; height: 2px; background: var(--accent-text); border-radius: 2px; }

/* ---------- Progress ---------- */
.progress { height: 6px; border-radius: 99px; background: var(--bg-4); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, #8e8e99, #ffffff); border-radius: inherit; transition: width var(--dur-4) var(--ease); }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--bg-3); border: 1px solid var(--line-2); font-size: var(--fs-14); color: var(--text-2); }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.alert-warn { background: var(--warn-soft); border-color: rgba(245,181,71,.3); color: #f7d08a; }
.alert-error { background: var(--loss-soft); border-color: var(--loss-line); color: #ffb3bb; }
.alert-info { background: var(--info-soft); border-color: rgba(90,184,255,.3); color: #b5dcff; }
.alert-success { background: var(--gain-soft); border-color: var(--gain-line); color: #a6efc8; }
.alert strong { color: var(--text-1); }

/* ---------- Empty / error states ---------- */
.state { display: grid; justify-items: center; text-align: center; gap: var(--s-3); padding: var(--s-9) var(--s-5); color: var(--text-2); }
.state-icon { width: 48px; height: 48px; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line-2); color: var(--text-2); }
.state-icon svg { width: 22px; height: 22px; }
.state h3 { font-size: var(--fs-16); color: var(--text-1); font-family: var(--font-sans); letter-spacing: -0.01em; }
.state p { max-width: 420px; font-size: var(--fs-14); }
.state.is-error .state-icon { color: var(--loss); background: var(--loss-soft); border-color: var(--loss-line); }
.state.is-warn .state-icon { color: var(--warn); background: var(--warn-soft); border-color: rgba(245,181,71,.3); }

/* ---------- Skeletons ---------- */
.skel { position: relative; overflow: hidden; background: var(--bg-3); border-radius: var(--r-sm); min-height: 12px; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.045), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-text { height: 12px; width: 60%; }
.skel-title { height: 28px; width: 40%; }
.skel-block { height: 180px; width: 100%; border-radius: var(--r-lg); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: var(--z-toast); right: var(--s-4); bottom: var(--s-4); display: grid; gap: var(--s-2); width: min(380px, calc(100vw - 32px)); pointer-events: none; }
@media (max-width: 719px) { .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); left: var(--s-4); right: var(--s-4); width: auto; } }
.toast { pointer-events: auto; display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--r-lg); background: var(--glass-bg-strong); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--glass-line-hi); box-shadow: var(--shadow-3); font-size: var(--fs-14); color: var(--text-1); animation: toast-in var(--dur-3) var(--ease); }
.toast .t-icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast-success .t-icon { color: var(--gain); }
.toast-error .t-icon { color: var(--loss); }
.toast-info .t-icon { color: var(--accent-text); }
.toast.is-leaving { animation: toast-out var(--dur-2) var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(4px); } }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: var(--z-modal); background: rgba(3, 4, 7, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: var(--s-4); animation: fade-in var(--dur-2) var(--ease); }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--glass-bg-strong); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow-3); animation: modal-in var(--dur-3) var(--ease); }
.modal-wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); padding: var(--s-6) var(--s-6) 0; }
.modal-head h2 { font-size: var(--fs-20); }
.modal-body { padding: var(--s-5) var(--s-6); color: var(--text-2); font-size: var(--fs-14); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s-2); padding: 0 var(--s-6) var(--s-6); flex-wrap: wrap; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- Misc ---------- */
.kbd { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--bg-3); font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }
.divider { height: 1px; background: var(--line-1); margin: var(--s-5) 0; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 10px var(--s-5); font-size: var(--fs-14); }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.copy-field { display: flex; align-items: center; gap: var(--s-2); padding: 4px 4px 4px var(--s-3); background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--r-md); min-width: 0; }
.copy-field code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); font-size: var(--fs-13); }
.lang-select { height: 34px; padding: 0 30px 0 10px; font-size: var(--fs-13); border-radius: var(--r-sm); width: auto; background-position: right 10px center; }
.icon { width: 18px; height: 18px; flex: none; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-3); border-top-color: var(--accent-text); animation: spin .8s linear infinite; }

/* ---------- Pricing / plans (landing, billing, paywall) ---------- */
.pricing-grid { display: grid; gap: var(--s-4); max-width: 920px; margin: 0 auto; }
@media (min-width: 800px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
.plan { padding: var(--s-7); border-radius: var(--r-2xl); background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-line); display: flex; flex-direction: column; gap: var(--s-5); position: relative; }
.plan.is-featured { border-color: var(--glass-line-hi); background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02) 40%); box-shadow: 0 30px 80px -40px var(--accent-glow); }
.plan-name { font-size: var(--fs-20); font-family: var(--font-display); font-weight: 600; display: flex; align-items: center; gap: var(--s-2); }
.plan-desc { color: var(--text-2); font-size: var(--fs-14); }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-price strong { font-family: var(--font-display); font-size: var(--fs-48); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; line-height: 1; background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan-price span { color: var(--text-2); }
.plan-vat { font-size: var(--fs-12); color: var(--text-3); margin-top: -12px; }
.plan-features { list-style: none; padding: 0; display: grid; gap: var(--s-3); font-size: var(--fs-14); flex: 1; }
.plan-features li { display: flex; gap: var(--s-2); align-items: flex-start; color: var(--text-1); }
.plan-features li svg { width: 16px; height: 16px; color: var(--accent-text); flex: none; margin-top: 3px; }
.plan-features li.is-off { color: var(--text-3); }
.plan-features li.is-off svg { color: var(--text-3); }


/* Feature icon tile */
.feature-ico { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--accent-soft); color: var(--text-1); border: 1px solid var(--glass-line); }
.feature-ico svg { width: 20px; height: 20px; }
.card-canvas { width: 100%; height: auto; display: block; }

/* Responsive visibility helpers */
@media (min-width: 1024px) { .hide-desktop { display: none !important; } }
/* Avis « ordinateur requis » : seulement sur téléphone (largeur < 768 px). */
.mobile-only { display: none; }
@media (max-width: 767px) { .mobile-only { display: flex; } }
.device-notice { margin: var(--s-3) var(--s-4) 0; }
@media (max-width: 559px) { .hide-sm-inline { display: none !important; } }
.hide-desktop-flex { display: inline-flex; }
@media (min-width: 1000px) { .hide-desktop-flex { display: none !important; } }

/* ---------- UX pass: single plan, explainers, link buttons ---------- */
.pricing-grid.is-single { max-width: 460px; }
@media (min-width: 800px) { .pricing-grid.is-single { grid-template-columns: 1fr; } }
.plan-best { font-size: var(--fs-13); color: var(--accent-text); font-weight: 600; }
.btn-link { background: none; border: 0; padding: 0 2px; color: var(--accent-text); font-size: var(--fs-14); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-link:hover { color: var(--text-1); }
.stack-sm > * + * { margin-top: var(--s-2); }

.with-tip { display: inline-flex; align-items: center; gap: 4px; }
.tip { position: relative; display: inline-flex; vertical-align: middle; text-transform: none; letter-spacing: normal; font-weight: 400; }
.tip-btn { width: 17px; height: 17px; border-radius: 50%; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line-3); background: var(--bg-3); color: var(--text-2); font-size: 10.5px; font-weight: 700; line-height: 1; cursor: help; }
.tip-btn:hover, .tip.is-open .tip-btn { color: var(--text-1); border-color: var(--accent-line); background: var(--accent-soft); }
.tip-pop { position: absolute; z-index: 60; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: min(280px, 80vw); padding: 10px 12px; border-radius: var(--r-md); background: var(--bg-5); border: 1px solid var(--line-3); box-shadow: var(--shadow-3, 0 10px 30px rgba(0,0,0,.5)); color: var(--text-1); font-size: var(--fs-13); line-height: 1.45; text-align: left; white-space: normal; visibility: hidden; opacity: 0; transition: opacity var(--dur-1); pointer-events: none; }
.tip:hover .tip-pop, .tip:focus-within .tip-pop, .tip.is-open .tip-pop { visibility: visible; opacity: 1; }
@media (max-width: 559px) { .tip-pop { left: auto; right: -40px; transform: none; } }

/* affiliate tiers */
.tiers-table tr.is-current td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tiers-table tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.ml-2 { margin-left: var(--s-2); }
