:root {
  --p: #0f4c5c; --p-hover: #0b3c49; --p-soft: #e7f1f3; --p-border: #bdd4da;
  --bg: #f4f6f6; --surface: #fff; --muted: #eef2f3; --line: #dbe3e5;
  --text: #142226; --text-2: #4f6269; --text-3: #6d7f86;
  --pos: #126b4a; --pos-bg: #e7f5ef; --neg: #b42318; --neg-bg: #fdecec; --neg-line: #f3c6c3;
  --warn: #8f5306; --warn-bg: #fef5e5; --warn-line: #f2d7a7;
  --r: 12px; --r-sm: 8px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.45; }
body { margin: 0; min-height: 100dvh; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* Header */
.fc-header { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.fc-header-in { max-width: 880px; margin: 0 auto; min-height: 52px; padding: 6px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.fc-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -0.01em; }
.fc-brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--p); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.fc-nav { display: none; gap: 2px; margin-left: 8px; }
.fc-nav a { padding: 8px 12px; border-radius: var(--r-sm); font-size: .9rem; font-weight: 600; color: var(--text-2); }
.fc-nav a:hover { background: var(--bg); }
.fc-nav a.on { color: var(--p); background: var(--p-soft); }
.fc-hours-actions { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 5; padding: 8px 0; background: var(--bg); }
.fc-header-end { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 6px; max-width: 100%; }
.fc-header-end .fc-header-equipo { display: none; }
@media (min-width: 880px) { .fc-header-end .fc-header-equipo { display: inline-flex; } }
.fc-quiet { min-height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-3); font-size: .82rem; font-weight: 600; display: inline-flex; align-items: center; }
.fc-quiet:hover { background: var(--bg); color: var(--text); }
.fc-offline { font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--muted); color: var(--text-2); white-space: nowrap; }

/* Page */
.fc-main { max-width: 600px; margin: 0 auto; padding: 16px 14px calc(88px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 18px; }
.fc-main.wide { max-width: 820px; }
.fc-title { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.fc-sub { margin: 2px 0 0; font-size: .85rem; color: var(--text-2); }
.fc-back { font-size: .85rem; font-weight: 600; color: var(--p); }
.fc-h2 { margin: 0; font-size: .9rem; font-weight: 700; }
.fc-note { margin: 0; font-size: .8rem; color: var(--text-2); }
.fc-empty { padding: 22px 16px; text-align: center; color: var(--text-2); font-size: .88rem; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); }

/* Context tabs */
.fc-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--muted); border-radius: var(--r); padding: 4px; gap: 4px; }
.fc-tab { min-height: 44px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; font-size: .95rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.fc-tab[aria-selected="true"] { background: var(--surface); color: var(--p); box-shadow: 0 0 0 1px var(--line); }
.fc-subtabs { display: flex; gap: 6px; margin-top: -8px; }
.fc-subtab { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: .78rem; font-weight: 600; color: var(--text-2); }
.fc-subtab[aria-pressed="true"] { background: var(--p); border-color: var(--p); color: #fff; }

/* Balance */
.fc-balance { padding: 2px 2px 0; }
.fc-balance-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .85rem; color: var(--text-2); font-weight: 600; }
.fc-cur { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; background: var(--surface); }
.fc-cur button { border: 0; background: transparent; padding: 4px 12px; min-height: 30px; font-size: .75rem; font-weight: 700; color: var(--text-3); }
.fc-cur button[aria-pressed="true"] { background: var(--p); color: #fff; }
.fc-balance-row { --fc-balance-font: 2.5rem; display: flex; align-items: center; gap: 4px; margin: 4px 0 2px; min-block-size: max(44px, calc(var(--fc-balance-font) * 1.1)); }
.fc-balance-amount { font-size: 2.5rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; margin: 0; overflow-wrap: anywhere; }
.fc-balance-row > .fc-balance-amount { min-inline-size: 0; font-size: var(--fc-balance-fit, var(--fc-balance-font)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-balance-amount.neg { color: var(--neg); }
.fc-privacy-btn { display: inline-flex; align-items: center; justify-content: flex-start; flex: none; inline-size: 44px; block-size: 44px; padding: 0; border: 0; background: transparent; color: var(--text-3); }
.fc-privacy-btn:hover { color: var(--p); }
.fc-privacy-btn:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; color: var(--p); }
[data-fc-privacy="1"] .fc-balance-amount.neg,
[data-fc-privacy="1"] .fc-amt.neg,
[data-fc-privacy="1"] #overview-balances strong.neg { color: inherit; }

/* Actions */
.fc-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fc-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: .95rem; }
.fc-act:hover { border-color: var(--p); }
.fc-act.in { background: var(--pos-bg); border-color: #bfe3d2; color: var(--pos); }
.fc-act.out { background: var(--p); border-color: var(--p); color: #fff; }
.fc-act.out:hover { background: var(--p-hover); }
.fc-act:disabled { opacity: .5; cursor: not-allowed; }
.fc-secondary { display: flex; gap: 8px; justify-content: center; }
.fc-work-links { flex-wrap: wrap; }
.fc-pillbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: .82rem; font-weight: 600; color: var(--text-2); }
.fc-pillbtn:hover { border-color: var(--p); color: var(--p); }

/* Lists */
.fc-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fc-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.fc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; min-height: 56px; border-bottom: 1px solid #e9eff0; width: 100%; background: transparent; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.fc-row:last-child { border-bottom: 0; }
a.fc-row:hover { background: var(--bg); }
.fc-row-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fc-row-title { font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-row-meta { font-size: .78rem; color: var(--text-2); }
.fc-amt { font-weight: 700; white-space: nowrap; }
.fc-amt.neg { color: var(--neg); }
.fc-badge { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: .7rem; font-weight: 700; background: var(--muted); color: var(--text-2); }
.fc-badge.neg { background: var(--neg-bg); color: var(--neg); }
.fc-badge.warn { background: var(--warn-bg); color: var(--warn); }
.fc-pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .72rem; font-weight: 700; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); white-space: nowrap; }

/* Controls */
.fc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: .92rem; white-space: nowrap; }
.fc-btn:hover { background: var(--muted); }
.fc-btn-primary { background: var(--p); border-color: var(--p); color: #fff; }
.fc-btn-primary:hover { background: var(--p-hover); }
.fc-btn-sm { min-height: 36px; padding: 0 12px; font-size: .82rem; }
.fc-btn-block { width: 100%; }
.fc-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fc-label { font-size: .8rem; font-weight: 600; color: var(--text-2); }
.fc-input, .fc-select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: .95rem; }
.fc-input:focus, .fc-select:focus, .fc-amount:focus-within { outline: none; border-color: var(--p); box-shadow: 0 0 0 3px var(--p-soft); }
.fc-form { display: flex; flex-direction: column; gap: 12px; }
.fc-grid2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
.fc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-chip { min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: .88rem; font-weight: 600; color: var(--text-2); }
.fc-chip[aria-pressed="true"] { background: var(--p); border-color: var(--p); color: #fff; }
.fc-linkbtn { align-self: flex-start; border: 0; background: transparent; padding: 4px 0; color: var(--text-3); font-size: .82rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.fc-linkbtn:hover { color: var(--p); }
.fc-alert { padding: 10px 12px; border-radius: var(--r-sm); font-size: .83rem; border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.fc-alert.err { border-color: var(--neg-line); background: var(--neg-bg); color: var(--neg); }
.fc-alert.info { border-color: var(--p-border); background: var(--p-soft); color: var(--p); }

/* Amount entry */
.fc-amount { display: flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1.5px solid var(--p-border); border-radius: var(--r); background: var(--surface); }
.fc-amount span { font-size: 1.4rem; font-weight: 700; color: var(--p); }
.fc-amount input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; padding: 4px 0; }

/* Sheets */
.fc-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15, 32, 38, .48); display: flex; align-items: flex-end; justify-content: center; }
.fc-sheet { width: 100%; max-width: 460px; max-height: 92dvh; overflow-y: auto; background: var(--surface); border-radius: 16px 16px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
.fc-sheet-head { display: flex; align-items: center; gap: 8px; }
.fc-sheet-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; flex: 1; }
.fc-x { width: 36px; height: 36px; border: 0; border-radius: var(--r-sm); background: var(--muted); color: var(--text-2); }
.fc-inline { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.fc-split-row { display: grid; grid-template-columns: 1fr 1fr 90px; gap: 6px; }
.fc-split-row .fc-select, .fc-split-row .fc-input { min-height: 40px; font-size: .85rem; padding: 6px 8px; }
@media (max-width: 480px) {
  .fc-split-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .fc-split-row [data-unit] { grid-column: 1 / -1; }
}

/* Advanced */
.fc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.fc-adv-links { display: grid; grid-template-columns: 1fr; gap: 8px; }
.fc-adv-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 600; }
.fc-adv-link small { display: block; font-weight: 500; color: var(--text-2); font-size: .78rem; }
.fc-adv-link.soon { color: var(--text-3); }
details.fc-det { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
details.fc-det > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; }
details.fc-det > summary::-webkit-details-marker { display: none; }
details.fc-det[open] > summary { border-bottom: 1px solid #e9eff0; }
.fc-det-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.fc-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.fc-checks label, .fc-check { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; min-height: 32px; }
.fc-indent { padding-left: 18px; }

/* Bottom nav */
.fc-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom, 0px); }
.fc-bottom a { min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .72rem; font-weight: 600; color: var(--text-3); }
.fc-bottom a.on { color: var(--p); }

/* Cards & payment method */
.fc-pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fc-pay-btn { min-height: 38px; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: .8rem; font-weight: 600; color: var(--text-2); text-align: center; }
.fc-pay-btn[aria-pressed="true"] { background: var(--p-soft); border-color: var(--p); color: var(--p); }
.fc-kv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fc-kv-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; min-width: 0; }
.fc-kv-box small { display: block; font-size: .72rem; color: var(--text-2); font-weight: 600; }
.fc-kv-box strong { display: block; font-size: .95rem; margin-top: 2px; overflow-wrap: anywhere; }
.fc-compare { display: grid; grid-template-columns: 1fr; gap: 8px; }
.fc-compare-col { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; font-size: .84rem; }
.fc-compare-col small { display: block; font-size: .72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; margin-bottom: 3px; }
.fc-btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-cap-preview { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; overflow: hidden; }
.fc-cap-img { max-width: 100%; max-height: 220px; border-radius: 6px; object-fit: contain; transition: transform .15s ease; }
.fc-audio-bar { display: flex; flex-direction: column; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }
.fc-rec-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--neg); margin-right: 6px; }
.fc-ambig { border-color: var(--warn) !important; background: var(--warn-bg); }
.fc-badge.err { background: var(--neg-bg); color: var(--neg); }
.fc-badge.ok { background: var(--p-soft); color: var(--p); }
.fc-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-seg-btn { flex: 1 1 0; min-width: 96px; min-height: 40px; padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.fc-seg-btn[aria-pressed="true"] { background: var(--p-soft); border-color: var(--p); color: var(--p); }
@media (max-width: 480px) {
  .fc-kv-grid { grid-template-columns: 1fr; }
  .fc-header-in { padding: 6px 10px; gap: 4px 8px; }
  .fc-quiet { padding: 0 7px; font-size: .78rem; min-height: 32px; }
}

@media (min-width: 640px) {
  .fc-grid2 { grid-template-columns: 1fr 1fr; }
  .fc-adv-links { grid-template-columns: 1fr 1fr; }
  .fc-compare { grid-template-columns: 1fr 1fr; }
  .fc-backdrop { align-items: center; padding: 16px; }
  .fc-sheet { border-radius: 16px; }
}
@media (min-width: 900px) {
  .fc-nav { display: flex; }
  .fc-bottom { display: none; }
  .fc-hours-actions { bottom: 0; }
  .fc-main { padding: 28px 14px 48px; gap: 20px; }
  .fc-balance-amount { font-size: 2.9rem; }
  .fc-balance-row { --fc-balance-font: 2.9rem; }
}
