/* AmaniFin — móvil primero, modo claro y oscuro con las mismas variables.
   Escritorio: navegación lateral desde 960 px y secciones en columnas desde 1100 px. */

:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --text: #142033;
  --text-2: #3a4a61;
  --muted: #5d6b80;
  --border: #dfe4ec;
  --grid: #e8ecf2;
  --accent: #1f5fd1;
  --accent-text: #ffffff;
  --accent-soft: #e4ecfb;
  --accent-wash: rgba(31, 95, 209, .10);
  --pos: #12804a;
  --neg: #c2362b;
  --warn: #b26f00;
  --night: #0f1b2d;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 6px 18px rgba(15, 27, 45, .05);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a111d;
    --surface: #121c2c;
    --surface-2: #1a263b;
    --text: #e8edf5;
    --text-2: #c3cdda;
    --muted: #8e9cb1;
    --border: #233149;
    --grid: #1e2a3f;
    --accent: #5b93f5;
    --accent-text: #0a111d;
    --accent-soft: #1b2b49;
    --accent-wash: rgba(91, 147, 245, .14);
    --pos: #3ccf7f;
    --neg: #ff7b6e;
    --warn: #f0b13a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* Los label son flex: sin esto, el atributo hidden que pone el JS no los ocultaría. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: .3rem 0 1rem; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.02rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .85rem; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }

/* Cifras en columna (listas, tablas, ejes): todas del mismo ancho para que alineen. Las
   cifras grandes sueltas van con las proporcionales de la fuente, que se leen mejor. */
.amount, .num, table, .budget-nums, .slice-nums, .pairs dd, .chart-tip, .chart text { font-variant-numeric: tabular-nums; }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* --- Estructura -------------------------------------------------------------------------- */

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 16px; padding-top: max(.6rem, env(safe-area-inset-top));
  background: var(--night); color: #fff;
}
.brand { display: inline-flex; align-items: center; gap: .5rem; color: #fff; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand:hover { text-decoration: none; }
.books { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; }
.books .pill { color: #c9d4e6; background: transparent; border-color: rgba(255, 255, 255, .18); }
.books .pill.active { background: #fff; color: var(--night); border-color: #fff; }
.top .user { margin-left: auto; color: #aebbd0; font-size: .9rem; display: none; }

main { max-width: 760px; margin: 0 auto; padding: 1rem 16px 6.5rem; }
main.bare { padding-top: 8vh; }
.side { display: none; }

.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom));
}
.bottom > a, .bottom summary {
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  font-size: .72rem; color: var(--muted); padding: .25rem 0; cursor: pointer; list-style: none;
}
.bottom summary::-webkit-details-marker { display: none; }
.bottom .icon { width: 22px; height: 22px; }
.bottom a[aria-current] { color: var(--accent); }
.bottom a:hover { text-decoration: none; }
.bottom .add {
  justify-self: center; width: 54px; height: 54px; margin-top: -22px;
  border-radius: 50%; background: var(--accent); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center; padding: 0;
  box-shadow: 0 6px 16px rgba(31, 95, 209, .35);
}
.bottom .add .icon { width: 28px; height: 28px; stroke-width: 2.2; }
.more { position: relative; }
.more .menu {
  position: absolute; right: .25rem; bottom: calc(100% + .5rem);
  min-width: 220px; padding: .4rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  display: flex; flex-direction: column;
}
.nav-link {
  display: flex; align-items: center; justify-content: flex-start; gap: .7rem; width: 100%;
  padding: .55rem .7rem; border-radius: 10px; color: var(--text-2); text-align: left;
  font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; min-height: 0;
}
.nav-link .icon { color: var(--muted); }
.nav-link:hover { background: var(--surface-2); text-decoration: none; }
.nav-link[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-link[aria-current] .icon { color: var(--accent); }
.nav-sep { height: 1px; background: var(--border); margin: .5rem .25rem; }

@media (min-width: 960px) {
  .top { padding: .7rem 24px; }
  .top .user { display: block; }
  .side {
    display: flex; flex-direction: column; gap: .15rem;
    position: fixed; top: 58px; left: 0; bottom: 0; width: 236px; padding: 1.1rem .8rem;
    border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto;
  }
  .side .add-btn { margin: 0 0 .9rem; width: 100%; }
  main.with-nav { margin-left: 236px; max-width: 1320px; padding: 1.6rem 2.2rem 3rem; }
  .bottom { display: none; }
}

/* --- Rejilla de escritorio ------------------------------------------------------------------ */

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.page-head .head-actions { display: none; gap: .6rem; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1.25rem; align-items: start; }
.col { display: flex; flex-direction: column; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.tiles .card { margin: 0; }

@media (min-width: 960px) {
  .page-head .head-actions { display: flex; }
}
@media (min-width: 1100px) {
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols.main-side { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
  .narrow { max-width: 760px; }
}

/* --- Piezas ------------------------------------------------------------------------------ */

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; margin: 0 0 1rem; box-shadow: var(--shadow);
}
@media (min-width: 960px) { .card { padding: 1.25rem 1.35rem; margin-bottom: 1.25rem; } }
a.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--accent); }
.callout { border-left: 4px solid var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.grid2 .card { margin: 0; }
/* .card.stat y no .stat: a.card (display: block) ganaría por especificidad. */
.card.stat, .card.hero { display: flex; flex-direction: column; gap: .2rem; }
.label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.big { font-size: 1.55rem; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
.hero .big { font-size: 2.1rem; }
@media (min-width: 960px) { .hero .big { font-size: 3rem; } }
.hero-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.stat .spark { margin-top: auto; padding-top: .5rem; }
/* En el móvil sobra (está el botón + de abajo); en escritorio completa la fila de cuatro. */
.add-tile { display: none !important; }
.three-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.three-tiles .big { font-size: 1.15rem; }
@media (min-width: 1100px) {
  .three-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .three-tiles .big { font-size: 1.55rem; }
  .add-tile { display: flex !important; flex-direction: row !important; align-items: center; justify-content: center; gap: .6rem; color: var(--accent) !important; font-weight: 600; border-style: dashed; }
  .add-tile .icon { width: 1.5em; height: 1.5em; }
}
.composition { min-width: min(100%, 420px); flex: 0 1 520px; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); }
@media (max-width: 959px) { .composition { margin-top: .75rem; } }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem 1rem; flex-wrap: wrap; }
.section-head h2 { margin-bottom: .6rem; }
.card > h2:first-child, .card > .section-head:first-child h2 { display: flex; align-items: center; gap: .5rem; }

.pairs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem 1rem; margin: 0; }
.pairs div { display: flex; flex-direction: column; }
.pairs dt { font-size: .8rem; color: var(--muted); }
.pairs dd { margin: 0; font-weight: 600; }

.pill {
  display: inline-block; padding: .3rem .8rem; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--border); color: var(--text); font-size: .9rem; background: var(--surface);
}
.pill.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.pill:hover { text-decoration: none; }
.badge { font-size: .7rem; padding: .05rem .45rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.tag { color: var(--accent); font-size: .8rem; }

.flash { padding: .7rem .9rem; border-radius: 10px; margin: 0 0 1rem; background: var(--accent-soft); }
.flash.error { background: color-mix(in srgb, var(--neg) 14%, var(--surface)); color: var(--text); border-left: 4px solid var(--neg); }
.flash.ok { border-left: 4px solid var(--pos); }

/* Barras de progreso y de reparto: la pista es un paso claro del mismo tono que el relleno. */
.bar { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: .4rem 0 .1rem; }
.bar > span { display: block; height: 100%; background: var(--pos); border-radius: 999px; }
.bar.warn > span { background: var(--warn); }
.bar.over > span { background: var(--neg); }
.bar.share { background: var(--accent-soft); }
.bar.share > span { background: var(--accent); }

/* Listas de movimientos, agrupadas por día */
.txs { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.txs li + li { border-top: 1px solid var(--border); }
.txs .day { padding: .5rem .95rem .35rem; font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.txs .day::first-letter { text-transform: uppercase; }
.tx { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .7rem .95rem; color: inherit; }
a.tx:hover { background: var(--surface-2); text-decoration: none; }
.tx-ico { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--surface-2); color: var(--muted); }
.tx-ico.out { color: var(--neg); background: color-mix(in srgb, var(--neg) 10%, var(--surface)); }
.tx-ico.in { color: var(--pos); background: color-mix(in srgb, var(--pos) 10%, var(--surface)); }
.tx-ico .icon { width: 18px; height: 18px; }
.tx-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tx-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-meta { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amount { font-weight: 700; white-space: nowrap; }
.amount.neutral { color: var(--muted); font-weight: 600; }
.empty { padding: 1rem; color: var(--muted); list-style: none; }
.card .txs { border: 0; border-radius: 0; box-shadow: none; margin: 0 -1rem -1rem; }
@media (min-width: 960px) { .card .txs { margin: 0 -1.35rem -1.25rem; } .card .txs .tx, .card .txs .day { padding-left: 1.35rem; padding-right: 1.35rem; } }

.accounts, .cats, .slices, .budget, .contrib { list-style: none; margin: 0; padding: 0; }
.accounts > li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .65rem 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.accounts > li:first-child { border-top: 0; }
.accounts > li > details { width: 100%; }
.accounts summary { display: flex; justify-content: space-between; cursor: pointer; }
.accounts .right { display: flex; align-items: center; gap: .75rem; }
.accounts summary { list-style: none; align-items: center; gap: .75rem; }
.accounts summary::-webkit-details-marker { display: none; }
.accounts details[open] > summary { margin-bottom: .75rem; }
.edit-panel { display: flex; flex-direction: column; gap: .6rem; padding: .85rem; margin-bottom: .4rem; background: var(--surface-2); border-radius: 12px; }
.edit-panel .actions { align-items: center; }
.archived { opacity: .6; }

.budget > li, .slices > li { padding: .6rem 0; border-top: 1px solid var(--border); }
.budget > li:first-child, .slices > li:first-child { border-top: 0; }
.budget summary, .slices summary { cursor: pointer; display: grid; grid-template-columns: 1fr auto; column-gap: .75rem; list-style: none; }
.budget summary::-webkit-details-marker, .slices summary::-webkit-details-marker { display: none; }
.budget summary .bar, .slices summary .bar { grid-column: 1 / -1; }
.budget .leaf summary, .slices .leaf summary { cursor: default; }
.budget details ul, .slices details ul { list-style: none; padding: .3rem 0 0 1rem; margin: 0; }
.budget-child, .slice-child { display: grid; grid-template-columns: 1fr auto; column-gap: .75rem; padding: .3rem 0; font-size: .92rem; }
.budget-child .bar { grid-column: 1 / -1; }
.budget-name, .slice-name { font-weight: 600; min-width: 0; }
.budget-nums, .slice-nums { text-align: right; white-space: nowrap; }
.slices > li:not(:has(details)) { display: grid; grid-template-columns: 1fr auto; column-gap: .75rem; }
.slices > li:not(:has(details)) .bar, .slice-detail { grid-column: 1 / -1; }
.contrib > li + li { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.contrib strong { display: block; margin-bottom: .4rem; }

.cats ul { list-style: none; padding-left: 1.1rem; margin: 0; }
.cat summary { cursor: pointer; padding: .45rem 0; }
.cat-tools { display: flex; flex-direction: column; gap: .5rem; padding: .25rem 0 .75rem 1rem; }

.month-nav { display: flex; align-items: center; justify-content: center; gap: 1.25rem; margin: 0 0 1rem; }
.page-head .month-nav { margin: 0; }
.month-nav a { font-size: 1.6rem; line-height: 1; padding: 0 .6rem; }
.month-nav a:hover { text-decoration: none; }
.month-nav strong { text-transform: capitalize; min-width: 9em; text-align: center; }

.filters { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1rem; }
@media (min-width: 960px) { .filters { flex-direction: row; align-items: center; justify-content: space-between; } }
.chips { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; }
.toggle { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); font-size: .95rem; align-self: flex-start; }
@media (min-width: 960px) { .toggle { align-self: center; } }
.toggle:hover { text-decoration: none; }
.toggle .knob { width: 38px; height: 22px; border-radius: 999px; background: var(--border); position: relative; transition: background .15s; }
.toggle .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on .knob { background: var(--accent); }
.toggle.on .knob::after { left: 19px; }

/* --- Gráficas (las dibuja app.js al ancho real) ---------------------------------------------- */

.chart { position: relative; margin: .9rem 0 0; min-height: 180px; }
.chart.spark { min-height: 0; height: 38px; margin: 0; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent-wash); }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .bar-mark { fill: var(--accent); }
.chart .bar-mark.dim { fill: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.chart .bar-mark.hover { fill: color-mix(in srgb, var(--accent) 80%, #fff); }
.chart .ref-line { stroke: var(--muted); stroke-width: 1; }
.chart .ref-label, .chart .end-label { fill: var(--text-2); font-size: 11px; font-weight: 600; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; stroke-opacity: .7; }
.chart .dot.marker { r: 5.5; stroke-width: 2.5; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; transform: translate(-50%, calc(-100% - 10px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .4rem .6rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18); white-space: nowrap; font-size: .82rem;
}
.chart-tip strong { display: block; font-size: .95rem; }
.chart-tip span { color: var(--muted); }
.chart-data { margin-top: .5rem; font-size: .85rem; }
.chart-data summary { color: var(--muted); cursor: pointer; width: max-content; }
.chart-data table { margin-top: .4rem; }

.table-wrap { overflow-x: auto; margin: .75rem -1rem 0; padding: 0 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .5rem .4rem; border-top: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: .78rem; color: var(--muted); font-weight: 600; border-top: 0; }
.num { text-align: right; white-space: nowrap; }

/* --- Formularios ------------------------------------------------------------------------- */

.stack { display: flex; flex-direction: column; gap: .85rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; color: var(--muted); font-weight: 500; }
input, select, button, .button { font: inherit; }
input, select {
  width: 100%; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); min-height: 44px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; align-items: end; }
.row.compact { grid-template-columns: 1fr auto; gap: .5rem; }
.row.compact label { min-width: 0; }
form.row.compact:has(label + label) { grid-template-columns: 1fr 1fr; }
form.row.compact:has(label + label) button { grid-column: 1 / -1; }
.hint { font-size: .8rem; color: var(--muted); font-weight: normal; }
.amount-field input { font-size: 1.6rem; font-weight: 700; padding: .5rem .75rem; }
.code { font-size: 1.6rem; letter-spacing: .3em; text-align: center; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem 1rem; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.button:hover { text-decoration: none; }
.primary { background: var(--accent); color: var(--accent-text); }
.primary:hover { filter: brightness(1.06); }
.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.secondary:hover { border-color: var(--muted); }
.danger { background: transparent; color: var(--neg); border-color: var(--neg); }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); font-weight: 500; }
.danger-text { color: var(--neg) !important; }
.inline { display: inline; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.actions form { display: contents; }
.actions.flush { margin: 0 0 .6rem; }
.actions.sticky { position: sticky; bottom: 4.6rem; background: var(--bg); padding: .5rem 0; }
@media (min-width: 960px) { .actions.sticky { bottom: 0; } }
.danger-zone { margin-top: 2rem; }
.add-form { margin-top: .75rem; }
.add-form > summary { list-style: none; display: inline-flex; }
.add-form > summary::-webkit-details-marker { display: none; }
.add-form[open] > summary { margin-bottom: .9rem; }

.segmented { display: flex; border: 0; padding: 3px; margin: 0; background: var(--surface-2); border-radius: 12px; }
.segmented label { flex: 1; flex-direction: row; margin: 0; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.segmented span { flex: 1; text-align: center; padding: .55rem .4rem; border-radius: 9px; color: var(--muted); font-weight: 600; cursor: pointer; font-size: .9rem; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }

.budget-edit { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .75rem; }
.budget-row { display: grid; grid-template-columns: 1fr 9rem; align-items: center; gap: .75rem; flex-direction: row; color: var(--text); }
.budget-row.top span { font-weight: 700; }
.budget-row:not(.top) span { padding-left: 1rem; }
.budget-row input { text-align: right; min-height: 38px; padding: .4rem .6rem; }
@media (min-width: 1100px) {
  .budget-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; align-items: start; }
  .budget-form > p, .budget-form > .actions { grid-column: 1 / -1; }
}

/* --- Acceso ------------------------------------------------------------------------------ */

.auth { max-width: 380px; margin: 0 auto; }
.logo { display: flex; align-items: center; justify-content: center; gap: .6rem; font-size: 1.7rem; margin-bottom: 1.25rem; }
.logo img { width: 40px; height: 40px; border-radius: 11px; }
.qr { background: #fff; border-radius: 12px; padding: .5rem; width: 220px; margin: .5rem auto 1rem; }
.qr svg { width: 100%; height: auto; display: block; }
.secret { font-family: ui-monospace, monospace; font-size: 1.05rem; letter-spacing: .08em; word-break: break-all; background: var(--surface-2); padding: .6rem; border-radius: 8px; }

@media (max-width: 380px) {
  .grid2, .tiles { grid-template-columns: 1fr; }
  .big { font-size: 1.35rem; }
}
