:root {
  --bg: #f8f4f7;
  --surface: #fffdfd;
  --surface-soft: #f3edf5;
  --text: #2e2932;
  --muted: #746d78;
  --line: #e8dee9;
  --accent: #9b6aa6;
  --accent-strong: #80528b;
  --accent-soft: #eee2f1;
  --danger: #b7515c;
  --shadow: 0 20px 55px rgba(77, 51, 82, 0.11);
}

* { box-sizing: border-box; }

html { color-scheme: light; }
body.modal-open { overflow: hidden; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% -5%, rgba(195, 157, 201, 0.22), transparent 34rem),
    radial-gradient(circle at 95% 12%, rgba(237, 201, 216, 0.25), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.brand-bar {
  min-height: 74px;
  display: flex;
  align-items: center;
  padding: 14px max(22px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(133, 94, 141, 0.1);
  background: rgba(255, 253, 253, 0.82);
  backdrop-filter: blur(14px);
}

.brand-bar-inner {
  width: min(calc(100% - 44px), 1480px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(145deg, #b480bd, #8a5796);
  box-shadow: 0 8px 20px rgba(128, 82, 139, 0.25);
}

.brand-icon svg { width: 22px; fill: currentColor; }

.brand-link { color: inherit; text-decoration: none; }

.examples-button {
  min-height: 48px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 0 0 auto;
  border: 1px solid rgba(128, 82, 139, 0.2);
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, #ad75b7, #80528b);
  box-shadow: 0 8px 20px rgba(128, 82, 139, 0.22);
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.examples-button:hover { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(128, 82, 139, 0.28); }
.examples-button svg { width: 21px; fill: currentColor; }
.examples-button:focus-visible, .examples-tab:focus-visible, .examples-close:focus-visible { outline: 4px solid rgba(155, 106, 166, 0.28); outline-offset: 3px; }

.page-shell {
  width: min(100% - 32px, 740px);
  margin: 0 auto;
  padding: 48px 0 56px;
}

.legal-page { width: min(100% - 32px, 820px); }

.legal-card h1 {
  margin: 16px 0 8px;
  font-size: clamp(30px, 5vw, 44px);
}

.legal-card h2 {
  margin: 30px 0 8px;
  font-size: 21px;
}

.legal-card p { line-height: 1.7; }
.legal-updated { margin-top: 0; color: var(--muted); }

.legal-back {
  display: inline-flex;
  margin-top: 28px;
  text-decoration: none;
}

.intro { text-align: center; margin-bottom: 28px; }

.eyebrow {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  max-width: 680px;
  margin: 16px auto 12px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.intro p {
  max-width: 580px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.uploader-card {
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(132, 94, 140, 0.12);
  border-radius: 28px;
  background: rgba(255, 253, 253, 0.94);
  box-shadow: var(--shadow);
}

.field-label {
  display: block;
  margin-bottom: 5px;
  font-size: 18px;
  font-weight: 750;
}

.field-help { margin: 0 0 14px; color: var(--muted); }

.name-field {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border: 2px solid var(--line);
  border-radius: 17px;
  background: white;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.name-field:focus-within {
  border-color: #bd91c5;
  box-shadow: 0 0 0 4px rgba(180, 128, 189, 0.15);
}

.name-field svg { width: 21px; flex: 0 0 auto; fill: #ad85b5; }
.name-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 17px; color: var(--text); }
.name-field input::placeholder { color: #aaa1ac; }

.choose-button,
.submit-button,
.secondary-button,
.move-button,
.delete-button {
  border: 0;
  cursor: pointer;
}

.choose-button {
  width: 100%;
  min-height: 116px;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 2px dashed #cdb2d2;
  border-radius: 21px;
  color: var(--accent-strong);
  background: #faf6fb;
  font-size: 18px;
  font-weight: 750;
}

.choose-button:hover { background: #f4ebf6; border-color: #ae82b7; }
.choose-button:focus-visible, .submit-button:focus-visible, .secondary-button:focus-visible, .move-button:focus-visible, .delete-button:focus-visible { outline: 4px solid rgba(155, 106, 166, 0.25); outline-offset: 2px; }
.choose-button svg { width: 31px; fill: currentColor; }

.format-note { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: 14px; }

.selection-panel { margin-top: 30px; }
.selection-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.selection-heading h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -0.02em; }
.selection-heading p { margin: 0; color: var(--muted); line-height: 1.45; }
.photo-count { flex: 0 0 auto; padding: 7px 10px; border-radius: 10px; background: var(--surface-soft); color: var(--accent-strong); font-size: 14px; font-weight: 750; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.photo-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  box-shadow: 0 5px 15px rgba(63, 42, 68, 0.06);
  touch-action: none;
}

.photo-card.is-dragging { opacity: .55; transform: scale(.98); }
.photo-preview { aspect-ratio: 1 / 1; position: relative; overflow: hidden; background: #f0eaf1; }
.photo-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.raw-placeholder { width: 100%; height: 100%; display: grid; place-items: center; padding: 12px; text-align: center; color: var(--accent-strong); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.order-number { position: absolute; top: 8px; left: 8px; min-width: 34px; height: 34px; display: grid; place-items: center; padding: 0 8px; border-radius: 11px; color: white; background: rgba(73, 51, 78, 0.86); backdrop-filter: blur(8px); font-weight: 800; }
.delete-button { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 11px; color: #5d455f; background: rgba(255,255,255,.9); font-size: 21px; line-height: 1; }
.drag-handle { display: flex; justify-content: center; align-items: center; min-height: 34px; color: #9b879e; font-size: 20px; cursor: grab; user-select: none; }
.photo-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.move-button { min-height: 38px; color: var(--accent-strong); background: white; font-size: 20px; font-weight: 800; }
.move-button:first-child { border-right: 1px solid var(--line); }
.move-button:disabled { opacity: .28; cursor: default; }

.secondary-button { width: 100%; min-height: 48px; margin-top: 14px; border: 1px solid #d9c3dd; border-radius: 15px; color: var(--accent-strong); background: white; font-weight: 750; }

.submit-button { width: 100%; min-height: 58px; margin-top: 24px; border-radius: 17px; color: white; background: linear-gradient(135deg, #a871b2, #865391); box-shadow: 0 10px 23px rgba(128, 82, 139, 0.22); font-size: 18px; font-weight: 800; }
.submit-button:disabled { cursor: not-allowed; color: #a59da7; background: #e7e2e8; box-shadow: none; }

.error-box { margin-top: 16px; padding: 13px 15px; border-radius: 14px; color: #803741; background: #f9e8eb; line-height: 1.45; }
.progress-wrap { margin-top: 18px; }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.progress-track { height: 12px; overflow: hidden; border-radius: 999px; background: #e8e1e9; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b47bbd, #875393); transition: width .25s ease; }
.progress-wrap p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.privacy-note { margin: 17px 0 0; text-align: center; color: #8d818f; font-size: 13px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(38, 27, 40, 0.48); backdrop-filter: blur(7px); }
.modal[hidden] { display: none; }
.modal-card { width: min(100%, 430px); padding: 34px; border-radius: 25px; text-align: center; background: white; box-shadow: var(--shadow); }
.modal-card h2 { margin: 14px 0 8px; font-size: 25px; }
.modal-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.success-mark { width: 64px; height: 64px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%; color: white; background: #81ad8b; font-size: 33px; font-weight: 800; }

.examples-modal { z-index: 30; padding: clamp(12px, 3vw, 28px); }
.examples-dialog {
  width: min(100%, 1180px);
  max-height: min(92vh, 980px);
  overflow: auto;
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid rgba(132, 94, 140, 0.14);
  border-radius: 28px;
  background: #fffdfd;
  box-shadow: 0 28px 90px rgba(28, 18, 31, 0.28);
}
.examples-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.examples-heading .eyebrow { margin: 0; }
.examples-heading h2 { margin: 14px 0 7px; font-size: clamp(28px, 5vw, 40px); letter-spacing: -0.04em; }
.examples-heading p:last-child { margin: 0; color: var(--muted); line-height: 1.5; }
.examples-close { width: 44px; height: 44px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: white; font-size: 29px; line-height: 1; cursor: pointer; }
.examples-tabs { display: flex; gap: 9px; margin: 27px 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.examples-tab { min-height: 44px; padding: 0 17px; border: 1px solid transparent; border-radius: 14px; color: var(--muted); background: transparent; font-weight: 750; cursor: pointer; }
.examples-tab:hover { background: var(--surface-soft); }
.examples-tab.is-active { border-color: #e4d3e8; color: var(--accent-strong); background: var(--accent-soft); }
.examples-panel[hidden] { display: none; }
.examples-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.example-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: white; box-shadow: 0 8px 25px rgba(63, 42, 68, 0.06); }
.example-video { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; border: 0; background: #201923; }
.example-mobile-video { display: none; }
.example-copy { padding: 15px 17px 18px; }
.example-copy h3 { margin: 0; font-size: 17px; line-height: 1.4; }
.example-full-player { display: inline-flex; min-height: 42px; align-items: center; margin-top: 12px; padding: 0 14px; border: 1px solid #e4d3e8; border-radius: 12px; color: var(--accent-strong); background: var(--accent-soft); font-size: 14px; font-weight: 750; text-decoration: none; }
.example-full-player:hover { background: #e7d7eb; }
.examples-empty { min-height: 210px; display: grid; place-items: center; padding: 28px; border: 1px dashed #d9c3dd; border-radius: 20px; text-align: center; background: #fcf9fc; }
.examples-empty-inner { max-width: 460px; }
.examples-empty-icon { width: 54px; height: 54px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 17px; color: var(--accent-strong); background: var(--accent-soft); }
.examples-empty-icon svg { width: 26px; fill: currentColor; }
.examples-empty h3 { margin: 0 0 7px; font-size: 19px; }
.examples-empty p { margin: 0; color: var(--muted); line-height: 1.55; }

@media (max-width: 620px) {
  .brand-bar { min-height: 64px; }
  .brand-bar-inner { width: calc(100% - 28px); gap: 10px; }
  .brand { font-size: 19px; }
  .brand-icon { width: 38px; height: 38px; border-radius: 12px; }
  .examples-button { min-height: 42px; padding: 0 13px; gap: 7px; border-radius: 14px; font-size: 14px; }
  .examples-button svg { width: 18px; }
  .page-shell { width: min(100% - 22px, 740px); padding-top: 30px; }
  h1 { font-size: 31px; }
  .intro p { font-size: 16px; }
  .uploader-card { padding: 20px 15px; border-radius: 23px; }
  .name-field { height: 60px; }
  .choose-button { min-height: 124px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .selection-heading { align-items: center; }
  .selection-heading p { font-size: 14px; }
  .photo-actions { min-height: 44px; }
  .examples-dialog { max-height: 94vh; padding: 20px 16px; border-radius: 22px; }
  .examples-tabs { gap: 7px; overflow-x: auto; }
  .examples-tab { flex: 0 0 auto; padding: 0 13px; font-size: 14px; }
  .examples-grid { grid-template-columns: 1fr; gap: 13px; }
  .example-card { width: min(100%, 430px); margin: 0 auto; }
  .example-video { max-height: 68vh; }
  .example-mobile-video { display: block; width: 100%; max-height: 68vh; aspect-ratio: 9 / 16; border: 0; background: #201923; object-fit: contain; }
  .examples-empty { min-height: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
