/* Newer look for sites that opt in. Every rule starts with a body class that
   js/look.js adds from the site's settings (look-search, look-panel, look-sheet), so
   a site that sets none of them is not changed by this file.
   Sites can change these colors in their own style.css:
     --look-ink, --look-muted, --look-line, --look-done, --look-todo, --look-font */

body.look-search,
body.look-panel,
body.look-sheet {
  --look-ink: #1f2933;
  --look-muted: #52606d;
  --look-line: #d9dee3;
  --look-done: #15803d;
  --look-todo: #606873;
  --look-focus: #0b5cad;
  --look-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Keyboard focus: always visible and the same on every control. */
body.look-search :focus-visible,
body.look-panel :focus-visible,
body.look-sheet :focus-visible {
  outline: 3px solid var(--look-focus);
  outline-offset: 2px;
}
body.look-search .sr-only,
body.look-search .sb-live,
body.look-search .sb-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/********** Search box **********/
body.look-search #search-box {
  height: auto;
  width: 360px;
  padding: 0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.28);
  font-family: var(--look-font);
  color: var(--look-ink);
}
body.look-search .sb-field {
  position: relative;
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 6px 0 14px;
}
body.look-search .sb-icon {
  font-size: 18px;
  color: var(--look-muted);
  margin-right: 10px;
}
body.look-search #search-box .sb-input {
  position: static;
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 18px;
  color: var(--look-ink);
  outline: none;
}
body.look-search .sb-input::placeholder {
  color: #6b7580;
}
body.look-search .sb-field:focus-within {
  border-radius: 14px;
  box-shadow: inset 0 0 0 3px var(--look-focus);
}
body.look-search .sb-btn {
  flex: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  font-size: 20px;
  color: var(--look-muted);
  cursor: pointer;
}
body.look-search .sb-btn[hidden] {
  display: none;
}
body.look-search .sb-btn:hover {
  background: #eef1f4;
}
body.look-search .sb-locate {
  color: var(--look-focus);
}
body.look-search .sb-locate.busy .fa:before {
  content: "\f110";
}
body.look-search .sb-locate.busy .fa {
  animation: sb-spin 1s steps(8) infinite;
}
@keyframes sb-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  body.look-search .sb-locate.busy .fa { animation: none; }
}

body.look-search .sb-list {
  margin: 0;
  padding: 4px 0 6px;
  list-style: none;
  border-top: 1px solid var(--look-line);
}
body.look-search .sb-list[hidden],
body.look-search .sb-card[hidden] {
  display: none;
}
body.look-search .sb-list li {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 16px;
  font-size: 16px;
  color: var(--look-ink);
  cursor: pointer;
}
body.look-search .sb-list li .fa {
  width: 22px;
  color: var(--look-muted);
}
body.look-search .sb-list li b {
  font-weight: 700;
}
body.look-search .sb-list li:hover,
body.look-search .sb-list li.active {
  background: #e8f0f8;
}
body.look-search .sb-list li.sb-note {
  cursor: default;
  color: var(--look-muted);
}
body.look-search .sb-list li.sb-note:hover {
  background: none;
}

/* The result card: an icon, one sentence, and sometimes one more line. The icon
   shape changes with the answer, so color is not the only clue. */
body.look-search .sb-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--look-line);
}
body.look-search .sb-card-icon {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  line-height: 32px;
  text-align: center;
  font-size: 16px;
  color: #ffffff;
  background: var(--look-muted);
}
body.look-search .sb-done .sb-card-icon {
  background: var(--look-done);
}
body.look-search .sb-none .sb-card-icon {
  background: #ffffff;
  color: var(--look-todo);
  box-shadow: inset 0 0 0 2px var(--look-todo);
}
body.look-search .sb-card-main {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}
body.look-search .sb-card-sub {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.35;
  color: var(--look-muted);
}

/* Old map location button is replaced by the one in the search box. */
body.look-search .leaflet-control-locate,
body.look-search .leaflet-bar-part-single {
  display: none !important;
}

@media (max-width: 650px) {
  body.look-search #search-box {
    left: 10px;
    right: 10px;
    width: auto;
  }
  body.look-search.panel-view #search-box {
    display: none;
  }
}

/********** Panel, legend, map buttons, font **********/
body.look-panel {
  font-family: var(--look-font);
}
body.look-panel #sidepanel {
  background: #f6f7f9;
}
body.look-panel #sidepanel .content:before {
  display: none;
}
body.look-panel #sidepanel .content {
  padding: 16px;
}

body.look-panel #service-summary {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--look-line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--look-ink);
}
body.look-panel #service-summary .summary-title {
  font-size: 20px;
}

/* The status line is a small pill: a dot, and the words. */
body.look-panel #service-summary .summary-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  background: #eef1f4;
  font-size: 14px;
  font-weight: 600;
  color: var(--look-ink);
}
body.look-panel #service-summary .summary-status:before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--look-todo);
}
body.look-panel #service-summary.is-active .summary-status {
  background: #e7f3ec;
}
body.look-panel #service-summary.is-active .summary-status:before {
  background: var(--look-done);
  box-shadow: none;
}

body.look-panel #service-summary .summary-percent {
  font-size: 15px;
  font-weight: 600;
}
body.look-panel #service-summary .summary-bar {
  height: 10px;
  border-radius: 5px;
  background: #e4e7eb;
}
body.look-panel #service-summary .summary-bar-fill {
  background: var(--look-done);
}
body.look-panel #service-summary p {
  color: var(--look-muted);
  font-size: 15px;
}
body.look-panel #service-summary .summary-description {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--look-line);
}

/* Legend: one bar for each kind of street, in the same color as the map line. */
body.look-panel #map-legend {
  padding: 14px 16px;
  border: 1px solid var(--look-line);
  border-radius: 14px;
  background: #ffffff;
}
body.look-panel #map-legend:before {
  content: "Key";
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--look-muted);
}
body.look-panel #map-legend .items > div {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  min-height: 36px;
  font-size: 16px;
  color: var(--look-ink);
}
body.look-panel #map-legend .items .legend-text {
  margin: 0;
}
body.look-panel .look-swatch {
  flex: none;
  display: inline-block;
  width: 40px;
  border-radius: 3px;
}
body.look-panel .look-swatch.dashed {
  background-image: repeating-linear-gradient(90deg, #ffffff 0 4px, transparent 4px 8px);
}
body.look-panel #static-messages {
  margin: 14px 0 0;
}

/* Map buttons share one rounded group instead of five separate boxes. */
body.look-panel .leaflet-top.leaflet-left {
  margin-top: 150px;
}
body.look-panel .leaflet-top.leaflet-left .leaflet-control {
  margin-top: 0;
  margin-bottom: 0;
}
body.look-panel .leaflet-bar,
body.look-panel .leaflet-control-layers {
  border-radius: 0;
  box-shadow: none;
}
body.look-panel .leaflet-top.leaflet-left .leaflet-control {
  background: #ffffff;
  border: none;
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.3);
  margin-left: 10px;
}
body.look-panel .leaflet-top.leaflet-left .leaflet-control:first-child {
  border-radius: 10px 10px 0 0;
}
body.look-panel .leaflet-top.leaflet-left .leaflet-control:last-child {
  border-radius: 0 0 10px 10px;
}
body.look-panel .leaflet-top.leaflet-left .leaflet-control + .leaflet-control {
  border-top: 1px solid var(--look-line);
}
body.look-panel .leaflet-bar a {
  border-bottom-color: var(--look-line);
  background-color: transparent;
}
body.look-panel #legend-btn-widescreen {
  border-radius: 10px;
}

/********** Phone sheet **********/
.sheet-handle {
  display: none;
}
@media (max-width: 650px) {
  body.look-sheet #mappanel.offscreen {
    right: 0;
  }
  body.look-sheet #service-summary-mini {
    display: none;
  }
  body.look-sheet #legend-btn-mobile {
    display: none;
  }
  body.look-sheet #sidepanel {
    display: block;
    top: auto;
    bottom: 0;
    height: 62vh;
    z-index: 1200;
    border-radius: 18px 18px 0 0;
    background: #f6f7f9;
    box-shadow: 0 -2px 12px rgba(16, 24, 40, 0.3);
    transform: translateY(calc(62vh - 200px));
    transition: transform 0.25s ease;
  }
  body.look-sheet.sheet-open #sidepanel {
    transform: none;
  }
  body.look-sheet #sidepanel .content {
    padding: 0 14px 24px;
    overflow-y: hidden;
  }
  body.look-sheet.sheet-open #sidepanel .content {
    overflow-y: auto;
    height: calc(100% - 28px);
  }
  body.look-sheet .sheet-handle {
    display: block;
    width: 100%;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
  }
  body.look-sheet .sheet-grip {
    display: block;
    width: 44px;
    height: 5px;
    margin: 0 auto;
    border-radius: 3px;
    background: #aab2bb;
  }
  /* In its low position the sheet shows the title, status and percent. */
  body.look-sheet:not(.sheet-open) #service-summary .summary-description,
  body.look-sheet:not(.sheet-open) #service-summary .summary-last,
  body.look-sheet:not(.sheet-open) #map-legend {
    visibility: hidden;
  }
  body.look-sheet #last-updated {
    bottom: 214px;
  }
  body.look-sheet .leaflet-bottom {
    bottom: 194px;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.look-sheet #sidepanel { transition: none; }
}

/* The result card sits above the zoom buttons, so the buttons start lower. */
body.look-search .leaflet-top.leaflet-left {
  margin-top: 195px;
}
