:root {
  --page: #120f0c;
  --ink: #f6f1e5;
  --muted: rgba(246, 241, 229, 0.68);
  --line: rgba(255, 247, 231, 0.18);
  --panel: rgba(39, 34, 29, 0.78);
  --panel-soft: rgba(54, 47, 39, 0.46);
  --panel-strong: rgba(28, 24, 20, 0.88);
  --accent: #c5a45c;
  --accent-soft: rgba(197, 164, 92, 0.22);
  --alive: #5f8c73;
  --alive-soft: rgba(95, 140, 115, 0.26);
  --faded: rgba(112, 110, 105, 0.72);
  --danger: #c98073;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: "Outfit", sans-serif;
}

button,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.reasoning-canvas {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at top center, rgba(252, 248, 237, 0.72), transparent 38%),
    linear-gradient(180deg, rgba(255, 248, 232, 0.32) 0%, rgba(255, 248, 232, 0.1) 28%, rgba(14, 12, 10, 0.28) 100%),
    #ddd4c1;
}

.reasoning-canvas::before,
.reasoning-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 420ms ease, transform 420ms ease;
}

.reasoning-canvas::before {
  background:
    radial-gradient(circle at 50% 26%, rgba(111, 83, 53, 0.42), transparent 38%),
    radial-gradient(circle at 50% 118%, rgba(16, 12, 9, 0.82), transparent 50%),
    linear-gradient(180deg, rgba(88, 65, 42, 0.38) 0%, rgba(118, 88, 58, 0.24) 22%, rgba(17, 13, 10, 0.58) 100%);
  opacity: 1;
}

.reasoning-canvas::after {
  background:
    radial-gradient(circle at center, transparent 54%, rgba(17, 14, 11, 0.36) 100%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 3px,
      transparent 3px,
      transparent 14px
  );
  mix-blend-mode: multiply;
  opacity: 0.6;
}

.reasoning-canvas.has-draft::before,
.reasoning-canvas.has-started::before {
  opacity: 0.52;
}

.reasoning-canvas.has-draft::after,
.reasoning-canvas.has-started::after {
  opacity: 0.42;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.leaflet-container {
  background: #d8cfbc;
  font-family: "Outfit", sans-serif;
}

.leaflet-tile-pane {
  filter: sepia(0.26) saturate(0.78) contrast(1.04) brightness(0.97);
  opacity: 0.9;
}

.leaflet-control-container {
  position: relative;
  z-index: 5;
}

.leaflet-top.leaflet-right {
  top: 120px;
  right: 22px;
}

.leaflet-control-zoom {
  border: 1px solid rgba(120, 104, 82, 0.24) !important;
  border-radius: 22px !important;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.leaflet-control-zoom a {
  width: 42px !important;
  height: 42px !important;
  line-height: 42px !important;
  border: 0 !important;
  background: rgba(255, 248, 236, 0.72) !important;
  color: #4f453a !important;
  backdrop-filter: blur(12px);
}

.leaflet-control-zoom a:first-child {
  border-bottom: 1px solid rgba(120, 104, 82, 0.18) !important;
}

.brand-bar {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 4;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 360ms ease, transform 360ms ease;
}

.reasoning-canvas.has-started .brand-bar {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.brand {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  letter-spacing: 0.14em;
  color: #6b5130;
  text-shadow: 0 3px 18px rgba(255, 250, 238, 0.35);
}

.restart-button {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 244, 224, 0.16);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(250, 245, 236, 0.82) 0%, rgba(234, 224, 208, 0.72) 100%);
  color: rgba(74, 56, 38, 0.88);
  box-shadow: 0 12px 28px rgba(28, 19, 12, 0.14);
  backdrop-filter: blur(14px);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 240ms ease, transform 240ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.reasoning-canvas.has-started .restart-button {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.restart-button:hover {
  box-shadow: 0 16px 32px rgba(28, 19, 12, 0.18);
  filter: brightness(1.02);
}

.landing-hero {
  position: absolute;
  top: 18vh;
  left: 50%;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(760px, calc(100vw - 40px));
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  transition:
    opacity 420ms ease,
    transform 420ms ease,
    filter 420ms ease;
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: -64px -86px;
  z-index: -1;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(94, 69, 45, 0.74) 0%, rgba(77, 57, 37, 0.5) 38%, rgba(55, 40, 27, 0.18) 68%, transparent 100%);
  filter: blur(18px);
  opacity: 1;
  transition: opacity 420ms ease, transform 420ms ease, filter 420ms ease;
}

.reasoning-canvas.has-draft .landing-hero,
.reasoning-canvas.has-started .landing-hero {
  opacity: 0;
  transform: translateX(-50%) translateY(-16px) scale(0.985);
  filter: blur(8px);
}

.reasoning-canvas.has-draft .landing-hero::before,
.reasoning-canvas.has-started .landing-hero::before {
  opacity: 0;
  transform: scale(0.98);
  filter: blur(14px);
}

.landing-mark {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(4rem, 10vw, 6.6rem);
  line-height: 0.9;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(252, 247, 238, 0.96);
  text-shadow: 0 14px 34px rgba(20, 14, 9, 0.34);
}

.landing-title {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(248, 240, 228, 0.94);
}

.landing-subtitle {
  margin: 0;
  max-width: 30ch;
  font-size: clamp(0.98rem, 1.4vw, 1.08rem);
  line-height: 1.5;
  color: rgba(236, 225, 207, 0.82);
}

.thought-layer {
  position: absolute;
  top: 74px;
  left: 50%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(680px, calc(100vw - 44px));
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(18px);
  transition: opacity 380ms ease, transform 380ms ease;
}

.reasoning-canvas.has-started .thought-layer {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.thought-card {
  position: relative;
  pointer-events: auto;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(72, 64, 55, 0.86) 0%, rgba(44, 38, 31, 0.9) 100%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.thought-card.current {
  padding: 22px 24px;
}

.thought-card.current.thinking {
  overflow: hidden;
}

.thought-card.current.thinking::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 10px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255, 245, 228, 0.06) 0%,
    rgba(255, 245, 228, 0.58) 50%,
    rgba(255, 245, 228, 0.06) 100%
  );
  transform: translateX(-100%);
  animation: thinkingSweep 1.4s ease-in-out infinite;
}

.thought-card.previous {
  width: calc(100% - 54px);
  margin-left: 26px;
  padding: 14px 18px;
  opacity: 0.42;
  transform: translateY(8px) scale(0.985);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
}

.thought-card.pulse {
  animation: thoughtPulse 480ms ease;
}

.thought-eyebrow {
  color: rgba(255, 245, 228, 0.66);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thought-card p {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: clamp(0.98rem, 1.45vw, 1.12rem);
  line-height: 1.42;
  max-width: 100%;
}

.thought-card.current p {
  max-width: 56ch;
}

.thought-card.previous p {
  max-width: 32ch;
}

.place-card {
  position: absolute;
  left: 50%;
  bottom: 112px;
  z-index: 4;
  width: min(720px, calc(100vw - 34px));
  padding: 22px 24px;
  border: 1px solid rgba(255, 247, 231, 0.16);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(49, 42, 35, 0.92) 0%, rgba(30, 26, 22, 0.95) 100%);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.24);
  transform: translateX(-50%);
  backdrop-filter: blur(26px);
  animation: cardRise 360ms ease;
}

.place-name {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 0.96;
}

.place-context {
  margin-top: 6px;
  color: rgba(230, 204, 148, 0.94);
  font-size: 0.77rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.place-why {
  margin-top: 12px;
  color: rgba(247, 242, 231, 0.86);
  line-height: 1.58;
  font-size: 1rem;
}

.place-video {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 10px 16px;
  border: 1px solid rgba(197, 164, 92, 0.3);
  border-radius: 999px;
  background: rgba(197, 164, 92, 0.12);
  color: rgba(247, 235, 204, 0.96);
  text-decoration: none;
}

.card-button {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid rgba(255, 247, 231, 0.14);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
}

.card-button.keep {
  background: rgba(95, 140, 115, 0.18);
  color: rgba(212, 242, 224, 0.96);
  border-color: rgba(95, 140, 115, 0.28);
}

.card-button.reject {
  background: rgba(201, 128, 115, 0.12);
  color: rgba(255, 224, 220, 0.94);
  border-color: rgba(201, 128, 115, 0.24);
}

.composer-shell {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 5;
  width: min(840px, calc(100vw - 34px));
  transform: translateX(-50%);
}

.status {
  margin: 0 0 8px 12px;
  color: rgba(89, 75, 53, 0.88);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 280ms ease, transform 280ms ease;
}

.reasoning-canvas.has-started .status {
  opacity: 1;
  transform: translateY(0);
}

.composer {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  gap: 14px;
  min-height: 78px;
  padding: 10px 10px 10px 22px;
  border: 1px solid rgba(255, 244, 224, 0.2);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(67, 58, 48, 0.88) 0%, rgba(38, 33, 28, 0.94) 100%);
  box-shadow:
    0 28px 54px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 248, 236, 0.14);
  backdrop-filter: blur(22px);
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.composer::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 251, 241, 0.05) 0%, rgba(255, 251, 241, 0.01) 100%);
  pointer-events: none;
}

.composer:focus-within {
  border-color: rgba(217, 186, 116, 0.42);
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.28),
    0 0 0 4px rgba(197, 164, 92, 0.12),
    inset 0 1px 0 rgba(255, 248, 236, 0.18);
  transform: translateY(-1px);
}

#composer-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  max-height: 132px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.4;
  outline: none;
  resize: none;
}

#composer-input::placeholder {
  color: rgba(246, 241, 229, 0.52);
}

#send-button {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  min-width: 58px;
  padding: 0;
  border: 1px solid rgba(255, 252, 245, 0.36);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(250, 245, 236, 0.98) 0%, rgba(239, 231, 215, 0.98) 100%);
  color: rgba(79, 58, 38, 0.96);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(30, 21, 13, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, opacity 180ms ease;
}

#send-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(30, 21, 13, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
  filter: brightness(1.02);
}

#send-button:disabled {
  opacity: 0.36;
  cursor: default;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid rgba(35, 30, 25, 0.9);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
  transition: transform 180ms ease, opacity 180ms ease;
  animation: markerAppear 280ms ease;
}

.marker.consider {
  background: rgba(205, 182, 110, 0.96);
}

.marker.deprio {
  background: rgba(212, 203, 184, 0.92);
  border-color: rgba(92, 78, 62, 0.88);
  transform: scale(0.92);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.12);
}

.marker.deprio::before,
.marker.deprio::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 2px;
  border-radius: 999px;
  background: rgba(92, 78, 62, 0.88);
}

.marker.deprio::before {
  transform: rotate(45deg);
}

.marker.deprio::after {
  transform: rotate(-45deg);
}

.marker.prio {
  background: rgba(91, 150, 113, 1);
  animation: survivorPulse 1.9s ease-in-out infinite;
}

.marker.pick {
  background: rgba(197, 164, 92, 1);
  transform: scale(1.28);
  box-shadow: 0 0 0 6px rgba(197, 164, 92, 0.2), 0 14px 24px rgba(0, 0, 0, 0.2);
}

.leaflet-tooltip.marker-label {
  padding: 4px 8px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(47, 42, 35, 0.86) !important;
  color: rgba(250, 245, 235, 0.96) !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}

.leaflet-tooltip.marker-label::before {
  display: none !important;
}

.leaflet-tooltip.marker-label.marker-label--consider {
  background: rgba(66, 57, 45, 0.82) !important;
  color: rgba(243, 233, 212, 0.95) !important;
}

.leaflet-tooltip.marker-label.marker-label--deprio {
  background: rgba(118, 99, 82, 0.82) !important;
  color: rgba(242, 230, 219, 0.94) !important;
  opacity: 0.92;
}

.leaflet-tooltip.marker-label.marker-label--prio {
  background: rgba(63, 90, 68, 0.9) !important;
  color: rgba(240, 246, 239, 0.98) !important;
}

.leaflet-tooltip.marker-label.marker-label--pick {
  background: rgba(109, 82, 34, 0.94) !important;
  color: rgba(255, 248, 234, 0.98) !important;
  box-shadow: 0 12px 28px rgba(55, 37, 11, 0.24);
}

@keyframes survivorPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(95, 140, 115, 0.32), 0 10px 18px rgba(0, 0, 0, 0.18);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(95, 140, 115, 0.08), 0 14px 24px rgba(0, 0, 0, 0.18);
  }
}

@keyframes thoughtPulse {
  0% {
    transform: translateY(10px);
    opacity: 0.7;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes thinkingSweep {
  0% {
    transform: translateX(-100%);
    opacity: 0.16;
  }

  50% {
    opacity: 0.72;
  }

  100% {
    transform: translateX(100%);
    opacity: 0.16;
  }
}

@keyframes markerAppear {
  0% {
    transform: scale(0.45);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes cardRise {
  0% {
    transform: translateX(-50%) translateY(18px);
    opacity: 0;
  }

  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .landing-hero {
    top: 10vh;
    gap: 6px;
    width: calc(100vw - 20px);
  }

  .landing-mark {
    font-size: clamp(2.7rem, 15vw, 4.4rem);
  }

  .landing-title {
    font-size: clamp(1.02rem, 4.8vw, 1.32rem);
  }

  .landing-subtitle {
    max-width: 24ch;
    font-size: 0.92rem;
  }

  .brand-bar {
    top: 10px;
  }

  .brand {
    font-size: clamp(1.7rem, 7vw, 2.2rem);
  }

  .restart-button {
    top: 10px;
    right: 12px;
    width: 38px;
    height: 38px;
  }

  .thought-layer {
    top: 48px;
    gap: 8px;
    width: calc(100vw - 20px);
  }

  .thought-card.current {
    padding: 14px 14px 15px;
    border-radius: 22px;
  }

  .thought-card.current p {
    max-width: none;
    font-size: 0.97rem;
    line-height: 1.34;
  }

  .thought-card.previous {
    display: none;
  }

  .place-card {
    bottom: 78px;
    width: calc(100vw - 16px);
    max-height: min(38dvh, 290px);
    padding: 14px 16px;
    border-radius: 22px;
    overflow: auto;
  }

  .place-name {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }

  .place-context {
    margin-top: 4px;
    font-size: 0.68rem;
  }

  .place-why {
    margin-top: 10px;
    font-size: 0.94rem;
    line-height: 1.46;
  }

  .composer-shell {
    width: calc(100vw - 14px);
    bottom: 8px;
  }

  .status {
    margin: 0 0 6px 10px;
    font-size: 0.66rem;
  }

  .composer {
    min-height: 62px;
    border-radius: 32px;
    gap: 8px;
    padding: 7px 7px 7px 14px;
  }

  #composer-input {
    width: 0;
    min-height: 28px;
    max-height: 96px;
    padding: 6px 0;
    font-size: 1rem;
    line-height: 1.32;
  }

  #send-button {
    width: 46px;
    height: 46px;
    min-width: 46px;
    font-size: 1.14rem;
  }
}

@media (max-width: 900px) and (max-height: 760px) {
  .landing-hero {
    top: 8vh;
  }

  .thought-layer {
    top: 42px;
  }

  .place-card {
    bottom: 70px;
    max-height: min(34dvh, 250px);
  }

  .composer {
    min-height: 58px;
  }

  #send-button {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }
}
