:root {
  --primary: #1f7a63;
  --primary-dark: #175c4b;
  --primary-soft: #e7f4f0;
  --secondary: #6fd3c1;
  --bg: #f6faf8;
  --surface: #ffffff;
  --surface-muted: #f8faf9;
  --text: #1f2937;
  --text-soft: #5b6471;
  --line: #d7e0dc;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --success: #1f7a63;
  --success-soft: #e7f4f0;
  --shadow: 0 8px 24px rgba(18, 63, 50, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 84px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 20px;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  color: #fff;
}

.header-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  flex: 0 0 auto;
}

.header-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-copy h1 {
  font-size: 28px;
  font-weight: 800;
}

.header-copy p {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.9;
}

.app-main {
  padding: 16px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.offline-banner,
.card,
.result-card,
.success-card,
.empty-state,
.settings-list {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.offline-banner {
  margin-bottom: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #8a4b08;
  background: #fff3dd;
}

.card,
.settings-list {
  padding: 16px;
  margin-bottom: 12px;
}

.section-title {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-soft);
}

.hero-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

.hero-card h2 {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 800;
}

.hero-card p {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-soft);
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 800;
}

.input-wrap {
  position: relative;
}

.address-input,
.text-input,
.text-area {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  font-size: 19px;
  color: var(--text);
  outline: none;
}

.address-input:focus,
.text-input:focus,
.text-area:focus {
  border-color: var(--primary);
  background: #fff;
}

.text-area {
  min-height: 116px;
  resize: vertical;
}

.inline-section {
  margin-top: 14px;
}

.field-gap {
  margin-top: 12px;
}

.input-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #d9e2de;
  color: var(--text-soft);
}

.input-clear.show {
  display: flex;
}

.suggest-box {
  display: none;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}

.suggest-box.open {
  display: block;
}

.suggest-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border-bottom: 1px solid #edf2ef;
  background: #fff;
  text-align: left;
}

.suggest-item:last-child {
  border-bottom: 0;
}

.suggest-type {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(31, 122, 99, 0.12);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.suggest-text {
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
}

.chip.favorite {
  border-color: var(--secondary);
  background: #f2fffc;
  color: var(--primary-dark);
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.ghost-btn,
.location-btn,
.shortcut-btn,
.call-btn {
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.shortcut-btn {
  width: 100%;
}

.primary-btn,
.submit-btn {
  width: 100%;
  min-height: 54px;
  margin-top: 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.submit-btn {
  background: #ba2f2f;
}

.primary-btn:disabled,
.submit-btn:disabled {
  opacity: 0.5;
}

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

.waste-grid.compact {
  margin-top: 8px;
}

.waste-btn {
  min-height: 82px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-soft);
  font-size: 17px;
  font-weight: 700;
}

.waste-btn span {
  display: block;
}

.waste-icon {
  margin-bottom: 6px;
  font-size: 24px;
}

.waste-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.card-compact {
  padding-top: 12px;
  padding-bottom: 12px;
}

.result-card {
  overflow: hidden;
}

.result-top {
  padding: 16px;
  border-bottom: 1px solid #edf2ef;
}

.result-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.result-top h3 {
  font-size: 22px;
  font-weight: 800;
}

.result-top p {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-soft);
}

.result-body {
  padding: 4px 16px 16px;
}

.result-item {
  padding: 12px 0;
  border-bottom: 1px solid #edf2ef;
}

.result-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.result-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-soft);
}

.result-value {
  margin-top: 3px;
  font-size: 20px;
  font-weight: 800;
}

.result-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-soft);
}

.call-btn {
  margin-top: 12px;
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.result-secondary-btn {
  width: 100%;
  margin-top: 8px;
}

.empty-state {
  padding: 40px 24px;
  text-align: center;
}

.empty-state h3 {
  font-size: 24px;
  font-weight: 800;
}

.empty-state p {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-soft);
}

.error-card {
  margin-bottom: 12px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
}

.error-card.info {
  background: #fff7e8;
  color: #8a5a11;
}

.photo-box {
  position: relative;
  min-height: 156px;
  padding: 16px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  text-align: center;
}

.photo-box.has-photo {
  padding: 0;
  border-style: solid;
  border-color: var(--primary);
  overflow: hidden;
}

.photo-box img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.photo-box .photo-placeholder {
  display: flex;
  min-height: 120px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-soft);
}

.photo-icon {
  font-size: 24px;
  font-weight: 800;
}

.photo-placeholder strong {
  font-size: 18px;
}

.photo-placeholder span {
  font-size: 13px;
}

.photo-input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.photo-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(27, 39, 35, 0.55);
  color: #fff;
  font-size: 18px;
}

.photo-box.has-photo .photo-remove {
  display: block;
}

.helper-text {
  margin-top: 7px;
  font-size: 13px;
  color: var(--text-soft);
}

.upload-progress {
  display: none;
  width: 100%;
  height: 6px;
  margin-top: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5ece9;
}

.upload-progress.show {
  display: block;
}

.upload-bar {
  height: 100%;
  width: 0;
  background: var(--primary);
}

.success-card {
  padding: 26px 20px;
  text-align: center;
  background: var(--success-soft);
}

.success-card h3 {
  font-size: 26px;
  font-weight: 800;
  color: var(--success);
}

.success-card p {
  margin-top: 8px;
  font-size: 15px;
  color: var(--primary-dark);
}

.settings-list h3 {
  font-size: 22px;
  margin-bottom: 6px;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 52px;
  border-bottom: 1px solid #edf2ef;
  font-size: 16px;
}

.settings-item:last-child {
  border-bottom: 0;
}

.settings-item strong {
  font-weight: 700;
}

.settings-item span {
  color: var(--text-soft);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.nav-btn {
  min-height: 72px;
  border: 0;
  background: #fff;
  color: #7b8692;
  font-size: 14px;
  font-weight: 700;
}

.nav-btn.active {
  color: var(--primary);
}

.nav-icon {
  display: block;
  margin-bottom: 4px;
  font-size: 22px;
}

@media (max-width: 360px) {
  .header-copy h1 {
    font-size: 24px;
  }

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

  .action-row {
    grid-template-columns: 1fr;
  }
}
