/* Jugueteca — estilo "bloques de juguete": papel cálido, bordes de tinta y sombras sólidas */
:root {
  --paper: #fbf6ee;
  --paper-2: #f3ebdd;
  --card: #fffdf9;
  --ink: #23201c;
  --ink-2: #5b544b;
  --muted: #8a8174;
  --line: #23201c;
  --soft: #e6dccb;
  --accent: #ef5a3c;
  --accent-ink: #fff;
  --ok: #2a9d8f;
  --warn: #e2a72e;
  --err: #c8372d;
  --radius: 14px;
  --shadow: 3px 3px 0 var(--line);
  --shadow-lg: 5px 5px 0 var(--line);
  --font-h: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-b: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(35, 32, 28, .06) 1px, transparent 0);
  background-size: 22px 22px;
  color: var(--ink);
  font: 16px/1.5 var(--font-b);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}
body.bare { padding-bottom: 0; }
h1, h2, h3 { font-family: var(--font-h); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.25rem; }
a { color: inherit; }
img { max-width: 100%; display: block; }
code, .code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
small { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 32px; }

/* ---------- Barra superior / navegación ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(251, 246, 238, .92); backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-h); font-weight: 700; font-size: 1.3rem; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid var(--line); border-radius: 11px; background: var(--warn); box-shadow: 2px 2px 0 var(--line); font-size: 1.2rem; }
.mainnav { margin-left: auto; display: flex; gap: 6px; }
.mainnav a { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 700; color: var(--ink-2); border: 2px solid transparent; }
.mainnav a em { font-style: normal; }
.mainnav a:hover { background: var(--paper-2); }
.mainnav a.on { border-color: var(--line); background: var(--card); color: var(--ink); box-shadow: 2px 2px 0 var(--line); }
.mainnav .nav-add { background: var(--accent); color: #fff; border-color: var(--line); box-shadow: 2px 2px 0 var(--line); }
.mainnav .nav-add span { font-weight: 800; }

@media (max-width: 760px) {
  /* backdrop-filter crea un contenedor para elementos fijos: se quita para que la barra inferior quede abajo */
  .topbar { justify-content: center; backdrop-filter: none; background: var(--paper); }
  .mainnav {
    position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 30;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 6px 8px env(safe-area-inset-bottom);
    background: var(--card); border-top: 2px solid var(--line);
    justify-content: space-around; align-items: center; gap: 0;
  }
  .mainnav a { flex-direction: column; gap: 0; padding: 4px 6px; font-size: .7rem; border: 0; min-width: 58px; }
  .mainnav a span { font-size: 1.3rem; line-height: 1.2; }
  .mainnav a.on { background: var(--paper-2); box-shadow: none; }
  .mainnav .nav-add { width: 54px; height: 54px; min-width: 0; border-radius: 50%; margin-top: -26px; border: 2px solid var(--line); box-shadow: 3px 3px 0 var(--line); justify-content: center; }
  .mainnav .nav-add span { font-size: 1.7rem; }
  .mainnav .nav-add em { display: none; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--card); color: var(--ink); font: 700 .95rem var(--font-b);
  text-decoration: none; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .08s, box-shadow .08s; white-space: nowrap;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-sm { padding: 6px 11px; font-size: .85rem; border-radius: 10px; box-shadow: 2px 2px 0 var(--line); }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 6px 9px; }
.btn-danger-ghost { color: var(--err); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; }

/* ---------- Mensajes ---------- */
.flash { padding: 12px 16px; border: 2px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; font-weight: 700; box-shadow: var(--shadow); background: #dff3ef; }
.flash-err { background: #fde2dc; }
.note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border: 2px dashed var(--ink-2); border-radius: var(--radius); margin: 16px 0; background: #fff7e2; }
.inline { display: inline; }

/* ---------- Encabezados de página ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.count { display: inline-grid; place-items: center; min-width: 30px; padding: 0 8px; height: 28px; border: 2px solid var(--line); border-radius: 99px; font: 700 .9rem var(--font-b); background: var(--warn); vertical-align: middle; }
.back { display: inline-block; margin-bottom: 12px; font-weight: 700; text-decoration: none; color: var(--ink-2); }
.eyebrow { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 800; opacity: .8; }

/* ---------- Paneles ---------- */
.panel, .card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.panel-head a { font-weight: 700; font-size: .9rem; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .grid-2, .grid-2.even { grid-template-columns: 1fr; } }

/* ---------- Hero (inicio) ---------- */
.hero {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 0;
  border: 2px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); margin-bottom: 20px;
}
.hero-main { padding: 26px; background: var(--c); color: #fff; position: relative; overflow: hidden; }
.hero-main::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 180px; height: 180px; border-radius: 30px; transform: rotate(18deg); background: rgba(255,255,255,.14); }
.hero-main h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); margin: 0; text-shadow: 2px 2px 0 rgba(0,0,0,.18); }
.hero-dates { margin: 6px 0 0; font-weight: 700; }
.hero-place { margin: 6px 0 0; opacity: .95; }
.hero-next { padding: 22px 24px; background: var(--card); border-left: 2px solid var(--line); }
.hero-big { font: 700 2rem var(--font-h); margin: 0; }
.hero-next p { margin: 0 0 8px; }
@media (max-width: 640px) { .hero { grid-template-columns: 1fr; } .hero-next { border-left: 0; border-top: 2px solid var(--line); } }

.alert-rotate {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 18px;
  border: 2px solid var(--line); border-radius: var(--radius); background: #fff1c9; text-decoration: none; box-shadow: var(--shadow);
  animation: nudge 2.4s ease-in-out infinite;
}
.alert-icon { font-size: 1.6rem; }
.alert-go { margin-left: auto; font-weight: 800; white-space: nowrap; }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .alert-rotate { animation: none; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 8px; }
.stat { display: flex; flex-direction: column; padding: 14px 16px; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); text-decoration: none; box-shadow: var(--shadow); }
.stat b { font: 700 1.9rem var(--font-h); line-height: 1; }
.stat span { color: var(--ink-2); font-size: .85rem; font-weight: 600; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.upcoming { list-style: none; margin: 0; padding: 0; }
.upcoming li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1.5px dashed var(--soft); }
.upcoming li:last-child { border-bottom: 0; }
.upcoming small { display: block; }
.dot { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); background: var(--c); flex: none; }
.tag { margin-left: auto; font-style: normal; font-size: .75rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--paper-2); }

.bars { list-style: none; margin: 0; padding: 0; }
.bars a { display: grid; grid-template-columns: 1fr 1.2fr auto; align-items: center; gap: 10px; padding: 6px 0; text-decoration: none; }
.bar { height: 14px; border: 2px solid var(--line); border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--c); border-right: 2px solid var(--line); }
.bar-n { font-weight: 800; min-width: 2ch; text-align: right; }
.bar-label { font-weight: 700; font-size: .92rem; }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; padding: 3px 10px 3px 8px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); }
.chip::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c, #999); border: 1.5px solid var(--line); }
.chip-solid { background: var(--c); color: #fff; font-size: .9rem; padding: 5px 12px; text-shadow: 1px 1px 0 rgba(0,0,0,.2); }
.chip-solid::before { display: none; }
.chip-fixed { background: #fff1c9; }
.chip-fixed::before, .chip-none::before { display: none; }
.chip-none { color: var(--muted); border-style: dashed; }

/* ---------- Tarjetas de juguete ---------- */
.toys { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.toys-sm { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
@media (max-width: 480px) { .toys { grid-template-columns: repeat(2, 1fr); gap: 12px; } .toys-sm { grid-template-columns: repeat(3, 1fr); } }
.toy { display: flex; flex-direction: column; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; box-shadow: var(--shadow); transition: transform .1s, box-shadow .1s; }
.toy:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.toy-img { position: relative; aspect-ratio: 1; background: var(--paper-2); border-bottom: 2px solid var(--line); }
.toy-img img { width: 100%; height: 100%; object-fit: cover; }
.toy-noimg { display: grid; place-items: center; height: 100%; font-size: 3rem; }
.toy-flag { position: absolute; top: 6px; right: 6px; background: var(--card); border: 2px solid var(--line); border-radius: 99px; padding: 1px 6px; font-size: .85rem; }
.toy-body { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 4px; }
.toy-body strong { font-size: .95rem; line-height: 1.25; }
.toys-sm .toy-body { padding: 7px 9px 9px; }
.toys-sm .toy-body strong { font-size: .82rem; }
.code { font-size: .75rem; font-weight: 700; color: var(--ink-2); letter-spacing: .03em; }
.code-lg { display: inline-block; font-size: 1rem; padding: 3px 10px; border: 2px solid var(--line); border-radius: 8px; background: #fff1c9; }

/* ---------- Filtros ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.filters .f-search { flex: 1 1 260px; }
.filters select { flex: 0 1 auto; }
.clear { font-weight: 700; font-size: .9rem; }

/* ---------- Formularios ---------- */
input, select, textarea {
  font: inherit; color: var(--ink); width: 100%;
  padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.filters select, .filters input { width: auto; }
.filters .f-search { width: auto; }
input[type="color"] { width: 44px; height: 42px; padding: 3px; flex: none; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
textarea { resize: vertical; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: .92rem; }
.form label small { font-weight: 500; }
.form { display: flex; flex-direction: column; gap: 14px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fields > * { min-width: 0; }
.span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }
label.check { flex-direction: row !important; align-items: center; gap: 8px; font-weight: 700; }
.check-card { padding: 12px 14px; border: 2px dashed var(--ink-2); border-radius: 12px; background: #fffaf0; align-items: flex-start !important; }
.check-card span { display: flex; flex-direction: column; }

.toy-form { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
@media (max-width: 760px) { .toy-form { grid-template-columns: 1fr; padding: 16px; } }
.photo-field { display: flex; flex-direction: column; gap: 10px; }
.photo-drop, .form .photo-drop { display: grid; place-items: center; aspect-ratio: 1; border: 2.5px dashed var(--ink-2); border-radius: 16px; background: var(--paper-2); cursor: pointer; overflow: hidden; }
.photo-drop img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; color: var(--ink-2); }
.photo-empty b { font-size: 3rem; }
.photo-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-bar { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 14px; border-top: 2px dashed var(--soft); }
.spacer { flex: 1; }
@media (max-width: 560px) { .form-bar .btn { flex: 1 1 100%; } .form-bar .spacer { display: none; } }

/* ---------- Detalle ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 26px; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow-lg); }
@media (max-width: 760px) { .detail { grid-template-columns: 1fr; padding: 14px; } }
.detail-photo img { width: 100%; border-radius: 14px; border: 2px solid var(--line); }
.detail-noimg { display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; aspect-ratio: 1; font-size: 5rem; background: var(--paper-2); border: 2px dashed var(--ink-2); border-radius: 14px; }
.detail h1 { margin: 10px 0 12px; }
.status-line { padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); font-weight: 800; margin-bottom: 14px; }
.status-line.is-out { background: #dff3ef; }
.status-line.is-in { background: var(--paper-2); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0 0 14px; }
.facts dt { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.notes { background: #fffaf0; border-left: 4px solid var(--warn); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; padding: 14px; background: var(--paper-2); border-radius: 12px; }
.quick-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: .85rem; }
@media (max-width: 480px) { .quick { grid-template-columns: 1fr; } .facts { grid-template-columns: 1fr; } }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }

/* ---------- Calendario ---------- */
.cal { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); margin: 14px 0 20px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head h2 { margin: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: .75rem; font-weight: 800; color: var(--muted); padding: 4px 0; text-transform: uppercase; }
.cal-day {
  position: relative; min-height: 78px; padding: 6px; border-radius: 10px;
  background: color-mix(in srgb, var(--c) 22%, #fff); border: 1.5px solid color-mix(in srgb, var(--c) 45%, #fff);
}
.cal-day.other { opacity: .38; }
.cal-day.today { outline: 3px solid var(--ink); outline-offset: -1px; }
.cal-day.start { border: 2px solid var(--line); background: color-mix(in srgb, var(--c) 45%, #fff); }
.cal-num { font-weight: 800; font-size: .9rem; }
.cal-rot { display: block; margin-top: 4px; font-size: .78rem; font-weight: 800; line-height: 1.2; }
.cal-rot em { font-style: normal; }
@media (max-width: 560px) { .cal-day { min-height: 54px; padding: 4px; } .cal-rot em { display: none; } .cal { padding: 10px; } }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: .85rem; font-weight: 700; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; background: var(--c); border: 1.5px solid var(--line); }

.periods { display: flex; flex-direction: column; gap: 8px; }
.period { display: grid; grid-template-columns: 90px 1fr 1.4fr auto 90px; gap: 8px; align-items: center; padding: 8px 10px 8px 14px; border: 2px solid var(--line); border-radius: 12px; border-left: 10px solid var(--c); background: #fff; }
.period.current { background: #fff7e2; }
.period-date b { display: block; font-family: var(--font-h); font-size: 1.05rem; }
.period-state { font-size: .82rem; font-weight: 700; text-align: right; }
@media (max-width: 760px) {
  .period { grid-template-columns: 1fr 1fr; }
  .period input[name="note"] { grid-column: 1 / -1; }
  .period-state { text-align: left; }
}
.ics-links { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.ics-links .copy { flex: 1 1 280px; font-size: .8rem; font-family: ui-monospace, Menlo, monospace; background: var(--paper-2); }

/* ---------- Rotación ---------- */
.rot-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border: 2px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--c) 18%, #fff); box-shadow: var(--shadow-lg); margin-bottom: 16px; }
.rot-banner h2 { font-size: 1.6rem; margin: 0; }
.rot-swap { display: flex; align-items: center; gap: 10px; }
.swap-arrow { font: 700 1.8rem var(--font-h); }
.rot-steps { background: var(--card); border: 2px dashed var(--ink-2); border-radius: var(--radius); padding: 14px 18px 14px 38px; margin: 0 0 20px; }
.rot-steps li { margin: 4px 0; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist label { display: flex; align-items: center; gap: 12px; padding: 8px; border: 2px solid var(--soft); border-radius: 12px; cursor: pointer; transition: background .1s; }
.checklist input { width: 24px; height: 24px; }
.checklist input:checked ~ .cl-txt { text-decoration: line-through; opacity: .5; }
.checklist label:has(input:checked) { background: #dff3ef; border-color: var(--ok); }
.cl-img { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 10px; overflow: hidden; background: var(--paper-2); font-size: 1.6rem; border: 1.5px solid var(--line); }
.cl-img img { width: 100%; height: 100%; object-fit: cover; }
.cl-txt { display: flex; flex-direction: column; line-height: 1.25; }
.warn { font-size: .78rem; font-weight: 800; color: var(--err); }
details.panel summary { cursor: pointer; margin-bottom: 4px; }
details.panel[open] summary { margin-bottom: 12px; }
.done-bar { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px); display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px; background: var(--card); border: 2px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); font-weight: 700; }
@media (min-width: 761px) { .done-bar { bottom: 14px; } }

/* ---------- Ajustes ---------- */
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.toc a { padding: 5px 12px; border: 2px solid var(--line); border-radius: 99px; background: var(--card); text-decoration: none; font-weight: 700; font-size: .85rem; }
.panel[id] { scroll-margin-top: 80px; }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px; border: 2px solid var(--soft); border-radius: 12px; background: #fff; }
.row > input:not([type="color"]):not([type="checkbox"]) { flex: 1 1 160px; width: auto; }
.row .in-icon { flex: 0 0 56px !important; text-align: center; }
.row .in-prefix { flex: 0 0 90px !important; text-transform: uppercase; font-family: ui-monospace, Menlo, monospace; }
.row-n { font-size: .82rem; font-weight: 800; color: var(--muted); min-width: 56px; }
.row-actions { display: flex; gap: 6px; margin-left: auto; }
.row-add { border-style: dashed; background: var(--paper); }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 14px; border: 2px solid var(--soft); border-radius: 12px; background: #fff; }
.tool p { margin: 0 0 6px; font-size: .88rem; color: var(--ink-2); flex: 1; }

/* ---------- Vacíos / bienvenida ---------- */
.empty, .empty-hero { text-align: center; padding: 40px 20px; }
.empty-hero { background: var(--card); border: 2px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); max-width: 640px; margin: 10px auto; }
.empty-emoji { font-size: 3.2rem; letter-spacing: .1em; }
.steps { text-align: left; max-width: 460px; margin: 26px auto 0; }
.steps li { margin: 8px 0; }

/* ---------- Login / setup ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 2px solid var(--line); border-radius: 22px; padding: 28px 24px; box-shadow: 6px 6px 0 var(--line); }
.auth-hero { font-size: 2.8rem; text-align: center; }
.auth-card h1 { text-align: center; margin-bottom: 2px; }
.auth-card > .muted { text-align: center; margin-top: 0; }
body.bare .wrap { padding: 0; max-width: none; }

/* ---------- Etiquetas ---------- */
.labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px dashed #999; border-left: 1px dashed #999; background: #fff; }
.label { display: flex; align-items: center; gap: 10px; padding: 10px; border-right: 1px dashed #999; border-bottom: 1px dashed #999; border-left: 8px solid var(--c); break-inside: avoid; min-height: 92px; }
.label-img { width: 64px; height: 64px; flex: none; display: grid; place-items: center; font-size: 2rem; border-radius: 8px; overflow: hidden; background: var(--paper-2); }
.label-img img { width: 100%; height: 100%; object-fit: cover; }
.label-txt { display: flex; flex-direction: column; min-width: 0; }
.label-code { font: 800 1.25rem ui-monospace, Menlo, monospace; letter-spacing: .04em; }
.label-name { font-weight: 700; font-size: .9rem; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.label-box { font-size: .75rem; color: var(--ink-2); }
@media (max-width: 560px) { .labels { grid-template-columns: repeat(2, 1fr); } }
.box-sheet { background: #fff; border: 3px solid var(--line); border-radius: 16px; margin-bottom: 20px; overflow: hidden; break-after: page; }
.box-sheet header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; padding: 18px 22px; background: var(--c); color: #fff; border-bottom: 3px solid var(--line); }
.box-sheet h2 { font-size: 2.6rem; margin: 0; }
.box-sheet header span { font-weight: 800; }
.box-sheet ol { columns: 2; column-gap: 30px; padding: 18px 22px 18px 44px; margin: 0; }
.box-sheet li { break-inside: avoid; padding: 4px 0; border-bottom: 1px dotted #bbb; }
.box-sheet li code { font-weight: 800; margin-right: 4px; }
.tick { float: right; }

.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 10px 0 20px; }

@media print {
  @page { size: letter; margin: 10mm; }
  body { background: #fff; padding: 0; }
  .topbar, .mainnav, .foot, .no-print, .flash { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .labels { grid-template-columns: repeat(3, 1fr) !important; }
  .label, .box-sheet header, .label-img { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .box-sheet { border-radius: 0; }
}
