.drop-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.drop-app > main {
  flex: 1;
}

.drop-app .header-actions,
.drop-app .lang-switch {
  min-width: 0;
}

.map-section {
  padding-top: 0.85rem;
  text-align: center;
}

.map-section .drop-lead {
  max-width: 36rem;
  margin-inline: auto;
}

.map-section .map-hint,
.map-section .map-fallback {
  text-align: center;
}

.write-launch {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.write-launch .write-open {
  margin-left: 0;
  min-height: 52px;
  padding-inline: 1.15rem;
}

.letter-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  overscroll-behavior: none;
}

.letter-modal[hidden],
.letter-modal:not(.is-open) {
  display: none !important;
}

.letter-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 9, 0.55);
}

.letter-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: var(--bg);
  border-radius: 0;
  padding: 0.85rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom));
}

.letter-modal__bar {
  position: relative;
  z-index: 2;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.35rem;
  background: var(--bg);
}

.letter-modal__bar .drop-heading {
  margin: 0;
  min-width: 0;
}

body.letter-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

body.letter-open .site-header {
  z-index: 1;
}

.letter-section {
  width: 100%;
  margin: 0.75rem auto 0;
}

.letter-modal .letter-section {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin-top: 0.35rem;
  overflow: hidden;
}

.letter-modal .stage-wrap {
  flex: 1 1 auto;
  align-items: center;
  min-height: 0;
  container-type: size;
}

.letter-modal .stage {
  width: min(100cqw, calc(100cqh * 0.75));
  max-width: 100%;
  height: auto;
}

.letter-modal .drop-status {
  flex: none;
}

.letter-modal .dock {
  position: static;
  z-index: 2;
  flex: none;
  background: var(--bg);
}

@media (max-width: 699px) {
  .letter-modal .tool-row,
  .letter-modal .option-row,
  .text-sheet__row {
    flex-wrap: wrap;
  }

  .letter-modal .tool {
    flex: 1 1 auto;
  }

  .letter-modal .option-row .send,
  .text-sheet__row .send {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .place-actions .send {
    width: 100%;
  }
}

@media (min-width: 700px) {
  .letter-modal {
    align-items: center;
    padding: 1.25rem;
  }

  .letter-modal__panel {
    display: block;
    width: min(460px, 100%);
    height: auto;
    max-height: min(92dvh, 920px);
    overflow: auto;
    border-radius: 20px;
  }

  .letter-modal__bar {
    position: sticky;
    top: 0;
  }

  .letter-modal .letter-section {
    display: block;
    overflow: visible;
  }

  .letter-modal .stage-wrap {
    container-type: normal;
  }

  .letter-modal .stage {
    width: min(100%, 420px, calc((100dvh - 16rem) * 0.75));
  }

  .letter-modal .dock {
    position: sticky;
    bottom: 0;
  }
}

.drop-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember-soft);
}

.drop-title {
  margin: 0.3rem 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  letter-spacing: -0.02em;
}

.drop-lead {
  margin: 0.4rem 0 0.85rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.drop-heading {
  margin: 0.85rem 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  letter-spacing: -0.02em;
}

.map-frame {
  position: relative;
  margin-top: 0.65rem;
}

.world-map,
.place-map {
  border-radius: 18px;
  overflow: hidden;
  background: #d7e4ee;
  z-index: 0;
}

.world-map {
  height: min(62vh, 560px);
  min-height: 340px;
}

.world-map .maplibregl-canvas,
.world-map .maplibregl-canvas-container {
  cursor: default !important;
}

.world-map .maplibregl-ctrl-top-left {
  display: none;
}

.place-map {
  height: 280px;
}

.place-section {
  display: none !important;
  width: min(1100px, calc(100% - 2.4rem));
  margin: 1.6rem auto 0;
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}

.place-section.is-open {
  display: block !important;
}

.place-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.place-actions .send {
  margin-left: 0;
}

.maplibregl-map {
  font-family: var(--font-body);
}

.maplibregl-ctrl-bottom-right {
  max-width: 48%;
}

.maplibregl-ctrl-attrib {
  font-size: 10px;
  line-height: 1.3;
  background: rgba(255, 255, 255, 0.9);
  color: #3a342c;
}

.maplibregl-ctrl-attrib a {
  color: #8a4b22;
}

.map-locate {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  appearance: none;
  border: 1px solid rgba(28, 22, 18, 0.16);
  background: rgba(255, 255, 255, 0.94);
  color: #1c1612;
  font: 700 0.78rem/1.2 var(--font-body);
  min-height: 44px;
  max-width: calc(100% - 1.1rem);
  border-radius: 14px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  text-align: center;
}

.map-locate:disabled {
  opacity: 0.45;
  cursor: default;
}

.map-legend {
  position: absolute;
  left: 0.55rem;
  bottom: 1.45rem;
  z-index: 2;
  pointer-events: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  max-width: 50%;
  margin: 0;
  padding: 0.4rem 0.55rem;
  list-style: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #1c1612;
  font-size: 0.72rem;
  line-height: 1.2;
}

.map-legend li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot,
.legend-guest,
.legend-drop {
  display: block;
  flex: none;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3ddc84;
}

.legend-guest {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: inset 0 0 0 2px #ff8a3d;
}

.legend-drop {
  width: 12px;
  height: 12px;
  border-radius: 50% 50% 50% 0;
  background: #ff8a3d;
  transform: rotate(-45deg);
  box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.35);
}

.map-hint,
.map-fallback {
  margin: 0.5rem 0 0;
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.map-fallback {
  color: var(--ember-soft);
}

.map-fallback[hidden] {
  display: none !important;
}

.pin-drop-wrap {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  cursor: grab;
}

.pin-guest {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: inset 0 0 0 2px #ff8a3d;
  position: relative;
}

.pin-guest::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 8px;
  height: 5px;
  background:
    linear-gradient(to bottom right, transparent 46%, #1c1612 49%, #1c1612 51%, transparent 54%),
    #f6f1e8;
  box-shadow: inset 0 0 0 1px #1c1612;
}

.pin-drop {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 0;
  background: #ff8a3d;
  border: 2px solid #fff6ee;
  transform: rotate(-45deg);
  box-shadow: 0 0 0 8px rgba(255, 138, 61, 0.28);
}

.promo {
  margin: 2.4rem auto 2.6rem;
  text-align: center;
}

.promo-body {
  margin: 0.55rem auto 1rem;
  max-width: 38rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.promo-line {
  margin: 0.75rem 0 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

@media (min-width: 900px) {
  .world-map {
    height: 480px;
    min-height: 480px;
  }

  .place-map {
    height: 340px;
  }
}

.stage-wrap {
  display: flex;
  justify-content: center;
}

.stage {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  background: #f6f1e8;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  touch-action: none;
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.letter-layer {
  position: absolute;
  inset: 0;
  touch-action: none;
  pointer-events: none;
}

.letter-text {
  position: absolute;
  margin: 0;
  padding: 0.15rem 0.2rem;
  color: #1c1612;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  white-space: pre;
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
  max-width: 92%;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.letter-text.is-light {
  color: #f4efe6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.letter-text.is-selected {
  outline: 1.5px dashed rgba(255, 138, 61, 0.95);
  outline-offset: 3px;
}

.drop-status {
  min-height: 1.3rem;
  margin: 0.55rem 0 0;
  font-size: 0.86rem;
  color: var(--ink-muted);
}

.drop-status.is-alert {
  color: var(--ember-soft);
}

.dock {
  position: relative;
  z-index: 5;
  margin-top: 0.35rem;
  padding: 0.35rem 0 calc(0.75rem + env(safe-area-inset-bottom));
  background: var(--bg);
}

.tool-row,
.option-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.option-row {
  margin-top: 0.45rem;
}

.tool,
.swatch,
.send {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink);
  font: 600 0.78rem/1 var(--font-body);
  min-height: 44px;
  min-width: 44px;
  border-radius: 14px;
  padding: 0 0.7rem;
  cursor: pointer;
}

.tool.is-on,
.swatch.is-on {
  border-color: var(--ember);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(255, 138, 61, 0.45);
}

.swatch {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
}

.swatch-ink { background: #1c1612; }
.swatch-ember { background: #ff8a3d; }
.swatch-paper { background: #f4efe6; }
.swatch-pine { background: #2f6f4e; }

.width {
  width: 44px;
  min-width: 44px;
  padding: 0;
}

.width i {
  display: block;
  margin: 0 auto;
  background: currentColor;
  border-radius: 99px;
}

.send {
  margin-left: auto;
  background: var(--ember);
  color: #1c1612;
  border-color: transparent;
  font-weight: 800;
  padding-inline: 0.95rem;
}

.send:disabled {
  opacity: 0.4;
  cursor: default;
}

.size-row {
  display: none !important;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.45rem;
}

.size-row.is-open {
  display: flex !important;
}

.size-row span {
  font-size: 0.75rem;
  color: var(--ink-muted);
  min-width: 2.2rem;
}

.size-row input {
  flex: 1;
  accent-color: var(--ember);
  min-height: 44px;
}

.text-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: none !important;
  padding: 0.85rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom));
  background: var(--header-bg);
  border-top: 1px solid var(--line);
}

.text-sheet.is-open {
  display: block !important;
}

.text-sheet textarea {
  width: min(420px, 100%);
  display: block;
  margin: 0 auto;
  min-height: 5.5rem;
  resize: none;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f6f1e8;
  color: #1c1612;
  font: 600 1rem/1.4 var(--font-display);
  padding: 0.75rem 0.8rem;
}

.text-sheet__row {
  width: min(420px, 100%);
  margin: 0.55rem auto 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.text-sheet p {
  width: min(420px, 100%);
  margin: 0.45rem auto 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.success {
  display: none !important;
  width: min(420px, calc(100% - 1.5rem));
  margin: 1.5rem auto;
  text-align: center;
}

.success.is-open {
  display: block !important;
}

.success h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.7rem;
  margin: 0.4rem 0;
}

.success p {
  color: var(--ink-muted);
  line-height: 1.5;
}

.success a,
.success button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0.4rem;
  padding: 0 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink);
  font: 700 0.95rem/1 var(--font-body);
  cursor: pointer;
}

.success .send {
  background: var(--ember);
  color: #1c1612;
  border-color: transparent;
}

.drop-app.is-done .write-launch,
.drop-app.is-done .letter-modal,
.drop-app.is-done .place-section,
.drop-app.is-sheet .dock {
  display: none !important;
}
