/*! CubifyIt Roads. Copyright (c) 2026 Cubify It Studio. All rights reserved.
No permission is granted to copy, modify or redistribute this code. See LICENSE. */
/* ---------- Top bar ---------- */

.topbar {
  min-height: 60px;
  flex: none;
  flex-wrap: wrap;
  display: flex;
  align-items: center;
  gap: 10px 24px;
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 600; white-space: nowrap; }
.search { display: flex; gap: 8px; flex: 1 1 240px; min-width: 0; max-width: 460px; }
/* The search box and button match the settings' controls: same height, corners, fill, hover and focus */
.search input {
  flex: 1;
  min-width: 0;
  height: var(--ctl-h);
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--ctl-r);
  background: var(--field);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  transition: border-color .15s, background .15s;
}
.search input::placeholder { color: var(--muted); font-weight: 400; }
.search input:hover { background: var(--field-hover); }
.search input:focus { background: var(--surface); border-color: var(--ink); }
/* A long address that doesn't fit ends in "…" (the whole of it shows when focused, and on hover) */
.search input:not(:focus) { text-overflow: ellipsis; }
.search-field { position: relative; flex: 1; min-width: 0; display: flex; }
/* The clear (×) button sits inside a text box at its right end: the search box (in place of the browser's own, which
   iPhones don't show) and the text on the base */
.search-field.has-text input { padding-right: 40px; } /* room for the × only while it shows */
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.clear-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border-radius: calc(var(--ctl-r) - 3px);
  background: #e2e2de;
  color: var(--ink);
}
.clear-btn:hover { background: #d6d6d1; }
.search-btn { flex: none; width: var(--ctl-h); height: var(--ctl-h); padding: 0; display: grid; place-items: center; border-radius: var(--ctl-r); }
/* Search problems show right of the search bar */
.search-error {
  flex: 0 1 auto;
  min-width: 0;
  padding: 8px 14px;
  border-radius: var(--ctl-r);
  background: #fbeeec;
  color: var(--danger);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mark row: on/off, shapes and color */
.check { display: flex; align-items: center; cursor: pointer; }
/* The mark's on/off checkbox: a rounded square like the other controls, black with a white tick when on */
.check input {
  appearance: none;
  -webkit-appearance: none;
  /* As big as the color showing in the chip beside it: the chip less its border and white rim */
  width: calc(var(--ctl-h) - 8px);
  height: calc(var(--ctl-h) - 8px);
  margin: 0;
  border: 1.5px solid #c9c9c4;
  border-radius: calc(var(--ctl-r) - 3px);
  background: var(--surface) center / 55% no-repeat;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.check input:hover { border-color: var(--ink); }
.check input:checked {
  border-color: var(--ink);
  background-color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* Shown but grayed out while the Mark box is unticked */
.mark-opt.is-off { opacity: .4; filter: grayscale(1); pointer-events: none; }
.seg { display: flex; gap: 2px; padding: 3px; background: var(--field); border-radius: var(--ctl-r); flex: none; }
.seg button { width: 32px; height: 34px; padding: 0; border-radius: calc(var(--ctl-r) - 3px); background: transparent; display: grid; place-items: center; color: var(--muted); }
.seg button:hover { background: var(--field-hover); color: var(--ink); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04); }

.suggestions {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.1);
}
.suggestions li {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.suggestions li:hover, .suggestions li.active { background: var(--field); }
.suggestions .name { font-weight: 500; }
.suggestions .where { font-size: 12px; color: var(--muted); }
.suggestions li.loading, .suggestions li.loading:hover { color: var(--muted); background: none; cursor: default; }
.suggestions li.credit, .suggestions li.credit:hover { padding-top: 2px; padding-bottom: 4px; font-size: 11px; color: var(--muted); background: none; cursor: default; text-align: right; }
.suggestions li.credit a { color: inherit; }
