:root {
  --board: #2c2c2c;
  --board-2: #333333;
  --card: #363636;
  --card-2: #404040;
  --line: rgba(255, 255, 255, 0.09);
  --chalk: #f4f1ea;
  --muted: #a9a59c;
  --red: #e3263f;
  --red-dark: #b5182d;
  --yellow: #ffc947;
  --yellow-dark: #e0a920;
  --green: #4cd07d;
  --radius: 18px;
  --display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--body);
  font-weight: 500;
  color: var(--chalk);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(255, 255, 255, 0.06), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(255, 255, 255, 0.04), transparent 60%),
    var(--board);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

/* Detalles de tiza: puntitos y estrellitas como en el flyer */
.chalk-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 1.6px, transparent 2px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='.45' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.6 5.6 6 .7-4.5 4.1 1.2 6-5.3-3-5.3 3 1.2-6L3.4 9.3l6-.7z'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' stroke='%23ffffff' stroke-opacity='.5' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 3v12M3 9h12'/%3E%3C/svg%3E");
  background-size: 18px 18px, auto, auto;
  background-repeat: repeat, no-repeat, no-repeat;
  background-position: -2px -2px, calc(100% - 22px) 120px, 18px 62%;
  -webkit-mask-image: linear-gradient(135deg, #000 0 14%, transparent 22% 100%);
  mask-image: linear-gradient(135deg, #000 0 14%, transparent 22% 100%);
}

.view { position: relative; z-index: 1; }
.splash { position: fixed; inset: 0; z-index: 1; display: grid; place-items: center; animation: fade 0.3s ease 0.15s both; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; left: 0; top: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.3px; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
hr { border: 0; border-top: 1px dashed var(--line); margin: 20px 0; }

.logo { display: block; height: auto; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45)); }
.logo-big { width: min(330px, 84vw); margin: 0 auto 8px; }
.logo-small { width: 128px; }

/* ---------- botones y campos ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  font: 800 17px/1 var(--body);
  color: var(--chalk);
  background: var(--card-2);
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:active { transform: translateY(2px) scale(0.98); }
.btn:disabled { opacity: 0.6; pointer-events: none; }
.btn-block { width: 100%; }
.btn-primary {
  font-family: var(--display);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.4px;
  background: var(--red);
  box-shadow: 0 4px 0 var(--red-dark);
}
.btn-yellow { color: #2a2112; background: var(--yellow); box-shadow: 0 4px 0 var(--yellow-dark); }
.btn-ghost { background: transparent; border: 2px solid var(--line); }
.btn-danger-ghost { background: transparent; color: #ff8a98; border: 2px solid rgba(227, 38, 63, 0.45); }
.icon-btn {
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: var(--card-2); color: var(--chalk);
  font-size: 18px; cursor: pointer;
}

.field { display: grid; gap: 7px; margin: 0 0 14px; }
.field > span { font-weight: 800; font-size: 15px; }
.field em { font-style: normal; color: var(--muted); font-weight: 600; }
.req { color: var(--yellow); }
input:not([type="file"]) {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: #1c1c1c;
  color: var(--chalk);
  font: 700 18px var(--body);
  outline: none;
  transition: border-color 0.15s;
}
input::placeholder { color: #6f6b64; font-weight: 600; }
input:focus { border-color: var(--yellow); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.money { position: relative; }
.money i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-weight: 800; }
.money input { padding-left: 32px; }
.error { color: #ff9aa6; font-weight: 700; margin: 0 0 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.stack > * + * { margin-top: 12px; }

/* ---------- ingreso ---------- */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 440px;
  margin: 0 auto;
}
.login-card h1 { margin-bottom: 2px; }
.login-card p { margin: 0 0 14px; }
.user-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin-bottom: 16px; }
.pick {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 14px 4px 12px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #262626;
  color: var(--chalk);
  font: 800 14px var(--body);
  font-size: 22px;
  cursor: pointer;
}
.pick span { font-size: 14px; }
.pick.is-on { border-color: var(--yellow); background: rgba(255, 201, 71, 0.12); }

/* ---------- panel ---------- */
#app-view { max-width: 720px; margin: 0 auto; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: linear-gradient(var(--board) 70%, rgba(44, 44, 44, 0));
}
.me-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 55%;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--chalk);
  font: 800 15px var(--body);
  cursor: pointer;
}
.me-chip #me-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--yellow); }

.toolbar { padding: 4px 16px 6px; }
.search {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 14px;
  border-radius: 16px;
  background: #1c1c1c;
  border: 2px solid transparent;
}
.search:focus-within { border-color: var(--yellow); }
.search input { border: 0 !important; background: transparent; padding-left: 8px; }
.toolbar-row { display: flex; align-items: center; justify-content: space-between; margin: 12px 2px 4px; }
.count { color: var(--muted); font-weight: 700; font-size: 14px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: #1c1c1c; }
.seg-btn {
  border: 0;
  padding: 7px 12px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: 800 13px var(--body);
  cursor: pointer;
}
.seg-btn.is-on { background: var(--card-2); color: var(--chalk); }

.list { list-style: none; margin: 0; padding: 6px 16px; display: grid; gap: 10px; }
.item {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
  animation: pop 0.25s ease both;
}
.item:active { background: var(--card-2); }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.thumb {
  width: 72px; height: 72px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #1c1c1c;
  cursor: zoom-in;
  display: grid;
  place-items: center;
  font-size: 30px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.no-photo { cursor: pointer; opacity: 0.7; }
.item-main { min-width: 0; }
.item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.item-name {
  font-weight: 800;
  font-size: 17px;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.item-meta { margin-top: 4px; font-size: 12.5px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.price {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.1;
  color: var(--yellow);
  white-space: nowrap;
}
.cost { font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; margin-top: 3px; }
.cost b { color: var(--green); font-weight: 800; }

.empty { text-align: center; padding: 60px 24px; }
.empty-emoji { font-size: 64px; margin-bottom: 10px; }
.empty h2 { margin-bottom: 6px; }

.fab {
  position: fixed;
  z-index: 6;
  right: 18px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 62px;
  padding: 0 26px 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font: 400 22px var(--display);
  letter-spacing: 0.5px;
  box-shadow: 0 5px 0 var(--red-dark), 0 14px 30px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}
.fab span { font-size: 26px; }
.fab:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--red-dark), 0 8px 20px rgba(0, 0, 0, 0.4); }
@media (min-width: 760px) { .fab { right: calc(50% - 340px); } }

/* ---------- hojas (dialogs) ---------- */
dialog { color: var(--chalk); }
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 94dvh;
  margin: auto auto 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background: var(--board-2);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet[open] { animation: slide-up 0.24s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } }
.sheet::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); }
@media (min-width: 600px) {
  .sheet { margin: auto; border-radius: 26px; border-bottom: 1px solid var(--line); }
}
.sheet-center { margin: auto; max-width: 380px; border-radius: 26px; border-bottom: 1px solid var(--line); width: calc(100% - 32px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-foot { display: flex; gap: 10px; margin-top: 6px; }
.sheet-foot .btn-primary { flex: 1; }
.big-emoji { font-size: 52px; text-align: center; }

.photo-box {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0 12px, transparent 12px 24px),
    #1c1c1c;
  border: 2px dashed rgba(255, 255, 255, 0.16);
}
.photo-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-empty, .photo-busy {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}
.photo-emoji { font-size: 44px; }
.photo-busy { background: rgba(0, 0, 0, 0.55); color: var(--chalk); }
.photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 18px; }
.photo-actions .btn { min-height: 48px; font-size: 16px; }

.margin { margin: -4px 0 12px; font-weight: 700; color: var(--muted); }
.margin b { color: var(--green); }
.meta { font-size: 13px; color: var(--muted); margin: 0 0 12px; line-height: 1.5; }

.users { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card);
}
.user-row b { display: block; }
.user-row small { color: var(--muted); }
.user-row .btn { min-height: 40px; padding: 0 14px; font-size: 14px; }

/* ---------- visor de fotos ---------- */
.viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(10, 10, 10, 0.94);
  display: none;
}
.viewer[open] { display: grid; place-items: center; animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; } }
.viewer img {
  max-width: 100vw;
  max-height: 82dvh;
  object-fit: contain;
  border-radius: 6px;
}
.viewer-close { position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 14px; z-index: 2; }
.viewer-caption {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  font: 400 22px var(--display);
}
.viewer-caption span { color: var(--yellow); margin-left: 8px; }

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--chalk);
  color: #1d1d1d;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: slide-up 0.2s ease;
}

/* ---------- categorías ---------- */
.section-title { margin: 8px 18px 10px; font-size: 20px; color: var(--chalk); }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 16px 8px; }
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
.cat-tile {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  min-height: 168px;
  padding: 16px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--c) 34%, transparent), transparent 70%),
    var(--card);
  color: var(--chalk);
  text-align: center;
  cursor: pointer;
  animation: pop 0.25s ease both;
  transition: transform 0.08s ease;
}
.cat-tile:active { transform: scale(0.97); }
.cat-icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 26px;
  background: color-mix(in srgb, var(--c, #6b6b6b) 30%, #1f1f1f);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c, #6b6b6b) 55%, transparent);
  font-size: 40px;
}
.cat-icon img { width: 64%; height: 64%; display: block; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.25)); }
.cat-icon.small { width: 44px; height: 44px; border-radius: 14px; flex: none; }
.cat-icon.big { width: 96px; height: 96px; border-radius: 30px; }
.cat-name { margin-top: 6px; font: 400 18px/1.15 var(--display); letter-spacing: 0.3px; }
.cat-count { font-size: 13px; font-weight: 700; color: var(--muted); }
.cat-new { background: transparent; border: 2px dashed rgba(255, 255, 255, 0.18); }
.cat-new .cat-icon { background: transparent; box-shadow: none; color: var(--yellow); font-size: 48px; }

.cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 16px 6px;
}
.cat-head #back-btn { font-size: 28px; line-height: 1; padding-bottom: 4px; flex: none; }
.cat-head-text { flex: 1; min-width: 0; }
.cat-head h2 { font-size: 23px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#cat-edit-btn { flex: none; font-size: 16px; }

.item-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--chalk);
  opacity: 0.85;
}
.item-cat img { width: 16px; height: 16px; }
.thumb.no-photo { background: color-mix(in srgb, var(--c, #6b6b6b) 28%, #1f1f1f); opacity: 1; }
.thumb.no-photo img { width: 60%; height: 60%; object-fit: contain; }

/* selector de categoría en el formulario de producto */
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #1f1f1f;
  color: var(--chalk);
  font: 800 14px var(--body);
  cursor: pointer;
}
.cat-chip img {
  width: 28px; height: 28px;
  padding: 4px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 35%, #1f1f1f);
}
.cat-chip.is-on { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, #1f1f1f); }

/* formulario de categoría */
.cat-preview { display: grid; justify-items: center; gap: 8px; margin: 0 0 16px; }
.cat-preview-name { font: 400 22px var(--display); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 34px; height: 34px;
  border: 3px solid transparent;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.swatch.is-on { border-color: var(--chalk); transform: scale(1.08); }
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 8px;
  max-height: 248px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 16px;
  background: #1f1f1f;
  overscroll-behavior: contain;
}
.icon-opt {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--card);
  cursor: pointer;
}
.icon-opt img { width: 100%; height: 100%; display: block; }
.icon-opt.is-on { border-color: var(--yellow); background: rgba(255, 201, 71, 0.15); }

/* ---------- ojito de contraseña ---------- */
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 56px; }
.eye {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-size: 21px;
  cursor: pointer;
}
.eye:active { background: rgba(255, 255, 255, 0.08); }

/* ---------- fotos de perfil ---------- */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: #1f1f1f;
}
.avatar img, .avatar-initial { width: 100%; height: 100%; display: grid; place-items: center; object-fit: cover; }
.avatar-initial { color: #fff; font-family: var(--display); }
.avatar.sm { width: 28px; height: 28px; margin: -4px 0 -4px -6px; }
.avatar.sm .avatar-initial { font-size: 15px; }
.avatar.md { width: 44px; height: 44px; }
.avatar.md .avatar-initial { font-size: 21px; }
.avatar.xl { width: 104px; height: 104px; border: 3px solid var(--yellow); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); }
.avatar.xl .avatar-initial { font-size: 48px; }
.me-photo { display: grid; justify-items: center; margin-bottom: 8px; }
.me-photo p { margin: 8px 0 0; }
.avatar-wrap { position: relative; }
.avatar-busy { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, 0.55); font-size: 26px; }
.avatar-actions { width: 100%; margin: 10px 0 4px; }
.link-btn { border: 0; background: none; color: var(--muted); font: 700 14px var(--body); text-decoration: underline; cursor: pointer; padding: 6px; }
.user-row { justify-content: flex-start; }
.user-row .user-info { flex: 1; min-width: 0; }
.user-row .user-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- historial del producto (admin) ---------- */
.history { margin: 0 0 14px; padding: 12px 14px; border-radius: 16px; background: #262626; }
.history h3 { font-size: 17px; margin-bottom: 8px; }
.history ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 220px; overflow-y: auto; }
.history ol > li { padding-left: 12px; border-left: 3px solid var(--yellow); font-size: 14px; }
.history small { color: var(--muted); font-weight: 700; }
.history ul { margin: 4px 0 0; padding-left: 18px; color: var(--chalk); font-size: 13.5px; }

/* ---------- marco de pizarrón para las fotos de productos ---------- */
/* Fondo negro con puntitos de tiza (como la portada) y la foto como una "figurita" con borde blanco. */
.chalk-frame,
.thumb:not(.no-photo),
.photo-box.has-photo {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.42) 1.1px, transparent 1.6px) 0 0 / 12px 12px,
    radial-gradient(120% 90% at 30% 0%, #3a3a3a, #161616 70%);
}
.chalk-frame img,
.thumb:not(.no-photo) img,
.photo-box.has-photo img {
  border: 3px solid var(--chalk);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  background: #1b1b1b;
}

/* miniatura de la lista */
.thumb:not(.no-photo) { padding: 7px; }
.thumb:not(.no-photo) img { border-width: 2px; border-radius: 8px; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55); }

/* foto en el formulario */
.photo-box.has-photo { border-style: solid; border-color: rgba(255, 255, 255, 0.08); padding: 16px 22px; }
.photo-box.has-photo img { transform: rotate(-1.2deg); }

/* foto en grande */
.viewer-frame {
  display: grid;
  place-items: center;
  max-width: min(94vw, 720px);
  padding: 22px;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.viewer .viewer-frame img { max-width: 100%; max-height: 70dvh; border-radius: 14px; border-width: 4px; }

/* ---------- ✨ quitar fondo ---------- */
.bg-tools { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: -6px 0 18px; }
.bg-tools .btn { min-height: 46px; font-size: 16px; }
.bg-tools .btn:only-child, .bg-tools .btn[hidden] + .btn { grid-column: 1 / -1; }
.btn-magic {
  color: #fff;
  background: linear-gradient(135deg, #9b5de5, #f26ca7 55%, #ffc947);
  box-shadow: 0 4px 0 #6d3aa8;
}
.btn-magic small { font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.25); }
.photo-busy { padding: 0 20px; text-align: center; }

/* ---------- 🔔 campanita y actividad (admin) ---------- */
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bell {
  position: relative;
  flex: none;
  width: 46px;
  height: 46px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  font-size: 20px;
  cursor: pointer;
}
.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font: 800 12px/22px var(--body);
  box-shadow: 0 0 0 2px var(--board);
  animation: pop 0.25s ease;
}
.sheet-tall { min-height: 80dvh; }
.cal { padding: 10px 10px 12px; border-radius: 18px; background: #262626; margin-bottom: 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-head b { font: 400 18px var(--display); }
.cal-head .icon-btn { width: 34px; height: 34px; font-size: 20px; }
.cal-head .icon-btn:disabled { opacity: 0.3; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-week span { font-size: 12px; font-weight: 800; color: var(--muted); padding: 2px 0; }
.cal-day {
  position: relative;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--chalk);
  font: 700 14px var(--body);
  cursor: pointer;
}
.cal-day.has-act::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--yellow);
}
.cal-day.is-today { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25); }
.cal-day.is-on { background: var(--red); color: #fff; }
.cal-day.is-on::after { background: #fff; }
.act-filter { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 8px; font-weight: 800; }
.act-range { }
.act-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.act-tabs::-webkit-scrollbar { display: none; }
.act-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #1f1f1f;
  color: var(--chalk);
  font: 800 13px var(--body);
  cursor: pointer;
}
.act-tab span { padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-size: 12px; }
.act-tab.is-on { border-color: var(--yellow); background: rgba(255, 201, 71, 0.14); }
.act-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.act-day { margin-top: 6px; font: 400 16px var(--display); color: var(--yellow); }
.act-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card); }
.act-item.is-new { box-shadow: inset 3px 0 0 var(--red); }
.act-icon { font-size: 20px; line-height: 1.3; text-align: center; }
.act-body { font-size: 14.5px; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
.act-body ul { margin: 4px 0 2px; padding-left: 18px; font-size: 13.5px; }
.act-body small { color: var(--muted); font-weight: 700; }
.act-body em { color: #ff8a98; font-style: normal; }
.act-empty { padding: 26px 10px; text-align: center; color: var(--muted); }
.topbar-right .me-chip { max-width: none; }
.topbar-right .me-chip #me-name { max-width: 110px; }
