:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --panel: #ffffff;
  --ink: #1f2328;
  --muted: #69707a;
  --line: #ded9d0;
  --red: #e60023;
  --red-dark: #b6001b;
  --blue: #2563eb;
  --green: #0f8f72;
  --amber: #f2b84b;
  --shadow: 0 24px 60px rgba(31, 35, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(230, 0, 35, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(37, 99, 235, 0.08), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.workspace {
  width: min(1080px, 100%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-weight: 800;
  font-size: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 22px;
}

.privacy-link {
  float: right;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.privacy-link:hover,
.back-link:hover,
.document-panel a:hover {
  color: var(--red);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: stretch;
  gap: 22px;
}

.tool-panel,
.preview-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-panel {
  padding: clamp(24px, 5vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 440px;
}

.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 70px);
  line-height: 0.96;
  letter-spacing: 0;
}

.status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(15, 143, 114, 0.24);
  border-radius: 999px;
  background: rgba(15, 143, 114, 0.08);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.status-pill[data-mode="working"] {
  border-color: rgba(37, 99, 235, 0.24);
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
}

.download-form {
  display: grid;
  gap: 10px;
}

.field-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 56px;
  border: 1px solid #cfc8bd;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 16px;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.download-button {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  padding: 0 20px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    opacity 160ms ease;
  white-space: nowrap;
}

.download-button:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.download-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.download-button svg,
.file-chip svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-line {
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
}

.status-line[data-state="working"] .status-dot {
  background: var(--blue);
  animation: pulse 900ms ease-in-out infinite;
}

.status-line[data-state="success"] .status-dot {
  background: var(--green);
}

.status-line[data-state="error"] .status-dot {
  background: var(--red);
}

.preview-panel {
  padding: 24px;
  overflow: hidden;
}

.phone-frame {
  position: relative;
  height: 100%;
  min-height: 440px;
  border-radius: 32px;
  background: #22262d;
  padding: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.phone-frame::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 86px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  transform: translateX(-50%);
}

.pin-card {
  height: 100%;
  border-radius: 24px;
  background: #fff;
  padding: 18px 14px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
}

.video-art {
  position: relative;
  min-height: 320px;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, #fee2e2 0 35%, #f9a8d4 35% 58%, #bfdbfe 58% 100%);
}

.video-art::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 14px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.18)),
    linear-gradient(45deg, rgba(15, 143, 114, 0.58), transparent 52%);
}

.video-art::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(31, 35, 40, 0.8);
  transform: translate(-50%, -50%);
  clip-path: polygon(38% 28%, 38% 72%, 72% 50%);
}

.video-art span {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.video-art span:nth-child(1) {
  left: 22px;
  bottom: 22px;
  width: 42px;
  height: 8px;
}

.video-art span:nth-child(2) {
  left: 72px;
  bottom: 22px;
  width: 132px;
  height: 8px;
}

.video-art span:nth-child(3) {
  right: 22px;
  bottom: 18px;
  width: 28px;
  height: 16px;
}

.pin-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pin-controls span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f1f2f4;
}

.pin-controls span:last-child {
  margin-left: auto;
  width: 72px;
  border-radius: 999px;
  background: var(--red);
}

.file-chip {
  position: absolute;
  right: -10px;
  bottom: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 18px 40px rgba(31, 35, 40, 0.24);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.65;
  }

  50% {
    transform: scale(1.55);
    opacity: 1;
  }
}

.document-page {
  background: var(--bg);
}

.document-shell {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
}

.document-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 48px);
}

.document-panel h1 {
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.02;
}

.document-panel h2 {
  margin: 30px 0 10px;
  font-size: 20px;
}

.document-panel p,
.document-panel li {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.document-panel ul {
  margin: 0;
  padding-left: 22px;
}

.document-panel a {
  color: var(--blue);
  font-weight: 800;
}

.document-updated {
  margin: 12px 0 28px;
  font-weight: 800;
}

@media (max-width: 860px) {
  .shell {
    align-items: start;
    padding: 20px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .tool-panel {
    min-height: auto;
  }

  .preview-panel {
    display: none;
  }
}

@media (max-width: 620px) {
  .title-row,
  .input-row {
    grid-template-columns: 1fr;
  }

  .title-row {
    display: grid;
  }

  .download-button {
    width: 100%;
  }

  h1 {
    font-size: 42px;
  }
}
