/* The iPhone app's own components, drawn on the web.
 *
 * Every token, size and colour here is read from hornero-mobile, so what the landing shows is
 * what the app shows:
 *   src/theme/tokens.ts      the palette, the radii (card 22, row 16, chip 14), 4-pt spacing,
 *                            the 44-pt touch target and the Geist faces
 *   src/components/text.tsx  body 15/20, caption 12/16, label 13/18 semibold, title 18/24,
 *                            amount 36/40 bold with tabular figures
 *   src/components/card.tsx  surface, 1px line, radius 22, padding 16, gap 8
 *   src/components/button.tsx  capsules: primary brand on onBrand, secondary fill, plain link
 *   src/components/chip.tsx  40 tall, radius 14, 1px border; picked takes the link border,
 *                            the brandSoft fill and a check
 *   src/movements/movement-row.tsx  the lettered 36x36 tile, the title, "Categoría · Cuenta"
 *                            and the signed amount
 *   src/budgets/budget-bar.tsx  8 tall, the spent part in its level's colour, the expected
 *                            Recurrings at 0.3 behind it, a 2px ink line at today
 *   src/al-tanto/signal-card.tsx  the Al tanto card
 *   src/agent/chat-message.tsx + card-view.tsx  the chat and the card waiting for Confirmar
 *   src/app/(tabs)/_layout.tsx  the native tab bar: icons only, the + on its own surface
 */

.ax {
  /* hornero-mobile src/theme/tokens.ts, palettes.light */
  --a-paper: #fbf6ee;
  --a-surface: #fffcf7;
  --a-ink: #252333;
  --a-ink2: #5b5866;
  --a-line: #ece4d8;
  --a-fill: #f4ede2;
  --a-brand: #f56b12;
  --a-on-brand: #252333;
  --a-brand-soft: #fde7d3;
  --a-link: #b5491a;
  --a-good: #1f7a5f;
  --a-warn: #8a5a00;
  --a-warn-soft: #f6ecd6;
  --a-bad: #b8264f;
  --a-chart: #e5600c;
  --a-ai: #1f62c9;
  --a-ai-soft: #e5eefb;
  /* radii: card 22, row 16, chip 14, pill */
  --a-rc: 22px;
  --a-rr: 16px;
  --a-rh: 14px;

  font-family: var(--font-text);
  color: var(--a-ink);
  font-size: 15px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}

/* ---- type ---- */
.ax .t-body { font-size: 15px; line-height: 20px; }
.ax .t-cap { font-size: 12px; line-height: 16px; }
.ax .t-lab { font-size: 13px; line-height: 18px; font-weight: 600; }
.ax .t-tit { font-size: 18px; line-height: 24px; font-weight: 600; }
.ax .t-amt { font-size: 36px; line-height: 40px; font-weight: 700; letter-spacing: -0.7px; }
.ax .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ax .dim { color: var(--a-ink2); }
.ax .in { color: var(--a-good); }

/* ---- the screen a phone shows ---- */
.ax-screen {
  background: var(--a-paper);
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}
.ax-h1 { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -0.5px; }
.ax-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }

/* ---- Card (src/components/card.tsx) ---- */
.ax-card {
  background: var(--a-surface);
  border: 1px solid var(--a-line);
  border-radius: var(--a-rc);
  padding: 16px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.ax-card--ai { border-color: var(--a-ai); gap: 12px; }
.ax-pair { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

/* ---- a ledger row (src/movements/movement-row.tsx) ---- */
.ax-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 0;
}
.ax-row + .ax-row { border-top: 1px solid var(--a-line); }
/* the lettered tile: the first letter of what the movement was, never an emoji */
.ax-tile {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--a-fill);
  color: var(--a-ink2);
  font-size: 15px;
  font-weight: 600;
}
.ax-tile--warn { background: var(--a-warn-soft); color: var(--a-warn); }
.ax-tile--brand { background: var(--a-brand-soft); color: var(--a-link); }
.ax-tile img { width: 20px; height: 20px; border-radius: 5px; }
.ax-grow { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.ax-grow > b { font-weight: 400; font-size: 15px; line-height: 20px; }

/* ---- the Budget bar (src/budgets/budget-bar.tsx) ---- */
.ax-bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--a-fill);
}
.ax-bar > i { position: absolute; inset: 0 auto 0 0; background: var(--lvl, var(--a-good)); }
.ax-bar > u { position: absolute; top: 0; bottom: 0; background: var(--lvl, var(--a-good)); opacity: 0.3; }
.ax-bar > b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--a-ink); }
.ax-lvl-ok { --lvl: var(--a-good); }
.ax-lvl-warning { --lvl: var(--a-warn); }
.ax-lvl-over { --lvl: var(--a-bad); }
.ax-note-lvl { display: flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; color: var(--lvl); }
.ax-note-lvl svg { width: 13px; height: 13px; flex: none; }

/* ---- Chip (src/components/chip.tsx) ---- */
.ax-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ax-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--a-line);
  border-radius: var(--a-rh);
  background: var(--a-surface);
  font-size: 15px;
  font-weight: 600;
}
.ax-chip.is-on { border-color: var(--a-link); background: var(--a-brand-soft); }
.ax-chip.is-on svg { width: 12px; height: 12px; color: var(--a-link); }
.ax-chip--ai.is-on { border-color: var(--a-ai); background: var(--a-ai-soft); }
.ax-chip--ai.is-on svg { width: 16px; height: 16px; color: var(--a-ai); }
.ax-chip--add { border-style: dashed; border-color: var(--a-ink2); background: none; color: var(--a-link); }
/* the compact chip of a filter row, which is what Movimientos uses on a 390-pt screen: the row
   scrolls sideways there, so it never wraps */
.device .ax-chip { min-height: 32px; padding: 0 10px; font-size: 14px; }
.device .ax-chips { flex-wrap: nowrap; gap: 6px; }
.ax-chip--add svg { width: 16px; height: 16px; }
.ax-chip small { font-size: 12px; font-weight: 400; color: var(--a-link); }

/* ---- Button (src/components/button.tsx) ---- */
.ax-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--a-brand);
  color: var(--a-on-brand);
  font-size: 17px;
  font-weight: 600;
}
.ax-btn svg { width: 17px; height: 17px; }
.ax-btn--sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.ax-btn--sm svg { width: 14px; height: 14px; }
.ax-btn--secondary { background: var(--a-fill); color: var(--a-ink); }
.ax-btn--plain { background: none; color: var(--a-link); padding: 0 8px; }

/* ---- a money field (src/components/money-field.tsx) ---- */
.ax-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid var(--a-line);
  border-radius: var(--a-rh);
  background: var(--a-surface);
}
.ax-field > span:first-child { flex: 1 1 auto; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ax-field > span:last-child { font-size: 18px; font-weight: 600; color: var(--a-link); }
.ax-label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--a-ink2); }

/* ---- a list group / list row (src/components/list-group.tsx, list-row.tsx) ---- */
.ax-list { background: var(--a-surface); border: 1px solid var(--a-line); border-radius: var(--a-rc); overflow: hidden; }
.ax-list > .ax-lrow { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 12px 16px; }
.ax-list > .ax-lrow + .ax-lrow { border-top: 1px solid var(--a-line); }
.ax-lrow svg { width: 17px; height: 17px; flex: none; }
.ax-lrow > span { flex: 1 1 auto; }

/* ---- the native tab bar (src/app/(tabs)/_layout.tsx): icons only, the + apart ---- */
.ax-tabs {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--a-line);
  background: color-mix(in oklab, var(--a-surface) 86%, transparent);
}
.ax-tabs > nav { flex: 1 1 auto; display: flex; justify-content: space-around; align-items: center; }
.ax-tabs svg { width: 24px; height: 24px; color: var(--a-ink2); }
.ax-tabs .is-on svg { color: var(--a-link); }
.ax-tabs .ax-plus {
  flex: none;
  width: 46px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--a-fill);
}
.ax-tabs .ax-plus svg { color: var(--a-link); }

/* ---- Al tanto (src/al-tanto/signal-card.tsx) ---- */
.ax-signal { gap: 4px; }
.ax-signal__top { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.ax-signal__ico {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--a-brand-soft);
}
.ax-signal__ico svg { width: 17px; height: 17px; color: var(--a-link); }
.ax-signal.is-urgent .ax-signal__ico { background: var(--a-warn-soft); }
.ax-signal.is-urgent .ax-signal__ico svg { color: var(--a-warn); }
.ax-signal__line { flex: 1 1 auto; min-width: 0; }
.ax-signal__line b { color: var(--a-link); font-weight: 600; }
.ax-signal.is-urgent .ax-signal__line b { color: var(--a-warn); }
.ax-signal__chev { flex: none; width: 13px; height: 13px; color: var(--a-ink2); }
.ax-signal__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -16px -8px; }
.ax-signal__foot .ax-btn--plain { min-height: 40px; padding: 0 16px; font-size: 15px; }
.ax-signal__foot .ax-btn--plain svg { width: 14px; height: 14px; }

/* ---- a Local notice as iOS shows it (src/notices/*, the strings in src/locales/es.json) ---- */
.ax-notes { display: grid; gap: 10px; }
.ax-note {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--a-rc);
  background: color-mix(in oklab, var(--a-surface) 92%, transparent);
  border: 1px solid color-mix(in oklab, var(--a-ink) 7%, transparent);
  box-shadow: 0 10px 24px -14px color-mix(in oklab, var(--a-ink) 45%, transparent);
}
.ax-note__app { flex: none; width: 38px; height: 38px; border-radius: 9px; overflow: hidden; }
.ax-note__app img { width: 100%; height: 100%; display: block; }
.ax-note__body { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.ax-note__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  line-height: 14px;
  color: var(--a-ink2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ax-note__meta time { text-transform: none; letter-spacing: 0; }
.ax-note__title { font-size: 15px; line-height: 20px; font-weight: 600; }
.ax-note__text { font-size: 15px; line-height: 20px; color: var(--a-ink); }

/* ---- the Agent (src/agent/chat-message.tsx, card-view.tsx) ---- */
.ax-chat { display: grid; gap: 12px; }
.ax-said {
  justify-self: end;
  max-width: 85%;
  padding: 8px 12px;
  border-radius: var(--a-rr);
  background: var(--a-ink);
  color: var(--a-paper);
}
.ax-reply { display: flex; gap: 8px; }
.ax-reply > img { flex: none; width: 28px; height: 28px; border-radius: 999px; background: var(--a-fill); }
.ax-reply > p { flex: 1 1 auto; margin: 0; line-height: 22px; }
.ax-toconfirm { display: flex; align-items: center; gap: 8px; color: var(--a-ai); }
.ax-toconfirm svg { width: 15px; height: 15px; }
.ax-ask {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px 0 12px;
  border-radius: var(--a-rr);
  background: var(--a-surface);
  color: var(--a-ink2);
}
.ax-ask > span { flex: 1 1 auto; }
.ax-ask .ax-send { flex: none; width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; background: var(--a-ai); color: #fff; }
.ax-ask .ax-send svg { width: 16px; height: 16px; }
.ax-aibox { display: grid; gap: 12px; padding: 16px; border-radius: var(--a-rc); background: var(--a-ai-soft); }

/* ---- the + screen (src/app/(tabs)/new/index.tsx) ---- */
.ax-big {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--a-rc);
  background: var(--a-brand);
  color: var(--a-on-brand);
}
.ax-big__ring {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 2px solid var(--a-on-brand);
  display: grid;
  place-items: center;
}
.ax-big__ring svg { width: 24px; height: 24px; }
.ax-big__txt { flex: 1 1 auto; display: grid; gap: 2px; }
.ax-big__txt b { font-size: 24px; line-height: 28px; font-weight: 700; }
.ax-big__txt span { opacity: 0.8; }
.ax-big > svg:last-child { flex: none; width: 16px; height: 16px; }
.ax-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ax-tile2 {
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-height: 88px;
  padding: 16px;
  border: 1px solid var(--a-line);
  border-radius: var(--a-rc);
  background: var(--a-surface);
}
.ax-tile2 svg { width: 24px; height: 24px; color: var(--a-link); }
.ax-tile2 svg.good { color: var(--a-good); }
.ax-tile2 b { font-size: 16px; line-height: 20px; font-weight: 600; }

/* ---- the phone the screens sit in ---- */
.device {
  position: relative;
  width: 280px;
  flex: none;
  border: 8px solid #252333;
  border-radius: 44px;
  background: var(--a-paper);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(37, 35, 51, 0.5);
  display: flex;
  flex-direction: column;
  padding-top: 38px;
}
.device::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 84px;
  height: 24px;
  margin-left: -42px;
  border-radius: 99px;
  background: #252333;
  z-index: 2;
}
/* the screen scrolls under the tab bar on a real phone, so what runs past the bottom fades out
   there rather than ending on a hard cut */
.device > .ax-screen {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 36px), transparent 100%);
  mask-image: linear-gradient(180deg, #000 calc(100% - 36px), transparent 100%);
}
