/* trama — Hoy, Armario, Looks, Perfil
   Dirección: "Patrón de corte" (DESIGN.md, docs/brief-hoy.md, docs/brief-armario.md).
   Restrained: negro + crema hacen todo el trabajo; el color de una prenda
   vive solo en su punto identificador, nunca en el cromo de la interfaz. */

:root {
  --ink: #111111;
  --paper: #f5f5f2;
  --ink-soft: #55534d;
  --line-faintest: rgba(17, 17, 17, 0.09);
  --line-faint: rgba(17, 17, 17, 0.16);
  --line-faint-strong: rgba(17, 17, 17, 0.28);
  --scrim: rgba(17, 17, 17, 0.32);
  /* Card ground: the softest ink step, a surface tone rather than a line. */
  --surface-soft: rgba(17, 17, 17, 0.045);
  --surface-soft-hover: rgba(17, 17, 17, 0.075);
  /* The soft ground made opaque (the same ink step over paper), for fills
     that must look like the plate without stacking darker. */
  --surface-soft-solid: color-mix(in srgb, var(--ink) 4.5%, var(--paper));

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  --fs-100: 0.8125rem;
  --fs-200: 0.9375rem;
  --fs-300: 1.0625rem;
  --fs-400: 1.375rem;

  --radius-card: 12px;
  --nav-h: 64px;
  /* The capsule floats this far above the bottom edge: 12px, or inside the
     iPhone's home-indicator inset (34px → 22px), as the system's own bar. */
  --nav-float: max(var(--sp-3), calc(env(safe-area-inset-bottom) - var(--sp-3)));
  --nav-clearance: calc(var(--nav-h) + var(--nav-float));
  /* Room for a browser's own bar at the foot of the screen, if it ever lay
     over the page's fixed elements. 0: on an iPhone (screenshots of Safari,
     2026-10-27) the page and its fixed elements end above Safari's bar, and
     only what scrolls passes under it (the fade below hides it). */
  --barra-navegador: 0px;
  /* The paper fade above the tab bar on phones (see .tab-bar::before). */
  --difuminado: var(--sp-6);

  --dur-fast: 160ms;
  --dur-base: 320ms;
  --dur-slow: 520ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  /* iOS's curve: brakes softly at the end. For the photo's transitions in "Añadir prenda"
     and the new card coming in (plan 035f). */
  --ease-ios: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-move: 220ms;

  /* What floats over the page (the sheet, the side panel, its menu): the
     paper itself in light; a step above it in dark (plan 043). */
  --paper-hoja: var(--paper);
  /* The mannequin, a photo's ground and the hanger rail (plan 043b): in light,
     what they always were; in dark, their own values (below). */
  --cuerpo-relleno: var(--surface-soft-solid);
  --cuerpo-contorno: var(--ink);
  --tinta-prenda: var(--ink);
  --papel-prenda: var(--paper);
  --casilla: var(--surface-soft);
  --casilla-hover: var(--surface-soft-hover);
  /* A small thumbnail's ground (plan 043c): in light, the paper, so a white or
     cream garment is not lost on the card's grey at 40px (the polo crema, 1.17
     to 1.28:1); in dark, a photo's ground as everywhere. */
  --casilla-miniatura: var(--paper);
  --mueble: var(--ink);

  color-scheme: light;
}

/* "Apariencia" (Perfil, plan 043): dark, marked on <html> before the first
   paint by each page's <head> (data-apariencia, "claro" or "oscuro", the
   person's choice or else the system's). The same two-colour world turned
   over: a light ink on an almost black, faintly warm paper; every other
   value is still a step of the ink. The steps of line and surface go up a
   little, since the same share shows less on dark. The scrim turns black: a
   light ink would lift the page instead of dimming it. */
html[data-apariencia="oscuro"] {
  --ink: #dcd8d0;
  --paper: #0e0d0c;
  --ink-soft: #a4a29e;
  --line-faintest: rgba(220, 216, 208, 0.1);
  --line-faint: rgba(220, 216, 208, 0.18);
  --line-faint-strong: rgba(220, 216, 208, 0.32);
  --scrim: rgba(0, 0, 0, 0.55);
  --surface-soft: rgba(220, 216, 208, 0.06);
  --surface-soft-hover: rgba(220, 216, 208, 0.09);
  --surface-soft-solid: color-mix(in srgb, var(--ink) 6%, var(--paper));
  /* With no shadows, what parts a sheet from the page in dark is this step
     (1.10:1), the scrim and its hairline. */
  --paper-hoja: #1a1816;
  /* The mannequin (plan 043b): its body a step above the paper, as in light
     (ink at 9%, #211f1c), with a muted outline rather than the brightest ink;
     the garments keep their ink and paper as in light, since their colour
     already parts them from the page; a dark garment's outline goes muted,
     or it would melt into the page. */
  --cuerpo-relleno: color-mix(in srgb, var(--ink) 9%, var(--paper));
  --cuerpo-contorno: #8e8a83;
  --tinta-prenda: #111111;
  --papel-prenda: #f5f5f2;
  /* A photo's ground (plan 043b, "C"): a warm mid-dark grey, 1.95:1 on the
     paper, so a black garment is not lost and the page stays dark. */
  --casilla: #46423e;
  --casilla-hover: #4e4a46;
  --casilla-miniatura: #46423e;
  /* The hanger rail, its hangers and the shelf (plan 043b, "D1"): a soft grey
     on the page itself, with no band (6.6:1). */
  --mueble: #9a968e;
  color-scheme: dark;
}
/* Without the <head>'s mark (no script), the system decides. */
@media (prefers-color-scheme: dark) {
  html:not([data-apariencia]) {
    --ink: #dcd8d0;
    --paper: #0e0d0c;
    --ink-soft: #a4a29e;
    --line-faintest: rgba(220, 216, 208, 0.1);
    --line-faint: rgba(220, 216, 208, 0.18);
    --line-faint-strong: rgba(220, 216, 208, 0.32);
    --scrim: rgba(0, 0, 0, 0.55);
    --surface-soft: rgba(220, 216, 208, 0.06);
    --surface-soft-hover: rgba(220, 216, 208, 0.09);
    --surface-soft-solid: color-mix(in srgb, var(--ink) 6%, var(--paper));
    --paper-hoja: #1a1816;
    /* The mannequin (plan 043b): its body a step above the paper, as in light
       (ink at 9%, #211f1c), with a muted outline rather than the brightest ink;
       the garments keep their ink and paper as in light, since their colour
       already parts them from the page; a dark garment's outline goes muted,
       or it would melt into the page. */
    --cuerpo-relleno: color-mix(in srgb, var(--ink) 9%, var(--paper));
    --cuerpo-contorno: #8e8a83;
    --tinta-prenda: #111111;
    --papel-prenda: #f5f5f2;
    /* A photo's ground (plan 043b, "C"): a warm mid-dark grey, 1.95:1 on the
       paper, so a black garment is not lost and the page stays dark. */
    --casilla: #46423e;
    --casilla-hover: #4e4a46;
    --casilla-miniatura: #46423e;
    /* The hanger rail, its hangers and the shelf (plan 043b, "D1"): a soft grey
       on the page itself, with no band (6.6:1). */
    --mueble: #9a968e;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}
/* Armario and a category screen differ in height; a stable gutter keeps
   their columns on one edge so the title morph doesn't jump sideways. */
html {
  scrollbar-gutter: stable;
}
/* In another language than Spanish, the page waits hidden until js/idioma.js
   has put its texts in (the <head> marks it, a second at most; plan 044): no
   flash of the Spanish written in the HTML. */
html[data-traduciendo] body {
  visibility: hidden;
}

/* The text face on Windows 11 (plan 047): Segoe UI Variable, which has a
   weight axis, declared from 450 to 700. Text asks for 400 (as before, so
   Safari on the iPhone and the Mac, and Android, draw what they drew); it
   falls outside the range and is drawn at 450, the nearest inside. 600 stays
   600. On Windows 10 local() finds nothing and Segoe UI follows. */
@font-face {
  font-family: "trama-texto";
  src: local("Segoe UI Variable Text"), local("SegoeUIVariable-Text");
  font-weight: 450 700;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "trama-texto", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-200);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -48px;
  left: var(--sp-4);
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: var(--sp-2) var(--sp-4);
  border-radius: 999px;
  text-decoration: none;
  font-size: var(--fs-100);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus {
  top: var(--sp-3);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}
/* Hoy's first screen (plan 036d): the header and the figure, one screen tall
   as they always were; the week comes under it, and Hoy scrolls. */
.hoy-pantalla {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: max(env(safe-area-inset-top), var(--sp-5)) var(--sp-5) var(--sp-2);
}

.wordmark {
  height: 28px;
  width: auto;
}
/* Today's date under Hoy's logo (plan 045a): out of the header's flow, so the
   header keeps its height and the figure never moves; it sits in the air
   that was already there between the logo and the figure's head, 8px under
   the logo, on one line (cut with "…" if a language ever makes it too long). */
.hoy-pantalla > .topbar {
  position: relative;
}
.hoy-fecha {
  position: absolute;
  left: var(--sp-5);
  top: calc(100% - var(--sp-2));
  max-width: calc(100% - 2 * var(--sp-5));
  font-size: var(--fs-200);
  line-height: 1.3;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hoy-fecha:empty {
  display: none;
}
/* In dark the logo (an ink PNG) takes the ink's tone: inverted to 83% grey,
   warmed a touch, it lands on #dbd8d2 (the ink, #dcd8d0). Its SVG redraws in
   img/logo/ have other proportions, so swapping it would change it in light. */
html[data-apariencia="oscuro"] .wordmark {
  filter: invert(83%) sepia(10%);
}
@media (prefers-color-scheme: dark) {
  html:not([data-apariencia]) .wordmark {
    filter: invert(83%) sepia(10%);
  }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-right: calc(var(--sp-2) * -1);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.icon-btn:hover,
.icon-btn[aria-expanded="true"] {
  background: var(--line-faintest);
}
.icon-btn:active {
  background: var(--line-faint);
}
.icon-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hoy {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: var(--sp-4) var(--sp-4) calc(var(--nav-clearance) + var(--sp-6));
}
/* On phones a framed zone can carry the figure up past the header (the feet
   lift the legs over the logo): it is cut at the header's lower edge
   instead. `clip`, not `hidden`: no scroll container and no stacking
   context, so the figure stays above the scrim, and the fixed branch is not
   cut. From 760px the logo sits left of the centred figure and the zoom
   may lift the head a little into the header's row, so nothing is cut. */
@media (max-width: 759px) {
  .hoy {
    overflow: clip;
  }
}

.stage {
  position: relative;
  /* Above the scrim, under the panel: the figure being dressed is never
     dimmed. Only the zones take taps; elsewhere a tap reaches the scrim
     and closes the panel. */
  z-index: 31;
  pointer-events: none;
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.branch-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Above the scrim, under the panel (same level, earlier in the DOM). */
  z-index: 31;
  width: 100%;
  height: 100%;
}

.branch-path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0;
}

.silhouette-stage {
  position: relative;
  /* Width- and height-capped together so the whole figure always stays
     above the fixed bottom nav, on short phones as much as tall ones. On
     phones it is the screen's subject and takes most of the band between
     header and tab bar (from 760px a rule below sizes it). */
  width: min(76vw, 340px, calc(62dvh * 240 / 560));
  aspect-ratio: 240 / 560;
  margin-inline: auto;
  /* The open zone's framing is set inline by app.js (zoneFrame) as the same
     translate + scale list, so moving between zones interpolates smoothly. */
  transform: translate(0, 0) scale(1);
  transform-origin: 0 0;
  transition: transform var(--dur-base) var(--ease-out);
}
/* Until the arrival drawing starts (app.js, playArrivalDrawing), the figure
   is hidden rather than shown whole for a frame. */
.hoy-draw-in .silhouette-figure,
.hoy-draw-in .equip-layer {
  visibility: hidden;
}

.silhouette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Filled with the soft ground made opaque: the bare figure reads as a
   light mannequin a step below the paper, so white and cream garments on it
   stand out, and with a panel open it is still one cut-out above the scrim. */
.silhouette-figure {
  --trazo-cuerpo: 2;
  fill: var(--cuerpo-relleno);
  stroke: var(--cuerpo-contorno);
  stroke-width: var(--trazo-cuerpo);
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Hoy carries both bodies inline (plan 042): the one not chosen
   (html[data-maniqui], marked in each page's <head>) stays out. */
html:not([data-maniqui="femenino"]) .silhouette-figure > [data-cuerpo="femenino"],
html[data-maniqui="femenino"] .silhouette-figure > [data-cuerpo="masculino"] {
  display: none;
}

/* The body's clean outline (plan 042, tools/maniqui.mjs): its pieces are
   painted twice, all of them with the line at double width and then all
   their fills over it, so only the outer half of the line shows and no
   join between pieces (neck, shoulders, hips, wrists) is drawn. The head
   goes over them whole, its chin over the neck. Each figure sets its line
   in --trazo-cuerpo. */
.cuerpo-trazo {
  stroke-width: calc(var(--trazo-cuerpo, 2) * 2);
}
.cuerpo-relleno {
  stroke: none;
}
.cuerpo-detalle {
  fill: none;
}

.equip-layer {
  fill: none;
  stroke: var(--tinta-prenda);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* A fitted garment covers the body and the layers under it (drawn bottom to
   top in app.js) in its own tone (garmentTone in garment-visual.js); open
   detail strokes stay unfilled, and turn paper on a dark tone so a black
   T-shirt keeps its neckline (not the waistband: it peeks out under the hem,
   where paper would read as a gap). */
.equip-layer .is-fitted {
  fill: var(--garment-fill, var(--papel-prenda));
}
/* A dark garment's outline (plan 043b): in dark, muted, or it would melt into
   the page; in light, the ink as ever. */
.equip-layer .is-dark {
  stroke: var(--cuerpo-contorno);
}
/* The accessories on the hands (a watch, a bracelet, a bag, the glasses):
   line icons on the body, in the page's ink, so in dark they stay light on
   the dark hand. */
.equip-layer .is-badge {
  stroke: var(--ink);
}
.equip-layer .g-detail {
  fill: none;
}
.equip-layer .is-dark .g-detail:not(.g-waist) {
  stroke: var(--papel-prenda);
  stroke-opacity: 0.75;
}

.equip-icon {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.equip-icon.is-filled {
  opacity: 1;
}

/* An empty hueco's cutting pattern: its garment's outline, unfilled, in a
   fine dashed line of ink at low opacity; its detail strokes stay out. */
.slot-pattern {
  fill: none;
  stroke: var(--line-faint-strong);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}
.slot-pattern .g-detail {
  display: none;
}

.zone-hotspot {
  position: absolute;
  pointer-events: auto;
  border-radius: 999px;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.zone-hotspot:hover,
.zone-hotspot:focus-visible {
  background: var(--line-faint);
}
.zone-hotspot:focus-visible {
  outline-offset: 4px;
}
/* The open zone is not tinted: the branch and the panel already say which
   it is, and a band behind the figure would peek out past its outline (the
   rounded shoulders, a narrow waist, under the feet) and read as a cast
   shadow, which this world has none of (plan 042). */
.zone-hotspot.is-open {
  background: transparent;
}
/* The page never scrolls under the figure; a held finger lifts the garment
   worn there (js/app.js), so the browser takes no gesture from a zone. */
.zone-hotspot {
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
}
/* The hueco a carried garment would go to, while it is over the figure. */
.zone-hotspot.is-drop-target {
  background: var(--line-faint);
}
/* Responds on touch-down, not on release; only the way out fades. */
.zone-hotspot:active {
  background: var(--line-faint);
  transition-duration: 0s;
}

.live-region {
  position: absolute;
}

/* Scrim + panel: bottom sheet on mobile, side panel from 760px up. */

.scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  z-index: 30;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}
.scrim[hidden] {
  display: none;
}
/* A fading-out scrim must not swallow the next tap. */
.scrim:not(.is-visible) {
  pointer-events: none;
}
.scrim.is-visible {
  opacity: 1;
}

.panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  /* Everything in the sheet that is "paper" (its head, its actions, the
     ground of a thumbnail's ×) is the sheet's own: a step up in dark. */
  --paper: var(--paper-hoja);
  background: var(--paper);
  border-top: 1px solid var(--line-faint);
  border-radius: 20px 20px 0 0;
  max-height: min(72vh, 620px);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--dur-base) var(--ease-out);
  padding-bottom: env(safe-area-inset-bottom);
}
.panel[hidden] {
  display: none;
}
/* Hoy's sheet stops lower than Armario's, so the zone being dressed fits
   above it (see zoneFrame in app.js). Its content scrolls. */
@media (max-width: 759px) {
  .panel--hoy {
    max-height: min(60dvh, 560px);
  }
}
.panel.is-open {
  transform: translateY(0);
}
/* While a finger drags the sheet it must follow 1:1, not ease after it. */
.panel.is-dragging,
.scrim.is-dragging {
  transition: none;
}

.panel-handle {
  position: relative;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-faint-strong);
  margin: var(--sp-3) auto var(--sp-1);
  touch-action: none;
}
/* A 4px bar is too thin to catch: widen the grab area without drawing it. */
.panel-handle::before {
  content: "";
  position: absolute;
  inset: -20px -48px;
}
/* The spring and the rubber band lift the sheet past its resting place;
   paper continues below it so no gap opens at the bottom edge. */
.panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 50vh;
  background: var(--paper);
}

.panel-header {
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-5) var(--sp-3);
  transition: box-shadow var(--dur-fast) var(--ease-out);
}
/* Once the body scrolls, the bar takes a hairline and what passes under it
   fades out first: a sliver of it (an underline) never reads as a stray line. */
.panel.is-scrolled .panel-header {
  box-shadow: 0 1px 0 var(--line-faint);
}
.panel.is-scrolled .panel-body {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--sp-3));
  mask-image: linear-gradient(to bottom, transparent, #000 var(--sp-3));
}

.panel-header h2 {
  flex: 1;
  margin: 0;
  font-size: var(--fs-400);
  font-weight: 600;
}

.panel-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
}
.panel-close:hover {
  background: var(--line-faint);
}
.panel-close svg {
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
}
/* "…" in a garment's detail: same size as the close button, beside it. */
.panel-more {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
}
.panel-more[hidden] {
  display: none;
}
.panel-more:hover,
.panel-more[aria-expanded="true"] {
  background: var(--line-faint);
}
.panel-more svg {
  fill: var(--ink);
}
/* Its menu hangs from the button, right edges aligned: paper, hairline and
   card radius, no shadow (the No-Shadow Rule). */
.panel-menu {
  position: absolute;
  z-index: 2;
  min-width: 200px;
  padding: var(--sp-1) 0;
  --paper: var(--paper-hoja);
  background: var(--paper);
  border: 1px solid var(--line-faint);
  border-radius: var(--radius-card);
  transform-origin: top right;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.panel-menu[hidden] {
  display: none;
}
.panel-menu.is-open {
  opacity: 1;
  transform: none;
}
.panel-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  width: 100%;
  min-height: 44px;
  padding: 0 var(--sp-4);
  text-align: left;
}
.panel-menu-item[hidden] {
  display: none;
}
.panel-menu-item:not([hidden]) ~ .panel-menu-item:not([hidden]) {
  border-top: 1px solid var(--line-faint);
}
.panel-menu-item:hover,
.panel-menu-item:focus-visible {
  background: var(--line-faintest);
}
.panel-menu-item:focus-visible {
  outline-offset: -2px;
  border-radius: 4px;
}
.panel-menu-item svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Back through "Combina con": same size and stroke as the close button. */
.panel-back {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin-left: calc(var(--sp-2) * -1);
  border-radius: 999px;
}
.panel-back[hidden] {
  display: none;
}
.panel-back:hover {
  background: var(--line-faint);
}
.panel-back svg {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The body scrolls on its own: the page under the scrim never moves with it,
   and a pull down from its top drags the sheet (bodyScroll in js/sheet.js). */
.panel-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--sp-5) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
/* The body scrolls instead of squeezing its content: without this a
   scrolling child ("Combina con") shrinks to a sliver with its own bar. */
.panel-body > * {
  flex-shrink: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.chip {
  border: 1px solid var(--line-faint);
  border-radius: 999px;
  background: var(--line-faintest);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-100);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.chip:hover {
  border-color: var(--ink);
}
.chip.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.chip-count {
  color: var(--ink-soft);
}
.chip.is-active .chip-count {
  color: var(--paper);
  opacity: 0.75;
}

.strip-item {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  text-align: center;
}


.strip-item-icon {
  /* Its photo is absolutely placed: without this, a long name squeezes it. */
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid var(--line-faint);
  display: grid;
  place-items: center;
  position: relative;
}
.strip-item:hover .strip-item-icon,
.strip-item:focus-visible .strip-item-icon {
  border-color: var(--ink);
}
.strip-item.is-active .strip-item-icon {
  border-color: var(--ink);
  border-width: 2px;
}

.strip-item-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.strip-item-dot {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--line-faint-strong);
}

.strip-item-name {
  font-size: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.25;
}

.worn-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.worn-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  border: 1px solid var(--line-faint-strong);
  border-radius: 999px;
  padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-3);
  font-size: var(--fs-100);
}

.worn-chip-remove {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink-soft);
}
.worn-chip-remove:hover {
  color: var(--ink);
  background: var(--line-faint);
}

.empty-state {
  font-size: var(--fs-100);
  color: var(--ink-soft);
  padding: var(--sp-2) 0;
}

/* Bottom tab bar — a floating capsule on every page, icon with its name
   beneath. Paper and a hairline all round, no shadow. The active item is
   ink, heavier, and marked by a short line under its name that slides from
   the previous tab (the inline script in each page's <head>). */

/* On phones the pages that scroll (all but Hoy) fade into paper above the
   tab bar: what passes under it, or beside it, or under Safari's bar below
   it, is not seen. A real element (.pie-papel, just before the tab bar in
   the four pages), fixed, over everything that scrolls and only under the
   bar (and the look detail's footer): solid paper from 32px above the bar
   (the room every page already leaves there) down to the screen's full
   height with Safari's bar folded (100lvh) and more, the 32px faded by a
   mask. A paper ground with a mask, not a gradient over nothing: Safari on
   an iPhone colours its own bar with what is fixed at the foot of the page.
   Its own layer (translateZ): on an iPhone the shelf's lines showed through
   the pseudo-elements that came before it, drawn over them. At the top,
   Safari shows the page under the clock and the island when it scrolls (its
   safe-area-inset-top is 0 there): a band (`html::before`) lies over that,
   ending at the page's top (or below the safe area, where there is one).
   Hoy never scrolls, and its view switch sits just above the bar. From
   760px, nothing. */
.pie-papel {
  display: none;
}
@media (min-width: 760px) {
  body:not(:has(.hoy)) .pie-papel,
  body:has(.semana) .pie-papel {
    display: block;
    position: fixed;
    z-index: 9;
    left: 0;
    right: 0;
    top: calc(100% - var(--nav-float) - var(--nav-h) - var(--difuminado));
    height: calc(var(--nav-float) + var(--nav-h) + var(--difuminado) + 96px);
    background: var(--paper);
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--difuminado));
    mask-image: linear-gradient(to bottom, transparent, #000 var(--difuminado));
    transform: translateZ(0);
    pointer-events: none;
  }
  /* The rail fits the screen: nothing scrolls under the bar there. */
  :root[data-armario-vista="perchero"] body:has(#armarioView:not([hidden])) .pie-papel {
    display: none;
  }
}
@media (max-width: 759px) {
  body:not(:has(.hoy)) {
    --nav-clearance: calc(var(--nav-h) + var(--nav-float) + var(--barra-navegador));
  }
  /* On the page, under the bar (10) and the look detail's paper footer (9),
     over everything that scrolls. */
  body:not(:has(.hoy)) .pie-papel,
  body:has(.semana) .pie-papel {
    display: block;
    position: fixed;
    z-index: 9;
    left: 0;
    right: 0;
    top: calc(100% - var(--nav-float) - var(--nav-h) - var(--difuminado) - var(--barra-navegador));
    height: calc(var(--nav-float) + var(--nav-h) + var(--difuminado) + var(--barra-navegador) + (100lvh - 100svh) + 96px);
    background: var(--paper);
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--difuminado));
    mask-image: linear-gradient(to bottom, transparent, #000 var(--difuminado));
    transform: translateZ(0);
    pointer-events: none;
  }
  html:not(:has(.hoy))::before {
    content: "";
    position: fixed;
    z-index: 9;
    left: 0;
    right: 0;
    bottom: calc(100% - env(safe-area-inset-top));
    height: 64px;
    background: var(--paper);
    transform: translateZ(0);
    pointer-events: none;
  }
}

.tab-bar {
  position: fixed;
  left: max(var(--sp-4), env(safe-area-inset-left));
  right: max(var(--sp-4), env(safe-area-inset-right));
  bottom: var(--nav-float);
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  max-width: 440px;
  height: var(--nav-h);
  margin-inline: auto;
  padding: 0 var(--sp-2);
  background: var(--paper);
  border: 1px solid var(--line-faint);
  border-radius: 999px;
}

/* One line for the whole bar. Its box is one column wide, so moving it by
   whole widths lands it under any tab at any screen size; only transform
   moves, the line itself never changes width. */
.tab-indicator {
  position: absolute;
  left: var(--sp-2);
  bottom: 7px;
  width: calc((100% - var(--sp-2) * 2) / 4);
  height: 1.5px;
  pointer-events: none;
  transform: translateX(calc(var(--tab-i, 0) * 100%));
}
.tab-indicator::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 24px;
  height: 100%;
  margin-left: -12px;
  border-radius: 999px;
  background: var(--ink);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  /* Lifts the icon and name so the tab line has room beneath the name. */
  padding-bottom: 6px;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-item:hover {
  color: var(--ink);
}
.nav-item:focus-visible {
  border-radius: 12px;
  outline-offset: -2px;
}

.nav-item-icon {
  position: relative;
  width: 24px;
  height: 24px;
}
.nav-item-icon svg {
  position: absolute;
  inset: 0;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--dur-fast) var(--ease-out);
}
/* Feedback on touch-down: the icon gives under the finger. On the svg, not
   the wrapper, which the Hoy pulse animates. */
.nav-item:active .nav-item-icon svg {
  transform: scale(0.9);
}

.nav-item-label {
  font-size: 0.6875rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.nav-item.is-active {
  color: var(--ink);
}
.nav-item.is-active svg {
  stroke-width: 1.9;
}
/* Hoy, Looks and Perfil turn solid when active: a filled version over the
   line one, same outline and weight. Armario's hanger has none and stays in
   line. Only opacity changes between the two. */
.nav-item-icon .nav-icon-solid {
  fill: currentColor;
  opacity: 0;
}
.nav-item.is-active .nav-icon-solid {
  opacity: 1;
}
.nav-item.is-active .has-solid .nav-icon-line {
  opacity: 0;
}
/* Arriving on a tab (html[data-tab-arrive], set by the <head> script): the
   icon fills in as the tab line slides, from the first frame and on the
   line's own timing (240ms, --ease-out), so both land together. */
html[data-tab-arrive] .nav-item.is-active .nav-icon-solid {
  animation: nav-solid-in 240ms var(--ease-out) both;
}
html[data-tab-arrive] .nav-item.is-active .has-solid .nav-icon-line {
  animation: nav-line-out 240ms var(--ease-out) both;
}
@keyframes nav-solid-in {
  from {
    opacity: 0;
  }
}
@keyframes nav-line-out {
  from {
    opacity: 1;
  }
}
/* No fill-in under reduced motion: the icon is simply solid while the tab
   line fades in. */
/* Reduced motion: the system's, or Perfil's "Movimiento" (html[data-movimiento], plan 041e). */
html:where([data-movimiento="reducido"])[data-tab-arrive] .nav-item.is-active .nav-icon-solid,
html:where([data-movimiento="reducido"])[data-tab-arrive] .nav-item.is-active .has-solid .nav-icon-line {
  animation: none;
}
.nav-item.is-active .nav-item-label {
  font-weight: 600;
}

/* Ghost element used for the "fly to slot" flight */

.fly-ghost {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  width: 44px;
  height: 44px;
  will-change: transform;
}
.fly-ghost img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.fly-ghost svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Card → detail morph: a copy of the card flying above the sheet. Paper
   under the soft ground so it reads the same over the scrim; both are its
   ::before, which fades on the way, since the ficha's photo has no box
   (plan 038). */
.detail-ghost {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-card);
  transform-origin: 0 0;
  will-change: transform;
}
.detail-ghost::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(var(--casilla), var(--casilla)), var(--paper);
}
.detail-ghost svg {
  position: relative;
  width: 56%;
  height: 56%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Desktop / tablet: the branch opens as a side panel, not a bottom sheet. */
@media (min-width: 760px) {
  .hoy {
    padding-bottom: calc(var(--nav-clearance) + var(--sp-7));
  }

  /* And no taller than Hoy's room under the header (76px) once its padding
     (16px above; the tab bar, "Lo llevo hoy" and the view switch below, 124px)
     is left (plan 039b): on a low screen the switch never goes under the bar. */
  .silhouette-stage {
    width: min(34vw, 340px, calc(68dvh * 240 / 560), calc((100dvh - 216px) * 240 / 560));
  }

  .panel {
    left: auto;
    top: 0;
    bottom: 0;
    width: min(30vw, 380px);
    max-height: none;
    border-top: 0;
    border-left: 1px solid var(--line-faint);
    border-radius: 0;
    transform: translateX(100%);
    padding-top: env(safe-area-inset-top);
  }
  .panel.is-open {
    transform: translateX(0);
  }
  .panel-handle {
    display: none;
  }
  .panel::after {
    display: none;
  }
}

/* Hoy's header: undo, redo and "…" (with "Vaciar el look"), right. Without
   anything to undo or redo a button steps back to 0.35. */
.icon-btn svg.icon-dots {
  fill: currentColor;
  stroke: none;
}
.hoy-more {
  position: relative;
}
.hoy-more .panel-menu {
  top: calc(100% + 4px);
  right: 0;
}
.panel-menu-item[aria-disabled="true"] {
  opacity: 0.35;
  cursor: default;
}
.panel-menu-item[aria-disabled="true"]:hover {
  background: none;
}
[data-history][aria-disabled="true"] {
  opacity: 0.35;
  cursor: default;
}
.icon-btn[data-history][aria-disabled="true"]:hover,
.icon-btn[data-history][aria-disabled="true"]:active,
.panel-history[aria-disabled="true"]:hover {
  background: none;
}
[data-history] {
  transition: opacity var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
/* The same two in the sheet's header, beside the ×: 32px like it, 44px to
   the finger. Phones only; from 760px the header's own stay in reach. */
.panel-history {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
}
.panel-history::before {
  content: "";
  position: absolute;
  inset: -6px;
}
.panel-history:hover {
  background: var(--line-faint);
}
.panel-history svg {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.panel--hoy .panel-header {
  gap: var(--sp-3);
}
@media (min-width: 760px) {
  .panel-history {
    display: none;
  }
  /* Beside the side panel the header's actions stay in reach, above the
     scrim (the logo stays dimmed with the page). */
  .hoy-actions {
    position: relative;
    z-index: 32;
    transition: transform var(--dur-base) var(--ease-out);
  }
  /* The side panel would cover them: they move aside with it. */
  body:has(.panel--hoy.is-open) .hoy-actions {
    transform: translateX(calc(-1 * var(--hoy-panel-w)));
  }
}

/* Hoy never scrolls, yet the root keeps a stable scrollbar gutter (so the
   tab bar holds still between pages): Hoy's sheet or side panel and its
   scrim reach under that empty gutter (measured in js/app.js) instead of
   leaving a strip beside them. */
.panel--hoy,
.panel--save,
body:has(.panel--hoy) .scrim {
  right: calc(-1 * var(--root-gutter, 0px));
}

/* Hoy's two views (plans/024-vista-flat-lay.md): the silhouette, and what
   it wears as photos on one plate. The switch sits under the figure, in the
   same place in both: two pills in the category pills' language inside one
   hairline, and an ink outline that slides to the chosen one. Both are the
   same width, so the outline moves by transform alone. */
.view-switch {
  position: absolute;
  z-index: 10; /* over the paper fade above the tab bar (.pie-papel), under the scrim */
  left: 50%;
  bottom: calc(var(--nav-clearance) + 14px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  transform: translateX(-50%);
  border: 1px solid var(--line-faint-strong);
  border-radius: 999px;
}
.view-switch button {
  position: relative;
  min-width: 92px;
  min-height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: var(--fs-100);
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
/* 44px to the finger. */
.view-switch button::before {
  content: "";
  position: absolute;
  inset: -4px 0;
}
.view-switch button:hover {
  color: var(--ink);
}
.view-switch button:active {
  transform: scale(0.97);
}
.view-switch button[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 500;
}
.view-switch button:focus-visible {
  outline-offset: -5px;
  border-radius: 999px;
}
/* "Lo llevo hoy" (plan 036c): over the view switch, 12px above it, in both
   views; the line saying it will be noted by itself, above it. An outlined
   pill (1.5px ink, paper ground) as the switch's chosen half; once pressed it
   goes, and the toast says "Apuntado · Deshacer" in its place (plan 039b). */
.llevo {
  position: absolute;
  z-index: 10; /* over the paper fade above the tab bar (.pie-papel), under the scrim */
  left: 50%;
  bottom: calc(var(--nav-clearance) + 14px + 36px + 12px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: calc(100% - 2 * var(--sp-4));
}
.llevo[hidden],
.llevo [hidden] {
  display: none;
}
.llevo-nota {
  margin: 0;
  font-size: 0.6875rem;
  line-height: 1.2;
  color: var(--ink-soft);
  text-align: center;
}
.llevo-boton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--fs-200);
  font-weight: 600;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out);
}
.llevo-boton:active {
  transform: scale(0.97);
}
/* Once "Lo llevo hoy" and its toast have gone, the switch rises into their
   room (the 44px button and the 10px between it and the 38px switch), so
   no gap is left between the figure and it: its top where the button's was.
   When the button comes back, it goes down again and the button fades in
   (js/app.js, pintarHueco). */
.view-switch[data-hueco="cerrado"] {
  transform: translate(-50%, calc(-44px - 10px));
}
.view-switch.se-mueve {
  transition: transform 300ms var(--ease-ios);
}
.llevo.entra {
  animation: llevo-entra 200ms var(--ease-out) 120ms both;
}
@keyframes llevo-entra {
  from {
    opacity: 0;
  }
}
/* Reduced motion: the system's, or Perfil's "Movimiento" (html[data-movimiento], plan 041e). */
:where(html[data-movimiento="reducido"]) .view-switch.se-mueve {
  transition: none;
}
:where(html[data-movimiento="reducido"]) .llevo.entra {
  animation: none;
}
/* A short screen (375×667): the line goes, and the figure (or the plate)
   leaves "Lo llevo hoy" its room over the switch. The figure keeps its size:
   centred in less room, it stands 28px higher; the plate is a little smaller. */
/* From 760px wide, the figure fits that room too (164px below it): 1500×730
   and 1366×650 (plan 039b). */
@media (max-height: 740px) and (min-width: 760px) {
  .silhouette-stage {
    width: min(34vw, 340px, calc(68dvh * 240 / 560), calc((100dvh - 256px) * 240 / 560));
  }
}
@media (max-height: 740px) {
  .llevo-nota {
    display: none;
  }
  .hoy {
    padding-bottom: calc(var(--nav-clearance) + var(--sp-6) + 56px);
  }
  .flatlay-band {
    bottom: calc(var(--nav-clearance) + 14px + 38px + 18px + 56px);
  }
}
/* Drawn over the hairline, so the chosen half reads as one ink pill. */
.view-switch-indicator {
  position: absolute;
  inset: -1px calc(50% - 1px) -1px -1px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  pointer-events: none;
  transition: transform var(--dur-move) var(--ease-out);
}
.view-switch[data-view="prendas"] .view-switch-indicator,
html[data-hoy-vista="prendas"] .view-switch-indicator {
  transform: translateX(calc(100% - 2px));
}

/* "Guardar look de hoy" (docs/brief-looks.md §5.5) is the first row of the
   header's "…" menu, above "Vaciar el look". Once Hoy is a saved look the
   row names it instead ("Guardado como «City look»", cut with an ellipsis if
   it is long) and leads to it. */
.hoy-more .panel-menu {
  /* Over the figure and the plate, which stand above the scrim's level. */
  z-index: 32;
  width: max-content;
  max-width: min(300px, calc(100vw - var(--sp-6)));
}
.hoy-more .panel-menu-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* While "Guardar look" is open the figure stays lit above the scrim, as
   when a zone is being dressed, but it is not there to be dressed: a tap on
   it reaches the scrim and closes the sheet. */
body:has(.panel--save.is-open) :is(.zone-hotspot, .flatlay-btn, .flatlay-dress) {
  pointer-events: none;
}
/* The plate does dim with the page: its photos keep the soft shadow of the
   product shot, which is invisible on paper and a pale edge on anything
   darker. Until the sheet is hidden, not just closing, so the photos never
   come back lit while the scrim is still fading. */
body:has(.panel--save:not([hidden])) .flatlay-band {
  z-index: auto;
}
/* Its paper reaches under the root's empty gutter with the scrim (below);
   its content keeps to the page's width. */
.panel--save {
  padding-right: var(--root-gutter, 0px);
}
@media (min-width: 760px) {
  /* The header's actions dim with the page instead of staying in reach. */
  body:has(.panel--save.is-open) .hoy-actions {
    z-index: auto;
  }
}

/* The view not shown: out of sight, but still laid out. Until app.js
   starts, the root says which one it is (set in index.html's <head> before
   the first paint). */
.silhouette-stage.is-away,
.flatlay-band.is-away,
html[data-hoy-vista="prendas"] .silhouette-stage {
  visibility: hidden;
}
html[data-hoy-vista="prendas"] .flatlay-band {
  visibility: visible;
}

/* The band the figure stands in, between the header and the switch; the
   plate is the largest 3:4 that fits it. */
.flatlay-band {
  position: absolute;
  inset: var(--sp-4) var(--sp-5) calc(var(--nav-clearance) + 14px + 38px + 18px);
  display: grid;
  place-items: center;
  container-type: size;
  /* With the figure, above the scrim: the photos travel to and from it. Only
     its photos take a touch: the rest of the band lets it through (to "Lo
     llevo hoy", plan 036c, or to the scrim). */
  z-index: 31;
  pointer-events: none;
}
.flatlay-band .flatlay > * {
  pointer-events: auto;
}
.flatlay {
  position: relative;
  width: min(100cqw, 420px, 100cqh * 0.75);
  aspect-ratio: 3 / 4;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* The plate's ground is its own layer, so it can appear while the photos
   are still on their way to it. */
.flatlay::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  background: var(--casilla);
}
/* Each garment's place is set inline, as percentages of the plate
   (layoutFor in js/flatlay.js); it travels from the figure by transform. */
.flatlay-item,
.flatlay-more {
  position: absolute;
}
.flatlay-item {
  transform-origin: 0 0;
}
/* Piled on the figure as they leave it or land, the torso's layers keep the
   order they are worn in: the outer one on top. */
.flatlay-item[data-key="torso.base"] {
  z-index: 1;
}
.flatlay-item[data-key="torso.media"] {
  z-index: 2;
}
.flatlay-item[data-key="torso.exterior"] {
  z-index: 3;
}
/* A garment is a button the size of its photo; a small one (a watch, a
   pair of glasses) still takes 44px to the finger. */
.flatlay-btn {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-card);
  transition: transform var(--dur-fast) var(--ease-out);
}
.flatlay-btn::before {
  content: "";
  position: absolute;
  inset: min(0px, (100% - 44px) / 2);
}
.flatlay-btn:active {
  transform: scale(0.97);
}
.flatlay-btn:focus-visible {
  border-radius: var(--radius-card);
}
/* A garment gone from the look fades where it lay (js/app.js). */
.flatlay-item.is-leaving {
  pointer-events: none;
}
.flatlay-btn > .garment-photo,
.flatlay-btn > svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.flatlay-btn > svg {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.flatlay-more {
  display: grid;
  place-items: center;
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.flatlay-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--sp-2);
  padding: var(--sp-5);
  text-align: center;
  color: var(--ink-soft);
}
.flatlay-empty p {
  margin: 0;
}
/* The primary pill at its content's width, as in Armario's welcome. */
.flatlay-empty .flatlay-dress {
  width: auto;
  margin-top: var(--sp-3);
}

/* Hoy's zone panel: the other half of the figure (docs/brief-panel-vestir.md).
   The zone's name at Display size, what it wears, its type pills and its
   garments as Armario's cards; the worn one marked by an ink outline. */
.panel--hoy .panel-header h2 {
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.wear-current {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* The plate a worn garment sits on: the card's own ground, square. */
.wear-plate {
  position: relative;
  flex: none;
  width: 72px;
  aspect-ratio: 1;
  border-radius: var(--radius-card);
  background: var(--casilla);
}
.wear-plate-visual {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.wear-plate .garment-photo {
  width: 80%;
  height: 80%;
}
.wear-plate svg {
  width: 56%;
  height: 56%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* An empty plate: the hueco's cutting pattern, as on the figure. */
.wear-plate svg.wear-plate-pattern {
  width: 70%;
  height: 70%;
  stroke: var(--line-faint-strong);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}
.wear-plate-pattern * {
  vector-effect: non-scaling-stroke;
}
.wear-plate-pattern .g-detail {
  display: none;
}
.wear-plate .strip-item-dot {
  right: 6px;
  top: 6px;
}

/* One hueco (head, legs): plate, name and type, "Quitar". */
.wear-single {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.wear-single-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wear-single-name {
  font-size: var(--fs-300);
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.wear-single-name.is-empty {
  font-weight: 400;
  color: var(--ink-soft);
}
.wear-single-type {
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.wear-single-type:empty {
  display: none;
}
.wear-remove {
  position: relative;
  flex: none;
  min-height: 36px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line-faint-strong);
  border-radius: 999px;
  font-size: var(--fs-100);
  font-weight: 600;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
/* 36px drawn, 44px to the finger. */
.wear-remove::before {
  content: "";
  position: absolute;
  inset: -4px;
}
.wear-remove:hover {
  border-color: var(--ink);
}
.wear-remove:active {
  transform: scale(0.96);
}
.wear-remove[hidden] {
  display: none;
}

/* Several huecos (torso, feet) or accessories (hands): a row of thumbnails,
   each with its × on the corner. It bleeds to the panel's edge and scrolls
   when the hands wear more than fit. */
.wear-list.is-thumbs {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  margin: 0 calc(var(--sp-5) * -1);
  padding: 10px var(--sp-5) 2px;
  scrollbar-width: none;
}
.wear-list.is-thumbs::-webkit-scrollbar {
  display: none;
}
/* The hands with nothing on: only "Sin accesorios todavía." under the label. */
.wear-list.is-thumbs:empty {
  display: none;
}
.wear-thumb {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.wear-thumb-plate {
  width: 64px;
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.wear-thumb-plate:hover {
  background: var(--casilla-hover);
}
.wear-thumb-plate:active {
  transform: scale(0.97);
}
.wear-thumb-plate:focus-visible {
  border-radius: var(--radius-card);
}
.wear-thumb-x {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line-faint-strong);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.wear-thumb-x::before {
  content: "";
  position: absolute;
  inset: -10px;
}
.wear-thumb-x:hover {
  border-color: var(--ink);
}
.wear-thumb-x[hidden] {
  display: none;
}
.wear-thumb-x svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.wear-thumb-label {
  font-size: var(--fs-100);
  line-height: 1.3;
  color: var(--ink-soft);
}
.wear-thumb-label:empty {
  display: none;
}
.wear-empty {
  margin: 0;
  color: var(--ink-soft);
}
.wear-empty[hidden] {
  display: none;
}

/* Armario's pill row, bleeding to the panel's edge at every width. */
.panel .wear-types {
  margin: 0 calc(var(--sp-5) * -1);
  padding: 3px var(--sp-5);
}

/* A held photo lifts its garment: no callout or text selection over it. */
.wear-grid .card {
  -webkit-touch-callout: none;
  user-select: none;
}
/* Armario's cards, three to a row at every width, 8px apart. */
.panel .wear-grid {
  position: relative;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
  margin-top: calc(var(--sp-2) * -1);
}
.wear-grid .grid-empty {
  margin: 0;
  padding: var(--sp-5) var(--sp-4);
}
/* The worn garment's mark: a line of ink 3px outside its card. Its own
   element, one per hueco, so it can travel from card to card. */
.wear-outline {
  position: absolute;
  top: 0;
  left: 0;
  border: 1.5px solid var(--ink);
  border-radius: calc(var(--radius-card) + 3px);
  pointer-events: none;
  transition: transform var(--dur-move) var(--ease-out);
}
.wear-outline.is-instant {
  transition: none;
}
/* With a mouse every sheet scrolls by a thin ink-step pill, as the strip
   did; touch screens keep their own overlay bar. */
@media (hover: hover) and (pointer: fine) {
  .panel-body::-webkit-scrollbar {
    width: 6px;
  }
  .panel-body::-webkit-scrollbar-track {
    background: transparent;
  }
  .panel-body::-webkit-scrollbar-thumb {
    background: var(--line-faint);
    border-radius: 999px;
  }
  .panel-body::-webkit-scrollbar-thumb:hover {
    background: var(--line-faint-strong);
  }
}
.wear-outline[hidden] {
  display: none;
}

.wear-more {
  align-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--sp-3);
  margin-top: calc(var(--sp-3) * -1);
  font-size: var(--fs-100);
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.wear-more:hover {
  color: var(--ink);
}
.wear-more[hidden] {
  display: none;
}

@media (min-width: 760px) {
  /* Wide enough for three cards of about 90px or more. */
  :root {
    --hoy-panel-w: clamp(340px, 34vw, 400px);
  }
  .panel--hoy {
    width: var(--hoy-panel-w);
  }

  .panel--hoy .panel-header h2 {
    font-size: 2.25rem;
  }
  /* The title sits on the line of Hoy's header row beside it (its icons
     centre 46px down), not tucked against the top edge. */
  .panel--hoy .panel-header {
    padding-top: 26px;
  }
  /* Beside the figure the pills keep inside the panel's 24px margin and
     wrap onto as many lines as they need, so every type shows whole (the
     sliding outline follows them across lines). The bleeding, sideways
     row is the phone's. */
  .panel .wear-types {
    flex-wrap: wrap;
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
  .wear-single .wear-plate {
    width: 88px;
  }
}

/* The zone's large title, in the panel's content: shown on phones only,
   where it scrolls away under the sheet's thin bar (iOS's large titles). */
.wear-title {
  display: none;
}
@media (max-width: 759px) {
  /* A thin bar over the top of the scrolling content: the grabber, then
     undo, redo and × on the right. Clear at rest, where the large title
     sits level with its buttons; paper with a hairline, and the zone's name
     at body size, once the content scrolls under it. */
  .panel--hoy .panel-handle {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 3;
    margin: 6px 0 0 -18px;
  }
  .panel--hoy .panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    height: 46px;
    padding: 6px var(--sp-4) 0 var(--sp-5);
    gap: var(--sp-2);
    justify-content: flex-end;
    border-radius: 20px 20px 0 0;
    border-bottom: 1px solid transparent;
    background: transparent;
    transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  }
  .panel--hoy .panel-header.is-condensed {
    background: var(--paper);
    border-bottom-color: var(--line-faint);
  }
  .panel--hoy .panel-header h2 {
    position: absolute;
    left: var(--sp-5);
    right: 136px;
    top: 6px;
    bottom: 0;
    display: flex;
    align-items: center;
    font-size: var(--fs-200);
    line-height: 1.2;
    letter-spacing: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity var(--dur-fast) var(--ease-out);
  }
  .panel--hoy .panel-header.is-condensed h2 {
    opacity: 1;
  }
  .panel--hoy .panel-body {
    padding-top: var(--sp-2);
    gap: var(--sp-4);
    scroll-padding-top: 46px;
  }
  /* Level with the bar's buttons, never under them. */
  .wear-title {
    display: block;
    max-width: calc(100% - 112px);
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.015em;
    text-wrap: balance;
  }
  /* A name too long for one line beside the buttons ("Manos y muñecas")
     steps down rather than taking a second line (app.js measures it). */
  .wear-title.is-long {
    font-size: 1.625rem;
  }
  /* On phones the plates step down so the grid starts higher, but every
     block keeps its air: 12px under the title, 8px under the section label,
     and the type pills centred between "Prenda actual" and the photos (19px
     to each, the pill row's own 3px padding included). */
  .wear-title + .wear-current {
    margin-top: -4px;
  }
  .panel--hoy .wear-current {
    gap: var(--sp-2);
  }
  .wear-list.is-thumbs {
    padding-top: var(--sp-2);
  }
  .wear-thumb {
    gap: var(--sp-1);
  }
  .wear-thumb-plate {
    width: 52px;
  }
  .wear-thumb-label {
    line-height: 1.2;
  }
  .wear-single .wear-plate {
    width: 64px;
  }
  .panel .wear-grid {
    margin-top: 0;
  }
}

/* Armario */

.topbar--contained {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
}

.armario {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 var(--sp-5) calc(var(--nav-clearance) + var(--sp-6));
}

/* Search lives in the header row and grows out of the magnifier: the bar
   is revealed from the magnifier's own spot and its icon travels from there
   to the head of the bar. Nothing below the header moves. */
.topbar-search {
  position: absolute;
  left: var(--sp-5);
  right: calc(var(--sp-5) - var(--sp-2));
  bottom: var(--sp-2);
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: var(--sp-1);
  align-items: center;
  pointer-events: none;
}
.topbar-search .search-bar {
  background: var(--paper);
  opacity: 0;
  clip-path: inset(0 0 0 calc(100% - 44px) round 22px);
  transition: clip-path 240ms var(--ease-out), opacity 120ms var(--ease-out) 180ms;
}
.topbar-search .search-bar > svg {
  stroke: var(--ink);
  transform: translateX(var(--mag-dx, 0px)) scale(1.05);
  transition: transform 240ms var(--ease-out), stroke 240ms var(--ease-out);
}
.topbar-search > .icon-btn {
  opacity: 0;
  transition: opacity 120ms var(--ease-out);
}
.topbar .wordmark,
.topbar-actions {
  transition: opacity 120ms var(--ease-out) 180ms, visibility 0s linear 0s;
}
.topbar .wordmark {
  transition-delay: 80ms, 0s;
}

.topbar.is-searching .topbar-search {
  pointer-events: auto;
}
.topbar.is-searching .topbar-search .search-bar {
  opacity: 1;
  clip-path: inset(0 0 0 0 round 22px);
  transition: clip-path var(--dur-base) var(--ease-out), opacity 120ms var(--ease-out);
}
.topbar.is-searching .topbar-search .search-bar > svg {
  stroke: var(--ink-soft);
  transform: none;
  transition: transform var(--dur-base) var(--ease-out), stroke var(--dur-base) var(--ease-out);
}
.topbar.is-searching .topbar-search > .icon-btn {
  opacity: 1;
  transition-delay: 120ms;
}
.topbar.is-searching .wordmark,
.topbar.is-searching .topbar-actions {
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms var(--ease-out), visibility 0s linear 120ms;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  border: 1px solid var(--line-faint-strong);
  border-radius: 999px;
  padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-4);
  min-height: 44px;
}
.search-bar svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.search-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font: inherit;
  /* 16px keeps iOS Safari from zooming the page on focus. */
  font-size: 1rem;
  color: var(--ink);
  caret-color: var(--ink);
}
.search-bar input::placeholder {
  color: var(--ink-soft);
}
.search-bar input::-webkit-search-cancel-button {
  display: none;
}
.search-bar input:focus {
  outline: none;
}
.search-bar:focus-within {
  border-color: var(--ink);
}
.search-clear {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink-soft);
}
.search-clear[hidden] {
  display: none;
}
.search-clear:hover {
  color: var(--ink);
  background: var(--line-faint);
}

/* Empty wardrobe — the welcome takes the grid's place and everything that
   acts on garments steps aside (see renderWelcome in armario.js). */
.armario.is-empty > :not(.wardrobe-welcome, h1) {
  display: none;
}
.wardrobe-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  /* Fills the screen between header and tab bar without scrolling, so the
     welcome sits just above its optical centre. */
  min-height: calc(100dvh - var(--nav-clearance) - 140px);
  padding: var(--sp-6) var(--sp-2) var(--sp-7);
  text-align: center;
}
.welcome-line {
  width: 200px;
  height: auto;
  margin-bottom: var(--sp-4);
  overflow: visible;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* The line is drawn once on arrival: the thread climbs in from the left and
   becomes the hanger's shoulders, then the stem drops. */
.welcome-line path {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: welcome-draw 900ms var(--ease-out) both;
}
.welcome-line .welcome-line-stem {
  animation-duration: 420ms;
  animation-delay: 620ms;
}
@keyframes welcome-draw {
  from {
    stroke-dashoffset: 1;
  }
}
.welcome-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}
.welcome-text {
  margin: 0;
  max-width: 30ch;
  color: var(--ink-soft);
  text-wrap: balance;
}
.wardrobe-welcome .welcome-action {
  width: auto;
  margin-top: var(--sp-3);
}
.topbar .icon-btn[hidden] {
  display: none;
}

/* Armario's two views (plan 031): Perchero or Cuadrícula. The switch is Hoy's
   view switch (one hairline, an ink outline that slides) in its compact form:
   two 44px segments of line icons, 32px tall, on the count's row, beside
   "Filtrar" (12px apart, 20px counting the button's own padding), so it costs no row of its own. Each segment reaches 44px to the
   finger. The page marks the view on <html> before the first paint (see
   armario.html), and the CSS shows and hides by it. */
.armario-meta-end {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.view-switch--compact {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  grid-template-columns: 44px 44px;
}
.view-switch--compact button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 30px; /* 32px con el borde de 1px del conmutador */
  padding: 0;
}
.view-switch--compact button::before {
  inset: -7px 0; /* 30 + 14 = 44px a la altura del dedo */
}
.view-switch--compact svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html[data-armario-vista="cuadricula"] #armarioSwitch .view-switch-indicator {
  transform: translateX(calc(100% - 2px));
}
/* Perchero keeps the count, "Filtrar" and the active filters; its own rows
   (css/perchero.css) take the place of the category pills, the type drawer
   and the grid, which belong to Cuadrícula. */
html[data-armario-vista="perchero"] :is(#categoryRow, #subcatDrawer, #grid),
html[data-armario-vista="cuadricula"] #perchero {
  display: none;
}

.armario-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 36px;
}

.armario-count {
  margin: 0;
  font-size: var(--fs-200);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* Plan 035e: one line under the count while one's own garments sit among
   the samples: how many, the way to keep only one's own, and ×. One line at
   every width; the count gives way first. */
.ejemplo-aviso {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  font-size: var(--fs-100);
  color: var(--ink-soft);
  white-space: nowrap;
}
.ejemplo-aviso[hidden] {
  display: none;
}
.ejemplo-aviso-texto {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ejemplo-aviso-accion {
  flex: 0 0 auto;
  min-height: 44px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-faint-strong);
  text-underline-offset: 3px;
}
.ejemplo-aviso-accion:hover {
  text-decoration-color: var(--ink);
}
.ejemplo-aviso-cerrar {
  flex: 0 0 auto;
  /* 32 wide (44 tall): at 375 the text needs the room. */
  width: 32px;
  height: 44px;
  margin-left: auto;
  margin-right: -6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink-soft);
}
.ejemplo-aviso-cerrar:hover {
  color: var(--ink);
}
.ejemplo-aviso-cerrar svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.filters-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 var(--sp-2);
  margin-right: calc(var(--sp-2) * -1);
  border-radius: 999px;
  font-size: var(--fs-100);
  color: var(--ink-soft);
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.filters-btn:hover,
.filters-btn.is-active {
  color: var(--ink);
}
.filters-btn:hover {
  background: var(--line-faintest);
}
.filters-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.filters-btn-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.filters-btn-count[hidden] {
  display: none;
}

/* Category pills — outlined, the selected one drawn in full ink. Bleeds to
   the screen edge so the row visibly continues past the last pill. */
.category-row {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  margin: var(--sp-3) calc(var(--sp-5) * -1) 0;
  padding: 3px var(--sp-5);
  scroll-padding-inline: var(--sp-5);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.category-row::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 18px;
  border: 1px solid var(--line-faint-strong);
  border-radius: 999px;
  font-size: var(--fs-100);
  color: var(--ink-soft);
  white-space: nowrap;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.cat-pill:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
}
.cat-pill:active {
  transform: scale(0.97);
}
.cat-pill[aria-pressed="true"] {
  padding: 0 17.5px;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-weight: 500;
}
/* One outline that travels between pills; the selected pill keeps its
   1.5px border but transparent, so nothing reflows. */
.cat-pill-indicator {
  position: absolute;
  top: 0;
  left: 0;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  pointer-events: none;
  transition: transform var(--dur-move) var(--ease-out), width var(--dur-move) var(--ease-out);
}
.cat-pill-indicator.is-instant {
  transition: none;
}
.category-row.has-indicator .cat-pill[aria-pressed="true"] {
  border-color: transparent;
}

.active-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.active-filters-row:empty {
  display: none;
}

.filters-clear {
  font-size: var(--fs-100);
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: var(--sp-1) var(--sp-2);
}
.filters-clear:hover {
  color: var(--ink);
}
.filters-clear[hidden] {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

/* Card — the garment alone on a soft ground: no outline, and no caption
   once a photo shows the garment (see .card-name). */
.card {
  position: relative;
  aspect-ratio: 6 / 7;
  display: grid;
  place-items: center;
  border-radius: var(--radius-card);
  background: var(--casilla);
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.card:hover {
  background: var(--casilla-hover);
}
.card:active {
  transform: scale(0.97);
}
.card:focus-visible {
  border-radius: var(--radius-card);
}
.card svg {
  width: 56%;
  height: 56%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card .strip-item-dot {
  right: 9px;
  top: 9px;
}
/* While its detail is open, the card's garment is up in the sheet. */
.card > svg,
.card > .garment-photo {
  transition: opacity var(--dur-fast) var(--ease-out);
}
.card.is-lifted > svg,
.card.is-lifted > .garment-photo {
  opacity: 0;
  transition: none;
}
.card:not(.is-fading) > svg,
.card:not(.is-fading) > .garment-photo {
  transition: none;
}
/* A garment still drawn in line is named inside its card, on one line at
   its foot (where a sample shows "Hace tiempo"), and the drawing is centred
   in the room above. So every card keeps its 6:7 box and every row the same
   height, with or without a name (flights and transitions measure the same
   rect). A long name ends in "…"; the whole of it is in the detail and the
   card's label. */
.card-named:not(.has-photo) {
  --card-name-foot: 24px; /* one 11px line, 7px from the bottom, and air */
  padding-bottom: var(--card-name-foot);
}
.card-name {
  position: absolute;
  left: var(--sp-2);
  right: var(--sp-2);
  bottom: 7px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.6875rem;
  line-height: 1.2;
  color: var(--ink);
  text-align: center;
}
.card.has-photo .card-name {
  display: none;
}
/* "Hace tiempo" (plan 036b): a line clock in the corner facing the colour
   dot, ink-soft, on every card it applies to, with a photo or not; the foot
   keeps only the name (a card with no photo), so every row is one height. */
.card-hace {
  position: absolute;
  left: 9px;
  top: 9px;
  width: 14px;
  height: 14px;
  color: var(--ink-soft);
}
.card-hace svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* In Armario (main grid and category screen) every card with a photo gives
   it the same box, with a foot under it, so all photos are drawn at one size
   and a tall garment (trousers, a bag) is drawn as the rest; the box is
   centred, so a garment never floats high on an empty foot. The card → detail flight moves the photo from either place
   to the detail's centred box (photoOffset in js/armario.js). Elsewhere (the
   look detail's grid, which never shows the notice) the photo stays centred
   at 80%. */
.card-foot.has-photo {
  --card-foot: 26px; /* as tall as a name's line at the foot (7px + 13px) and 6px of air */
}
.card-foot.has-photo > .garment-photo {
  top: calc((8% + var(--card-foot)) / 2);
  left: 10%;
  right: auto;
  bottom: auto;
  width: 80%;
  height: calc(92% - var(--card-foot));
  margin: 0;
}

/* What the clock means, over it (js/armario.js, avisoHace): an ink pill as
   the toast, one line of Label text. */
.hace-aviso {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 80;
  max-width: calc(100vw - 16px);
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--fs-100);
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.hace-aviso.is-visible {
  opacity: 1;
}
/* The mark answers the pointer a little beyond its 14px. */
.card-hace::before {
  content: "";
  position: absolute;
  inset: -8px;
}
/* A held finger reads the mark: no callout or text selection over a card. */
.grid .card[data-hace] {
  -webkit-touch-callout: none;
  user-select: none;
}
/* "Hace tiempo", explained in the detail. */
.detail-hace {
  margin: var(--sp-4) 0 0;
  text-wrap: balance;
  font-size: var(--fs-100);
  color: var(--ink-soft);
  text-align: center;
}
.detail-hace svg {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 6px;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* A garment's uses in its detail (plan 036b): the look detail's figures. */
.detail-usos {
  margin-top: var(--sp-4);
}
.detail-usos-nada {
  margin: var(--sp-4) 0 0;
  font-size: var(--fs-100);
  color: var(--ink-soft);
  text-align: center;
}

/* Cut-out photos (transparent WebP, tools/fotos-prendas.ps1) sit on the
   same ground as the line icons. No blend mode: multiply would tint white
   garments with the card's grey. The box is fixed by the container, so
   nothing moves while a photo loads. */
.garment-photo {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 80%;
  height: 80%;
  object-fit: contain;
  /* The photo is never the target: taps and Hoy's drag-to-dress belong to
     the button around it, not to the browser's own image drag. */
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}
.strip-item-icon .garment-photo {
  width: 46px;
  height: 46px;
}

.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--sp-7) var(--sp-4);
  color: var(--ink-soft);
  font-size: var(--fs-200);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}

.view[hidden],
.grid[hidden] {
  display: none;
}

/* Type pills — the second level under a group pill. Smaller and filled
   rather than outlined: they don't select, they open a type's own screen.
   The row bleeds like the pill row. It opens and closes at once, without
   animating its height: that would re-lay out and repaint the whole grid
   below on every frame. The grid's own fade hides the jump, and the pills'
   cascade is the entrance. */
.subcat-drawer {
  display: grid;
  margin: 0 calc(var(--sp-5) * -1);
  grid-template-rows: 0fr;
}
.subcat-drawer.is-open {
  grid-template-rows: 1fr;
}
.subcat-drawer-inner {
  min-height: 0;
  overflow: hidden;
}
.subcat-row {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding: var(--sp-3) var(--sp-5) 3px;
  scroll-padding-inline: var(--sp-5);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.subcat-row::-webkit-scrollbar {
  display: none;
}

/* Freshly built type pills arrive in a quick cascade; never blocks taps. */
@keyframes sub-pill-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
/* Subordinate to the group row: lower, softer text; ink only on intent. */
.sub-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: var(--sp-1) var(--sp-3);
  border-radius: 999px;
  background: var(--line-faintest);
  font-size: var(--fs-100);
  line-height: 1.2;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
  animation: sub-pill-in 180ms var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 30ms);
}
.sub-pill:hover,
.sub-pill:active {
  color: var(--ink);
  background: var(--line-faint);
}
.sub-pill:active {
  transform: scale(0.97);
}
.sub-pill-name {
  display: inline-block;
}
.sub-pill-count {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}
/* Reduced motion: the system's, or Perfil's "Movimiento" (html[data-movimiento], plan 041e). */
:where(html[data-movimiento="reducido"]) .sub-pill {
  animation: none;
}
/* Both pill rows scroll, so an outset ring would be clipped by the row. */
.sub-pill:focus-visible,
.cat-pill:focus-visible {
  outline-offset: -2px;
  border-radius: 999px;
}
/* The selected pill's own ink border would swallow that ring: draw it
   inside the border instead, with a sliver of paper between them. */
.cat-pill[aria-pressed="true"]:focus-visible {
  outline-offset: -5px;
}

/* Category screen — back arrow and "…" over a large title, as in
   referencias/paginas/armario-categorias-ropa.png. The bar stays put and
   picks up the name in small type once the large title scrolls away. */
.cat-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  /* "Volver" | the title, centred | "+" and "…" (plan 048): both sides as wide. */
  grid-template-columns: 88px 1fr 88px;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  /* Insets put the chevron's and the dots' drawn edges on the text column. */
  padding: max(env(safe-area-inset-top), var(--sp-4)) calc(var(--sp-5) - 14px) var(--sp-1) calc(var(--sp-5) - 18px);
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.cat-topbar.is-condensed {
  border-bottom-color: var(--line-faint);
}
.cat-topbar-title {
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  font-size: var(--fs-200);
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.cat-topbar.is-condensed .cat-topbar-title {
  opacity: 1;
  transform: none;
}
.cat-topbar-actions {
  display: flex;
  justify-content: flex-end;
}
.cat-more {
  position: relative;
}
.cat-more svg circle {
  fill: currentColor;
  stroke: none;
}
.cat-more-dot {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.cat-more-dot[hidden] {
  display: none;
}

.cat-page {
  padding-top: var(--sp-2);
}
.cat-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.cat-title:focus:not(:focus-visible) {
  outline: none;
}
.cat-title-text {
  display: inline-block;
}
.cat-count {
  margin-top: var(--sp-1);
}

/* Type pill → category: the pill's name grows into the large title and
   that type's garments glide to their places in the grid; the rest of the
   screen slides a short step in the direction of travel. */
.tab-bar {
  view-transition-name: tab-bar;
}
::view-transition-group(*) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
/* Within Armario (html[data-vt] set by transition()): the screen slides a
   short step in the direction of travel. */
html[data-vt]::view-transition-old(root) {
  animation: vt-out 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
html[data-vt]::view-transition-new(root) {
  animation: vt-in 380ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Between tabs (cross-document): one app, not four pages. The tab bar stays
   put and the new screen fades in over the old one, no dip to white and no
   slide, as tab switches do on iOS. The opt-in (@view-transition) is inline
   in each page's <head>: see the comment there. */
html:not([data-vt])::view-transition-old(root) {
  animation: none;
}
html:not([data-vt])::view-transition-new(root) {
  animation: vt-fade-in 150ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
/* The transition swallows taps until it ends: keep the whole of it at 150ms,
   not the 420ms of the Armario morph. */
html:not([data-vt])::view-transition-group(root),
::view-transition-group(tab-bar),
::view-transition-old(tab-bar),
::view-transition-new(tab-bar) {
  animation-duration: 150ms;
}
@keyframes vt-fade-in {
  from {
    opacity: 0;
  }
}
html[data-vt="back"] {
  --vt-shift: -24px;
}
@keyframes vt-in {
  from {
    opacity: 0;
    transform: translateX(var(--vt-shift, 24px));
  }
}
@keyframes vt-out {
  to {
    opacity: 0;
  }
}
::view-transition-old(cat-title),
::view-transition-new(cat-title) {
  width: auto;
  height: 100%;
}

/* Reduced motion (html[data-vt="fade"], set by transition()): the whole
   screen cross-fades; no shared element travels. */
html[data-vt="fade"] * {
  view-transition-name: none !important;
}
html[data-vt="fade"]::view-transition-group(root) {
  animation-duration: 200ms;
}
html[data-vt="fade"]::view-transition-old(root) {
  animation: none;
}
html[data-vt="fade"]::view-transition-new(root) {
  animation: vt-reduced-in 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes vt-reduced-in {
  from {
    opacity: 0;
  }
}

/* Detail, filter and add sheets all reuse .panel */

.detail-icon {
  position: relative;
  width: 144px;
  aspect-ratio: 6 / 7;
  margin: 0 auto;
  border-radius: var(--radius-card);
  background: var(--casilla);
  display: grid;
  place-items: center;
}
.detail-icon svg {
  width: 56%;
  height: 56%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
}
.detail-tags .chip {
  cursor: default;
}
.detail-tags .chip:hover {
  border-color: var(--line-faint);
}

/* ---------- A garment's ficha (plan 038, js/ficha.js) ---------- */

/* The photo, large and with no box: the cut-out straight on the sheet's paper,
   whole (contain) in a box of fixed height, so nothing moves while it loads. */
.detail-icon.ficha-foto {
  width: 100%;
  height: 232px;
  aspect-ratio: auto;
  border-radius: 0;
  background: none;
}
/* A short screen (375×667) still shows the name, the tags and the uses. */
@media (max-height: 700px) {
  .detail-icon.ficha-foto {
    height: 180px;
  }
}
.ficha-foto > .garment-photo {
  width: 100%;
  height: 100%;
}
.ficha-foto > svg {
  width: 132px;
  height: 132px;
  stroke-width: 1.6;
}
.ficha-foto > .strip-item-dot {
  top: calc(50% - 62px);
  right: calc(50% - 72px);
  width: 10px;
  height: 10px;
}
/* The brand over the name, in trama's letter: no logos. */
.ficha-marca {
  margin: var(--sp-3) 0 0;
  font-size: var(--fs-200);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
/* A brand with more garments of it is a link to them all (plan 038c): the same
   line with a ›, 44px tall for a finger without moving what is under it. */
a.ficha-marca {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  margin: calc(var(--sp-3) - 12px) 0 -12px;
  color: var(--ink);
  text-decoration: none;
}
a.ficha-marca svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
a.ficha-marca:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ficha-nombre {
  margin: 2px 0 0;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}
.ficha-nombre.sin-marca {
  margin-top: var(--sp-3);
}
/* The tags, as one line of text instead of pills. */
.ficha-linea {
  margin: 6px 0 0;
  font-size: var(--fs-200);
  line-height: 1.4;
  color: var(--ink-soft);
}
.ficha-linea ~ .detail-usos {
  margin-top: var(--sp-4);
}
.ficha-linea ~ .detail-hace,
.ficha-linea ~ .detail-usos-nada {
  margin-top: var(--sp-3);
  text-align: left;
  text-wrap: pretty;
}
.ficha-seccion > .section-label {
  margin-bottom: var(--sp-3);
}
/* Four to a row at every width: three and "+N", or all of them. */
.ficha-fila {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-4) var(--sp-3);
}
.ficha-fila .strip-item {
  width: auto;
  min-width: 0;
}
.ficha-fila .strip-item-icon {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}
/* Two lines at most, and room for two always: every "7 días" and every tile
   of a row line up. */
.ficha-fila .strip-item-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-height: calc(2 * 1.25em);
  /* A step under the strip's 12px (plan 038d): most names fit whole in two lines. */
  font-size: 11px;
  letter-spacing: -0.005em;
}
.ficha-fila .strip-item-icon .garment-photo {
  width: 76%;
  height: 76%;
}
/* Under a tile of "Con qué la llevas más", the days worn together. */
.ficha-fila-sub {
  font-size: 11px;
  color: var(--ink-soft);
}
/* "Cuándo la usas" (plan 038b): twelve thin bars, January to December, the
   months worn in ink; a month worn opens it in Looks. */
.ficha-meses {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ficha-mes-ir {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  font-size: 11px;
  color: var(--ink-soft);
  text-decoration: none;
}
.ficha-mes-ir i {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--line-faintest);
}
.ficha-mes.si .ficha-mes-ir i {
  background: var(--ink);
}
.ficha-mes.es-este .ficha-mes-ir {
  color: var(--ink);
  font-weight: 600;
}
a.ficha-mes-ir:hover i {
  background: var(--ink-soft);
}
.ficha-meses-texto {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.ficha-semana-texto {
  margin-top: 2px;
}
/* "Etiqueta" (plan 038d): its photo as a thumbnail, and large as a step. */
.ficha-etiqueta-ir {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ficha-etiqueta-foto,
.add-etiqueta-foto {
  position: relative;
  flex: 0 0 auto;
  width: 84px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-card);
  border: 1px solid var(--line-faint);
  overflow: hidden;
  background: var(--casilla);
}
.ficha-etiqueta-foto img,
.add-etiqueta-foto img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ficha-etiqueta-ir:hover .ficha-etiqueta-foto,
.ficha-etiqueta-ir:focus-visible .ficha-etiqueta-foto {
  border-color: var(--ink);
}
.ficha-etiqueta-texto {
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.ficha-etiqueta-grande img {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-card);
  background: var(--casilla);
}
.ficha-etiqueta-pie {
  margin: var(--sp-3) 0 0;
  text-align: center;
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
/* "Foto de la etiqueta" in "Más detalles": the thumbnail with its ×, and "Cambiar". */
.add-etiqueta-fila {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}
.add-etiqueta-foto {
  width: 64px;
}
.add-etiqueta-quitar {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line-faint);
  background: var(--paper);
}
/* A finger's reach, beyond the 24px drawn. */
.add-etiqueta-quitar::before {
  content: "";
  position: absolute;
  inset: -10px;
}
.add-etiqueta-quitar svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
}
.add-etiqueta .add-hint {
  margin: 0;
}
.ficha-mas .strip-item-icon {
  font-size: var(--fs-300);
  font-weight: 600;
  color: var(--ink-soft);
}
/* While the name shows in the sheet, the bar carries only its buttons; once
   it scrolls under the bar, it goes up into it (vigilarNombre). */
.panel:has(.ficha-nombre) .panel-header h2 {
  transition: opacity var(--dur-fast) var(--ease-out);
}
.panel:has(.ficha-nombre):not(.nombre-arriba) .panel-header h2 {
  opacity: 0;
}
/* Opened from a link (?prenda=), the sheet's heading takes the focus: a ring
   shows only from the keyboard. */
#panelTitle:focus {
  outline: none;
}

.section-label {
  margin: 0;
  font-size: var(--fs-100);
  font-weight: 400;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.panel-body.has-actions {
  padding-bottom: 0;
}
.sheet-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  margin-top: calc(var(--sp-2) * -1);
  padding: var(--sp-3) 0 var(--sp-5);
  background: var(--paper);
  border-top: 1px solid var(--line-faint);
}

.sheet-text {
  margin: 0;
  color: var(--ink-soft);
  max-width: 34ch;
}

.btn-primary {
  display: block;
  width: 100%;
  min-height: 48px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--fs-200);
  font-weight: 600;
  text-align: center;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
/* Only with a mouse: a finger's tap leaves :hover on, and the button would
   stay grey, as if disabled, until something else is touched. */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    opacity: 0.85;
  }
}
.btn-primary:active {
  transform: scale(0.98);
}
/* "Ver N prendas": digits that roll when a filter changes the count. */
.roll {
  display: inline-flex;
  font-variant-numeric: tabular-nums;
}
.roll-digit {
  position: relative;
  display: inline-block;
}
.roll-digit > span {
  display: inline-block;
}
.roll-out {
  position: absolute;
  inset: 0;
}

/* Looks — docs/brief-looks.md. A horizontal card per look: the look dressed
   on the silhouette, its name and star, occasion · season, the garments
   (never more than four tiles), how often and when it was worn, and
   "Ponérmelo hoy" right there. */

/* On phones the cards stand as far apart as the page's side padding, so
   each reads as its own look. */
.look-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  margin-top: var(--sp-5);
}

.look-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(96px, 34%) 1fr;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4) var(--sp-4) var(--sp-3);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.look-card:hover {
  background: var(--surface-soft-hover);
}
.look-card:has(.look-card-link:active) {
  transform: scale(0.985);
}

.look-card-visual {
  display: grid;
  place-items: center;
  min-height: 176px;
}
.look-sil {
  height: 172px;
  width: auto;
  max-width: 100%;
  overflow: visible;
}
/* A look with a photo shows it in the figure's place, cut to fill the
   whole column (object-fit: cover) with the card's corners. */
.look-card-photo {
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 176px;
  object-fit: cover;
  /* Anchored high: a full-length photo keeps the head and loses its feet
     and the floor first. */
  object-position: center 25%;
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}
.look-card-photo:not([src]) {
  visibility: hidden;
}
/* The photo is framed by the same 12px all round (it reaches the card's
   foot, where a figure would leave air), so it sits on the card as a print
   on a mount, not wedged against its edges. */
.look-card.has-photo {
  padding-bottom: var(--sp-3);
}
/* On a card each garment covers what is under it (the sleeves of the layers
   beneath, the part of a sleeve under the shoulder), in the card's own
   ground made opaque rather than a tone, and deepening with it on hover. */
.look-card {
  --card-solid: var(--surface-soft-solid);
}
.look-card:hover {
  --card-solid: color-mix(in srgb, var(--ink) 7.5%, var(--paper));
}
.look-sil .sil-fitted > g {
  fill: var(--card-solid);
  transition: fill var(--dur-fast) var(--ease-out);
}
.look-sil .g-detail {
  fill: none;
}

/* The silhouette in Looks: the body in a lighter line so the garments on it
   read first; both keep a hairline weight at any size. The body's line is
   the ink already mixed with the ground behind it (--tinta-cuerpo of ink),
   not ink at an opacity: its clean outline lays two lines where pieces meet,
   which an opacity would darken; and its fills are that ground, so the
   figure still reads as a line drawing. */
.sil-figure,
.sil-garments {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sil-figure {
  --tinta-cuerpo: 30%;
  --trazo-cuerpo: 1;
  stroke: color-mix(in srgb, var(--ink) var(--tinta-cuerpo), var(--card-solid, var(--surface-soft-solid)));
  stroke-width: var(--trazo-cuerpo);
}
.sil-figure .cuerpo-relleno,
.sil-figure .cuerpo-cabeza {
  fill: var(--card-solid, var(--surface-soft-solid));
}
.sil-garments {
  stroke-width: 1.35;
}
.sil-figure *,
.sil-garments * {
  vector-effect: non-scaling-stroke;
}

.look-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: var(--sp-1);
}
.look-card-name {
  margin: 0;
  padding-right: 36px;
  font-size: var(--fs-300);
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}
.look-card-link {
  color: var(--ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
/* The whole card opens the look; the star and the pill sit above it. */
.look-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
}
.look-card-link:focus-visible {
  outline: none;
}
.look-card-link:focus-visible::after {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.look-card-tags {
  margin: var(--sp-1) 0 0;
  font-size: var(--fs-100);
  color: var(--ink-soft);
}

.look-thumbs {
  display: flex;
  gap: 6px;
  margin: var(--sp-4) 0 0;
  padding: 0;
  list-style: none;
}
.look-thumb {
  position: relative;
  flex: 0 1 40px;
  min-width: 0;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-faint);
  border-radius: var(--radius-card);
}
.look-thumb svg {
  width: 66%;
  height: 66%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.look-thumb .garment-photo {
  width: 86%;
  height: 86%;
}
.look-thumb .strip-item-dot {
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
}
.look-thumb.is-missing {
  border-style: dashed;
  border-color: var(--line-faint-strong);
}
.look-thumb-more {
  font-size: var(--fs-100);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.look-card-uses {
  margin: var(--sp-3) 0 0;
  font-size: var(--fs-100);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* "Ponérmelo hoy" on a card: a compact ink pill. Once Hoy wears exactly
   this look it turns into a drawn outline with a check. */
.wear-pill {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin-top: var(--sp-3);
  padding: 0 var(--sp-4);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--fs-100);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out),
    opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
/* A 36px pill, a 44px target. */
.wear-pill::before {
  content: "";
  position: absolute;
  inset: -4px;
}
.wear-pill:hover {
  opacity: 0.85;
}
.wear-pill:active {
  transform: scale(0.96);
}
.wear-pill.is-worn,
.wear-btn.is-worn {
  background: transparent;
  color: var(--ink);
  cursor: default;
}
.wear-pill.is-worn:hover,
.wear-btn.is-worn:hover {
  opacity: 1;
}
.wear-pill.is-worn:active,
.wear-btn.is-worn:active {
  transform: none;
}
.wear-check {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
}

/* Favourite: a star, so it never reads as the Looks heart in the tab bar.
   Drawn in line; marking fills it with ink from its centre. */
.fav-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 1;
  color: var(--ink-soft);
}
.look-topbar .fav-btn {
  position: static;
}
.fav-btn[aria-pressed="true"] {
  color: var(--ink);
}
.fav-btn svg {
  width: 22px;
  height: 22px;
  overflow: visible;
  transition: transform var(--dur-fast) var(--ease-out);
}
.fav-btn:active svg {
  transform: scale(0.9);
}
.star-line {
  fill: none;
}
.star-fill {
  fill: var(--ink);
  stroke: none;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  transition: transform 240ms var(--ease-out);
}
.fav-btn[aria-pressed="true"] .star-fill {
  transform: scale(1);
}

.look-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-7) var(--sp-4);
  text-align: center;
  color: var(--ink-soft);
}
.look-empty p {
  margin: 0;
  max-width: 30ch;
  text-wrap: balance;
}
.look-empty-sil {
  height: 180px;
  width: auto;
  margin-bottom: var(--sp-2);
}
.look-empty-star {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-linejoin: round;
}
.look-empty-action {
  width: auto;
  margin-top: var(--sp-2);
}

/* Look detail — a second view of looks.html, built like the category
   screen: bar, the look large on its silhouette, title, tags, use, the
   garments, and "Ponérmelo hoy" fixed above the tab bar. */
.look-topbar {
  grid-template-columns: 44px 1fr auto;
}
.look-topbar-actions {
  display: flex;
}
/* The content keeps clear of the fixed footer and the tab bar under it.
   Two classes so the 760px `.armario` padding further down can't undo it. */
.armario.look-detail {
  --look-actions-h: calc(48px + var(--sp-3) * 2 + 1px);
  padding-bottom: calc(var(--nav-clearance) + var(--look-actions-h) + var(--sp-6));
}
/* The figure gets a definite height from the same variable as its plate,
   never a percentage that some layouts can't resolve. */
.look-hero {
  --hero-h: min(46dvh, 420px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--hero-h);
  margin-top: var(--sp-2);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}
.look-hero-sil {
  height: calc(var(--hero-h) * 0.88);
  width: auto;
  max-width: 100%;
  overflow: visible;
}
/* At this size the body no longer needs to step back as far as on a card. */
.look-hero-sil .sil-figure {
  --tinta-cuerpo: 55%;
  --trazo-cuerpo: 1.3;
}
.look-hero-sil .sil-garments {
  stroke-width: 1.9;
}
/* Each garment covers the body and the layers under it (drawn bottom to top
   in looks.js) in its own tone, as on Hoy; the plate made opaque is only the
   fallback. Open detail strokes stay unfilled, paper on a dark tone. */
.look-hero-sil .sil-fitted > g {
  fill: var(--garment-fill, var(--surface-soft-solid));
}
/* Filled as on Hoy, the hero's garments take Hoy's inks (plan 043b); its
   accessories, outside .sil-fitted, keep the page's. */
.look-hero-sil .sil-fitted {
  stroke: var(--tinta-prenda);
}
.look-hero-sil .sil-fitted > .is-dark {
  stroke: var(--cuerpo-contorno);
}
.look-hero-sil .g-detail {
  fill: none;
}
.look-hero-sil .is-dark .g-detail:not(.g-waist) {
  stroke: var(--papel-prenda);
  stroke-opacity: 0.75;
}
.look-detail-title {
  margin-top: var(--sp-5);
}
.look-detail-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.look-tags-note {
  margin-left: var(--sp-1);
  font-size: var(--fs-100);
  color: var(--ink-soft);
}

.look-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: var(--sp-5) 0 0;
  border-block: 1px solid var(--line-faint);
}
.look-stat {
  padding: var(--sp-4) 0;
}
.look-stat + .look-stat {
  padding-left: var(--sp-4);
  border-left: 1px solid var(--line-faint);
}
.look-stat dt {
  font-size: var(--fs-100);
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.look-stat dd {
  margin: var(--sp-1) 0 0;
  font-size: var(--fs-400);
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.look-stat-unit {
  font-size: var(--fs-200);
  font-weight: 400;
  color: var(--ink-soft);
}
.look-stat-sub {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-100);
  font-weight: 400;
  color: var(--ink-soft);
}

.look-detail-label {
  margin-top: var(--sp-6);
}
.look-detail .grid {
  margin-top: var(--sp-3);
}
.card.is-missing {
  border: 1px dashed var(--line-faint-strong);
  background: transparent;
  cursor: default;
}
.card-missing-text {
  padding: var(--sp-2);
  font-size: 0.6875rem;
  line-height: 1.25;
  color: var(--ink-soft);
  text-align: center;
}

/* The footer is a paper band down to the screen's edge: the tab bar's
   capsule floats inside it, below the button, and nothing scrolls past. */
.look-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10; /* over the paper fade (9); the tab bar, later in the page, stays over it */
  padding: var(--sp-3) var(--sp-5) calc(var(--nav-clearance) + var(--sp-3));
  background: var(--paper);
  border-top: 1px solid var(--line-faint);
}
.wear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  max-width: 520px;
  margin-inline: auto;
  border: 1.5px solid var(--ink);
}
.wear-btn .wear-check {
  width: 18px;
  height: 18px;
}
/* On the detail, "Deshacer" joins the footer beside the button for a few
   seconds instead of floating over the look. */
.look-actions-row {
  display: flex;
  gap: var(--sp-2);
  max-width: 520px;
  margin-inline: auto;
}
.look-actions-row .wear-btn {
  flex: 1;
  min-width: 0;
}
/* The 48px outlined pill: "Deshacer" in the detail's footer, and the photo
   buttons of "Guardar look" (.btn-outline, the same pill under a name that
   says what it is, with a line icon). */
.undo-inline,
.btn-outline {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 var(--sp-5);
  border: 1px solid var(--line-faint-strong);
  border-radius: 999px;
  font-weight: 600;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.undo-inline[hidden] {
  display: none;
}
.undo-inline:hover,
.btn-outline:hover {
  border-color: var(--ink);
}
.undo-inline:active,
.btn-outline:active {
  transform: scale(0.98);
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-5) 0 var(--sp-4);
}
.btn-outline svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* "Deshacer" on the list: an ink pill above the tab bar. It stays while
   pointed at or focused. On the detail it is .undo-inline, in the footer.
   Its text never takes more than two lines (cut with "…"; a screen reader
   still reads it whole, as the element holds it whole); on two, it keeps
   6px above and below inside the pill, and the corners round off at 24px so
   they do not clip it. "Deshacer" stays centred beside it, 16px away. */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-clearance) + var(--sp-3));
  z-index: 25;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  width: max-content;
  max-width: calc(100% - var(--sp-5) * 2);
  min-height: 48px;
  padding: var(--sp-1) var(--sp-1) var(--sp-1) 20px;
  border-radius: 24px;
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.toast[hidden] {
  display: none;
}
/* With no action, the text keeps the same room on both sides. */
.toast:has(> .toast-action[hidden]) {
  padding-right: 20px;
}
/* A note with no action ("Próximamente…"), shown over an open sheet. On
   phones the sheet fills the bottom, so the note drops in from the top,
   over the dimmed page, instead of covering the sheet's content. */
.toast--notice {
  z-index: 35;
  padding-right: 20px;
}
@media (max-width: 759px) {
  .toast--notice {
    top: calc(env(safe-area-inset-top) + var(--sp-3));
    bottom: auto;
    transform: translate(-50%, -8px);
  }
  .toast--notice.is-visible {
    transform: translate(-50%, 0);
  }
}
/* In the place of an element of Hoy (js/app.js, showToast's `sitio`):
   "Apuntado" where "Lo llevo hoy" was, over the switch, centred on the 44px
   button it replaces; it scrolls with the page as the button did. */
.toast--sitio {
  position: absolute;
  z-index: 10;
  bottom: calc(var(--nav-clearance) + 14px + 36px + 12px - 2px);
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast-text {
  min-width: 0;
  margin: 6px 0; /* a margin, not padding: the cut at two lines falls right under the second */
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.toast-action {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 var(--sp-4);
  border-radius: 999px;
  color: var(--paper);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur-fast) var(--ease-out);
}
.toast-action:hover {
  text-decoration-color: currentColor;
}
.toast-action:focus-visible {
  outline-color: var(--paper);
  outline-offset: -4px;
  border-radius: 999px;
}

/* Sheets of the detail: options, rename, the look's own garment. */
.sheet-list {
  display: flex;
  flex-direction: column;
}
.sheet-row {
  min-height: 52px;
  text-align: left;
  font-size: var(--fs-300);
  border-top: 1px solid var(--line-faint);
}
.sheet-row:first-child {
  border-top: 0;
}
/* Only with a mouse (a tapped row stayed light on a phone); a chosen option
   row keeps its ink, the check says which it is. */
@media (hover: hover) {
  .sheet-row:hover {
    color: var(--ink-soft);
  }
  .sheet-row[aria-checked="true"]:hover {
    color: var(--ink);
  }
}
/* "Añadir prenda" (plan 035b, js/anadir-prenda.js): the photo in its card,
   as it will look in the grid; the type in the group's pills and chips;
   "Más detalles" folded. All of it from the sheets' own parts. */
.add-sheet {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.add-details {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.add-details[hidden] {
  display: none;
}
.add-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
}
.add-preview {
  width: min(168px, 48%);
  align-self: center;
}
.add-photo .filters-clear,
.add-more,
.add-done-links .filters-clear {
  min-height: 44px;
}
/* In the sheet the group pills run edge to edge of it, as on the page. */
.add-groups {
  margin-top: 0;
}
.add-more {
  align-self: flex-start;
  margin-left: calc(var(--sp-2) * -1);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  margin-top: calc(var(--sp-2) * -1);
}
.add-more svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--dur-fast) var(--ease-out);
}
.add-more[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.add-note {
  text-transform: none;
  letter-spacing: 0;
}
.add-price {
  max-width: 10rem;
  min-width: 0;
}
/* The price's currency (plan 044c): its symbol in a pill like the field's,
   beside it, 48px tall; a tap opens trama's own list under it (plan 046,
   js/lista.js and css/lista.css). */
.add-precio {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.add-moneda {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 48px;
  min-height: 48px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--line-faint-strong);
  border-radius: 999px;
  color: var(--ink);
  font-size: 1rem;
  white-space: nowrap;
}
.add-moneda[aria-expanded="true"] {
  border-color: var(--ink);
}
.add-moneda:focus-visible {
  border-color: var(--ink);
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
/* The colour palette: each garment colour in a 32px circle with a hairline of
   ink round it (white still shows on paper), on a 44px target; the chosen one
   ringed in ink 3px out. Estampado/Multicolor is a circle of four colours.
   Its name shows above it, as an ink pill (hover, keyboard focus, a held
   finger). */
.swatches {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-inline: -6px;
}
.swatch {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  -webkit-touch-callout: none;
  user-select: none;
}
.swatch::before {
  content: "";
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--swatch);
  border: 1px solid var(--line-faint-strong);
}
.swatch[data-color="estampado"]::before {
  background: conic-gradient(#a33b34 0 25%, #25344d 0 50%, #c7b299 0 75%, #5b6b4d 0);
}
.swatch[aria-checked="true"]::before {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.swatch-name {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, calc(-100% + 2px));
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--fs-100);
  white-space: nowrap;
  pointer-events: none;
}
.swatch-name[hidden] {
  display: none;
}
/* The photo's exact colour beside "sacado de la foto". */
.add-exact {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--line-faint-strong);
  vertical-align: -1px;
}
.add-hint {
  margin: 0;
  font-size: var(--fs-100);
  color: var(--ink-soft);
}

/* The group pills run edge to edge of the sheet; passing under the footer,
   which keeps to the content's width, they would show beside it. The footer
   covers the side margins too (paper, no hairline there). */
.add-sheet + .sheet-actions::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 calc(var(--sp-5) * -1);
  background: var(--paper);
}

/* "Con fondo · Sin fondo" (plan 035f, js/recorte.js): Hoy's view switch, over
   the card, in the sheet's flow. While the model downloads or the garment is
   cut out, the card says so in its foot (where "Hace tiempo" goes), its photo
   dimmed. */
.view-switch--sheet {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  align-self: center;
}
.view-switch--sheet.is-second .view-switch-indicator {
  transform: translateX(calc(100% - 2px));
}
.add-fondo {
  margin-bottom: var(--sp-2);
}
.add-estado {
  position: absolute;
  left: var(--sp-2);
  right: var(--sp-2);
  bottom: 7px;
  font-size: 0.6875rem;
  line-height: 1.2;
  color: var(--ink);
  text-align: center;
}
.add-preview:not(.is-busy) > .add-estado {
  display: none;
}
/* The photo the card showed, over the new one while it fades out (js/anadir-prenda.js,
   transitionCard). */
.add-preview > .add-before {
  z-index: 1;
}
/* A garment just added: its card waits, hidden, until the sheet closes, and then comes in
   (js/armario.js, revealCards). */
.card.is-entrando {
  opacity: 0;
}
.add-preview.is-busy > .garment-photo {
  opacity: 0.35;
}
.add-photo-links {
  gap: var(--sp-4);
}
.add-photo-note {
  max-width: 34ch;
  text-align: center;
}
.add-descarga {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  margin-top: var(--sp-2);
  text-align: center;
}
.add-descarga .filters-clear {
  min-height: 44px;
}

/* "Retocar": the sheet across the whole screen (on phones from the top, from
   760px a wider side panel), with undo and redo beside the ×. The photo fills
   the room between the header and the footer; what is outside the cut-out
   lies under a veil of paper. Two fingers zoom it (the photo and its veil,
   one box); the ring that marks a touch keeps its size. */
.panel.is-entera {
  top: 0;
  max-height: none;
  border-top: 0;
  border-radius: 0;
  padding-top: env(safe-area-inset-top);
}
.panel.is-entera .panel-handle {
  visibility: hidden;
}
.panel.is-entera .panel-body {
  flex: 1;
  min-height: 0;
}
@media (min-width: 760px) {
  .panel.is-entera {
    width: min(100vw, 720px);
  }
  .panel-history.panel-history--retocar {
    display: grid;
  }
}
.panel-body > .retocar {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.retocar-vista {
  position: relative;
  flex: 1 1 auto;
  min-height: 240px;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--casilla);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}
.retocar-foto {
  position: absolute;
  transform-origin: 0 0;
}
.retocar-foto img,
.retocar-velo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}
.retocar-velo.is-nuevo {
  opacity: 0;
}
.retocar-velo.is-nuevo.is-visible {
  opacity: 1;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.retocar-aro {
  position: absolute;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  line-height: 1;
  transform: scale(calc(1 / var(--zoom, 1)));
  pointer-events: none;
}
.retocar-aro[hidden] {
  display: none;
}
.retocar-entera {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  min-height: 36px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line-faint-strong);
  border-radius: 999px;
  background: var(--paper);
  font-size: var(--fs-100);
  font-weight: 600;
}
/* 44px to the finger. */
.retocar-entera::before {
  content: "";
  position: absolute;
  inset: -4px 0;
}
.retocar-entera[hidden] {
  display: none;
}
.retocar-ayuda {
  align-self: center;
  text-align: center;
}
.retocar-acciones .retocar-modos {
  margin-bottom: var(--sp-2);
}
.add-done-text {
  align-self: center;
  text-align: center;
}
.sheet-actions .add-again {
  width: 100%;
}
.add-done-links {
  display: flex;
  justify-content: center;
  gap: var(--sp-5);
}

.rename-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.text-field {
  min-height: 48px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line-faint-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  caret-color: var(--ink);
  font: inherit;
  /* 16px keeps iOS Safari from zooming the page on focus. */
  font-size: 1rem;
}
.text-field:focus {
  outline: none;
  border-color: var(--ink);
}
.btn-primary:disabled {
  opacity: 0.35;
  cursor: default;
}
.sheet-inline-action {
  align-self: flex-start;
  margin-top: calc(var(--sp-4) * -1);
  padding-left: 0;
}
.sheet-link {
  align-self: center;
}

/* Card → look detail: the silhouette and the name travel. */
/* The card's visual and the hero's have different proportions: both
   snapshots fill the travelling box and are cut to it, as object-fit: cover
   cuts the photo on screen, so a photo grows into the hero without
   stretching (a figure keeps its proportions in both places, so nothing is
   cut from it). */
::view-transition-old(look-visual),
::view-transition-new(look-visual) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* object-fit alone doesn't cut a snapshot: the pair does, with the card's
   corners. */
::view-transition-image-pair(look-visual) {
  overflow: clip;
  border-radius: var(--radius-card);
}
::view-transition-old(look-title),
::view-transition-new(look-title) {
  width: auto;
  height: 100%;
}

@media (min-width: 760px) {
  .look-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
  }
  /* The detail in two columns: the look on its figure with its button under
     it, held in view, and beside it everything about it, garments included,
     in one screen. The figure and the button share the height between the
     figure's top (80px, under the bar) and the tab bar, which floats alone
     as on every other page. */
  .look-view {
    --look-hero-top: 80px;
    --look-hero-h: min(calc(100dvh - var(--look-hero-top) - var(--sp-4) - 48px - var(--sp-5) - var(--nav-clearance)), 620px);
  }
  .look-detail {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    /* The figure spans the five rows beside it and a sixth that takes what
       it has left over, so a short column never spreads its rows apart. */
    grid-template-rows: repeat(5, auto) 1fr;
    column-gap: var(--sp-6);
    align-content: start;
  }
  .armario.look-detail {
    padding-bottom: calc(var(--nav-clearance) + var(--sp-5));
  }
  .look-detail > * {
    grid-column: 2;
  }
  .look-detail > .look-hero {
    --hero-h: var(--look-hero-h);
    grid-column: 1;
    grid-row: 1 / span 6;
    position: sticky;
    top: var(--look-hero-top);
    margin-top: var(--sp-2);
  }
  .look-detail-title {
    margin-top: var(--sp-2);
  }
  /* looks.js picks the columns (--fit-cols) and the card width (--fit-w)
     that show every garment whole above the tab bar, never larger than three
     to a row. */
  .look-detail .grid {
    grid-template-columns: repeat(var(--fit-cols, 3), minmax(0, var(--fit-w, 1fr)));
  }
  /* No band over the garments: the button sits under the figure, in the
     left column of the 900px content column. */
  .look-actions {
    top: calc(var(--look-hero-top) + var(--look-hero-h) + var(--sp-4));
    bottom: auto;
    left: calc((100% - min(100%, 900px)) / 2 + var(--sp-5));
    right: auto;
    width: calc((min(100%, 900px) - var(--sp-5) * 2 - var(--sp-6)) * 5 / 12);
    padding: 0;
    background: none;
    border-top: 0;
  }
}

/* Reduced motion: the system's, or Perfil's "Movimiento" (html[data-movimiento], plan 041e). */
:where(html[data-movimiento="reducido"]) .toast,
:where(html[data-movimiento="reducido"]) .toast.is-visible {
  transform: translate(-50%, 0);
  transition: opacity 200ms var(--ease-out) !important;
}

/* A look's photo on its detail: a second page beside the figure, turned by
   a swipe (scroll snap) or by its dots. The figure always comes first. */
/* Its dots are placed on the plate, which is their box: relative on phones
   (.look-hero), sticky from 760px. */
.look-hero.has-photo {
  display: block;
  overflow: hidden;
  /* No grey plate behind the photo: the photo is its own frame, whole,
     with its corners rounded. The plate is the silhouette's page only. */
  background: none;
}
.look-hero.has-photo .look-hero-page:not(.look-hero-page--photo) {
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}
.look-hero-pages {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.look-hero-pages::-webkit-scrollbar {
  display: none;
}
.look-hero-page {
  flex: 0 0 100%;
  display: grid;
  place-items: center;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
/* The photo's address comes from IndexedDB a moment later: nothing shows
   until it has one. */
.look-hero-photo:not([src]),
.photo-preview img:not([src]) {
  visibility: hidden;
}
/* Whole, never cut (object-fit: contain), centred on the grey plate. The
   image's box is the photo itself (auto size within the plate), so the
   12px corners round the photo, not an empty margin around it. */
.look-hero-photo {
  width: auto;
  height: auto;
  max-width: 100%;
  /* The plate's own height: a percentage would not resolve inside the
     scrolling pages, and a tall photo would spill past the plate's foot. */
  max-height: var(--hero-h);
  object-fit: contain;
  border-radius: var(--radius-card);
}
/* Two dots on a small paper capsule, so they read over the photo too. */
.look-hero-dots {
  position: absolute;
  left: 50%;
  bottom: var(--sp-3);
  display: flex;
  padding: 0 2px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line-faint);
  transform: translateX(-50%);
}
.look-hero-dot {
  position: relative;
  width: 22px;
  height: 18px;
  display: grid;
  place-items: center;
}
.look-hero-dot::before {
  content: "";
  position: absolute;
  inset: -13px -11px;
}
.look-hero-dot::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--line-faint-strong);
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.look-hero-dot[aria-pressed="true"]::after {
  background: var(--ink);
  transform: scale(1.15);
}

/* "Guardar look": name, occasion and season, the optional photo. */
.save-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.save-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.save-tags {
  margin-top: 0;
}
.photo-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
}
.photo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
}
.photo-row {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
}
.photo-preview {
  flex: none;
  width: 120px;
  aspect-ratio: 3 / 4;
  margin: var(--sp-1) 0 0;
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  overflow: hidden;
}
.photo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-preview.is-busy {
  display: grid;
  place-items: center;
  padding: var(--sp-4);
  font-size: var(--fs-100);
  color: var(--ink-soft);
  text-align: center;
}
.photo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.photo-actions .filters-clear {
  min-height: 44px;
}
.photo-error {
  color: var(--ink);
}

/* The look maker — a third view of looks.html (docs/brief-looks.md §5.4).
   It fills the screen: the tab bar steps aside, "Cancelar" is the way out.
   Above, a bar and the look being made (the figure dressing itself on its
   plate, the garments chosen as Hoy's thumbnails); below, the wardrobe. */
html[data-view="crear"] .tab-bar {
  display: none;
}
.maker-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.maker-head.is-condensed {
  border-bottom-color: var(--line-faint);
}
.maker-sentinel {
  height: 0;
}
.maker-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-2);
  max-width: 900px;
  margin-inline: auto;
  padding: max(env(safe-area-inset-top), var(--sp-4)) var(--sp-5) var(--sp-3);
}
.maker-cancel {
  justify-self: start;
}
.maker-next {
  justify-self: end;
  margin-top: 0;
  align-self: center;
}
.maker-next[aria-disabled="true"] {
  opacity: 0.35;
  cursor: default;
}
.maker-next[aria-disabled="true"]:active {
  transform: none;
}
.maker-title {
  margin: 0;
  font-size: var(--fs-200);
  font-weight: 600;
  white-space: nowrap;
}
.maker-title:focus:not(:focus-visible) {
  outline: none;
}

.maker-look {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: var(--sp-4);
  max-width: 900px;
  margin-inline: auto;
  padding: 0 var(--sp-5) var(--sp-4);
}
.maker-figure {
  display: grid;
  place-items: center;
  height: 176px;
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}
/* Hoy's figure at a fraction of Hoy's size: its lines are Hoy's, in the
   figure's own units (2 for the body and a garment, 1.5 for an empty
   hueco's pattern), so they grow and shrink with the drawing and the
   miniature reads as Hoy made small (plan 042: a line fixed in pixels
   weighed far more than Hoy's on a figure this small, the body's doubled
   outline most of all). */
.maker-sil {
  height: 160px;
  width: auto;
  aspect-ratio: 240 / 560;
  overflow: visible;
}
.maker-sil .sil-figure {
  --tinta-cuerpo: 55%;
  --trazo-cuerpo: 2;
}
.maker-sil .sil-figure * {
  vector-effect: none;
}
.maker-sil .equip-layer {
  stroke-width: 2;
}
.maker-sil .slot-pattern {
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}
.maker-chosen {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
  max-height: 176px;
  overflow-y: auto;
  scrollbar-width: none;
}
.maker-chosen::-webkit-scrollbar {
  display: none;
}
.wear-list.is-thumbs.maker-thumbs {
  flex-wrap: wrap;
  overflow: visible;
  gap: var(--sp-3) 14px;
  margin: 0;
  padding: 10px 10px 0 0;
}
.maker-thumbs .wear-thumb-plate {
  width: 52px;
}
.maker-empty {
  max-width: 18ch;
  font-size: var(--fs-200);
}

.armario.maker {
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--sp-7));
}
.maker-wardrobe {
  padding-top: var(--sp-1);
}
.maker-meta[hidden],
.maker-search[hidden] {
  display: none;
}
.maker-meta .icon-btn {
  margin-right: calc(var(--sp-2) * -1);
}
.maker-search {
  display: grid;
  grid-template-columns: 1fr 44px;
  align-items: center;
  gap: var(--sp-1);
  margin-right: calc(var(--sp-2) * -1);
}
.maker-grid {
  position: relative;
}

@media (min-width: 760px) {
  /* Two columns: the look on its figure held in view at the left, the
     wardrobe beside it. */
  .maker-view {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--sp-6);
    align-content: start;
    width: 100%;
    max-width: 900px;
    margin-inline: auto;
    padding-inline: var(--sp-5);
  }
  .maker-head {
    display: contents;
  }
  .maker-bar {
    grid-column: 1 / -1;
    position: sticky;
    top: 0;
    z-index: 5;
    width: calc(100% + var(--sp-5) * 2);
    max-width: none;
    margin-inline: calc(var(--sp-5) * -1);
    background: var(--paper);
    border-bottom: 1px solid transparent;
    transition: border-color var(--dur-fast) var(--ease-out);
  }
  .maker-head.is-condensed .maker-bar {
    border-bottom-color: var(--line-faint);
  }
  .maker-sentinel {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .maker-look {
    --fig-h: min(420px, calc(100dvh - 76px - 180px));
    grid-column: 1;
    grid-row: 3;
    position: sticky;
    top: 76px;
    align-self: start;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-4);
    margin-inline: 0;
    padding: var(--sp-2) 0 var(--sp-5);
  }
  .maker-figure {
    height: var(--fig-h);
  }
  .maker-sil {
    height: calc(var(--fig-h) - var(--sp-6));
  }
  .maker-chosen {
    max-height: none;
    overflow: visible;
  }
  .maker-thumbs .wear-thumb-plate {
    width: 64px;
  }
  .maker-empty {
    max-width: none;
  }
  .armario.maker {
    grid-column: 2;
    grid-row: 3;
    max-width: none;
    margin: 0;
    padding: 0 0 var(--sp-7);
  }
  .maker-wardrobe {
    padding-top: var(--sp-2);
  }
  .grid.maker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Perfil (plan 041): the person and how they use the wardrobe, then the
   wardrobe's backup. On phones Armario's 24px sides, one section after
   another; from 760px a column of 520px at most, as wide as a look's wear
   button; from 1000px two columns in Armario's column, the person on the left
   and the wardrobe on the right. Lines on cream, no cards. */

.perfil {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: var(--sp-4) var(--sp-5) calc(var(--nav-clearance) + var(--sp-6));
}
/* From 760px, in the column of Armario and Looks (900px, 1040px from 1200px),
   as its header is (plan 039b): what it holds starts under the logo, 520px at
   most. */
.perfil-columnas,
.perfil-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-7);
}
@media (min-width: 760px) {
  .perfil {
    max-width: 900px;
    margin-inline: auto;
    padding-top: var(--sp-6);
  }
  .perfil-columnas {
    max-width: 520px;
  }
}
@media (min-width: 1000px) {
  .perfil-columnas {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 0 var(--sp-8);
    align-items: start;
  }
}
@media (min-width: 1200px) {
  .perfil {
    max-width: 1040px;
  }
  .perfil-columnas {
    column-gap: 96px;
  }
}
/* The head: a ring of the brand's line with the Perfil icon (later, the
   person's initial or photo), "Tu armario" and since when. */
.perfil-cab {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.perfil-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}
/* With a photo, the photo fills the ring; with a name and no photo, its first
   letter at Title size. */
.perfil-avatar.con-foto {
  overflow: hidden;
}
.perfil-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.perfil-inicial {
  font-size: var(--fs-400);
  font-weight: 600;
  line-height: 1;
}
.perfil-avatar svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.perfil-nombre {
  margin: 0;
  font-size: var(--fs-400);
  font-weight: 600;
  line-height: 1.2;
}
.perfil-desde {
  margin: 2px 0 0;
  color: var(--ink-soft);
}
.perfil-desde[hidden],
.perfil-vacio[hidden],
.perfil-cifra[hidden],
.perfil-redescubrir[hidden],
.perfil-meses[hidden],
.perfil-meses-frase[hidden],
.perfil-colores[hidden],
.perfil-rinde[hidden] {
  display: none;
}
/* The head and its figure read together: 24px between them, not a section's 48. */
.perfil-cab + .perfil-cifra {
  margin-top: calc(var(--sp-5) - var(--sp-7));
}
/* A small tag beside a figure or a line: the share used ("92 %"), the backup's
   size ("128 kB"). Label size on the chips' faintest ground. */
.perfil-etiqueta {
  flex: none;
  padding: 2px var(--sp-2);
  border-radius: 999px;
  background: var(--line-faintest);
  font-size: var(--fs-100);
  line-height: 1.4;
  white-space: nowrap;
}
.perfil-etiqueta[hidden] {
  display: none;
}
/* Plan 041b: the figure. "En los últimos 12 meses has usado" in ink-soft, the
   number in Display beside "de tus 78 prendas", a 2px line as long as that
   share, and under it, between hairlines, the small figures (as a look
   detail's stats), each a link to what it counts. */
.perfil-cifra-has {
  margin: 0;
  color: var(--ink-soft);
}
/* The share sits on the number's baseline, not centred on the row. */
.perfil-cifra-fila {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-1);
}
.perfil-cifra-n {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-2);
  color: var(--ink);
  text-decoration: none;
}
.perfil-cifra-n b {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.perfil-cifra-n span {
  font-size: var(--fs-300);
  color: var(--ink-soft);
}
/* Only with a mouse: on a phone a tapped link would stay underlined. */
@media (hover: hover) {
  .perfil-cifra-n:hover span {
    color: var(--ink);
  }
}
.perfil-cifra-linea {
  position: relative;
  height: 2px;
  margin-top: var(--sp-4);
  border-radius: 2px;
  background: var(--line-faint);
}
.perfil-cifra-linea i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 2px;
  background: var(--ink);
}
.perfil-minis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: var(--sp-4) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-faint);
}
.perfil-minis li + li {
  padding-left: var(--sp-3);
  border-left: 1px solid var(--line-faint);
}
.perfil-minis svg {
  width: 20px;
  height: 20px;
  margin-bottom: 6px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.perfil-minis a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 44px;
  padding-top: var(--sp-3);
  color: var(--ink);
  text-decoration: none;
}
.perfil-minis b {
  font-size: var(--fs-400);
  font-weight: 600;
  line-height: 1.2;
}
.perfil-minis span {
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
@media (hover: hover) {
  .perfil-minis a:hover span {
    color: var(--ink);
  }
}
/* "Para redescubrir": rows between hairlines, the photo on the card's grey,
   the name and when it was last worn, and "Ponérmela hoy" as Hoy's basic has
   it (outlined; "En tu look de hoy" once put on). The row opens the garment. */
/* A section's label with a link at its right ("Ver todo ›"), on one line. */
.perfil-titulo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-1);
}
.perfil-ver {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-size: var(--fs-100);
  font-weight: 600;
  text-decoration: none;
}
@media (hover: hover) {
  .perfil-ver:hover {
    text-decoration: underline;
    text-decoration-color: var(--line-faint-strong);
    text-underline-offset: 3px;
  }
}
.perfil-filas {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-faint);
}
.perfil-fila {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--line-faint);
}
.perfil-fila-prenda {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--ink);
  text-decoration: none;
}
.perfil-fila-foto {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 64px;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--casilla);
}
.perfil-fila-foto .garment-photo {
  width: 84%;
  height: 84%;
}
.perfil-fila-foto > svg {
  width: 62%;
  height: 62%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.perfil-fila-que {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.perfil-fila-que b {
  font-weight: 600;
}
.perfil-fila-que span {
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
@media (hover: hover) {
  .perfil-fila-prenda:hover b {
    text-decoration: underline;
    text-decoration-color: var(--line-faint-strong);
    text-underline-offset: 3px;
  }
}
.perfil-pon,
.perfil-puesta {
  flex: none;
}
.basico-pon.perfil-pon {
  padding-inline: var(--sp-4);
}
/* Plan 041d, "Tu armario por colores": a 14px strip of the colour families,
   2px apart, each as long as its share and in the family's own colour (the
   named exception to the One Dot Rule, as Looks' "Mes" days: they are the
   garments' colours); white with a hairline inside so it shows on cream. The
   legend in words, no dots: a link each, the name in ink and its share in
   ink-soft. */
.perfil-colores .section-label {
  margin-bottom: var(--sp-3);
}
.perfil-tira {
  display: flex;
  gap: 2px;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
}
.perfil-tira i {
  display: block;
  flex-basis: 0;
  min-width: 2px;
}
.perfil-tira i.is-claro {
  outline: 1px solid var(--line-faint);
  outline-offset: -1px;
}
.perfil-leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp-4);
  margin: var(--sp-2) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-100);
}
.perfil-leyenda a,
.perfil-leyenda li > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  color: var(--ink);
  text-decoration: none;
}
.perfil-leyenda b {
  font-weight: 400;
}
@media (hover: hover) {
  .perfil-leyenda a:hover b {
    text-decoration: underline;
    text-decoration-color: var(--line-faint-strong);
    text-underline-offset: 3px;
  }
}
.perfil-leyenda span span {
  color: var(--ink-soft);
}
/* "Por tipos": a row for each group, its name, a 2px ink line as long as how
   many it holds and the figure at the right; the row opens the group. */
.perfil-sub {
  margin: var(--sp-6) 0 var(--sp-2);
}
.perfil-tipos {
  margin: 0;
  padding: 0;
  list-style: none;
}
/* 28px a row: the section reads at a glance (36 left it airy on a phone). */
.perfil-tipos a {
  display: grid;
  grid-template-columns: 96px 1fr 28px;
  align-items: center;
  gap: var(--sp-3);
  min-height: 28px;
  color: var(--ink);
  font-size: var(--fs-100);
  text-decoration: none;
}
.perfil-tipos i {
  display: block;
  width: calc(var(--parte) * 100%);
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}
.perfil-tipos em {
  font-style: normal;
  text-align: right;
  color: var(--ink-soft);
}
@media (hover: hover) {
  .perfil-tipos a:hover span {
    text-decoration: underline;
    text-decoration-color: var(--line-faint-strong);
    text-underline-offset: 3px;
  }
}
/* "Lo que rinde cada prenda": two halves between hairlines, a hairline
   between them; each a link to its garment. */
.perfil-rinde .section-label {
  margin-bottom: var(--sp-3);
}
.perfil-rinde-dos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line-faint);
  border-bottom: 1px solid var(--line-faint);
}
.perfil-rinde-una {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: var(--sp-4) var(--sp-4) var(--sp-4) 0;
  color: var(--ink);
  text-decoration: none;
}
.perfil-rinde-una + .perfil-rinde-una {
  padding: var(--sp-4) 0 var(--sp-4) var(--sp-4);
  border-left: 1px solid var(--line-faint);
}
.perfil-rinde-una .perfil-fila-foto {
  margin-bottom: var(--sp-2);
}
.perfil-rinde-titulo,
.perfil-rinde-coste,
.perfil-rinde-cuenta {
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.perfil-rinde-coste b {
  font-size: var(--fs-400);
  font-weight: 600;
  color: var(--ink);
}
.perfil-rinde-nombre {
  margin-top: var(--sp-1);
  font-weight: 600;
}
@media (hover: hover) {
  .perfil-rinde-una:hover .perfil-rinde-nombre {
    text-decoration: underline;
    text-decoration-color: var(--line-faint-strong);
    text-underline-offset: 3px;
  }
}
/* Plan 041c, "Mes a mes": the sentence, then a bar for each month, as tall as
   the garments worn in it (the tallest, 100px). The last one closed in ink,
   the rest a step of ink, this one so far dashed; under each its three
   letters (11px ink-soft; the last one's in ink 600), or, narrow, only the
   quarters'. A bar is a link to its month in Looks. */
.perfil-meses .section-label {
  margin-bottom: var(--sp-3);
}
.perfil-meses-frase {
  margin: 0 0 var(--sp-4);
  max-width: 40ch;
  text-wrap: pretty;
}
.perfil-barras {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.perfil-barra {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  height: 128px;
  color: var(--ink-soft);
  text-decoration: none;
}
.perfil-barra i {
  display: block;
  width: 100%;
  max-width: 22px;
  height: calc(var(--h) * 100px);
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: var(--line-faint-strong);
  transition: background-color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) {
  .perfil-barra:hover i {
    background: var(--ink-soft);
  }
}
.perfil-barra.is-ultimo i {
  background: var(--ink);
}
.perfil-barra.is-en-curso i {
  background: transparent;
  border: 1px dashed var(--line-faint-strong);
  border-bottom: 0;
}
.perfil-barra span {
  font-size: 11px;
  line-height: 1.2;
}
.perfil-barra.is-ultimo span {
  color: var(--ink);
  font-weight: 600;
}
.perfil-barras.is-estrecha .perfil-barra:not([data-trimestre]) span {
  visibility: hidden;
}
/* Nothing worn yet: one sentence and the way to Hoy, never figures at 0. */
.perfil-vacio p {
  margin: 0;
  max-width: 30ch;
  font-size: var(--fs-300);
  text-wrap: pretty;
}
.perfil-vacio a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: var(--sp-1);
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line-faint-strong);
  text-underline-offset: 3px;
}
@media (hover: hover) {
  .perfil-vacio a:hover {
    text-decoration-color: currentColor;
  }
}
.perfil-copia {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.perfil-texto {
  margin: var(--sp-3) 0 0;
  max-width: 42ch;
  text-wrap: pretty;
}
/* "Última copia: hace 3 días" and, beside it, the backup's size as a tag. */
.perfil-ultima-fila {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-2);
  margin-top: var(--sp-2);
}
.perfil-ultima-fila .perfil-ultima {
  margin: 0;
}
.perfil-ultima {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
/* More than 30 days and changes since: the line says so, in ink. */
.perfil-ultima.is-aviso {
  color: var(--ink);
}
/* Side by side while they fit, left-aligned; one under the other on a
   narrow phone. */
.perfil-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}
.perfil-acciones .btn-primary,
.perfil-acciones .btn-outline {
  width: auto;
  padding-inline: var(--sp-5);
}
.perfil-peso {
  margin: var(--sp-3) 0 0;
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
/* What the last restore brought: stays until the next thing done with the
   backup, in ink (it is news, not a footnote). */
.perfil-detalle {
  color: var(--ink);
  text-wrap: pretty;
}
.perfil-peso[hidden],
.perfil-volver[hidden] {
  display: none;
}
/* Right after restoring, while on the page: the way back to the wardrobe as
   it was. */
.perfil-volver {
  min-height: 44px;
  margin-top: var(--sp-2);
  padding: 0;
  text-align: left;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line-faint-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur-fast) var(--ease-out);
}
.perfil-volver:hover {
  text-decoration-color: currentColor;
}
/* Plan 035e: the sample garments, inside "Tu armario es tuyo", under the
   backup. */
.perfil-ejemplo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: var(--sp-7);
}

/* Plan 041e: "Ajustes", in the shared sheet: the name (the app's text
   field), the photo (its ring at 56px beside "Elegir una foto" and "Quitar
   la foto") and the motion, three option rows as the backup's "Cómo". */
.ajustes {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  padding-bottom: var(--sp-4);
}
.ajustes-grupo {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.ajustes-campo {
  width: 100%;
}
.ajustes-foto {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.ajustes-foto-acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--sp-4);
}
.ajustes-foto-acciones .btn-outline {
  width: auto;
  padding-inline: var(--sp-5);
}
.ajustes-foto-acciones .perfil-volver {
  margin-top: 0;
}
.ajustes-error {
  margin: 0;
  font-size: var(--fs-100);
  color: var(--ink);
}
.ajustes-error[hidden] {
  display: none;
}
/* "Idioma" (plan 046): one row as Apariencia's, the chosen one ("Como el
   sistema" over "español", or "English") with a line › at its end, over the
   option rows' 20px check; a tap opens the "Idioma" screen in the same sheet,
   so the sheet doesn't grow with each language. */
.ajustes-idioma-flecha {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.copia-modo-nota[hidden] {
  display: none;
}
/* The "Idioma" screen takes Ajustes' place while it is open. */
.ajustes[hidden],
.ajustes-idioma-pantalla[hidden] {
  display: none;
}
/* "Tu maniquí" (plan 042c): the two bodies side by side, each drawn small on
   the soft ground with its name under it. The one chosen has an ink border
   and the line check after its name, as the option rows' check says which. */
.ajustes-maniqui {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.maniqui-opcion {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-2) var(--sp-3);
  border: 1.5px solid transparent;
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.maniqui-opcion[aria-checked="true"] {
  border-color: var(--ink);
}
@media (hover: hover) {
  .maniqui-opcion:hover {
    background: var(--surface-soft-hover);
  }
}
/* The body as on Hoy, its line in the drawing's units (about 1px here),
   filled with paper so it stands on the soft ground. */
.maniqui-dibujo {
  width: auto;
  height: 112px;
  overflow: visible;
}
.maniqui-dibujo .silhouette-figure {
  --trazo-cuerpo: 5;
  fill: var(--paper);
}
.maniqui-opcion-nombre {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}
.maniqui-opcion .copia-marca {
  width: 18px;
  height: 18px;
}
.maniqui-opcion[aria-checked="true"] .copia-marca {
  opacity: 1;
}
/* "Recuperar una copia", in the shared sheet: what the backup holds, what
   there is, the two ways as option rows, and the footer's main button. */
.copia-resumen {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.copia-trae {
  margin: 0;
  max-width: 40ch;
  text-wrap: pretty;
}
/* "Cómo" and its two rows, as a filter group: the label 4px over the rows. */
.copia-como {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.copia-modo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
}
.copia-modo-texto {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.copia-modo-nota {
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.copia-marca {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.copia-modo[aria-checked="true"] .copia-marca {
  opacity: 1;
}
.copia-error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-4);
  padding-bottom: var(--sp-2);
}

@media (min-width: 760px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--sp-4);
  }
  .armario {
    max-width: 900px;
    margin-inline: auto;
    width: 100%;
    padding-bottom: calc(var(--nav-clearance) + var(--sp-7));
  }
  .category-row {
    margin-inline: 0;
    padding-inline: 3px;
  }
  .subcat-drawer {
    margin-inline: 0;
  }
  .subcat-row {
    padding-inline: 3px;
  }
  .cat-title {
    font-size: 2.25rem;
  }
}

@media (min-width: 1000px) {
  .grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* A computer's screen, a step larger (plan 032): from 1200px the column, the
   type, the pills, the side panels, the garment detail's photo, "Combina con"
   and Looks' thumbnails grow. Phones, and the hanger rail with its stage, stay
   as they are. */
@media (min-width: 1200px) {
  :root {
    --fs-100: 0.875rem; /* 13 → 14px */
    --fs-200: 1rem; /* 15 → 16px */
    --fs-300: 1.125rem; /* 17 → 18px */
    --fs-400: 1.5rem; /* 22 → 24px */
    --hoy-panel-w: clamp(380px, 30vw, 460px);
  }
  /* What keeps its size: "Ponérmelo hoy" and the rail's stage. */
  .wear-pill,
  .pch-escenario {
    --fs-100: 0.8125rem;
    --fs-200: 0.9375rem;
    --fs-300: 1.0625rem;
    --fs-400: 1.375rem;
  }

  /* Armario's and Looks' column, from 900 to 1040px, header included. */
  .topbar--contained,
  .armario,
  .cat-topbar,
  .maker-bar,
  .maker-look,
  .maker-view {
    max-width: 1040px;
  }
  .cat-pill {
    min-height: 40px;
  }

  .panel {
    width: clamp(380px, 30vw, 460px);
  }
  /* Almost the panel's width, but never so tall the main button leaves the view. */
  .detail-icon {
    width: min(88%, calc(42vh * 6 / 7));
  }
  .detail-icon.ficha-foto {
    width: 100%;
    height: min(42vh, 400px);
  }
  /* The garment detail's main action stays at the foot of the panel, as the
     filter sheet's does: the panel's paper and a hairline above, no shadow. */
  .panel-body:has(> .detail-actions) {
    flex: 1;
    padding-bottom: 0;
  }
  .detail-actions {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    padding: var(--sp-3) 0 var(--sp-5);
    background: var(--paper);
    border-top: 1px solid var(--line-faint);
  }
  #panelBody .strip-item-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 0.8125rem;
  }
  #panelBody .ficha-fila .strip-item-name {
    font-size: 12px;
  }

  .look-thumb {
    flex-basis: 52px;
  }
  .look-card-visual {
    min-height: 202px;
  }
  .look-sil {
    height: 198px;
  }
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

/* Reduced motion: the system's, or Perfil's "Movimiento" (html[data-movimiento], plan 041e). */
:where(html[data-movimiento="reducido"]) * {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}

/* Reduced motion means a gentler change, not none: surfaces fade in
   place instead of sliding. Nothing below moves. */
:where(html[data-movimiento="reducido"]) .panel,
:where(html[data-movimiento="reducido"]) .panel.is-open {
  transform: none;
}
:where(html[data-movimiento="reducido"]) .panel {
  opacity: 0;
  transition: opacity 200ms var(--ease-out) !important;
}
:where(html[data-movimiento="reducido"]) .panel.is-open {
  opacity: 1;
}
:where(html[data-movimiento="reducido"]) .scrim {
  transition: opacity 200ms var(--ease-out) !important;
}

:where(html[data-movimiento="reducido"]) .topbar-search .search-bar,
:where(html[data-movimiento="reducido"]) .topbar-search > .icon-btn,
:where(html[data-movimiento="reducido"]) .topbar .wordmark,
:where(html[data-movimiento="reducido"]) .topbar-actions {
  transition: opacity 200ms var(--ease-out), visibility 0s linear 0s !important;
}
:where(html[data-movimiento="reducido"]) .topbar.is-searching .wordmark,
:where(html[data-movimiento="reducido"]) .topbar.is-searching .topbar-actions {
  transition: opacity 200ms var(--ease-out), visibility 0s linear 200ms !important;
}

/* ---------- The week and a day's sheet (plan 036d, js/dia.js) ---------- */

/* Under Hoy's figure: "Esta semana", Monday to Sunday. It starts right
   under the view switch, at the usual distance between sections: the room
   the first screen keeps under the switch for the tab bar is not left empty
   (the first screen itself does not change). */
.semana {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: calc(var(--sp-2) - var(--nav-clearance) - 14px) auto 0;
  padding: var(--sp-5) var(--sp-5) calc(var(--nav-clearance) + var(--sp-6));
}
.semana-titulo {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-300);
  font-weight: 600;
}
.semana-dias {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.semana-dia {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.semana-letra {
  font-size: 0.6875rem;
  line-height: 1.2;
  color: var(--ink-soft);
  text-align: center;
}
.semana-dias .dia-tarjeta {
  height: 92px;
}
.semana-dias .dia-n {
  font-size: var(--fs-100);
  font-weight: 500;
}
.semana-ley {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: var(--sp-4) 0 0;
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.semana-ley[hidden] {
  display: none;
}
.semana-ley i {
  flex: none;
  width: 14px;
  height: 18px;
  border: 1.5px dashed var(--line-faint-strong);
  border-radius: 4px;
}
@media (min-width: 760px) {
  .semana-dias {
    gap: 10px;
  }
  .semana-dias .dia-tarjeta {
    height: 132px;
  }
}

/* A day's card: its number and the stripes of what was worn (decision 8):
   the top or outer layer, the bottom half, the shoes; a dress, top and
   middle at once. Each stripe the garment's own colour, a hairline round it
   so white shows on paper. Noted by itself and not confirmed: lighter, a
   dashed edge. Nothing noted: only the number, in a hairline box. Today:
   the ink outline. The days to come: the number alone, faded. */
.dia-tarjeta {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  text-align: left;
  overflow: hidden;
}
button.dia-tarjeta {
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
button.dia-tarjeta:hover {
  background-color: var(--surface-soft-hover);
}
button.dia-tarjeta:active {
  transform: scale(0.97);
}
.dia-n {
  flex: none;
  padding: 4px 0 3px 6px;
  font-size: 0.6875rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.dia-franjas {
  flex: 1;
  display: grid;
  grid-template-rows: 40fr 40fr 20fr;
  gap: 2px;
  padding: 3px 4px 4px;
}
.dia-n + .dia-franjas {
  padding-top: 0;
}
.dia-franjas > span {
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--line-faintest);
}
.dia-franjas > .is-doble {
  grid-row: span 2;
}
.dia-franjas > .is-nada {
  box-shadow: none;
}
.dia-tarjeta.is-solo {
  background: none;
}
.dia-tarjeta.is-solo::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px dashed var(--line-faint-strong);
  border-radius: inherit;
  pointer-events: none;
}
.dia-tarjeta.is-solo .dia-franjas > span {
  opacity: 0.45;
}
.dia-tarjeta.is-nada {
  background: none;
  box-shadow: inset 0 0 0 1px var(--line-faintest);
}
.dia-tarjeta.is-hoy {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.dia-tarjeta.is-futuro {
  background: none;
  box-shadow: none;
  color: var(--ink-soft);
  opacity: 0.6;
}
.dia-mas {
  flex: 1;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  color: var(--ink-soft);
}

/* The day's sheet. A change made in it, said at its top with its undo. */
.dia-hecho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin: 0 0 var(--sp-3);
  padding: 0 0 0 var(--sp-4);
  border-radius: 20px;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--fs-100);
}
/* As the toast's: two lines at most, with room above and below. */
.dia-hecho > span {
  min-width: 0;
  margin: 6px 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.dia-deshacer {
  flex: none;
  min-height: 40px;
  padding: 0 var(--sp-4);
  border: 0;
  background: none;
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.dia-sub {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
/* Its garments laid on a plate: Hoy's garments view, in a box of its own. */
/* Its own stacking context: the torso's layers (z-index 1 to 3, the outer one
   on top) stay in order among themselves and never over what is held at the
   top of the sheet, as the date and its line in Looks' column from 1200px
   (where `container-type: normal` takes away the context `size` gave). */
.dia-mesa {
  isolation: isolate;
  container-type: size;
  height: 340px;
  display: grid;
  place-items: center;
  margin: 0 auto var(--sp-4);
}
.dia-mesa .flatlay {
  width: min(100cqw, 300px, 100cqh * 0.75);
}
.dia-acciones {
  display: flex;
  gap: var(--sp-3);
  margin: 0 0 var(--sp-5);
}
.dia-acciones > button {
  flex: 1;
  min-height: 48px;
  white-space: nowrap;
}
.dia-lista-cab {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 var(--sp-2);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line-faint);
}
.dia-lista-cab b {
  font-size: var(--fs-300);
  font-weight: 600;
}
.dia-lista-cab span {
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.dia-prendas {
  margin: 0;
  padding: 0;
  list-style: none;
}
.dia-prendas li {
  border-bottom: 1px solid var(--line-faintest);
}
/* Each garment opens in Armario (plan 037); one no longer there, a plain row. */
.dia-prenda-fila {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  padding: 8px 0;
  color: var(--ink);
  text-decoration: none;
}
a.dia-prenda-fila:active {
  opacity: 0.7;
}
.dia-prendas .look-thumb {
  width: 56px;
  height: 56px;
}
.dia-prenda b {
  display: block;
  font-size: var(--fs-200);
  font-weight: 500;
}
.dia-prenda span {
  display: block;
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.dia-enlace {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: var(--sp-2);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-200);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.dia-label {
  margin: var(--sp-5) 0 var(--sp-2);
  font-size: var(--fs-100);
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* "Lo mismo que el domingo": the day before, in a row. */
.dia-fila {
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line-faint);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dia-fila .dia-tarjeta {
  height: 66px;
}
.dia-fila-texto b {
  display: block;
  font-weight: 600;
}
.dia-fila-texto span {
  display: block;
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.dia-fila-ir {
  color: var(--ink-soft);
}
/* One of the saved looks, in a strip. */
.dia-looks {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 calc(var(--sp-5) * -1);
  padding: 0 var(--sp-5) 4px;
  scrollbar-width: none;
}
.dia-look {
  flex: none;
  width: 84px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dia-look .dia-tarjeta {
  height: 110px;
}
.dia-look-nombre {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.25;
}
/* Armario: the look of "Última vez" opens that day. */
.detail-usos-look {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ---------- Looks: Mes · Días · Guardados (plan 036e, js/looks-calendario.js) ---------- */

/* Hoy's switch, three halves wide, in the page's flow under the header: the
   whole width on a phone, at the left from 760px. The ink outline slides to
   the chosen one. */
.view-switch--tres {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  grid-template-columns: repeat(3, 1fr);
  margin: var(--sp-2) 0 var(--sp-5);
}
.view-switch--tres button {
  min-width: 0;
}
.view-switch--tres .view-switch-indicator {
  inset: -1px calc(200% / 3 - 1px) -1px -1px;
}
html[data-looks-vista="dias"] #looksSwitch .view-switch-indicator {
  transform: translateX(calc(100% - 2px));
}
html[data-looks-vista="guardados"] #looksSwitch .view-switch-indicator {
  transform: translateX(calc(200% - 4px));
}
@media (min-width: 760px) {
  .view-switch--tres {
    align-self: flex-start;
  }
  .view-switch--tres button {
    min-width: 104px;
  }
}
html:not([data-looks-vista="mes"]) #mesView,
html:not([data-looks-vista="dias"]) #diasView,
html:is([data-looks-vista="mes"], [data-looks-vista="dias"]) #main > :is(.armario-meta, .category-row, .look-list) {
  display: none;
}
.looks-mes,
.looks-dias {
  width: 100%;
  max-width: 720px;
}
/* The day chosen (plan 039, from 1200px): its number in an ink circle, in the
   month and in "Días"; there, its row on the cards' grey too. */
.dia-tarjeta.is-elegido .dia-n {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: 3px 0 1px 3px;
  padding: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}
.dias-fila.is-elegido {
  background: var(--surface-soft);
  border-radius: 12px;
  border-bottom-color: transparent;
}
.dias-fila.is-elegido .dias-fecha b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--fs-300);
}
.dias-fila.is-elegido .dias-fecha span {
  margin-top: 2px;
}
/* From 1200px, "Mes" and "Días" in two columns as wide as the header's: the
   month (or the list) and the day chosen, 380px, up to 440px at 1920px. */
@media (min-width: 1200px) {
  .looks-mes.es-ancho,
  .looks-dias.es-ancho {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(380px, calc(380px + (100vw - 1440px) / 8), 440px);
    column-gap: 48px;
    align-items: start;
  }
  .looks-col {
    min-width: 0;
  }
  /* The day: what its sheet holds, held in view as the list scrolls, and
     scrolling on its own when it is taller than the screen. */
  .looks-dia {
    position: sticky;
    top: var(--sp-5);
    /* Its foot over the bar where it starts, under the view switch. */
    max-height: calc(100vh - 150px - var(--nav-clearance));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 2px 4px var(--sp-4) var(--sp-6);
    border-left: 1px solid var(--line-faint);
  }
  @supports not selector(::-webkit-scrollbar) {
    .looks-dia {
      scrollbar-width: thin;
      scrollbar-color: var(--line-faint) transparent;
    }
  }
  /* Its head, the date and its look's name, held at the top as it scrolls
     (plan 039b), on paper so what passes under it is not seen. */
  .looks-dia-titulo {
    position: sticky;
    top: -2px;
    z-index: 1;
    margin: 0;
    padding-top: 2px;
    height: 32px;
    font-size: var(--fs-400);
    font-weight: 600;
    line-height: 1.2;
    background: var(--paper);
  }
  .looks-dia .dia-hoja > .dia-sub:first-of-type {
    position: sticky;
    top: 30px;
    z-index: 1;
    margin: 0;
    padding: 2px 0 var(--sp-3);
    background: var(--paper);
  }
  /* A thin bar, the hairline's colour: no system bar with arrows (Windows). */
  .looks-dia::-webkit-scrollbar {
    width: 6px;
  }
  .looks-dia::-webkit-scrollbar-track {
    background: transparent;
  }
  .looks-dia::-webkit-scrollbar-thumb {
    background: var(--line-faint);
    border-radius: 999px;
  }
  .looks-dia::-webkit-scrollbar-thumb:hover {
    background: var(--line-faint-strong);
  }
  /* The plate as wide as the column, as "Editar" is. */
  .looks-dia .dia-mesa {
    height: auto;
    display: block;
    container-type: normal;
  }
  .looks-dia .dia-mesa .flatlay {
    width: 100%;
  }
  /* The whole month on the screen: its figures on one line, and cards as tall
     as the screen lets (--filas: the weeks it spans), 40 to 108px. */
  .looks-mes.es-ancho .mes-cab {
    margin-bottom: var(--sp-2);
  }
  .looks-mes.es-ancho .mes-cifras {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1) var(--sp-5);
    margin-bottom: var(--sp-3);
    border: 0;
  }
  .looks-mes.es-ancho .mes-cifras > div {
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    padding: 0;
    border: 0;
  }
  .looks-mes.es-ancho .mes-cifras dd {
    font-size: var(--fs-300);
  }
  .looks-mes.es-ancho .mes-rejilla .dia-tarjeta {
    height: clamp(40px, calc((100vh - 400px) / var(--filas, 6) - 10px), 108px);
  }
  /* Its air underneath is the page's (padding-bottom, below): it fits without scrolling. */
  .looks-mes.es-ancho .mes-ley {
    margin: var(--sp-3) 0 0;
  }
  .looks-dias.es-ancho .dias-fila {
    padding-inline: var(--sp-2);
  }
  .armario:has(> .looks-mes.es-ancho) {
    padding-bottom: var(--sp-4);
  }
}

/* "Octubre", and ‹ › to go month by month (the one after, off in this month). */
.mes-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin: 0 0 var(--sp-3);
}
.mes-titulo {
  margin: 0;
  font-size: var(--fs-400);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.mes-flechas {
  display: flex;
  gap: var(--sp-1);
}
.mes-flecha[aria-disabled="true"] {
  opacity: 0.3;
  cursor: default;
}
/* Its three figures: days noted, garments, looks. */
.mes-cifras {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 var(--sp-5);
  border-top: 1px solid var(--line-faint);
  border-bottom: 1px solid var(--line-faint);
}
.mes-cifras > div {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  padding: var(--sp-3) 0;
}
.mes-cifras > div + div {
  padding-left: var(--sp-3);
  border-left: 1px solid var(--line-faintest);
}
.mes-cifras dd {
  order: -1; /* the figure over its label */
  margin: 0;
  font-size: var(--fs-400);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.mes-cifras dt {
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
/* Monday to Sunday: the letters, then the days in seven columns. */
.mes-semana,
.mes-rejilla {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.mes-semana {
  margin-bottom: 4px;
  font-size: 0.6875rem;
  line-height: 1.2;
  color: var(--ink-soft);
  text-align: center;
}
.mes-rejilla .dia-tarjeta {
  height: 72px;
}
/* Under it, the air the other pages leave at their end (plan 048): in a month
   gone it is the last thing, and it sat on the tab bar's paper. Under this
   month, "Hoy"'s card's margin takes it in. */
.mes-ley {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  margin: var(--sp-4) 0;
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.mes-ley > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mes-ley i {
  flex: none;
  width: 12px;
  height: 16px;
  border-radius: 3px;
}
.mes-ley .l-ap {
  background: var(--ink-soft);
}
.mes-ley .l-solo {
  border: 1.5px dashed var(--line-faint-strong);
}
.mes-ley .l-hoy {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.mes-ley .l-elegido {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--ink);
}
@media (min-width: 760px) {
  .mes-semana,
  .mes-rejilla {
    gap: 10px;
  }
  .mes-rejilla .dia-tarjeta {
    height: 108px;
  }
}
/* "Hoy": what Hoy wears, and noting it from here. The day, its text and its
   button in a row while the text keeps at least 7.5rem beside the button;
   when they don't fit together (English at 375 and 390 px, a long
   translation), the button goes under them, the whole width (plan 044d).
   The text takes the row's spare room, never the button. */
.mes-hoy {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
  margin: var(--sp-5) 0 0;
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--line-faint);
  border-bottom: 1px solid var(--line-faint);
}
.mes-hoy .dia-tarjeta {
  flex: 0 0 44px;
  height: 60px;
}
.mes-hoy-texto {
  flex: 999 1 7.5rem;
  min-width: 0;
}
.mes-hoy-texto b {
  display: block;
  font-weight: 600;
}
.mes-hoy-texto span {
  display: block;
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.mes-hoy .btn-outline {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 0 var(--sp-4);
  color: var(--ink);
  text-decoration: none;
  /* Its width in the row is its one line (max-content); alone on its own
     line, a translation longer than the screen goes on two. */
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

/* "Días": the month day by day, the most recent first. */
.dias-lista {
  margin: 0;
  padding: 0;
  list-style: none;
}
.dias-fila {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  border-bottom: 1px solid var(--line-faintest);
}
.dias-abrir {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: var(--sp-3);
  align-items: center;
  min-height: 64px;
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dias-fecha {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.dias-fecha b {
  font-size: var(--fs-400);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dias-fecha span {
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.dias-cuerpo {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dias-fotos {
  display: flex;
  gap: 6px;
}
.dias-fotos .look-thumb {
  flex: 0 0 44px;
}
.dias-nombre {
  font-size: var(--fs-200);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.dias-nombre span {
  font-weight: 400;
  color: var(--ink-soft);
}
/* Noted by itself and not confirmed: as in the month (.dia-tarjeta.is-solo),
   a dashed edge, and what is inside lighter (plan 048). */
.dias-fila.is-solo .look-thumb {
  border: 1.5px dashed var(--line-faint-strong);
}
.dias-fila.is-solo .look-thumb > * {
  opacity: 0.55;
}
.dias-fila.is-nada .dias-fecha {
  color: var(--ink-soft);
}
.dias-sin {
  font-size: var(--fs-200);
  color: var(--ink-soft);
}
.dias-llevo {
  flex: none;
  min-height: 40px;
  padding: 0 var(--sp-4);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* "Esta semana · Ver el mes" (Hoy). */
.semana-cab {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin: 0 0 var(--sp-3);
}
.semana-cab .semana-titulo {
  margin: 0;
}
.semana-mes {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -12px 0;
  font-size: var(--fs-200);
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- "Un básico que no usas hace tiempo" (plan 037, js/basico.js) ---------- */

/* Under "Esta semana", at the usual distance between sections; as wide as the
   week. Its foot keeps the room of the toast as well as the tab bar's, so the
   toast ("… en lugar de …", "… no saldrá en 7 días") never lies over its buttons. */
.semana:has(~ .basico:not([hidden])) {
  padding-bottom: var(--sp-4);
}
.basico {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-5) calc(var(--nav-clearance) + var(--sp-3) + 72px + var(--sp-3));
}
.basico[hidden] {
  display: none;
}
.basico .semana-titulo {
  margin: 0 0 var(--sp-3);
}
/* "Qué llevar hoy" (plan 045b, js/llevar.js): the first section under the
   figure, so it is the one that rises into the room the first screen keeps
   for the tab bar (as the week did before it); the week then comes after it
   at the usual distance between sections. */
.llevar {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: calc(var(--sp-2) - var(--nav-clearance) - 14px) auto 0;
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
}
.llevar[hidden] {
  display: none;
}
.llevar .semana-titulo {
  margin: 0 0 var(--sp-3);
}
.llevar:not([hidden]) + .semana {
  margin-top: 0;
  padding-top: var(--sp-4);
}
/* "Completa tu look" (plan 045d, js/completa.js): between the week and the
   basic, with the shared card (.tarjeta-hoy). Last of the sections shown, it
   keeps the toast's room as well as the tab bar's at its foot, as the basic
   does; with a section after it, the usual distance. */
.completa {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-5) calc(var(--nav-clearance) + var(--sp-3) + 72px + var(--sp-3));
}
.completa[hidden] {
  display: none;
}
.completa .semana-titulo {
  margin: 0 0 var(--sp-3);
}
.semana:has(~ .completa:not([hidden])),
.completa:has(~ .basico:not([hidden])),
.completa:has(~ .hace-ano:not([hidden])) {
  padding-bottom: var(--sp-4);
}
/* Why this one: the true reason, naming the garment worn today. */
.completa-por {
  margin-top: 6px;
  font-size: var(--fs-100);
  line-height: 1.35;
  color: var(--ink);
}
/* That garment, small, with "Lo que llevas". */
.completa-con {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: var(--sp-2);
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.completa-con .look-thumb {
  flex: 0 0 36px;
  height: 36px;
}
/* "Hace un año" (plan 045c, js/hace-un-ano.js): the last section, so it keeps
   the tab bar's room at its foot; the ones before it then end at the usual
   distance between sections. No card: a row, as a day of Looks' "Días" — the
   day's card of stripes (as in the week, without its number), the date in
   ink-soft, the look's name (or "Lo que llevaste") and its garments. The whole
   row is one button that opens that day's sheet. */
.hace-ano {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-5) calc(var(--nav-clearance) + var(--sp-6));
}
.hace-ano[hidden] {
  display: none;
}
.hace-ano .semana-titulo {
  margin: 0 0 var(--sp-3);
}
.semana:has(~ .hace-ano:not([hidden])),
.basico:has(~ .hace-ano:not([hidden])) {
  padding-bottom: var(--sp-4);
}
.hace-ano-dia {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: start;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.hace-ano-dia .dia-tarjeta {
  height: 92px;
  transition: transform var(--dur-fast) var(--ease-out);
}
.hace-ano-dia:active .dia-tarjeta {
  transform: scale(0.97);
}
.hace-ano-texto {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hace-ano-fecha {
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.hace-ano-nombre {
  font-size: var(--fs-200);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.hace-ano-dia:hover .hace-ano-nombre {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hace-ano-fotos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.hace-ano-fotos .look-thumb {
  flex: 0 0 40px;
  height: 40px;
}
/* The look's garments laid on a plate as in Hoy's second view (js/flatlay.js,
   layoutFor), in a 3:4 frame straight on the card's grey. */
.llevar-foto {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
}
.llevar-foto > span {
  position: absolute;
  display: grid;
  place-items: center;
}
.llevar-foto .garment-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.llevar-foto > span > svg {
  width: 72%;
  height: 72%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Why this one: the true reason, in ink, as a sentence. */
.llevar-por {
  margin-top: 6px;
  font-size: var(--fs-100);
  line-height: 1.35;
  color: var(--ink);
}
/* The cards of Hoy's sections (plans 037 and 045b: "Qué llevar hoy", the
   basic), one rule for all: on --casilla, 12px corners, no shadow; the photo
   (or the plate of a look) on the left, the text on the right. The section is
   the grid and the card itself is only a wrapper (display: contents), so its
   buttons can sit under the card on phones and inside it, under the text, from
   760px, with no element moving in the page (a button keeps its focus when
   the card is painted again). The grey is the section's ::before, laid over
   the card's rows. */
.tarjeta-hoy {
  --tarjeta-pad: var(--sp-3);
  --tarjeta-foto: 128px;
  display: grid;
  grid-template-columns: calc(var(--tarjeta-foto) + var(--tarjeta-pad)) minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: var(--sp-4);
}
.tarjeta-hoy > h2 {
  grid-column: 1 / -1;
}
.tarjeta-hoy::before {
  content: "";
  grid-column: 1 / -1;
  grid-row: 2;
  border-radius: 12px;
  background: var(--casilla);
}
.basico-tarjeta,
.llevar-tarjeta,
.completa-tarjeta {
  display: contents;
}
.basico-foto,
.llevar-foto,
.completa-foto {
  grid-column: 1;
  grid-row: 2;
  margin: var(--tarjeta-pad) 0 var(--tarjeta-pad) var(--tarjeta-pad);
}
.basico-texto,
.llevar-texto,
.completa-texto {
  grid-column: 2;
  grid-row: 2;
  margin: var(--tarjeta-pad) var(--tarjeta-pad) var(--tarjeta-pad) 0;
}
.basico-acciones,
.llevar-acciones,
.completa-acciones {
  grid-column: 1 / -1;
  grid-row: 3;
}
/* The photo straight on the card's grey, as on a grid card. */
.basico-foto,
.completa-foto {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.basico-foto .garment-photo,
.completa-foto .garment-photo {
  width: 86%;
  height: 86%;
}
.basico-foto > svg,
.completa-foto > svg {
  width: 62%;
  height: 62%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.basico-texto,
.llevar-texto,
.completa-texto {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 2px;
}
.basico-nombre,
.llevar-nombre,
.completa-nombre {
  font-size: var(--fs-200);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.basico-nombre:hover,
.llevar-nombre:hover,
.completa-nombre:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.basico-de,
.llevar-de {
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.basico-uso {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: var(--fs-100);
  color: var(--ink-soft);
}
.basico-uso svg {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}
.basico-va {
  margin-top: auto;
  padding-top: var(--sp-2);
}
.basico-va > span:first-child {
  display: block;
  margin-bottom: 4px;
  font-size: 0.6875rem;
  color: var(--ink-soft);
}
.basico-va-fotos {
  display: flex;
  gap: 6px;
}
.basico-va-fotos .look-thumb {
  flex: 0 0 36px;
  background: var(--paper);
}
/* "Ponérmela hoy" as "Lo llevo hoy" (1.5px ink, paper ground); "Otra" with a
   hairline; "Ahora no", an underlined link at the right. Once put on, an ink
   pill says so in its place. "Qué llevar hoy" has the same pills (plan 045b). */
.basico-acciones,
.llevar-acciones,
.completa-acciones {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.basico-pon,
.basico-otra,
.basico-hecho {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
}
.basico-pon {
  padding: 0 var(--sp-5);
  border: 1.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out);
}
.basico-otra {
  padding: 0 var(--sp-4);
  border: 1px solid var(--line-faint-strong);
  background: none;
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.basico-otra:hover {
  border-color: var(--ink);
}
.basico-pon:active,
.basico-otra:active {
  transform: scale(0.97);
}
/* 10px above and below: inside its 44px with up to 24px of text (22.4px on
   a computer), so it keeps its height; 12px would make it taller. */
.basico-hecho {
  padding: 10px var(--sp-4);
  background: var(--ink);
  color: var(--paper);
}
.basico-hecho svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.basico-acciones [hidden],
.llevar-acciones [hidden],
.completa-acciones [hidden] {
  display: none;
}
/* Plan 045e: the big pill only in "Qué llevar hoy"; "Completa tu look" and the
   basic say theirs in words, underlined, as "Ahora no": "Añadir a mi look" and
   "Ponérmela hoy" in Body 600, "Otra" and "Ahora no" in 400. Three pills one
   under another weighed too much. */
.hoy-accion,
.basico-no {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-200);
  font-weight: 600;
  text-align: start;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out);
}
.hoy-accion.es-suave,
.basico-no {
  font-weight: 400;
}
.hoy-accion:active,
.basico-no:active {
  transform: scale(0.97);
}
.basico-no {
  margin-left: auto;
}
/* "Completa tu look" keeps its one action inside the card on phones too, under
   the text, as from 760px: under the card it read loose. Whatever the photo is
   taller goes under the action (the last row takes it). */
.completa.tarjeta-hoy {
  grid-template-rows: auto auto 1fr;
}
.completa.tarjeta-hoy::before {
  grid-row: 2 / span 2;
}
.completa-foto {
  grid-row: 2 / span 2;
  align-self: start;
}
.completa-texto {
  margin-bottom: 0;
}
.completa-acciones {
  grid-column: 2;
  grid-row: 3;
  align-self: start;
  margin: var(--sp-2) var(--tarjeta-pad) var(--tarjeta-pad) 0;
}
/* Put on, their "✓ En tu look de hoy" is in words too: the tick and the words
   in ink, with no pill (as a pill it took two lines in the card's narrow
   column, and weighed again). "Qué llevar hoy" keeps its ink pill. */
.completa-acciones .basico-hecho,
.basico-acciones .basico-hecho {
  padding: 0;
  background: none;
  color: var(--ink);
  white-space: normal;
}
/* From 760px (plan 045b): the photo in a 3:4 frame, 132px wide, beside the
   text and the buttons, which go inside the card under the text; the text
   reads top down with nothing pushed to the card's foot, so the card is as
   tall as its photo and no hole opens in the 720px column. Whatever the photo
   is taller than the text and buttons goes under the buttons (the last row
   takes it), never between the lines. */
@media (min-width: 760px) {
  .basico-va-fotos .look-thumb {
    flex-basis: 44px;
  }
  .tarjeta-hoy {
    --tarjeta-foto: 132px;
    grid-template-rows: auto auto 1fr;
    column-gap: var(--sp-5);
  }
  .tarjeta-hoy::before {
    grid-row: 2 / span 2;
  }
  .basico-foto,
  .llevar-foto,
  .completa-foto {
    grid-row: 2 / span 2;
    aspect-ratio: 3 / 4;
  }
  .basico-texto,
  .llevar-texto,
  .completa-texto {
    margin-bottom: 0;
    padding-top: var(--sp-2);
  }
  .basico-va,
  .completa-con {
    margin-top: var(--sp-3);
    padding-top: 0;
  }
  .basico-acciones,
  .llevar-acciones,
  .completa-acciones {
    grid-column: 2;
    grid-row: 3;
    align-self: start;
    margin: var(--sp-4) var(--tarjeta-pad) var(--tarjeta-pad) 0;
  }
}
/* Looks: the whole ficha is in Armario. */
.ficha-enlace {
  align-self: flex-start;
  margin-top: var(--sp-5);
}

/* The small thumbnails (Looks' cards, Hoy's and the look maker's plates,
   "Combina con"), on their own ground (plan 043c): the paper in light, so a
   white or cream garment shows on the card's grey; a photo's ground in dark,
   so a black one does (043b). */
.look-thumb,
.strip-item-icon,
.wear-plate {
  background: var(--casilla-miniatura);
}

/* In dark, the figures of Looks' cards and of a look's detail as Hoy's
   (plan 043c): the body a step above the ground with its muted outline, the
   garments filled with their own tone under their ink (the dark ones, with
   the body's outline), so the drawing is not the white-line negative of the
   light one; the accessories, outside .sil-fitted, keep the page's ink. */
html[data-apariencia="oscuro"] .sil-figure {
  stroke: var(--cuerpo-contorno);
}
html[data-apariencia="oscuro"] .sil-figure .cuerpo-relleno,
html[data-apariencia="oscuro"] .sil-figure .cuerpo-cabeza {
  fill: var(--cuerpo-relleno);
}
html[data-apariencia="oscuro"] .look-sil .sil-fitted {
  stroke: var(--tinta-prenda);
}
html[data-apariencia="oscuro"] .look-sil .sil-fitted > g {
  fill: var(--garment-fill, var(--papel-prenda));
}
html[data-apariencia="oscuro"] .look-sil .sil-fitted > .is-dark {
  stroke: var(--cuerpo-contorno);
}
html[data-apariencia="oscuro"] .look-sil .g-detail {
  fill: none;
}
html[data-apariencia="oscuro"] .look-sil .is-dark .g-detail:not(.g-waist) {
  stroke: var(--papel-prenda);
  stroke-opacity: 0.75;
}
/* A day's stripes: a firmer hairline, so the black ones (the shoes) show on
   the dark card. */
html[data-apariencia="oscuro"] .dia-franjas > span {
  box-shadow: inset 0 0 0 1px var(--line-faint);
}
/* A day noted by itself and not confirmed: its stripes at 0.7, not 0.45; on
   the dark card, the light ones went muddy grey. */
html[data-apariencia="oscuro"] .dia-tarjeta.is-solo .dia-franjas > span {
  opacity: 0.7;
}
@media (prefers-color-scheme: dark) {
  /* In dark, the figures of Looks' cards and of a look's detail as Hoy's
     (plan 043c): the body a step above the ground with its muted outline, the
     garments filled with their own tone under their ink (the dark ones, with
     the body's outline), so the drawing is not the white-line negative of the
     light one; the accessories, outside .sil-fitted, keep the page's ink. */
  html:not([data-apariencia]) .sil-figure {
    stroke: var(--cuerpo-contorno);
  }
  html:not([data-apariencia]) .sil-figure .cuerpo-relleno,
  html:not([data-apariencia]) .sil-figure .cuerpo-cabeza {
    fill: var(--cuerpo-relleno);
  }
  html:not([data-apariencia]) .look-sil .sil-fitted {
    stroke: var(--tinta-prenda);
  }
  html:not([data-apariencia]) .look-sil .sil-fitted > g {
    fill: var(--garment-fill, var(--papel-prenda));
  }
  html:not([data-apariencia]) .look-sil .sil-fitted > .is-dark {
    stroke: var(--cuerpo-contorno);
  }
  html:not([data-apariencia]) .look-sil .g-detail {
    fill: none;
  }
  html:not([data-apariencia]) .look-sil .is-dark .g-detail:not(.g-waist) {
    stroke: var(--papel-prenda);
    stroke-opacity: 0.75;
  }
  /* A day's stripes: a firmer hairline, so the black ones (the shoes) show on
     the dark card. */
  html:not([data-apariencia]) .dia-franjas > span {
    box-shadow: inset 0 0 0 1px var(--line-faint);
  }
  html:not([data-apariencia]) .dia-tarjeta.is-solo .dia-franjas > span {
    opacity: 0.7;
  }
}

/* The thin pieces (glasses, bracelets, necklaces, `is-fina` from
   js/garment-visual.js) fill a small thumbnail: a fine frame or cord, with
   empty space round it, was too thin to read at 80-86% (plan 043). The
   garments keep their margin. */
.look-thumb .garment-photo.is-fina,
.wear-plate .garment-photo.is-fina,
.strip-item-icon .garment-photo.is-fina,
.ficha-fila .strip-item-icon .garment-photo.is-fina {
  width: 100%;
  height: 100%;
}

/* ---------- Long texts in other languages (plan 044b) ----------
   What the long-text sketches found (plans/044-idiomas.md): the places with a
   fixed width a long word can't fit, given room to grow or a part that gives
   way first. */

/* Long words (German compounds: "Kleidungsstücke") break with a hyphen, as
   the page's language does it (<html lang>), only from 13 letters: the words
   of Spanish and English stay whole, as before. Never in a button or a pill:
   those fit their words or the translation is shortened. */
/* A word even longer than its line, that can't be hyphenated (a name, a word
   the language's dictionary doesn't have), breaks where it must instead of
   going out of its box (plan 044d, the stress test: pruebas/estres.spec.mjs).
   A word that fits is never broken. */
body {
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphenate-limit-before: 6;
  -webkit-hyphenate-limit-after: 6;
  hyphenate-limit-chars: 13 6 6;
}
:where(button, .btn-primary, .btn-outline, .chip, .cat-pill, .sub-pill, .nav-item, .wear-pill) {
  hyphens: manual;
}

/* Hoy's "Silueta / Prendas": as wide as its labels ask (its two halves are
   equal, the longer one's), not squeezed into the right half of the screen
   that left: 50% leaves it; the screen's width at most. */
#viewSwitch {
  width: max-content;
  max-width: calc(100vw - 32px);
}

/* "Un básico que no usas": its three actions go to a second line when they
   don't fit ("Pas maintenant" was pushed off the screen); "Ahora no" stays
   whole and to the right. "Qué llevar hoy"'s two, the same. */
.basico-acciones,
.llevar-acciones,
.completa-acciones {
  flex-wrap: wrap;
  row-gap: var(--sp-2);
}
.basico-no {
  white-space: nowrap;
}

/* Armario's bar: the count gives way first (on two lines), never the switch
   or "Filtrar". */
.armario-count {
  min-width: 0;
}
.armario-meta-end {
  flex-shrink: 0;
}

/* The look maker's bar: its two buttons keep their words; the title in the
   middle gives way, cut with "…". */
.maker-bar {
  grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr);
}
.maker-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- The stress test (plan 044d, pruebas/estres.spec.mjs) ----------
   With every text half as long again and a word at its end that can't be
   broken, what still went out of its place. */

/* Columns of a share of the width (1fr) grow to fit their longest word: a
   long one pushed the page sideways. minmax(0, 1fr): the share, and the word
   breaks inside it. Looks' month figures, Perfil's "Lo que rinde" (the
   month's "Hoy" card is a wrapping row: .mes-hoy). */
.mes-cifras {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.perfil-rinde-dos {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
/* Hoy's "Aún no lo has apuntado", beside its icon: the text, a column that
   gives way (a bare text in a flex row can't shrink). */
.basico-uso {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
}
/* Looks' "Mes · Días · Guardados": three equal thirds of the screen. A long
   label takes less padding first, then a second line, never out of its
   third. */
.view-switch--tres button {
  padding: 0 var(--sp-2);
  white-space: normal;
  line-height: 1.15;
}
/* A text whose box is as wide as it asks (a centred column, a flex row): a
   word longer than the room there is would make the box that wide, and break
   only past it. `anywhere` counts the room first. The names under the
   ficha's tiles, Perfil's "Lo que rinde" halves, "Con fondo · Sin fondo". */
.strip-item-name,
.perfil-rinde-una,
.view-switch--sheet button {
  overflow-wrap: anywhere;
}
.view-switch--sheet {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  max-width: 100%;
}
.view-switch--sheet button {
  white-space: normal;
  line-height: 1.15;
}
/* Perfil's "Para redescubrir": the garment's name gives way, but its button
   never takes the whole row; a long one goes on two lines. */
.perfil-pon {
  flex: 0 1 auto;
  max-width: 50%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.2;
}
/* The outlined and the ink pills ("Empezar con mi armario", "Añadir"): never
   wider than their place; a translation that doesn't fit goes on two lines,
   centred. */
.btn-outline,
.btn-primary {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
}
/* "Cuándo la usas": when a month's short name is wider than its column
   (French "mars" at 375 px; js/ficha.js measures it), the twelve a step
   smaller. */
.ficha-meses.es-estrecha .ficha-mes-ir {
  font-size: 10px;
  letter-spacing: -0.01em;
}
/* The tab bar: four equal tabs always (1fr would let a long name widen its
   own and push the tab line off-centre). When two names come closer than
   8 px, or one is wider than its tab (js/nav.js measures them: never in
   Spanish, English or German), the four go a step smaller and onto two
   lines if one still doesn't fit, never closer than 8 px; the two lines
   keep clear of the tab line. */
.tab-bar {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.nav-item {
  min-width: 0;
}
.nav-item-label {
  white-space: nowrap;
}
.tab-bar.es-estrecha .nav-item {
  gap: 2px;
}
.tab-bar.es-estrecha .nav-item-label {
  max-width: calc(100% - 8px);
  font-size: 10px;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
