:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #17251f;
  background: #f4f7f5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --green: #176c4c;
  --muted: #718078;
  --line: #e6ece8;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 2%, rgba(206, 232, 216, 0.42), transparent 43%),
    #f4f7f5;
}

button,
textarea {
  font: inherit;
}

.app-shell {
  width: min(100% - 40px, 850px);
  margin: 0 auto;
}

.topbar {
  display: flex;
  height: 76px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #1c3228;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.8px;
  text-decoration: none;
}

.brand-light {
  color: #739080;
  font-weight: 500;
}

.brand-mark {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border-radius: 11px;
  background: #e2f0e8;
}

.brand-mark svg {
  width: 19px;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.prototype-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid #e4ebe6;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.64);
  color: #718078;
  font-size: 11px;
  font-weight: 600;
}

.prototype-tag span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #58ad79;
  box-shadow: 0 0 0 3px #e5f3e9;
}

.intro {
  padding: 24px 0;
  text-align: center;
}

.eyebrow {
  margin: 0 0 13px;
  color: #54836a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.65px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.18;
}

h1 span {
  color: var(--green);
}

.intro-copy {
  margin-bottom: 0;
  color: #728078;
  font-size: 14px;
  line-height: 1.7;
}

.workspace {
  width: min(100%, 680px);
  margin: 0 auto;
}

.input-card,
.results-card {
  border: 1px solid rgba(221, 230, 224, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.89);
  box-shadow: 0 16px 48px rgba(41, 72, 53, 0.055);
}

.input-card {
  padding: 23px;
}

.card-heading,
.input-footer,
.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-heading {
  margin-bottom: 13px;
}

.card-heading label {
  font-size: 13px;
  font-weight: 700;
}

.input-hint {
  color: #9aa69f;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 130px;
  resize: vertical;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fbfcfb;
  color: #28372f;
  font-size: 13px;
  line-height: 1.7;
  transition: border-color 160ms, box-shadow 160ms;
}

textarea:focus {
  border-color: #7bb294;
  box-shadow: 0 0 0 3px rgba(54, 135, 88, 0.1);
}

textarea::placeholder {
  color: #a6b0aa;
}

.input-footer {
  gap: 12px;
  margin-top: 14px;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

#char-count {
  color: #98a39d;
  font-size: 11px;
}

.primary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background 160ms, transform 160ms;
}

.secondary-button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid #dce8e0;
  border-radius: 9px;
  background: #f7faf8;
  color: #32674b;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.secondary-button:hover {
  background: #edf5ef;
}

.primary-button:hover {
  transform: translateY(-1px);
  background: #10583d;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.primary-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.results-card {
  margin-top: 14px;
  padding: 21px 23px 23px;
}

.results-heading {
  margin-bottom: 17px;
}

.results-heading .eyebrow {
  margin-bottom: 5px;
  font-size: 9px;
}

h2 {
  margin-bottom: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  letter-spacing: -0.5px;
}

.result-count {
  padding: 6px 9px;
  border-radius: 99px;
  background: #edf5ef;
  color: #397553;
  font-size: 10px;
  font-weight: 700;
}

.result-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.result-item {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid #edf1ee;
  border-radius: 10px;
  background: #fcfdfc;
}

.result-label {
  display: block;
  margin-bottom: 6px;
  color: #849189;
  font-size: 10px;
}

.result-value {
  display: block;
  overflow-wrap: anywhere;
  color: #24372c;
  font-size: 13px;
  font-weight: 700;
}

.status-message {
  min-height: 18px;
  margin: 15px 4px 0;
  color: #87938b;
  font-size: 11px;
  text-align: center;
}

.map-copy {
  margin: 12px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.capture-card {
  margin-bottom: 18px;
}

.camera-launch {
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 16px;
  border: 1px solid #d7e8de;
  border-radius: 18px;
  background: linear-gradient(145deg, #f3faf6, #e6f2eb);
  color: #174e37;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(23, 108, 76, 0.06);
  transition: background 160ms ease, box-shadow 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.camera-launch-art {
  display: grid;
  width: 112px;
  height: 112px;
  margin-bottom: 4px;
  place-items: center;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 50, 37, 0.15);
}

.camera-launch-art img {
  display: block;
  max-width: 100%;
  object-fit: contain;
  width: 96px;
  height: 96px;
}

.camera-launch-title {
  font-size: 18px;
  font-weight: 700;
}

.camera-launch-hint {
  color: #527362;
  font-size: 12px;
}

@media (hover: hover) {
  .camera-launch:hover:not(:disabled) {
    background: #e0efe6;
    box-shadow: 0 8px 24px rgba(23, 108, 76, 0.13);
  }
}

.camera-launch:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 4px;
}

.camera-launch:active:not(:disabled) {
  background: #d6e9de;
}

.camera-launch:disabled {
  opacity: 0.65;
  cursor: wait;
}

.app-details {
  margin-top: 14px;
  font-size: 12px;
}

.app-details summary {
  min-height: 44px;
  padding: 12px 0;
  color: var(--green);
  cursor: pointer;
  line-height: 1.6;
}

.text-option .input-card {
  margin-top: 8px;
}

#capture-status:empty {
  display: none;
}

#camera-view {
  margin-top: 16px;
  padding-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
  background: #17251f;
  scroll-margin: 16px;
}

.camera-feed {
  position: relative;
  width: min(100%, calc(38svh * 16 / 9));
  margin: 0 auto;
}

#camera-preview {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}

#camera-zoom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 0;
  color: white;
  font-size: 12px;
}

#camera-zoom label {
  flex-shrink: 0;
}

#zoom-level {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  accent-color: #82d6a7;
}

#zoom-help {
  margin: 6px 12px 0;
  color: #e4eee7;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.camera-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 12px 4px;
}

.camera-shutter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  min-width: 150px;
  padding: 8px 18px;
  border: 2px solid white;
  border-radius: 32px;
  background: white;
  color: #17251f;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.shutter-icon {
  width: 32px;
  height: 32px;
  border: 3px solid #176c4c;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px white;
  background: #176c4c;
}

.camera-shutter:disabled {
  opacity: 0.65;
  cursor: wait;
}

.camera-shutter:focus-visible {
  outline: 3px solid #82d6a7;
  outline-offset: 3px;
}

#camera-capture-hint {
  margin: 10px 12px 0;
  color: #e4eee7;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

#camera-preview,
#photo-preview {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.camera-guide {
  position: absolute;
  top: 50%;
  left: 5%;
  width: 90%;
  aspect-ratio: 3.2;
  transform: translateY(-50%);
  border: 3px solid #fff;
  border-radius: 8px;
  box-shadow: 0 0 0 2px var(--green);
  pointer-events: none;
}

#confirm-photo {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  font-size: 13px;
}

#photo-plate {
  width: 100%;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  text-transform: uppercase;
}

.capture-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.6;
}

.capture-consent input {
  flex-shrink: 0;
  margin-top: 4px;
}

#capture-status.error {
  color: #b34343;
}

.map-copy a {
  color: var(--green);
}

#location-map {
  width: 100%;
  height: 340px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

[hidden] {
  display: none !important;
}

.status-message.error {
  color: #b34343;
}

footer {
  padding: 49px 0 28px;
  color: #a1aaa4;
  font-size: 10px;
  text-align: center;
}

@media (max-width: 560px) {
  .camera-launch {
    gap: 6px;
    padding: 14px 10px;
  }

  .camera-launch-art {
    width: 80px;
    height: 80px;
    border-radius: 20px;
  }

  .camera-launch-art img {
    width: 72px;
    height: 72px;
  }

  .camera-launch-title {
    font-size: 16px;
  }

  .camera-launch-hint {
    font-size: 11px;
    overflow-wrap: anywhere;
  }

  .app-shell {
    width: min(100% - 28px, 450px);
  }

  .topbar {
    height: 64px;
  }

  .intro {
    padding: 16px 0 20px;
  }

  h1 {
    font-size: clamp(28px, 8vw, 36px);
    letter-spacing: -1px;
  }

  .intro-copy {
    max-width: 300px;
    margin-right: auto;
    margin-left: auto;
    font-size: 13px;
  }

  .input-card {
    padding: 17px;
  }

  textarea {
    min-height: 145px;
    font-size: 13px;
  }

  .input-footer {
    align-items: flex-end;
  }

  .button-group {
    gap: 6px;
  }

  .secondary-button,
  .primary-button {
    min-height: 40px;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 10px;
  }

  .results-card {
    padding: 18px 17px;
  }

  .result-list {
    grid-template-columns: 1fr;
  }

  footer {
    padding-top: 36px;
  }
}

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