:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef3f6;
  --text: #172026;
  --muted: #62717c;
  --border: #d9e0e5;
  --accent: #1f6feb;
  --accent-strong: #174ea6;
  --red: #c7352a;
  --yellow: #d99a00;
  --blue: #246bcb;
  --green: #2d8a4f;
  --purple: #5d3f8f;
  --gray: #717d86;
  --shadow: 0 8px 24px rgba(23, 32, 38, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.app-header {
  align-items: center;
  background: #11191f;
  color: #f6f9fb;
  display: flex;
  gap: 24px;
  min-height: 64px;
  padding: 0 24px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  min-width: 230px;
}

.brand {
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
}

.source-note {
  color: #aebbc4;
  font-size: 12px;
}

.main-nav {
  display: flex;
  flex: 1;
  gap: 8px;
}

.main-nav a {
  border-radius: 6px;
  color: #dce5eb;
  font-size: 13px;
  padding: 8px 10px;
}

.main-nav a:hover {
  background: #24313a;
  color: #ffffff;
  text-decoration: none;
}

.user-block {
  align-items: center;
  display: flex;
  gap: 12px;
}

.user-block form {
  margin: 0;
}

.app-main {
  padding: 22px 24px 36px;
}

.page-title-row {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-title-row h1 {
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 4px;
}

.page-title-row p {
  color: var(--muted);
  margin: 0;
}

.button-row,
.filter-actions,
.form-actions,
.table-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-button,
.secondary-button,
.text-button {
  align-items: center;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-strong);
  text-decoration: none;
}

.secondary-button {
  background: #e9eff4;
  color: #172026;
}

.secondary-button:hover {
  background: #dbe5ec;
  text-decoration: none;
}

.text-button {
  background: transparent;
  color: inherit;
  padding-inline: 6px;
}

.compact {
  min-height: 30px;
  padding: 5px 8px;
}

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  margin-bottom: 16px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.metric-card span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  margin-top: 8px;
}

.filter-bar {
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  margin-bottom: 16px;
  padding: 12px;
}

label {
  color: var(--muted);
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
}

input,
select,
textarea,
.field-input {
  background: #ffffff;
  border: 1px solid #cfd8df;
  border-radius: 6px;
  color: var(--text);
  min-height: 36px;
  padding: 7px 9px;
  width: 100%;
}

textarea {
  resize: vertical;
}

.map-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: 360px minmax(0, 1fr);
  height: clamp(560px, 64vh, 780px);
  min-height: 560px;
}

.map-sidebar,
.map-panel,
.info-panel,
.table-panel,
.auth-panel,
.pin-editor,
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.map-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.sidebar-heading {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding: 12px;
}

.sidebar-heading h2 {
  font-size: 14px;
  margin: 0;
}

.sidebar-heading span {
  background: var(--surface-2);
  border-radius: 999px;
  font-weight: 800;
  min-width: 28px;
  padding: 3px 8px;
  text-align: center;
}

.job-list {
  flex: 1;
  overflow: auto;
}

.job-row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: grid;
  gap: 5px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.job-row:hover {
  background: #f7fafc;
}

.job-row strong {
  font-size: 14px;
}

.job-meta,
.job-address {
  color: var(--muted);
  font-size: 12px;
}

@keyframes jobsiteCoordinatePulse {
  0%,
  100% {
    border-color: #f2c94c;
    box-shadow: 0 0 0 0 rgba(242, 201, 76, 0.08);
  }
  50% {
    border-color: #ffe28a;
    box-shadow: 0 0 0 4px rgba(242, 201, 76, 0.28);
  }
}

.job-row.is-coordinate-attention {
  background: #fff8df;
  border: 1px solid #f2c94c;
  animation: jobsiteCoordinatePulse 1.1s ease-in-out infinite;
}

.job-row.is-coordinate-attention:hover {
  background: #fff2bd;
}

.job-attention {
  align-self: start;
  background: #f2c94c;
  border-radius: 999px;
  color: #1f1300;
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  margin-top: 2px;
  padding: 5px 8px;
  text-transform: uppercase;
}

.queue-preview {
  border-top: 1px solid var(--border);
  max-height: 220px;
  overflow: auto;
}

.compact-list {
  list-style: none;
  margin: 0;
  padding: 6px 12px 12px;
}

.compact-list li {
  display: grid;
  gap: 2px;
  padding: 6px 0;
}

.compact-list span {
  color: var(--muted);
  font-size: 12px;
}

.map-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.map-tools {
  display: flex;
  gap: 8px;
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 600;
}

.route-toggle {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: #172026;
}

.route-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.route-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.jobsite-map,
.fix-pin-map,
.detail-map {
  height: 100%;
  min-height: 0;
  position: relative;
  width: 100%;
}

.jobsite-map.is-picking-coordinate {
  cursor: crosshair;
}

.detail-map {
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 260px;
  min-height: 260px;
}

.fix-pin-map {
  border-radius: 8px;
  height: clamp(520px, 58vh, 720px);
  min-height: 520px;
}

.map-loading-fallback {
  align-items: center;
  background: #edf2f5;
  color: var(--muted);
  display: flex;
  font-weight: 700;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: absolute;
  text-align: center;
  z-index: 1;
}

.leaflet-container .map-loading-fallback {
  display: none;
}

.map-empty {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  left: 50%;
  max-width: 380px;
  padding: 18px;
  position: absolute;
  text-align: center;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 600;
}

.map-empty h2 {
  margin: 0 0 6px;
}

.map-empty.map-error {
  border-color: #f0a29a;
  background: #fff0ee;
  color: #8a1f17;
}

.route-status {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 8px;
  bottom: 14px;
  box-shadow: var(--shadow);
  color: #33414b;
  font-size: 12px;
  font-weight: 800;
  left: 14px;
  max-width: min(520px, calc(100% - 28px));
  padding: 8px 10px;
  position: absolute;
  z-index: 600;
}

.route-status-error {
  background: #fff8e8;
  border-color: #f2c94c;
  color: #735200;
}

.coordinate-pick-panel {
  align-items: center;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #f2c94c;
  border-radius: 8px;
  bottom: 14px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  left: 14px;
  max-width: min(620px, calc(100% - 28px));
  padding: 10px 12px;
  position: absolute;
  z-index: 700;
}

.coordinate-pick-panel[hidden] {
  display: none;
}

.coordinate-pick-panel p {
  margin: 3px 0 0;
}

.coordinate-pick-panel code {
  display: inline-block;
  margin-top: 6px;
}

.marker-pin {
  align-items: center;
  border: 2px solid #ffffff;
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 3px 10px rgba(23, 32, 38, 0.35);
  display: flex;
  height: 26px;
  justify-content: center;
  transform: rotate(-45deg);
  width: 26px;
}

.marker-pin::after {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  content: "";
  height: 8px;
  width: 8px;
}

.marker-label {
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  position: relative;
  text-shadow: 0 1px 2px rgba(23, 32, 38, 0.5);
  transform: rotate(45deg);
  z-index: 1;
}

.marker-labeled .marker-pin::after {
  display: none;
}

.marker-red .marker-pin { background: var(--red); }
.marker-yellow .marker-pin { background: var(--yellow); }
.marker-blue .marker-pin { background: var(--blue); }
.marker-green .marker-pin { background: var(--green); }
.marker-gray .marker-pin { background: var(--gray); }
.marker-purple .marker-pin { background: var(--purple); }
.marker-orange .marker-pin { background: #f2994a; }
.marker-teal .marker-pin { background: #00a6a6; }
.marker-pink .marker-pin { background: #eb5ea8; }
.marker-indigo .marker-pin { background: #4f46e5; }
.marker-cyan .marker-pin { background: #06b6d4; }
.marker-lime .marker-pin { background: #84cc16; }
.marker-brown .marker-pin { background: #8b5e34; }
.marker-navy .marker-pin { background: #1d4ed8; }
.marker-gold .marker-pin { background: #d99a00; }
.marker-coral .marker-pin { background: #f97366; }
.marker-mint .marker-pin { background: #10b981; }
.marker-violet .marker-pin { background: #7c3aed; }
.marker-olive .marker-pin { background: #6b8e23; }
.marker-magenta .marker-pin { background: #d946ef; }
.marker-slate .marker-pin { background: #475569; }
.marker-maroon .marker-pin { background: #8f1d2c; }
.marker-aqua .marker-pin { background: #22d3ee; }
.marker-plum .marker-pin { background: #9b51e0; }
.marker-salmon .marker-pin { background: #fb7185; }
.marker-forest .marker-pin { background: #15803d; }
.marker-amber .marker-pin { background: #f59e0b; }
.marker-sky .marker-pin { background: #0ea5e9; }
.marker-rose .marker-pin { background: #e11d48; }
.marker-jade .marker-pin { background: #00a36c; }
.marker-copper .marker-pin { background: #b87333; }
.marker-berry .marker-pin { background: #be123c; }
.marker-sea .marker-pin { background: #0f766e; }
.marker-brick .marker-pin { background: #a33a2f; }
.marker-turquoise .marker-pin { background: #14b8a6; }
.marker-orchid .marker-pin { background: #c026d3; }
.marker-sand .marker-pin { background: #ca8a04; }
.marker-azure .marker-pin { background: #2563eb; }
.marker-crimson .marker-pin { background: #dc2626; }
.marker-emerald .marker-pin { background: #059669; }
.marker-periwinkle .marker-pin { background: #6366f1; }
.marker-chartreuse .marker-pin { background: #a3e635; }
.marker-cerulean .marker-pin { background: #0284c7; }
.marker-fuchsia .marker-pin { background: #db2777; }
.marker-khaki .marker-pin { background: #b45309; }
.marker-raspberry .marker-pin { background: #e11d48; }
.marker-lagoon .marker-pin { background: #0891b2; }
.marker-mustard .marker-pin { background: #ca8a04; }
.marker-lavender .marker-pin { background: #8b5cf6; }
.marker-tangerine .marker-pin { background: #ea580c; }
.marker-charcoal .marker-pin { background: #334155; }
.marker-pending .marker-pin {
  animation: jobsiteCoordinatePulse 1.1s ease-in-out infinite;
  background: #f2c94c;
}
.marker-picked .marker-pin { background: #14532d; }
.marker-color-01 .marker-pin { background: #2f80ed; }
.marker-color-02 .marker-pin { background: #f2c94c; }
.marker-color-03 .marker-pin { background: #eb5757; }
.marker-color-04 .marker-pin { background: #27ae60; }
.marker-color-05 .marker-pin { background: #f2994a; }
.marker-color-06 .marker-pin { background: #00a6a6; }
.marker-color-07 .marker-pin { background: #eb5ea8; }
.marker-color-08 .marker-pin { background: #828282; }
.marker-color-09 .marker-pin { background: #9b51e0; }
.marker-color-10 .marker-pin { background: #56ccf2; }
.marker-color-11 .marker-pin { background: #219653; }
.marker-color-12 .marker-pin { background: #bb6bd9; }
.marker-color-13 .marker-pin { background: #f97316; }
.marker-color-14 .marker-pin { background: #14b8a6; }
.marker-color-15 .marker-pin { background: #ef4444; }
.marker-color-16 .marker-pin { background: #3b82f6; }
.marker-color-17 .marker-pin { background: #84cc16; }
.marker-color-18 .marker-pin { background: #a855f7; }
.marker-color-19 .marker-pin { background: #06b6d4; }
.marker-color-20 .marker-pin { background: #f59e0b; }
.marker-color-21 .marker-pin { background: #10b981; }
.marker-color-22 .marker-pin { background: #ec4899; }
.marker-color-23 .marker-pin { background: #6366f1; }
.marker-color-24 .marker-pin { background: #dc2626; }
.marker-color-25 .marker-pin { background: #16a34a; }
.marker-color-26 .marker-pin { background: #0ea5e9; }
.marker-color-27 .marker-pin { background: #d946ef; }
.marker-color-28 .marker-pin { background: #ca8a04; }
.marker-color-29 .marker-pin { background: #0891b2; }
.marker-color-30 .marker-pin { background: #ea580c; }
.marker-color-31 .marker-pin { background: #4f46e5; }
.marker-color-32 .marker-pin { background: #65a30d; }
.marker-color-33 .marker-pin { background: #be123c; }
.marker-color-34 .marker-pin { background: #0284c7; }
.marker-color-35 .marker-pin { background: #7c3aed; }
.marker-color-36 .marker-pin { background: #c2410c; }
.marker-color-37 .marker-pin { background: #15803d; }
.marker-color-38 .marker-pin { background: #0d9488; }
.marker-color-39 .marker-pin { background: #db2777; }
.marker-color-40 .marker-pin { background: #475569; }
.marker-color-41 .marker-pin { background: #1d4ed8; }
.marker-color-42 .marker-pin { background: #9333ea; }
.marker-color-43 .marker-pin { background: #b45309; }
.marker-color-44 .marker-pin { background: #059669; }
.marker-color-45 .marker-pin { background: #e11d48; }
.marker-color-46 .marker-pin { background: #2563eb; }
.marker-color-47 .marker-pin { background: #a3e635; }
.marker-color-48 .marker-pin { background: #f43f5e; }
.marker-color-49 .marker-pin { background: #22d3ee; }
.marker-color-50 .marker-pin { background: #8b5cf6; }

.marker-color-02 .marker-label,
.marker-color-05 .marker-label,
.marker-color-10 .marker-label,
.marker-color-17 .marker-label,
.marker-color-20 .marker-label,
.marker-color-28 .marker-label,
.marker-color-47 .marker-label,
.marker-color-49 .marker-label {
  color: #1b2430;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
}

.marker-yellow .marker-label,
.marker-orange .marker-label,
.marker-lime .marker-label,
.marker-gold .marker-label,
.marker-coral .marker-label,
.marker-aqua .marker-label,
.marker-salmon .marker-label,
.marker-amber .marker-label,
.marker-sky .marker-label,
.marker-sand .marker-label,
.marker-chartreuse .marker-label,
.marker-khaki .marker-label,
.marker-mustard .marker-label,
.marker-tangerine .marker-label,
.marker-pending .marker-label {
  color: #1b2430;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
}

.pin-popup {
  display: grid;
  gap: 6px;
  min-width: 230px;
}

.pin-popup h3 {
  font-size: 15px;
  margin: 0;
}

.pin-popup p {
  margin: 0;
}

.popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.popup-actions a,
.popup-actions button {
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  min-height: 28px;
  padding: 5px 8px;
}

.popup-actions a {
  background: #e9eff4;
  color: #172026;
}

.popup-actions button {
  background: var(--accent);
  color: #ffffff;
}

.message-stack {
  display: grid;
  gap: 8px;
  padding: 12px 24px 0;
}

.message {
  border-radius: 8px;
  font-weight: 700;
  padding: 10px 12px;
}

.message-success { background: #e4f5eb; color: #17633a; }
.message-warning { background: #fff4d8; color: #875f00; }
.message-error { background: #ffe5e2; color: #9f261d; }
.message-info { background: #e8f0ff; color: #174ea6; }

.section-form {
  display: grid;
  gap: 14px;
  max-width: 1120px;
}

.form-section {
  padding: 16px;
}

.form-section h2,
.info-panel h2,
.table-panel h2 {
  font-size: 16px;
  margin: 0 0 12px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.wide {
  grid-column: 1 / -1;
}

.status-strip {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
  text-transform: uppercase;
}

.badge-mapped,
.badge-manual,
.badge-completed,
.priority-low { background: #e4f5eb; color: #17633a; }

.badge-pending,
.badge-needs_review,
.badge-failed,
.priority-normal { background: #edf1f4; color: #4e5c66; }

.priority-high,
.priority-urgent { background: #ffe5e2; color: #9f261d; }

.badge-open,
.badge-assigned,
.badge-scheduled,
.badge-in_progress { background: #e8f0ff; color: #174ea6; }

.badge-draft,
.badge-cancelled { background: #f2eafd; color: #4d2c83; }

.muted {
  color: var(--muted);
}

.detail-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.detail-main {
  display: grid;
  gap: 16px;
}

.detail-side {
  display: grid;
  gap: 16px;
  align-content: start;
}

.info-panel,
.table-panel {
  padding: 16px;
}

.detail-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  margin: 0 0 16px;
}

.detail-grid div {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

dd {
  margin: 3px 0 0;
}

.status-list,
.action-stack {
  display: grid;
  gap: 10px;
}

.action-stack form {
  display: grid;
  gap: 8px;
}

.timeline {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  border-left: 3px solid var(--border);
  display: grid;
  gap: 4px;
  padding-left: 10px;
}

.timeline span {
  color: var(--muted);
  font-size: 12px;
}

code {
  background: #f0f4f7;
  border-radius: 5px;
  color: #34424d;
  display: block;
  font-size: 12px;
  overflow: auto;
  padding: 6px;
}

.table-panel {
  overflow: auto;
}

.ops-table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

.ops-table th,
.ops-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.ops-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.ops-table small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.fix-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: 420px minmax(0, 1fr);
}

.coordinate-pair-field {
  margin-bottom: 12px;
}

.coordinate-pair-field small {
  color: var(--muted);
  font-weight: 600;
}

.coordinate-helper-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.coordinate-helper-actions .is-picking {
  background: #dff4e7;
  color: #14532d;
}

.coordinate-help-panel {
  background: #f7fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
}

.coordinate-help-panel[hidden] {
  display: none;
}

.coordinate-help-panel h3 {
  font-size: 14px;
  margin: 0;
}

.coordinate-help-panel ol {
  color: var(--text);
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 20px;
}

.location-confirmation-body {
  background: #eef3f6;
}

.location-confirmation-shell {
  display: grid;
  gap: 16px;
  margin: 0 auto;
  max-width: 1180px;
  padding: 24px;
}

.location-confirmation-header {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.location-confirmation-header h1 {
  font-size: 28px;
  line-height: 1.1;
  margin: 0 0 6px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.confirmation-expiry {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 240px;
  padding: 12px;
}

.confirmation-expiry span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.confirmation-expiry strong {
  display: block;
  margin-top: 4px;
}

.location-confirmation-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 430px minmax(0, 1fr);
}

.location-confirmation-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.location-confirmation-card h2 {
  font-size: 18px;
  margin: 0;
}

.confirmation-options {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.confirmation-options .is-picking {
  background: #dff4e7;
  color: #14532d;
}

.location-status {
  background: #edf5ff;
  border: 1px solid #c8dcfb;
  border-radius: 8px;
  color: #174ea6;
  font-size: 13px;
  font-weight: 800;
  padding: 10px;
}

.location-status-error {
  background: #ffe5e2;
  border-color: #f0a29a;
  color: #9f261d;
}

.map-card {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.location-confirmation-map {
  height: clamp(520px, 64vh, 760px);
  min-height: 520px;
  position: relative;
  width: 100%;
}

.compact-detail-grid {
  grid-template-columns: 1fr;
  margin-bottom: 0;
}

.success-state,
.unavailable-state {
  max-width: 760px;
}

.success-state {
  border-color: #b7dfc8;
}

.unavailable-state {
  border-color: #f0a29a;
}

.location-link-panel {
  align-items: center;
  background: rgba(17, 25, 31, 0.48);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 2000;
}

.location-link-panel[hidden] {
  display: none;
}

.location-link-dialog {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  max-width: 640px;
  padding: 18px;
  position: relative;
  width: min(100%, 640px);
}

.location-link-dialog h2 {
  font-size: 18px;
  margin: 0;
}

.location-link-close {
  position: absolute;
  right: 10px;
  top: 8px;
}

.action-note {
  font-size: 12px;
  margin: -2px 0 0;
}

.pin-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.history-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.auth-shell {
  display: grid;
  min-height: calc(100vh - 130px);
  place-items: center;
}

.auth-panel {
  box-shadow: var(--shadow);
  max-width: 420px;
  padding: 24px;
  width: 100%;
}

.auth-panel h1 {
  margin: 0 0 6px;
}

.stack-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

@media (max-width: 1100px) {
  .summary-grid,
  .filter-bar,
  .form-grid,
  .history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-layout,
  .detail-layout,
  .fix-layout,
  .location-confirmation-grid {
    grid-template-columns: 1fr;
  }

  .map-layout {
    height: auto;
    min-height: 0;
  }

  .map-sidebar {
    height: 340px;
    min-height: 300px;
  }

  .map-panel {
    height: 520px;
    min-height: 420px;
  }

  .location-confirmation-header {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .app-header,
  .page-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .main-nav,
  .button-row,
  .filter-actions {
    flex-wrap: wrap;
  }

  .summary-grid,
  .filter-bar,
  .form-grid,
  .detail-grid,
  .history-grid {
    grid-template-columns: 1fr;
  }

  .app-main {
    padding: 16px;
  }

  .map-panel,
  .fix-pin-map,
  .location-confirmation-map {
    height: 420px;
    min-height: 360px;
  }

  .location-confirmation-shell {
    padding: 16px;
  }
}
