/* Layout: una columna de app móvil (máx 560px), cabecera fija arriba, barra de pestañas abajo; las cenas como tarjetas de "carta de restaurante". */
:root {
  --bg: #f5f2f6;
  --surface: #ffffff;
  --sunk: #ece6ee;
  --ink: #221a24;
  --muted: #6c6070;
  --line: #e2dae5;
  --wine: #7a1f3d;
  --wine-soft: #f3e3e9;
  --on-wine: #ffffff;
  --gold: #c98a0b;
  --gold-off: #ddd3df;
  --ok: #2c7a4b;
  --ok-soft: #e1f1e7;
  --warn: #a2560f;
  --warn-soft: #f8ead9;
  --shadow: 0 1px 2px rgba(34,26,36,.06), 0 4px 14px rgba(34,26,36,.06);
  --f-display: "Gloock", "Georgia", "Times New Roman", serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #141015; --surface: #1e1820; --sunk: #2a222d; --ink: #f2ecf3; --muted: #a698aa; --line: #342b38;
  --wine: #e2698f; --wine-soft: #3a1f2a; --on-wine: #1a0d13; --gold: #f1b739; --gold-off: #463b4a;
  --ok: #6fcf97; --ok-soft: #1b3326; --warn: #f0a35c; --warn-soft: #3a2817;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #141015; --surface: #1e1820; --sunk: #2a222d; --ink: #f2ecf3; --muted: #a698aa; --line: #342b38;
  --wine: #e2698f; --wine-soft: #3a1f2a; --on-wine: #1a0d13; --gold: #f1b739; --gold-off: #463b4a;
  --ok: #6fcf97; --ok-soft: #1b3326; --warn: #f0a35c; --warn-soft: #3a2817;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25); color-scheme: dark; }

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
.wrap { max-width: 560px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Cabecera */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { font-family: var(--f-display); font-size: 24px; line-height: 1; letter-spacing: -.01em; }
.brand em { font-style: normal; color: var(--wine); }
.per { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.per select { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }

main.wrap { padding-block: 16px 104px; display: flex; flex-direction: column; gap: 14px; }

/* Barra inferior */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabs .wrap { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.tab { background: none; border: 0; padding: 10px 4px 9px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; position: relative; }
.tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="true"] { color: var(--wine); }
.tab .dot { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--wine); color: var(--on-wine); font-size: 10px; line-height: 16px; padding: 0 4px; }

/* Bloques */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sec { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lead { font-size: 15px; color: var(--muted); margin: 0; }
p { margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 10px 14px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); min-height: 42px; }
.btn.primary { background: var(--wine); color: var(--on-wine); border-color: var(--wine); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--wine); padding-inline: 6px; }
.btn.danger { color: var(--warn); }
.btn.sm { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .tab:focus-visible, .cena-card:focus-visible, .star:focus-visible, .ph:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
.f input, .f select, .f textarea { font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 16px; width: 100%; }
.f textarea { min-height: 70px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { outline: 2px solid var(--wine); outline-offset: -1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .grid2 { grid-template-columns: 1fr; } }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.chip.st-borrador { background: var(--sunk); color: var(--muted); }
.chip.st-invitada { background: var(--wine-soft); color: var(--wine); }
.chip.st-terminada { background: var(--ok-soft); color: var(--ok); }
.chip.st-cerrada { background: var(--sunk); color: var(--ink); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }

.banner { border-radius: 12px; padding: 12px 14px; background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.callout { border-radius: 12px; padding: 12px 14px; background: var(--wine-soft); color: var(--wine); font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* Lista de cenas */
.hero h1 { font-family: var(--f-display); font-weight: 400; font-size: 30px; line-height: 1.1; }
.stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stats b { color: var(--ink); font-size: 15px; }
.cena-card { text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; cursor: pointer; }
.cena-card.next { border-color: var(--wine); box-shadow: var(--shadow); }
.date { display: flex; flex-direction: column; align-items: center; border-radius: 10px; background: var(--sunk); padding: 6px 0; line-height: 1; }
.date .d { font-family: var(--f-display); font-size: 24px; }
.date .m { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--wine); margin-top: 3px; }
.date .w { font-size: 11px; color: var(--muted); margin-top: 2px; }
.info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hosts { font-weight: 700; }
.dishes { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score { text-align: right; font-family: var(--f-display); font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.score small { display: block; font-family: var(--f-body); font-size: 11px; color: var(--muted); margin-top: 3px; }
.score.none { color: var(--gold-off); }

/* Detalle */
.back { align-self: flex-start; }
.det-head { display: flex; flex-direction: column; gap: 8px; }
.det-head h1 { font-family: var(--f-display); font-weight: 400; font-size: 28px; line-height: 1.12; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.menu { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 18px; display: flex; flex-direction: column; gap: 16px; text-align: center; }
.menu-title { font-family: var(--f-display); font-size: 22px; }
.menu-rule { height: 1px; background: var(--line); margin: 0 30%; }
.course { display: flex; flex-direction: column; gap: 3px; }
.course-k { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: var(--wine); }
.course-n { font-family: var(--f-display); font-size: 20px; line-height: 1.2; }
.course p { color: var(--muted); font-size: 14px; max-width: 42ch; margin: 0 auto; white-space: pre-line; }

.course-edit { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.course-edit legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--wine); padding: 0 4px; }

/* Estrellas 1 a 7 */
.stars { display: inline-flex; gap: 2px; }
.star { width: 16px; height: 16px; fill: var(--gold-off); }
.star.on { fill: var(--gold); }
.star-in { display: flex; gap: 2px; }
.star-in button { background: none; border: 0; padding: 4px 2px; cursor: pointer; line-height: 0; border-radius: 6px; }
.star-in .star { width: 30px; height: 30px; }
@media (max-width: 380px) { .star-in .star { width: 26px; height: 26px; } }
.asp { display: flex; flex-direction: column; gap: 4px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.asp:last-child { border-bottom: 0; }
.asp-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 600; }
.asp-h .val { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; font-size: 14px; }

.res-row { display: grid; grid-template-columns: 1fr auto 34px; gap: 10px; align-items: center; padding-block: 7px; border-bottom: 1px solid var(--line); font-size: 14px; }
.res-row:last-child { border-bottom: 0; }
.res-row .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.final { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--wine-soft); border-radius: 12px; padding: 14px 16px; }
.final .big { font-family: var(--f-display); font-size: 44px; line-height: 1; color: var(--wine); font-variant-numeric: tabular-nums; }
.final .scale { font-size: 12px; color: var(--muted); }
.voter { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.voter:last-child { border-bottom: 0; }
.voter .c { grid-column: 1 / -1; font-size: 14px; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.voter .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.pend { display: flex; flex-wrap: wrap; gap: 6px; }

/* Fotos */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ph { aspect-ratio: 1; max-width: 100%; border-radius: 10px; overflow: hidden; background: var(--sunk); border: 0; padding: 0; cursor: pointer; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upl { position: relative; overflow: hidden; }
.upl input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Ranking y listas */
.rank { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding-block: 10px; border-bottom: 1px solid var(--line); }
.rank:last-child { border-bottom: 0; }
.rank .pos { font-family: var(--f-display); font-size: 22px; color: var(--muted); text-align: center; }
.rank:first-child .pos { color: var(--gold); }
.rank .n { font-family: var(--f-display); font-size: 26px; font-variant-numeric: tabular-nums; }
.li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-block: 9px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li > div { min-width: 0; overflow-wrap: anywhere; }
.empty { text-align: center; padding: 28px 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty h2 { font-family: var(--f-display); font-weight: 400; font-size: 22px; }
.reg h1 { font-family: var(--f-display); font-weight: 400; font-size: 34px; line-height: 1.05; }

/* Modal y aviso */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(15,10,16,.55); display: flex; align-items: flex-end; justify-content: center; padding-left: max(0px, env(safe-area-inset-left, 0px)); padding-right: max(0px, env(safe-area-inset-right, 0px)); }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px max(16px, env(safe-area-inset-left, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
.sheet h2 { font-family: var(--f-display); font-weight: 400; font-size: 22px; }
.sheet pre { white-space: pre-wrap; font-family: var(--f-body); font-size: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0; max-height: 34vh; overflow: auto; }
.sheet.photo { padding: 10px; background: #000; }
.sheet.photo img { width: 100%; max-height: 72vh; object-fit: contain; border-radius: 8px; }
.sheet.photo .row { color: #ddd; padding: 4px 6px; }
.toast { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.copyable { user-select: all; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
@media (prefers-reduced-motion: no-preference) { .cena-card, .btn { transition: transform .12s ease; } .cena-card:active, .btn:active { transform: scale(.985); } }

/* Ajustes de la app independiente (fuera de Claude) */
html, body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.top { top: 0; padding-top: env(safe-area-inset-top, 0px); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--sunk); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 9px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.pin-big { font-family: var(--f-display); font-size: 40px; letter-spacing: .12em; text-align: center; color: var(--wine); font-variant-numeric: tabular-nums; }
.offline { position: fixed; z-index: 7; left: 0; right: 0; top: 0; padding: calc(4px + env(safe-area-inset-top, 0px)) 16px 4px; background: var(--warn-soft); color: var(--warn); font-size: 12px; text-align: center; font-weight: 600; }
