.sheet-backdrop { display: none; }
.sheet {
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--paper);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-2);
  transform: translateY(calc(100% - 92px));
  transition: transform 280ms ease;
  will-change: transform;
}
.sheet.is-open { transform: translateY(0); }
.sheet-handle-zone { padding: 10px 16px 4px; touch-action: none; cursor: grab; }
.sheet-close { display: none; }
.sheet-handle {
  display: block;
  width: 40px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: var(--line);
}
.sheet-header { display: flex; align-items: center; gap: 8px; padding: 0 16px 8px; flex-shrink: 0; }
.sheet-head { min-height: 34px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sheet-body {
  flex: 1;
  min-height: 0;
  max-height: calc(76vh - 92px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 16px calc(20px + var(--safe-b));
}
.sheet-section { padding: 12px 0; border-top: 1px solid var(--line); }
.sheet-section:first-child { border-top: 0; padding-top: 4px; }
.location-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  box-shadow: var(--shadow-1);
}
.location-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #e8f0fe;
  color: var(--teal);
  font-size: 20px;
}
.location-card-copy { flex: 1; min-width: 0; }
.location-card-title { font-size: var(--fs-14); font-weight: 600; }
.location-card-subtitle { margin-top: 2px; font-size: var(--fs-12); color: var(--text-muted); }
.location-card-action {
  min-height: 44px;
  min-width: 44px;
  color: var(--teal);
  font-size: var(--fs-12);
  font-weight: 600;
  white-space: nowrap;
}
.location-card-action:hover { color: var(--teal-dark); }
.sheet-title { font-size: var(--fs-20); line-height: 1.25; }
.sheet-sub { font-size: var(--fs-12); color: var(--text-muted); margin-top: 4px; }
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--mist);
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--text-muted);
}
.status-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
}
.status-chip.is-warn::before { background: var(--amber); }
.status-chip.is-off::before { background: var(--text-muted); }
.dir-fields { display: flex; flex-direction: column; gap: 10px; }
.dir-field { display: flex; flex-direction: column; gap: 4px; }
.dir-input {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 16px;
  text-align: left;
  width: 100%;
}
input.dir-input { text-align: left; }
.dir-input:focus { outline: 2px solid var(--teal); outline-offset: -1px; }
.dir-results { display: flex; flex-direction: column; gap: 4px; }
.dir-results[hidden] { display: none; }
.seg {
  display: flex;
  margin-top: 12px;
  padding: 4px;
  background: var(--mist);
  border-radius: 999px;
}
.seg-btn {
  flex: 1;
  min-height: 44px;
  border-radius: 999px;
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--text-muted);
}
.seg-btn.is-active { background: var(--teal); color: var(--paper); }
.dir-options { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.dir-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dir-select { font-size: 16px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); padding: 0 8px; }
.dir-toggle input { width: 18px; height: 18px; accent-color: var(--teal); }
.dir-summary { margin-top: 14px; }
.dir-summary-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; }
.dir-summary-main { font-size: var(--fs-16); font-weight: 600; }
.dir-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
@media (max-width: 899px) {
  .sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 900;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 280ms ease-out;
  }
  .sheet-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  .sheet {
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    height: 58vh;
    height: min(58dvh, 560px);
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.18);
    transform: translateY(100%);
    transition: transform 280ms ease-out;
  }
  .sheet.is-open { transform: translateY(0); }
  .sheet-handle-zone {
    position: relative;
    padding: 12px 16px 8px;
  }
  .sheet-handle { width: 36px; margin-bottom: 12px; }
  .sheet-close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
  }
  .sheet-close:hover { background: var(--mist); color: var(--ink); }
  .sheet-body {
    height: auto;
    max-height: none;
    padding-bottom: calc(20px + var(--safe-b));
  }
}
@media (min-width: 900px) {
  .sheet {
    display: none;
    left: 88px;
    right: auto;
    bottom: 24px;
    top: 140px;
    width: 380px;
    border-radius: var(--radius-lg);
    transform: none;
  }
  .sheet.is-open { display: flex; transform: none; }
  .sheet-handle-zone { display: none; }
  .sheet-header { padding-top: 16px; }
  .sheet-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    height: 44px;
    border-radius: 999px;
    font-size: 24px;
    line-height: 1;
  }
  .sheet-close:hover { background: var(--mist); }
  .sheet-body { max-height: none; height: auto; }
  body[data-tab="directions"] .sheet { width: 420px; top: 96px; }
}
.sidebar-rail { display: none; }
@media (min-width: 900px) {
  .sidebar-rail {
    position: fixed;
    top: 108px;
    left: 16px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 56px;
    padding: 8px 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
    box-shadow: var(--shadow-1);
  }
  .rail-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 48px;
    padding: 4px 0;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
  }
  .rail-action:hover { background: #e8f0fe; color: var(--teal); }
  .rail-icon { font-size: 20px; line-height: 1; }
}
