/* Vela · panel de clientes en directo.
   Same dark brand as the original Vela panel (../panel-clientes.html): flame gradient, Funnel Display / Funnel Sans /
   Martian Mono, blue = money in / profit, red = money out / loss, amber = owner's commission.
   Sticky header with tabs (bottom bar + action button on phones), every form in a modal sheet. */
:root {
  color-scheme: dark;
  --bg: #08090b;
  --surface: #101216;
  --surface-2: #161920;
  --raise: #1c2028;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .15);
  --ink: #f2f0ec;
  --ink-2: #afaba3;
  --muted: #8f8a80;
  --amber: #ff9f43;
  --gold: #ffd58a;
  --flame: linear-gradient(100deg, #ffe2a8 0%, #ffab4c 48%, #ff6a3d 100%);
  --on-flame: #170d04;
  --blue: #5a9bff;
  --blue-ink: #9cc2ff;
  --red: #ff6b6b;
  --red-ink: #ff9d9d;
  --green: #4fd08a;
  --shadow: 0 24px 60px -18px rgba(0, 0, 0, .8);
  --display: "Funnel Display", "Helvetica Neue", Arial, sans-serif;
  --body: "Funnel Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Martian Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: clip; }
body.noscroll { overflow: hidden; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.pos { color: var(--blue-ink); }
.neg { color: var(--red-ink); }
.amb { color: var(--gold); }
.mut { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .86em; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: clamp(16px, 3.5vw, 32px); }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: rgba(8, 9, 11, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand b { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.brand span { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 9px; }
.tabs { display: flex; gap: 2px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.tabs button { background: none; border: 0; border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-current="page"] { background: rgba(255, 255, 255, .1); color: var(--ink); }
.top-r { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sync { font-family: var(--mono); font-size: 10px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.sync.ok::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.sync.warn { color: var(--gold); }
.sync.warn::before { background: var(--amber); }
.sync.bad { color: var(--red-ink); }
.sync.bad::before { background: var(--red); }
.sync.busy::before { background: var(--amber); animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }
body:not(.authed) .tabs, body:not(.authed) .sync, body:not(.authed) .top-r .btn, body:not(.authed) .top-r .phone-only, body:not(.authed) .bar { display: none !important; }
.top-r .phone-only { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: filter .2s, background-color .2s, transform .2s var(--ease); }
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.sm { padding: 8px 14px; font-size: 13.5px; }
.btn.flame { background: var(--flame); color: var(--on-flame); box-shadow: 0 10px 28px -12px rgba(255, 120, 50, .8), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn.flame:hover { filter: brightness(1.07); }
.btn.ghost { background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); color: var(--ink); }
.btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.btn.danger { background: rgba(255, 107, 107, .12); border: 1px solid rgba(255, 107, 107, .4); color: var(--red-ink); }
.btn.danger:hover { background: rgba(255, 107, 107, .2); }
.btn.solid-danger { background: var(--red); color: #1a0606; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.busy { cursor: progress; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: rgba(255, 255, 255, .06); border-color: var(--line); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.link { background: none; border: 0; color: var(--gold); font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 4px 0; white-space: nowrap; }

/* layout */
main { padding-block: 28px 64px; min-height: 70vh; }
.v-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.v-head > div { min-width: 0; }
.v-head h1 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -.04em; }
.v-head p { color: var(--ink-2); margin-top: 6px; }
.card { background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015)); border: 1px solid var(--line); border-radius: 20px; padding: 20px; min-width: 0; }
.card h2 { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; }
.card-h p { color: var(--muted); font-size: 13px; }
.stack { display: grid; gap: 16px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015)); }
.kpi { padding: 18px; display: grid; gap: 4px; align-content: start; border-left: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.kpi .v { font-family: var(--display); font-size: clamp(20px, 2.1vw, 27px); font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 4px; overflow-wrap: anywhere; }
.kpi .n { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.kpi .n.neg { color: var(--red-ink); }
.kpi.hl { background: radial-gradient(120% 100% at 0% 0%, rgba(255, 159, 67, .12), transparent 70%); }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1 1 auto; }
.field-s { position: relative; flex: 1 1 260px; min-width: 0; }
.field-s svg { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
.field-s input[type="search"] { width: 100%; padding: 11px 14px 11px 40px; }
input[type="text"], input[type="search"], input[type="date"], input[type="email"], input[type="tel"], input[type="password"], select, textarea { background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 13px; font-size: 15px; min-width: 0; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(255, 170, 90, .7); box-shadow: 0 0 0 3px rgba(255, 159, 67, .15); }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%23afaba3' stroke-width='1.6' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; }
select option { background: #15181d; color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); }
.seg { display: inline-flex; gap: 2px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 12px; padding: 3px; flex-wrap: wrap; max-width: 100%; }
.seg button { background: none; border: 0; border-radius: 9px; padding: 7px 12px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, .1); color: var(--ink); }
.seg button small { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-left: 4px; }

/* client rows */
.clist { display: grid; gap: 8px; }
.crow { display: grid; grid-template-columns: 44px minmax(0, 1.6fr) auto minmax(0, 1fr) 20px; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); cursor: pointer; transition: background .2s, border-color .2s; }
.crow:hover { background: rgba(255, 255, 255, .05); border-color: var(--line-2); }
.crow > svg, .arow > svg { width: 16px; height: 16px; color: var(--muted); }
.av { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 16px; color: #111; background: hsl(var(--h, 30) 80% 72%); flex: none; }
.av.lg { width: 64px; height: 64px; border-radius: 20px; font-size: 24px; }
.c-main { display: grid; min-width: 0; }
.c-main b { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-main small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-num { display: grid; text-align: right; min-width: 0; }
.c-num b { font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.c-num small { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px 4px 8px; border-radius: 999px; background: rgba(255, 255, 255, .06); white-space: nowrap; justify-self: start; max-width: 100%; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.chip.st-activo::before, .chip.a-ok::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.chip.st-pausado::before, .chip.a-wait::before, .chip.a-stale::before { background: var(--amber); }
.chip.a-stale { color: var(--gold); }
.chip.st-baja, .chip.a-off { color: var(--muted); }
.chip.a-err { color: var(--red-ink); background: rgba(255, 107, 107, .12); }
.chip.a-err::before { background: var(--red); }
.chip.cl-cerrado::before, .chip.cl-cobrado::before { display: none; }
.chip.cl-cerrado { color: var(--ink); }
.chip.cl-cobrado { color: var(--gold); background: rgba(255, 159, 67, .14); }
.chip.cl-preview { color: var(--blue-ink); background: rgba(90, 155, 255, .12); }
.chip.cl-preview::before { background: var(--blue); }
.chip.cl-blocked { color: var(--muted); }
.chip svg { width: 12px; height: 12px; flex: none; }
.tchip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: rgba(255, 255, 255, .08); color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.t-deposito, .t-deposit, .t-buy { background: rgba(90, 155, 255, .14); color: var(--blue-ink); }
.t-retiro, .t-withdrawal, .t-sell { background: rgba(255, 107, 107, .14); color: var(--red-ink); }
.t-comision, .t-profit_share { background: rgba(255, 159, 67, .14); color: var(--gold); }
.tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 8px; white-space: nowrap; }

/* live account rows */
.alist { display: grid; gap: 8px; }
.arow { display: grid; grid-template-columns: 40px minmax(0, 1.5fr) auto minmax(0, 1fr) minmax(0, .65fr) 20px; align-items: center; gap: 6px 14px; width: 100%; text-align: left; padding: 13px 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); cursor: pointer; transition: background .2s, border-color .2s; }
.arow:hover { background: rgba(255, 255, 255, .05); border-color: var(--line-2); }
.arow .av { width: 40px; height: 40px; border-radius: 13px; font-size: 15px; }
.arow.is-err { border-color: rgba(255, 107, 107, .35); }
.a-ml { display: grid; text-align: right; min-width: 0; }
.a-ml small { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.a-ml b { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.a-errmsg { grid-column: 2 / -1; display: flex; align-items: flex-start; gap: 7px; color: var(--red-ink); font-size: 13px; overflow-wrap: anywhere; min-width: 0; }
.a-errmsg svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }

/* account cards in the client file */
.acards { display: grid; gap: 10px; }
.acard { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: rgba(255, 255, 255, .02); display: grid; gap: 10px; min-width: 0; }
.acard.is-err { border-color: rgba(255, 107, 107, .35); }
.acard-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.acard-h .who { flex: 1 1 200px; min-width: 0; display: grid; }
.acard-h .who b { font-family: var(--mono); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.acard-h .who small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.acard-h .acts { display: flex; gap: 2px; margin-left: auto; }
.mini { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px 14px; }
.mini div { min-width: 0; }
.mini dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mini dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }

/* moves + flows lists */
.mlist { display: grid; min-width: 0; }
.mrow { display: grid; grid-template-columns: 96px minmax(0, 1.2fr) 112px minmax(0, 1.4fr) 130px 76px; gap: 12px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); font-size: 14.5px; }
.mrow:first-child { border-top: 0; }
.mrow.head { font-family: var(--mono); font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding-block: 4px 10px; }
.mrow .amt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mrow .note { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mrow .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: var(--ink); min-width: 0; }
.mrow .who:hover { color: var(--gold); }
.mrow .acts { display: flex; justify-content: flex-end; gap: 2px; }
.mrow.no-client { grid-template-columns: 96px 112px minmax(0, 1.6fr) 130px 76px; }
.mrow.flow { grid-template-columns: 128px minmax(0, 1.1fr) 140px minmax(0, 1.4fr) 130px; }
.mrow.flow.no-client { grid-template-columns: 128px 140px minmax(0, 1.6fr) 130px; }
.mtot { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pill { border: 1px solid var(--line); background: rgba(255, 255, 255, .03); border-radius: 999px; padding: 6px 13px; font-size: 13px; color: var(--ink-2); max-width: 100%; }
.pill b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.more { margin-top: 10px; }

/* positions */
.ptable { display: grid; min-width: 0; }
.prow { display: grid; grid-template-columns: minmax(0, 1.1fr) 80px 70px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.prow:first-child { border-top: 0; }
.prow.head { font-family: var(--mono); font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding-block: 4px 10px; }
.prow .r { text-align: right; }
.prow .sym { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .sym small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

/* closes */
.clrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.clrow:first-child { border-top: 0; }
.clrow.head { font-family: var(--mono); font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding-block: 4px 10px; }
.clrow .r { text-align: right; }
.ccards { display: grid; gap: 12px; }
.ccard { border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; background: rgba(255, 255, 255, .025); display: grid; gap: 14px; min-width: 0; }
.ccard.locked { background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .015)); }
.ccard.blocked { opacity: .82; }
.ccard-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ccard-h .who { background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -.02em; text-align: left; min-width: 0; overflow-wrap: anywhere; margin-right: auto; }
.ccard-h .who:hover { color: var(--gold); }
.figs { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; }
.figs div { min-width: 0; }
.figs dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.figs dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.figs dd small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.com { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; border-radius: 14px; padding: 12px 14px; background: radial-gradient(120% 140% at 0% 0%, rgba(255, 159, 67, .1), transparent 70%), rgba(255, 255, 255, .02); border: 1px solid var(--line); }
.com div { display: grid; min-width: 0; }
.com span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.com b { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.com small { font-size: 12px; color: var(--ink-2); }
.warns { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.warns li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--gold); overflow-wrap: anywhere; min-width: 0; }
.warns li svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.ccard-f { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cl-notes { display: grid; gap: 4px; min-width: 0; border-left: 2px solid var(--line-2); padding: 2px 0 2px 12px; }
.cl-notes .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cl-notes p { font-size: 13px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.acc-det { font-size: 13px; color: var(--ink-2); min-width: 0; }
.acc-det summary { cursor: pointer; color: var(--gold); font-weight: 600; width: max-content; max-width: 100%; }
.acc-det ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.acc-det li { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; overflow-wrap: anywhere; }
.acc-det li b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.acc-det i { font-style: normal; color: var(--muted); }
.acc-det small { color: var(--muted); }
.cm-warn { margin-top: 4px; margin-bottom: 10px; }
.plist li .cm-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; cursor: pointer; }
.cm-row input { width: 20px; height: 20px; accent-color: var(--amber); margin: 0; }
.cm-who { display: grid; min-width: 0; }
.cm-n { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-w { width: 14px; height: 14px; color: var(--amber); flex: none; }
.cm-who small { font-size: 12px; color: var(--gold); white-space: normal; overflow-wrap: anywhere; }
.danger-zone { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }
.link.danger-link { color: var(--red-ink); display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.link.danger-link svg { width: 15px; height: 15px; }
.ph { display: none; }
#af-login-note svg { width: 13px; height: 13px; vertical-align: -2px; }
.ccard-f .why { color: var(--muted); font-size: 13px; margin-right: auto; }
.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 12px 14px; background: rgba(255, 159, 67, .08); border: 1px solid rgba(255, 159, 67, .3); color: var(--ink); font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.notice svg { width: 18px; height: 18px; flex: none; color: var(--amber); margin-top: 1px; }
.notice.n-info { background: rgba(90, 155, 255, .08); border-color: rgba(90, 155, 255, .3); }
.notice.n-info svg { color: var(--blue); }
.notice.n-bad { background: rgba(255, 107, 107, .08); border-color: rgba(255, 107, 107, .35); }
.notice.n-bad svg { color: var(--red); }
.rt { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 11px; white-space: nowrap; }
.rt::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.rt.on::before { background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 2.4s ease-in-out infinite; }

/* charts */
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); shape-rendering: crispEdges; }
.chart .tick { fill: var(--muted); font-family: var(--mono); font-size: 9.5px; }
.chart .line { fill: none; stroke: var(--blue); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#g-area); }

/* daily P/L calendar ("tipo FTMO", §6b). Layout follows the width of the calendar itself (container
   queries), so the same markup works in a page card, in a sheet and on a 360 px phone:
   ≥ 900 px  7 day columns + weekly total column, full amounts
   600–899   same grid, whole-euro amounts
   < 600     7 compact columns, abbreviated amounts (+12, −3, +1,2k), weekly totals listed under the grid */
.cal { container-type: inline-size; display: grid; gap: 14px; min-width: 0; }
.cal-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; }
.cal-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cal-nav .icon-btn { border-color: var(--line-2); background: rgba(255, 255, 255, .03); }
.cal-nav .icon-btn[disabled] { opacity: .35; cursor: default; }
.cal-nav .btn { margin-left: 4px; }
.cal-title { font-size: 19px; min-width: 9.6em; text-align: center; white-space: nowrap; }
.cal-sel { flex: 0 1 280px; min-width: 0; padding-block: 8px; font-size: 14px; }
.cal-sum { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: rgba(255, 255, 255, .02); }
.cal-fig { display: grid; gap: 2px; align-content: start; padding: 12px 14px; min-width: 0; border-left: 1px solid var(--line); border-top: 1px solid var(--line); margin: -1px 0 0 -1px; }
.cal-fig .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cal-fig b { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.cal-fig small { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.cal-fig.f-pnl { background: radial-gradient(120% 100% at 0% 0%, rgba(90, 155, 255, .1), transparent 70%); }
.cal-fig.f-share { background: radial-gradient(120% 100% at 0% 0%, rgba(255, 159, 67, .12), transparent 70%); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 1.15fr); gap: 6px; }
.cal-wd { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 4px 2px; white-space: nowrap; overflow: hidden; }
.cal-wd.we { opacity: .7; }
.cal-wd .s { display: none; }
.cal-d { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; min-height: 86px; padding: 8px 9px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); color: var(--ink-2); text-align: left; overflow: hidden; }
button.cal-d { cursor: pointer; transition: border-color .2s, filter .2s; }
button.cal-d:hover { border-color: var(--line-2); filter: brightness(1.15); }
.cal-d.out { background: none; border-color: transparent; opacity: .3; }
.cal-n { font-family: var(--mono); font-size: 11px; line-height: 1.3; color: var(--muted); }
.cal-a { margin-top: auto; max-width: 100%; font-weight: 650; font-size: 14px; letter-spacing: -.01em; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-a.m, .cal-a.c { display: none; }
.cal-t { max-width: 100%; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-f { display: flex; flex-wrap: wrap; gap: 3px; max-width: 100%; }
.cal-f i { font-style: normal; font-size: 10px; font-weight: 600; line-height: 1.25; padding: 1px 5px; border-radius: 6px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cal-f .f-dep { color: var(--blue-ink); background: rgba(90, 155, 255, .2); }
.cal-f .f-ret { color: var(--red-ink); background: rgba(255, 107, 107, .2); }
.cal-f .f-ppf { color: var(--gold); background: rgba(255, 159, 67, .2); }
.cal-d.win { background: rgba(90, 155, 255, var(--a, .2)); border-color: rgba(90, 155, 255, .4); }
.cal-d.loss { background: rgba(255, 107, 107, var(--a, .2)); border-color: rgba(255, 107, 107, .4); }
.cal-d.win .cal-a { color: var(--blue-ink); }
.cal-d.loss .cal-a { color: var(--red-ink); }
.cal-d.win .cal-n, .cal-d.loss .cal-n, .cal-d.flat .cal-n { color: var(--ink-2); }
.cal-d.flat .cal-a { color: var(--ink-2); }
.cal-d.none { color: var(--muted); }
.cal-d.we { opacity: .5; }
.cal-d.we.win, .cal-d.we.loss { opacity: .8; }
.cal-d.fut { opacity: .4; background: none; }
.cal-d.today { opacity: 1; border-color: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
.cal-d.today .cal-n { color: var(--ink); font-weight: 600; }
.cal-d.today .cal-n::after { content: " · hoy"; font-family: var(--body); }
.cal-wk { display: grid; align-content: center; gap: 1px; min-width: 0; padding: 8px 10px; border-radius: 12px; border: 1px dashed var(--line-2); background: rgba(255, 255, 255, .03); }
.cal-wk .k, .cal-wkh { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cal-wk b { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-wk small { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-weeks { display: none; }
.cal-wrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; padding: 9px 2px; border-top: 1px solid var(--line); font-size: 14px; }
.cal-wrow:first-child { border-top: 0; }
.cal-wrow > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-wrow small, .cal-wrow .n { color: var(--muted); font-size: 12.5px; }
.cal-wrow b { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; text-align: right; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.cal-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cal-legend .lg-win { background: rgba(90, 155, 255, .55); }
.cal-legend .lg-loss { background: rgba(255, 107, 107, .55); }
.cal-legend .lg-none { background: rgba(255, 255, 255, .08); border: 1px solid var(--line-2); }
.cal-legend .lg-dep, .cal-legend .lg-ret, .cal-legend .lg-ppf { border-radius: 50%; }
.cal-legend .lg-dep { background: var(--blue); }
.cal-legend .lg-ret { background: var(--red); }
.cal-legend .lg-ppf { background: var(--amber); }
.cal-note .link { padding: 0; font-size: inherit; }
.cal.is-loading .cal-sum, .cal.is-loading .cal-grid { opacity: .45; animation: blink 1.4s ease-in-out infinite; }
@container (max-width: 899px) {
  .cal-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cal-a.f { display: none; }
  .cal-a.m { display: block; }
  .cal-d { min-height: 76px; padding: 7px 8px; }
  .cal-d.today .cal-n::after { content: none; }
}
@container (max-width: 599px) {
  .cal-title { font-size: 16px; min-width: 8.4em; }
  .cal-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-fig { padding: 10px 12px; }
  .cal-fig b { font-size: 17px; }
  .cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .cal-wkh, .cal-wk { display: none; }
  .cal-weeks { display: grid; }
  .cal-wd { text-align: center; padding: 0; }
  .cal-wd .l { display: none; }
  .cal-wd .s { display: inline; }
  .cal-d { align-items: center; min-height: 50px; padding: 4px 2px 5px; gap: 1px; border-radius: 9px; text-align: center; }
  .cal-n { font-size: 10px; }
  .cal-a.m { display: none; }
  .cal-a.c { display: block; font-size: 10.5px; letter-spacing: -.02em; text-overflow: clip; }
  .cal-t { display: none; }
  .cal-f { justify-content: center; gap: 2px; }
  .cal-f i { width: 5px; height: 5px; padding: 0; border-radius: 50%; }
  .cal-f i span { display: none; }
  .cal-f .f-dep { background: var(--blue); }
  .cal-f .f-ret { background: var(--red); }
  .cal-f .f-ppf { background: var(--amber); }
  .cal-d.today { box-shadow: inset 0 0 0 1.5px var(--ink); }
}

/* day sheet: closed trades of one day */
.sheet.wide { width: min(100%, 860px); }
.day-sum { margin: 0 0 14px; }
.day-body { gap: 18px; }
.day-t { font-size: 15px; display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.day-t small { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; }
.day-note { margin-top: 16px; }
.dlist { display: grid; min-width: 0; }
.drow { display: grid; grid-template-columns: 52px minmax(0, 1fr) 92px 64px minmax(104px, auto); gap: 10px; align-items: center; padding: 9px 2px; border-top: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.drow:first-child { border-top: 0; }
.drow.head { font-family: var(--mono); font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding-block: 2px 8px; }
.drow .r { text-align: right; }
.drow .tm { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.drow .sym { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow .sym small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.drow .amt { font-weight: 600; white-space: nowrap; }
.drow.extra .sym { font-weight: 500; color: var(--ink-2); }
.drow.total { border-top-color: var(--line-2); }
.acard-h .acts { align-items: center; gap: 4px; }

/* client file */
.back { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--ink-2); cursor: pointer; padding: 4px 0; margin-bottom: 16px; font-size: 14px; }
.back:hover { color: var(--ink); }
.back svg { width: 16px; height: 16px; }
.d-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 18px; margin-bottom: 20px; }
.d-head .who { flex: 1 1 260px; min-width: 0; display: grid; gap: 6px; }
.d-head h1 { font-size: clamp(28px, 3.6vw, 38px); letter-spacing: -.04em; overflow-wrap: anywhere; }
.d-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--ink-2); font-size: 14px; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.info { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.info div { padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; }
.info div:nth-child(-n+2) { border-top: 0; }
.info dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.info dd { margin: 3px 0 0; font-size: 14.5px; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.info .wide { grid-column: 1 / -1; }
.copy-mini { background: none; border: 1px solid var(--line-2); border-radius: 7px; color: var(--gold); font-size: 11px; padding: 2px 7px; cursor: pointer; }

/* empty + gate + login */
.empty { text-align: center; padding: 42px 20px; display: grid; justify-items: center; gap: 12px; color: var(--ink-2); }
.empty svg { width: 44px; height: 44px; color: var(--amber); opacity: .9; }
.empty h3 { font-size: 21px; color: var(--ink); }
.empty p { max-width: 46ch; }
.gate { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.gate > div { display: grid; justify-items: center; gap: 14px; max-width: 460px; }
.gate > div > svg { width: 56px; height: 56px; color: var(--amber); }
.gate h1 { font-size: 28px; }
.gate p { color: var(--ink-2); }
.gate code { font-family: var(--mono); font-size: 12px; color: var(--gold); }
.login { width: min(100%, 400px); text-align: left; display: grid; gap: 16px; padding: 26px; }
.login .lb { display: flex; align-items: center; gap: 10px; }
.login .lb svg { width: 34px; height: 34px; }
.login h1 { font-size: 30px; letter-spacing: -.04em; }
.login p { color: var(--ink-2); font-size: 14px; }
.login .btn { width: 100%; }
.skel { height: 64px; border-radius: 16px; background: linear-gradient(90deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .07), rgba(255, 255, 255, .03)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skel.sm { height: 40px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* modal sheet */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.ov { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .2s both; }
.sheet { position: relative; width: min(100%, 560px); max-height: min(92vh, 860px); overflow: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--line-2); border-radius: 24px; box-shadow: var(--shadow); padding: 22px; animation: up .3s var(--ease) both; }
.sheet.sm { width: min(100%, 440px); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { opacity: 0; transform: translateY(18px); } }
.sheet-h { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-h > div { min-width: 0; }
.sheet-h h2 { font-size: 22px; letter-spacing: -.03em; overflow-wrap: anywhere; }
.sheet-h p { color: var(--ink-2); font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.form { display: grid; gap: 14px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fld { display: grid; gap: 6px; min-width: 0; }
.fld > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.fld > span small { font-weight: 400; color: var(--muted); }
.fld input, .fld select, .fld textarea { width: 100%; }
.fld textarea { min-height: 76px; resize: vertical; }
.sec-t { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.radios { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.radios.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.radios label { position: relative; }
.radios input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radios span { display: block; text-align: center; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line-2); font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: rgba(255, 255, 255, .03); transition: all .2s; }
.radios input:checked + span { color: var(--on-flame); background: var(--flame); border-color: transparent; }
.radios input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--amber); flex: none; }
.hint { font-size: 12.5px; color: var(--muted); }
.preview { border-radius: 14px; padding: 12px 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.preview b { color: var(--ink); }
.plist { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; max-height: 40vh; overflow: auto; }
.plist li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 2px; border-top: 1px solid var(--line); font-size: 14px; }
.plist li:first-child { border-top: 0; }
.plist li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.err { color: var(--red-ink); font-size: 13px; }
.sheet-f { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.acts-list { display: grid; gap: 8px; }
.acts-list button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); cursor: pointer; font-weight: 600; }
.acts-list button:hover { background: rgba(255, 255, 255, .07); }
.acts-list button span { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.acts-list svg { width: 22px; height: 22px; color: var(--amber); flex: none; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 80; transform: translateX(-50%); background: var(--raise); border: 1px solid var(--line-2); border-radius: 14px; padding: 11px 16px; box-shadow: var(--shadow); font-size: 14px; width: max-content; max-width: calc(100vw - 32px); overflow-wrap: anywhere; animation: up .3s var(--ease) both; }
.toast.bad { border-color: rgba(255, 107, 107, .5); color: var(--red-ink); }

/* bottom bar (phones) */
.bar { display: none; }
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--line); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .arow { grid-template-columns: 40px minmax(0, 1.5fr) auto minmax(0, 1fr) 20px; }
  .arow .a-ml { display: none; }
}
@media (max-width: 860px) {
  .top-r .sync { max-width: 160px; }
}
@media (max-width: 760px) {
  .tabs, .top-r .btn { display: none; }
  .top-r .phone-only { display: inline-grid; }
  main { padding-top: 22px; padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
  .bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) 60px repeat(2, minmax(0, 1fr)); align-items: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px)); background: rgba(10, 11, 13, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .bar button { display: grid; justify-items: center; gap: 3px; background: none; border: 0; color: var(--muted); font-size: 10.5px; font-weight: 600; padding: 6px 0; cursor: pointer; min-width: 0; }
  .bar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bar button svg { width: 22px; height: 22px; }
  .bar button[aria-current="page"] { color: var(--ink); }
  .bar .fab { width: 52px; height: 52px; border-radius: 18px; background: var(--flame); color: var(--on-flame); place-items: center; justify-self: center; box-shadow: 0 10px 28px -10px rgba(255, 120, 50, .9); padding: 0; }
  .bar .fab svg { width: 24px; height: 24px; }
  .crow, .arow { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 12px; padding: 13px; }
  .crow .av { width: 40px; height: 40px; grid-row: span 2; }
  .arow .av { grid-row: span 2; }
  .crow .chip, .arow .chip { grid-column: 2; grid-row: 2; }
  .crow .c-num, .arow .c-num { grid-column: 3; grid-row: 1 / span 2; }
  .crow > svg, .arow > svg { display: none; }
  .a-errmsg { grid-column: 1 / -1; }
  .mrow, .mrow.no-client, .mrow.flow, .mrow.flow.no-client { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 2px; }
  .mrow.head { display: none; }
  .mrow .d { grid-column: 1; grid-row: 1; font-family: var(--mono); font-size: 11px; color: var(--muted); }
  .mrow .who { grid-column: 1; grid-row: 2; font-weight: 600; }
  .mrow .ty { grid-column: 2; grid-row: 1; justify-self: end; }
  .mrow .amt { grid-column: 2; grid-row: 2; }
  .mrow .note { grid-column: 1 / -1; white-space: normal; font-size: 13px; }
  .mrow .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .mrow.no-client .note { grid-row: 2; grid-column: 1; }
  .prow { grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 10px; }
  .prow.head { display: none; }
  .prow .sym { grid-column: 1; grid-row: 1 / span 2; }
  .prow .side { grid-column: 2; grid-row: 1; }
  .prow .vol { grid-column: 2; grid-row: 2; }
  .prow .po, .prow .pc { display: none; }
  .prow .pl { grid-column: 3; grid-row: 1 / span 2; }
  .drow { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 2px 10px; }
  .drow.head { display: none; }
  .drow .tm { grid-column: 1; grid-row: 1 / span 2; align-self: start; padding-top: 2px; }
  .drow .sym { grid-column: 2; grid-row: 1; }
  .drow .amt { grid-column: 3; grid-row: 1; }
  .drow .side { grid-column: 2; grid-row: 2; }
  .drow .vol { grid-column: 3; grid-row: 2; font-size: 12px; color: var(--muted); }
  .drow.trade .vol::after { content: " lotes"; }
  .clrow { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .clrow.head { display: none; }
  .clrow .p { grid-column: 1; grid-row: 1; font-weight: 600; }
  .clrow .st { grid-column: 2; grid-row: 1; justify-self: end; }
  .clrow .g { grid-column: 1; grid-row: 2; text-align: left; }
  .clrow .cm { grid-column: 2; grid-row: 2; }
  .clrow .fc { grid-column: 1 / -1; text-align: left; font-size: 13px; color: var(--ink-2); }
  .info { grid-template-columns: minmax(0, 1fr); }
  .info div:nth-child(2) { border-top: 1px solid var(--line); }
  .com { grid-template-columns: minmax(0, 1fr); }
  .modal { place-items: end center; padding: 0; }
  .sheet { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
  .sheet.sm { width: 100%; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .radios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .top-r .sync { max-width: 46vw; }
  .sync-l { display: none; }
  /* touch targets >= 40 px on phones */
  .top-r { gap: 10px; }
  .icon-btn { width: 44px; height: 44px; }
  .btn.sm { min-height: 42px; }
  .seg button { min-height: 40px; }
  .link, .back { min-height: 40px; display: inline-flex; align-items: center; }
  .copy-mini { min-height: 32px; padding: 6px 10px; }
  .mrow .who { padding-block: 9px; }            /* keeps the ellipsis of long names */
  .ccard-h .who { padding-block: 7px; }
  .cal-note .link { min-height: 0; display: inline; }   /* link inside running text */
  .acard-h .acts, .mrow .acts { gap: 10px; }
  .acc-det summary { min-height: 40px; display: flex; align-items: center; }
  .cm-row { min-height: 44px; }
  /* labels that the hidden table heads give on wide screens */
  .ph { display: inline; color: var(--muted); font-size: 12px; }
  .prow .vol::after { content: " lotes"; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px; }
  .kpi:nth-child(n) { border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(-n+2) { border-top: 0; }
  .d-actions .btn { flex: 1 1 auto; }
  .brand span { display: none; }
  .card { padding: 16px; }
  .ccard { padding: 14px; }
  .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar > select, .toolbar > .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; } }
