/* The application shell: a quiet top bar, five permanent destinations, one atlas. */
:root {
  --nav-height: 86px;
  --shell-height: 76px;
}
/* Keep page landmarks for assistive technology without repeating the navigation. */
.named-by-navigation #collection-title,
#collections-page > .page-heading h1,
#album-page > .album-heading h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.named-by-navigation #collection-label,
#collections-page > .page-heading .eyebrow,
#album-page > .album-heading .eyebrow {
  display: none;
}
.named-by-navigation .journal-intro {
  padding-top: 16px;
}
.named-by-navigation #collection-description:empty {
  display: none;
}
.named-by-navigation .collection-actions {
  margin-top: 0;
}
.guest-browsing .journal-intro {
  padding-block: 16px;
}
.guest-browsing #collection-description {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.guest-browsing #collection-actions {
  display: none;
}
.masthead #account-nav .guest-signin {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px;
  font-size: 14px;
  font-weight: 400;
  border: 0;
  white-space: nowrap;
  color: var(--muted);
}
.guest-browsing #primary-navigation {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-inline: max(12px, calc((100vw - 440px) / 2));
}
.guest-invitation {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 20px var(--space) 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
}
.guest-invitation > div {
  flex: 1;
}
.guest-invitation p {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 25px;
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--wine);
}
.guest-invitation button {
  min-height: 44px;
  padding: 8px 0;
  font-size: 14px;
}
.guest-invitation #dismiss-invitation {
  flex-shrink: 0;
  min-width: 44px;
  font-size: 23px;
  color: var(--muted);
}
.membership-welcome-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.selection-empty {
  max-width: 430px;
  margin-inline: auto;
}
.named-by-navigation
  .journal-intro:has(#collection-actions[hidden]):has(#stats[hidden]):has(
    #collection-description:empty
  ) {
  padding-block: 0;
}
[hidden] {
  display: none !important;
}
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: auto;
  min-height: 76px;
  gap: 16px;
  flex-wrap: nowrap;
  padding: calc(10px + env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right)) 10px
    max(24px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
}
.masthead .wordmark {
  font-size: 36px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.masthead .wordmark > span {
  display: none;
}
.masthead .wordmark .brand-underline {
  width: 76px;
  height: 12px;
  margin: 3px auto 0;
}
.masthead #header-tools {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  margin: 0 0 0 auto;
  width: auto;
}
.masthead .language-picker {
  display: flex;
  align-items: center;
  margin: 0;
  gap: 0;
}
.masthead .language-picker > span {
  display: none;
}
.masthead #language-switch {
  width: 66px;
  min-width: 0;
  min-height: 44px;
  font-size: 16px;
  border: 0;
  background-color: transparent;
  padding: 8px 18px 8px 8px;
  color: var(--wine);
}
.masthead #account-nav {
  display: flex;
  flex-direction: row;
  width: auto;
  align-items: center;
}
.masthead #account-nav .account-identity {
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  min-height: 44px;
  max-width: 230px;
  border: 1px solid var(--line);
  border-radius: 24px;
  font-size: 14px;
}
.masthead #account-nav .account-identity svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.masthead #account-nav .account-identity > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.masthead #account-nav .account-identity small {
  display: none;
}
.bottom-navigation {
  position: fixed;
  z-index: 1100;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  gap: 4px;
  margin: 0;
  padding: 5px max(16px, calc((100vw - 800px) / 2), env(safe-area-inset-right))
    max(5px, env(safe-area-inset-bottom))
    max(16px, calc((100vw - 800px) / 2), env(safe-area-inset-left));
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px #36261c06;
}
#primary-navigation .nav-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 70px;
  gap: 5px;
  padding: 7px 4px;
  margin: 0;
  font-size: 13px;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: normal;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}
#primary-navigation .nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
#primary-navigation .nav-label {
  max-width: 100%;
}
#primary-navigation .nav-link::after {
  display: none;
}
#primary-navigation .nav-link.active {
  color: var(--wine-dark);
  background: #efe7dc;
  font-weight: 600;
}
#primary-navigation .nav-link:hover {
  background: #eee7dc;
  color: var(--wine);
}
#primary-navigation .selection-link {
  gap: 1px;
}
#primary-navigation .selection-brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 19px;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
#primary-navigation .brand-underline {
  display: block;
  position: static;
  width: 64px;
  height: 12px;
  opacity: 1;
  margin: 1px auto 0;
  color: var(--gold);
}
#primary-navigation .active .brand-underline {
  color: var(--wine);
}
button:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 3px;
}
#atlas,
#atlas.restaurant-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, var(--map-track, 50fr)) 46px minmax(
      0,
      var(--list-track, 50fr)
    );
  grid-template-areas: "map" "controls" "journal";
  height: calc(100dvh - var(--shell-height) - var(--nav-height));
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
#atlas.private-landing {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "journal";
}
#atlas.private-landing .map-panel {
  display: none;
}
#atlas[data-map-split="0"] .map-panel,
#atlas[data-map-split="100"]:not(.private-landing) .journal-panel {
  visibility: hidden;
  pointer-events: none;
}
body:has(#atlas[data-map-split="100"]:not([hidden])) #quick-add {
  display: none;
}
.workspace-controls {
  grid-area: controls;
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  min-height: 0;
  padding: 0 6px;
  border-block: 1px solid var(--line);
  background: #f5f0e8;
  cursor: row-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 2;
}
#workspace-divider {
  flex: 1;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 5px;
  outline-offset: -4px;
}
.split-grip {
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: #b4a491;
  transition: background-color 120ms;
}
#workspace-divider:focus-visible {
  outline: 2px solid var(--wine);
}
.workspace-controls:hover .split-grip,
.split-resizing .split-grip {
  background: var(--wine);
}
.workspace-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  padding: 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--wine);
  cursor: pointer;
  touch-action: manipulation;
}
.workspace-controls button:hover:not(:disabled) {
  background: #e9e0d4;
}
.workspace-controls button:disabled {
  opacity: 0.25;
  cursor: default;
}
.workspace-controls button:focus-visible {
  outline-offset: -4px;
}
.workspace-controls svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 22px;
  height: 22px;
}
#atlas .journal-panel {
  grid-area: journal;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  padding: 0;
  border: 0;
}
#atlas .map-panel {
  grid-area: map;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  width: 100%;
  border: 0;
}
#atlas #map {
  height: 100%;
  min-height: 0;
}
#journal-list-view {
  max-width: 900px;
  margin-inline: auto;
  padding-bottom: 92px;
}
#restaurant-view {
  max-width: 980px;
  margin-inline: auto;
}
#collections-page,
#album-page {
  height: calc(100dvh - var(--shell-height) - var(--nav-height));
  min-height: 0;
  overflow-y: auto;
}
#quick-add {
  position: fixed;
  bottom: calc(var(--nav-height) + 18px);
  right: max(22px, env(safe-area-inset-right));
  z-index: 1050;
}
#toast {
  bottom: calc(var(--nav-height) + 84px);
}
.restaurant-sheet .visit-summary {
  padding-inline: 20px;
}
.restaurant-sheet .visit-body {
  padding-inline: 20px;
}
.visit-journal-preview {
  padding-inline: 20px;
}
@media (max-width: 760px), (max-width: 960px) and (max-height: 500px) {
  :root {
    --nav-height: 85px;
  }
  .masthead,
  .masthead:has(nav button[hidden]) {
    min-height: 68px;
    padding: calc(8px + env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right)) 8px
      max(20px, env(safe-area-inset-left));
    gap: 8px;
  }
  .masthead .wordmark {
    font-size: 32px;
  }
  .masthead #header-tools {
    gap: 4px;
  }
  .masthead #account-nav .account-identity {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 10px;
    border-color: var(--line);
  }
  .masthead #account-nav .account-identity > span,
  .masthead .membership-link {
    display: none;
  }
  #primary-navigation {
    gap: 1px;
    padding: 4px max(4px, env(safe-area-inset-right))
      max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
  }
  #primary-navigation .nav-link {
    min-height: 72px;
    padding: 5px 2px;
    font-size: 12px;
    gap: 4px;
  }
  #primary-navigation .nav-label {
    max-width: 90px;
  }
  #primary-navigation .selection-link {
    gap: 2px;
  }
  #primary-navigation .selection-brand {
    font-size: 16px;
  }
  #primary-navigation .brand-underline {
    width: 52px;
    height: 10px;
  }
  .journal-intro {
    padding-top: 20px;
  }
  .journal-intro h1 {
    font-size: 36px;
    margin-block: 8px 12px;
  }
  .personal-journal #collection-label {
    display: none;
  }
  .personal-journal .journal-intro h1 {
    margin-top: 0;
  }
  .personal-journal .collection-actions {
    margin: 0 0 8px;
    justify-content: flex-end;
  }
  /* The persistent + action already provides visit/address creation on phones. */
  .personal-journal #collection-actions [data-action="log"],
  .personal-journal #collection-actions:has([data-action="log"]:only-child) {
    display: none;
  }
  .personal-journal #collection-actions [data-action="sharing"] {
    min-height: 44px;
    padding: 8px 0;
    border: 0;
    background: transparent;
  }
  .personal-journal .stats {
    margin: 0 0 8px;
    padding: 8px 0;
    gap: 12px;
  }
  .personal-journal .stats > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .personal-journal .stats > div + div {
    padding-left: 12px;
  }
  .personal-journal .stats strong {
    font-size: 22px;
  }
  .personal-journal .stats span {
    font-size: 12px;
    margin: 0;
    text-transform: none;
  }
  #atlas .leaflet-top .leaflet-control-zoom {
    margin-top: 12px;
  }
  #atlas .map-fit {
    left: auto;
    right: 12px;
    top: 12px;
  }
  .restaurant-sheet .visit-summary,
  .restaurant-sheet .visit-body,
  .visit-journal-preview {
    padding-inline: 16px;
  }
  #quick-add {
    bottom: calc(var(--nav-height) + 16px);
    right: max(18px, env(safe-area-inset-right));
  }
  #toast {
    bottom: calc(var(--nav-height) + 84px);
  }
}
@media (max-width: 359px) {
  .masthead #account-nav .guest-signin {
    padding-inline: 2px;
  }
  .masthead .wordmark {
    font-size: 29px;
  }
  .masthead {
    padding-inline: 14px;
  }
  #primary-navigation .nav-link {
    font-size: 11px;
  }
  #primary-navigation .selection-brand {
    font-size: 14px;
  }
}
@media (max-height: 500px) and (max-width: 960px) {
  #primary-navigation .nav-link {
    min-height: 52px;
    flex-direction: row;
    gap: 6px;
  }
  #primary-navigation .selection-link {
    flex-direction: column;
    gap: 0;
  }
}

/* Orientation, not a device-width guess, decides the direction of the split. */
@media (orientation: landscape) {
  #atlas,
  #atlas.restaurant-open {
    grid-template-columns: minmax(0, var(--list-track, 50fr)) 46px minmax(
        0,
        var(--map-track, 50fr)
      );
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "journal controls map";
  }
  #atlas.private-landing {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "journal";
  }
  .workspace-controls {
    flex-direction: column;
    padding: 6px 0;
    border-block: 0;
    border-inline: 1px solid var(--line);
    cursor: col-resize;
  }
  #workspace-divider {
    min-width: 44px;
  }
  .split-grip {
    width: 4px;
    height: 36px;
  }
  .workspace-controls svg {
    transform: rotate(90deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .split-grip {
    transition: none;
  }
}
