:root {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-soft: #f7f7f8;
  --surface-deep: #efeff1;
  --ink: #1b1c1e;
  --ink-soft: #44464a;
  --muted: #9a9ba0;
  --muted-light: #b6b7bb;
  --line: rgba(24, 25, 28, 0.06);
  --line-strong: rgba(24, 25, 28, 0.1);
  --orange: #f7a51f;
  --orange-deep: #d98600;
  --orange-soft: #fff3df;
  --green: #4f8562;
  --green-soft: #edf7f0;
  --red: #d74b45;
  --red-soft: #fff0ee;
  --shadow-card: 0 2px 14px rgba(22, 23, 26, 0.035);
  --shadow-sheet: 0 -12px 40px rgba(22, 23, 26, 0.14);
  --radius-card: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-max: 560px;
  --page-gutter: clamp(14px, 4vw, 22px);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: #e8e9eb;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

body.modal-open,
body.map-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

input,
select {
  min-width: 0;
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid rgba(247, 165, 31, 0.8);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.app {
  position: relative;
  width: min(100%, var(--app-max));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(20, 21, 24, 0.025);
}

/* ---------- Header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: var(--safe-top);
  background: rgba(244, 244, 245, 0.9);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
}

.topbar-inner {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  height: 62px;
  padding: 0 14px;
}

.topbar-title {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.015em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-action {
  width: 58px;
  padding: 8px 0;
  color: var(--ink-soft);
  font-size: 15px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, color 0.18s ease;
}

.topbar-action--right {
  justify-self: end;
  color: var(--orange-deep);
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}

body.is-selecting .topbar-action {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.is-selecting .topbar-title {
  font-size: 17px;
  font-weight: 600;
}

/* ---------- Home ---------- */
.content {
  padding: 3px var(--page-gutter) calc(120px + var(--safe-bottom));
}

.stats-card {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  min-height: 106px;
  padding: 18px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.stat {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.16s ease;
}

.stat:active {
  transform: scale(0.96);
}

.stat strong {
  color: var(--ink);
  font-size: clamp(27px, 7vw, 33px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  transition: color 0.18s ease;
}

.stat span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  transition: color 0.18s ease;
}

.stat.is-active strong,
.stat.is-active span {
  color: var(--orange-deep);
}

.stat.is-active span {
  font-weight: 500;
}

.stat.is-active::after {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--orange);
  content: "";
  transform: translateX(-50%);
}

.stat-divider {
  align-self: center;
  width: 1px;
  height: 38px;
  background: rgba(24, 25, 28, 0.06);
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  height: 50px;
  margin-top: 18px;
  border: 1px solid rgba(24, 25, 28, 0.045);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-field:focus-within {
  border-color: rgba(247, 165, 31, 0.5);
  box-shadow: 0 0 0 4px rgba(247, 165, 31, 0.1);
}

.search-icon {
  width: 20px;
  height: 20px;
  margin-left: 18px;
  color: #929398;
}

.search-field input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0 42px 0 11px;
  background: transparent;
  font-size: 16px;
}

.search-field input::placeholder {
  color: #a9aaaf;
}

.search-clear {
  position: absolute;
  right: 10px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #999aa0;
  background: #f1f1f3;
}

.search-clear .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.city-tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding: 1px 0 2px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.city-tabs::-webkit-scrollbar {
  display: none;
}

.city-chip {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 20px;
  border: 1px solid rgba(24, 25, 28, 0.04);
  border-radius: 999px;
  color: #4e5055;
  background: var(--surface);
  font-size: 15px;
  line-height: 38px;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.city-chip:active {
  transform: scale(0.96);
}

.city-chip.is-active {
  border-color: transparent;
  color: #fff;
  background: var(--orange);
  box-shadow: 0 5px 13px rgba(247, 165, 31, 0.24);
  font-weight: 500;
}

.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 20px;
  margin: 16px 2px 10px;
  color: var(--muted);
  font-size: 12px;
}

.longpress-hint {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: #aaa9ad;
  font-size: 11px;
  text-align: right;
}

.longpress-hint .icon {
  width: 14px;
  height: 14px;
}

.record-list {
  display: grid;
  gap: 12px;
}

.record-card {
  position: relative;
  padding: 17px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.14s ease, box-shadow 0.2s ease;
}

.record-card.is-entering {
  animation: card-in 0.42s cubic-bezier(0.22, 0.75, 0.24, 1) both;
  animation-delay: var(--enter-delay, 0ms);
}

.record-card.is-pressing {
  transform: scale(0.985);
  background: #fdfdfc;
}

.record-card.is-selected {
  border-color: rgba(247, 165, 31, 0.75);
  background: #fffdf8;
  box-shadow: 0 0 0 2px rgba(247, 165, 31, 0.09), var(--shadow-card);
}

.record-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 30px;
}

.record-name {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.012em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 27px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.status-pill--unvisited {
  color: #b47612;
  background: var(--orange-soft);
}

.status-pill--visited {
  color: var(--green);
  background: var(--green-soft);
}

.record-head .status-pill {
  margin: -2px 0 0 auto;
}

.record-card .select-mark {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1.5px solid #d9dadd;
  border-radius: 50%;
  color: transparent;
  background: #fff;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.record-card .select-mark .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.5;
}

body.is-selecting .record-card .status-pill {
  visibility: hidden;
}

body.is-selecting .record-card.is-selected .select-mark {
  border-color: var(--orange);
  color: #fff;
  background: var(--orange);
  transform: scale(1.03);
}

.record-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 13px;
}

.info-tile {
  min-width: 0;
  min-height: 65px;
  padding: 9px 13px 10px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.info-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.info-value {
  display: block;
  overflow: hidden;
  color: #2d2e31;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.star-readout {
  display: flex;
  align-items: center;
  gap: 1.5px;
  height: 24px;
  color: #d8d9dc;
  font-family: "Times New Roman", Arial, sans-serif;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
}

.star-readout span {
  display: inline-block;
}

.star-readout .is-on {
  color: var(--orange);
}

.star-readout--large {
  gap: 2px;
  height: 27px;
  font-size: 21px;
}

.record-address {
  display: flex;
  align-items: flex-start;
  gap: 1px;
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.55;
}

.record-address-label {
  flex: 0 0 auto;
  color: var(--orange-deep);
}

.record-address-value {
  min-width: 0;
  color: #5b5c60;
  overflow-wrap: anywhere;
}

.record-meta {
  margin-top: 7px;
  color: #a6a7ab;
  font-size: 13px;
  line-height: 1.55;
}

.record-fee {
  margin-top: 5px;
  color: var(--orange-deep);
  font-size: 13.5px;
  line-height: 1.55;
}

.empty-state {
  padding: 48px 22px 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow-card);
}

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 50%;
  color: var(--orange-deep);
  background: var(--orange-soft);
}

.empty-icon .icon {
  width: 26px;
  height: 26px;
}

.empty-state h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.empty-state p {
  margin: 7px 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.empty-action {
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: #fff;
  font-size: 13px;
}

.content-footnote {
  margin: 22px 0 0;
  color: #b4b5b8;
  font-size: 10.5px;
  letter-spacing: 0.01em;
  text-align: center;
}

/* ---------- Floating actions ---------- */
.fab-stack {
  position: fixed;
  right: max(20px, calc((100vw - var(--app-max)) / 2 + 20px));
  bottom: calc(25px + var(--safe-bottom));
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.22, 0.75, 0.24, 1);
}

body.is-selecting .fab-stack {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.9);
}

.fab {
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.fab:active {
  transform: scale(0.93);
}

.fab-map {
  width: 45px;
  height: 45px;
  border: 1px solid rgba(24, 25, 28, 0.055);
  color: #65676c;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 16px rgba(24, 25, 28, 0.11);
}

.fab-map .icon {
  width: 21px;
  height: 21px;
}

.fab-add {
  width: 61px;
  height: 61px;
  color: #fff;
  background: var(--orange);
  box-shadow: 0 9px 22px rgba(240, 152, 21, 0.37), 0 2px 5px rgba(240, 152, 21, 0.18);
}

.fab-add .icon {
  width: 27px;
  height: 27px;
  stroke-width: 1.7;
}

.selection-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(100%, var(--app-max));
  padding: 12px var(--page-gutter) calc(12px + var(--safe-bottom));
  border-top: 1px solid rgba(24, 25, 28, 0.055);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 28px rgba(24, 25, 28, 0.07);
  transform: translate(-50%, 110%);
  transition: transform 0.28s cubic-bezier(0.22, 0.75, 0.24, 1);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

body.is-selecting .selection-bar {
  transform: translate(-50%, 0);
}

.selection-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.selection-copy strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.selection-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-route-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--orange);
  box-shadow: 0 6px 14px rgba(240, 152, 21, 0.28);
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.plan-route-btn .icon {
  width: 18px;
  height: 18px;
}

.plan-route-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.plan-route-btn:disabled {
  color: #a5a6aa;
  background: #efeff1;
  box-shadow: none;
  opacity: 1;
}

/* ---------- Sheets ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(22, 23, 26, 0.34);
  opacity: 0;
  transition: opacity 0.24s ease;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.overlay.is-open {
  opacity: 1;
}

.sheet {
  display: flex;
  width: min(100%, var(--app-max));
  max-height: 92dvh;
  flex-direction: column;
  overflow: hidden;
  border-radius: 26px 26px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-sheet);
  transform: translateY(102%);
  transition: transform 0.32s cubic-bezier(0.22, 0.75, 0.24, 1);
}

.sheet:focus,
.confirm-dialog:focus {
  outline: none;
}

.overlay.is-open .sheet {
  transform: translateY(0);
}

.icon-btn {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #66686d;
  background: #f2f2f4;
  transition: background 0.18s ease, transform 0.18s ease;
}

.icon-btn:active {
  transform: scale(0.93);
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

.sheet-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
}

.detail-sheet {
  position: relative;
  padding: 27px 22px calc(22px + var(--safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-sheet::before {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: #e4e4e7;
  content: "";
  transform: translateX(-50%);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--orange-deep);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-right: 38px;
}

.detail-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.detail-head .status-pill {
  margin-top: 20px;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 20px;
}

.detail-info-box {
  min-height: 70px;
  padding: 11px 14px;
  border-radius: 13px;
  background: var(--surface-soft);
}

.detail-info-box > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.detail-info-box strong {
  display: block;
  font-size: 17px;
  font-weight: 500;
}

.detail-address {
  margin-top: 9px;
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--surface-soft);
}

.detail-address > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-address p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.detail-meta {
  margin: 16px 2px 20px;
}

.detail-meta > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 7px 0;
}

.detail-meta dt {
  color: var(--muted);
  font-size: 12.5px;
}

.detail-meta dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  text-align: right;
}

.detail-meta .fee-text {
  color: var(--orange-deep);
}

.detail-actions {
  display: flex;
  gap: 9px;
}

.detail-actions .button {
  flex: 1;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

.button:active {
  transform: scale(0.985);
}

.button .icon {
  width: 18px;
  height: 18px;
}

.button--primary {
  color: #fff;
  background: var(--orange);
  box-shadow: 0 6px 14px rgba(240, 152, 21, 0.2);
}

.button--ghost {
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: #fff;
}

.button--danger {
  color: #fff;
  background: var(--red);
}

.button--block {
  width: 100%;
}

/* ---------- Form ---------- */
.form-sheet {
  max-height: 94dvh;
}

.form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.form-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

#recordForm {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.form-scroll {
  overflow-y: auto;
  padding: 18px 22px 6px;
  overscroll-behavior: contain;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  margin: 0 0 7px 2px;
  color: #77797e;
  font-size: 12.5px;
  font-weight: 500;
}

.field-label em {
  color: var(--orange-deep);
  font-style: normal;
}

.field > input,
.field > .select-wrap,
.field > .affix-input {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(24, 25, 28, 0.075);
  border-radius: 12px;
  background: #f9f9fa;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.field > input {
  padding: 0 14px;
  outline: none;
  font-size: 15px;
}

.field > input::placeholder {
  color: var(--muted-light);
}

.field > input:focus,
.field > .select-wrap:focus-within,
.field > .affix-input:focus-within {
  border-color: rgba(247, 165, 31, 0.65);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(247, 165, 31, 0.09);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  gap: 11px;
}

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrap select {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0 36px 0 14px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  font-size: 15px;
}

.select-wrap .icon {
  position: absolute;
  right: 12px;
  width: 16px;
  height: 16px;
  color: #a3a4a8;
  transform: rotate(90deg);
  pointer-events: none;
}

.affix-input {
  display: flex;
  align-items: center;
  padding: 0 14px;
}

.affix-input > span {
  margin-right: 4px;
  color: var(--orange-deep);
  font-size: 15px;
}

.affix-input input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: 100%;
  max-width: 280px;
  height: 47px;
  padding: 4px;
  border-radius: 12px;
  background: #f3f3f5;
}

.segmented label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: #999ba0;
  font-size: 14px;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.segmented input:checked + span {
  color: #3d3e42;
  background: #fff;
  box-shadow: 0 1px 6px rgba(24, 25, 28, 0.08);
  font-weight: 500;
}

.segmented label:nth-child(1) input:checked + span {
  color: var(--orange-deep);
}

.segmented label:nth-child(2) input:checked + span {
  color: var(--green);
}

.rating-picker {
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 1px;
}

.rating-star {
  padding: 0 1px;
  color: #dcdde0;
  font-family: "Times New Roman", Arial, sans-serif;
  font-size: 31px;
  line-height: 1;
  transition: color 0.12s ease, transform 0.12s ease;
}

.rating-star:active {
  transform: scale(1.15);
}

.rating-star.is-on {
  color: var(--orange);
}

.rating-value {
  margin-left: 10px;
  color: var(--muted);
  font-size: 12px;
}

.field input[type="datetime-local"] {
  color: #404146;
  font-variant-numeric: tabular-nums;
}

.location-picker {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid rgba(24, 25, 28, 0.075);
  border-radius: 13px;
  background: #f9f9fa;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.location-picker:active {
  background: #f4f4f6;
}

.location-picker-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--orange-deep);
  background: var(--orange-soft);
}

.location-picker-icon .icon {
  width: 19px;
  height: 19px;
}

.location-picker-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.location-picker-copy strong {
  overflow: hidden;
  color: #54565b;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-picker-copy small {
  overflow: hidden;
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-picker-arrow {
  width: 16px;
  height: 16px;
  color: #b2b3b7;
}

.form-error {
  margin: -3px 2px 12px;
  color: var(--red);
  font-size: 12.5px;
}

.form-footer {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  padding: 13px 22px calc(13px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.form-footer .button--ghost {
  flex: 0 0 92px;
}

.form-footer .button--save {
  flex: 1;
}

.form-footer .button.is-busy {
  opacity: 0.68;
  pointer-events: none;
}

/* ---------- Confirm ---------- */
.overlay--center {
  align-items: center;
  padding: 24px;
}

.confirm-dialog {
  width: min(100%, 350px);
  padding: 24px 22px 20px;
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(22, 23, 26, 0.18);
  transform: scale(0.96);
  transition: transform 0.22s cubic-bezier(0.22, 0.75, 0.24, 1);
}

.overlay.is-open .confirm-dialog {
  transform: scale(1);
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.confirm-dialog p {
  margin: 8px 0 20px;
  color: #888a8f;
  font-size: 13px;
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  gap: 9px;
}

.confirm-actions .button {
  flex: 1;
  height: 44px;
  font-size: 14px;
}

/* ---------- Map ---------- */
.map-screen {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 300;
  display: flex;
  width: min(100%, var(--app-max));
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 0 30px rgba(20, 21, 24, 0.12);
  transform: translateX(-50%);
}

.map-screen--picker {
  z-index: 700;
}

.screen-header {
  position: relative;
  z-index: 1000;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  height: calc(60px + var(--safe-top));
  flex: 0 0 auto;
  padding: var(--safe-top) 14px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.screen-header h1 {
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-header .icon-btn {
  background: #f5f5f6;
}

.screen-header .icon-btn:last-child {
  justify-self: end;
}

.screen-header-spacer {
  width: 35px;
  height: 35px;
  justify-self: end;
}

.map-stage {
  position: relative;
  flex: 1;
  min-height: 160px;
  overflow: hidden;
  background-color: #e9e9e4;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    radial-gradient(circle at 20% 20%, #eef1e8 0, transparent 44%),
    radial-gradient(circle at 80% 90%, #e2e9e3 0, transparent 46%);
  background-size: 26px 26px, 26px 26px, auto, auto;
}

.map-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.map-panel {
  position: relative;
  z-index: 1000;
  max-height: 49%;
  margin-top: -22px;
  padding: 10px 20px calc(18px + var(--safe-bottom));
  overflow-y: auto;
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -12px 30px rgba(22, 23, 26, 0.1);
  overscroll-behavior: contain;
}

.panel-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 13px;
  border-radius: 999px;
  background: #e6e6e9;
}

.map-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 800;
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(24, 25, 28, 0.06);
  border-radius: 999px;
  color: #62646a;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 3px 12px rgba(24, 25, 28, 0.09);
  font-size: 11px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.map-offline-note {
  position: absolute;
  top: 54px;
  left: 14px;
  z-index: 800;
  max-width: calc(100% - 28px);
  padding: 7px 10px;
  border-radius: 9px;
  color: #8b734c;
  background: rgba(255, 249, 237, 0.96);
  font-size: 10.5px;
  line-height: 1.5;
}

.map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 850;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border-radius: 999px;
  color: #55575c;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(24, 25, 28, 0.13);
  font-size: 12px;
  transform: translate(-50%, -50%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid #f2d9ae;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.amap-container {
  background: #e9e9e4;
}

.amap-logo,
.amap-copyright {
  opacity: 0.6;
}

.amap-info-content {
  border-radius: 14px;
  box-shadow: 0 8px 26px rgba(24, 25, 28, 0.16);
  padding: 12px 14px;
  font-family: inherit;
}

.map-dot {
  display: block;
  width: 18px;
  height: 18px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #f7a51f;
  box-shadow: 0 2px 8px rgba(24, 25, 28, 0.28);
}

.map-dot.is-visited {
  background: #4f8562;
}

.map-popup {
  color: #1d1e20;
}

.map-popup strong {
  display: block;
  padding-right: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.map-popup span {
  display: block;
  margin-top: 3px;
  color: #9b9ca1;
  font-size: 10.5px;
  line-height: 1.45;
}

.map-popup em {
  display: inline-block;
  margin-top: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--orange-deep);
  background: var(--orange-soft);
  font-size: 9.5px;
  font-style: normal;
}

.map-popup em.is-visited {
  color: var(--green);
  background: var(--green-soft);
}

.route-pin,
.picker-map-pin {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--orange);
  box-shadow: 0 4px 12px rgba(177, 111, 6, 0.34);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.picker-map-pin {
  width: 24px;
  height: 24px;
  border-width: 4px;
}

.route-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.route-panel-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.route-panel-head .eyebrow {
  margin-bottom: 3px;
}

.route-kicker {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  height: 25px;
  margin-top: 2px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--orange-deep);
  background: var(--orange-soft);
  font-size: 10px;
}

.route-kicker .icon {
  width: 13px;
  height: 13px;
}

.route-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 15px;
}

.route-metric {
  min-width: 0;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.route-metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.route-metric strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #2b2c2f;
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-status {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin: 10px 1px 0;
  color: #a09e99;
  font-size: 10.5px;
  line-height: 1.5;
}

.route-status .icon {
  width: 13px;
  height: 13px;
  margin-top: 1px;
}

.route-status--warn {
  color: #a17837;
}

.route-stops {
  display: grid;
  gap: 0;
  margin: 15px 0 0;
  padding: 0;
  list-style: none;
}

.route-stop {
  position: relative;
  display: flex;
  gap: 11px;
  padding: 9px 0;
}

.route-stop:not(:last-child)::after {
  position: absolute;
  top: 42px;
  bottom: -3px;
  left: 12px;
  width: 1px;
  background: repeating-linear-gradient(to bottom, #e7d4b3 0 3px, transparent 3px 6px);
  content: "";
}

.route-stop-number {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--orange-deep);
  background: var(--orange-soft);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.route-stop-copy {
  min-width: 0;
  flex: 1;
}

.route-stop-copy strong {
  display: block;
  overflow: hidden;
  color: #303135;
  font-size: 13.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-stop-copy span {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-stop-tag {
  align-self: center;
  color: #b2b3b7;
  font-size: 10px;
}

.route-add-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  color: #8f7955;
  background: #fffaf1;
  font-size: 11px;
  line-height: 1.6;
}

.route-add-tip .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--orange-deep);
}

.browse-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.browse-heading h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
}

.browse-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.map-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  color: #6d6f74;
  background: var(--surface-soft);
  font-size: 11px;
}

.map-count-pill::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  content: "";
}

.map-count-pill.is-visited::before {
  background: var(--green);
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: #9c9da1;
  font-size: 10px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}

.legend-dot.is-visited {
  background: var(--green);
}

.browse-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 12px;
  color: #8d8e93;
  background: #f8f8f9;
  font-size: 11px;
  line-height: 1.6;
}

.browse-tip .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--orange);
}

.map-fit-btn,
.map-back-list-btn {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 14px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: #64666a;
  background: #fff;
  font-size: 11px;
}

.map-fit-btn .icon,
.map-back-list-btn .icon {
  width: 15px;
  height: 15px;
}

.map-error {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 12px;
  color: #a66f26;
  background: #fff8ec;
  font-size: 11px;
  line-height: 1.6;
}

/* ---------- Location picker ---------- */
.map-screen--picker .map-panel {
  display: none;
}

.map-screen--picker .map-stage {
  border-radius: 0;
}

.picker-tip {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 800;
  max-width: calc(100% - 32px);
  padding: 8px 13px;
  border: 1px solid rgba(24, 25, 28, 0.05);
  border-radius: 999px;
  color: #6a6c71;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 14px rgba(24, 25, 28, 0.09);
  font-size: 11px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.picker-panel {
  position: relative;
  z-index: 1000;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 13px;
  padding: 16px 20px calc(16px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 -10px 26px rgba(22, 23, 26, 0.06);
}

.picker-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.picker-copy strong {
  color: #404247;
  font-size: 13px;
  font-weight: 500;
}

.picker-copy span {
  color: var(--muted);
  font-size: 11px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: calc(105px + var(--safe-bottom));
  left: 50%;
  z-index: 1200;
  max-width: min(calc(100% - 44px), 430px);
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(29, 30, 33, 0.92);
  box-shadow: 0 8px 24px rgba(20, 21, 24, 0.18);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Animations ---------- */
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (hover: hover) {
  .record-card:hover {
    border-color: rgba(24, 25, 28, 0.11);
    box-shadow: 0 5px 20px rgba(22, 23, 26, 0.06);
  }

  .city-chip:not(.is-active):hover {
    border-color: rgba(24, 25, 28, 0.1);
  }

  .fab:hover {
    transform: translateY(-1px);
  }

  .fab:active {
    transform: scale(0.94);
  }
}

@media (min-width: 600px) {
  body {
    background:
      radial-gradient(circle at 14% 14%, rgba(247, 165, 31, 0.08), transparent 30%),
      radial-gradient(circle at 88% 80%, rgba(247, 165, 31, 0.06), transparent 32%),
      #e8e9eb;
  }

  .app {
    border-right: 1px solid rgba(20, 21, 24, 0.035);
    border-left: 1px solid rgba(20, 21, 24, 0.035);
  }

  .topbar-inner {
    height: 66px;
    padding: 0 20px;
  }

  .content {
    padding-top: 5px;
  }

  .map-screen,
  .selection-bar {
    box-shadow: 0 0 50px rgba(20, 21, 24, 0.16);
  }
}

@media (max-width: 370px) {
  .topbar-inner {
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    padding: 0 11px;
  }

  .topbar-title {
    font-size: 19px;
  }

  .stats-card {
    min-height: 98px;
    padding: 16px 4px;
  }

  .stat span {
    font-size: 13px;
  }

  .record-card {
    padding: 15px 14px;
  }

  .record-name {
    font-size: 18.5px;
  }

  .info-tile {
    padding-right: 10px;
    padding-left: 10px;
  }

  .info-value {
    font-size: 15.5px;
  }

  .longpress-hint {
    max-width: 150px;
    font-size: 10px;
  }

  .plan-route-btn {
    padding: 0 14px;
    font-size: 13px;
  }

  .selection-copy span {
    max-width: 120px;
  }

  .field-row {
    grid-template-columns: 1fr 1fr;
  }

  .route-metrics {
    gap: 6px;
  }

  .route-metric {
    padding: 10px;
  }

  .route-metric strong {
    font-size: 14.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Pager ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 15px;
}

.pager button {
  height: 38px;
  padding: 0 17px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 13px;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.pager button:active:not(:disabled) {
  transform: scale(0.96);
}

.pager button:disabled {
  color: var(--muted-light);
  opacity: 0.55;
}

.pager span {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Settings FAB ---------- */
.fab-settings {
  width: 45px;
  height: 45px;
  border: 1px solid rgba(24, 25, 28, 0.055);
  color: #65676c;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 16px rgba(24, 25, 28, 0.11);
}

.fab-settings .icon {
  width: 21px;
  height: 21px;
}

/* ---------- Settings sheet ---------- */
.settings-sheet {
  max-height: 92dvh;
}

.settings-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 22px calc(20px + var(--safe-bottom));
  overscroll-behavior: contain;
}

.settings-section {
  padding: 16px 0 4px;
}

.settings-section + .settings-section {
  border-top: 1px solid var(--line);
}

.settings-section h3 {
  margin: 0 0 10px 2px;
  color: #6d6f74;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.settings-hint {
  margin: 10px 2px 6px;
  color: var(--muted-light);
  font-size: 11px;
  line-height: 1.65;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 2px;
}

.settings-row .row-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #2e2f33;
  font-size: 14.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-row .row-meta {
  flex: 0 0 auto;
  color: var(--muted-light);
  font-size: 11px;
}

.row-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: #5c5e63;
  background: #fff;
  font-size: 12px;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.row-action .icon {
  width: 14px;
  height: 14px;
}

.row-action:active {
  background: #f6f6f7;
}

.row-action--danger {
  color: var(--red);
  border-color: rgba(215, 75, 69, 0.35);
}

.row-action--danger:active {
  background: var(--red-soft);
}

.row-action--primary {
  color: #fff;
  border-color: transparent;
  background: var(--orange);
}

.row-action:disabled {
  color: var(--muted-light);
  border-color: var(--line);
  background: #f4f4f5;
}

.account-row {
  padding: 4px 2px;
}

.account-row .row-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.account-row .row-name::before {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--orange);
  content: "";
}

.city-add {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.city-add input {
  flex: 1;
  height: 42px;
  border: 1px solid rgba(24, 25, 28, 0.075);
  border-radius: 11px;
  outline: none;
  padding: 0 13px;
  background: #f9f9fa;
  font-size: 14px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.city-add input:focus {
  border-color: rgba(247, 165, 31, 0.65);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(247, 165, 31, 0.09);
}

.city-add .row-action {
  height: 42px;
  padding: 0 16px;
}

.manager-list {
  display: grid;
  gap: 2px;
}

.manager-list .settings-row + .settings-row {
  border-top: 1px solid rgba(24, 25, 28, 0.045);
}

.manager-empty {
  padding: 10px 2px;
  color: var(--muted-light);
  font-size: 12px;
}

.city-edit-row {
  display: flex;
  gap: 8px;
  padding: 6px 0;
}

.city-edit-row input {
  flex: 1;
  height: 38px;
  border: 1px solid rgba(247, 165, 31, 0.55);
  border-radius: 10px;
  outline: none;
  padding: 0 12px;
  background: #fff;
  font-size: 14px;
}

.record-row {
  align-items: flex-start;
  padding: 9px 2px;
}

.record-row .row-copy {
  min-width: 0;
  flex: 1;
}

.record-row .row-copy strong {
  display: block;
  overflow: hidden;
  color: #2e2f33;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-row .row-copy span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-row .status-pill {
  margin-top: 2px;
}

.record-row .row-delete {
  margin-top: 2px;
}

.inline-confirm {
  margin: 2px 0 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--red-soft);
}

.inline-confirm p {
  margin: 0 0 9px;
  color: #a04a45;
  font-size: 12px;
  line-height: 1.6;
}

.inline-confirm p strong {
  color: var(--red);
}

.inline-confirm input {
  width: 100%;
  height: 40px;
  border: 1px solid rgba(215, 75, 69, 0.35);
  border-radius: 10px;
  outline: none;
  padding: 0 12px;
  background: #fff;
  font-size: 14px;
}

.inline-confirm input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215, 75, 69, 0.1);
}

.inline-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 9px;
}

.inline-confirm-actions .row-action {
  height: 34px;
}

/* ---------- Auth ---------- */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(247, 165, 31, 0.14), transparent 34%),
    radial-gradient(circle at 84% 86%, rgba(247, 165, 31, 0.1), transparent 36%),
    #f2f2f3;
  opacity: 1;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.auth-screen[hidden] {
  display: none;
}

body:not(.is-locked) .auth-screen {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.auth-card {
  width: min(100%, 380px);
  padding: 30px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(22, 23, 26, 0.1);
}

.auth-brand {
  margin-bottom: 22px;
  text-align: center;
}

.auth-logo {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: var(--orange);
  box-shadow: 0 8px 20px rgba(240, 152, 21, 0.3);
}

.auth-logo .icon {
  width: 27px;
  height: 27px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-brand p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.auth-mode-note {
  margin: 0 0 14px 2px;
  color: var(--orange-deep);
  font-size: 12px;
  line-height: 1.6;
}

.auth-mode-note:empty {
  display: none;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 2px 12px;
  color: #77797e;
  font-size: 12.5px;
}

.auth-remember .icon {
  width: 14px;
  height: 14px;
}

.auth-switch {
  display: block;
  width: 100%;
  margin-top: 12px;
  color: #84868b;
  font-size: 12.5px;
  text-align: center;
}

.auth-switch:active {
  color: var(--orange-deep);
}

body.is-locked .app {
  visibility: hidden;
}