/* Ajustes, Categorías and Revisar (js/views/settings.js, settings/, categories.js, review.js, fixed-suggestions.js, shortcut.js). */

/* Ajustes: a short menu of pages, and the fixed items as a compact list. */
.settings-menu a.item > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; font-size: .9rem; font-weight: 650; text-decoration: none; }
.back svg { width: 16px; height: 16px; }
.fixed-group > summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; cursor: pointer; font-weight: 650; border-top: 1px solid var(--line); }
.fixed-group:first-of-type > summary { border-top: 0; }
.fixed-group > summary .amount { color: var(--muted); font-size: .9rem; }
.compact-list .item { padding: 7px 0; gap: 10px; contain-intrinsic-size: auto 52px; }
.compact-list .avatar { width: 30px; height: 30px; font-size: .8rem; }
.compact-list .avatar svg, .compact-list .avatar img { width: 18px; height: 18px; }
.compact-list .item .title { font-weight: 600; font-size: .95rem; }
.compact-list .item .meta { font-size: .8rem; }
.keep-option { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.keep-option span { display: grid; gap: 2px; }

/* UX Ajustes: touch targets of at least 40px in Ajustes, Revisar mis datos and
   Revisar categorías; categories listed with their actions under the name on a
   phone; the merchant's category picker full width on a phone; the optional AI
   help folded after the list; a visible focus on "Restaurar…". */
.settings-page { display: grid; gap: 16px; min-width: 0; }
.settings-page .btn.small, .review-check .btn.small, .category-pick .btn.small, .categories-month .btn.small { min-height: 40px; }
.review-check input.tiny { min-height: 40px; }
.settings-page label.btn:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.add-category { display: flex; gap: 10px; align-items: center; }
.add-category input { flex: 1; min-width: 0; }
.add-category .btn { flex: none; }
.category-list .title .badge { margin-left: 8px; vertical-align: 2px; }
.category-list .item.is-hidden .title { color: var(--muted); }
.category-actions { gap: 2px; flex: none; }
.category-pick .pick { flex: none; width: 180px; }
.actions-end { display: flex; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
.ai-help > summary { padding: 8px 0; cursor: pointer; }
.ai-help > summary .muted { margin-left: 8px; }
.ai-help[open] > summary { margin-bottom: 12px; }
@media (max-width: 560px) {
  .category-list .item { flex-wrap: wrap; row-gap: 4px; }
  .category-actions { width: 100%; margin-left: -10px; }
  .category-pick { flex-wrap: wrap; row-gap: 8px; }
  .category-pick .pick { width: 100%; }
}

/* UX Ajustes: «Pegar lista» de fijos con pasos y formato plegado. */
.bulk-steps { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 4px; }
.bulk-example { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; padding: 12px; border-radius: 12px; background: var(--panel-2); font-size: .85rem; }
.bulk-copy .btn { min-height: 40px; }
.bulk-format > summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; }

/* ¿Son fijos? (js/views/fixed-suggestions.js), in Ajustes → fijos. */
.fixed-suggestions .suggestion { align-items: flex-start; }
.suggestion-actions { margin-top: 8px; gap: 8px; }
.suggestion-actions .btn { min-height: 40px; }
.insight.info { border-left-color: var(--accent); }

/* Topes sugeridos (Ajustes → Categorías) */
.limit-suggestion { cursor: pointer; }
.limit-suggestion input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }

/* Atajo de Apple Pay */
.shortcut-item { align-items: flex-start; }
.shortcut-copy { gap: 8px; flex-wrap: wrap; }
.shortcut-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: .92rem; }
.shortcut-steps code { font-size: .85em; padding: 1px 5px; border-radius: 6px; background: var(--panel-2); }

/* UX Ajustes: the gear stays marked on Ajustes and Revisar (40 px to tap), a 40 px
   "‹ Ajustes" link, a focus ring on each fixed item and the restore step line. */
.topbar a.btn[href="#/ajustes"] { min-width: 40px; min-height: 40px; }
.topbar a.btn[href="#/ajustes"][aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
a.back[href="#/ajustes"] { min-height: 40px; margin-bottom: 0; }
.compact-list .item.clickable { cursor: pointer; }
.compact-list .item.clickable:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 12px; }
.restore-status:empty { display: none; }

/* Uso de la app */
.usage-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.usage-totals > div { display: grid; gap: 2px; }
.usage-totals b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.usage-list code { font-size: .9em; overflow-wrap: anywhere; }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.recovery-codes .code { font-size: 1rem; padding: 8px; }

/* Plan */
.plan-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.plan-table th, .plan-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.plan-table thead th { font-size: .85rem; color: var(--muted); }
.plan-table tbody th { font-weight: 500; }
.plan-table td { width: 28%; }

/* UX Ajustes: in «Cómo leemos los meses» the «Usar este» button goes under the
   explanation, so the text keeps the full width on a phone; in the menu, what asks
   for something (no recovery codes, an old backup) reads in the warning color; the
   "nothing matches" line of the fixed items' search only shows when it has text. */
.month-modes .item { flex-wrap: wrap; row-gap: 8px; }
.month-modes .item > .main { flex-basis: 100%; }
.settings-menu .needs-attention { color: var(--warn); font-weight: 600; }
.fixed-none:empty { display: none; }
/* UX Ajustes: quota rows in Revisar mis datos that break cleanly on a phone (the
   movement on its own line, then "Cuota _ de _" together and «Borrar este» at the end). */
.quota-fields { display: inline-flex; align-items: center; gap: 6px; }
.quota-row .meta:empty { display: none; }
@media (max-width: 560px) {
  .quota-head > .row { width: 100%; }
  .quota-head > .row > .meta { flex-basis: 100%; }
  .quota-row { row-gap: 6px; }
  .quota-row .quota-line { flex-basis: 100%; }
  .quota-row > .btn { margin-left: auto; }
}

/* UX Ajustes: the fixed groups draw their top line only after a visible group, so a
   search that hides the first one leaves no stray border on top; the hidden
   categories folded at the end of the list, with a 40 px summary. */
.fixed-group > summary { border-top: 0; }
.fixed-group:not([hidden]) ~ .fixed-group > summary { border-top: 1px solid var(--line); }
.hidden-categories { border-top: 1px solid var(--line); }
.hidden-categories > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 40px; padding: 8px 0; cursor: pointer; font-weight: 650; }
.hidden-categories > summary .muted { font-weight: 400; }
