.saved-panel {
  width: var(--saved-panel-width, 360px);
  grid-template-rows: auto auto minmax(0, 1fr);
}

.sidebar-resize-handle {
  position: absolute;
  z-index: 30;
  top: 0;
  right: -6px;
  bottom: 0;
  width: 12px;
  cursor: col-resize;
}

.sidebar-resize-handle::after {
  position: absolute;
  top: 50%;
  left: 5px;
  width: 2px;
  height: 42px;
  border-radius: 2px;
  background: rgba(236, 241, 246, .38);
  content: "";
  transform: translateY(-50%);
}

.sidebar-resize-handle:hover::after,
.sidebar-resize-handle:focus-visible::after {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .16);
}

.panel-heading-actions {
  display: flex;
  gap: 6px;
}

.material-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  overflow: hidden;
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
}

.panel-resize-handle {
  position: absolute;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: -6px;
  width: 12px;
  cursor: col-resize;
}

.panel-resize-handle::after {
  position: absolute;
  top: 50%;
  left: 5px;
  width: 2px;
  height: 42px;
  border-radius: 2px;
  background: #cbd5e1;
  content: "";
  transform: translateY(-50%);
}

.panel-resize-handle:hover::after,
.panel-resize-handle:focus-visible::after {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.drawer {
  right: calc(var(--saved-panel-width, 360px) + 22px);
}

.drawer.is-map-anchored {
  right: auto;
}

.map-controls {
  right: calc(var(--saved-panel-width, 360px) + 48px);
}

.workspace.panel-unpinned .drawer {
  right: 22px;
}

.workspace.panel-unpinned .map-controls {
  right: 48px;
}

@media (max-width:980px) {
  .saved-panel { width: 310px; }
  .panel-resize-handle { display: none; }
  .sidebar-resize-handle { display: none; }
  .drawer { right: calc(310px + 18px); }
  .map-controls { right: 358px; }
}

@media (max-width:720px) {
  .saved-panel { width: 100%; }
  .drawer { right: 10px; }
  .map-controls { right: 14px; }
}

/* Keep the Google canvas flush with the workspace after layout changes. */
@media (min-width:721px) {
  .app-shell,
  .main-area {
    height: 100vh;
  }
}

/* All desktop modules use the same compact application bar. */
@media (min-width:721px) {
  #app.app-shell,
  .flight-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 62px minmax(0, 1fr);
    height: 100vh;
    min-height: 0;
  }

  #app > .sidebar,
  .flight-shell > .sidebar {
    grid-row: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
    height: 62px;
    padding: 7px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, .11);
    background: #18212b;
    scrollbar-width: none;
  }

  #app > .sidebar::-webkit-scrollbar,
  .flight-shell > .sidebar::-webkit-scrollbar {
    display: none;
  }

  #app > .main-area,
  .flight-shell > .flight-main {
    grid-row: 2;
    height: auto;
    min-height: 0;
  }

  #app > .sidebar .timezone-clock,
  .flight-shell > .sidebar .timezone-clock {
    display: flex;
    order: 0;
    flex: 0 0 180px;
    width: 180px;
    min-height: 48px;
    margin: 0;
    padding: 0 8px 0 0;
    box-sizing: border-box;
    border-right: 1px solid rgba(255, 255, 255, .16);
    border-left: 0;
    line-height: 1.1;
  }

  #app > .sidebar .timezone-analogue-clock,
  .flight-shell > .sidebar .timezone-analogue-clock {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  #app > .sidebar .timezone-clock-text,
  .flight-shell > .sidebar .timezone-clock-text {
    min-width: 126px;
    height: 44px;
  }

  #app > .sidebar .timezone-clock-value,
  .flight-shell > .sidebar .timezone-clock-value {
    font-size: 15px;
  }

  #app > .sidebar .module-switcher,
  .flight-shell > .sidebar .module-switcher {
    order: 1;
    flex: 0 0 184px;
    width: 184px;
    min-width: 184px;
    max-width: 184px;
    min-height: 36px;
    box-sizing: border-box;
    padding: 0 3px;
    border-radius: 8px;
  }

  #app > .sidebar .module-switcher .module-button.active,
  .flight-shell > .sidebar .module-switcher .module-button.active {
    flex: 1 1 0;
    width: 0;
  }

  #app > .sidebar .module-button,
  .flight-shell > .sidebar .module-button {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 11px;
  }

  #app > .sidebar .module-toggle-controls,
  .flight-shell > .sidebar .module-toggle-controls {
    display: flex;
    min-height: 26px;
  }

  #app > .sidebar .module-toggle,
  .flight-shell > .sidebar .module-toggle {
    width: 24px;
    min-height: 26px;
  }

  #app > .sidebar > .nav-group,
  #app > .sidebar > .sidebar-footer .nav-group,
  .flight-shell > .sidebar > .nav-group,
  .flight-shell > .sidebar > .sidebar-footer .nav-group {
    display: flex;
    align-items: center;
    gap: 2px;
  }

  #app > .sidebar > .nav-group,
  .flight-shell > .sidebar > .nav-group {
    order: 2;
    flex: 0 0 auto;
  }

  #app > .sidebar .nav-link,
  .flight-shell > .sidebar .nav-link {
    flex: 0 0 auto;
    min-height: 34px;
    gap: 6px;
    padding: 0 8px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 11px;
  }

  #app > .sidebar > .nav-group > .nav-link {
    flex: 0 0 92px;
    width: 92px;
  }

  .flight-shell > .sidebar > .nav-group > .nav-link {
    flex: 0 0 104px;
    width: 104px;
  }

  #app > .sidebar .nav-link [data-icon],
  .flight-shell > .sidebar .nav-link [data-icon] {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }

  #app > .sidebar .module-button > span:last-child,
  #app > .sidebar .nav-link span:not([data-icon]),
  .flight-shell > .sidebar .module-button > span:last-child,
  .flight-shell > .sidebar .nav-link span:not([data-icon]) {
    font-size: 11px;
  }

  #app > .sidebar .module-button > span:last-child,
  .flight-shell > .sidebar .module-button > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #app > .sidebar .nav-separator,
  .flight-shell > .sidebar .nav-separator {
    flex: 0 0 1px;
    width: 1px;
    height: 22px;
    margin: 0 5px;
  }

  #app > .sidebar > .sidebar-footer,
  .flight-shell > .sidebar > .sidebar-footer {
    order: 3;
    flex: 0 0 auto;
    margin: 0 0 0 auto;
  }

  #app > .sidebar .sidebar-resize-handle,
  .flight-shell > .sidebar .sidebar-resize-handle,
  .flight-shell > .sidebar .flight-sidebar-resize-handle {
    display: none;
  }
}

.workspace,
.map-canvas,
.map-canvas > div,
.map-canvas .gm-style {
  width: 100%;
  height: 100% !important;
}

/* Saved-place rows: keep the location on its own line below the place name. */
.place-row > span:nth-child(2) {
  min-width: 0;
}

.place-row .place-title,
.place-row .place-subtitle {
  display: block;
}

.place-row .place-subtitle {
  margin-top: 3px;
}

.drawer-header .icon-button {
  width: 20px;
  min-height: 20px;
  border-radius: 5px;
}

.drawer-header .icon-button [data-icon] {
  width: 10px;
  height: 10px;
  flex-basis: 10px;
}

.drawer-header {
  justify-content: space-between;
  padding: 6px 8px 5px;
}

.drawer-header .material-icon {
  width: 10px;
  height: 10px;
  font-size: 10px;
  line-height: 10px;
}

.drawer:not(.is-minimized) .drawer-image {
  margin-top: 3px;
}

.drawer-media {
  position: relative;
}

.drawer-favourite {
  position: absolute;
  top: 14px;
  right: 24px;
  z-index: 1;
  width: 30px;
  min-height: 30px;
  border-color: rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 2px 10px rgba(24, 33, 43, .18);
}

.drawer-favourite [data-icon] {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}

.drawer-minimise-button {
  color: var(--muted);
}

.drawer.is-minimized {
  top: auto;
  right: auto;
  bottom: 22px;
  left: 22px;
  width: min(300px, calc(100% - 44px));
  max-height: none;
  overflow: hidden;
  border-radius: 14px;
}

.drawer.is-minimized .drawer-media,
.drawer.is-minimized .drawer-body > :not(.drawer-title-row) {
  display: none;
}

.drawer.is-minimized .drawer-header {
  padding: 5px 7px 1px;
}

.drawer.is-minimized .drawer-header .icon-button {
  width: 24px;
  min-height: 24px;
  border: 0;
}

.drawer.is-minimized .drawer-body {
  padding: 0 14px 14px;
}

.drawer.is-minimized .drawer-title-row {
  min-height: 30px;
  align-items: center;
}

.drawer.is-minimized .drawer-title-row h2 {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer.is-minimized .drawer-address {
  display: none;
}

@media (max-width:720px) {
  .drawer.is-minimized {
    right: auto;
    bottom: calc(42% + 10px);
    left: 10px;
    width: min(300px, calc(100% - 20px));
  }
}

.category-type-icon {
  color: var(--muted);
}

.category-type-icon .material-icon {
  width: 18px;
  height: 18px;
}

.opening-status > [data-icon] {
  color: #d29218;
}

.opening-status.is-open > [data-icon] {
  color: var(--success);
}

.opening-status-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.opening-status-copy small {
  padding: 2px 6px;
  border-radius: 999px;
  background: #edf8f3;
  color: #157d59;
  font-size: 11px;
  font-weight: 700;
}

.opening-status.is-closing-soon .opening-status-copy small {
  background: #fff5e2;
  color: #a96508;
}

.opening-status.is-closed .opening-status-copy small {
  background: #f1f3f5;
  color: var(--muted);
}

.rating-mix {
  margin: 12px 0 2px;
  padding: 12px 0 2px;
  border-top: 1px solid var(--line);
}

.rating-mix-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 94px;
  align-items: center;
  gap: 16px;
}

.rating-mix-summary {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

.rating-mix-score {
  color: var(--ink);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: .88;
}

.rating-mix-state {
  margin: 12px 0 4px;
  padding: 8px 0 0;
  border: 0;
  background: transparent;
}

.rating-mix-state-copy {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.rating-mix-link {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.rating-mix-rows {
  display: grid;
  gap: 6px;
}

.rating-mix-row {
  display: grid;
  grid-template-columns: 12px minmax(36px, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
}

.rating-mix-star {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.rating-mix-track {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--line) 76%, transparent);
}

.rating-mix-track i {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--warning, #c87800);
}

.rating-mix-value {
  text-align: right;
  white-space: nowrap;
}

.rating-stars {
  display: inline-flex;
  gap: 1px;
  --rating-star-fill: var(--warning, #c87800);
  color: var(--rating-star-fill);
  font-size: 13px;
  line-height: 1;
}

.rating-star {
  color: transparent;
  background: linear-gradient(90deg, var(--rating-star-fill) var(--star-fill), color-mix(in srgb, var(--line) 84%, transparent) var(--star-fill));
  -webkit-background-clip: text;
  background-clip: text;
}

.rating-mix-total,
.rating-mix-sample {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.rating-mix-sample {
  max-width: 100%;
  margin-top: 2px;
  text-wrap: balance;
}

[data-theme="dark"] .rating-mix {
  border-color: rgba(255, 255, 255, .14);
}

[data-theme="dark"] .rating-mix-score,
[data-theme="dark"] .rating-mix-star {
  color: #f5f8fc;
}

[data-theme="dark"] .rating-mix-track {
  background: rgba(255, 255, 255, .14);
}

@media (max-width: 420px) {
  .rating-mix-content { grid-template-columns: 1fr; gap: 12px; }
  .rating-mix-summary { justify-items: start; text-align: left; }
  .rating-mix-row { grid-template-columns: 12px minmax(34px, 1fr) auto; }
}

.location-consent {
  position: relative;
  width: min(100%, 420px);
  overflow: hidden;
  border: 1px solid rgba(24, 33, 43, .12);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(11, 23, 35, .28);
}

.location-consent-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 24px;
  background: #18212b;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.location-consent-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
}

.location-consent-mark .icon-svg,
.location-consent-note .icon-svg {
  width: 16px;
  height: 16px;
}

.location-consent-close {
  position: absolute;
  z-index: 1;
  top: 13px;
  right: 13px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.location-consent-close:hover,
.location-consent-close:focus-visible {
  background: rgba(255, 255, 255, .2);
  outline: 0;
}

.location-consent-body {
  padding: 26px 28px 24px;
}

.location-consent-eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.location-consent h2 {
  margin: 7px 0 8px;
  color: var(--ink);
  font-size: 24px;
  letter-spacing: -.035em;
}

.location-consent p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.location-consent-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f3f7ff;
  color: #315a9c;
  font-size: 12px;
  font-weight: 600;
}

.location-consent-actions {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.location-consent-actions .button-primary {
  min-height: 44px;
}

.location-consent-actions .button-quiet {
  margin-top: 0;
}

.place-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.place-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 8px;
}

.place-title-line .place-title {
  min-width: 0;
}

.place-title-line .place-rating {
  flex: 0 0 auto;
  margin-top: 0;
  white-space: nowrap;
}

/* Keep the two primary drawer actions balanced; the destructive action stays
   on its own compact line beneath them. */
.drawer-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drawer-actions > :nth-child(-n + 2) {
  width: 100%;
}

.drawer-actions > :nth-child(3) {
  grid-column: 1 / -1;
  justify-self: start;
}

.save-place-modal .modal-title-input {
  min-height: 0;
  padding: 0 44px 0 0;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.save-place-modal .modal-title-input:focus {
  outline: 0;
}

.save-place-modal .modal-title-address {
  margin: -8px 0 4px;
}

.save-place-modal .modal-title-country {
  margin-top: -10px;
  color: var(--muted);
  font-size: 12px;
}

.rating-slider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  align-items: center;
  gap: 12px;
}

.form-grid .rating-slider input[type="range"] {
  min-height: 30px;
  padding: 0;
  accent-color: var(--accent);
}

.rating-slider output {
  color: var(--ink);
  font-weight: 700;
  text-align: right;
}

/* The supporting place facts should remain noticeably quieter than the title. */
.drawer .info-grid {
  gap: 7px;
  margin: 14px 0;
}

.drawer .info-item {
  gap: 8px;
  font-size: 13px;
  line-height: 1.3;
}

.drawer-country .country-flag {
  box-shadow: none;
}

.drawer .info-item > [data-icon],
.drawer .info-item .material-icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
  font-size: 15px;
}

/* Save-place collection selection follows the searchable picker pattern while
   retaining standard checkbox form values for multi-select submission. */
.collection-picker {
  width: 100%;
}

.collection-picker .country-picker-menu {
  left: 0;
  right: auto;
  width: 100%;
}

.collection-picker-option .collection-picker-check {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
  color: var(--accent);
  opacity: 0;
}

.collection-picker-option.is-selected .collection-picker-check {
  opacity: 1;
}

.collection-picker-input {
  display: none;
}
