/*
  SHOW ME HOW IT LOOKS — V1.4
  Clean consolidated stylesheet.
*/

:root {
  --page-bg: #f6f7f9;
  --page-bg-soft: #fbfbfc;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --text: #111827;
  --text-soft: #303846;
  --muted: #5f6673;
  --muted-light: #7b8493;
  --accent: #407af7;
  --accent-dark: #2563eb;
  --accent-soft: #e8f1ff;
  --border: #dfe4ec;
  --border-strong: #cbd3df;
  --frame: #000000;
  --checker-a: #f8fafc;
  --checker-b: #eef2f7;
  --danger: #b42318;
  --success: #1a7f37;
  --shadow-soft: 0 18px 45px rgb(17 24 39 / 12%);
  --shadow-card: 0 24px 70px rgb(17 24 39 / 14%);
  --frame-aspect-ratio: 16 / 9;
  --frame-ratio-decimal: 1.7777778;
  --fill-overscan-x: 0px;
  --fill-overscan-y: 0px;
  --actual-overscan-x: 0px;
  --actual-overscan-y: 0px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 18% 12%, #ffffff 0, #ffffff 15%, var(--page-bg) 36%, var(--page-bg) 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}

a { color: inherit; }
button,
input,
select { font-family: inherit; }
button { cursor: pointer; }

/* Header */
.site-header {
  width: min(1640px, calc(100% - 96px));
  margin: 0 auto;
  padding: 24px 0 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 34px;
}

.brand-block,
.brand-row,
.brand-credit,
.version-badge,
h1 { display: none; }

.top-nav {
  display: flex;
  align-items: center;
  gap: 42px;
  padding-top: 2px;
}

.top-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
}

.top-nav a:hover { color: var(--accent); }

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.support-copy {
  max-width: none;
  margin-right: -4px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 600;
}

.support-button-wrap {
  display: flex;
  align-items: center;
  min-height: 34px;
  transform: scale(0.75);
  transform-origin: left center;
  margin-right: -74px;
}

.support-button-wrap a,
.support-button-wrap button {
  white-space: nowrap;
}


.utility-icon {
  width: 44px;
  height: 44px;
  margin-top: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 22px;
  box-shadow: var(--shadow-soft);
}


.mobile-desktop-notice {
  display: none;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 550;
  box-shadow: var(--shadow-soft);
}

.mobile-desktop-notice strong {
  color: var(--text);
  font-weight: 850;
}

/* Page / hero */
main {
  width: min(1580px, calc(100% - 120px));
  margin: 0 auto;
  padding: 12px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(540px, 0.95fr) minmax(560px, 1.05fr);
  gap: clamp(54px, 7vw, 112px);
  align-items: center;
}

.hero-copy {
  display: block;
  padding-left: 52px;
}

.hero-title {
  margin: 0 0 22px !important;
  max-width: 760px;
  color: var(--accent);
  font-size: clamp(72px, 7.2vw, 138px);
  line-height: 0.82;
  letter-spacing: -0.07em;
  text-transform: uppercase;
  font-weight: 850;
}

.hero-title .hero-title-line { display: block; }

.hero-copy h2 {
  margin: 0;
  max-width: 700px;
  color: #111827;
  font-size: clamp(24px, 2vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.035em;
  font-weight: 650;
}

.hero-copy > p:not(.hero-title) {
  max-width: 720px;
  margin: 6px 0 0;
  color: #6b7280;
  font-size: clamp(18px, 1.35vw, 24px);
  line-height: 1.4;
  letter-spacing: -0.025em;
  font-weight: 500;
}

.hero-actions {
  display: grid;
  gap: 18px;
}

/* Cards / upload / controls */
.upload-card,
.control-card,
.summary-card,
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.upload-card {
  border-radius: 24px;
  padding: 20px;
  min-height: 0;
}

.upload-dropzone {
  min-height: 132px;
  border: 1px dashed var(--border-strong);
  border-radius: 20px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  cursor: pointer;
  padding: 24px 30px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-drag-over {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 0 10px;
  border: 2px solid #bcd5ff;
  border-radius: 50%;
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
  font-weight: 400;
}

.upload-title {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.upload-copy {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.18;
  font-weight: 500;
}

.upload-copy + .upload-copy { margin-top: 2px; }
input[type="file"] { display: none; }

.paste-hint {
  margin: 6px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
}

.control-card {
  border-radius: 20px;
  padding: 20px 24px 22px;
}

.frame-control-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 20px minmax(180px, 1fr);
  gap: 18px;
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.ratio-label {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1;
  font-weight: 750;
}

.unit-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.unit-input input {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  font-weight: 650;
}

.unit-input span {
  display: grid;
  place-items: center;
  border-left: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field select {
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 15px;
  background: var(--surface);
  color: var(--text);
  font-size: 17px;
  line-height: 1;
  font-weight: 650;
}

.field input:focus,
.field select:focus,
.unit-input:focus-within {
  outline: 3px solid #dbeafe;
  border-color: var(--accent);
}

.dimension-symbol {
  height: 50px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 20px;
  font-weight: 600;
}

.ratio-selector-row {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.ratio-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 0;
}

.ratio-chip {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ratio-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ratio-chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.ratio-icon {
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  flex: 0 0 auto;
}

.ratio-icon-16-9 { width: 24px; height: 13.5px; }
.ratio-icon-9-16 { width: 13.5px; height: 24px; }
.ratio-icon-1-1 { width: 18px; height: 18px; }
.ratio-icon-freeform { width: 22px; height: 16px; border-style: dashed; }

.ratio-mode-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
}


/* Media position controls */
.position-controls {
  display: none;
  width: min(920px, 100%);
  margin: 28px auto 6px;
  padding: 20px 24px 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

body.has-shiftable-media .position-controls {
  display: grid;
  gap: 18px;
}

.position-controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.position-controls-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.position-controls-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
}

.position-reset-button {
  min-height: 42px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.position-slider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.position-slider {
  display: grid;
  gap: 8px;
}

.position-slider span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1;
  font-weight: 750;
}

.position-slider strong {
  color: var(--accent);
  font-weight: 850;
}

.position-slider input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}


.preview-scale-note {
  display: none;
  max-width: 980px;
  margin: 18px auto 0;
  padding: 0 24px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
}

body.has-image .preview-scale-note,
body.has-video .preview-scale-note {
  display: block;
}

/* Metadata */
.meta {
  margin: 12px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.meta strong { color: var(--text); }

.preview-media-meta,
#mediaMeta.preview-media-meta,
#mediaMeta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 6px 10px;
  max-width: 1180px;
  margin: 26px auto 12px;
  padding: 0 24px;
  overflow: visible;
  color: #6b7280;
  text-align: center;
  white-space: normal;
  font-size: clamp(18px, 1.35vw, 24px);
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.preview-media-meta strong,
#mediaMeta.preview-media-meta strong,
#mediaMeta strong {
  color: #111827;
  font-weight: 750;
}

.media-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.media-meta-name {
  display: inline;
  white-space: normal;
  overflow-wrap: anywhere;
}

.media-meta-separator {
  color: #9ca3af;
  white-space: nowrap;
}

#mediaMeta:empty,
#previewFrameMeta:empty { display: none; }

.preview-frame-meta,
#previewFrameMeta,
.frame-caption,
.frame-caption-target { display: none !important; }

/* Preview cards */
.preview-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
  margin-top: 34px;
  background: transparent;
}

.preview-card {
  position: relative;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* Uploaded-state preview dividers */
body.has-image .preview-card:not(:first-child),
body.has-video .preview-card:not(:first-child) {
  border-left: 1px solid var(--border);
  padding-left: 28px;
}

body.has-image .preview-strip,
body.has-video .preview-strip {
  gap: 28px;
}

.preview-card > h2 {
  position: relative;
  z-index: 20;
  display: block;
  width: 100%;
  margin: 18px 0 24px;
  color: #1f2937;
  font-size: clamp(30px, 2.45vw, 46px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0;
  text-align: center;
  background: transparent;
}

.stage-wrap {
  overflow: hidden;
  padding: 44px 78px 44px;
  margin: 0;
}

.preview-shell {
  position: relative;
  overflow: visible;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  background: var(--surface);
  isolation: isolate;
}

#fitShell,
#fillShell,
#actualShell {
  margin-left: auto;
  margin-right: auto;
}

.preview-shell.crop-shadow {
  background: #f4f5f7;
  border-radius: 0;
}

.frame-window {
  position: absolute;
  inset: auto;
  overflow: hidden;
  background: #000000;
  border: 1px solid #9ca3af;
  border-radius: 0;
  z-index: 10;
  box-shadow: none;
}

.frame-window.is-draggable {
  cursor: grab;
  touch-action: none;
}

.frame-window.is-dragging {
  cursor: grabbing;
}

.shift-toast {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 30;
  transform: translate(-50%, -50%);
  max-width: min(260px, calc(100% - 28px));
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.88);
  color: #ffffff;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.shift-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.02);
}

.media-el {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  max-height: none;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  user-select: none;
  pointer-events: none;
}

body.has-image .image-only,
body.has-video .video-only { display: block; }

body.has-video img.image-only,
body.has-video .image-only { display: none !important; }

.fit-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dimmed-media {
  z-index: 1;
  filter: saturate(0.85) brightness(0.78);
}

.preview-shell.crop-shadow > .dimmed-media {
  display: block;
  opacity: 0.28;
  filter: saturate(0.85) brightness(0.78);
  z-index: 1;
}

.preview-shell.crop-shadow .frame-window .media-el {
  opacity: 1;
  filter: none;
}

.preview-shell.crop-shadow.no-overflow > .dimmed-media,
.preview-shell.no-overflow > .dimmed-media { display: none !important; }

.preview-shell.crop-shadow::after { display: none !important; }

img.media-el:not([src]),
img.media-el[src=""],
img.dimmed-media:not([src]),
img.dimmed-media[src=""],
body.has-video .preview-shell.crop-shadow > img.dimmed-media {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

body.has-image .preview-shell.crop-shadow > img.dimmed-media[src]:not([src=""]) {
  display: block !important;
  visibility: visible !important;
  opacity: 0.28 !important;
}

.empty {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  background: repeating-linear-gradient(135deg, var(--checker-a) 0, var(--checker-a) 13px, var(--checker-b) 13px, var(--checker-b) 26px);
}

.empty:hover { color: var(--accent); }
body.has-image .empty,
body.has-video .empty { display: none; }

.details,
#fitDetails,
#fillDetails,
#actualDetails {
  display: none;
}

body.has-image #fitDetails,
body.has-image #fillDetails,
body.has-image #actualDetails,
body.has-video #fitDetails,
body.has-video #fillDetails,
body.has-video #actualDetails {
  display: flex;
  visibility: visible;
  position: relative;
  left: auto;
  top: auto;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  padding: 14px 18px 0;
  margin: 0;
  border: 0;
  overflow: visible;
  white-space: normal;
  pointer-events: auto;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
  text-align: left;
  flex-direction: column;
  gap: 5px;
}

.preview-card .details strong,
body.has-image #fitDetails strong,
body.has-image #fillDetails strong,
body.has-image #actualDetails strong,
body.has-video #fitDetails strong,
body.has-video #fillDetails strong,
body.has-video #actualDetails strong {
  color: #111827;
  font-weight: 800;
}

body:not(.has-image):not(.has-video) .stage-wrap {
  padding: 0;
  margin: 0;
  overflow: hidden;
}

body:not(.has-image):not(.has-video) .preview-shell {
  width: 100%;
  max-width: min(100%, 720px);
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
}

body:not(.has-image):not(.has-video) .preview-shell .frame-window {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  left: 0;
  top: 0;
}

/* Video controls / export */
.video-controls {
  display: none;
  width: min(720px, 100%);
  margin: 26px auto 4px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

body.has-video .video-controls { display: flex; }

.video-controls button {
  min-width: 96px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
}

.video-controls input[type="range"] {
  flex: 1;
  min-width: 160px;
  accent-color: var(--accent);
}

.video-time {
  min-width: 100px;
  color: var(--text-soft);
  font-size: 13px;
  text-align: right;
  font-weight: 700;
}

.export-row {
  display: grid;
  place-items: center;
  margin: 28px 0 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 30px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 20px 44px rgb(64 122 247 / 28%);
  font-size: 18px;
  font-weight: 750;
  text-decoration: none;
}

.button:hover { background: var(--accent-dark); }

.button.secondary {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
  box-shadow: none;
  font-size: 14px;
}

.button:disabled {
  background: #407AF7;
  color: #ffffff;
  cursor: not-allowed;
  box-shadow: none;
}

/* Info cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  width: min(760px, 100%);
  margin: 22px auto 0;
}

.summary-card {
  min-height: 88px;
  border-radius: 18px;
  padding: 17px 18px;
  color: inherit;
  text-decoration: none;
  display: grid;
  grid-template-columns: 48px 1fr 18px;
  align-items: center;
  gap: 16px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.summary-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 21px;
  font-weight: 800;
}

.summary-card strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.summary-card em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25;
  font-style: normal;
  font-weight: 500;
}

.summary-card b {
  color: var(--text-soft);
  font-size: 32px;
  font-weight: 450;
}

.info-stack {
  display: grid;
  gap: 18px;
  width: min(1060px, 100%);
  margin: 30px auto 0;
}

.info-card {
  scroll-margin-top: 32px;
  border-radius: 20px;
  padding: 26px 30px;
}

.info-card h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.info-card p,
.info-card li {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 500;
}

.info-card p { margin: 10px 0 0; }

.info-card details {
  padding: 13px 0;
  border-top: 1px solid var(--border);
}

.info-card details:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.info-card summary {
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
}

.info-card ul {
  margin: 0;
  padding-left: 20px;
}

.info-card li + li { margin-top: 8px; }



/* Feedback / report a bug page */
.feedback-main {
  width: min(960px, calc(100% - 120px));
  margin: 0 auto;
  padding: 44px 0 64px;
}

.feedback-hero {
  margin-bottom: 22px;
}

.feedback-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feedback-hero h1 {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.065em;
  font-weight: 850;
}

.feedback-hero p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.35vw, 22px);
  line-height: 1.42;
  letter-spacing: -0.025em;
  font-weight: 500;
}

.feedback-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.feedback-form {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field.full-span {
  grid-column: 1 / -1;
}

.form-field span {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1;
  font-weight: 750;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  font-weight: 550;
}

.form-field input,
.form-field select {
  min-height: 50px;
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 3px solid #dbeafe;
  border-color: var(--accent);
}

.form-helper {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.form-actions .button {
  min-width: 180px;
}

.back-link {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
}

.back-link:hover {
  color: var(--accent);
}

.form-hidden {
  display: none;
}

.feedback-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
}

body.dark-mode .feedback-card,
body.dark-mode .form-field input,
body.dark-mode .form-field select,
body.dark-mode .form-field textarea {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

body.dark-mode .feedback-hero h1,
body.dark-mode .form-field span { color: var(--text); }
body.dark-mode .feedback-hero p,
body.dark-mode .form-helper,
body.dark-mode .feedback-note,
body.dark-mode .back-link { color: var(--muted); }

@media (max-width: 900px) {
  .feedback-main {
    width: min(100% - 48px, 960px);
    padding-top: 28px;
  }

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

@media (max-width: 640px) {
  .feedback-main {
    width: min(100% - 32px, 960px);
  }

  .feedback-card {
    padding: 20px;
  }

  .form-actions .button {
    width: 100%;
  }
}

/* Footer */
.site-footer {
  width: min(1580px, calc(100% - 120px));
  margin: 34px auto 0;
  padding: 0 0 42px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
}

.footer-meta {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-meta span { margin-left: 10px; }

.footer-logo {
  width: min(180px, 32vw);
  height: auto;
  display: block;
}

/* Modal */
.warning { color: var(--danger); font-weight: 800; }
.success { color: var(--success); font-weight: 800; }
.is-hidden { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #111827;
  z-index: 9999;
}

.modal.show { display: flex; }

.dialog {
  width: min(540px, 100%);
  padding: 24px;
  border-radius: 22px;
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow-card);
}

.dialog h2 {
  margin: 0 0 10px;
  color: var(--danger);
  font-size: 22px;
  line-height: 1.2;
}

.dialog p {
  margin: 0 0 14px;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.45;
}

.dialog button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 750;
}

/* Dark mode */
body.dark-mode {
  --page-bg: #05070b;
  --page-bg-soft: #0b0f17;
  --surface: #111827;
  --surface-soft: #1f2937;
  --text: #f9fafb;
  --text-soft: #e5e7eb;
  --muted: #9ca3af;
  --muted-light: #9ca3af;
  --border: #374151;
  --border-strong: #4b5563;
  --frame: #000000;
  --checker-a: #111827;
  --checker-b: #1f2937;
  --accent-soft: #1d355f;
  color: var(--text);
  background: #05070b;
}

body.dark-mode .site-header,
body.dark-mode main,
body.dark-mode .site-footer { color: var(--text); }

body.dark-mode .mobile-desktop-notice,
body.dark-mode .upload-card,
body.dark-mode .control-card,
body.dark-mode .position-controls,
body.dark-mode .summary-card,
body.dark-mode .info-card,
body.dark-mode .video-controls,
body.dark-mode .unit-input,
body.dark-mode .unit-input input,
body.dark-mode .field input,
body.dark-mode .field select,
body.dark-mode .ratio-chip,
body.dark-mode .utility-icon {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

body.dark-mode .upload-dropzone {
  background: var(--surface);
  border-color: var(--border-strong);
}

body.dark-mode .upload-dropzone:hover {
  background: var(--surface-soft);
  border-color: var(--accent);
}

body.dark-mode .unit-input span {
  background: var(--surface-soft);
  color: var(--muted);
  border-color: var(--border);
}

body.dark-mode .hero-title,
body.dark-mode .hero-copy h2,
body.dark-mode .position-controls-header h2,
body.dark-mode .info-card h2,
body.dark-mode .summary-card strong,
body.dark-mode .preview-card > h2,
body.dark-mode .preview-media-meta strong,
body.dark-mode #mediaMeta strong { color: var(--text); }

body.dark-mode .hero-title { color: var(--accent); }

body.dark-mode .support-copy,
body.dark-mode .hero-copy > p:not(.hero-title),
body.dark-mode .position-controls-header p,
body.dark-mode .top-nav a,
body.dark-mode .upload-copy,
body.dark-mode .ratio-mode-note,
body.dark-mode .meta,
body.dark-mode .info-card p,
body.dark-mode .info-card li,
body.dark-mode .summary-card em,
body.dark-mode .preview-media-meta,
body.dark-mode #mediaMeta,
body.dark-mode .footer-meta { color: var(--muted); }

body.dark-mode .preview-card { background: transparent; }
body.dark-mode .preview-card > h2 { background: transparent; }

body.dark-mode .frame-window {
  background: #000000;
  border-color: #9ca3af;
}

body.dark-mode .empty {
  color: var(--muted);
  background: repeating-linear-gradient(135deg, var(--checker-a) 0, var(--checker-a) 13px, var(--checker-b) 13px, var(--checker-b) 26px);
}

body.dark-mode .ratio-chip.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

body.dark-mode .preview-shell.crop-shadow { background: #111827; }
body.dark-mode .shift-toast { background: rgba(249, 250, 251, 0.92); color: #111827; }

body.dark-mode .dialog {
  background: #111827;
  color: var(--text);
}

body.dark-mode .dialog p { color: var(--muted); }

/* Responsive */
@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .support-copy {
    max-width: 360px;
    text-align: left;
    white-space: normal;
  }

  .site-header,
  main,
  .site-footer {
    width: min(100% - 48px, 1580px);
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
  }

  .hero-copy {
    padding-left: 0;
  }

  .summary-cards { width: 100%; }
}

@media (max-width: 900px) {
  .mobile-desktop-notice { display: block; }
  body.has-image .preview-card:not(:first-child),
  body.has-video .preview-card:not(:first-child) {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 28px;
  }

  .site-header {
    grid-template-columns: 1fr auto;
    padding-top: 22px;
    padding-bottom: 10px;
  }

  main { padding-top: 8px; }
  .hero-grid { gap: 28px; }

  .frame-control-row {
    grid-template-columns: 1fr;
  }

  .dimension-symbol { display: none; }

  .preview-strip {
    grid-template-columns: 1fr;
  }

  .stage-wrap {
    padding: 34px 36px 34px;
    margin: 0;
  }

  .summary-cards { grid-template-columns: 1fr; }

  .video-controls {
    border-radius: 22px;
    flex-wrap: wrap;
  }

  .video-controls input[type="range"] {
    flex-basis: 100%;
    order: 3;
  }

  .preview-media-meta,
  #mediaMeta.preview-media-meta,
  #mediaMeta {
    margin: 24px auto 12px;
    padding: 0 18px;
    font-size: 18px;
    line-height: 1.35;
  }

  .preview-card > h2 {
    margin: 14px 0 20px;
    font-size: 34px;
  }
}

@media (max-width: 640px) {
  .header-actions {
    gap: 10px;
  }

  .support-copy {
    flex-basis: 100%;
    max-width: 100%;
    margin-right: 0;
    white-space: normal;
    font-size: 12px;
  }

  .support-button-wrap {
    transform-origin: left center;
    margin-left: 0;
  }

  .site-header,
  main,
  .site-footer {
    width: min(100% - 32px, 1580px);
  }

  .site-header {
    padding-top: 18px;
    padding-bottom: 8px;
  }

  main { padding-top: 6px; }

  .top-nav { gap: 22px; }

  .utility-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .hero-grid { gap: 24px; }

  .hero-title {
    max-width: 100%;
    margin-bottom: 18px !important;
    font-size: clamp(46px, 14.5vw, 68px);
    line-height: 0.88;
    letter-spacing: -0.065em;
  }

  .hero-copy h2 {
    max-width: 100%;
    font-size: clamp(22px, 6vw, 30px);
    line-height: 1.14;
  }

  .hero-copy > p:not(.hero-title) {
    max-width: 100%;
    margin-top: 6px;
    font-size: clamp(16px, 4.6vw, 21px);
    line-height: 1.35;
  }

  .upload-card,
  .control-card { padding: 18px; }

  .upload-dropzone {
    padding: 34px 24px;
    gap: 14px;
  }

  .upload-icon { margin-bottom: 20px; }
  .upload-title {
    margin-bottom: 14px;
    font-size: 28px;
    line-height: 1.12;
  }

  .upload-copy {
    max-width: 92%;
    margin-left: auto;
    margin-right: auto;
    font-size: 18px;
    line-height: 1.35;
  }

  .upload-copy + .upload-copy { margin-top: 12px; }


  .position-controls {
    margin: 22px auto 4px;
    padding: 18px;
  }

  .position-controls-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .position-reset-button {
    width: 100%;
  }

  .position-slider-grid {
    grid-template-columns: 1fr;
  }

  .button { width: 100%; }

  .preview-media-meta,
  #mediaMeta.preview-media-meta,
  #mediaMeta {
    justify-content: flex-start;
    text-align: left;
  }

  .preview-card > h2 {
    font-size: clamp(30px, 10vw, 46px);
  }

  body:not(.has-image):not(.has-video) .preview-shell { max-width: 100%; }

  body.has-image #fitDetails,
  body.has-image #fillDetails,
  body.has-image #actualDetails,
  body.has-video #fitDetails,
  body.has-video #fillDetails,
  body.has-video #actualDetails {
    font-size: 12px;
    padding: 12px 12px 0;
  }

  .site-footer {
    justify-content: space-between;
    align-items: flex-end;
    flex-direction: row;
  }

  .footer-meta {
    max-width: 62%;
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .footer-meta span {
    display: block;
    margin-left: 0;
  }
}
