.visited-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(246, 201, 88, 0.24), transparent 24rem),
    radial-gradient(circle at 88% 66%, rgba(232, 111, 97, 0.14), transparent 28rem),
    var(--cream);
}

.visited-shell {
  width: min(1380px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 72px;
}

.visited-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 5px 5px 0 var(--ink);
}

.visited-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.visited-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.visited-back {
  color: var(--wine-dark);
  font-size: 0.8rem;
  font-weight: 900;
}

.visited-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 34px;
  align-items: end;
  padding: 72px 8px 40px;
}

.visited-kicker {
  margin: 0 0 12px;
  color: var(--wine-dark);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.visited-hero h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.5rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
}

.visited-hero h1 em {
  color: var(--wine);
  font-style: normal;
}

.visited-hero p:not(.visited-kicker) {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  line-height: 1.85;
}

.visited-count {
  display: grid;
  padding: 24px;
  border: 2px solid var(--ink);
  border-radius: 25px;
  background: #fff4cf;
  box-shadow: 7px 7px 0 var(--ink);
  text-align: center;
}

.visited-count strong {
  color: var(--wine);
  font-size: 3rem;
  line-height: 1;
}

.visited-count span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.visited-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 24px;
  align-items: start;
}

.visited-map-card,
.visited-editor {
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--ink);
}

.visited-map-head,
.visited-map-foot {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px 20px;
}

.visited-map-head {
  border-bottom: 2px solid var(--ink);
}

.visited-map-head span,
.visited-editor-head > span {
  color: var(--wine-dark);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.visited-map-head strong {
  display: block;
  margin-top: 3px;
}

.visited-map-head p,
.visited-map-foot {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.visited-map-foot {
  border-top: 2px solid var(--ink);
}

.visited-map {
  width: 100%;
  height: 610px;
  background: #efe6d7;
}

.visited-editor {
  padding: 24px;
}

.visited-editor-head h2 {
  margin: 7px 0 20px;
  font-size: 1.45rem;
}

.visited-search label,
.visited-place-form label,
.visited-selected span {
  display: block;
  margin-bottom: 7px;
  font-size: 0.76rem;
  font-weight: 900;
}

.visited-search > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.visited-search input,
.visited-place-form input,
.visited-place-form textarea {
  width: 100%;
  border: 1.5px solid #d7c2aa;
  border-radius: 13px;
  background: #fffdf8;
}

.visited-search button,
.visited-locate,
.visited-submit,
.visited-cancel {
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.visited-search button,
.visited-submit {
  background: var(--wine);
  color: #fff;
}

.visited-locate {
  width: 100%;
  margin-top: 10px;
  background: #fff4cf;
}

.visited-cancel {
  background: #fff;
}

.visited-search-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.visited-search-result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #d7c2aa;
  border-radius: 13px;
  background: #fffdf8;
}

.visited-search-result strong,
.visited-search-result small {
  display: block;
}

.visited-search-result small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
}

.visited-search-result button {
  border: 0;
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--wine);
  color: #fff;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
}

.visited-place-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1.5px dashed #d7c2aa;
}

.visited-place-form[hidden] {
  display: none;
}

.visited-selected small,
.visited-photo-picker small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.68rem;
}

.visited-photo-picker {
  padding: 13px;
  border: 1.5px dashed #d7c2aa;
  border-radius: 14px;
  background: #fffaf0;
  cursor: pointer;
}

.visited-photo-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.visited-editor-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.visited-editor-status.is-error {
  color: #b44337;
}

.visited-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.visited-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.visited-journal {
  margin-top: 46px;
}

.visited-journal-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 20px;
}

.visited-journal-head h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.visited-journal-head > p {
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.visited-cards {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding-left: 32px;
}

.visited-cards::before {
  position: absolute;
  top: 28px;
  bottom: 28px;
  left: 10px;
  width: 2px;
  background: #d8bca2;
  content: "";
}

.visited-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(140px, 42%) 1fr;
  min-height: 190px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
}

.visited-card::before {
  position: absolute;
  top: 30px;
  left: -29px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--wine);
  content: "";
}

.visited-card.is-active {
  outline: 5px solid rgba(232, 111, 97, 0.25);
}

.visited-card-photo {
  min-height: 190px;
  background: #f4e4bf;
}

.visited-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visited-card-photo span {
  display: grid;
  height: 100%;
  min-height: 190px;
  place-items: center;
  color: #aa8b61;
  font-size: 2rem;
}

.visited-card-copy {
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.visited-card-copy time {
  color: var(--wine-dark);
  font-size: 0.68rem;
  font-weight: 900;
}

.visited-card-copy h3 {
  margin: 7px 0 9px;
  font-size: 1.18rem;
}

.visited-card-copy p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.visited-delete {
  align-self: flex-start;
  margin-top: 13px;
  padding: 5px 10px;
  border: 1px solid #d8a49c;
  border-radius: 999px;
  background: #fff;
  color: var(--wine-dark);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
}

.visited-empty {
  grid-column: 1 / -1;
  padding: 44px 24px;
  border: 1.5px dashed #d7c2aa;
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

.visited-pin {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 10px;
  background: var(--wine);
  box-shadow: 0 3px 15px rgba(75, 56, 42, 0.32);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  transform: rotate(-45deg);
}

.visited-pin span {
  transform: rotate(45deg);
}

@media (max-width: 980px) {
  .visited-hero,
  .visited-layout {
    grid-template-columns: 1fr;
  }

  .visited-hero {
    padding-top: 50px;
  }

  .visited-count {
    max-width: 260px;
  }
}

@media (max-width: 700px) {
  .visited-shell {
    width: min(100% - 24px, 1380px);
    padding-top: 12px;
  }

  .visited-topbar {
    border-radius: 18px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .visited-hero h1 {
    font-size: 3.1rem;
  }

  .visited-map-card,
  .visited-editor {
    border-radius: 22px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .visited-map-head,
  .visited-journal-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .visited-map {
    height: 440px;
  }

  .visited-cards {
    grid-template-columns: 1fr;
    padding-left: 26px;
  }

  .visited-card {
    grid-template-columns: 130px 1fr;
  }
}

@media (max-width: 470px) {
  .visited-card {
    grid-template-columns: 1fr;
  }

  .visited-card-photo,
  .visited-card-photo span {
    min-height: 190px;
  }

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

  .visited-cancel,
  .visited-submit {
    width: 100%;
  }
}
