:root {
  --gk-sheet-offset: 42%;
  --gk-visual-height: 100dvh;
  --gk-keyboard-inset: 0px;
}

body.gk-workspace-ready {
  height: 100vh !important;
  height: 100dvh !important;
  overflow: hidden !important;
  background: var(--ui-bg) !important;
}

.gk-workspace-shell {
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.gk-feature-workspace {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(350px, 430px) minmax(0, 1fr);
  overflow: hidden;
  background: var(--ui-bg);
}

.gk-workspace-sheet {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding-top: 58px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  color: var(--ui-text);
  border-right: 1px solid var(--ui-border);
  background: color-mix(in srgb, var(--ui-surface) 97%, transparent);
  box-shadow: 18px 0 48px rgba(20, 49, 40, .08);
  z-index: 4;
}

.gk-sheet-handle {
  display: none;
}

.gk-sheet-chrome {
  min-height: 58px;
  padding: 0 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.gk-sheet-chrome-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.gk-sheet-eyebrow {
  color: var(--ui-brand);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.15px;
  text-transform: uppercase;
}

.gk-sheet-title {
  overflow: hidden;
  color: var(--ui-text);
  font: 750 18px/1.2 "Manrope", sans-serif;
  letter-spacing: -.45px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gk-sheet-state-button {
  display: none;
}

.gk-workspace-tabs {
  min-width: 0;
  padding: 0 18px 14px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--ui-border);
}

.gk-workspace-tabs::-webkit-scrollbar {
  display: none;
}

.gk-workspace-tab {
  min-height: 42px;
  padding: 0 16px;
  flex: 0 0 auto;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  color: var(--ui-muted);
  background: var(--ui-surface-soft);
  font: 750 11px "DM Sans", sans-serif;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.gk-workspace-tab:hover {
  color: var(--ui-text);
  border-color: color-mix(in srgb, var(--ui-brand) 24%, var(--ui-border));
  background: var(--ui-surface);
  transform: translateY(-1px);
}

.gk-workspace-tab[aria-selected="true"] {
  color: #fff;
  border-color: var(--ui-nav);
  background: var(--ui-nav);
  box-shadow: 0 8px 20px rgba(20, 52, 43, .18);
}

.gk-workspace-tab:focus-visible,
.gk-sheet-handle:focus-visible,
.gk-sheet-state-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ui-brand) 28%, transparent);
  outline-offset: 2px;
}

.gk-workspace-scroll {
  min-width: 0;
  min-height: 0;
  padding: 18px 18px 34px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ui-muted) 28%, transparent) transparent;
}

.gk-workspace-tab-panel {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.gk-workspace-tab-panel[hidden] {
  display: none !important;
}

.gk-workspace-tab-panel > :where(.tool-card, .natural-planner, .day-layout, .best-time-results, .compare-results, .halfway-results, .day-results, .tool-results-stack) {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.gk-workspace-tab-panel .tool-card,
.gk-workspace-tab-panel .natural-planner {
  border-radius: 22px;
  box-shadow: none;
}

.gk-workspace-tab-panel .tool-header {
  margin: 0 0 2px;
  display: block;
}

.gk-workspace-tab-panel .tool-header h1 {
  margin: 6px 0 8px;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  letter-spacing: -1.65px;
}

.gk-workspace-tab-panel .tool-header-copy > p:last-child {
  font-size: 12px;
  line-height: 1.55;
}

.gk-workspace-tab-panel .tool-capabilities {
  margin-top: 13px;
  justify-content: flex-start;
}

.gk-workspace-tab-panel :where(.route-form-grid, .route-timing-grid, .weather-form-grid, .crowd-form-grid, .best-time-place-grid, .best-time-window-grid, .compare-origin-row, .halfway-options-grid, .day-settings-grid) {
  grid-template-columns: 1fr;
}

.gk-workspace-tab-panel :where(.tool-content-grid, .best-time-content-grid, .compare-detail-grid, .halfway-content-grid, .day-result-grid, .route-intelligence-grid, .journey-companion-grid, .day-layout) {
  grid-template-columns: 1fr;
}

.gk-workspace-tab-panel .tool-results-stack {
  display: grid;
  gap: 12px;
}

.gk-workspace-tab-panel .tool-insights-grid,
.gk-workspace-tab-panel .day-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gk-workspace-tab-panel .tool-insight-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.gk-workspace-tab-panel .best-time-recommendation,
.gk-workspace-tab-panel .halfway-winner {
  grid-template-columns: 1fr;
}

.gk-workspace-tab-panel .best-time-score,
.gk-workspace-tab-panel .halfway-score {
  width: 100%;
  min-height: 100px;
}

.gk-workspace-tab-panel .route-preference-grid,
.gk-workspace-tab-panel .best-time-priority-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gk-workspace-tab-panel .compare-destinations,
.gk-workspace-tab-panel .halfway-travellers {
  grid-template-columns: 1fr;
}

.gk-workspace-map-pane {
  position: relative;
  /* Keep map search and provider controls below an expanded results sheet. */
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 10%, color-mix(in srgb, var(--ui-brand) 8%, transparent), transparent 35%),
    var(--ui-bg);
}

.gk-workspace-map-pane > .gk-workspace-map-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 22px 58px rgba(18, 53, 42, .12);
}

.gk-workspace-map-pane > .gk-workspace-map-card > .tool-card-heading {
  position: absolute;
  z-index: 3;
  top: 16px;
  left: 16px;
  right: 16px;
  width: auto;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--ui-border) 75%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--ui-surface) 88%, transparent);
  box-shadow: 0 12px 34px rgba(16, 42, 34, .12);
  backdrop-filter: blur(15px);
}

.gk-workspace-map-pane .tool-map-canvas {
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
  border: 0;
  border-radius: inherit;
}

.gk-workspace-map-pane .tool-provider-attribution,
.gk-workspace-map-pane .google-maps-attribution {
  position: absolute;
  z-index: 3;
  right: 10px;
  bottom: 8px;
  margin: 0;
  padding: 4px 7px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--ui-surface) 88%, transparent);
  backdrop-filter: blur(10px);
}

.gk-map-status {
  position: absolute;
  z-index: 4;
  left: 30px;
  bottom: 30px;
  max-width: min(420px, calc(100% - 60px));
  min-height: 46px;
  padding: 8px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--ui-border) 76%, transparent);
  border-radius: 14px;
  color: var(--ui-text);
  background: color-mix(in srgb, var(--ui-surface) 91%, transparent);
  box-shadow: 0 13px 34px rgba(15, 42, 33, .16);
  backdrop-filter: blur(15px);
}

.gk-map-status-brand {
  padding: 5px 7px;
  border-radius: 7px;
  color: #fff;
  background: var(--ui-nav);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .4px;
}

.gk-map-status-summary {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-tool-page .gk-workspace-map-pane > .gk-workspace-map-card > .tool-card-heading {
  display: none;
}

.route-tool-page .gk-map-status.gk-map-search {
  z-index: 70;
  top: 18px;
  right: auto;
  bottom: auto;
  left: 50%;
  width: min(560px, calc(100% - 120px));
  max-width: none;
  min-height: 0;
  padding: 7px;
  display: grid;
  gap: 6px;
  border-radius: 18px;
  transform: translateX(-50%);
}

.gk-map-search-input-host {
  position: relative;
  width: 100%;
  min-height: 48px;
  padding: 0 8px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--ui-surface);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.gk-map-search-input-host:focus-within {
  border-color: color-mix(in srgb, var(--ui-brand) 45%, var(--ui-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-brand) 12%, transparent);
}

.gk-map-search-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--ui-brand);
}

.gk-map-search-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

body .gk-map-search-input {
  width: 100%;
  height: 46px;
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  color: var(--ui-text) !important;
  background: transparent !important;
  box-shadow: none !important;
  font: 650 14px "DM Sans", sans-serif;
  -webkit-appearance: none;
}

body .gk-map-search-input:focus {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.gk-map-search-input::-webkit-search-cancel-button {
  display: none;
}

.gk-map-search-clear {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ui-muted);
  background: var(--ui-surface-soft);
  font-size: 20px;
  cursor: pointer;
}

.gk-map-search-clear[hidden] {
  display: none;
}

.gk-map-search-selection {
  min-width: 0;
  min-height: 44px;
  padding: 7px 9px 7px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ui-success) 8%, var(--ui-surface));
}

.gk-map-search-selection[hidden] {
  display: none;
}

.gk-map-search-selection-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.gk-map-search-selection-name,
.gk-map-search-selection-distance {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gk-map-search-selection-name {
  color: var(--ui-text);
  font-size: 10px;
}

.gk-map-search-selection-distance {
  color: var(--ui-muted);
  font-size: 8px;
}

.gk-map-search-ready {
  margin-left: auto;
  padding: 6px 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--ui-success);
  background: color-mix(in srgb, var(--ui-success) 11%, var(--ui-surface));
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.gk-map-search .goknowing-place-predictions {
  top: calc(100% + 8px);
  max-height: min(310px, calc(var(--gk-visual-height, 100dvh) - 100px));
  border-radius: 14px;
  text-align: left;
}

@media (min-width: 901px) and (max-width: 1120px) {
  .gk-feature-workspace {
    grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  :root {
    --gk-sheet-offset: 42%;
  }

  .gk-feature-workspace {
    position: relative;
    display: block;
    height: 100vh;
    height: 100dvh;
  }

  .gk-workspace-map-pane {
    position: absolute;
    inset: 0;
    padding: 0;
  }

  .gk-workspace-map-pane > .gk-workspace-map-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .gk-workspace-map-pane > .gk-workspace-map-card > .tool-card-heading {
    top: max(68px, calc(env(safe-area-inset-top) + 54px));
    left: auto;
    right: 13px;
    max-width: min(260px, calc(100% - 82px));
    padding: 8px 10px;
  }

  .gk-workspace-map-pane > .gk-workspace-map-card > .tool-card-heading .tool-kicker,
  .gk-workspace-map-pane > .gk-workspace-map-card > .tool-card-heading .tool-live-status,
  .gk-workspace-map-pane > .gk-workspace-map-card > .tool-card-heading .tool-heading-note {
    display: none;
  }

  .gk-workspace-map-pane > .gk-workspace-map-card > .tool-card-heading h2 {
    margin: 0;
    font-size: 11px;
  }

  .gk-map-status {
    top: max(16px, env(safe-area-inset-top));
    right: 14px;
    bottom: auto;
    left: 68px;
    min-height: 42px;
    max-width: none;
  }

  .route-tool-page .gk-map-status.gk-map-search {
    top: max(12px, env(safe-area-inset-top));
    right: 62px;
    left: 66px;
    width: auto;
    padding: 5px;
    transform: none;
  }

  .gk-map-search-input-host {
    min-height: 44px;
  }

  body .gk-map-search-input {
    height: 42px;
    font-size: 16px !important;
  }

  .gk-map-search-selection {
    min-height: 40px;
  }

  .gk-workspace-sheet {
    --gk-sheet-offset: 42%;
    position: fixed;
    z-index: 55;
    right: 0;
    bottom: var(--gk-keyboard-inset);
    left: 0;
    width: 100%;
    height: min(88dvh, calc(var(--gk-visual-height) - 8px));
    min-height: 280px;
    padding: 0;
    grid-template-rows: 28px auto auto minmax(0, 1fr);
    border: 1px solid var(--ui-border);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background: color-mix(in srgb, var(--ui-surface) 98%, transparent);
    box-shadow: 0 -18px 54px rgba(10, 34, 26, .2);
    transform: translateY(var(--gk-sheet-offset));
    transition: transform .26s cubic-bezier(.2, .75, .25, 1), height .18s ease, bottom .18s ease;
    will-change: transform;
  }

  .gk-workspace-sheet[data-sheet-state="collapsed"] {
    --gk-sheet-offset: calc(100% - 126px);
  }

  .gk-workspace-sheet[data-sheet-state="half"] {
    --gk-sheet-offset: 42%;
  }

  .gk-workspace-sheet[data-sheet-state="expanded"] {
    --gk-sheet-offset: 0%;
  }

  .gk-workspace-sheet.is-dragging {
    transition: none;
  }

  .gk-sheet-handle {
    width: 100%;
    height: 28px;
    padding: 0;
    border: 0;
    display: grid;
    place-items: center;
    touch-action: none;
    cursor: ns-resize;
    background: transparent;
  }

  .gk-sheet-handle-bar {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ui-muted) 38%, transparent);
  }

  .gk-sheet-chrome {
    min-height: 48px;
    padding: 0 16px 9px;
  }

  .gk-sheet-title {
    font-size: 16px;
  }

  .gk-sheet-state-button {
    width: auto;
    min-width: 70px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    display: grid;
    grid-auto-flow: column;
    place-items: center;
    color: var(--ui-text);
    background: var(--ui-surface-soft);
    cursor: pointer;
  }

  .gk-sheet-state-button b {
    margin-left: 5px;
    font: 750 11px "DM Sans", sans-serif;
  }

  .gk-sheet-state-button span {
    transition: transform .2s ease;
  }

  .gk-sheet-state-button.is-expanded span {
    transform: rotate(180deg);
  }

  .gk-workspace-tabs {
    padding: 0 12px 12px;
    gap: 7px;
  }

  .gk-workspace-tab {
    min-height: 40px;
    padding: 0 14px;
    font-size: 10px;
  }

  .gk-workspace-scroll {
    padding: 14px 12px calc(28px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .gk-workspace-tab-panel {
    gap: 12px;
  }

  .gk-workspace-tab-panel .tool-card,
  .gk-workspace-tab-panel .natural-planner {
    padding: 17px;
    border-radius: 16px;
  }

  .gk-workspace-tab-panel .tool-header {
    padding: 2px 4px 4px;
  }

  .gk-workspace-tab-panel .tool-header h1 {
    font-size: 1.72rem;
  }

  .gk-workspace-tab-panel .tool-capabilities {
    display: none;
  }

  .gk-workspace-tab-panel :where(input, textarea, select) {
    font-size: 16px !important;
  }

  .gk-workspace-tab-panel .tool-insights-grid,
  .gk-workspace-tab-panel .day-summary-grid,
  .gk-workspace-tab-panel .route-preference-grid,
  .gk-workspace-tab-panel .best-time-priority-grid {
    grid-template-columns: 1fr;
  }

  .gk-workspace-tab-panel .tool-insight-card:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .gk-workspace-tab-panel .tool-primary-button,
  .gk-workspace-tab-panel .routine-primary {
    min-height: 48px;
  }

  .gk-workspace-tab-panel .goknowing-place-predictions {
    max-height: min(260px, calc(var(--gk-visual-height) * .42));
  }

  body:has(.goknowing-sidebar.open) .gk-workspace-sheet {
    pointer-events: none;
  }
}

@media (max-width: 520px) {
  .gk-workspace-tab {
    padding: 0 13px;
    font-size: 10px;
  }

  .gk-map-search-ready {
    display: none;
  }

  .gk-workspace-tab-panel .tool-card-heading {
    align-items: flex-start;
  }

  .gk-workspace-tab-panel .tool-heading-note {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gk-workspace-sheet,
  .gk-workspace-tab,
  .gk-sheet-state-button span {
    transition: none !important;
  }
}
