/* Caudal web app.
   Palettes copied role by role from Caudal's Theme.kt (2026-11-19), Material 3 names mapped to base.css:
   background → --bg · onSurface → --on · onSurfaceVariant → --onv · primary → --pri
   surfaceContainerLowest/Low/High → --lowest/--low/--high · surfaceVariant → --rail
   outlineVariant → --outV · selected fill → --act/--onAct · floatingCardColor() → --sheet
   incomeColor() → --inc · chart bars → --bar. Tiles mix their category tint into --tbase. */
html.t-caudal {
  --bg: #B9E2DF; --on: #06312C; --onv: #1E4640; --pri: #00695C; --onPri: #FFFFFF;
  --lowest: #FFFFFF; --low: #F4FBFA; --high: #D4EBE6; --rail: #A7D8D2; --outV: #8DB5B1;
  --act: #80CBC4; --onAct: #00251F; --sheet: #F4FBFA; --inc: #1B5E20; --bar: #26A69A; --water: #80CBC4;
  color-scheme: light;
}
html.t-claro {
  --bg: #F2F7F4; --on: #161D1B; --onv: #3F4946; --pri: #006A60; --onPri: #FFFFFF;
  --lowest: #EBF4F1; --low: #E6F2EF; --high: #DBEEEB; --rail: #DAE5E1; --outV: #BEC9C5;
  --act: #CCE8E2; --onAct: #05201C; --sheet: #F2F7F4; --inc: #2E7D32; --bar: #6FB8AC; --water: #A9DCD0;
  color-scheme: light;
}
html.t-oscuro {
  --bg: #070C11; --on: #DDE7E8; --onv: #A8B8BB; --pri: #6EB7B0; --onPri: #073632;
  --lowest: #05090D; --low: #142022; --high: #18232B; --rail: #111A21; --outV: #34434A;
  --act: #2F6761; --onAct: #F0FAF8; --sheet: #18232B; --inc: #74B98A; --bar: #3D807A; --water: #264744;
  --tbase: #18232B; --tmix: 32%; --shadow: rgba(0, 0, 0, .5);
  color-scheme: dark;
}
html.t-medianoche {
  --bg: #000000; --on: #CDDDD9; --onv: #9FBFB9; --pri: #8CBFBA; --onPri: #00352E;
  --lowest: #000000; --low: #0A211E; --high: #173C34; --rail: #113029; --outV: #22423C;
  --act: #12463E; --onAct: #B2DFDB; --sheet: #173C34; --inc: #52C41A; --bar: #00695C; --water: #00544A;
  --tbase: #113029; --tmix: 30%; --shadow: rgba(0, 0, 0, .6);
  color-scheme: dark;
}
html.t-amatista {
  --bg: #141218; --on: #E6E0E9; --onv: #CAC4D0; --pri: #CFBDFE; --onPri: #381E72;
  --lowest: #121016; --low: #26212D; --high: #383142; --rail: #2E2836; --outV: #49454F;
  --act: #4A4458; --onAct: #E8DEF8; --sheet: #383142; --inc: #52C41A; --bar: #7E67B8; --water: #4F378A;
  --tbase: #2E2836; --tmix: 30%; --shadow: rgba(0, 0, 0, .5);
  color-scheme: dark;
}
html.t-bosque {
  --bg: #80A68C; --on: #14201A; --onv: #263C30; --pri: #205133; --onPri: #FFFFFF;
  --lowest: #CEDFD4; --low: #C3D6CA; --high: #B2CBB9; --rail: #B0CBB8; --outV: #6F9479;
  --act: #C0D4B8; --onAct: #17250F; --sheet: #B2CBB9; --inc: #174E1B; --bar: #5E8C6E; --water: #5E8C6E;
  color-scheme: light;
}
html.t-arena {
  --bg: #FFF8F3; --on: #201B16; --onv: #504539; --pri: #9A6E3F; --onPri: #FFFFFF;
  --lowest: #FBF5EF; --low: #F5EBE0; --high: #EFE2D3; --rail: #F0E0D0; --outV: #D5C3B5;
  --act: #FFDDB8; --onAct: #2B1808; --sheet: #EFE2D3; --inc: #2E7D32; --bar: #D9AE7E; --water: #FFDDB8;
  color-scheme: light;
}
html.t-cafe {
  --bg: #C7AB85; --on: #3A2C20; --onv: #5E4C39; --pri: #6F4E37; --onPri: #FFFFFF;
  --lowest: #E4D0B5; --low: #DCC6A8; --high: #CFB795; --rail: #D8C4A8; --outV: #A88D6E;
  --act: #5A4632; --onAct: #DCC6A8; --sheet: #E4D0B5; --inc: #2E5A1E; --bar: #A47E5B; --water: #BF9B77;
  color-scheme: light;
}
html.t-vainilla {
  --bg: #FBF6E3; --on: #1E1B10; --onv: #4B4739; --pri: #8A6516; --onPri: #FFFFFF;
  --lowest: #FEFAEC; --low: #F4EBCB; --high: #ECE1B6; --rail: #EAE2C0; --outV: #D3CAA6;
  --act: #EFE1A8; --onAct: #211B00; --sheet: #ECE1B6; --inc: #2E7D32; --bar: #D6B65A; --water: #E8CF7A;
  color-scheme: light;
}
html.t-cuarzo {
  --bg: #FFF6F8; --on: #20191C; --onv: #504349; --pri: #B03B6E; --onPri: #FFFFFF;
  --lowest: #FFF0F5; --low: #FADFEA; --high: #F3D1DF; --rail: #F1DEE3; --outV: #D5C2C9;
  --act: #F7CEDD; --onAct: #2A151F; --sheet: #F3D1DF; --inc: #2E7D32; --bar: #E58BAF; --water: #F0A6C2;
  color-scheme: light;
}
html.t-poliglota {
  --bg: #EDE6FB; --on: #3A2359; --onv: #5B4A6B; --pri: #432969; --onPri: #FFFFFF;
  --lowest: #FFFFFF; --low: #F5F5F5; --high: #D9CFF2; --rail: #DFD3F5; --outV: #BBA9F5;
  --act: #D4C9F6; --onAct: #221238; --sheet: #FFFFFF; --inc: #266B2A; --bar: #9C86E6; --water: #BBA9F5;
  color-scheme: light;
}

body { background: var(--bg); }
/* Only after the first paint, so a dark page does not fade in from the light default on load. */
body.ready { transition: background-color .25s; }
.num, .amt, .big, .mv .a { font-variant-numeric: tabular-nums; }

/* =================== Door =================== */
.door { min-height: 100dvh; display: flex; flex-direction: column; }
.door-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; }
.door-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--on); font-weight: 800; text-decoration: none; }
.door-brand img { width: 30px; height: 30px; border-radius: 9px; }
.door-main {
  flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 24px 40px;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center;
}
.door-icon { width: 88px; height: 88px; border-radius: 24px; box-shadow: 0 14px 34px rgba(0, 60, 52, .22); }
.door-name { margin: 22px 0 6px; color: var(--pri); font-weight: 800; letter-spacing: .02em; }
.door h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 800; letter-spacing: -.03em; line-height: 1.04; }
.door-sub { margin-top: 16px; max-width: 30em; color: var(--onv); font-size: 18px; }
.door-pts { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.door-pts li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.door-pts .ic { color: var(--pri); }
.door-card {
  padding: 28px; border-radius: 28px; background: var(--low);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--outV) 60%, transparent), 0 24px 60px var(--shadow, rgba(0, 50, 44, .14));
}
.door-card h2 { font-size: 22px; font-weight: 800; }
.door-card > p { color: var(--onv); margin: 8px 0 20px; font-size: 15px; }
.or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--onv); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--outV); }
.fine { margin-top: 14px; color: var(--onv); font-size: 13px; }
.fine.links { display: flex; gap: 18px; }
.door-water { width: 100%; height: 90px; }
.door-water path:first-child { fill: var(--water); }
@media (max-width: 899px) {
  .door-main { grid-template-columns: 1fr; gap: 32px; padding-top: 8px; }
  .door-icon { width: 72px; height: 72px; border-radius: 20px; }
}

/* =================== App bar =================== */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 68px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.bar-brand { display: inline-flex; align-items: center; gap: 10px; margin-right: 6px; color: var(--on); font-weight: 800; font-size: 18px; text-decoration: none; }
.bar-brand img { width: 34px; height: 34px; border-radius: 10px; }
.space-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 8px; border: 0; border-radius: 20px;
  background: var(--low); color: var(--on); font-weight: 700; font-size: 15px; max-width: 220px;
}
.space-pill img { width: 26px; height: 26px; }
.space-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-pill .ic { color: var(--onv); }
.month { display: flex; align-items: center; }
.month-l { min-width: 150px; text-align: center; font-weight: 800; white-space: nowrap; }
.bar-brand, .month, #who { flex: none; }
.month .ib:disabled { opacity: .3; cursor: default; background: none; }
.grow { flex: 1; }
.sync {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 15px;
  color: var(--onv); font-size: 12px; font-weight: 700; box-shadow: inset 0 0 0 1px var(--outV); white-space: nowrap;
}
.sync .ic { width: 15px; height: 15px; }
#who { display: inline-flex; }
#who .av { cursor: pointer; }

/* =================== Layout =================== */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 392px; gap: 24px; align-items: start;
  max-width: 1380px; margin: 0 auto; padding: 4px 24px 40px;
}
.main { min-width: 0; }
.tabs.rail { width: fit-content; margin: 6px 0 18px; }
.tabs.rail button { flex: none; padding: 0 18px; }

/* Segmented control (Gasto/Ingreso, tabs, filters) */
.rail { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--rail); }
.rail button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border: 0; border-radius: 12px;
  background: transparent; color: var(--onv); font-weight: 700; font-size: 15px;
}
.rail button:hover { color: var(--on); }
.rail button.on { background: var(--act); color: var(--onAct); }
.rail .sg { width: 18px; height: 18px; }
.rail .ic { width: 18px; height: 18px; }

/* =================== Apuntar panel =================== */
.entry {
  position: sticky; top: 80px; display: flex; flex-direction: column; gap: 12px; padding: 18px;
  border-radius: 28px; background: var(--low); max-height: calc(100dvh - 96px); overflow: auto;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--outV) 45%, transparent);
}
.entry-h { display: flex; justify-content: space-between; align-items: center; }
.entry-h h2 { font-size: 20px; font-weight: 800; }
.date-chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 10px;
  color: var(--pri); font-weight: 700; font-size: 13px; box-shadow: inset 0 0 0 1px var(--outV); cursor: pointer;
}
.date-chip.past { background: var(--act); color: var(--onAct); box-shadow: none; }
.date-chip input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.amt { padding: 4px 0 0; text-align: center; font-size: 54px; font-weight: 700; letter-spacing: -2px; line-height: 1.1; }
.amt small { font-size: 28px; font-weight: 600; color: var(--onv); letter-spacing: 0; }
.amt.inc { color: var(--inc); }
.amt.bump { animation: bump .18s ease-out; }
@keyframes bump { 50% { transform: scale(1.03); } }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tile {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 10px; border: 0; border-radius: 14px;
  background: color-mix(in srgb, var(--t) var(--tmix, 20%), var(--tbase, var(--lowest))); color: var(--on);
  font-weight: 700; font-size: 14px; text-align: left;
}
.tile img { width: 28px; height: 28px; flex: none; }
.tile.on { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--t) 60%, var(--on)); }
.methods { display: flex; gap: 6px; }
.methods button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 6px; border: 0;
  border-radius: 12px; background: var(--high); color: var(--on); font-weight: 700; font-size: 13px;
}
.methods button img { width: 22px; height: 22px; }
.methods button.on { background: var(--act); color: var(--onAct); box-shadow: inset 0 0 0 1.5px var(--pri); }
.note-f {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 12px;
  background: var(--lowest); color: var(--onv); box-shadow: inset 0 0 0 1px var(--outV);
}
.note-f:focus-within { box-shadow: inset 0 0 0 2px var(--pri); }
.note-f input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--on); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad button {
  height: 50px; border: 0; border-radius: 14px; background: var(--high); color: var(--on);
  font-size: 22px; font-weight: 500; display: grid; place-items: center; transition: filter .1s, transform .1s;
}
.pad button:active, .pad button.hit { filter: brightness(.9); transform: scale(.97); }
.save { margin-top: 2px; }
.kbd-hint { color: var(--onv); font-size: 12px; text-align: center; }
kbd { font: inherit; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--high); color: var(--on); }
.last {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 14px;
  background: var(--lowest); font-size: 13px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--outV) 60%, transparent);
}
.last img { width: 26px; height: 26px; }
.last span { flex: 1; min-width: 0; }
.last b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.last small { color: var(--onv); }
.last .btn { min-height: 34px; padding: 0 10px; font-size: 13px; }
@media (max-height: 860px) and (min-width: 1000px) {
  .entry { gap: 8px; padding: 14px 16px; }
  .amt { font-size: 42px; padding: 0; }
  .tile { height: 40px; }
  .methods button, .note-f { height: 38px; }
  .pad button { height: 40px; font-size: 20px; }
  .btn.l.save { min-height: 46px; }
  .kbd-hint { display: none; }
}

/* =================== Cards (Resumen, Ajustes) =================== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.card { padding: 20px; border-radius: 24px; background: var(--low); min-width: 0; }
.card.wide { grid-column: 1 / -1; }
.card > h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; font-size: 16px; font-weight: 800; }
.card > h3 small { color: var(--onv); font-size: 13px; font-weight: 600; }
.card > p.sub { color: var(--onv); font-size: 14px; margin: -8px 0 14px; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(240px, auto) 1fr; gap: 32px; align-items: end; padding: 24px; }
.hero .k { color: var(--onv); font-weight: 700; font-size: 14px; }
.big { font-size: clamp(42px, 5vw, 62px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin: 2px 0 12px; }
.big small { font-size: .45em; font-weight: 700; color: var(--onv); letter-spacing: 0; }
.hero-sub { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-sub span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--lowest); font-size: 13px; font-weight: 600; color: var(--onv); }
.hero-sub b { color: var(--on); }
.hero-sub b.inc, .inc { color: var(--inc); }
.hero-sub img { width: 16px; height: 16px; }
.trend { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--onv); font-size: 14px; }
.trend .ic { color: var(--pri); }
.shared-note { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--onv); }
.days-w { min-width: 0; }
.days { display: flex; align-items: flex-end; gap: 3px; height: 128px; }
.days i { flex: 1; min-height: 3px; border-radius: 4px 4px 2px 2px; background: var(--bar); }
.days i.zero { background: color-mix(in srgb, var(--bar) 25%, transparent); }
.days i.today { background: var(--pri); }
.days i.future { background: color-mix(in srgb, var(--outV) 35%, transparent); }
.days-x { display: flex; justify-content: space-between; margin-top: 6px; color: var(--onv); font-size: 11px; font-weight: 700; }

/* categories */
.cat-row {
  display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 8px 6px;
  border: 0; border-radius: 14px; background: transparent; color: var(--on); text-align: left;
}
.cat-row:hover { background: color-mix(in srgb, var(--on) 5%, transparent); }
.ct { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--t) var(--tmix, 22%), var(--tbase, var(--lowest))); }
.ct img { width: 28px; height: 28px; }
.cat-row b { font-weight: 700; }
.meter { height: 8px; margin-top: 6px; border-radius: 4px; background: var(--high); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--t); }
.cat-row .v { text-align: right; font-weight: 800; }
.cat-row .v small { display: block; color: var(--onv); font-size: 12px; font-weight: 600; }

/* methods */
.split { display: flex; gap: 3px; height: 14px; border-radius: 7px; overflow: hidden; margin: 4px 0 14px; }
.split i { min-width: 4px; }
.legend { display: grid; gap: 4px; }
.legend div { display: grid; grid-template-columns: 12px 30px 1fr auto; gap: 10px; align-items: center; min-height: 40px; }
.legend .dot { width: 12px; height: 12px; border-radius: 50%; }
.legend img { width: 28px; height: 28px; }
.legend b { font-weight: 800; text-align: right; }
.legend small { color: var(--onv); font-weight: 600; margin-left: 6px; }

/* six months */
.months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 170px; }
.mo { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; border: 0; padding: 0; background: none; color: var(--onv); font-size: 12px; font-weight: 700; }
.mo .col { width: 100%; max-width: 46px; min-height: 4px; border-radius: 10px 10px 4px 4px; background: var(--bar); opacity: .75; }
.mo:hover .col { opacity: 1; }
.mo.on { color: var(--on); }
.mo.on .col { background: var(--pri); opacity: 1; }
.mo .v { font-size: 11px; white-space: nowrap; }

/* empty states */
.empty { padding: 44px 16px; text-align: center; color: var(--onv); }
.empty .ic { width: 36px; height: 36px; margin: 0 auto 12px; color: var(--pri); }
.empty b { display: block; color: var(--on); font-size: 17px; margin-bottom: 4px; }

/* =================== Movimientos =================== */
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; }
.search { flex: 1 1 240px; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 23px; background: var(--low); color: var(--onv); }
.search:focus-within { box-shadow: inset 0 0 0 2px var(--pri); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--on); }
.tools .rail button { height: 38px; padding: 0 14px; font-size: 14px; }
.fchip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 10px; border: 0; border-radius: 19px; background: var(--act); color: var(--onAct); font-weight: 700; font-size: 14px; }
.fchip img { width: 22px; height: 22px; }
.fchip .ic { width: 16px; height: 16px; }
.mv-sum { color: var(--onv); font-size: 14px; margin: 10px 4px 0; }
.day { margin-top: 18px; }
.day-h { display: flex; justify-content: space-between; gap: 12px; padding: 0 8px 6px; color: var(--onv); font-size: 13px; font-weight: 800; }
.day-b { border-radius: 20px; background: var(--low); overflow: hidden; }
.mv {
  display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 10px 14px;
  border: 0; border-top: 1px solid color-mix(in srgb, var(--outV) 50%, transparent); background: transparent; color: var(--on); text-align: left;
}
.mv:first-child { border-top: 0; }
.mv:hover { background: color-mix(in srgb, var(--on) 4%, transparent); }
.mv b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv small { display: flex; align-items: center; gap: 6px; color: var(--onv); font-size: 13px; overflow: hidden; white-space: nowrap; }
.mv small img { width: 16px; height: 16px; }
.mv .a { font-weight: 800; white-space: nowrap; }
.mv .a.inc { color: var(--inc); }
.mv.new { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--act) 70%, transparent); } }

/* =================== Ajustes =================== */
.acc-row { display: flex; align-items: center; gap: 14px; }
.acc-row b { display: block; font-size: 17px; }
.acc-row small { display: block; color: var(--onv); font-size: 14px; }
.acc-row .ic.l { color: var(--pri); }
.row-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.row-acts .btn { min-height: 40px; font-size: 14px; }
.plan-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 800; background: var(--high); color: var(--onv); margin-top: 6px; }
.plan-pill.on { background: var(--act); color: var(--onAct); }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.theme {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 10px; border: 0; border-radius: 16px;
  background: var(--high); color: var(--on); font-weight: 700; font-size: 13px; text-align: left;
}
.theme .sw { position: relative; height: 56px; border-radius: 10px; background: var(--sbg); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.theme .sw i { position: absolute; left: 8px; right: 24px; bottom: 8px; height: 18px; border-radius: 6px; background: var(--slow); }
.theme .sw em { position: absolute; right: 8px; top: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--spri); }
.theme span { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 0 2px; }
.theme span .ic { width: 15px; height: 15px; color: var(--onv); }
.theme.on { box-shadow: inset 0 0 0 2px var(--pri); }
.theme.locked .sw { opacity: .8; }
.hint { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; color: var(--onv); font-size: 13px; }
.hint .ic { width: 16px; height: 16px; margin-top: 2px; }
.sp-list { display: flex; flex-direction: column; }
.sp { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--outV) 50%, transparent); }
.sp:first-child { border-top: 0; }
.sp img { width: 34px; height: 34px; }
.sp > span:not(.av) { flex: 1; min-width: 0; }
.sp b { display: block; }
.sp small { display: block; color: var(--onv); font-size: 13px; }
.sp .btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; color: var(--onv); align-items: center; }
.keys span:nth-child(odd) { display: flex; gap: 4px; }

/* dialogs inside Caudal */
.dz-dlg { background: var(--sheet); }
.ed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ed-grid .fld.full { grid-column: 1 / -1; }
.inp.sel { appearance: auto; }
.dz-acts .left { margin-right: auto; }
.btn.danger { color: #B3261E; }
html.t-oscuro .btn.danger, html.t-medianoche .btn.danger, html.t-amatista .btn.danger { color: #F2B8B5; }
.icons-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.icons-pick label { position: relative; }
.icons-pick input { position: absolute; opacity: 0; inset: 0; }
.icons-pick span { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: var(--high); cursor: pointer; }
.icons-pick img { width: 30px; height: 30px; }
.icons-pick input:checked + span { background: var(--act); box-shadow: inset 0 0 0 2px var(--pri); }
.icons-pick input:focus-visible + span { outline: 2px solid var(--pri); outline-offset: 2px; }
.members { margin-top: 12px; }
.members .sp .av { width: 34px; height: 34px; font-size: 13px; }
.err { min-height: 1.2em; margin-top: 8px; color: #B3261E; font-size: 14px; font-weight: 600; }
html.t-oscuro .err, html.t-medianoche .err, html.t-amatista .err { color: #F2B8B5; }

/* space menu */
.sp-menu { width: 280px; }
.sp-menu button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 10px; border: 0; border-radius: 12px; background: none; color: var(--on); font-weight: 600; text-align: left; }
.sp-menu button:hover { background: color-mix(in srgb, var(--on) 7%, transparent); }
.sp-menu button[aria-current="true"] { background: var(--act); color: var(--onAct); }
.sp-menu img { width: 28px; height: 28px; }
.sp-menu small { margin-left: auto; color: var(--onv); font-size: 12px; font-weight: 600; }
.sp-menu .add { border-top: 1px solid var(--outV); border-radius: 0 0 12px 12px; margin-top: 4px; color: var(--pri); }

/* =================== Bottom navigation (narrow screens) =================== */
.bottom { display: none; }
@media (max-width: 999px) {
  .layout { grid-template-columns: 1fr; padding: 0 16px 100px; }
  .main .tabs { display: none; }
  .app .entry { position: static; max-height: none; overflow: visible; display: none; }
  .app.entry-open .entry { display: flex; max-width: 520px; width: 100%; margin: 0 auto; }
  .app.entry-open .main { display: none; }
  .bottom {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 4px;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--low);
    box-shadow: 0 -1px 0 color-mix(in srgb, var(--outV) 60%, transparent);
  }
  .bottom button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; border: 0; background: none;
    color: var(--onv); font-size: 12px; font-weight: 700;
  }
  .bottom button .ic { width: 56px; height: 30px; padding: 5px 18px; border-radius: 15px; }
  .bottom button.on { color: var(--on); }
  .bottom button.on .ic { background: var(--act); color: var(--onAct); }
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .dz-toast { bottom: 96px; }
}
@media (max-width: 699px) {
  .bar { gap: 4px; padding: 0 10px; height: 60px; }
  .bar-brand span, .bar .sw-btn, .bar .th-btn, .sync { display: none; }
  .bar-brand { margin-right: 2px; }
  .bar-brand img { width: 30px; height: 30px; }
  .space-pill { max-width: 130px; padding-right: 8px; font-size: 14px; }
  .month-l { min-width: 0; font-size: 14px; }
  .month .ib { width: 34px; }
  #who .btn { min-height: 40px; padding: 0 14px; }
  .cards { grid-template-columns: 1fr; }
  .card { padding: 16px; border-radius: 20px; }
  .hero { padding: 18px; }
  .days { height: 96px; gap: 2px; }
  .ed-grid { grid-template-columns: 1fr; }
}
@media (max-width: 479px) {
  .bar-brand { display: none; }
  .month-l .yr.now { display: none; }
  .month .ib { width: 30px; }
  .space-pill { gap: 6px; max-width: 150px; }
}

/* Mid widths: the sync chip keeps its icon and says the rest in its tooltip (and in Ajustes). */
@media (max-width: 999px) {
  .sync span { display: none; }
  .sync { padding: 0 8px; }
}
