@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;550;600;650;700&display=swap");
:root {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #151821;
  background: #f7f8fb;
  font-synthesis: none;
  --blue: #2055e6;
  --muted: #697182;
  --line: #e5e8ef;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
a,
input {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.42;
}
button {
  border: 0;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #407bff;
  outline-offset: 4px;
}
button:active:not(:disabled) {
  transform: scale(0.975);
}
button {
  transition:
    background 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
}
a {
  color: inherit;
  text-decoration: none;
}
svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
[hidden] {
  display: none !important;
}
.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.topbar {
  height: 98px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  max-width: 1440px;
  margin: auto;
}
.wordmark {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -2.8px;
}
.wordmark span {
  font-family: Inter;
  font-size: 11px;
  letter-spacing: 0;
  vertical-align: top;
  margin-left: 3px;
  display: inline-block;
  margin-top: 10px;
}
.prototype-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #5c6574;
}
.tiny-pill {
  padding: 4px 7px;
  border: 1px solid #d6dce7;
  font-size: 11px;
  border-radius: 6px;
  font-weight: 600;
}
.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 3px 12px #1b2a4710;
  display: grid;
  place-items: center;
  color: #404858;
}
.icon-button:hover {
  background: #e9eefb;
}
main {
  max-width: 1344px;
  padding: 0 32px;
  margin: auto;
}
.intro {
  padding: 26px 0 36px;
}
.intro h1 {
  font-family: var(--display);
  font-size: 72px;
  letter-spacing: -4px;
  line-height: 1;
  margin: 0 0 18px;
  font-weight: 800;
}
.intro h1 span {
  color: var(--blue);
}
.intro p {
  margin: 0;
  font-size: 18px;
  color: var(--muted);
  line-height: 1.5;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.53fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.scan-panel {
  background: white;
  border: 1px solid #e0e5ef;
  box-shadow:
    0 18px 60px #253d6010,
    0 2px 4px #23304905;
  border-radius: 30px;
  overflow: hidden;
}
.panel-top {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mode-switch,
.prompt-switch,
.output-switch {
  padding: 4px;
  display: flex;
  background: #eef1f6;
  border-radius: 24px;
  gap: 3px;
}
.mode-switch button {
  padding: 10px 18px;
  border-radius: 22px;
  background: transparent;
  color: #687182;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.mode-switch .active {
  background: white;
  color: #1a202a;
  box-shadow: 0 2px 5px #24334d14;
}
.mode-switch svg {
  width: 18px;
  height: 18px;
}
.local-badge {
  font-size: 11px;
  font-weight: 550;
  color: #64706d;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.local-badge > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3a8a6d;
}
.stage-wrap {
  position: relative;
  background: #18222c;
  display: grid;
  place-items: center;
  min-height: 360px;
  overflow: hidden;
}
.stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1;
  max-width: 620px;
  overflow: hidden;
  background: radial-gradient(
    ellipse at 55% 30%,
    #394c59,
    #1a2632 62%,
    #151c28
  );
}
#sourceCanvas,
#camera {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}
.has-image #sourceCanvas {
  display: block;
}
.is-camera #camera {
  display: block;
}
.is-camera #sourceCanvas {
  display: none;
}
.overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s;
  stroke: none;
}
.has-selection .overlay {
  opacity: 1;
}
.outside-dim {
  fill: #071524;
  opacity: 0.42;
  transition: opacity 0.5s;
}
.outline {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.outline.glow {
  stroke: #d3d2ff;
  stroke-width: 9px;
  filter: blur(7px);
  opacity: 0.8;
}
.outline.base {
  stroke: url(#shine);
  stroke-width: 2.5px;
}
.outline.shimmer {
  stroke: white;
  stroke-width: 3.5px;
  stroke-dasharray: 10 8 1 81;
  animation: orbit 3.4s linear infinite;
  filter: drop-shadow(0 0 3px #fff);
}
.selecting .stage {
  cursor: crosshair;
}
.selecting .outside-dim {
  opacity: 0.24;
}
.manual .outline.base {
  stroke: #bad4ff;
}
.manual .shimmer {
  animation: none;
  opacity: 0.5;
}
.camera-search .outside-dim {
  opacity: 0.06;
}
.camera-search .outline.base {
  stroke: #bad4ff;
  opacity: 0.65;
}
.is-locked .outline.base {
  stroke: #a2f7d2;
}
.is-locked .outside-dim {
  opacity: 0.2;
}
.empty-stage {
  position: absolute;
  inset: 0;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background: radial-gradient(circle at 50% 20%, #456d8740, transparent 65%);
}
.scan-glyph {
  width: 90px;
  height: 105px;
  display: grid;
  place-items: center;
  margin-bottom: 32px;
  border: 1px solid #9dabbb7a;
  border-radius: 13px;
  transform: rotate(-8deg);
  box-shadow:
    inset 0 0 26px #c6dfff0d,
    0 15px 24px #0003;
  background: linear-gradient(130deg, #a5c8e820, #49699012);
}
.scan-glyph svg {
  width: 42px;
  height: 42px;
  stroke-width: 1.15;
  color: #e6eeff;
}
.empty-stage h2 {
  font-family: var(--display);
  font-size: 30px;
  margin: 0 0 12px;
  letter-spacing: -1.2px;
}
.empty-stage p {
  font-size: 14px;
  color: #b7c4d0;
  margin: 0 0 30px;
}
.empty-stage > span {
  font-size: 11px;
  color: #8f9ca9;
  margin-top: 17px;
}
.empty-stage .button {
  min-width: 198px;
}
.scanning-beam {
  position: absolute;
  left: 0;
  width: 100%;
  height: 18%;
  top: -20%;
  background: linear-gradient(transparent, #a8d6ff12, #dbe8ff40);
  border-bottom: 1px solid #ffffff70;
  pointer-events: none;
  display: none;
}
.is-busy .scanning-beam {
  display: block;
  animation: scan 2.5s ease-in-out infinite;
}
.busy-indicator {
  position: absolute;
  left: 50%;
  top: 25px;
  transform: translateX(-50%);
  max-width: 92%;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid #ffffff40;
  border-radius: 30px;
  background: #162131bd;
  color: white;
  backdrop-filter: blur(20px);
  font-size: 13px;
  box-shadow: 0 4px 18px #0002;
  z-index: 5;
  white-space: nowrap;
}
.spinner {
  width: 15px;
  height: 15px;
  border: 1.5px solid #ffffff45;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.stage-notice {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 11px 15px;
  border: 1px solid #ffffff30;
  border-radius: 24px;
  background: #1a2736b8;
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 9px;
  color: #f6faff;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}
.notice-dot {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: #bfe1ff;
}
.is-locked .notice-dot {
  background: #a2f7d2;
}
.is-camera .stage-notice {
  bottom: 115px;
}
.shutter {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 5px;
  border: 3px solid white;
  background: #ffffff20;
  box-shadow: 0 4px 22px #0004;
}
.shutter span {
  display: block;
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 50%;
}
.shutter:active:not(:disabled) {
  transform: translateX(-50%) scale(0.93);
}
.scanner-bottom {
  padding: 23px 24px 24px;
}
.status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}
.status-line h2 {
  font-family: var(--display);
  font-size: 23px;
  letter-spacing: -0.7px;
  margin: 0 0 6px;
}
.status-line p {
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  color: var(--muted);
}
.status-line .icon-button {
  flex-shrink: 0;
  background: #f3f5f9;
  box-shadow: none;
}
.action-bar {
  display: flex;
  gap: 9px;
}
.button {
  min-height: 49px;
  padding: 12px 18px;
  border-radius: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}
.button svg {
  width: 19px;
  height: 19px;
}
.primary {
  background: var(--blue);
  color: white;
  box-shadow:
    inset 0 1px 0 #86a5ff,
    0 4px 12px #2055e620;
}
.primary:hover:not(:disabled) {
  background: #174bd8;
  box-shadow:
    inset 0 1px 0 #86a5ff,
    0 5px 18px #2055e63a;
}
.secondary {
  background: #eff2f8;
  color: #46516a;
  border: 1px solid #e8ecf4;
}
.secondary:hover:not(:disabled) {
  background: #e4ebf8;
}
.secondary.active {
  background: #e4edff;
  color: #2055e6;
  border-color: #b8ccff;
}
.white {
  background: #fff;
  color: #1b2533;
  box-shadow: 0 6px 22px #0002;
}
.action-bar .primary {
  margin-left: auto;
  min-width: 145px;
}
.text-button {
  padding: 10px 0;
  background: transparent;
  color: #49668f;
  min-height: 44px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.text-button:hover {
  color: var(--blue);
}
.text-button svg {
  width: 16px;
  height: 16px;
}
.candidate-row {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}
#candidateButtons {
  display: flex;
  gap: 6px;
}
#candidateButtons button {
  border-radius: 50%;
  height: 28px;
  width: 28px;
  background: #eff2f8;
  font-size: 11px;
  color: #47556a;
}
#candidateButtons button.active {
  background: #e3ebff;
  color: var(--blue);
  outline: 1px solid #99b5ff;
}
.refinement {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  margin: -4px 0 17px;
}
.refinement > span {
  font-size: 11px;
  color: var(--muted);
  flex: 1;
  min-width: 170px;
  line-height: 1.4;
}
.prompt-switch {
  border-radius: 8px;
  padding: 3px;
}
.prompt-switch button {
  padding: 7px 9px;
  font-size: 11px;
  background: transparent;
  color: #626d7b;
  border-radius: 6px;
}
.prompt-switch .active {
  background: white;
  color: var(--blue);
  box-shadow: 0 1px 3px #121f3515;
}
.corner-handle {
  position: absolute;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  padding: 0;
  background: transparent;
  border-radius: 50%;
  touch-action: none;
  cursor: grab;
  z-index: 5;
  display: grid;
  place-items: center;
}
.corner-handle:after {
  content: "";
  width: 15px;
  height: 15px;
  background: white;
  border: 2px solid #4478ed;
  box-shadow: 0 1px 10px #0006;
  border-radius: 50%;
}
.corner-handle:active:not(:disabled) {
  transform: translate(-50%, -50%);
  cursor: grabbing;
}
.stage.is-dragover {
  outline: 3px dashed #9cbeff;
  outline-offset: -10px;
}
.result-panel {
  background: linear-gradient(145deg, #eef2fa, #fff 60%, #f5f3fa);
  border: 1px solid #fff;
  border-radius: 30px;
  min-height: 710px;
  position: relative;
  padding: 28px 26px;
  box-shadow: 0 6px 35px #253d6008;
  overflow: hidden;
}
.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.result-heading h2 {
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: -0.7px;
  margin: 0;
}
.result-badge {
  color: #7c8799;
  font-size: 10px;
  border: 1px solid #dfe5ef;
  border-radius: 14px;
  padding: 5px 8px;
  white-space: nowrap;
}
.result-badge.success {
  background: #e6f5ec;
  color: #317251;
  border-color: #d5eede;
}
.result-stage {
  height: 430px;
  display: grid;
  place-items: center;
  perspective: 1000px;
  position: relative;
  isolation: isolate;
  margin-top: 12px;
}
.result-halo {
  position: absolute;
  inset: 12% 0;
  background: conic-gradient(
    from 30deg,
    #8bbaff45,
    #f4d0f550,
    #dee6ff60,
    #fff3ca50,
    #8bbaff45
  );
  filter: blur(45px);
  border-radius: 50%;
  z-index: -1;
  opacity: 0;
  transition: opacity 1s;
}
.has-result .result-halo {
  opacity: 1;
}
.empty-result {
  text-align: center;
  color: #8992a2;
}
.blank-poster {
  width: 173px;
  height: 232px;
  border: 1px dashed #ccd4e2;
  border-radius: 18px;
  transform: rotate(-8deg);
  display: grid;
  place-items: center;
  background: linear-gradient(130deg, #fff9, #e6ebf566);
  box-shadow: inset 1px 1px 0 #fff;
  position: relative;
  margin: 12px auto 42px;
}
.blank-poster:before {
  content: "";
  position: absolute;
  inset: 5px;
  transform: translate(14px, 6px) rotate(6deg);
  border: 1px solid #dfe5ee;
  border-radius: 18px;
  z-index: -1;
}
.blank-poster svg {
  width: 42px;
  height: 42px;
  color: #a1afc7;
  stroke-width: 1.2;
}
.empty-result p {
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
}
.lifted-poster {
  position: relative;
  max-width: 86%;
  max-height: 94%;
  padding: 7px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    #eef7ff 0%,
    #c8bdff 16%,
    #f3f4ff 30%,
    #b6e5f4 50%,
    #ffeeb5 64%,
    #e2cbef 82%,
    #edf7ff
  );
  box-shadow:
    1px 1px 0 #fff,
    0 20px 38px -14px #203b6f5c,
    0 2px 10px #34446512;
  transform: rotate(-5deg);
  transition: transform 0.35s;
  overflow: hidden;
  will-change: transform;
}
.lifted-poster:hover {
  transform: rotate(0) translateY(-4px);
}
#resultCanvas {
  display: block;
  max-width: 100%;
  max-height: 380px;
  width: auto;
  height: auto;
  border-radius: 5px;
  position: relative;
  z-index: 1;
}
.lifted-poster.cutout {
  padding: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 16px 13px #25325228);
  overflow: visible;
}
.result-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 7px;
}
.output-switch {
  border: 1px solid #e0e6f0;
  background: #eaf0f780;
}
.output-switch button {
  padding: 9px 13px;
  font-size: 11px;
  border-radius: 18px;
  background: transparent;
  color: #6b768b;
}
.output-switch .active {
  background: #fff;
  color: #1e345c;
  box-shadow: 0 2px 6px #1f365415;
}
#dimensions {
  font-size: 11px;
  color: #6f7b90;
  margin: 3px 0 6px;
}
.download {
  width: 100%;
  font-size: 14px;
}
.result-details .text-button {
  margin-top: -8px;
}
.result-note {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  color: #8692a5;
  margin-top: 70px;
}
.result-note svg {
  width: 22px;
}
.result-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}
.flying-poster {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  filter: drop-shadow(0 12px 26px #172b504d);
  border-radius: 7px;
  transform-origin: 0 0;
}
.examples {
  padding: 42px 2px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
.examples h2 {
  font-family: var(--display);
  font-size: 23px;
  letter-spacing: -0.8px;
  margin: 0 0 8px;
}
.examples p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.example-buttons {
  display: flex;
  gap: 12px;
}
.example-buttons button {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  min-width: 192px;
  background: white;
  border: 1px solid #e5e9f0;
  border-radius: 16px;
  padding: 10px 14px 10px 10px;
  box-shadow: 0 3px 10px #23365406;
  color: #263249;
}
.example-buttons button:hover {
  border-color: #aabfe9;
  box-shadow: 0 5px 15px #263c6210;
}
.example-buttons button > span:nth-child(2) {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.example-buttons small {
  display: block;
  font-size: 10px;
  color: #8a93a2;
  font-weight: 400;
  margin-top: 4px;
}
.example-buttons svg {
  width: 15px;
  height: 15px;
  color: #8a99b2;
  margin-left: auto;
}
.example-thumb {
  display: block;
  width: 39px;
  height: 52px;
  border-radius: 7px;
  background: #303c47;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.example-thumb:before {
  content: "";
  position: absolute;
  inset: 8px 9px;
  background: #d4ed41;
  transform: rotate(-6deg);
}
.street-thumb {
  background-image: url("/assets/street-poster.png");
  background-size: cover;
  background-position: center;
}
.street-thumb:before {
  display: none;
}
.perspective-thumb:before {
  background: #d4ed41;
  transform: perspective(70px) rotateY(-25deg) rotate(4deg);
}
.multiple-thumb:before {
  background: #ee938f;
  inset: 9px 17px 7px 4px;
  transform: rotate(-7deg);
}
.multiple-thumb:after {
  content: "";
  position: absolute;
  inset: 15px 3px 6px 22px;
  background: #aaaaf1;
  transform: rotate(8deg);
}
footer {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding: 14px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #8a93a3;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: #182839;
  color: white;
  padding: 15px 22px;
  border: 1px solid #7f97b545;
  border-radius: 18px;
  box-shadow: 0 8px 35px #06152f40;
  font-size: 13px;
  line-height: 1.5;
  max-width: min(90vw, 500px);
  z-index: 120;
}
.toast.error {
  background: #5c2c3c;
}
dialog {
  border: 1px solid #fff;
  border-radius: 28px;
  box-shadow: 0 35px 90px #0e1b3640;
  max-width: 560px;
  width: calc(100% - 36px);
  padding: 38px 35px;
  background: #fcfdff;
  color: #24314a;
  max-height: 90dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #152b4e66;
  backdrop-filter: blur(6px);
}
dialog h2 {
  font-family: var(--display);
  font-size: 37px;
  line-height: 1.08;
  letter-spacing: -1.5px;
  margin: 0 0 24px;
}
dialog p {
  font-size: 13px;
  line-height: 1.7;
  color: #667084;
}
.dialog-close {
  position: absolute;
  right: 18px;
  top: 18px;
  box-shadow: none;
  background: #eff3f9;
}
dl {
  margin: 25px 0;
  border-top: 1px solid #dde4ef;
}
dl > div {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #e6eaf1;
  font-size: 12px;
  gap: 20px;
}
dt {
  color: #7d899b;
}
dd {
  margin: 0;
  text-align: right;
}
dialog .small {
  font-size: 11px;
}
.source-links {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--blue);
  margin-top: 20px;
}
@keyframes orbit {
  to {
    stroke-dashoffset: -100;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes scan {
  from {
    top: -20%;
  }
  to {
    top: 110%;
  }
}
@media (min-width: 1400px) {
  .intro {
    padding-top: 35px;
    padding-bottom: 40px;
  }
  .stage {
    max-width: 650px;
  }
  .result-panel {
    min-height: 744px;
  }
  .result-stage {
    height: 465px;
  }
  #resultCanvas {
    max-height: 410px;
  }
}
@media (max-width: 1100px) {
  .topbar {
    padding: 0 32px;
  }
  .workspace {
    gap: 20px;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
  .scanner-bottom {
    padding: 20px 17px;
  }
  .action-bar {
    gap: 7px;
  }
  .button {
    padding: 12px 13px;
    font-size: 12px;
  }
  .action-bar .primary {
    min-width: 125px;
  }
  .action-bar .secondary svg {
    display: none;
  }
  .result-panel {
    padding: 24px 18px;
    min-height: 630px;
  }
  .result-stage {
    height: 370px;
  }
  #resultCanvas {
    max-height: 322px;
  }
  .result-note {
    margin-top: 62px;
  }
  .examples {
    gap: 20px;
  }
  .example-buttons {
    gap: 8px;
  }
  .example-buttons button {
    min-width: 155px;
    padding-right: 10px;
    gap: 9px;
  }
  .examples h2 {
    font-size: 21px;
  }
  .example-buttons button > svg {
    display: none;
  }
}
@media (max-width: 780px) {
  .topbar {
    height: 78px;
    padding: 0 22px;
  }
  .wordmark {
    font-size: 35px;
  }
  .prototype-label {
    font-size: 12px;
    gap: 8px;
  }
  .topbar > .icon-button {
    width: 38px;
    height: 38px;
  }
  main {
    padding: 0 18px;
  }
  .intro {
    padding: 22px 4px 28px;
  }
  .intro h1 {
    font-size: 56px;
    letter-spacing: -3px;
    margin-bottom: 13px;
  }
  .intro p {
    font-size: 14px;
  }
  .workspace {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .scan-panel {
    border-radius: 25px;
  }
  .panel-top {
    padding: 13px 14px;
  }
  .mode-switch button {
    padding: 9px 15px;
    font-size: 12px;
  }
  .local-badge {
    font-size: 10px;
  }
  .stage-wrap {
    min-height: 320px;
  }
  .stage {
    max-width: 560px;
  }
  .scanner-bottom {
    padding: 20px;
  }
  .status-line {
    margin-bottom: 19px;
  }
  .status-line h2 {
    font-size: 23px;
  }
  .action-bar .secondary svg {
    display: block;
  }
  .action-bar .primary {
    min-width: 135px;
  }
  .button {
    font-size: 12px;
    padding: 12px 14px;
  }
  .action-bar {
    gap: 8px;
  }
  .result-panel {
    min-height: 340px;
    padding: 23px;
  }
  .result-heading h2 {
    font-size: 23px;
  }
  .result-stage {
    height: 270px;
  }
  .empty-result {
    display: flex;
    align-items: center;
    gap: 35px;
  }
  .blank-poster {
    width: 115px;
    height: 160px;
    margin: 20px 0;
  }
  .blank-poster svg {
    width: 31px;
  }
  .empty-result p {
    text-align: left;
  }
  .result-note {
    margin-top: 5px;
    margin-bottom: 12px;
  }
  .result-panel.has-result .result-stage {
    height: 400px;
  }
  #resultCanvas {
    max-height: 355px;
  }
  .result-details {
    max-width: 400px;
    margin: auto;
  }
  .examples {
    padding-top: 32px;
    display: block;
  }
  .examples > div:first-child {
    margin-bottom: 18px;
  }
  .example-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }
  .example-buttons button {
    min-width: 0;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .example-thumb {
    width: 100%;
    height: 75px;
  }
  .example-thumb:before {
    inset: 9px 28%;
  }
  .multiple-thumb:before {
    inset: 10px 52% 10px 10%;
  }
  .multiple-thumb:after {
    inset: 17px 8% 8px 58%;
  }
  .example-buttons button > span:nth-child(2) {
    font-size: 11px;
  }
  .example-buttons small {
    font-size: 9px;
  }
  .stage-notice {
    bottom: 17px;
    font-size: 11px;
    max-width: 94%;
    white-space: normal;
    text-align: center;
  }
  footer {
    font-size: 10px;
    margin-top: 8px;
  }
  .text-button {
    font-size: 11px;
  }
  .corner-handle:after {
    width: 17px;
    height: 17px;
  }
  dialog {
    padding: 34px 24px;
  }
  dialog h2 {
    font-size: 32px;
  }
}
@media (max-width: 390px) {
  main {
    padding: 0 12px;
  }
  .topbar {
    padding: 0 17px;
  }
  .action-bar .button {
    padding: 11px 12px;
  }
  .action-bar .secondary svg {
    display: none;
  }
  .action-bar .primary {
    min-width: 130px;
  }
  .status-line h2 {
    font-size: 21px;
  }
  .local-badge {
    font-size: 9px;
  }
  .empty-stage h2 {
    font-size: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .outline.shimmer {
    opacity: 0.5;
  }
  .lifted-poster {
    transform: none;
  }
  .scanning-beam {
    display: none !important;
  }
}

/* Automatic collection review */
.poster-collection {
  padding: 24px 24px 0;
  border-bottom: 1px solid var(--line, #e9eaf0);
  margin-bottom: 14px;
}
.collection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.collection-heading h2 {
  font-size: 18px;
  margin: 0;
}
.collection-heading button {
  white-space: nowrap;
}
.poster-gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 3px;
  scrollbar-width: thin;
}
.poster-card {
  position: relative;
  flex: 0 0 96px;
  display: flex;
}
.poster-tile {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid #dfe3f0;
  border-radius: 14px;
  background: #fff;
  color: #35415a;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.poster-tile img {
  width: 76px;
  height: 92px;
  object-fit: contain;
  border-radius: 5px;
  background: #f2f3f8;
}
.poster-tile.active {
  border: 2px solid #2b50e7;
  background: #edf1ff;
  padding: 7px;
}
.poster-tile small {
  font-size: 10px;
  color: #707b90;
}
.duplicates {
  background: #edf0f7;
  border-radius: 12px;
}
.duplicates .poster-tile {
  opacity: 0.8;
}
.batch-actions {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 18px;
}
.batch-actions button {
  font-size: 12px;
}
.batch-actions #removePoster {
  margin-left: auto;
}
#posterBoxes path {
  fill: transparent;
  stroke: #88b9ff;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
#posterBoxes g {
  cursor: pointer;
  pointer-events: auto;
}
#posterBoxes text {
  font: 700 28px system-ui;
  fill: white;
  paint-order: stroke;
  stroke: #2353df;
  stroke-width: 8px;
  stroke-linejoin: round;
}
#posterBoxes g:focus {
  outline: none;
}
#posterBoxes g:focus path {
  stroke: white;
  stroke-width: 4;
}
.has-collection .result-stage {
  min-height: 320px;
}
.has-collection .lifted-poster canvas {
  max-height: 340px;
}
@media (max-width: 780px) {
  .poster-collection {
    padding: 20px 18px 0;
  }
  .poster-card {
    flex-basis: 88px;
  }
  .poster-tile img {
    width: 68px;
    height: 84px;
  }
  .batch-actions {
    gap: 14px;
  }
  .has-collection .result-stage {
    min-height: 280px;
  }
}

.selecting #posterBoxes g {
  pointer-events: none;
}

.poster-delete {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #a9414d;
  cursor: pointer;
  border-radius: 50%;
}
.poster-delete::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #e5d8de;
  box-shadow: 0 2px 6px #1d24341a;
}
.poster-delete svg {
  position: relative;
  pointer-events: none;
}
.poster-delete:hover::before {
  background: #fff0f1;
  border-color: #dba7ae;
}
.poster-delete:focus-visible {
  outline: 2px solid #2b50e7;
  outline-offset: 1px;
}
.poster-delete:disabled {
  opacity: 0.4;
  cursor: default;
}
