/* Bitácora — estilos
   Papel salvia, tinta azul-negra y un ámbar de resaltador que marca "ahora" y "hoy". */

:root {
  --paper: #EEF1EC;
  --surface: #FBFCFA;
  --sunk: #E3E8E2;
  --ink: #1E2A33;
  --ink-2: #4A5862;
  --ink-3: #7A868C;
  --line: #CDD4CC;
  --line-2: #DDE3DC;
  --amber: #E0A030;
  --amber-soft: #F6E3B8;
  --green: #2F7D5B;
  --green-soft: #DCEDE3;
  --red: #B23A32;
  --red-soft: #F5DEDB;
  --blue: #2E5C8A;
  --focus: #E0A030;
  --shadow: 0 10px 30px rgba(30, 42, 51, .16);
  --r-s: 6px;
  --r-m: 10px;
  --r-l: 16px;
  --font: "Instrument Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12181D;
    --surface: #1A2228;
    --sunk: #222C33;
    --ink: #E3E8E4;
    --ink-2: #AEB9B5;
    --ink-3: #7E8A88;
    --line: #2F3B43;
    --line-2: #273239;
    --amber: #E8AE45;
    --amber-soft: #3E3420;
    --green: #5BB58A;
    --green-soft: #1E3529;
    --red: #E2736A;
    --red-soft: #3D2321;
    --blue: #7FA8D4;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12181D; --surface: #1A2228; --sunk: #222C33; --ink: #E3E8E4; --ink-2: #AEB9B5; --ink-3: #7E8A88;
  --line: #2F3B43; --line-2: #273239; --amber: #E8AE45; --amber-soft: #3E3420; --green: #5BB58A; --green-soft: #1E3529;
  --red: #E2736A; --red-soft: #3D2321; --blue: #7FA8D4; --shadow: 0 10px 30px rgba(0, 0, 0, .45); color-scheme: dark;
}

* { box-sizing: border-box; }
:root {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html, body { height: 100%; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* ---------- Estructura ---------- */
.app { min-height: 100%; display: flex; }
.side { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--paper);
  border-bottom: 1px solid var(--line-2);
}
.topbar h1 { font-size: 19px; font-weight: 600; margin: 0; flex: 1; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { margin-left: -6px; }
.searchbox {
  display: none; align-items: center; gap: 8px;
  padding: 0 12px; height: 40px; border-radius: var(--r-m);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-3);
  cursor: text; min-width: 0;
}
.content { flex: 1; padding: 14px 14px calc(var(--nav-h) + 28px); max-width: 1180px; width: 100%; margin: 0 auto; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--surface); border-top: 1px solid var(--line);
}
.bottomnav a, .bottomnav button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--ink-3); text-decoration: none; background: none; border: 0; padding: 6px 0;
}
.bottomnav a.on { color: var(--ink); font-weight: 600; }
.bottomnav a.on svg { stroke: var(--ink); }
.bottomnav .plus {
  width: 54px; height: 54px; margin: -18px auto 0; border-radius: 50%;
  background: var(--ink); color: var(--paper); display: grid; place-items: center;
  box-shadow: var(--shadow); touch-action: none; user-select: none; -webkit-user-select: none;
}
.bottomnav .plus svg { stroke: var(--paper); width: 26px; height: 26px; }
.bottomnav .plus.rec { background: var(--red); }

@media (min-width: 900px) {
  .bottomnav { display: none; }
  .content { padding: 22px 28px 48px; }
  .side {
    display: flex; flex-direction: column; gap: 2px;
    position: sticky; top: 0; height: 100vh; width: 232px; flex: none;
    padding: 18px 12px; border-right: 1px solid var(--line-2); background: var(--paper); overflow-y: auto;
  }
  .side .brand { font-size: 20px; font-weight: 700; letter-spacing: -.02em; padding: 4px 10px 16px; display: flex; align-items: center; gap: 8px; }
  .side .brand i { width: 10px; height: 22px; background: var(--amber); border-radius: 2px; display: inline-block; }
  .side a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-s); text-decoration: none; color: var(--ink-2); font-size: 15px; }
  .side a:hover { background: var(--sunk); color: var(--ink); }
  .side a.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--amber); }
  .side a .count { margin-left: auto; font-size: 12px; background: var(--amber-soft); color: var(--ink); padding: 1px 7px; border-radius: 10px; }
  .side hr { border: 0; border-top: 1px solid var(--line-2); margin: 10px 4px; }
  .side .newbtn { margin: 0 4px 14px; }
  .topbar { padding: 12px 28px; top: 0; }
  .searchbox { display: flex; width: 340px; }
  .topbar .icon-search { display: none; }
}

/* ---------- Iconos y botones ---------- */
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 18px; height: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: var(--r-m); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 500; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.danger { color: var(--red); }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: var(--r-s); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%; color: var(--ink-2); flex: none; }
.iconbtn:hover { background: var(--sunk); color: var(--ink); }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }

/* ---------- Secciones y bloques ---------- */
.sec { margin: 0 0 26px; }
.sec > h2, .sech {
  font-size: 15px; font-weight: 600; margin: 0 0 8px; color: var(--ink-2);
  display: flex; align-items: center; gap: 8px;
}
.sech .grow + a, .sech a.more { font-weight: 500; font-size: 13px; color: var(--ink-3); text-decoration: none; }
.panel { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 14px; }
.empty { padding: 18px 4px; color: var(--ink-3); font-size: 14px; }
.empty .btn { margin-top: 10px; }

/* Lista de registros */
.items { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-l); overflow: hidden; }
.items > li { border-top: 1px solid var(--line-2); }
.items > li:first-child { border-top: 0; }
.it { display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-decoration: none; color: inherit; min-height: 52px; }
a.it:hover, button.it:hover { background: var(--sunk); }
button.it { width: 100%; border: 0; background: none; text-align: left; }
.it .t { font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.it .m { font-size: 13px; color: var(--ink-3); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.it .amt { font-weight: 600; margin-left: auto; padding-left: 8px; }
.it .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--sunk); color: var(--ink-2); flex: none; }
.it .thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: var(--sunk); }
.it.done .t { text-decoration: line-through; color: var(--ink-3); }
.daygroup { font-size: 13px; color: var(--ink-3); padding: 14px 4px 6px; display: flex; justify-content: space-between; }
.daygroup:first-child { padding-top: 2px; }

.check {
  width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--ink-3); background: none; flex: none;
  display: grid; place-items: center; padding: 0;
}
.check.on { background: var(--green); border-color: var(--green); }
.check.on::after { content: ""; width: 10px; height: 6px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 8px; border-radius: 20px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.chip .dot, .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.amber { background: var(--amber-soft); color: var(--ink); }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -14px 14px; padding: 2px 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a {
  border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 6px 14px; font-size: 14px;
  white-space: nowrap; text-decoration: none; color: var(--ink-2);
}
.tabs .on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (min-width: 900px) { .tabs { margin: 0 0 16px; padding: 2px 0; } }

/* Entrada rápida */
.quick { display: flex; gap: 8px; margin: 0 0 14px; }
.quick input { flex: 1; min-width: 0; }
.quick .hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* ---------- Formularios ---------- */
.field { margin: 0 0 14px; }
.field > label, .flabel { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink-2); margin: 0 0 5px; font-weight: 500; }
.field > label a, .flabel a { font-weight: 400; color: var(--ink-3); font-size: 12px; text-decoration: underline; cursor: pointer; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=time], input[type=search], input:not([type]), select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface); font-size: 16px; min-height: 46px;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.seg button { flex: 1; border: 0; background: var(--surface); padding: 10px 6px; font-size: 14px; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: var(--paper); font-weight: 600; }

/* ---------- Hojas modales ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(18, 24, 29, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--paper); width: 100%; max-height: 92vh; border-radius: var(--r-l) var(--r-l) 0 0;
  display: flex; flex-direction: column; box-shadow: var(--shadow);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet header { display: flex; align-items: center; gap: 8px; padding: 12px 10px 10px 18px; border-bottom: 1px solid var(--line-2); }
.sheet header h3 { margin: 0; font-size: 17px; font-weight: 600; flex: 1; }
.sheet .body { padding: 16px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet footer { display: flex; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.sheet footer .btn { flex: 1; }
@media (min-width: 700px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: var(--r-l); max-height: 88vh; }
  .sheet.wide { max-width: 760px; }
}

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r-m); z-index: 90;
  font-size: 14px; box-shadow: var(--shadow); max-width: calc(100% - 32px); display: flex; gap: 12px; align-items: center;
}
.toast button { background: none; border: 0; color: var(--amber); font-weight: 600; padding: 0; }
@media (min-width: 900px) { .toast { bottom: 26px; } }

/* Captura */
.capgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.capgrid button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px; border-radius: var(--r-m);
  border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; color: var(--ink-2);
}
.capgrid button svg { width: 24px; height: 24px; color: var(--ink); }
.capgrid button.voice { background: var(--red-soft); border-color: transparent; }
.capgrid button.voice svg { color: var(--red); }

.recorder { text-align: center; padding: 10px 0 4px; }
.recorder .time { font-size: 44px; font-weight: 600; letter-spacing: -.02em; }
.recorder .pulse { width: 14px; height: 14px; border-radius: 50%; background: var(--red); display: inline-block; margin-right: 8px; animation: pulse 1.2s infinite; vertical-align: middle; }
@keyframes pulse { 50% { opacity: .25; } }
.recorder .live { min-height: 80px; text-align: left; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m); padding: 12px; margin-top: 14px; color: var(--ink-2); font-size: 15px; }

/* ---------- Hoy ---------- */
.hoyhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 2px 0 18px; }
.hoyhead .date { font-size: 34px; font-weight: 650; letter-spacing: -.03em; line-height: 1; }
.hoyhead .date span { display: block; font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); margin-top: 6px; }
.money4 { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--r-l); overflow: hidden; margin: 0 0 24px; }
.money4 a { background: var(--surface); padding: 12px 14px; text-decoration: none; }
.money4 b { display: block; font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.money4 small { color: var(--ink-3); font-size: 13px; }
@media (min-width: 600px) { .money4 { grid-template-columns: repeat(4, 1fr); } }

/* Línea del día: el elemento protagonista */
.dayline { position: relative; list-style: none; margin: 0; padding: 0 0 0 64px; }
.dayline::before { content: ""; position: absolute; left: 52px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.dayline li { position: relative; padding: 0 0 12px; }
.dayline .tm { position: absolute; left: -64px; width: 46px; text-align: right; top: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.dayline .nub { position: absolute; left: -16px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-3); }
.dayline .card { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line-2); border-left: 4px solid var(--c, var(--ink-3)); border-radius: var(--r-m); padding: 9px 12px; }
.dayline .card .t { font-weight: 600; }
.dayline .card .m { font-size: 13px; color: var(--ink-3); }
.dayline li.past .card { opacity: .55; }
.dayline li.past .nub { background: var(--ink-3); }
.dayline li.now { height: 22px; padding: 0; }
.dayline li.now::before { content: ""; position: absolute; left: -14px; right: 0; top: 10px; height: 3px; background: var(--amber); border-radius: 2px; }
.dayline li.now span { position: absolute; left: -64px; width: 46px; text-align: right; top: 2px; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--amber-soft); border-radius: 4px; padding: 0 2px; }

.hoygrid { display: grid; gap: 0; }
@media (min-width: 900px) {
  .hoygrid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
  .hoygrid .colA { grid-row: span 3; }
}
@media (min-width: 1200px) {
  .hoygrid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .9fr); }
}

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar .lab { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; gap: 8px; }
.bar .trk { height: 8px; background: var(--sunk); border-radius: 4px; overflow: hidden; position: relative; }
.bar .fil { height: 100%; border-radius: 4px; }
.bar .lim { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); }
.cols { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 6px; }
.cols .c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.cols .c i { width: 100%; max-width: 30px; background: var(--ink-2); border-radius: 4px 4px 0 0; min-height: 2px; display: block; }
.cols .c.hl i { background: var(--amber); }
.cols .c small { font-size: 11px; color: var(--ink-3); white-space: nowrap; }

/* ---------- Agenda ---------- */
.agbar { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.agbar .title { font-size: 18px; font-weight: 600; flex: 1; min-width: 140px; }
.nlbox { position: relative; margin: 0 0 14px; }
.nlbox input { padding-left: 40px; }
.nlbox svg { position: absolute; left: 12px; top: 12px; color: var(--ink-3); }

.tgrid { position: relative; display: grid; border: 1px solid var(--line-2); border-radius: var(--r-l); background: var(--surface); overflow: hidden; }
.tgrid .hdr { display: grid; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; z-index: 3; background: var(--surface); }
.tgrid .hdr div { padding: 8px 4px; text-align: center; font-size: 13px; color: var(--ink-2); border-left: 1px solid var(--line-2); }
.tgrid .hdr div.today { color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px 0 var(--amber); }
.tgrid .allday { display: grid; border-bottom: 1px solid var(--line-2); }
.tgrid .allday > div { padding: 4px; border-left: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 3px; min-height: 8px; }
.tgrid .scroll { max-height: 64vh; overflow-y: auto; position: relative; }
.tgrid .body { display: grid; position: relative; }
.tgrid .hours div { height: 52px; font-size: 11px; color: var(--ink-3); text-align: right; padding: 0 6px; transform: translateY(-7px); }
.tgrid .daycol { position: relative; border-left: 1px solid var(--line-2); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 51px, var(--line-2) 51px, var(--line-2) 52px); cursor: copy; }
.tgrid .daycol.today { background-color: color-mix(in srgb, var(--amber-soft) 35%, transparent); }
.tgrid .ev { position: absolute; left: 2px; right: 2px; border-radius: 6px; padding: 3px 6px; font-size: 12px; line-height: 1.25; overflow: hidden; text-decoration: none;
  background: color-mix(in srgb, var(--c, var(--blue)) 16%, var(--surface)); border-left: 3px solid var(--c, var(--blue)); color: var(--ink); cursor: pointer; z-index: 1; }
.tgrid .ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgrid .nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--amber); z-index: 2; pointer-events: none; }
.tgrid .nowline::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); }
.adchip { font-size: 12px; padding: 2px 6px; border-radius: 5px; background: var(--red-soft); color: var(--red); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.adchip.task { background: var(--sunk); color: var(--ink-2); }

.month { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line-2); border-radius: var(--r-l); overflow: hidden; background: var(--line-2); gap: 1px; }
.month .wd { background: var(--surface); text-align: center; font-size: 12px; color: var(--ink-3); padding: 6px 0; }
.month .d { background: var(--surface); min-height: 62px; padding: 4px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.month .d.out { background: var(--paper); color: var(--ink-3); }
.month .d .n { font-size: 13px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.month .d.today .n { background: var(--amber); color: #1E2A33; }
.month .d .dots { display: flex; gap: 3px; flex-wrap: wrap; padding: 0 2px; }
.month .d .ttl { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 2px solid var(--c); padding-left: 4px; display: none; }
@media (min-width: 900px) {
  .month .d { min-height: 104px; }
  .month .d .ttl { display: block; }
  .month .d .dots { display: none; }
}

.weeklist .day { margin-bottom: 12px; }
.weeklist .day h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.weeklist .day.today h4 { color: var(--ink); }
.weeklist .day.today h4::after { content: " · hoy"; color: var(--amber); }

/* Detalle */
.dhead { margin: 0 0 16px; }
.dhead .crumbs { font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 6px; }
.dhead .crumbs a { color: var(--ink-2); }
.dhead h2 { font-size: 24px; margin: 0; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 15px; margin: 0 0 18px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.bodytext { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m); padding: 12px 14px; margin: 0 0 18px; }
.photo-big { border-radius: var(--r-l); margin: 0 0 16px; max-height: 70vh; width: auto; background: var(--sunk); cursor: zoom-in; }
audio { width: 100%; margin: 4px 0 14px; }
.callout { border-left: 4px solid var(--amber); background: var(--surface); padding: 12px 14px; border-radius: 0 var(--r-m) var(--r-m) 0; margin: 0 0 18px; }
.callout h4 { margin: 0 0 8px; font-size: 15px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }

/* Fotos */
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.pgrid a { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--sunk); display: block; }
.pgrid img { width: 100%; height: 100%; object-fit: cover; }
.pgrid span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 700px) { .pgrid { grid-template-columns: repeat(5, 1fr); gap: 8px; } }

/* Bandeja */
.inbox-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 14px; margin: 0 0 12px; }
.inbox-card textarea { min-height: 80px; margin: 6px 0 10px; }
.inbox-card .used { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.sendto { display: flex; gap: 6px; flex-wrap: wrap; }

/* Búsqueda */
.search-ov { position: fixed; inset: 0; z-index: 70; background: var(--paper); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
.search-ov .bar { display: flex; gap: 6px; align-items: center; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line-2); }
.search-ov .bar input { flex: 1; }
.search-ov .res { flex: 1; overflow-y: auto; padding: 12px 14px 40px; max-width: 900px; width: 100%; margin: 0 auto; }
.crumb { font-size: 12px; color: var(--ink-3); }
mark { background: var(--amber-soft); color: inherit; border-radius: 2px; padding: 0 1px; }
.hist { background: var(--surface); border: 1px solid var(--line-2); border-left: 4px solid var(--amber); border-radius: var(--r-m); padding: 12px 14px; margin: 0 0 16px; }
.hist .nums { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; margin: 8px 0 10px; }
.hist .nums b { display: block; font-size: 18px; }
.hist .nums small { color: var(--ink-3); font-size: 12px; }
@media (min-width: 600px) { .hist .nums { grid-template-columns: repeat(4, 1fr); } }

/* Listas editables */
.lm-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.lm-item .name { flex: 1; min-width: 0; }
.lm-item .name small { color: var(--ink-3); display: block; font-size: 12px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; }
.swatches button.on { border-color: var(--ink); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login form { width: 100%; max-width: 360px; }
.login h1 { font-size: 34px; margin: 0 0 4px; letter-spacing: -.03em; display: flex; align-items: center; gap: 10px; }
.login h1 i { width: 12px; height: 30px; background: var(--amber); border-radius: 3px; display: inline-block; }
.login p { color: var(--ink-2); margin: 0 0 24px; }
.err { color: var(--red); font-size: 14px; margin: 0 0 12px; }

.loading { padding: 40px 0; text-align: center; color: var(--ink-3); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--sunk); padding: 10px; border-radius: var(--r-s); overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
