:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #65736d;
  --line: #d9e1dd;
  --panel: #fbfcfb;
  --soft: #eef4f1;
  --accent: #13795b;
  --accent-strong: #0f5f49;
  --pay: #1f6fb2;
  --bonus: #b35516;
  --shadow: 0 18px 50px rgba(24, 38, 32, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #e7ece9;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(231, 236, 233, 0.88), rgba(231, 236, 233, 0.88)),
    #e7ece9;
}

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

.auth-gate-inner {
  display: grid;
  gap: 14px;
  width: min(380px, 100%);
  padding: 24px;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-gate-inner h1 {
  font-size: 1.45rem;
}

.auth-gate-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  height: 100vh;
  padding: 14px;
  overflow: hidden;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  height: calc(100vh - 28px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background:
    linear-gradient(rgba(23, 33, 29, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 29, 0.05) 1px, transparent 1px),
    #dfe9e4;
  background-size: 64px 64px;
}

.us-map {
  display: block;
  width: 100%;
  height: 100%;
}

.state {
  fill: rgba(255, 255, 255, 0.72);
  stroke: rgba(23, 33, 29, 0.22);
  stroke-width: 0.8;
}

.map-note {
  fill: rgba(23, 33, 29, 0.65);
  font-size: 0.8rem;
  font-weight: 700;
}

.map-point {
  fill: var(--accent);
  stroke: #fff;
  stroke-width: 2.5;
  filter: drop-shadow(0 6px 10px rgba(23, 33, 29, 0.25));
  cursor: pointer;
}

.map-point.has-bonus {
  fill: var(--bonus);
}

.map-point.has-pay {
  fill: var(--pay);
}

.map-point.active {
  stroke: #17211d;
  stroke-width: 3.5;
}

.map-tooltip {
  position: absolute;
  z-index: 700;
  width: min(310px, calc(100% - 32px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(23, 33, 29, 0.2);
  transform: translate(-50%, calc(-100% - 18px));
}

.map-tooltip[hidden] {
  display: none;
}

.map-tooltip h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.map-tooltip p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.summary-strip {
  position: absolute;
  z-index: 500;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 8px;
  max-width: 560px;
}

.map-overlay-top {
  position: absolute;
  z-index: 500;
  top: 16px;
  left: 16px;
  display: grid;
  gap: 8px;
  max-width: min(520px, calc(100% - 32px));
}

.map-scope,
.map-legend {
  padding: 9px 11px;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(251, 252, 251, 0.94);
  font-size: 0.78rem;
  font-weight: 750;
  backdrop-filter: blur(8px);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

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

.legend-dot {
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(23, 33, 29, 0.2);
}

.legend-dot.pay {
  background: var(--pay);
}

.legend-dot.bonus {
  background: var(--bonus);
}

.legend-dot.standard {
  background: var(--accent);
}

.summary-strip div {
  padding: 10px 12px;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 8px;
  background: rgba(251, 252, 251, 0.94);
  backdrop-filter: blur(8px);
}

.summary-strip span {
  display: block;
  font-size: 1.35rem;
  font-weight: 760;
  line-height: 1;
}

.summary-strip small {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.panel-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.header-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.auth-control {
  min-height: 38px;
}

.google-login-button {
  min-width: 168px;
  min-height: 38px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.google-login-button[hidden] {
  display: none;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-menu[hidden] {
  display: none;
}

.user-name {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 38px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

.icon-button {
  min-width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.text-button {
  font-size: 0.82rem;
  font-weight: 750;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.filters {
  display: grid;
  flex: 0 0 auto;
  gap: 12px;
  max-height: min(42vh, 390px);
  overflow: auto;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #f7faf8;
}

label {
  display: grid;
  gap: 5px;
}

label span,
legend {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

input[type="search"],
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

input[type="search"] {
  padding: 0 12px;
}

select {
  padding: 0 10px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.state-filter {
  display: grid;
  gap: 5px;
}

.state-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 132px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.state-option {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 30px;
  gap: 7px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.state-option:hover {
  background: var(--soft);
}

.state-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--accent);
}

.state-option span {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segment {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.segment.active {
  color: #fff;
  background: var(--accent);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.selected-job {
  flex: 0 0 auto;
  margin: 14px 20px 0;
  padding: 14px;
  border: 1px solid #bfd8cf;
  border-radius: 8px;
  background: #eef7f3;
}

.pagination {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  gap: 8px;
  margin: 14px 20px 0;
}

.pagination[hidden] {
  display: none;
}

.pagination button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-strong);
  background: #fff;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
}

.pagination button:disabled {
  color: #a2ada8;
  cursor: not-allowed;
}

.pagination span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.listings {
  display: grid;
  align-content: start;
  flex: 1 1 auto;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 14px 20px 20px;
}

.job-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.job-card:hover,
.job-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(19, 121, 91, 0.12);
}

.job-card h2,
.selected-job h2 {
  margin: 0 0 8px;
  font-size: 0.98rem;
  line-height: 1.28;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #26332f;
  background: var(--soft);
  font-size: 0.76rem;
  font-weight: 650;
}

.pill.pay {
  color: #0d4f86;
  background: #e7f1fb;
}

.pill.bonus {
  color: #8b3f0e;
  background: #fff0e5;
}

.teaser {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.empty {
  padding: 22px 14px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 920px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    padding: 0;
    overflow: visible;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .map-pane {
    min-height: 52vh;
    height: 52vh;
  }

  .panel {
    max-height: none;
    height: auto;
    overflow: visible;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .listings {
    overflow: visible;
  }

  .filters {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 560px) {
  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-header,
  .filters,
  .pagination,
  .listings {
    padding-left: 14px;
    padding-right: 14px;
  }

  .pagination {
    margin-left: 14px;
    margin-right: 14px;
  }

  .panel-header {
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
}
