:root {
  color-scheme: light;
  font: 100%/1.55 "Segoe UI", system-ui, sans-serif;
  --ink: #142f33;
  --muted: #526970;
  --canvas: #f0f5f4;
  --paper: #fff;
  --field: #f8fbfa;
  --line: #d6e4e1;
  --strong-line: #a3bab6;
  --primary: #08675b;
  --primary-dark: #064e45;
  --deep: #0e3539;
  --accent: #d3f58d;
  --soft: #e8f5ef;
  --error: #9b2924;
  --shadow: 0 1px 2px #113f3910, 0 12px 32px #113f390b;
  --radius: 1rem;
  --content: 73rem;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; background: var(--canvas); color: var(--ink); }
a { color: var(--primary); text-underline-offset: 0.22em; }
a:hover { color: var(--primary-dark); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #167d6d; outline-offset: 3px; }
h1, h2, h3, p, dl { margin: 0; }
h1, h2, h3 { line-height: 1.15; }
h1 { font-size: clamp(2.15rem, 5vw, 3.45rem); font-weight: 760; letter-spacing: -0.055em; }
h2 { font-size: 1.35rem; font-weight: 740; letter-spacing: -0.033em; }
h3 { font-size: 1.16rem; font-weight: 710; letter-spacing: -0.023em; }
.muted { color: var(--muted); }
.skip-link {
  position: absolute;
  z-index: 2;
  top: -6rem;
  left: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--paper);
}
.skip-link:focus { top: 0.75rem; }

.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner {
  max-width: var(--content);
  min-height: 4.3rem;
  margin: auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-size: 1.46rem;
  font-weight: 780;
  letter-spacing: -0.065em;
  text-decoration: none;
}
.brand-mark {
  position: relative;
  flex: none;
  width: 2.14rem;
  height: 2.14rem;
  border-radius: 0.68rem;
  background: var(--deep);
}
.brand-mark::before {
  content: "";
  position: absolute;
  inset: 24% 29% 36%;
  border-right: 0.15rem solid var(--accent);
  border-bottom: 0.15rem solid var(--accent);
  transform: rotate(45deg);
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.15rem clamp(0.05rem, 1.5vw, 0.65rem);
}
.site-nav a, .site-nav .button { min-height: 2.55rem; font-size: 0.9rem; }
.site-nav a:not(.button) {
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.62rem;
  border-radius: 0.5rem;
  color: var(--muted);
  font-weight: 620;
  text-decoration: none;
}
.site-nav a:not(.button):hover,
.site-nav a[aria-current="page"] { color: var(--primary-dark); background: var(--soft); }
.site-nav form { margin: 0; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.85rem;
  padding: 0.65rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  text-align: center;
  font-size: 0.94rem;
  font-weight: 690;
  line-height: 1.2;
  text-decoration: none;
}
.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-dark); color: #fff; }
.button-outline { background: var(--paper); border-color: var(--strong-line); color: var(--primary-dark); }
.button-outline:hover { background: var(--soft); }
.button-accent { background: var(--accent); color: var(--deep); }
.button-accent:hover { background: #e2ffb4; color: var(--deep); }
.button-accent:focus-visible { outline-color: var(--accent); }
.button-quiet { background: transparent; color: var(--primary-dark); padding: 0.4rem 0.65rem; }
.button-quiet:hover { background: var(--soft); color: var(--primary-dark); }

.page { max-width: var(--content); margin: auto; padding: 2rem 1.5rem 4rem; }
.notices { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.notice {
  padding: 0.78rem 1rem;
  border: 1px solid #b4d8cb;
  border-left: 4px solid var(--primary);
  border-radius: 0.65rem;
  color: var(--primary-dark);
  background: var(--soft);
}
.notice.error { color: var(--error); background: #fff1ef; border-color: #e4b2ac; border-left-color: var(--error); }
.panel, .project-tile, .match-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.auth-page { max-width: 63rem; padding-top: clamp(2.3rem, 9vh, 6rem); }
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  min-height: 29rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.3rem;
  background: var(--paper);
  box-shadow: 0 24px 70px #123e3820;
}
.auth-aside {
  position: relative;
  isolation: isolate;
  display: flex;
  overflow: hidden;
  padding: clamp(1.55rem, 4vw, 3.35rem);
  color: #f5fff9;
  background: radial-gradient(ellipse at 88% 88%, #1e6556, transparent 71%), var(--deep);
}
.auth-aside p {
  max-width: 12ch;
  font-size: clamp(1.9rem, 3.6vw, 3.35rem);
  font-weight: 725;
  line-height: 1.07;
  letter-spacing: -0.04em;
}
.search-graphic {
  position: absolute;
  z-index: -1;
  inset: auto -12% -20% 4%;
  aspect-ratio: 1;
  background: radial-gradient(circle, #c7f7bd38 0 0.85px, transparent 1px) 0 0 / 14px 14px;
  mask-image: radial-gradient(ellipse, #000 18%, #000b 44%, transparent 73%);
}
.search-graphic-orbit {
  position: absolute;
  inset: 25%;
  border: 1px solid #c9f9c76b;
  border-radius: 50%;
  box-shadow: 0 0 0 2rem #c9f9c719, 0 0 0 4rem #c9f9c715, 0 0 0 6rem #c9f9c70b;
}
.search-graphic-sweep {
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  background: conic-gradient(from -72deg, transparent 0deg 288deg, #dcff9824 334deg, #dcff987e 360deg);
}
.search-graphic-point {
  position: absolute;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0.39rem #d3f58d22;
}
.point-one { left: 47%; top: 42%; }
.point-two { left: 31%; top: 55%; width: 0.4rem; height: 0.4rem; }
.point-three { left: 66%; top: 31%; width: 0.42rem; height: 0.42rem; }
.auth-panel, .password-panel { padding: clamp(1.55rem, 4vw, 3.3rem); }
.auth-panel { align-self: center; }
.auth-panel h1, .password-panel h1 { font-size: clamp(2rem, 4.8vw, 2.85rem); }
.auth-panel .muted { margin-top: 0.55rem; }
.auth-panel .stack-form, .password-panel .stack-form { margin-top: 1.65rem; }
.auth-panel .button-primary { width: 100%; margin-top: 0.15rem; }
.auth-footer { border-top: 1px solid var(--line); margin-top: 1.3rem; padding-top: 1rem; color: var(--muted); }
.auth-footer a { font-weight: 660; }
.password-panel { max-width: 36rem; margin: auto; }
.password-panel .button-primary { justify-self: start; }

.stack-form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.4rem; min-width: 0; }
.field label { font-weight: 660; }
.field input, .field textarea {
  width: 100%;
  min-width: 0;
  padding: 0.66rem 0.77rem;
  border: 1px solid var(--strong-line);
  border-radius: 0.65rem;
  background: var(--field);
  color: var(--ink);
}
.field input { min-height: 2.95rem; }
.field textarea { min-height: 5.2rem; resize: vertical; }
.field textarea::placeholder { color: var(--muted); }
.field [aria-invalid="true"] { border-color: var(--error); }
.help, .errorlist { font-size: 0.88rem; }
.help { color: var(--muted); }
.help ul, .errorlist { margin: 0; padding-left: 1.2rem; }
.errorlist { color: var(--error); }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.1rem 1.5rem;
  margin-bottom: 1.35rem;
}
.page-heading > div { min-width: 0; overflow-wrap: anywhere; }
.page-heading p { margin-top: 0.45rem; color: var(--muted); }
.overview-heading {
  min-height: 10.6rem;
  align-items: center;
  padding: clamp(1.4rem, 4vw, 2.65rem);
  border-radius: 1.15rem;
  background: radial-gradient(ellipse at 99% 112%, #20745b, transparent 70%), var(--deep);
  color: #fcfffe;
}
.overview-heading p { color: #dcf0ea; }
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
}
.project-tile {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.project-tile:hover { border-color: #70a89b; color: var(--primary-dark); box-shadow: 0 7px 24px #123f3918; }
.project-tile:hover h2 { text-decoration: underline; text-underline-offset: 0.2em; }
.project-tile p { color: var(--muted); }
.tile-footer { margin-top: auto; padding-top: 0.82rem; display: grid; gap: 0.72rem; }
.tile-stats, .project-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tile-stats > div, .project-stats > div { min-width: 0; }
.tile-stats > div + div, .project-stats > div + div { padding-left: 0.9rem; border-left: 1px solid var(--line); }
.tile-stats dt, .project-stats dt { color: var(--muted); font-size: 0.87rem; line-height: 1.25; }
.tile-stats dd, .project-stats dd {
  margin: 0.25rem 0 0;
  font-size: 1.48rem;
  font-variant-numeric: tabular-nums;
  font-weight: 745;
  line-height: 1;
}
.tile-stats dd span, .project-stats dd span { color: var(--muted); font-size: 0.95rem; font-weight: 620; }
.project-tile progress {
  appearance: none;
  width: 100%;
  height: 0.36rem;
  border: 0;
  border-radius: 1rem;
  background: #e0ebe8;
  color: var(--primary);
  accent-color: var(--primary);
}
.project-tile progress::-webkit-progress-bar { border-radius: 1rem; background: #e0ebe8; }
.project-tile progress::-webkit-progress-value { border-radius: 1rem; background: var(--primary); }
.project-tile progress::-moz-progress-bar { border-radius: 1rem; background: var(--primary); }
.empty-card {
  padding: 1.25rem;
  border: 1px dashed var(--strong-line);
  border-radius: var(--radius);
  background: #f8fbfa;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.empty-card h2 { margin-bottom: 0.38rem; color: var(--ink); }

.breadcrumb { margin-bottom: 0.72rem; font-size: 0.92rem; font-weight: 650; }
.project-heading { padding-bottom: 1.26rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.project-stats {
  flex: 0 1 16rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--paper);
}
.project-workspace {
  display: grid;
  grid-template-columns: minmax(18.5rem, 0.72fr) minmax(0, 1.28fr);
  align-items: start;
  gap: 1.5rem;
}
.query-panel { min-width: 0; padding: clamp(1.1rem, 2.6vw, 1.45rem); }
.query-panel h2 { margin-bottom: 1.1rem; }
.job-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.55rem;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.job-status strong { color: var(--primary-dark); }
.job-status time { font-variant-numeric: tabular-nums; }
.job-status.job-failed strong { color: var(--error); }

.project-results { min-width: 0; display: grid; gap: 1.55rem; }
.match-section h2 { margin: 0 0 0.7rem 0.1rem; }
.match-list { display: grid; gap: 0.7rem; }
.match-card { min-width: 0; display: grid; gap: 0.55rem; padding: 1.12rem 1.3rem; overflow-wrap: anywhere; }
.match-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.45rem 1rem; }
.match-heading > div { min-width: 0; }
.match-card h3 a { color: var(--ink); text-decoration-color: #779b91; }
.match-card h3 a:hover { color: var(--primary-dark); text-decoration-color: currentColor; }
.match-source { margin-bottom: 0.31rem; color: var(--primary-dark); font-size: 0.88rem; font-weight: 660; }
.match-price {
  flex: none;
  max-width: 45%;
  padding: 0.33rem 0.62rem;
  border-radius: 0.48rem;
  background: var(--soft);
  color: var(--primary-dark);
  font-weight: 725;
  line-height: 1.25;
}
.match-location { color: var(--ink); font-size: 0.91rem; font-weight: 625; }
.match-summary, .match-footer { color: var(--muted); font-size: 0.94rem; }
.match-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding-top: 0.52rem;
  border-top: 1px solid var(--line);
  font-size: 0.87rem;
}
.match-footer .button { min-height: 2.2rem; }
.match-excluded { background: #f8fbfa; box-shadow: none; }
.match-excluded .match-price { background: #e9f0ee; color: var(--muted); }

@media (max-width: 49rem) {
  .project-workspace { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
}

@media (max-width: 40rem) {
  .topbar-inner, .page { padding-inline: 1rem; }
  .site-nav a:not(.button), .site-nav .button { padding-inline: 0.5rem; }
  .auth-page { padding-top: 1.65rem; }
  .auth-shell { grid-template-columns: minmax(0, 1fr); min-height: initial; }
  .auth-aside { align-items: center; min-height: 6.3rem; padding: 1.15rem 1.5rem; }
  .auth-aside p { max-width: 17ch; font-size: clamp(1.36rem, 4.6vw, 1.85rem); }
  .search-graphic { inset: auto -14% -160% 30%; }
}

@media (max-width: 31rem) {
  .topbar-inner { flex-wrap: wrap; }
  .site-nav { justify-content: flex-start; }
  .site-nav a, .site-nav .button { min-height: 2.15rem; }
  .page { padding-top: 1.3rem; }
  .auth-page { padding-top: 1.4rem; }
  .form-actions .button { flex: 1 1 auto; }
  .project-stats { flex-basis: 100%; max-width: 22rem; }
  .match-card { padding-inline: 1rem; }
  .match-price { max-width: 40%; }
}
