/* ==========================================================================
   Portal de comerciales · Fossil Natura — marca 2026
   Montserrat · #2E2D2C / #F0F0F0 / blanco · pastillas 100px · tarjetas 14px.
   Logotipo oficial: el vertical. En barras pequeñas, solo el símbolo FN.
   Sale de la maqueta (portal-comerciales/maqueta/portal.css), adaptado a páginas reales.
   ========================================================================== */

@font-face { font-family: 'Montserrat'; font-weight: 300; font-display: swap; src: url('fonts/Montserrat-Light.ttf') format('truetype'); }
@font-face { font-family: 'Montserrat'; font-weight: 400; font-display: swap; src: url('fonts/Montserrat-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Montserrat'; font-weight: 500; font-display: swap; src: url('fonts/Montserrat-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url('fonts/Montserrat-Bold.ttf') format('truetype'); }

:root {
  --ink: #2E2D2C;
  --paper: #F0F0F0;
  --white: #FFFFFF;
  --muted: rgba(46, 45, 44, .62);
  --soft: rgba(46, 45, 44, .42);
  --line: rgba(46, 45, 44, .12);
  --line-strong: rgba(46, 45, 44, .22);
  --r-card: 14px;
  --r-thumb: 10px;
  --r-pill: 100px;
  --gutter: 20px;
  --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

.app {
  font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100dvh;
}
.app main { max-width: 560px; margin: 0 auto; }

/* ── Tipografía ──────────────────────────────────────────────────────── */
.eyebrow { font-size: 10px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.h1 { font-size: 26px; font-weight: 300; line-height: 1.15; letter-spacing: -.01em; margin: 6px 0 0; }
.h2 { font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 500; }
.num { font-variant-numeric: tabular-nums; }
.small.strong { text-decoration: none; }

/* ── Cabecera ────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 64px; padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top, 0px); box-sizing: content-box;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); background: var(--paper);
}
.topbar .simbolo { height: 30px; width: auto; display: block; }
.topbar .back { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink); text-decoration: none; min-height: 44px; }
.topbar .title { font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.topbar.three { display: grid; grid-template-columns: 1fr auto 1fr; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink); color: var(--paper); text-decoration: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; letter-spacing: .04em;
}

.content { padding: 20px var(--gutter) 32px; }
.con-tabs .content { padding-bottom: calc(var(--tabbar) + var(--safe-b) + 32px); }
.con-dock .content { padding-bottom: calc(110px + var(--safe-b)); }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head .small { text-align: right; text-decoration: none; }

/* ── Pastillas (botones) ─────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 26px; border-radius: var(--r-pill);
  font: 500 14px/1 'Montserrat', sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  -webkit-tap-highlight-color: transparent;
}
.pill:active { opacity: .85; }
.pill[disabled] { opacity: .5; cursor: default; }
.pill.ghost { background: transparent; color: var(--ink); }
.pill.light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.pill.block { display: flex; width: 100%; }
.pill.sm { min-height: 40px; padding: 0 18px; font-size: 13px; }
.pill-row { display: flex; gap: 8px; }
.pill-row .pill { flex: 1; gap: 6px; padding: 0 8px; font-size: 12px; }

/* ── Tarjetas y listas ───────────────────────────────────────────────── */
.card { background: var(--white); border-radius: var(--r-card); padding: 16px; }
.card.flat { background: transparent; border: 1px solid var(--line); }
.list { background: var(--white); border-radius: var(--r-card); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; color: inherit; }
.list-item + .list-item { border-top: 1px solid var(--line); }
a.list-item:active { background: rgba(46,45,44,.04); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .name.wrap { white-space: normal; overflow: visible; font-size: 14px; }
.list-item .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.list-item > svg { flex: none; color: var(--soft); }
.list-item.line { gap: 12px; padding: 12px 14px; }
.list.datos .dato { font-size: 14px; margin-top: 2px; word-break: break-word; }
.cifra { text-align: right; }
.cifra .num { font-size: 26px; font-weight: 300; line-height: 1; }
.vacio { margin-top: 12px; padding: 18px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-card); color: var(--muted); font-size: 13px; }
.vacio a { color: var(--ink); font-weight: 500; }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--r-pill); font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.tag.dark { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ── Miniaturas y fotos ──────────────────────────────────────────────── */
.thumb { flex: none; width: 52px; height: 52px; border-radius: var(--r-thumb); overflow: hidden; background: var(--paper); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo { display: block; border-radius: var(--r-thumb); overflow: hidden; background: var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-grande { height: 190px; border-radius: var(--r-card); }
/* Recorte con la forma de la F en negativo (paths de REBRANDING/web-plantilla/shapes.json) */
.forma-r { clip-path: url(#vR); }

/* ── Formularios ─────────────────────────────────────────────────────── */
.field { display: block; margin-top: 14px; }
.legend + .field, .acceso-form > .field:first-of-type { margin-top: 0; }
.label { display: block; font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.label .opt { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--soft); }
.input {
  width: 100%; min-height: 48px; padding: 12px 16px;
  background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--r-thumb);
  font: 400 16px/1.3 'Montserrat', sans-serif; color: var(--ink);   /* 16px: iOS no hace zoom al enfocar */
  -webkit-appearance: none; appearance: none;
}
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.input::placeholder { color: var(--soft); }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath d='M6 9.5l6 6 6-6' fill='none' stroke='%232E2D2C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px; }
textarea.input { min-height: 84px; resize: vertical; }
input[type=date].input { min-height: 48px; }
.row-2 { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.row-2 .field { margin-top: 14px; }
.legend { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; margin: 26px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }
form > .legend:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.con-error .input { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.field-error { display: block; margin-top: 6px; font-size: 12px; font-weight: 500; }
.cliente-nombre { font-size: 18px; font-weight: 500; margin-top: 4px; }

/* Casilla */
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--soft); display: flex; align-items: center; justify-content: center; margin-top: 1px; color: transparent; }
.check .box svg { width: 14px; height: 14px; }
.check input:checked + .box { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.check input:checked + .box:empty::after { content: ''; width: 10px; height: 6px; border-left: 1.5px solid var(--paper); border-bottom: 1.5px solid var(--paper); transform: rotate(-45deg) translate(1px, -1px); }
.check input:focus-visible + .box { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Sí / No */
.seg { display: flex; border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 3px; background: var(--white); }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 10px 0; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--ink); }

/* Buscador */
.search { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; background: var(--white); border-radius: var(--r-pill); color: var(--soft); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); min-width: 0; -webkit-appearance: none; }
.search input::placeholder { color: var(--soft); }

/* Cantidad con − y + */
.stepper { flex: none; display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--white); }
.stepper button { width: 38px; height: 40px; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.stepper input { width: 34px; border: 0; text-align: center; font-size: 16px; font-weight: 500; background: transparent; -moz-appearance: textfield; padding: 0; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; }
.stepper.activo { border-color: var(--ink); }
.aviso-minimo { margin-top: 8px; display: flex; gap: 6px; align-items: center; }

/* Fotos de la entrega */
.fotos-sel { display: flex; flex-wrap: wrap; gap: 8px; }
.fotos-previas { display: contents; }
.foto-prev { position: relative; width: 76px; height: 76px; border-radius: var(--r-thumb); overflow: hidden; background: var(--line); }
.foto-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-prev button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.foto-add { width: 76px; height: 76px; border-radius: var(--r-thumb); border: 1px dashed rgba(46,45,44,.35); display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; }

/* «He recibido material» / «Cambiar contraseña» desplegables */
details.recibir { margin-top: 14px; }
details.recibir > summary { list-style: none; }
details.recibir > summary::-webkit-details-marker { display: none; }
details[open].recibir > summary { background: var(--ink); color: var(--paper); }
.recibir-fila { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.recibir-fila + .recibir-fila { border-top: 1px solid var(--line); }
.recibir-fila .grow { flex: 1; font-weight: 500; }

/* ── Campanita y avisos ───────────────────────────────────────────────── */
.topbar-der { display: flex; align-items: center; gap: 6px; }
.campana { position: relative; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.campana-n { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: var(--paper); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--paper); }
.aviso.nuevo .name::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); margin-right: 7px; vertical-align: 2px; }
.digital-item .tag { margin-left: 4px; vertical-align: 2px; }

/* ── Instalar la app en el móvil ──────────────────────────────────────── */
.instalar { margin-top: 18px; background: var(--white); border-radius: var(--r-card); padding: 16px; position: relative; }
.instalar.fijo { margin-top: 0; }
.instalar .inst-cab { display: flex; gap: 12px; align-items: center; padding-right: 28px; }
.instalar .inst-ico { flex: none; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; }
.instalar .inst-ico img { width: 100%; height: 100%; display: block; }
.instalar .inst-tit { font-weight: 500; }
.instalar .inst-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.instalar ol { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: paso; }
.instalar li { counter-increment: paso; display: flex; gap: 10px; align-items: center; padding: 7px 0; font-size: 14px; }
.instalar li::before { content: counter(paso); flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 500; display: flex; align-items: center; justify-content: center; }
.instalar li span { line-height: 1.5; }
.instalar li svg { vertical-align: -4px; margin: 0 1px; }
.instalar li b { font-weight: 500; }
.instalar .cerrar { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--soft); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.instalar .pill { margin-top: 14px; }
.instalar .hecho-ok { display: flex; gap: 8px; align-items: center; font-size: 14px; }

/* ── Stock ───────────────────────────────────────────────────────────── */
.stock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stock { display: block; background: var(--white); border-radius: var(--r-card); padding: 14px; text-decoration: none; color: inherit; }
.stock .eyebrow { min-height: 26px; }
.stock .qty { font-size: 34px; font-weight: 300; line-height: 1; margin-top: 10px; }
.stock .unit { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stock.low { background: var(--ink); color: var(--paper); }
.stock.low .unit, .stock.low .eyebrow { color: rgba(240, 240, 240, .7); }
.bar { height: 3px; border-radius: 3px; background: var(--line); margin-top: 12px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); }
.stock.low .bar { background: rgba(240, 240, 240, .2); }
.stock.low .bar i { background: var(--paper); }

/* ── Avisos ──────────────────────────────────────────────────────────── */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-card); border: 1px solid var(--ink); font-size: 13px; }
.notice > svg { flex: none; margin-top: 1px; }
.notice.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); margin-top: 18px; }
.notice.error { background: var(--white); font-weight: 500; }
.dark-screen .notice.error { background: var(--paper); color: var(--ink); }
.pendientes-sub { opacity: .75; }
.toast {
  position: fixed; left: 50%; top: calc(76px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 50;
  width: calc(100% - 40px); max-width: 520px; padding: 14px 18px; border-radius: var(--r-card);
  background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 500;
  animation: toast 4.5s ease forwards;
}
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -8px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; visibility: hidden; } }
.red-aviso {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 12px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 500;
}
.red-aviso[hidden] { display: none; }
.con-dock .red-aviso { bottom: calc(96px + var(--safe-b)); }

/* ── Historial ───────────────────────────────────────────────────────── */
.entry { position: relative; padding-left: 22px; padding-bottom: 20px; }
.entry::before { content: ''; position: absolute; left: 4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.entry::after { content: ''; position: absolute; left: 7px; top: 18px; bottom: 0; width: 1px; background: var(--line-strong); }
.entry:last-child::after { display: none; }
.entry .when { font-size: 12px; color: var(--muted); }
.entry .what { font-size: 14px; font-weight: 500; margin-top: 2px; }
.entry .photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.entry .photos .photo { width: 64px; height: 64px; }
.entry.pendiente::before { background: transparent; border: 1px solid var(--ink); }

/* ── Barra inferior y botón fijo ─────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: var(--white); border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); text-decoration: none; }
.tabbar a.on { color: var(--ink); }
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 14px var(--gutter) calc(18px + var(--safe-b));
  background: var(--paper); border-top: 1px solid var(--line);
}
.dock > * { max-width: 520px; margin-left: auto; margin-right: auto; }
.dock-link { display: block; text-align: center; margin-top: 14px; font-size: 13px; font-weight: 500; text-decoration: none; }

/* ── Confirmación ────────────────────────────────────────────────────── */
.hecho { padding-top: 56px; }
.hecho-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; }
.hecho .h1 { margin-top: 26px; font-size: 30px; }
.hecho-texto { margin: 14px 0 0; font-size: 15px; line-height: 1.55; }
.hecho-texto b { color: var(--ink); font-weight: 500; }

/* ── Pantalla oscura (acceso) ────────────────────────────────────────── */
.dark-screen { background: var(--ink); color: var(--paper); }
.dark-screen .eyebrow, .dark-screen .label { color: rgba(240, 240, 240, .6); }
.dark-screen .label .opt { color: rgba(240, 240, 240, .45); }
.dark-screen .input { background: rgba(240, 240, 240, .06); border-color: rgba(240, 240, 240, .22); color: var(--paper); }
.dark-screen .input:focus { border-color: var(--paper); box-shadow: 0 0 0 1px var(--paper); }
.dark-screen .input::placeholder { color: rgba(240, 240, 240, .45); }
.dark-screen .check .box { border-color: rgba(240, 240, 240, .6); }
.dark-screen .check input:checked + .box { background: var(--paper); border-color: var(--paper); }
.dark-screen .check input:checked + .box:empty::after { border-color: var(--ink); }
.acceso { padding-top: 24px; }
.acceso-logo { height: 62px; width: auto; display: block; }
.acceso-titulo { margin-top: 72px; }
.acceso-titulo .h1 { font-size: 34px; }
.acceso-form { margin-top: 40px; }
.acceso-form .notice { margin-bottom: 16px; }
.acceso-recordar { margin: 18px 0 26px; font-size: 13px; color: rgba(240, 240, 240, .8); }
.acceso-olvido { display: block; margin-top: 20px; text-align: center; font-size: 13px; color: rgba(240, 240, 240, .7); text-decoration: none; }
.acceso-texto { margin: 32px 0 24px; font-size: 15px; line-height: 1.55; color: rgba(240, 240, 240, .8); }

@media (min-width: 640px) {
  .content { padding-top: 32px; }
}

/* ── Página pública de material compartido (ver.php) ───────────────────── */
.publico { min-height: 100vh; display: flex; flex-direction: column; }
.pub-cab { padding: 28px var(--gutter) 0; max-width: 640px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.pub-cab img { display: block; height: auto; }
.pub { flex: 1; padding: 56px var(--gutter) 40px; max-width: 640px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.pub .h1 { font-size: 30px; }
.pub-texto { margin: 14px 0 0; font-size: 15px; line-height: 1.6; }
.pub-media { display: block; width: 100%; height: auto; margin: 26px 0 0; border-radius: var(--r-card); background: var(--white); }
.pub-boton { margin-top: 28px; }
.pub-meta { margin-top: 14px; font-size: 12px; color: var(--muted); }
.pub-pie { padding: 22px var(--gutter) calc(22px + var(--safe-b)); text-align: center; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pub-pie a { color: inherit; }

/* Material digital: botón «Compartir» junto a cada material */
.digital-item { padding: 0; }
.digital-item .digital-abrir { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; padding: 14px 4px 14px 16px; color: inherit; text-decoration: none; }
.compartir { flex: none; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-right: 8px;
  border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink); cursor: pointer; }
.compartir:active { background: var(--paper); }

/* Preguntas y sugerencias (ayuda.php) */
.mensajes { display: flex; flex-direction: column; gap: 10px; }
.mensaje-texto { margin: 6px 0 0; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.mensaje-resp { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-thumb); background: var(--paper); }
.mensaje-pend { margin-top: 10px; }
.mensaje .meta { font-size: 12px; color: var(--muted); }

/* Botones de texto (Anular, Reintentar) */
.link-btn { padding: 6px 0; border: 0; background: none; font-size: 12px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); cursor: pointer; }
/* Ficha de cliente: «Entrega» y «Visita» a la par */
.pill-row.dos .pill { font-size: 14px; }

/* Pedidos de material (stock.php) */
.list-item.pedido { align-items: flex-start; }
.list-item.pedido .meta { white-space: normal; }
.list-item.pedido .anular { margin-top: 2px; }

/* Visitas: motivo y resultado en pastillas que saltan de línea */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: block; padding: 10px 16px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--white);
  font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.chips input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chips input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Lista de visitas */
.list-item.visita { align-items: flex-start; }
.list-item.visita .meta, .list-item.visita .name { white-space: normal; }
.visita-ico { flex: none; display: flex; margin-top: 1px; color: var(--soft); }
.tarjeta-nuevo { background: var(--white); border-radius: var(--r-card); }
/* Anclas (#pedidos): que la barra de arriba no tape el título */
.section[id] { scroll-margin-top: 84px; }

/* Pedidos en camino: confirmar la recepción o avisar de un problema */
.list-item.pedido.en-camino { flex-wrap: wrap; }
details.problema { margin-top: 6px; }
details.problema > summary { list-style: none; display: inline-block; }
details.problema > summary::-webkit-details-marker { display: none; }
details.problema form { margin-top: 8px; }
a.notice.aviso-pedido { text-decoration: none; }

/* Pestaña «Material»: selector Mi stock | PLV (17-10-2026) */
.seg-tabs { display: flex; background: var(--white); border-radius: var(--r-pill); padding: 3px; margin-top: 16px; }
.seg-tabs a { flex: 1; text-align: center; padding: 10px 0; border-radius: var(--r-pill); font-size: 12px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); text-decoration: none; }
.seg-tabs a.on { background: var(--ink); color: var(--paper); }

/* PLV */
.list-item.plv .meta, .list-item.plv .name { white-space: normal; }
.plv-pasos { list-style: none; margin: 0; padding: 0; }
.plv-pasos li { position: relative; padding: 0 0 16px 24px; font-size: 14px; }
.plv-pasos li::before { content: ''; position: absolute; left: 4px; top: 5px; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--soft); background: var(--paper); }
.plv-pasos li::after { content: ''; position: absolute; left: 8px; top: 16px; bottom: 0; width: 1px; background: var(--line-strong); }
.plv-pasos li:last-child::after { display: none; }
.plv-pasos li.hecho::before { background: var(--ink); border-color: var(--ink); }
.plv-pasos li.ahora { font-weight: 500; }
.plv-pasos li.ahora::before { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(46,45,44,.12); }
.plv-pasos .meta { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.plv-pasos li.pendiente { color: var(--soft); }
.opciones { display: grid; gap: 8px; }
.opciones label { position: relative; display: block; }
.opciones input { position: absolute; opacity: 0; }
.opciones span { display: block; padding: 14px 16px; border-radius: var(--r-card); border: 1px solid var(--line-strong); background: var(--white); cursor: pointer; font-size: 14px; font-weight: 500; }
.opciones span small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.opciones input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.opciones input:checked + span::after { content: ''; position: absolute; right: 16px; top: 18px; width: 10px; height: 6px; border-left: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(-45deg); }
.opciones input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.plv-fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.plv-fotos .photo { aspect-ratio: 1; }
.pill-row.tres .pill { font-size: 13px; }

/* ── Visor de imágenes (portal.js): fotos de tienda, PLV, entregas y productos ── */
html.visor-abierto, html.visor-abierto body { overflow: hidden; }
.visor { position: fixed; inset: 0; z-index: 100; background: #161615; color: var(--paper); display: flex; flex-direction: column;
  font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif; }
.visor[hidden] { display: none; }
.visor-barra { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px; background: rgba(22, 22, 21, .92); position: relative; z-index: 2; }
.visor-cuenta { flex: 1; text-align: center; font-size: 12px; font-weight: 500; letter-spacing: .12em; color: rgba(240, 240, 240, .7); }
.visor-acciones { display: flex; gap: 6px; min-width: 48px; justify-content: flex-end; }
.visor-boton { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(240, 240, 240, .12); color: var(--paper);
  display: flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.visor-boton[hidden] { display: none; }
.visor-boton:active { background: rgba(240, 240, 240, .24); }
.visor-cerrar { background: var(--paper); color: var(--ink); }
.visor-lienzo { flex: 1; position: relative; overflow: hidden; touch-action: none; display: flex; align-items: center; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0px); user-select: none; -webkit-user-select: none; }
.visor-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; will-change: transform; -webkit-user-drag: none; }
.visor.cargando .visor-img { opacity: .25; }
.visor-estado { position: absolute; left: 20px; right: 20px; top: 50%; margin: 0; transform: translateY(-50%); text-align: center; font-size: 13px; color: rgba(240, 240, 240, .75); pointer-events: none; }
.visor-nav { position: absolute; top: 50%; z-index: 2; margin-top: 24px; background: rgba(22, 22, 21, .55); }
.visor-ant { left: 10px; }
.visor-sig { right: 10px; }
