:root {
  color-scheme: light;
  --bg: #edf3ef;
  --ink: #17211d;
  --muted: #66736d;
  --surface: #ffffff;
  --line: #d7e3dd;
  --forest: #0f6f5f;
  --forest-dark: #114d43;
  --leaf: #18a058;
  --sky: #0e7490;
  --amber: #d97706;
  --rose: #be123c;
  --slate: #475569;
  --shadow: 0 18px 45px rgba(20, 47, 39, 0.16);
  --dock-shadow: 0 -12px 35px rgba(20, 47, 39, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(24, 160, 88, 0.16), transparent 28%),
    linear-gradient(180deg, #f6faf8 0%, #edf3ef 52%, #e6eee9 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 14px 118px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
  margin: 0 -14px 10px;
  padding: 12px 14px;
  background: rgba(246, 250, 248, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(215, 227, 221, 0.7);
}

.brand-mark {
  display: grid;
  width: 74px;
  height: 56px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 10px 24px rgba(20, 47, 39, 0.1);
}

.brand-mark img {
  display: block;
  width: 66px;
  height: 48px;
  object-fit: contain;
}

.brand-copy p,
.brand-copy h1 {
  margin: 0;
}

.brand-copy p {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-copy h1 {
  color: var(--forest-dark);
  font-size: clamp(1.18rem, 5.4vw, 1.5rem);
  line-height: 1.08;
}

.report-flow {
  display: grid;
  gap: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.camera-stage {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(17, 77, 67, 0.18), transparent 38%),
    #14221e;
  box-shadow: var(--shadow);
}

.camera-stage.has-photo {
  background: #101614;
}

.camera-stage::before,
.camera-stage::after {
  position: absolute;
  z-index: 1;
  width: 38px;
  height: 38px;
  border-color: rgba(255, 255, 255, 0.52);
  content: "";
  pointer-events: none;
}

.camera-stage::before {
  top: 18px;
  left: 18px;
  border-top: 2px solid;
  border-left: 2px solid;
  border-radius: 12px 0 0 0;
}

.camera-stage::after {
  right: 18px;
  bottom: 18px;
  border-right: 2px solid;
  border-bottom: 2px solid;
  border-radius: 0 0 12px 0;
}

.camera-copy {
  position: absolute;
  z-index: 3;
  top: 22px;
  left: 22px;
  right: 22px;
  color: white;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.4);
}

.camera-copy p,
.camera-copy h2 {
  margin: 0;
}

.camera-copy p {
  font-size: 0.8rem;
  font-weight: 900;
  opacity: 0.86;
}

.camera-copy h2 {
  width: min(310px, 100%);
  margin-top: 4px;
  font-size: clamp(1.65rem, 8vw, 2.35rem);
  line-height: 1.03;
}

.viewfinder {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #101614;
}

.viewfinder img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.camera-stage.has-photo .viewfinder img {
  visibility: visible;
  opacity: 1;
}

.viewfinder img[hidden] {
  display: none;
}

.camera-stage.has-photo .viewfinder::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.34), transparent 35%, rgba(0, 0, 0, 0.28));
  content: "";
  pointer-events: none;
}

.photo-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 112px 22px 96px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 900;
  text-align: center;
}

.camera-stage.has-photo .photo-empty,
.camera-stage.has-photo .camera-icon-large {
  display: none !important;
}

.camera-icon {
  display: block;
  flex: 0 0 auto;
  background: currentColor;
  mask: url("/static/icons/camera.svg") center / contain no-repeat;
  -webkit-mask: url("/static/icons/camera.svg") center / contain no-repeat;
}

.camera-icon-large {
  width: 78px;
  height: 78px;
  color: rgba(255, 255, 255, 0.86);
}

.camera-icon-button {
  width: 22px;
  height: 22px;
  color: var(--forest);
}

.camera-actions {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.primary-action,
.ghost-action,
.icon-button,
.submit-button {
  border: 0;
  border-radius: 16px;
  font-weight: 900;
  cursor: pointer;
}

.primary-action {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ffffff;
  color: var(--forest-dark);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.ghost-action {
  min-height: 54px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  backdrop-filter: blur(12px);
}

.gps-strip {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  padding: 14px 14px 14px 16px;
  box-shadow: 0 12px 32px rgba(20, 47, 39, 0.08);
}

.mini-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.gps-strip strong {
  display: block;
  color: var(--forest-dark);
  font-size: 0.98rem;
}

.icon-button {
  width: auto;
  min-width: 112px;
  height: 48px;
  background: #e4f4ef;
  color: var(--forest-dark);
  font-size: 0.78rem;
}

.locate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
}

.locate-icon {
  display: block;
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url("/static/icons/locate-fixed.svg") center / contain no-repeat;
  -webkit-mask: url("/static/icons/locate-fixed.svg") center / contain no-repeat;
}

.map-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(20, 47, 39, 0.08);
}

.location-map {
  position: relative;
  overflow: hidden;
  height: 190px;
  min-height: 190px;
  width: 100%;
  background: #dce8e2;
}

.location-map .leaflet-pane,
.location-map .leaflet-layer,
.location-map .leaflet-tile-container,
.location-map .leaflet-tile,
.location-map .leaflet-marker-icon,
.location-map .leaflet-marker-shadow,
.location-map .leaflet-pane > svg,
.location-map .leaflet-pane > canvas {
  position: absolute;
  top: 0;
  left: 0;
}

.location-map .leaflet-map-pane {
  z-index: 1;
}

.location-map .leaflet-tile-pane {
  z-index: 2;
}

.location-map .leaflet-overlay-pane {
  z-index: 4;
}

.location-map .leaflet-tile {
  max-width: none !important;
  max-height: none !important;
  border: 0;
  user-select: none;
  -webkit-user-drag: none;
}

.location-map .leaflet-control-attribution {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 10;
  font-size: 0.64rem;
}

.report-sheet {
  border: 1px solid var(--line);
  border-radius: 26px 26px 18px 18px;
  background: rgba(255, 255, 255, 0.96);
  padding: 10px 14px 16px;
  box-shadow: 0 14px 40px rgba(20, 47, 39, 0.1);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: #c7d7d0;
}

.field-group {
  min-width: 0;
  margin: 0 0 16px;
  border: 0;
  padding: 0;
}

.field-group legend,
.comment-field span {
  display: block;
  margin-bottom: 10px;
  color: #26362f;
  font-size: 0.94rem;
  font-weight: 900;
}

.waste-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.waste-chip,
.quantity-tabs label {
  position: relative;
  display: grid;
  min-height: 54px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbfa;
  color: #2a3933;
  font-size: 0.88rem;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
}

.waste-chip input,
.quantity-tabs input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.waste-chip:has(input:checked),
.quantity-tabs label:has(input:checked) {
  border-color: transparent;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(20, 47, 39, 0.16);
}

.waste-chip.plastic:has(input:checked) {
  background: var(--rose);
}

.waste-chip.glass:has(input:checked) {
  background: var(--sky);
}

.waste-chip.metal:has(input:checked) {
  background: var(--slate);
}

.waste-chip.paper:has(input:checked) {
  background: var(--amber);
}

.waste-chip.organic:has(input:checked) {
  background: var(--leaf);
}

.waste-chip.other:has(input:checked) {
  background: #6d5dfc;
}

.quantity-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-radius: 18px;
  background: #edf3ef;
  padding: 5px;
}

.quantity-tabs label {
  min-height: 46px;
  border: 0;
  background: transparent;
}

.quantity-tabs label:has(input:checked) {
  background: var(--forest);
}

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

textarea,
.coordinate-grid input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdfc;
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 92px;
  padding: 13px 14px;
  resize: vertical;
}

textarea:focus,
.coordinate-grid input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(15, 111, 95, 0.14);
}

.location-details {
  border-top: 1px solid #edf3ef;
  padding-top: 10px;
}

.location-details summary {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
}

.coordinate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.coordinate-grid label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.coordinate-grid input {
  margin-top: 6px;
  padding: 11px 12px;
}

.submit-dock {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  padding: 12px max(14px, calc((100vw - 520px) / 2 + 14px)) calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(215, 227, 221, 0.82);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: var(--dock-shadow);
}

.message {
  min-height: 18px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.message.success {
  color: var(--forest-dark);
}

.message.error {
  color: var(--rose);
}

.submit-button {
  width: 100%;
  min-height: 54px;
  background: linear-gradient(135deg, var(--forest), var(--leaf));
  color: white;
  box-shadow: 0 12px 24px rgba(15, 111, 95, 0.24);
}

.submit-button:disabled,
.icon-button:disabled,
.ghost-action:disabled {
  cursor: wait;
  opacity: 0.66;
}

@media (min-width: 760px) {
  .app-shell {
    padding-top: 22px;
  }

  .app-header {
    border-radius: 24px;
    margin: 0 0 14px;
    border: 1px solid rgba(215, 227, 221, 0.75);
  }
}

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

  .camera-stage {
    min-height: 330px;
  }

  .coordinate-grid {
    grid-template-columns: 1fr;
  }
}
