/* Calma: warm paper, deep green ink, soft cards. Fraunces for the name and headings, Inter for text.
   Light theme only. Sell-coloured (terracotta) only marks a warning or a sell level. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-weight: 400; font-size: 16px; line-height: 1.45; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0 0 .4em; }
img { max-width: 100%; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--buy); outline-offset: 2px; }

.wordmark { display: flex; flex-direction: column; line-height: 1.1; }
.wordmark-name { font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: -.5px; }
.wordmark-tag { font-size: 13px; color: var(--muted); margin-top: 2px; }

.card, .box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }

.field { margin: 0 0 14px; }
.field label, .field-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font: inherit; }
.field.has-error input, .field.has-error .pw { border-color: var(--sell); }
/* Money box: the currency sign lives inside the box, the amount is left-aligned. */
.money { display: flex; align-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.money:focus-within { outline: 3px solid var(--buy); outline-offset: 2px; }
.money input[type="text"] { flex: 1; min-width: 0; border: 0; background: transparent;
  min-height: 42px; text-align: left; outline: none; }
.money.sign-after input[type="text"] { padding-right: 4px; }
.money.sign-before input[type="text"] { padding-left: 4px; }
.money.sign-before .money-sign { padding-right: 3px; }
.money-sign { color: var(--muted); padding: 0 12px; flex: none; pointer-events: none; user-select: none; }
.field.has-error .money { border-color: var(--sell); }
/* Count box (shares sold): like the money box, the suffix ("de 5") inside on the right; a press on it lands in the box. */
.count-box { display: flex; align-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.count-box:focus-within { outline: 3px solid var(--buy); outline-offset: 2px; }
.count-box input[type="text"] { flex: 1; min-width: 0; border: 0; background: transparent; min-height: 42px; padding-right: 4px; text-align: left; outline: none; }
.count-of { color: var(--muted); padding: 0 12px; flex: none; pointer-events: none; user-select: none; white-space: nowrap; }
.field.has-error .count-box { border-color: var(--sell); }
/* The line above "Guardar venta" that follows the number sold. */
.sold-left { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.field-error { color: var(--ink); font-size: 13px; margin-top: 4px; border-left: 3px solid var(--sell); padding-left: 8px; }
.field .field-head { margin-bottom: 4px; }   /* a label with a "?" beside it, not inside it: a tap on the "?" must not reach the input */
.field .field-head label { display: inline; margin: 0; }
/* The "?" of a field head keeps its 44 px tap area but does not reach down over the box under it (4 px margin): 18 px more above. */
.field-head .tip-q::after { top: -18px; bottom: -4px; }
.field-hint { font-size: 13px; margin-top: 4px; color: var(--muted); }

.btn { display: block; width: 100%; min-height: 44px; padding: 12px; border: 1px solid var(--ink); border-radius: 8px; font: inherit; font-weight: 600; font-size: 15px; text-align: center; cursor: pointer; text-decoration: none; }
.btn.ink { background: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.warn { background: var(--card); color: var(--ink); border-color: var(--sell); }
.btn:disabled { opacity: .5; cursor: default; }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }
a.btn { line-height: 1.25; }

.banner { border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: 8px; background: var(--card); padding: 8px 12px; font-size: 14px; margin: 10px 0; }
.banner.ok { border-left-color: var(--buy); background: var(--tip); }
.banner.warn { border-left-color: var(--sell); }
.banner a { font-weight: 600; }

.sheet-scrim { position: fixed; inset: 0; background: rgba(31, 61, 54, .4); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.sheet { background: var(--paper); border-radius: 16px 16px 0 0; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; padding: 16px; }
.sheet:focus { outline: none; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.sheet-head h2 { margin: 6px 0 0; font-size: 24px; line-height: 1.1; overflow-wrap: anywhere; }
.sheet-x { flex: none; background: none; border: 0; font-size: 26px; line-height: 1; min-width: 44px; min-height: 44px; cursor: pointer; color: var(--ink); }
.sheet-sub { margin: 4px 0 14px; font-size: 14px; color: var(--muted); }

.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.toast-x { background: none; border: 0; font-size: 22px; line-height: 1; min-width: 44px; min-height: 44px; cursor: pointer; color: var(--ink); }

.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* The "?" explanation: a small round button, and its text on the soft green. */
.tip-wrap { display: inline; }
/* ui.WithTip: the last word and its "?" stay on one line. */
.tip-last { white-space: nowrap; }
.tip-q { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: 6px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--tip); color: var(--ink); font: 700 12px var(--sans); cursor: pointer; vertical-align: middle; position: relative; }
/* The look stays 22 px; the tap area is 44x44 (12 px past the padding box on every side), no layout change. */
.tip-q::after { content: ""; position: absolute; inset: -12px; }
/* In the desktop table a header "?" sits at the cell edge: keep the area inside the 9 px cell padding so the scroll box does not grow. */
.stable .tip-q::after { inset: -12px -8px; }
.tip-q[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
/* The open "?" bubble (ui.Tip): fixed and placed from JS; it resets what a table header or label would hand down. */
.tip { position: fixed; left: 0; top: 0; z-index: 45; box-sizing: border-box; width: max-content; max-width: min(300px, calc(100% - 16px)); padding: 10px 12px; border-radius: 10px; background: var(--ink); color: #fff; font: 400 13px/1.45 var(--sans); text-align: left; white-space: normal; letter-spacing: normal; text-transform: none; box-shadow: 0 6px 20px rgba(31, 61, 54, .22); }
.tip::before { content: ""; position: absolute; top: -5px; left: calc(var(--arrow, 50%) - 6px); width: 12px; height: 12px; background: var(--ink); transform: rotate(45deg); }
.tip.above::before { top: auto; bottom: -5px; }
.tip-scroll { display: block; overflow-y: auto; overscroll-behavior: contain; }
.tip-title { display: block; margin-bottom: 6px; font-weight: 700; }
.tip-steps { margin: 0; padding-left: 18px; }
.tip-steps li + li { margin-top: 4px; }

/* Sign-in screens (auth-app.js): one phone-width column, the name on top. */
.auth { max-width: 420px; margin: 0 auto; padding: 16px 16px 40px; }
.auth-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.lang { display: flex; flex: none; border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: hidden; }
.lang button { min-width: 44px; min-height: 44px; padding: 0 8px; border: 0; background: transparent; color: var(--ink); font: 600 14px var(--sans); letter-spacing: .04em; cursor: pointer; }
.lang button + button { border-left: 1px solid var(--line); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.auth-main { padding-top: 24px; }
.auth-title { margin: 0; font-size: 28px; line-height: 1.15; }
.lede { margin: 10px 0 0; font-size: 15px; color: var(--muted); }
.auth-main .banner { margin: 16px 0 0; }
.auth-form { margin-top: 18px; }
.auth-form > .btn { margin-top: 8px; }
.auth-actions { margin-top: 18px; display: grid; gap: 10px; }
.remember-hint { margin: -4px 0 12px 32px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.alert-list { margin: 4px 0 0 32px; padding: 0; font-size: 14px; color: var(--muted); }
.check input { width: 22px; height: 22px; accent-color: var(--ink); }
.auth input[readonly] { background: transparent; }
.pw { display: flex; border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: hidden; }
.pw input { flex: 1; min-width: 0; border: 0; border-radius: 0; }
.pw input:focus-visible { outline: none; }
.pw:focus-within { outline: 3px solid var(--buy); outline-offset: 2px; }
.pw button { flex: none; min-width: 76px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 14px var(--sans); cursor: pointer; }
.meter { display: flex; gap: 4px; margin-top: 8px; }
.meter i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.meter i.on { background: var(--muted); }
.meter.full i { background: var(--buy); }
.reqs { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--muted); }
.reqs li { display: flex; align-items: center; gap: 6px; }
.reqs em { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1px solid var(--line); border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 700; line-height: 1; }
.reqs li.ok { color: var(--ink); }
.reqs li.ok em { background: var(--buy); border-color: var(--buy); color: var(--card); }
.auth-links { margin-top: 10px; }
.auth-links a { display: inline-block; padding: 11px 0; font-weight: 600; }
.auth-foot { margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* Signed-in app: top bar, then the screen. */
.app { max-width: 1180px; margin: 0 auto; padding: 0 16px 96px; }   /* room for the feedback bubble (52 + 16 + 16 and some) */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.brand-link { text-decoration: none; color: var(--ink); }
/* The menu goes beside the wordmark when it fits on one line there, else onto its own row (flex wraps it as a whole: its
   basis is its one-line width); on its own row it shrinks to the screen and its tabs wrap only below 360 px. */
.topnav { display: flex; gap: 4px; flex: 1 1 auto; flex-wrap: wrap; }
.topnav a { padding: 10px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 15px; color: var(--muted); }
.topnav a.on { color: var(--ink); background: var(--tip); }
.topbar-end { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.linkbtn { background: none; border: 0; padding: 10px 4px; min-height: 44px; font: 600 14px var(--sans); color: var(--ink); text-decoration: underline; cursor: pointer; }
.main { padding-top: 22px; }
.app-foot { margin: 40px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }   /* "Valor suggests; the decision … is yours", under every page */
.inline-action { max-width: 240px; margin-top: 12px; }
.lede { color: var(--muted); }

/* Results */
/* The title and summary on the left, the search box top right (on a phone it wraps under the summary). */
.rhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 20px; margin-bottom: 14px; }
.rhead > div:first-child { flex: 1 1 auto; min-width: 0; }
.rtitle { margin: 0; font-size: 26px; line-height: 1.15; }
.rsub { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
/* The plain line above the stocks (which come first, what to do). */
.rintro { margin: 4px 0 12px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font: 400 13.5px var(--sans); color: var(--ink); }
.chip-adjust { min-height: 44px; padding: 4px 18px; border-color: var(--ink); font-weight: 600; cursor: pointer; }
/* Puedo comprar · Demasiado caro · Todas: one row, each label wraps over its count on a narrow phone rather than overflow. */
.showsw { max-width: 520px; margin: -6px 0 18px; }
.showsw button { flex: 1 1 auto; min-height: 44px; padding: 4px 10px; letter-spacing: normal; line-height: 1.2; }
.showsw-n { font-weight: 400; opacity: .8; }
/* The row right above the list: the switch on the left (or its search-time wrapper with the paused line), the view
   button at the right end, both top-aligned; with no switch the button is alone at the right. */
.listbar { display: flex; align-items: flex-start; gap: 8px; margin: -6px 0 18px; }
.listbar > :not(.viewbtn) { flex: 0 1 520px; min-width: 0; }
.listbar .showsw { margin: 0; }
.listbar .paused-line { margin: 8px 0 -4px; }
/* The cards or the table: one outlined icon, never filled (it is no filter), named for the view it switches to; the
   name shows in a small dark bubble under it with a mouse, and on keyboard focus. */
.viewbtn { flex: none; margin-left: auto; position: relative; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); cursor: pointer; }
.viewbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.viewbtn-tip { display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 5; width: max-content; padding: 6px 9px; border-radius: 8px; background: var(--ink); color: #fff; font: 400 13px/1.3 var(--sans); white-space: nowrap; pointer-events: none; box-shadow: 0 6px 20px rgba(31, 61, 54, .22); }
.viewbtn:focus-visible .viewbtn-tip { display: block; }
@media (hover: hover) { .viewbtn:hover { border-color: var(--line-strong); } .viewbtn:hover .viewbtn-tip { display: block; } }   /* a tap on a phone leaves neither behind */
/* The search box in Resultados, top right beside the title: one wrapper holds the line magnifier, the input and the
   clear button, with the other controls' thin border, 40 px high (44 on a phone, below); the focus ring goes round the
   wrapper, not inside it. The ✕ fills the box's right end, over its border. */
.rhead .sbar { flex: 0 0 320px; }
.sbar-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sbar-box { display: flex; align-items: center; height: 40px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.sbar-box:hover { border-color: var(--line-strong); }
.sbar-box:focus-within { outline: 3px solid var(--buy); outline-offset: 2px; }
.sbar-icon { flex: none; width: 16px; height: 16px; margin-left: 12px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.sbar-box input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0 8px; font: 400 15px var(--sans); color: var(--ink); }
.sbar-box input::placeholder { color: var(--muted); opacity: 1; }
.sbar-box input:focus-visible { outline: none; }
.sbar-clear { flex: none; width: 40px; height: 40px; margin: -1px -1px -1px 0; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.sbar-clear svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.sbar-clear:hover svg { stroke: var(--ink); }
.sbar-clear:focus-visible { outline: none; background: var(--tip); }
@media (max-width: 700px) {
  .rhead { flex-wrap: wrap; }
  .rhead .sbar { flex: 1 1 100%; }
  .sbar-box { height: 44px; }
  .sbar-box input { font-size: 16px; }   /* under 16 px, iPhone Safari zooms the page in when the box is tapped */
  .sbar-clear { width: 44px; height: 44px; }
}
.showsw.paused { opacity: .45; }
.paused-line { margin: -10px 0 14px; color: var(--muted); font-size: 14px; }
.others { margin-top: 22px; }
.others .paused-line { margin: 12px 0 0; }
.others h2 { margin: 0 0 10px; font-size: 18px; }
/* A card outside the list: the list's card padding, in the same columns (.cards); its lines stay at the top. */
.ocard { display: grid; gap: 8px; align-content: start; padding: 16px; overflow-wrap: anywhere; }
.ocard p { margin: 0; font-size: 15px; line-height: 1.4; }
.ocard .scard-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.ocard .scard-name { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.ocard-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.otag { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); font: 400 13px var(--sans); }
.fnote { border-left: 3px solid var(--buy); background: var(--tip); border-radius: 0 8px 8px 0; padding: 10px 12px; display: grid; gap: 6px; font-size: 14px; overflow-wrap: anywhere; }
.fnote p { margin: 0; }
.fnote-title { font-weight: 600; }
.sheet-actions { display: grid; gap: 10px; margin-top: 8px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.scard { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.scard-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.scard-name { display: flex; flex-direction: column; text-decoration: none; min-width: 0; }
.tkr { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.co { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard-close { font-weight: 600; font-size: 17px; white-space: nowrap; }
/* The "›" after a ticker says it opens the stock's page; on a computer the ticker underlines under the mouse. */
.tkr-row { display: inline-flex; align-items: baseline; gap: 4px; }
.chev { color: var(--muted); font: 600 .9em var(--sans); line-height: 1; }
@media (hover: hover) {
  .scard-name:hover .tkr, .stable .stk a:hover .tkr, .lrow .top a:hover .tkr { text-decoration: underline; text-underline-offset: 3px; }
  .sparklink:hover { background: var(--tip); }
}
/* A Resultados card's small price line opens the stock's page (no caption under it: Carlos, 2026-11-08). */
.sparklink { display: block; margin: 0 -6px; padding: 4px 6px 2px; border-radius: 8px; color: inherit; text-decoration: none; }
.spark { display: block; width: 100%; height: 60px; }
.spark-empty { background: var(--tip); border-radius: 8px; }
.spark-line { fill: none; stroke: var(--ink); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.spark-buy, .spark-sell { stroke-width: 1.4; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.spark-buy { stroke: var(--buy); }
.spark-sell { stroke: var(--sell); }
.clines { display: grid; gap: 8px; }
.cline-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.cline-label { font-size: 14.5px; }
.cline-value { font-size: 16px; white-space: nowrap; }
.cline.buy .cline-value { color: var(--buy); }
.cline.sell .cline-value { color: var(--sell); }
.cline.warn .cline-label { color: var(--ink); border-left: 3px solid var(--sell); padding-left: 8px; display: block; }
.cline-note { font-size: 13px; color: var(--muted); margin-top: 2px; }
/* Valor's suggestion: one tinted box under the two levels, the share count large (results.js SuggestBox). */
.sbox { background: var(--tip); border-radius: 10px; padding: 12px; display: grid; gap: 4px; }
.sbox-head { font-size: 14px; }
.sbox .tip-q:not([aria-expanded="true"]) { background: var(--card); } /* --tip (a not-yet box: --paper) is the box's own colour */
.sbox-count { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.15; }
.sbox-cost { font-size: 14px; }
.sbox-each { white-space: nowrap; }
.sbox-loss { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
/* "Now" or "not yet" (mockup C): above its buy price a green tag on top; not there yet the box is grey and dashed */
.sbox-tag { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; font-weight: 600; color: var(--buy); }
/* the dot stays beside the first line when the tag wraps (a 390 px phone) */
.sbox-tag::before { content: ""; flex: none; width: 9px; height: 9px; margin-top: .45em; border-radius: 50%; background: var(--buy); }
.sbox.wait { background: var(--paper); border: 1px dashed var(--line-strong); }
.sbox.wait .sbox-count { color: var(--muted); }
.sbox-gap { font-size: 13px; color: var(--muted); }
.sbox-loss .cline-label { font-size: 14px; } /* the box's padding takes 24 px: this keeps the line whole on a 290 px card */
.stale { font-size: 13px; color: var(--muted); }
.scard-foot { margin-top: auto; }
.watch { min-height: 44px; width: 100%; border: 1px solid var(--ink); border-radius: 8px; background: transparent; color: var(--ink); font: 600 15px var(--sans); cursor: pointer; }
.watch.on { background: var(--ink); color: var(--paper); }

.table-wrap { position: relative; overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.stable { width: 100%; border-collapse: collapse; font-size: 14.5px; text-align: right; white-space: nowrap; }
.stable th, .stable td { padding: 10px 9px; border-bottom: 1px solid var(--line); font-weight: 400; vertical-align: middle; }
.stable thead th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.stable th.left, .stable td.left { text-align: left; }
.stable tbody tr:last-child > * { border-bottom: 0; }
.stable a { text-decoration: none; }
.stable .tkr { font-size: 16px; }
.stable .seg { position: sticky; left: 0; z-index: 1; width: 60px; min-width: 60px; background: var(--card); text-align: center; }
.stable .stk { position: sticky; left: 60px; z-index: 1; background: var(--card); }
.stable .stk a { display: flex; flex-direction: column; }
.stable .co { display: block; max-width: 170px; }
.shares-cell { display: flex; flex-direction: column; align-items: flex-end; }
.shares-cell small { color: var(--muted); font-size: 12.5px; }
.star { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 1.5px solid var(--ink); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.star svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.star.on { background: var(--ink); color: var(--paper); }
.star.on svg { fill: currentColor; }
.star:focus-visible { outline: 3px solid var(--buy); outline-offset: 2px; }
.sortbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; min-height: 24px; }
.stable .cell-note { display: inline-block; max-width: 150px; white-space: normal; text-align: left; font-size: 13px; }

/* Results on a phone: "Ordenar por" and the list. */
.sortbar { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; }
.sortbar select { font: 600 16px var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; height: 44px; min-width: 0; width: auto; flex: 1 1 auto; }
.sortbar label, .sortbar .dir { flex: none; }
.sortbar label { white-space: nowrap; }
.sortbar .dir { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 16px; cursor: pointer; }
ol.slist { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.lrow { display: grid; grid-template-columns: 44px 1fr 12px; gap: 8px; padding: 10px 8px 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.lrow .rchev { align-self: center; color: var(--muted); font: 600 20px/1 var(--sans); }
.lrow:last-child { border-bottom: 0; }
.lrow > div { min-width: 0; }
.lrow .star { position: relative; width: 44px; height: 44px; border: 0; border-radius: 0; background: transparent; color: var(--ink); }
.lrow .star::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 1.5px solid var(--ink); }
.lrow .star svg { position: relative; }
.lrow .star.on { background: transparent; color: var(--paper); }
.lrow .star.on::before { background: var(--ink); }
.lrow .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 14.5px; }
.lrow .top a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
.lrow .top .co { font-size: 13.5px; }
.lrow .px { font-weight: 600; white-space: nowrap; }
.lrow .tkr { font-size: 16px; }
.lrow .stale { font-size: 12px; color: var(--muted); margin-top: 2px; }
.lrow dl.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 8px; margin: 6px 0 0; }
.lrow dl.facts.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lrow dl.facts > div { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.lrow dt { color: var(--muted); font-size: 11.5px; }
.lrow dd { margin: 0; font-size: 13.5px; font-weight: 600; }
.lrow dd small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.lrow dd.warn { font-weight: 500; font-size: 12.5px; color: var(--ink); border-left: 3px solid var(--sell); padding-left: 8px; }
.lrow dd a { color: inherit; }
.lrow .sorted dt { color: var(--ink); font-weight: 600; }

@media (max-width: 700px) {
  .cards { grid-template-columns: 1fr; }
  .rtitle { font-size: 22px; }
  /* The four Spanish tabs on one line from 360 px wide, with less side padding and gap, the same height. Measured with
     the real Inter 600 15 px the four labels are 298 px of text: with 6 px sides and 2 px gaps they need 352 px, so they
     fit from 390 px wide (narrower: below). On a phone that is too wide to sit beside the wordmark, so the menu takes the
     row under it, and "Salir" the row under that, on the right; wider, they share rows as they fit. */
  .topnav { gap: 2px; }
  .topnav a { padding: 10px 6px; }
}
/* Below 390 px wide 15 px text can't fit (328 px inside at 360): 14 px with 5 px sides needs 325 px; the height stays 42. */
@media (max-width: 389px) {
  .topnav a { padding: 10px 5px; font-size: 14px; line-height: 22px; }
}

/* One stock (stock.js, chart.js). */
.stockpage { display: grid; gap: 16px; }
.stockpage .back { margin: 0; font-size: 14px; }
.co-big { color: var(--muted); font: 400 17px var(--sans); }
.box-pad { padding: 16px; }
.box-title { margin: 0 0 8px; font-size: 20px; }
.chart-card { padding: 8px; }
.chart { display: block; width: 100%; height: auto; font: 12px var(--sans); }
.ch-grid line { stroke: var(--line); stroke-width: 1; }
.ch-grid text { fill: var(--muted); }
.ch-up line, .ch-down line { stroke-width: 1.4; }
.ch-up line { stroke: var(--buy); } .ch-up rect { fill: var(--buy); }
.ch-down line { stroke: var(--sell); } .ch-down rect { fill: var(--sell); }
.ch-line line { stroke-width: 1.6; stroke-dasharray: 6 4; }
.ch-line text { font-weight: 600; }
.ch-line .ch-price { font-weight: 400; }
.ch-buy line { stroke: var(--buy); } .ch-buy text { fill: var(--buy); }
.ch-sell line { stroke: var(--sell); } .ch-sell text { fill: var(--sell); }
.ch-today line { stroke: var(--muted); stroke-dasharray: 2 3; } .ch-today text { fill: var(--ink); }
.ch-peak circle, .ch-dip circle { fill: var(--card); stroke-width: 2; }
.ch-peak circle { stroke: var(--ink); } .ch-peak text { fill: var(--ink); font-weight: 600; }
.ch-peak.ath circle { fill: var(--ink); }
.ch-dip circle { stroke: var(--sell); } .ch-dip text { fill: var(--muted); font-weight: 600; }
/* A price tag may sit over a candle edge where nothing next to its marker is clear: an outline in the card's colour keeps it readable. */
.ch-peak text, .ch-dip text { paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
/* Where the spot beside a marker is crowded, its tag sits further out with a thin line to it. */
.ch-leader { stroke: var(--muted); stroke-width: 1; }
.ch-wave path { fill: none; stroke: var(--muted); }
.ch-wave text { fill: var(--muted); }
.stock-lines { display: grid; gap: 10px; }
.facts { margin: 0; display: grid; gap: 8px; }
.fact { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fact dt { color: var(--muted); font-size: 14.5px; }
.fact dd { margin: 0; font-weight: 600; }
.how-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; line-height: 1.45; }
.how-note { margin: 0; font-size: 15px; }
.how-note.warn { margin-top: 8px; border-left: 3px solid var(--sell); padding-left: 8px; }
.held { border: 2px solid var(--ink); background: var(--tip); display: flex; flex-direction: column; gap: 10px; }
.held.reached { border-color: var(--sell); }
.held-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.held-head .box-title { margin: 0; }
.held-buy { display: flex; flex-direction: column; gap: 10px; }
.held .mrow-history { background: var(--card); }   /* the box is already tip-coloured */
.held-mine { margin: 0; font-size: 14.5px; }
.more-title { font-size: 17px; }
.more-tag { font-family: var(--sans); font-size: 13px; font-weight: 400; color: var(--muted); }
.stock-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stock-actions .btn, .stock-actions .watch { width: 100%; }
.stock-actions > :only-child { grid-column: 1 / -1; }   /* one action ("Compré más", or "Seguir" alone): the whole row */
.bought-note { margin: 0 0 12px; }
@media (max-width: 700px) { .stock-actions { grid-template-columns: 1fr; } }
.chart-box { width: 100%; }
.ch-legend { list-style: none; margin: 6px 4px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.ch-legend li { display: flex; align-items: center; gap: 6px; }
.ch-legend i { width: 16px; border-top: 2px dashed currentColor; }
.ch-legend .ch-buy { color: var(--buy); } .ch-legend .ch-sell { color: var(--sell); } .ch-legend .ch-today { color: var(--muted); }
.ch-legend b { color: var(--ink); }
.ch-caption { margin: 4px 6px 4px; font-size: 13px; color: var(--muted); }

/* My stocks, Your money, Settings, People */
.minepage, .moneypage, .settingspage, .peoplepage { display: grid; gap: 16px; max-width: 1180px; }
.settingspage, .peoplepage { max-width: 560px; }
.minepage .rtitle, .moneypage .rtitle, .settingspage .rtitle, .peoplepage .rtitle { margin: 0; }
.minepage .rsub, .moneypage .rsub, .settingspage .rsub, .peoplepage .rsub { margin: -10px 0 0; }
.msec { margin: 8px 0 0; font-size: 20px; }
.minepage .showsw { margin: 0; }   /* Siguiendo's switch: the page grid's gap spaces it */
/* Tu dinero: the money card, then Tus límites; side by side from 900 px wide (two equal columns, money card left). */
.money-cols { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .money-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.limits .box-title { margin: 0 0 2px; }
.limits-sub { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
/* What Valor uses now when the portfolio has lost value (RAD-55), the two amounts bold. */
.risk-used { margin: 8px 0 14px; border-left: 3px solid var(--buy); background: var(--tip); border-radius: 0 8px 8px 0; padding: 9px 11px; font-size: 14px; }
.risk-used b { white-space: nowrap; }
/* The money card: label left, amount right, the two totals bold over a rule (dashed for the cash left, solid for the
   portfolio today). Capped at 520 px below 900 px (one column, so the amounts stay near their labels, inside .money-cols
   too); from 900 px it fills its half of .money-cols, which is already narrow. */
.moneybox { max-width: 520px; }
@media (min-width: 900px) { .moneybox { max-width: none; } }
.money-lines { margin: 0; display: grid; gap: 4px; font-size: 15px; }
.money-line { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.money-line dt { min-width: 0; }
.money-line dd { margin: 0; white-space: nowrap; text-align: right; }
.money-line.total { font-weight: 700; border-top: 1px dashed var(--line); padding-top: 4px; }
.money-line.total.today { border-top-style: solid; }
/* "Corregir" beside "Empezaste con": a small outlined button with a pencil, so it never reads as part of the label (Carlos,
   2026-11-08: "Empezaste con Corregir" read as one sentence). The pencil is drawn by CSS, so the text stays "Corregir". The
   look is 30 px high; the ::after makes the tap area 44 px high without making the row taller. */
.money-fix { position: relative; display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; margin-left: 8px; min-height: 30px;
  padding: 2px 12px; border: 1px solid var(--ink); border-radius: 999px; background: var(--card); font: 600 13px var(--sans); color: var(--ink); cursor: pointer; }
.money-fix::before { content: "\270E"; font-size: 14px; line-height: 1; }
.money-fix::after { content: ""; position: absolute; inset: -7px 0; }
.money-fix:hover { background: var(--tip); }
.money-excess { margin: 10px 0 0; font-size: 14px; border-left: 3px solid var(--sell); padding-left: 8px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.mrow { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
/* Ya vendidas: one folded line at the very bottom of Mis acciones (44 px high), opened onto small cards like the held ones. */
.sold-list { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.sold-fold { align-self: stretch; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: 700 15px var(--sans); text-align: left; cursor: pointer; }
.sold-intro { margin: 0; }
.sold-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.mrow.reached { border-left: 4px solid var(--sell); }
.mrow-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mrow-line { margin: 0; font-size: 14.5px; }
.mrow-line.sell { color: var(--sell); }
.mrow-line.strong { font-weight: 600; }
/* A held stock's purchases and sales, behind "▸ 2 compras" (44 px tap height). */
.mrow-fold { align-self: flex-start; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--ink); font: 600 14px var(--sans); text-decoration: underline; cursor: pointer; }
.mrow-history { margin: 0; padding: 8px 10px; background: var(--tip); border-radius: 8px; font-size: 13.5px; display: grid; gap: 4px; list-style: none; }
/* Each line ends with its "Corregir", Tu dinero's outlined pencil button (.money-fix), on the right; a long line wraps
   beside it. The line is 44 px high, so the button's 44 px tap area (its ::after) stays inside it; on a phone the button
   itself is 44 px high. */
.mrow-history li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 44px; }
.mrow-history .hist-line { flex: 1 1 170px; min-width: 0; }
.mrow-history .money-fix { margin-left: auto; }
@media (max-width: 700px) {
  .mrow-history .money-fix { min-height: 44px; }
  .mrow-history .money-fix::after { content: none; }
}
.mrow-actions { display: grid; gap: 8px; margin-top: auto; }
.mrow-actions.two { grid-template-columns: 1fr 1fr; }
.mrow-actions .btn { padding: 10px 8px; }
.badge-sell { flex: none; padding: 3px 10px; border: 1px solid var(--sell); border-radius: 999px; font-size: 13px; font-weight: 600; }
.sub { color: var(--muted); font-size: 13px; font-weight: 400; }
.gain { color: var(--buy); } .loss { color: var(--sell); }
.settings-form > .btn { margin-top: 8px; }
.settings-lang .lang { margin-top: 4px; width: max-content; }
.settings-lang .lang button { padding: 0 16px; }
.invite-form > .btn { margin-top: 4px; }
.plist { list-style: none; margin: 0; padding: 0; }
.prow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.prow:first-child { border-top: 0; }
.prow-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.prow-actions { display: flex; gap: 8px; }
.prow-actions .btn { width: auto; min-width: 96px; padding: 8px 14px; }
.prow-confirm { flex-basis: 100%; }
.prow-confirm p { margin: 0 0 8px; font-size: 14.5px; }
@media (max-width: 420px) { .mrow-actions.two { grid-template-columns: 1fr; } }

/* Starting steps */
.startpage { display: grid; gap: 16px; max-width: 560px; }
.stepbar { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.stepbar li { font-size: 12px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); }
.stepbar li.done { background: var(--tip); color: var(--buy); }
.stepbar li.now { background: var(--ink); color: var(--card); border-color: var(--ink); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.start-card { display: grid; gap: 14px; }
.start-card .rsub { margin: -8px 0 0; }
.start-fields { display: grid; gap: 14px; }
.start-tip { margin: 0; background: var(--tip); border-radius: 8px; padding: 10px 12px; }
.start-tip.risk-warn { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--sell); }
.risk-note { margin: 0; }
.risk-raise { display: inline-block; width: auto; min-height: 44px; margin-top: 6px; padding: 8px 14px; }
.start-actions { display: flex; justify-content: space-between; gap: 10px; }
.start-actions > :only-child, .start-actions > :last-child { margin-left: auto; }
.start-actions .btn { width: auto; min-width: 96px; }
.topbar.steps .topbar-end { width: auto; margin-left: auto; }

/* Feedback bubble and sheet (feedback.js). The bubble sits under the "?" popover (45), the scrim (50) and the toast (60). */
.fb-fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40; width: 52px; height: 52px; padding: 0; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); box-shadow: 0 4px 14px rgba(31, 61, 54, .28); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fb-fab svg { width: 24px; height: 24px; display: block; }
.fb-fab:focus-visible { outline: 3px solid var(--buy); outline-offset: 2px; }
body:has(.sheet-scrim) .fb-fab { display: none; }
@media print { .fb-fab { display: none; } }
.fb-kinds { display: flex; border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: hidden; }
.fb-kinds .fb-kind { position: relative; flex: 1; margin: 0; display: flex; }   /* beats .field label (margin-bottom 4px, display block) */
.fb-kind + .fb-kind { border-left: 1px solid var(--line); }
.fb-kind input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.fb-kind span { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 4px 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
.fb-kind.on span { background: var(--ink); color: var(--paper); }
.fb-kind input:focus-visible + span { outline: 3px solid var(--buy); outline-offset: -3px; }
.fb-thumbs { list-style: none; display: flex; gap: 12px; margin: 22px 0 0; padding: 0; }   /* the 44 px remove buttons stick out 12 px above the pictures */
.fb-thumbs li { position: relative; }
.fb-thumbs img { display: block; width: 84px; height: 84px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; }
.fb-thumb-x { position: absolute; top: -12px; right: -12px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink); }

/* A held stock over its limits, or grown (Task 6): the over lines, one suggestion, the calm note for a winner. */
.held-status { display: grid; gap: 10px; margin: 12px 0 4px; }
.held-over { border-left: 3px solid var(--sell); background: var(--sell-pale); border-radius: 6px; padding: 8px 10px; display: grid; gap: 6px; font-size: 14px; }
.held-over p, .held-grown p, .held-suggest p, .held-why { margin: 0; }
.settings-form .held-over { margin: 0 0 14px; }
.held-why { font-size: 13px; color: var(--muted); }
.held-suggest { background: var(--tip); border-radius: 10px; padding: 12px; display: grid; gap: 6px; font-size: 14px; }
.held-suggest-title { margin: 0; font: 600 13px var(--sans); color: var(--ink); }
.held-checks { margin: 0; display: grid; gap: 4px; }
.held-checks > div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.held-checks dt, .held-checks dd { margin: 0; }
.held-checks dd { color: var(--buy); }
.held-suggest .held-keep { color: var(--muted); }
.held-grown { border-left: 3px solid var(--buy); background: var(--tip); border-radius: 0 8px 8px 0; padding: 10px 12px; display: grid; gap: 6px; font-size: 14px; }
/* Inside the held box (its own background is --tip) the boxes stay visible. */
.held .held-suggest, .held .held-grown { background: var(--card); }
.held .held-suggest { border: 1px solid var(--line); }

/* Tu dinero: the add / take out buttons, the dated list, and the sheets' "after" check */
.move-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.move-buttons .btn { padding: 8px 10px; font-size: 14px; }
.move-lbl { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.move-list { margin-top: 14px; }
.move-list ul { list-style: none; margin: 0; padding: 0; }
.move-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; padding: 4px 0; border-top: 1px dashed var(--line); }
.move-del { background: none; border: 0; padding: 10px 0 10px 8px; min-height: 44px; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.move-after { margin: 8px 0 10px; }
.move-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 3px 0; }
.move-row b { font-weight: 600; text-align: right; }
.move-row .was { color: var(--muted); font-weight: 400; margin-right: 6px; }
.move-tip { background: var(--tip); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-top: 8px; }
.move-tip p { margin: 0 0 6px; }
.move-over { margin-top: 8px; }
.move-after .move-calm { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.move-raise { width: auto; display: inline-block; margin-top: 8px; padding: 8px 12px; font-size: 14px; }
/* The Corregir sheet of a purchase or sale (fix.js): its rows are the "after" check's above; the green line of a card
   that comes back, the line of a card that ends, the after box's one line when no number changes, and the "Borrar esta
   compra" text button under Guardar (off while a save is on its way). Deleting is not a loss, so neither it nor the
   deletion's confirm button (the dark .btn.ink, as Tu dinero's "Borrar") is red: red means money (Carlos, RAD-152). */
.fix-split { margin: -6px 0 12px; }
.fix-back { margin: 8px 0; background: var(--tip); border: 1px solid var(--buy); border-radius: 8px; padding: 9px 11px; font-size: 14px; }
.fix-ends { margin: 8px 0; border-left: 3px solid var(--line-strong); padding-left: 8px; font-size: 14px; }
.fix-del { display: block; width: 100%; min-height: 44px; padding: 10px; border: 0; border-radius: 8px; background: none;
  font: 600 15px var(--sans); color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.fix-del:disabled { opacity: .5; cursor: default; text-decoration: none; }
.move-after .fix-nothing { margin: 0; font-size: 14px; }
.nosell { display: grid; gap: 8px; }
.nosell p { margin: 0; font-size: 15px; line-height: 1.4; }
.nosell-box { background: var(--tip); border: 1px solid var(--buy); border-radius: 8px; padding: 10px 12px; font-size: 15px; line-height: 1.4; }
