:root {
  --color-bg: #111316;
  --color-surface: #202328;
  --color-surface-strong: #2d3036;
  --color-primary: #5fd7e7;
  --color-primary-text: #10272c;
  --color-text: #ffffff;
  --color-muted: rgba(255, 255, 255, 0.68);
  --color-faint: rgba(255, 255, 255, 0.1);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.24);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

.studio,
.camera-app {
  min-height: 100vh;
}

.studio {
  display: grid;
  place-items: center;
  padding: var(--space-6);
}

.camera-app {
  display: grid;
  place-items: center;
  padding: var(--space-4);
}

.lens-screen,
.editor-shell,
.crop-shell {
  width: min(440px, 100%);
  min-height: min(900px, calc(100vh - 32px));
  display: grid;
  overflow: hidden;
  border-radius: 24px;
  background: #17191d;
  box-shadow: var(--shadow-soft);
}

.lens-screen,
.crop-shell {
  grid-template-rows: auto 1fr auto;
  padding: var(--space-5);
}

.web-entry {
  width: min(1120px, 100%);
  min-height: min(720px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 440px);
  align-items: center;
  gap: var(--space-10);
  padding: clamp(28px, 5vw, 64px);
  border-radius: 24px;
  background: #17191d;
  box-shadow: var(--shadow-soft);
}

.web-entry__copy {
  display: grid;
  gap: var(--space-5);
  align-content: center;
}

.product-mark {
  color: var(--color-primary);
  font-size: 0.95rem;
  font-weight: 900;
}

.web-entry h1 {
  max-width: 520px;
  margin: 0;
  color: var(--color-text);
  font-size: 3rem;
  line-height: 1.08;
}

.web-entry p {
  max-width: 430px;
  margin: 0;
  color: var(--color-muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.upload-drop {
  width: min(420px, 100%);
  min-height: 178px;
  display: grid;
  place-items: center;
  gap: var(--space-2);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  text-align: center;
}

.upload-drop strong {
  font-size: 1.15rem;
  font-weight: 900;
}

.upload-drop span,
.mobile-upload {
  color: var(--color-muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.sample-card {
  width: min(360px, 100%);
  justify-self: center;
  display: grid;
  place-items: center;
}

.lens-topbar,
.editor-topbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.lens-topbar span:first-child,
.editor-topbar strong {
  font-size: 1rem;
  font-weight: 900;
}

.lens-topbar span:last-child,
.editor-topbar span {
  color: var(--color-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.lens-preview,
.camera-preview {
  display: grid;
  place-items: center;
  padding: var(--space-8) 0;
}

.camera-preview {
  position: relative;
  min-height: 0;
  padding: 0;
  border-radius: 24px;
  background: #08090b;
  overflow: hidden;
}

.camera-preview video {
  width: 100%;
  height: 100%;
  min-height: 58vh;
  display: block;
  object-fit: cover;
}

.camera-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  gap: var(--space-2);
  padding: var(--space-6);
  background: #101216;
  text-align: center;
}

.camera-fallback strong {
  font-size: 1rem;
}

.camera-fallback span {
  max-width: 260px;
  color: var(--color-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.lens-ring {
  width: min(270px, 68vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 12px solid #2a2d33;
  border-radius: 50%;
  background: #08090b;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), 0 18px 70px rgba(0, 0, 0, 0.45);
}

.lens-ring span {
  width: 42%;
  aspect-ratio: 1;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: #14171b;
}

.lens-actions {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
}

.lens-actions p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}

.capture-button {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border: 7px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  cursor: pointer;
}

.capture-button span {
  width: 58px;
  height: 58px;
  display: block;
  border-radius: 50%;
  background: var(--color-primary);
}

.capture-button input,
.icon-button input,
.editor-tab-upload input,
.upload-drop input,
.mobile-upload input {
  width: 1px;
  height: 1px;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.editor-shell {
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: var(--space-4);
}

.editor-topbar {
  padding-bottom: var(--space-2);
}

.editor-topbar > div {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.icon-button.active {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.mobile-camera-actions {
  min-height: 100px;
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-2) var(--space-3);
}

.shutter-button {
  width: 82px;
  height: 82px;
  justify-self: center;
  border: 7px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
}

.mobile-upload {
  min-height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.crop-topbar {
  min-height: 48px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
}

.crop-topbar > div {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.crop-topbar strong {
  font-size: 1rem;
  font-weight: 900;
}

.crop-topbar span {
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.crop-preview {
  position: relative;
  width: min(340px, 78vw);
  aspect-ratio: var(--crop-aspect);
  place-self: center;
  overflow: hidden;
  border-radius: 24px;
  background: #08090b;
  box-shadow: var(--shadow-soft);
  touch-action: none;
  user-select: none;
}

.crop-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
}

.crop-frame {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 18px;
  box-shadow:
    0 0 0 999px rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(0, 0, 0, 0.32),
    inset 0 0 0 1px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  touch-action: none;
}

.crop-frame::before,
.crop-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.crop-frame::before {
  border-top: 1px solid rgba(255, 255, 255, 0.34);
  border-bottom: 1px solid rgba(255, 255, 255, 0.34);
  transform: scaleY(0.333);
}

.crop-frame::after {
  border-left: 1px solid rgba(255, 255, 255, 0.34);
  border-right: 1px solid rgba(255, 255, 255, 0.34);
  transform: scaleX(0.333);
}

.crop-frame.active {
  border-color: #ffffff;
  box-shadow:
    0 0 0 999px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(0, 0, 0, 0.32),
    0 0 20px rgba(255, 255, 255, 0.18);
}

.crop-frame button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  touch-action: none;
}

.crop-frame__drag {
  position: absolute;
  inset: 18px;
  z-index: 1;
  cursor: move;
}

.crop-handle,
.crop-corner {
  position: absolute;
  z-index: 3;
}

.crop-handle::after,
.crop-corner::after {
  content: "";
  position: absolute;
  background: #ffffff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.32);
}

.crop-handle--top,
.crop-handle--bottom {
  left: 26px;
  right: 26px;
  height: 28px;
  cursor: ns-resize;
}

.crop-handle--top {
  top: -14px;
}

.crop-handle--bottom {
  bottom: -14px;
}

.crop-handle--top::after,
.crop-handle--bottom::after {
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
}

.crop-handle--top::after {
  top: 13px;
}

.crop-handle--bottom::after {
  bottom: 13px;
}

.crop-handle--left,
.crop-handle--right {
  top: 26px;
  bottom: 26px;
  width: 28px;
  cursor: ew-resize;
}

.crop-handle--left {
  left: -14px;
}

.crop-handle--right {
  right: -14px;
}

.crop-handle--left::after,
.crop-handle--right::after {
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 999px;
}

.crop-handle--left::after {
  left: 13px;
}

.crop-handle--right::after {
  right: 13px;
}

.crop-corner {
  width: 42px;
  height: 42px;
}

.crop-corner::after {
  width: 22px;
  height: 22px;
  background: transparent;
  border: 3px solid #ffffff;
}

.crop-corner--top-left {
  top: -3px;
  left: -3px;
  cursor: nwse-resize;
}

.crop-corner--top-left::after {
  top: 0;
  left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 14px 0 0 0;
}

.crop-corner--top-right {
  top: -3px;
  right: -3px;
  cursor: nesw-resize;
}

.crop-corner--top-right::after {
  top: 0;
  right: 0;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 14px 0 0;
}

.crop-corner--bottom-right {
  right: -3px;
  bottom: -3px;
  cursor: nwse-resize;
}

.crop-corner--bottom-right::after {
  right: 0;
  bottom: 0;
  border-left: 0;
  border-top: 0;
  border-radius: 0 0 14px 0;
}

.crop-corner--bottom-left {
  left: -3px;
  bottom: -3px;
  cursor: nesw-resize;
}

.crop-corner--bottom-left::after {
  left: 0;
  bottom: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0 0 0 14px;
}

.card-stage {
  position: relative;
  width: min(340px, 82vw);
  display: grid;
  place-self: center;
  place-items: center;
  filter: drop-shadow(var(--shadow-soft));
}

.editor-shell.editing-tool .card-stage {
  width: min(255px, 68vw);
}

.editor-shell.editing-text .card-stage {
  width: min(170px, 46vw);
}

.editor-panel {
  display: grid;
  gap: 10px;
  padding-top: var(--space-3);
}

.mode-switch {
  width: min(260px, 100%);
  min-height: 34px;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  border-radius: 999px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.mode-switch button {
  min-width: 0;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}

.mode-switch button.active {
  background: rgba(255, 255, 255, 0.94);
  color: #15171a;
}

.edit-tray {
  min-height: 82px;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.edit-tray--text {
  min-height: 206px;
  align-items: start;
}

.filter-reel,
.type-reel {
  width: 100%;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 1px 2px 7px;
}

.filter-reel {
  cursor: grab;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  scrollbar-width: thin;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.filter-reel--dragging {
  cursor: grabbing;
  user-select: none;
}

.filter-reel::-webkit-scrollbar {
  height: 4px;
}

.filter-reel::-webkit-scrollbar-track {
  background: transparent;
}

.filter-reel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.type-reel {
  scrollbar-width: none;
}

.type-reel::-webkit-scrollbar {
  display: none;
}

.filter-reel button,
.type-reel button {
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.filter-reel button {
  width: 54px;
  flex: 0 0 54px;
  display: grid;
  justify-items: center;
  gap: 5px;
  scroll-snap-align: start;
}

.filter-reel button.active,
.type-reel button.active {
  color: var(--color-text);
}

.filter-reel button:disabled {
  cursor: wait;
  opacity: 0.58;
  pointer-events: none;
}

.filter-reel--dragging button {
  pointer-events: none;
}

.filter-reel__thumb {
  width: 48px;
  height: 58px;
  display: block;
  border: 2px solid transparent;
  border-radius: 10px;
  background-color: var(--color-surface);
  background-position: center;
  background-size: cover;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
  transition: border-color 160ms ease, transform 160ms ease;
}

.filter-reel button.active .filter-reel__thumb {
  border-color: #ffffff;
  transform: translateY(-2px);
}

.background-toggle {
  width: min(220px, 100%);
  min-height: 36px;
  justify-self: center;
  display: inline-grid;
  grid-template-columns: 38px auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 4px 12px 4px 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
  cursor: pointer;
}

.background-toggle span {
  width: 34px;
  height: 22px;
  position: relative;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.background-toggle span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 160ms ease;
}

.background-toggle span.active {
  background: var(--color-primary);
}

.background-toggle span.active::after {
  transform: translateX(12px);
}

.background-toggle strong,
.background-toggle em {
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
}

.background-toggle em {
  color: var(--color-muted);
}

.background-toggle:disabled {
  cursor: wait;
  opacity: 0.6;
}

.type-reel {
  gap: 16px;
}

.type-reel button {
  width: 58px;
  flex: 0 0 58px;
  display: grid;
  justify-items: center;
  gap: 7px;
}

.type-reel__orb {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--type-b);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
  color: #16181c;
  font-size: 0.82rem;
  font-weight: 950;
  overflow: hidden;
  transition: border-color 160ms ease, transform 160ms ease;
}

.type-reel__orb--none {
  font-size: 0.72rem;
}

.type-reel__orb img {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
}

.type-reel button.active .type-reel__orb {
  border-color: #ffffff;
  transform: translateY(-2px);
}

.editor-tabbar {
  min-height: 50px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: stretch;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 6px;
}

.editor-tabbar button,
.editor-tab-upload {
  min-width: 0;
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0 4px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
}

.editor-tabbar button.active {
  color: var(--color-text);
}

.editor-tabbar button.active::before {
  content: "";
  position: absolute;
  top: -7px;
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: var(--color-text);
}

.panel-header {
  min-height: 24px;
  display: grid;
  align-items: center;
}

.panel-header div {
  display: grid;
  gap: 3px;
}

.panel-header strong {
  font-size: 1rem;
  font-weight: 900;
}

.panel-header span {
  color: var(--color-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.text-card-form {
  display: grid;
  gap: 6px;
}

.text-card-form label {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.text-card-form span {
  color: var(--color-muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.text-card-form input,
.text-card-form textarea {
  width: 100%;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-surface-strong);
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 800;
  outline: none;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.text-card-form input {
  height: 34px;
  padding: 0 var(--space-4);
}

.text-card-form textarea {
  height: 44px;
  resize: none;
  padding: 8px var(--space-4);
  line-height: 1.35;
}

.text-card-form__inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: var(--space-2);
}

.text-card-form input::placeholder,
.text-card-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.text-card-form input:focus,
.text-card-form textarea:focus {
  background: #363a42;
  box-shadow: 0 0 0 3px rgba(95, 215, 231, 0.18);
}

.app-button {
  min-height: 48px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0 var(--space-6);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

.app-button:hover,
.app-button:focus-within {
  transform: translateY(-1px);
}

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

.app-button--primary {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.app-button--text {
  min-height: 42px;
  padding: 0 var(--space-4);
  background: var(--color-surface);
  color: var(--color-text);
}

.loading {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.filtering,
.preparing {
  position: absolute;
  left: 50%;
  bottom: -36px;
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: rgba(17, 19, 23, 0.86);
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 800;
  transform: translateX(-50%);
  white-space: nowrap;
}

.preparing {
  color: var(--color-primary);
}

.preparing-overlay {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: min(250px, calc(100% - 32px));
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: rgba(17, 19, 23, 0.88);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  color: var(--color-text);
  transform: translateX(-50%);
  z-index: 30;
}

.preparing-overlay > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 0.82rem;
  font-weight: 900;
}

.preparing-overlay strong {
  color: var(--color-primary);
  font-size: 0.82rem;
}

.preparing-progress {
  height: 5px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.preparing-progress span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--color-primary);
  transition: width 260ms ease;
}

@media (max-width: 520px) {
  .camera-app,
  .studio {
    padding: 0;
  }

  .lens-screen,
  .editor-shell,
  .crop-shell {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
  }

  .card-stage {
    width: min(310px, 82vw);
  }
}

@media (min-width: 900px) {
  .lens-screen {
    min-height: min(760px, calc(100vh - 64px));
  }

  .editor-shell {
    width: min(860px, calc(100vw - 64px));
    min-height: min(720px, calc(100vh - 64px));
    grid-template-columns: minmax(360px, 1fr) 340px;
    grid-template-rows: auto 1fr;
    column-gap: var(--space-6);
  }

  .editor-topbar {
    grid-column: 1 / -1;
  }

  .card-stage {
    width: min(390px, 100%);
  }

  .editor-shell.editing-tool .card-stage {
    width: min(300px, 100%);
  }

  .editor-shell.editing-text .card-stage {
    width: min(260px, 100%);
  }

  .editor-panel {
    align-self: end;
  }
}

@media (max-width: 860px) {
  .web-entry {
    min-height: 100vh;
    grid-template-columns: 1fr;
    align-content: start;
    border-radius: 0;
    gap: var(--space-8);
  }

  .web-entry h1 {
    font-size: 2.25rem;
  }

  .sample-card {
    width: min(300px, 78vw);
  }
}

/* PokeShot capture studio redesign */
:root {
  --color-bg: #07080a;
  --color-surface: #17191d;
  --color-surface-strong: #24272d;
  --color-primary: #ffffff;
  --color-primary-text: #090a0c;
  --color-accent: #f2555a;
  --color-accent-soft: rgba(242, 85, 90, 0.16);
  --color-text: #f7f8fa;
  --color-muted: rgba(247, 248, 250, 0.66);
  --color-faint: rgba(247, 248, 250, 0.11);
  --shadow-soft: 0 22px 70px rgba(0, 0, 0, 0.42);
  --shadow-panel: 0 -18px 48px rgba(0, 0, 0, 0.42);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 24px;
  --motion-fast: 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

html {
  background: var(--color-bg);
}

body {
  background: #0d0f12;
  color: var(--color-text);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button:focus-visible,
label:focus-within,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.86);
  outline-offset: 3px;
}

.studio,
.camera-app {
  min-height: 100vh;
  background: #0d0f12;
}

.studio {
  padding: clamp(18px, 3vw, 36px);
}

.camera-app {
  padding: clamp(12px, 2vw, 22px);
}

.lens-screen,
.editor-shell,
.crop-shell {
  isolation: isolate;
  width: min(444px, 100%);
  min-height: min(920px, calc(100vh - 24px));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  background: #07080a;
  box-shadow: var(--shadow-soft);
}

.lens-screen,
.crop-shell {
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
}

.web-entry {
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 48px));
  grid-template-columns: minmax(300px, 0.94fr) minmax(300px, 430px);
  gap: clamp(34px, 6vw, 82px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  background: #101216;
  box-shadow: var(--shadow-soft);
}

.web-entry__copy {
  gap: 18px;
}

.product-mark {
  width: max-content;
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 900;
}

.web-entry h1 {
  max-width: 520px;
  font-size: clamp(2.35rem, 5vw, 4.35rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.web-entry p {
  max-width: 420px;
  color: var(--color-muted);
  font-size: 1rem;
}

.upload-drop {
  width: min(360px, 100%);
  min-height: 58px;
  display: inline-grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  justify-items: start;
  gap: 4px 14px;
  border: 0;
  border-radius: 999px;
  padding: 10px 12px 10px 20px;
  background: var(--color-primary);
  color: var(--color-primary-text);
  text-align: left;
  transition: transform var(--motion-fast), background var(--motion-fast);
}

.upload-drop::after {
  content: "+";
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-primary-text);
  color: var(--color-primary);
  font-size: 1.35rem;
  font-weight: 900;
}

.upload-drop:hover {
  transform: translateY(-1px);
}

.upload-drop strong {
  grid-column: 1;
  font-size: 1rem;
}

.upload-drop span {
  grid-column: 1;
  color: rgba(9, 10, 12, 0.6);
  font-size: 0.78rem;
}

.sample-card {
  position: relative;
  width: min(358px, 100%);
  min-height: 520px;
  align-content: center;
}

.sample-card::before {
  content: "";
  position: absolute;
  inset: 12px 26px 22px;
  border-radius: 34px;
  background: #07080a;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.46);
  z-index: -1;
}

.lens-topbar,
.editor-topbar,
.crop-topbar {
  position: relative;
  z-index: 20;
}

.lens-topbar {
  min-height: 46px;
  padding: 0 2px;
}

.lens-topbar span:first-child,
.editor-topbar strong,
.crop-topbar strong {
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 900;
}

.lens-topbar span:last-child,
.editor-topbar span,
.crop-topbar span {
  color: var(--color-muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
  font-size: 1.05rem;
  transition: background var(--motion-fast), transform var(--motion-fast), opacity var(--motion-fast);
}

.icon-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.icon-button.active {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.camera-preview {
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background: #000000;
}

.camera-preview video {
  min-height: 0;
  height: 100%;
}

.camera-fallback {
  background: #101216;
}

.mobile-camera-actions {
  min-height: 110px;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  padding: 12px 4px 4px;
}

.shutter-button {
  width: 82px;
  height: 82px;
  border: 7px solid rgba(255, 255, 255, 0.92);
  background: transparent;
  box-shadow: inset 0 0 0 4px #07080a;
  transition: opacity var(--motion-fast), transform var(--motion-fast);
}

.shutter-button:active:not(:disabled) {
  transform: scale(0.96);
}

.shutter-button:disabled {
  cursor: not-allowed;
  opacity: 0.34;
}

.mobile-upload {
  min-height: 42px;
  width: max-content;
  justify-self: center;
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--color-text);
}

.mobile-upload--fallback {
  min-height: 48px;
  padding: 0 24px;
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.crop-shell {
  background: #07080a;
}

.crop-topbar {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  min-height: 48px;
}

.crop-preview {
  width: min(390px, calc(100vw - 44px));
  max-height: calc(100vh - 216px);
  border-radius: 26px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
}

.crop-frame {
  border-radius: 20px;
}

.crop-controls {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 14px 16px 16px;
  background: rgba(23, 25, 29, 0.96);
}

.crop-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.crop-control-row strong {
  color: var(--color-text);
  font-size: 0.8rem;
}

.crop-zoom {
  width: 100%;
  accent-color: var(--color-primary);
}

.editor-shell {
  position: relative;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 14px;
  overflow: hidden;
  background: #07080a;
}

.editor-topbar {
  min-height: 50px;
  padding: 0 0 6px;
}

.editor-topbar__title {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.editor-topbar__title strong,
.editor-topbar__title span {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-stage {
  width: min(328px, calc(100vw - 98px));
  min-height: 0;
  place-self: center;
  align-self: center;
  transform: translateX(-18px);
  transition: width var(--motion-fast), transform var(--motion-fast);
}

.editor-shell.editing-tool .card-stage,
.editor-shell.editing-text .card-stage {
  width: min(302px, calc(100vw - 118px));
}

.editor-panel {
  position: relative;
  z-index: 10;
  gap: 12px;
  margin: 0 -4px -4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 12px 12px 14px;
  background: rgba(18, 20, 24, 0.98);
  box-shadow: var(--shadow-panel);
}

.mode-switch {
  width: 100%;
  min-height: 40px;
  border-radius: 14px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.mode-switch button {
  min-height: 34px;
  border-radius: 11px;
  color: var(--color-muted);
  font-size: 0.82rem;
}

.mode-switch button.active {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.filter-reel {
  gap: 13px;
  margin: 0 -12px;
  padding: 0 12px 8px;
  scrollbar-width: none;
}

.filter-reel::-webkit-scrollbar {
  display: none;
}

.filter-reel button {
  width: 62px;
  flex-basis: 62px;
  gap: 7px;
  color: rgba(247, 248, 250, 0.58);
  font-size: 0.72rem;
}

.filter-reel__thumb {
  width: 56px;
  height: 70px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: none;
}

.filter-reel button.active .filter-reel__thumb {
  border-color: var(--color-primary);
  transform: none;
}

.filter-reel button.active {
  color: var(--color-text);
}

.editor-tabbar {
  position: absolute;
  top: 82px;
  right: 12px;
  z-index: 30;
  min-height: 0;
  width: 56px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 0;
  padding: 0;
  pointer-events: auto;
}

.editor-tabbar button,
.editor-tab-upload {
  width: 56px;
  min-height: 62px;
  display: grid;
  grid-template-rows: 40px auto;
  justify-items: center;
  gap: 4px;
  border: 0;
  border-radius: 16px;
  padding: 4px 2px 5px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  transition: background var(--motion-fast), transform var(--motion-fast);
}

.editor-tabbar button.active,
.editor-tab-upload:active {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.editor-tabbar button.active::before {
  display: none;
}

.tool-glyph {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 950;
}

.tool-label {
  display: block;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-tray {
  min-height: 88px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}

.edit-tray--text {
  min-height: 228px;
}

.panel-header {
  min-height: 22px;
}

.panel-header strong {
  font-size: 0.95rem;
}

.text-card-form {
  gap: 8px;
}

.text-card-form input,
.text-card-form textarea {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.text-card-form input {
  height: 42px;
}

.text-card-form textarea {
  height: 58px;
}

.type-reel {
  gap: 14px;
  margin: 0 -12px;
  padding: 2px 12px 4px;
}

.type-reel button {
  width: 60px;
  flex-basis: 60px;
}

.type-reel__orb {
  width: 52px;
  height: 52px;
  box-shadow: none;
}

.type-reel button.active .type-reel__orb {
  border-color: var(--color-primary);
}

.app-button {
  border-radius: 999px;
}

.app-button--text {
  min-height: 42px;
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.filtering,
.preparing-overlay {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 20, 24, 0.92);
}

.preparing-progress span {
  background: var(--color-primary);
}

@media (max-width: 520px) {
  .studio,
  .camera-app {
    padding: 0;
  }

  .lens-screen,
  .editor-shell,
  .crop-shell {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .lens-screen,
  .crop-shell {
    padding: max(12px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  }

  .editor-shell {
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .card-stage {
    width: min(304px, calc(100vw - 96px));
    transform: translateX(-17px);
  }

  .editor-shell.editing-tool .card-stage,
  .editor-shell.editing-text .card-stage {
    width: min(278px, calc(100vw - 112px));
  }

  .editor-tabbar {
    top: 76px;
    right: 10px;
  }

  .editor-tabbar button,
  .editor-tab-upload {
    width: 52px;
    min-height: 58px;
    border-radius: 14px;
  }

  .tool-glyph {
    width: 36px;
    height: 36px;
  }

  .editor-panel {
    border-radius: 22px 22px 0 0;
    margin-right: -12px;
    margin-bottom: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    padding-left: 12px;
  }

  .crop-preview {
    width: min(370px, calc(100vw - 28px));
    max-height: calc(100dvh - 210px);
  }
}

@media (min-width: 900px) {
  .camera-app {
    place-items: center;
  }

  .lens-screen,
  .crop-shell,
  .editor-shell {
    width: min(444px, calc(100vw - 48px));
    min-height: min(920px, calc(100vh - 32px));
  }

  .editor-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    column-gap: 0;
  }

  .editor-topbar,
  .card-stage,
  .editor-panel {
    grid-column: auto;
  }

  .card-stage {
    width: min(328px, calc(100% - 98px));
  }

  .editor-shell.editing-tool .card-stage,
  .editor-shell.editing-text .card-stage {
    width: min(302px, calc(100% - 118px));
  }
}

@media (max-width: 860px) {
  .web-entry {
    min-height: 100dvh;
    gap: 28px;
    border: 0;
    border-radius: 0;
    padding: 28px 20px;
  }

  .web-entry h1 {
    font-size: clamp(2.35rem, 12vw, 3.4rem);
  }

  .sample-card {
    width: min(310px, 76vw);
    min-height: 440px;
  }
}

.web-entry {
  width: min(420px, calc(100vw - 28px));
  min-height: min(900px, calc(100dvh - 28px));
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  padding: 16px;
  background: #090a0c;
  box-shadow: var(--shadow-soft);
}

.web-entry__phone-top {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 900;
}

.web-entry__phone-top span:last-child {
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.web-entry__copy {
  align-content: end;
  gap: 12px;
  padding-bottom: 2px;
}

.product-mark {
  display: none;
}

.web-entry h1 {
  max-width: 310px;
  font-size: 2.05rem;
  line-height: 1.12;
}

.web-entry p {
  max-width: 310px;
  font-size: 0.94rem;
  line-height: 1.45;
}

.upload-drop {
  width: 100%;
  min-height: 58px;
}

.sample-card {
  width: min(292px, 76vw);
  min-height: 0;
  align-self: center;
  justify-self: center;
}

.sample-card::before {
  inset: 10px 20px 18px;
}

.preparing-overlay {
  width: min(278px, calc(100% - 28px));
  gap: 12px;
  padding: 14px;
  background: rgba(13, 15, 18, 0.94);
}

.preparing-preview {
  height: 78px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.preparing-preview span {
  display: block;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  transform-origin: bottom;
  animation: preparing-card-pulse 1.35s ease-in-out infinite;
}

.preparing-preview span:nth-child(2) {
  animation-delay: 0.16s;
}

.preparing-preview span:nth-child(3) {
  animation-delay: 0.32s;
}

.filtering {
  bottom: -44px;
}

@keyframes preparing-card-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scaleY(0.72);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@media (min-width: 900px) {
  .web-entry {
    width: min(420px, calc(100vw - 48px));
    min-height: min(900px, calc(100vh - 32px));
  }
}

@media (max-width: 520px) {
  .web-entry {
    width: 100%;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    padding: max(14px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  }

  .web-entry h1 {
    font-size: 2rem;
  }

  .sample-card {
    width: min(274px, 76vw);
  }
}

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

/* Final mobile-app entry pass */
.studio {
  background: #1a1e25;
}

.web-entry {
  width: min(430px, calc(100vw - 32px));
  min-height: min(880px, calc(100dvh - 32px));
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 30px;
  padding: 20px;
  background: #f4f6f8;
  color: #111318;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.web-entry__phone-top {
  min-height: 36px;
  color: #111318;
  font-size: 0.98rem;
}

.web-entry__phone-top span:last-child {
  color: #717680;
  font-size: 0.82rem;
}

.web-entry .sample-card {
  width: min(274px, 70vw);
  align-self: center;
}

.web-entry .sample-card::before {
  opacity: 0.2;
}

.web-entry__copy {
  gap: 10px;
  align-content: end;
  padding-bottom: 0;
}

.web-entry h1 {
  max-width: 100%;
  color: #111318;
  font-size: 2.05rem;
  line-height: 1.14;
}

.web-entry p {
  max-width: 100%;
  color: #6d737c;
  font-size: 0.98rem;
  line-height: 1.5;
}

.web-entry .entry-notice {
  color: #8b3a2e;
}

.web-entry .upload-drop {
  min-height: 64px;
  border-radius: 22px;
  padding: 12px 12px 12px 20px;
  background: #111318;
  color: #ffffff;
}

.web-entry .upload-drop::after {
  width: 42px;
  height: 42px;
  background: #ffffff;
  color: #111318;
}

.web-entry .upload-drop strong {
  font-size: 1.03rem;
}

.web-entry .upload-drop span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
}

.card-stage--processing .card {
  filter: saturate(1.04);
}

.card-stage--processing .preparing-overlay,
.card-stage--processing .filtering {
  pointer-events: none;
}

.card-stage--processing .preparing-overlay {
  bottom: 14px;
  width: min(286px, calc(100% - 28px));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 13px 14px;
  background: rgba(12, 14, 18, 0.9);
}

.card-stage--processing .preparing-overlay > div {
  min-height: 20px;
}

.card-stage--processing .filtering {
  bottom: -42px;
}

@media (max-width: 520px) {
  .studio {
    padding: 0;
  }

  .web-entry {
    width: 100%;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    padding: max(16px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  }

  .web-entry h1 {
    font-size: 1.95rem;
  }
}
