/* SplitFlow — identidad: cuenta de restaurante en papel crema con tinta índigo y acento coral.
   Tipografía: Young Serif (títulos y totales) + Instrument Sans (texto). */
:root { --font-body: "Instrument Sans", system-ui, sans-serif; --font-figure: "Young Serif", Georgia, serif;
  --paper: #f6efe1; --surface: #fffaf0; --card: #fffaf0; --ink: #1f2250; --ink-soft: #5d5f86; --line: #dccfb4; --accent: #2f3bbd; --coral: #e4573d; --radius: 10px; }
@media (prefers-color-scheme: dark) { :root { --paper: #14152b; --surface: #1c1e3d; --card: #1c1e3d; --ink: #f1ecdd; --ink-soft: #aeb0d4; --line: #33365e; --accent: #9aa6ff; --coral: #ff8f78; } }
.top h1, .bill h2, h2 { font-family: var(--font-figure); font-weight: 400; letter-spacing: -0.01em; }
.top h1 { font-size: 2rem; } .top h1 span { display: block; border-bottom: 4px solid var(--coral); padding-bottom: 0.25rem; }
.bill { position: relative; background: var(--surface); padding: 1.25rem 1.1rem 1.5rem; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; box-shadow: 0 3px 0 var(--line);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 18px 100% repeat-x; mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 18px 100% repeat-x; padding-bottom: 2.2rem; }
.ledger .amt { color: var(--accent); font-family: var(--font-figure); font-weight: 400; }
.ledger .leader { border-bottom-color: var(--coral); opacity: 0.55; }

/* SplitFlow: la cuenta del restaurante es el elemento memorable (líneas con puntos guía). */
:root { --accent: #2f3bbd; }

.shell { max-width: 640px; margin: 0 auto; padding: 1rem 1rem 3rem; }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0 1rem; }
.top h1 { margin: 0; }
.picker { display: flex; gap: 0.5rem; align-items: center; }
.picker select { width: auto; max-width: 11rem; }

main > section, form.panel { margin-bottom: 2rem; }
form.panel { padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.row { display: grid; gap: 0.75rem; grid-template-columns: 1fr; margin-bottom: 0.75rem; }
@media (min-width: 520px) { .row { grid-template-columns: 1fr 1fr; } }
.field { margin-bottom: 0.75rem; }
.field.inline { display: grid; grid-template-columns: 1fr 9rem; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.field.inline label { margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.check { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 500; margin: 0; min-height: 44px; }
.check input { width: 1.15rem; height: 1.15rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.detail { margin-bottom: 1rem; }

/* La cuenta */
.bill { padding: 1.25rem 0 1.5rem; border-bottom: 2px solid var(--ink); }
.bill h2 { font-size: 1.5rem; }
.ledger { list-style: none; margin: 0.5rem 0 0.75rem; padding: 0; }
.ledger li { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.55rem 0; font-size: 1.1rem; }
.ledger .who { font-weight: 600; }
.ledger .leader { flex: 1; border-bottom: 2px dotted var(--ink-soft); transform: translateY(-0.25em); min-width: 1rem; }
.ledger .amt { font-family: var(--font-figure); font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums lining-nums; }
.total { color: var(--ink-soft); margin: 0; }
.empty { color: var(--ink-soft); }
.empty.settled { font-family: var(--font-figure); font-size: 1.3rem; color: var(--plus); }

/* Listas */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.rows .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rows .sub { font-size: 0.85rem; color: var(--ink-soft); }
.rows .amt { font-family: var(--font-figure); font-weight: 600; font-variant-numeric: tabular-nums lining-nums; text-align: right; }
.rows .amt.plus { color: var(--plus); }
.rows .amt.minus { color: var(--minus); }
.rows button { min-height: 40px; padding: 0.25rem 0.7rem; }

.inline-form { display: flex; gap: 0.5rem; align-items: flex-end; margin-top: 0.75rem; }
.inline-form .field { flex: 1; margin: 0; }
.tools { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 1rem; }
.foot { text-align: center; font-size: 0.8rem; color: var(--ink-soft); margin-top: 2rem; }

@media (prefers-color-scheme: dark) { :root { --accent: #8b94ff; } }

.brand { display: flex; align-items: center; gap: 0.65rem; }
.brand .logo { width: 44px; height: 44px; flex: none; border-radius: 11px; }
.brand .es { display: block; font: 500 0.42em/1.2 var(--font-body); opacity: 0.75; margin-top: 0.15em; }

.small { min-height: 40px; padding: 0.25rem 0.7rem; }
.ledger li { flex-wrap: wrap; }
.ledger li .small { margin-left: auto; }
.recon { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-bottom: 0.75rem; }
.recon th, .recon td { text-align: right; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); }
.recon th:first-child, .recon td:first-child { text-align: left; }
.share pre { white-space: pre-wrap; background: var(--surface); border: 1px dashed var(--line); padding: 0.75rem; border-radius: var(--radius); font: 0.9rem/1.5 var(--font-body); }
.button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; font-weight: 600; background: var(--card); }
.backup { margin: 2rem 0 1rem; } .backup summary { cursor: pointer; font-weight: 600; }
.attach { position: relative; cursor: pointer; } .attach input { position: absolute; opacity: 0; width: 1px; height: 1px; }
