:root {
  --ink: #111;
  --paper: #f4f4f5;
  --card: #fff;
  --line: #e6e6e8;
  --muted: #6b6b70;
  --brass: #e10600;
  --brass-dark: #b80500;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: Inter, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100%;
}

.rail {
  background: #000;
  color: #f5f5f5;
  padding: 1.1rem .75rem;
}

.rail-brand {
  margin: 0 .35rem 1.1rem;
  color: #fff;
}
.rail-brand small { color: #a3a3a3; opacity: 1; }

.tablet-featured {
  margin: -1.2rem -1.2rem 1.4rem;
  padding: 1.4rem 1.2rem 1.6rem;
  border-radius: 0 0 18px 18px;
}

.family-head { margin: 0 0 1rem; }
.family-head h2 { margin: .4rem 0 .35rem; }
.family-head .muted { margin: 0 0 .2rem; max-width: 40rem; }

.subfamily-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem 1rem;
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.subfamily-filter label {
  font-weight: 700;
  font-size: .88rem;
  color: #333;
}
.subfamily-filter select {
  flex: 1 1 220px;
  min-width: 200px;
  max-width: 420px;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fafafa;
}

.pager {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .45rem;
  margin: .35rem 0 .75rem;
}
.pager-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .05rem;
  text-align: center;
  padding: .3rem .5rem;
  background: #f4f4f5;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.pager-status-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #777;
}
.pager-status-page {
  font-size: .82rem;
  color: #111;
  line-height: 1.2;
}
.pager-status-range {
  font-size: .72rem;
  color: #555;
}
.pager-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  min-height: 0;
  min-width: 0;
  padding: .28rem .55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #111;
  font: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
}
.pager-btn-next {
  align-items: flex-end;
  text-align: right;
  background: var(--brass, #E10600);
  border-color: var(--brass, #E10600);
  color: #fff;
}
.pager-btn-prev:hover {
  border-color: #111;
}
.pager-btn-next:hover {
  filter: brightness(1.05);
}
.pager-btn-kicker {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .7;
  line-height: 1.1;
}
.pager-btn strong {
  font-size: .78rem;
  line-height: 1.15;
  font-weight: 700;
}
.pager-btn-disabled {
  opacity: .4;
  box-shadow: none;
  cursor: default;
  background: #f7f7f8;
  color: #777;
}
.pager-meta {
  margin: 0 0 .75rem;
  font-size: .88rem;
  color: #555;
}
@media (max-width: 700px) {
  .pager {
    grid-template-columns: 1fr 1fr;
  }
  .pager-status {
    grid-column: 1 / -1;
    order: -1;
  }
}

.rail h1 {
  margin: 0 0 1.1rem;
  text-align: center;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1rem;
}

.rail button, .rail a {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: #e7e7e7;
  border: 0;
  border-left: 3px solid transparent;
  padding: .7rem .9rem;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.rail button.active, .rail a.active {
  background: rgba(225,6,0,.16);
  border-left-color: var(--brass);
  color: #fff;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex;
  gap: .8rem;
  align-items: center;
  padding: .8rem 1.2rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.top input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .7rem 1rem;
  font: inherit;
}
.top .btn-back {
  min-height: 44px;
}
.content {
  padding: 1.2rem;
  overflow: auto;
  flex: 1;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

.card, .hero, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,.05);
}

.card { cursor: pointer; }
.card img { width: 100%; height: 150px; object-fit: cover; background: #111; display: block; }
.family-card img,
.product-card .photo-wrap img,
.featured-card .photo-wrap img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  object-position: center center;
  background: #fff;
  display: block;
  padding: 12px;
  box-sizing: border-box;
}
.hero img { width: 100%; height: 150px; object-fit: cover; background: #111; display: block; }
.card .body, .hero .body, .panel { padding: .9rem 1rem; }
.muted { color: var(--muted); }
.badge {
  display: inline-block;
  background: #fde8e8;
  color: #e10600;
  border-radius: 999px;
  padding: .1rem .5rem;
  font-size: .75rem;
  font-weight: 700;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: .65rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn-brass { background: var(--brass); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-danger { background: #e10600; color: #fff; }

.login {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.2rem;
  background:
    radial-gradient(circle at 18% 20%, rgba(225,6,0,.3), transparent 34%),
    #000;
}
.install-app {
  width: min(420px, 92vw);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  color: #fff;
  text-align: center;
}
.install-app .install-title {
  margin: 0 0 .35rem;
  font-weight: 700;
}
.install-app .muted {
  margin: 0 0 .85rem;
  color: #cfcfcf;
}
.install-app .btn {
  width: 100%;
}
.install-help {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.72);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.install-help-card {
  position: relative;
  width: min(440px, 100%);
  background: #fff;
  color: var(--ink);
  border-radius: 16px;
  padding: 1.4rem 1.2rem 1.2rem;
}
.install-help-card h2 {
  margin: 0 0 .8rem;
  font-size: 1.15rem;
}
.install-help-card ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  line-height: 1.5;
}
.install-help-close {
  position: absolute;
  top: .45rem;
  right: .55rem;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #666;
}
.login form {
  width: min(420px, 92vw);
  background: #fff;
  padding: 2rem;
  border-radius: 20px;
}
.login img.login-logo {
  width: 84px;
  height: 84px;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  display: block;
  margin: 0 auto 1rem;
  background: #000;
}
.login h1 { font-family: "Libre Baskerville", Georgia, serif; text-align: center; }
.login input {
  width: 100%;
  margin: .35rem 0 1rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.qty { display: flex; align-items: center; gap: .5rem; }
.qty input { width: 72px; padding: .4rem; border: 1px solid var(--line); border-radius: 8px; }

.order-panel {
  margin: 1rem 0 1.25rem;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid #e6e6e8;
  background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .07);
}
.order-panel-head {
  padding: .85rem 1rem;
  background: linear-gradient(90deg, #111 0%, #2a2a2a 100%);
  color: #fff;
}
.order-panel-kicker {
  display: block;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .75;
  margin-bottom: .15rem;
}
.order-panel-head strong {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
}
.order-panel-box {
  padding: 1rem;
}
.order-stepper {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  gap: .65rem;
  align-items: stretch;
  margin-bottom: .85rem;
}
.order-step-btn {
  border: 2px solid #ddd;
  border-radius: 14px;
  background: #fff;
  color: #111;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  min-height: 64px;
  transition: border-color .16s ease, background .16s ease, transform .12s ease;
}
.order-step-btn:hover,
.order-step-btn:active {
  border-color: #e10600;
  background: #fff5f5;
}
.order-step-btn:active {
  transform: scale(.97);
}
.order-step-value {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  border: 2px solid #ececec;
  border-radius: 14px;
  background: #fff;
  padding: .45rem .5rem;
  min-height: 64px;
}
.order-step-value span {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #777;
}
.order-step-value input {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  font-weight: 900;
  color: #111;
  padding: 0;
  -moz-appearance: textfield;
}
.order-step-value input::-webkit-outer-spin-button,
.order-step-value input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.btn-order-add {
  width: 100%;
  min-height: 58px;
  font-size: clamp(1rem, 2.8vw, 1.15rem);
  font-weight: 800;
  letter-spacing: .02em;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(196, 146, 58, .28);
}
.detail-media,
.detail-info {
  align-self: start;
}
.alert { padding: .8rem 1rem; border-radius: 12px; margin-bottom: 1rem; }
.alert-error { background: #fde8e8; color: #e10600; }
.alert-ok { background: #e8f7ee; color: #1f7a46; }

.alert-toasts {
  position: fixed;
  z-index: 1200;
  pointer-events: none;
}
.alert-toasts-spotlight {
  right: 50%;
  top: 50%;
  transform: translate(50%, -50%);
  width: min(920px, calc(100vw - 1.25rem));
  max-height: min(92vh, 920px);
  overflow: auto;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: alert-spotlight-in .5s cubic-bezier(.2, .9, .2, 1);
}
.alert-toasts-push {
  animation: alert-spotlight-in .5s cubic-bezier(.2, .9, .2, 1), alert-spotlight-shake .6s ease .15s;
}
.alert-spotlight-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1195;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, .78);
  cursor: pointer;
}
.alert-toasts-head {
  background: linear-gradient(135deg, #ff1a1a 0%, #e10600 45%, #9b0000 100%);
  color: #fff;
  border-radius: 20px;
  padding: 1.35rem 1.5rem 1.2rem;
  text-align: center;
  box-shadow: 0 16px 48px rgba(225, 6, 0, .45);
  border: 3px solid rgba(255, 255, 255, .35);
  position: relative;
  overflow: hidden;
}
.alert-toasts-head::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .18) 50%, transparent 70%);
  animation: alert-shine 2.2s ease-in-out infinite;
  pointer-events: none;
}
.alert-toasts-head-icon {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: .35rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .25));
}
.alert-toasts-head strong {
  display: block;
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1.15;
}
.alert-toasts-head span {
  display: block;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  opacity: .95;
  margin-top: .45rem;
  font-weight: 600;
}
.alert-toasts-head em {
  display: inline-block;
  margin-top: .65rem;
  font-style: normal;
  font-size: .95rem;
  font-weight: 800;
  background: rgba(0, 0, 0, .22);
  padding: .35rem .85rem;
  border-radius: 999px;
}
.alert-toasts-foot {
  display: grid;
  gap: .75rem;
  pointer-events: auto;
}
.alert-toasts-dismiss {
  border: 0;
  border-radius: 16px;
  padding: 1.05rem 1.25rem;
  background: #111;
  color: #fff;
  font-weight: 800;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.alert-toasts-dismiss:hover { background: #e10600; }
.alert-toast-link {
  border: 0;
  background: #fff;
  color: #e10600;
  font-weight: 800;
  font-size: clamp(.95rem, 2.2vw, 1.1rem);
  cursor: pointer;
  padding: .85rem 1rem;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}
@keyframes alert-spotlight-in {
  from { opacity: 0; transform: translate(50%, -44%) scale(.88); }
  to { opacity: 1; transform: translate(50%, -50%) scale(1); }
}
@keyframes alert-spotlight-shake {
  0%, 100% { transform: translate(50%, -50%); }
  20% { transform: translate(calc(50% - 6px), -50%); }
  40% { transform: translate(calc(50% + 6px), -50%); }
  60% { transform: translate(calc(50% - 4px), -50%); }
  80% { transform: translate(calc(50% + 4px), -50%); }
}
@keyframes alert-shine {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}
.alert-toast {
  pointer-events: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
  border: 4px solid var(--brand, #e10600);
  padding: 1.35rem 1.5rem 1.35rem 5.5rem;
  position: relative;
  animation: alert-toast-in .45s cubic-bezier(.2, .9, .2, 1);
  overflow: hidden;
}
.alert-toast::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(225, 6, 0, .07), transparent 55%);
  pointer-events: none;
}
.alert-toast-hero {
  animation: alert-toast-in .45s cubic-bezier(.2, .9, .2, 1), alert-toast-pulse 1.2s ease-in-out infinite;
  border-width: 5px;
  padding-top: 1.55rem;
  padding-bottom: 1.55rem;
}
.alert-toasts-push .alert-toast-hero {
  animation: alert-toast-in .45s cubic-bezier(.2, .9, .2, 1), alert-toast-pulse 1s ease-in-out 4;
}
.alert-toast-price {
  border-color: #c62828;
  background: linear-gradient(180deg, #fff 0%, #fff0f0 100%);
}
.alert-toast-quantity {
  border-color: #1565c0;
  background: linear-gradient(180deg, #fff 0%, #eef6ff 100%);
}
.alert-toast-general {
  border-color: #5d4037;
  background: linear-gradient(180deg, #fff 0%, #f5f0ee 100%);
}
.alert-toast-icon {
  position: absolute;
  left: 1.15rem;
  top: 1.25rem;
  width: clamp(3rem, 8vw, 3.75rem);
  height: clamp(3rem, 8vw, 3.75rem);
  border-radius: 999px;
  background: #e10600;
  color: #fff;
  font-weight: 900;
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(225, 6, 0, .4);
}
.alert-toast-quantity .alert-toast-icon { background: #1565c0; box-shadow: 0 8px 20px rgba(21, 101, 192, .4); }
.alert-toast-general .alert-toast-icon { background: #6d4c41; box-shadow: 0 8px 20px rgba(109, 76, 65, .4); }
.alert-toast-tag {
  display: inline-block;
  font-size: clamp(.72rem, 1.8vw, .82rem);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: #e10600;
  padding: .35rem .75rem;
  border-radius: 999px;
  margin-bottom: .55rem;
  position: relative;
}
.alert-toast-quantity .alert-toast-tag { background: #1565c0; }
.alert-toast-general .alert-toast-tag { background: #6d4c41; }
.alert-toast-title {
  display: block;
  font-size: clamp(1.35rem, 3.8vw, 1.85rem);
  margin-bottom: .65rem;
  color: #111;
  position: relative;
  line-height: 1.2;
  font-weight: 800;
}
.alert-toast-body {
  font-size: clamp(1.05rem, 2.8vw, 1.35rem);
  line-height: 1.55;
  color: #1a1a1a;
  white-space: normal;
  position: relative;
  font-weight: 500;
}
.alert-toast-close {
  position: absolute;
  top: .65rem;
  right: .65rem;
  border: 0;
  background: rgba(0, 0, 0, .08);
  border-radius: 999px;
  font-size: 1.65rem;
  line-height: 1;
  color: #444;
  cursor: pointer;
  padding: .15rem .55rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
}
.alert-toast-close:hover { color: #111; background: rgba(0, 0, 0, .14); }
@keyframes alert-toast-in {
  from { opacity: 0; transform: translateY(20px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes alert-toast-pulse {
  0%, 100% { box-shadow: 0 20px 60px rgba(225, 6, 0, .28), 0 0 0 0 rgba(225, 6, 0, .35); }
  50% { box-shadow: 0 24px 70px rgba(225, 6, 0, .38), 0 0 0 8px rgba(225, 6, 0, .12); }
}
html.alert-flash::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1190;
  background: rgba(225, 6, 0, .2);
  animation: alert-flash-bg 2.8s ease;
}
@keyframes alert-flash-bg {
  0% { opacity: 0; }
  12% { opacity: 1; }
  100% { opacity: 0; }
}

.nav-alerts { position: relative; }
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .4rem;
  margin-left: .35rem;
  border-radius: 999px;
  background: #e10600;
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}
.rail .nav-alerts.active .nav-badge,
.rail button.active .nav-badge { background: #fff; color: #e10600; }

.avisos-page { display: grid; gap: 1.5rem; }
.avisos-head-hero {
  background: linear-gradient(135deg, #ff1a1a, #e10600);
  color: #fff;
  border-radius: 18px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: 0 12px 36px rgba(225, 6, 0, .28);
}
.avisos-head-icon { font-size: 2.5rem; margin-bottom: .25rem; }
.avisos-head h2 { margin: 0 0 .4rem; font-size: clamp(1.5rem, 4vw, 2rem); }
.avisos-head p { margin: 0; font-size: clamp(1rem, 2.5vw, 1.15rem); opacity: .95; }
.avisos-group h3 {
  margin: 0 0 .85rem;
  font-size: clamp(.95rem, 2.2vw, 1.1rem);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #e10600;
  font-weight: 900;
}
.avisos-list { display: grid; gap: 1rem; }
.aviso-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-radius: 18px;
  border: 3px solid var(--line);
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .08);
}
.aviso-price { border-color: #c62828; background: linear-gradient(180deg, #fff, #fff5f5); }
.aviso-quantity { border-color: #1565c0; background: linear-gradient(180deg, #fff, #f3f9ff); }
.aviso-general { border-color: #6d4c41; background: linear-gradient(180deg, #fff, #faf7f6); }
.aviso-card-icon {
  width: clamp(3rem, 8vw, 3.5rem);
  height: clamp(3rem, 8vw, 3.5rem);
  border-radius: 999px;
  background: #fde8e8;
  color: #e10600;
  font-weight: 900;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(225, 6, 0, .2);
}
.aviso-quantity .aviso-card-icon { background: #e3f2fd; color: #1565c0; box-shadow: 0 6px 16px rgba(21, 101, 192, .2); }
.aviso-general .aviso-card-icon { background: #efebe9; color: #6d4c41; }
.aviso-card-tag {
  display: inline-block;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: #888;
  padding: .3rem .65rem;
  border-radius: 999px;
  margin-bottom: .35rem;
}
.aviso-price .aviso-card-tag { background: #c62828; }
.aviso-quantity .aviso-card-tag { background: #1565c0; }
.aviso-general .aviso-card-tag { background: #6d4c41; }
.aviso-card-body h4 {
  margin: 0 0 .55rem;
  font-size: clamp(1.2rem, 3.2vw, 1.55rem);
  line-height: 1.25;
}
.aviso-card-text {
  line-height: 1.6;
  color: #222;
  font-size: clamp(1rem, 2.6vw, 1.2rem);
}

.detail { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1rem; }
.thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.thumbs img { width: 88px; height: 88px; object-fit: contain; object-position: center; background: #fff; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); padding: 6px; box-sizing: border-box; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: .6rem .4rem; border-bottom: 1px solid var(--line); }
select, textarea { width: 100%; padding: .65rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .detail { grid-template-columns: 1fr; }
  .rail { display: flex; overflow: auto; gap: .3rem; padding: .55rem .6rem; align-items: center; }
  .rail h1 { display: none; }
  .rail .rail-brand {
    display: flex;
    margin: 0 .35rem 0 0;
    flex: none;
  }
  .rail .rail-brand span { display: none; }
  .rail .rail-brand img { width: 40px; height: 40px; }
  .rail button { white-space: nowrap; }
}

.panel .photo-wrap,
.panel .photo-wrap-lg {
  background: #fff;
}
.panel .photo-wrap-lg img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  object-position: center center;
  background: #fff;
  padding: 18px;
  box-sizing: border-box;
}

.magazine-teaser {
  background: #111;
  color: #fff;
  border-color: #111;
}
.magazine-teaser strong { display: block; margin: .35rem 0 .2rem; }
.magazine-teaser .muted { color: #cfcfcf; }

html.magazine-open,
html.magazine-open body,
html.magazine-open #app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.magazine {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #fff;
  overflow: hidden;
  z-index: 40;
}
.magazine-bar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  flex-wrap: nowrap;
  padding: .55rem .8rem;
  background: #000;
  border-bottom: 1px solid rgba(255,255,255,.12);
  flex: none;
  pointer-events: auto;
}
.magazine-bar > div:first-child {
  min-width: 0;
  flex: 1;
}
.magazine-kicker {
  margin: 0;
  color: #E10600;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.magazine-bar strong {
  font-family: "Libre Baskerville", Georgia, serif;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}
.magazine-page {
  color: #cfcfcf;
  font-weight: 600;
  flex: none;
  white-space: nowrap;
}
.magazine-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: nowrap;
  flex: none;
}
.magazine-actions .btn-ghost {
  color: #fff;
  border-color: rgba(255,255,255,.22);
}
.mag-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.mag-nav:disabled {
  opacity: .28;
  cursor: default;
}
.mag-nav-prev { left: 10px; }
.mag-nav-next { right: 10px; }
.mag-nav:not(:disabled):active {
  transform: translateY(-50%) scale(.96);
}
.mag-under { z-index: 1; }
.mag-under-next,
.mag-under-prev { z-index: 1; }
.mag-flip {
  z-index: 2;
  transform-origin: left center;
  box-shadow: 12px 0 40px rgba(0,0,0,.35);
  will-change: transform;
}
.magazine-tabs {
  position: relative;
  z-index: 20;
  display: flex;
  gap: .4rem;
  overflow: auto;
  padding: .35rem .8rem;
  flex: none;
  background: #000;
}
.magazine-tabs button {
  background: transparent;
  color: #d4d4d4;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  padding: .35rem .8rem;
  font: inherit;
  cursor: pointer;
}
.magazine-tabs button.active {
  background: #E10600;
  border-color: #E10600;
  color: #fff;
}
.magazine-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  background: #000;
}
.magazine-progress {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  z-index: 9;
  width: min(280px, 80%);
  text-align: center;
  pointer-events: none;
}
.magazine-progress[hidden] { display: none; }
.magazine-progress-track {
  height: 4px;
  border-radius: 99px;
  background: rgba(255,255,255,.15);
  overflow: hidden;
}
.magazine-progress-bar {
  height: 100%;
  width: 0;
  background: #E10600;
  transition: width .2s ease;
}
.magazine-progress p {
  margin: .35rem 0 0;
  color: #cfcfcf;
  font-size: .82rem;
}
.magazine-book {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  perspective: 2200px;
  background: #000;
}
.mag-leaf {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.mag-under { z-index: 1; }
.mag-flip {
  z-index: 2;
  transform-origin: left center;
  box-shadow: 12px 0 40px rgba(0,0,0,.35);
}
.mag-leaf img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #000;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
@media (max-width: 760px) {
  .mag-nav {
    width: 42px;
    height: 42px;
    font-size: 1.7rem;
  }
  .mag-nav-prev { left: 6px; }
  .mag-nav-next { right: 6px; }
  .magazine-page {
    font-size: .85rem;
  }
}
.magazine-msg {
  text-align: center;
  color: #a3a3a3;
  padding: 5rem 1rem 1rem;
  margin: 0;
}
.offline-banner {
  display: block;
  margin: .75rem .5rem 0;
  padding: .55rem .65rem;
  border-radius: 10px;
  background: rgba(225, 6, 0, .14);
  color: #ffd8d8;
  font-size: .78rem;
  line-height: 1.35;
}
.offline-panel {
  max-width: 36rem;
}
.offline-panel h2 {
  margin-top: 0;
}
.offline-ready {
  padding: 0 1rem;
  font-size: .72rem;
  line-height: 1.35;
}
.offline-pack-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .72);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.offline-pack-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.offline-pack-card h3 {
  margin: 0 0 .35rem;
}
.offline-pack-card p {
  margin: 0 0 .85rem;
  color: #555;
}
.offline-pack-track {
  height: 8px;
  border-radius: 999px;
  background: #ececec;
  overflow: hidden;
  margin-bottom: .45rem;
}
.offline-pack-bar {
  height: 100%;
  background: linear-gradient(90deg, #e10600, #ff4d4d);
  transition: width .25s ease;
}
.offline-pack-card small {
  color: #777;
}
