.pw-nightmare-file {
  --ink: #111827;
  --muted: #536273;
  --amber: #f59e0b;
  --blue: #113b5d;
  --cyan: #2aa7c8;
  --green: #16805a;
  margin: 0 0 3rem;
}

.pw-nightmare-file * {
  box-sizing: border-box;
}

.pw-nightmare-file p {
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.78;
  margin: 0 0 1.1rem;
}

.pw-nightmare-file a {
  color: #b35f00;
  font-weight: 700;
}

.pw-story-lede {
  border: 1px solid #f2d49b;
  background: linear-gradient(135deg, #fff8e7 0%, #eff8fb 100%);
  border-radius: 8px;
  padding: clamp(1rem, 2.5vw, 1.6rem);
  margin: 1.2rem 0 2rem;
  position: relative;
  overflow: hidden;
}

.pw-story-lede:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, .6) 40%, transparent 70%);
  transform: translateX(-100%);
  animation: pw-sheen 6s ease-in-out infinite;
}

.pw-story-lede strong {
  color: var(--ink);
}

.pw-alert-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border-radius: 999px;
  padding: .35rem .7rem;
  background: #111827;
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: .75rem;
}

.pw-alert-chip span {
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, .7);
  animation: pw-pulse 1.7s infinite;
}

.pw-story-scene {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #d9e3e8;
  background: #fff;
  margin: 2rem 0;
  position: relative;
  box-shadow: 0 18px 45px rgba(17, 24, 39, .10);
  animation: pw-float-in .7s ease both;
}

.pw-story-scene img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.pw-story-scene figcaption {
  color: #4b5563;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  font-size: .92rem;
  line-height: 1.55;
  padding: .85rem 1rem;
}

.pw-image-scan:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -35%;
  height: 35%;
  background: linear-gradient(180deg, transparent, rgba(42, 167, 200, .28), transparent);
  animation: pw-scan 5s ease-in-out infinite;
  pointer-events: none;
}

.pw-timeline {
  display: grid;
  gap: .85rem;
  margin: 2rem 0;
  counter-reset: pw-step;
}

.pw-timeline-item {
  counter-increment: pw-step;
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: .9rem;
  align-items: start;
  border: 1px solid #e6edf1;
  border-radius: 8px;
  padding: .95rem;
  background: #fff;
  transform-origin: left center;
  animation: pw-slide-up .7s ease both;
}

.pw-timeline-item:nth-child(2) { animation-delay: .08s; }
.pw-timeline-item:nth-child(3) { animation-delay: .16s; }
.pw-timeline-item:nth-child(4) { animation-delay: .24s; }

.pw-timeline-item:before {
  content: counter(pw-step);
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-weight: 900;
}

.pw-timeline-item strong {
  color: var(--ink);
  display: block;
  margin-bottom: .25rem;
}

.pw-split-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr);
  gap: 1rem;
  align-items: stretch;
  margin: 2rem 0;
}

.pw-mini-panel {
  border: 1px solid #e6edf1;
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
}

.pw-mini-panel.dark {
  background: #0f2233;
  border-color: #0f2233;
  color: white;
  position: relative;
  overflow: hidden;
}

.pw-mini-panel.dark:after {
  content: "";
  position: absolute;
  width: 11rem;
  height: 11rem;
  right: -4rem;
  bottom: -5rem;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  animation: pw-orbit 7s linear infinite;
}

.pw-mini-panel.dark p,
.pw-mini-panel.dark strong {
  color: white;
  position: relative;
  z-index: 1;
}

.pw-source-box {
  border-left: 4px solid var(--amber);
  background: #fff7e6;
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.1rem;
  margin: 2rem 0;
}

.pw-source-box p:last-child {
  margin-bottom: 0;
}

.pw-checklist {
  display: grid;
  gap: .7rem;
  margin: 1.5rem 0 2.2rem;
}

.pw-check {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  gap: .75rem;
  padding: .9rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.pw-check:before {
  content: "";
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  margin-top: .25rem;
  background: radial-gradient(circle at center, var(--green) 0 38%, #d9f7ea 39% 100%);
}

.pw-postcode-cta {
  border-radius: 8px;
  padding: clamp(1rem, 3vw, 1.8rem);
  margin: 2.6rem 0;
  background: linear-gradient(135deg, #102235 0%, #113b5d 62%, #f59e0b 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.pw-postcode-cta:before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 36px 36px;
  animation: pw-grid 12s linear infinite;
  opacity: .55;
}

.pw-postcode-cta > * {
  position: relative;
  z-index: 1;
}

.pw-postcode-cta p,
.pw-postcode-cta strong {
  color: #fff;
}

.pw-postcode-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background: #fff;
  color: #111827;
  text-decoration: none;
  border-radius: 999px;
  padding: .72rem 1.05rem;
  font-weight: 900;
  margin-top: .5rem;
}

.pw-reveal-line {
  display: grid;
  gap: .45rem;
  margin: 1.5rem 0;
}

.pw-reveal-line span {
  height: .62rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--cyan), var(--blue));
  transform-origin: left;
  animation: pw-grow 1.1s ease both;
}

.pw-reveal-line span:nth-child(2) { width: 78%; animation-delay: .12s; }
.pw-reveal-line span:nth-child(3) { width: 56%; animation-delay: .24s; }

@keyframes pw-sheen {
  0%, 50% { transform: translateX(-100%); }
  75%, 100% { transform: translateX(100%); }
}

@keyframes pw-pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .65); }
  70% { box-shadow: 0 0 0 .7rem rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes pw-float-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pw-slide-up {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pw-scan {
  0%, 35% { top: -35%; }
  70%, 100% { top: 100%; }
}

@keyframes pw-orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pw-grid {
  from { background-position: 0 0; }
  to { background-position: 72px 72px; }
}

@keyframes pw-grow {
  from { transform: scaleX(0); opacity: .3; }
  to { transform: scaleX(1); opacity: 1; }
}

@media (max-width: 760px) {
  .pw-split-panel {
    grid-template-columns: 1fr;
  }

  .pw-timeline-item {
    grid-template-columns: 2.5rem 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pw-nightmare-file *,
  .pw-nightmare-file *:before,
  .pw-nightmare-file *:after {
    animation: none !important;
    transition: none !important;
  }
}
