/* GIRI — interfaz web
   Dirección: papel washi, tinta sumi y un solo acento bermellón por pantalla (el sello o el botón principal).
   Solo modo claro. Los colores salen de css/tokens.css (ver docs/MARCA.md); acá solo se les da un rol.
   La hoja impresa NO depende de este archivo (se dibuja en js/calendar-engine.js). */

:root {
  color-scheme: light;
  /* Superficies */
  --bg: var(--giri-washi);
  --bg-2: var(--giri-washi-2);
  --surface: color-mix(in srgb, var(--giri-washi) 70%, var(--giri-papel));
  --surface-solid: color-mix(in srgb, var(--giri-washi) 55%, var(--giri-papel));
  --line: color-mix(in srgb, var(--giri-piedra) 32%, transparent);
  --line-strong: color-mix(in srgb, var(--giri-piedra) 60%, transparent);
  /* Texto */
  --ink: var(--giri-sumi);
  --muted: var(--giri-texto-2);
  --faint: var(--giri-texto-2);
  /* Trimestres (koi) */
  --q1: var(--giri-q1);
  --q2: var(--giri-q2);
  --q3: var(--giri-q3);
  --q4: var(--giri-q4);
  --grad: linear-gradient(90deg, var(--q1), var(--q2) 34%, var(--q3) 67%, var(--q4));
  /* Acciones: la interfaz va en tinta; el bermellón queda para el sello y el botón principal (.sello) */
  --accent: var(--giri-sumi);
  --accent-hover: color-mix(in srgb, var(--giri-sumi) 85%, black);
  --sello: var(--giri-bermellon);
  --sello-hover: color-mix(in srgb, var(--giri-bermellon) 88%, black);
  --on-accent: var(--giri-washi);
  --ok: var(--giri-q1);
  --danger: var(--giri-bermellon);
  /* Forma y profundidad: sombras cálidas, en tinta */
  --r-xl: 20px;
  --r-lg: 16px;
  --r-md: 10px;
  --shadow: 0 1px 1px color-mix(in srgb, var(--giri-sumi) 4%, transparent), 0 12px 32px -14px color-mix(in srgb, var(--giri-sumi) 22%, transparent);
  --shadow-lift: 0 30px 70px -26px color-mix(in srgb, var(--giri-sumi) 38%, transparent);
  --font: var(--giri-sans);
  --serif: var(--giri-serif);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; border-radius: 8px; }

.wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: max(22px, env(safe-area-inset-left));
}

/* ---------- barra superior ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 20px; font-size: 15px; }
.nav-links a:not(.pill) { color: var(--ink); text-decoration: none; }
.nav-links a:not(.pill):hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- marca: wordmark y mini sello (docs/MARCA.md) ---------- */
.wordmark {
  font: 600 20px/1 var(--serif);
  letter-spacing: 0.32em;
  margin-right: -0.32em; /* el espaciado no suma después de la última letra */
  color: var(--ink);
}
.sello-mini {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  padding-top: 1px;
  border-radius: 6px;
  background: var(--sello);
  color: var(--giri-washi);
  font: 600 10.5px/1.02 var(--giri-kanji);
  writing-mode: vertical-rl; /* 義 arriba, 理 abajo, como en el sello grande */
  letter-spacing: 0;
}
.versalitas {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- botones ---------- */
.pill, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: 0;
  border-radius: 980px;
  background: var(--accent);
  color: var(--on-accent);
  font: 500 16px/1 var(--font);
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition: transform .35s var(--ease), background-color .2s, box-shadow .35s var(--ease), opacity .2s;
}
.pill:hover, .btn:hover { background: var(--accent-hover); }
.pill:active, .btn:active { transform: scale(.97); }
.pill.sm { min-height: 32px; padding: 6px 14px; font-size: 13px; }
.btn.alt, .pill.ghost {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.btn.alt:hover, .pill.ghost:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
/* Botón principal de la pantalla: el único acento bermellón (junto con el sello) */
.btn.hot, .pill.sello { background: var(--sello); color: var(--on-accent); font-weight: 600; }
.btn.hot:hover, .pill.sello:hover { background: var(--sello-hover); }
.pill.linea { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.pill.linea:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.btn.sm { min-height: 34px; padding: 7px 14px; font-size: 14px; }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btns.end { align-self: end; }
.link-more { color: var(--accent); text-decoration: none; font-size: 17px; }
.link-more:hover { text-decoration: underline; }

/* ---------- encabezado de páginas internas (tienda) ---------- */
.eyebrow { margin: 0 0 14px; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.hero-sub {
  max-width: 34em;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.45;
  text-wrap: balance;
}

/* ---------- portada: el sello ---------- */
.portada { padding-block: clamp(40px, 7vw, 88px) clamp(56px, 9vw, 110px); text-align: center; overflow: clip; }
.sello-grande { width: min(560px, 100%); margin: 0 auto; }

/* Parallax del hero, solo CSS: tres capas apiladas en la misma celda que se mueven a distinta velocidad con el scroll.
   Fondo 40 px (y escala de .95 a 1 al entrar), medio 120 px (el sello) y frente 240 px, mientras el hero sale de la pantalla.
   El parallax va en la capa (.capa-medio) y el giro lento en el SVG de adentro (.sello-anillo): no se pisan.
   Sin soporte de animation-timeline queda estático; con prefers-reduced-motion, sin animación. */
.escena { position: relative; display: grid; place-items: center; view-timeline: --escena block; }
.escena > .capa { grid-area: 1 / 1; width: 100%; }
.capa-fondo { display: grid; place-items: center; }
.hoja-falsa {
  width: min(1040px, 100%);
  aspect-ratio: 2 / 1;
  border-radius: 24px;
  /* grilla de 53 columnas finas y 4 franjas por trimestre: una hoja sugerida, sin fechas ni nombres */
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--giri-sumi) 8%, transparent) 1px, transparent 1px) 0 0 / calc(100% / 53) 100%,
    linear-gradient(180deg,
      transparent 0 4%,
      color-mix(in srgb, var(--giri-q1) 15%, transparent) 4% 26%, transparent 26% 28%,
      color-mix(in srgb, var(--giri-q2) 15%, transparent) 28% 50%, transparent 50% 52%,
      color-mix(in srgb, var(--giri-q3) 15%, transparent) 52% 74%, transparent 74% 76%,
      color-mix(in srgb, var(--giri-q4) 15%, transparent) 76% 98%, transparent 98%),
    var(--giri-washi);
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
}
.capa-medio { position: relative; z-index: 1; }
.capa-frente { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.pieza { position: absolute; display: grid; place-items: center; box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--giri-sumi) 40%, transparent); }
/* mini sello en tinta (no en bermellón: el sello grande es el único rojo de la pantalla) */
.pieza-sello {
  top: 8%; left: 9%;
  width: clamp(40px, 6vw, 58px); height: clamp(40px, 6vw, 58px);
  border-radius: 10px;
  background: var(--giri-sumi);
  color: var(--giri-washi);
  font: 600 clamp(13px, 1.9vw, 19px)/1.02 var(--giri-kanji);
  writing-mode: vertical-rl;
  rotate: -8deg;
}
.pieza-cinta {
  top: 16%; right: 8%;
  width: clamp(70px, 11vw, 130px); height: clamp(20px, 2.8vw, 32px);
  background: color-mix(in srgb, var(--giri-arcilla) 88%, transparent);
  rotate: 14deg;
  box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--giri-sumi) 35%, transparent);
}
.pieza-check {
  bottom: 14%; left: 14%;
  width: clamp(40px, 5.6vw, 56px); height: clamp(40px, 5.6vw, 56px);
  border-radius: 50%;
  background: var(--giri-washi);
  box-shadow: 0 0 0 1px var(--line), 0 10px 24px -10px color-mix(in srgb, var(--giri-sumi) 40%, transparent);
}
.pieza-check svg { width: 55%; height: 55%; fill: none; stroke: var(--giri-sumi); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pieza-punto { bottom: 24%; right: 15%; width: clamp(12px, 1.6vw, 18px); height: clamp(12px, 1.6vw, 18px); border-radius: 50%; background: var(--giri-q3); }
@media (max-width: 560px) {
  .pieza-sello { top: 2%; left: 2%; }
  .pieza-cinta { top: 6%; right: 0; }
  .pieza-check { bottom: 4%; left: 4%; }
  .pieza-punto { bottom: 14%; right: 4%; }
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .capa-fondo, .capa-medio, .capa-frente { animation-timing-function: linear; animation-fill-mode: both; animation-timeline: --escena; animation-range: exit; }
    .capa-fondo { animation-name: px-fondo; }
    .hoja-falsa { animation: px-entra linear both; animation-timeline: --escena; animation-range: entry; }
    .capa-medio { animation-name: px-medio; }
    .capa-frente { animation-name: px-frente; }
  }
}
/* rango exit: quietas mientras el hero está en pantalla y se mueven a distinta velocidad mientras sale */
@keyframes px-fondo { from { translate: 0 0; } to { translate: 0 -40px; } }
@keyframes px-medio { from { translate: 0 0; } to { translate: 0 -120px; } }
@keyframes px-frente { from { translate: 0 0; } to { translate: 0 -240px; } }
@keyframes px-entra { from { scale: .95; opacity: .7; } to { scale: 1; opacity: 1; } }
.sello-grande svg { display: block; width: 100%; height: auto; }
/* el anillo de las 52 semanas gira muy lento: una vuelta cada 120 s (los kanji quedan derechos) */
.sello-anillo { transform-box: view-box; transform-origin: 50% 50%; animation: girar 120s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.portada-titulo {
  margin: clamp(32px, 5vw, 56px) auto 0;
  max-width: 14ch;
  font: 300 clamp(48px, 8vw, 96px)/1.04 var(--serif);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.portada-bajada { max-width: 32em; margin: 22px auto 0; color: var(--muted); font-size: clamp(17px, 2vw, 20px); line-height: 1.5; text-wrap: balance; }
.portada-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 34px; }
.portada-cta .pill { min-height: 50px; padding-inline: 28px; font-size: 16px; }

/* ---------- portada: el año ---------- */
.anio { padding-block: clamp(60px, 9vw, 120px); background: var(--bg-2); }
.section-title em { font-style: italic; color: var(--giri-q1); }
.anio-caja {
  margin: clamp(32px, 5vw, 56px) auto 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: thin;
}
.anio-caja:focus-visible { outline-offset: 4px; }
.anio-grilla {
  --c: clamp(10px, calc((min(100vw, 1240px) - 44px - 51 * 3px) / 52), 17px);
  display: grid;
  grid-template-columns: repeat(52, var(--c));
  grid-template-rows: auto repeat(7, var(--c));
  gap: 3px;
  width: max-content;
  margin: 0 auto;
}
.anio-grilla .dia { display: block; border-radius: 3px; background: var(--giri-casilla); }
.anio-grilla .dia.fuera { opacity: .45; }
.anio-grilla .dia.q1 { background: var(--giri-q1); }
.anio-grilla .dia.q2 { background: var(--giri-q2); }
.anio-grilla .dia.q3 { background: var(--giri-q3); }
.anio-grilla .dia.q4 { background: var(--giri-q4); }
.anio-grilla .dia.hoy { background: var(--sello); box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 3.5px var(--sello); }
.trim {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-align: left;
}
.trim::before { content: ""; flex: none; width: 18px; height: 4px; border-radius: 2px; background: currentColor; }
.trim.q1::before { background: var(--giri-q1); }
.trim.q2::before { background: var(--giri-q2); }
.trim.q3::before { background: var(--giri-q3); }
.trim.q4::before { background: var(--giri-q4); }
.anio .section-sub { margin-top: clamp(24px, 4vw, 40px); }

/* ---------- portada: la hoja ---------- */
/* abajo suma con el padding del escenario (40–80 px) para dar los mismos 60–120 px que el resto de las secciones */
.hoja { padding-block: clamp(60px, 9vw, 120px) clamp(20px, 3vw, 40px); text-align: center; }

/* escenario con la hoja en 3D */
.stage {
  position: relative;
  margin: clamp(48px, 7vw, 90px) auto 0;
  max-width: 1180px;
  perspective: 1600px;
  padding-bottom: clamp(40px, 6vw, 80px);
}
.glow {
  position: absolute;
  inset: 12% 6% 4%;
  background: var(--grad);
  filter: blur(90px);
  opacity: .18;
  border-radius: 50%;
  transform: scale(var(--glow, .8));
  transition: transform .2s linear;
  pointer-events: none;
}
.showcase {
  --rx: 22deg; --sc: .88; --ty: 30px;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: var(--giri-papel);
  box-shadow: var(--shadow-lift), 0 0 0 1px var(--line);
  transform: translateY(var(--ty)) rotateX(var(--rx)) scale(var(--sc));
  transform-origin: 50% 100%;
  will-change: transform;
  line-height: 0;
}
.showcase svg { display: block; width: 100%; height: auto; }
.showcase-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 980px;
  background: color-mix(in srgb, var(--giri-sumi) 62%, transparent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  backdrop-filter: blur(8px);
}
/* En el celu la hoja mide ~350 px: con 18 px de radio la esquina se comía el nombre */
@media (max-width: 560px) {
  .showcase { border-radius: 10px; padding: 5px; }
  .showcase-tag { top: 8px; left: 8px; padding: 3px 8px; font-size: 10px; }
}

/* ---------- secciones ---------- */
.section-title {
  margin: 0 auto;
  max-width: 18ch;
  text-align: center;
  font: 300 clamp(36px, 5.6vw, 64px)/1.08 var(--serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.section-sub {
  max-width: 36em;
  margin: 16px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 21px);
  text-wrap: balance;
}


/* ---------- constructor (panel) ---------- */
.grid {
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 960px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 24px;
  align-items: start;
}

.panel {
  display: grid;
  gap: 22px;
  min-width: 0;
  padding: 28px;
  border-radius: var(--r-xl);
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
@media (max-width: 520px) { .panel { padding: 22px 18px; border-radius: var(--r-lg); } }
#editor-form { display: grid; gap: 22px; }

.section { display: grid; gap: 14px; margin: 0; padding: 0; border: 0; min-width: 0; }
.section + .section, #editor-form + .section, .panel > .section:not(:first-child) {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.step, .label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.step .n {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

/* ---------- campos ---------- */
.field, .field-label, .inline { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: -0.005em; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-short { max-width: 50%; }
.inline { display: flex; align-items: center; gap: 10px; }
.inline select { width: auto; min-height: 36px; padding: 6px 34px 6px 12px; }

input[type=text], input[type=email], input[type=tel], input[type=date], select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 14px;
  border: 0;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--ink);
  font: 400 17px var(--font);
  letter-spacing: -0.015em;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow .25s var(--ease), background-color .25s;
  -webkit-appearance: none;
  appearance: none;
}
select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2386868B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}
input:hover, select:hover, textarea:hover { background-color: color-mix(in srgb, var(--ink) 7%, transparent); }
input:focus, select:focus, textarea:focus {
  outline: none;
  background-color: var(--surface-solid);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
::placeholder { color: var(--faint); }
textarea { min-height: 90px; resize: vertical; font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; word-break: break-all; }

.add-form { display: grid; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 400px) { .row2 { grid-template-columns: 1fr; } .field-short { max-width: none; } }

/* paletas como muestras redondas */
.palettes { display: flex; flex-wrap: wrap; gap: 10px; }
.pal {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 8px;
  border: 0;
  border-radius: 980px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--ink);
  font: 500 14px var(--font);
  cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .3s var(--ease), background-color .2s;
}
.pal:hover { transform: translateY(-2px); }
.pal .sw { display: grid; grid-template-columns: repeat(2, 10px); gap: 2px; width: 22px; height: 22px; border-radius: 50%; overflow: hidden; }
.pal .sw i { display: block; width: 10px; height: 10px; }
.pal[aria-pressed="true"] { background: var(--surface-solid); box-shadow: 0 0 0 2px var(--ink), var(--shadow); }

/* checkboxes como interruptores de iPhone */
.checks { display: grid; gap: 4px; }
.checks label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 16px;
  cursor: pointer;
}
.checks label { flex-direction: row-reverse; justify-content: flex-end; }
.checks label input { margin-left: auto; }
.checks input[type=checkbox] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 51px;
  height: 31px;
  margin: 0 0 0 auto;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 16%, transparent);
  cursor: pointer;
  transition: background-color .3s var(--ease);
}
.checks input[type=checkbox]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--giri-papel);
  box-shadow: 0 3px 8px color-mix(in srgb, var(--giri-sumi) 15%, transparent), 0 3px 1px color-mix(in srgb, var(--giri-sumi) 6%, transparent);
  transition: transform .35s var(--ease);
}
.checks input[type=checkbox]:checked { background: var(--giri-q1); }
.checks input[type=checkbox]:checked::after { transform: translateX(20px); }

/* ---------- listas ---------- */
.list, .friends {
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--ink) 3.5%, transparent);
  overflow: hidden;
}
.list { max-height: 380px; overflow: auto; }
.list:empty::before, .friends:empty::before {
  content: attr(data-empty);
  display: block;
  padding: 22px 18px;
  color: var(--faint);
  font-size: 15px;
  text-align: center;
}
.item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 10px 12px 16px;
  border-bottom: 1px solid var(--line);
}
.item:last-child, .friend:last-child { border-bottom: 0; }
.item.is-new { animation: pop-in .6s var(--ease) both; }
.chip { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-strong); }
.item-text { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; line-height: 1.25; }
.item-text small { display: block; margin-top: 2px; color: var(--faint); font-size: 13px; font-weight: 400; }
.item-date { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.x {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .3s var(--ease);
}
.x:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); transform: rotate(90deg); }

.friend {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  transition: background-color .2s;
}
.friend:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.friend-name { font-weight: 600; overflow-wrap: anywhere; }
.friend-meta { color: var(--faint); font-size: 13px; }

.hint { margin: 0; color: var(--muted); font-size: 15px; }
.msg {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  color: var(--ink);
  font-size: 15px;
  animation: pop-in .5s var(--ease) both;
}
.msg.err { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.codebox { display: grid; gap: 10px; animation: pop-in .5s var(--ease) both; }
.editing {
  padding: 10px 16px;
  border-radius: 980px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  font-size: 14px;
  font-weight: 600;
  justify-self: start;
}

/* ---------- vista previa ---------- */
.preview {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 72px);
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 20px;
  border-radius: var(--r-xl);
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
@media (max-width: 960px) { .preview { position: static; } }
.preview-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; padding-inline: 4px; }
.preview-head .label { font-size: 17px; }
.sheet-scroll { overflow-x: auto; border-radius: 12px; }
.sheet {
  min-width: 1000px;
  line-height: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -22px color-mix(in srgb, var(--giri-sumi) 35%, transparent);
  background: var(--giri-papel);
}
.sheet.is-updated { animation: refresh .55s var(--ease); }
.sheet svg { display: block; width: 100%; height: auto; }

/* ---------- pestañas (panel) como control segmentado ---------- */
.tabs {
  display: inline-flex;
  gap: 2px;
  margin: 0 0 28px;
  padding: 3px;
  border-radius: 980px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.tab {
  min-height: 34px;
  padding: 6px 20px;
  border: 0;
  border-radius: 980px;
  background: transparent;
  color: var(--ink);
  font: 500 14px var(--font);
  cursor: pointer;
  transition: background-color .3s var(--ease), box-shadow .3s var(--ease);
}
.tab[aria-selected="true"] { background: var(--surface-solid); box-shadow: 0 3px 8px color-mix(in srgb, var(--giri-sumi) 12%, transparent), 0 3px 1px color-mix(in srgb, var(--giri-sumi) 4%, transparent); }

/* ---------- cabecera compacta (panel) ---------- */
.top { padding-block: clamp(36px, 6vw, 64px) 24px; }
.top h1 { margin: 0; font: 300 clamp(40px, 6vw, 64px)/1.08 var(--serif); letter-spacing: -0.02em; }
.top .lede { margin: 10px 0 0; max-width: 36em; color: var(--muted); font-size: clamp(17px, 2vw, 21px); }

/* ---------- diálogo ---------- */
dialog {
  max-width: min(400px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
}
dialog[open] { animation: pop-in .45s var(--ease); }
dialog::backdrop { background: color-mix(in srgb, var(--giri-sumi) 40%, transparent); backdrop-filter: blur(6px); }
.dialog-body { display: grid; gap: 20px; padding: 26px; text-align: center; }
.dialog-body p { margin: 0; font-weight: 600; font-size: 18px; }
.dialog-body .btns { justify-content: center; }

/* ---------- portada: productos ---------- */
.productos { padding-block: clamp(60px, 9vw, 120px); background: var(--giri-arcilla); }
.productos-grilla { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: clamp(32px, 5vw, 56px); }
@media (max-width: 860px) { .productos-grilla { grid-template-columns: minmax(0, 1fr); } }
.prod { display: grid; grid-template-rows: auto 1fr auto auto; gap: 10px; padding: 28px 26px; border-radius: var(--r-lg); background: var(--bg); }
.prod h3 { margin: 0; font: 600 22px/1.2 var(--serif); }
.prod-bajada { margin: 0; color: var(--muted); font-size: 16px; }
.prod-precio { margin: 8px 0 0; font: 300 32px/1 var(--serif); font-variant-numeric: tabular-nums; }
.prod-link { justify-self: start; color: var(--ink); font-weight: 500; text-underline-offset: 4px; }
.productos-mas { margin: 32px 0 0; text-align: center; }

/* ---------- pie ---------- */
.footer { padding-block: 48px 60px; color: var(--muted); font-size: 14px; text-align: center; border-top: 1px solid var(--line); }

/* ---------- animaciones ---------- */
@keyframes flow { to { background-position: 200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(28px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes refresh { 0% { transform: scale(.992); filter: saturate(.6) brightness(1.04); } 100% { transform: none; filter: none; } }

/* Entrada de la portada (al cargar) */
.sello-grande, .portada-titulo, .portada-bajada, .portada-cta { animation: rise 1s var(--ease) both; }
.portada-titulo { animation-delay: .2s; }
.portada-bajada { animation-delay: .35s; }
.portada-cta { animation-delay: .5s; }

/* Aparición al hacer scroll: solo si hay JS (la clase la pone app.js) */
.js .reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .showcase { transform: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- impresión: solo la hoja del editor, tamaño original 120,86 × 60 cm ---------- */
@page { size: 1208.6mm 600mm; margin: 0; }
@page aviso { size: A4; margin: 20mm; } /* página pública: una hoja común con el aviso */
@media print {
  html, body { margin: 0; padding: 0; background: var(--giri-papel); }
  /* Página pública: no se imprime la hoja, solo el aviso */
  .publica { page: aviso; }
  .publica > * { display: none !important; }
  .publica::after {
    content: "Pedí tu GIRI · Año 2027 en nuestra tienda online.";
    display: block; padding: 40mm 0; text-align: center;
    font: 300 20pt/1.3 var(--serif); color: var(--giri-sumi);
  }
  /* Panel (solo local): la hoja completa en 120,86 × 60 cm */
  .nav, .top, .tabs, .panel, .preview-head, dialog { display: none !important; }
  .wrap { max-width: none; padding: 0 !important; }
  .grid, .preview { display: block; position: static; padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; }
  .sheet-scroll { overflow: visible; }
  .sheet { min-width: 0; box-shadow: none; border-radius: 0; animation: none; break-inside: avoid; }
  .sheet svg { width: 1208.6mm; height: 599mm; }
}

/* ---------- cómo nace GIRI (portada) y /historia ---------- */
.nace { padding-block: clamp(60px, 9vw, 120px); }
.nace-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.nace-foto, .historia-foto { margin: 0; }
.nace-foto img, .historia-foto img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
}
.nace-foto figcaption, .historia-foto figcaption { margin-top: 10px; color: var(--muted); font-size: 14px; }
.nace-titulo {
  margin: 0 0 20px;
  font: 300 clamp(32px, 4.4vw, 52px)/1.1 var(--serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.nace-texto p:not(.versalitas) { margin: 0 0 14px; max-width: 34em; font-size: clamp(17px, 1.8vw, 19px); line-height: 1.6; }
.nace-texto .nace-firma { font-family: var(--serif); font-style: italic; }
.nace-texto .pill { margin-top: 10px; }
@media (max-width: 760px) {
  .nace-inner { grid-template-columns: 1fr; }
  .nace-foto { max-width: 420px; }
}

.historia { padding-bottom: clamp(60px, 9vw, 110px); }
.historia-top { padding-block: clamp(40px, 7vw, 88px) clamp(20px, 3vw, 32px); text-align: center; }
.historia-top h1 {
  margin: 0 auto;
  max-width: 16ch;
  font: 300 clamp(40px, 6.4vw, 76px)/1.06 var(--serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.historia-texto { max-width: 720px; }
.historia-texto > p { margin: 0 0 20px; font-size: clamp(18px, 2vw, 20px); line-height: 1.7; }
.historia-texto .kanji { font-family: var(--giri-kanji); font-weight: 600; }
.historia-foto { margin: clamp(28px, 5vw, 48px) auto; max-width: 520px; }
.historia-cita { margin: clamp(32px, 5vw, 56px) 0; padding: 0; border: 0; text-align: center; }
.historia-cita p { margin: 0; font: italic 300 clamp(26px, 3.6vw, 38px)/1.25 var(--serif); text-wrap: balance; }
.historia-texto > .historia-firma { font-family: var(--serif); font-style: italic; font-size: 22px; }
.historia-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
