/* Shared styles for the free tools in public/tools/ (resizer, plate blur). */
:root {
  --fg: #171717;
  --muted: #737373;
  --border: #d4d4d4;
  --divider: #e5e5e5;
  --surface: #f5f5f5;
  --accent: #16dfb1;
  --accent-dark: #1daf8d;
  --error: #b42318;
  --error-text: #7a271a;
  --error-bg: #fef3f2;
  --error-border: #fecdca;
  --warn-text: #93370d;
  --warn-bg: #fffaeb;
  --warn-border: #fedf89;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: #fff;
  color: var(--fg);
  font-family: "Inter Tight", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
[hidden] {
  display: none !important;
}
svg {
  flex: none;
}
input[type="range"] {
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: var(--fg);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.root {
  display: flex;
  flex-direction: column;
  height: 760px;
  padding: 16px;
}

/* Empty dropzone */
.dropzone {
  flex: 1;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 20px;
  border: 2px dashed var(--border);
  border-radius: 20px;
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.dropzone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  transition: background 0.15s;
}
.root.drag-over .dropzone {
  border: 2px solid var(--accent);
  background: #e8fcf7;
}
.root.drag-over .dropzone-icon {
  background: var(--accent);
}
.dropzone-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.dropzone-sub {
  margin-top: 6px;
  font-size: 15px;
  color: var(--muted);
}
.lock-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}

/* Pills */
.pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--fg);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.pill:hover {
  background: #000;
}
.pill-sm {
  height: 48px;
}
.pill-outline {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--fg);
}
.pill-outline:hover {
  border-color: var(--fg);
  background: #fff;
}
.pill-accent {
  background: var(--accent);
  color: var(--fg);
}
.pill-accent:hover {
  background: var(--accent-dark);
}

/* Workspace */
.workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.preview-col {
  flex: 1 1 460px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--error-border);
  border-radius: 12px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 14px;
  line-height: 1.4;
}
.banner-body {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.banner-title {
  font-weight: 600;
}
.icon-button {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: -4px -6px 0 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.icon-button:hover {
  background: #fee4e2;
}
.caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  font-size: 14px;
}
.caption-left {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}
.caption-left b {
  font-weight: 600;
  white-space: nowrap;
}
.caption-left span,
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.caption-left span {
  color: var(--muted);
}
.size-pill {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface);
}
.frame {
  position: relative;
  overflow: hidden;
  background: var(--fg);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.08);
  user-select: none;
}
.frame img {
  user-select: none;
  -webkit-user-drag: none;
}
.frame-blur {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
}
.frame-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.logo-handle {
  position: absolute;
  border-radius: 2px;
  outline: 1.5px solid transparent;
  outline-offset: 4px;
  cursor: grab;
  touch-action: none;
}
.logo-handle img {
  display: block;
  width: 100%;
  pointer-events: none;
}
.logo-handle:hover {
  outline: 1.5px dashed var(--accent);
}
.logo-handle.dragging {
  outline: 2px solid var(--accent);
  cursor: grabbing;
}
.logo-tip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--fg);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
}
.logo-handle:hover:not(.dragging) .logo-tip {
  display: flex;
}
.logo-tip.below {
  top: calc(100% + 12px);
  bottom: auto;
}
.logo-tip.align-left {
  left: 0;
  transform: none;
}
.logo-tip.align-right {
  left: auto;
  right: 0;
  transform: none;
}
.guide {
  position: absolute;
  pointer-events: none;
}
.guide-h {
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px dashed rgba(22, 223, 177, 0.7);
}
.guide-v {
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1px dashed rgba(22, 223, 177, 0.7);
}
.thumbs {
  flex: none;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px; /* room for the selected thumb's outline */
}
.thumb {
  flex: none;
  width: 68px;
  height: 50px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  outline: 2px solid transparent;
  outline-offset: 2px;
  background: var(--surface);
  opacity: 0.85;
}
.thumb.active {
  outline-color: var(--fg);
  opacity: 1;
}
.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1.5px dashed var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  opacity: 1;
}
.thumb-add:hover {
  border-color: var(--fg);
  color: var(--fg);
}

/* Controls panel */
.panel {
  flex: 1 1 320px;
  max-width: 380px;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}
.panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
  padding: 20px;
}
.section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
}
.section-title span {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.group-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.group-label + .group-label,
.list + .group-label {
  margin-top: 6px;
}
.list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.option {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--fg);
  text-align: left;
}
.option:hover {
  border-color: var(--fg);
}
.option[aria-pressed="true"] {
  border-color: var(--fg);
  background: var(--surface);
}
.market {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 12px;
}
.radio {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 1.5px solid #a3a3a3;
  border-radius: 50%;
}
.radio::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fg);
  opacity: 0;
}
.option[aria-pressed="true"] .radio {
  border-color: var(--fg);
}
.option[aria-pressed="true"] .radio::after {
  opacity: 1;
}
.market-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.market-dims {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.market-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.market-logos img {
  width: 20px;
  height: 20px;
  border-radius: 5px;
}
.social {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
}
.shape-box {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
.shape {
  border: 1.5px solid #a3a3a3;
  border-radius: 3px;
}
.option[aria-pressed="true"] .shape {
  border-color: var(--fg);
}
.social-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.social-label {
  font-size: 13px;
  font-weight: 600;
}
.social-dims {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.plain {
  padding: 11px 10px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.custom-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
}
.custom-box label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.px-input {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.px-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
}
.times {
  display: flex;
  align-items: center;
  height: 42px;
  color: var(--muted);
}
.note {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
.mode {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  padding: 12px;
}
.mode-diagram {
  position: relative;
  width: 44px;
  height: 32px;
  overflow: hidden;
  border-radius: 4px;
}
.mode-diagram span {
  position: absolute;
  border-radius: 2px;
}
.mode-title {
  font-size: 13px;
  font-weight: 600;
}
.mode-sub {
  margin-top: -6px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.add-logo {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: #fff;
  text-align: left;
}
.add-logo:hover {
  border-color: var(--fg);
  background: var(--surface);
}
.add-logo-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.strong {
  font-size: 14px;
  font-weight: 600;
}
.inline-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.4;
  color: var(--error);
}
.logo-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
}
.logo-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.checker {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 40px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: #fff;
  background-image:
    linear-gradient(
      45deg,
      #e5e5e5 25%,
      transparent 25%,
      transparent 75%,
      #e5e5e5 75%
    ),
    linear-gradient(
      45deg,
      #e5e5e5 25%,
      transparent 25%,
      transparent 75%,
      #e5e5e5 75%
    );
  background-position:
    0 0,
    5px 5px;
  background-size: 10px 10px;
}
.checker img {
  max-width: 100%;
  max-height: 100%;
}
.logo-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
}
.link-button {
  flex: none;
  padding: 6px;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
}
.trash {
  width: 32px;
  height: 32px;
  margin: 0;
}
.trash:hover {
  background: var(--divider);
}
.slider {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.slider-label b {
  font-weight: 500;
}
.slider-label span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.hint {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.warning {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--warn-border);
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 13px;
  line-height: 1.4;
}
.panel-footer {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--divider);
  background: #fff;
}
.footer-note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.progress {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 50px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.progress-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--accent);
  transition: width 0.2s;
}
.spinner {
  position: relative;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(23, 23, 23, 0.2);
  border-top-color: var(--fg);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.progress-text {
  position: relative;
}

/* Done */
.done {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding: 24px 20px 20px;
}
.check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
}
.done-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.done-text {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.done-text button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-weight: 600;
  text-decoration: underline;
}
.upsell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: 16px;
  background: var(--fg);
  color: #fff;
}
.before-after {
  display: flex;
  gap: 8px;
  height: 86px;
  overflow: hidden;
  border-radius: 10px;
}
.before-after figure {
  position: relative;
  flex: 1;
  margin: 0;
}
.before-after img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.before-after figcaption {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(23, 23, 23, 0.7);
  font-size: 11px;
  font-weight: 600;
}
.upsell-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.upsell-sub {
  margin-top: -6px;
  font-size: 14px;
  line-height: 1.45;
  color: #a3a3a3;
}
.start-over {
  margin-top: auto;
}

@media (max-width: 719px) {
  .root {
    height: auto;
    min-height: 100vh; /* fill the iframe, which has a fixed height */
  }
  .workspace {
    flex-wrap: wrap;
  }
  .preview-col {
    min-height: min(80vw, 460px);
  }
  .panel {
    max-width: none;
  }
}
