:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --surface: #fffdfa;
  --ink: #20211f;
  --muted: #6d706a;
  --line: #e4dfd4;
  --accent: #0f766e;
  --accent-strong: #0b5c55;
  --gold: #b7791f;
  --soft: #e9f5f2;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(32, 33, 31, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 0%, rgba(15, 118, 110, 0.12), transparent 34%), var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
.button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 750;
  min-height: 44px;
  padding: 0 18px;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

button:hover {
  background: var(--accent-strong);
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.2);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

a {
  color: var(--accent);
}

.ghost-button {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.ghost-button:hover {
  background: #f4f1e9;
  box-shadow: none;
}

.app-shell {
  margin: 0 auto;
  max-width: 1120px;
  min-height: 100vh;
  padding: 16px 16px 104px;
}

.app-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-weight: 850;
  gap: 10px;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 14px;
  color: #fff;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

#menu-toggle {
  display: none;
}

.primary-nav {
  align-items: center;
  background: rgba(255, 253, 250, 0.88);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding: 5px;
  position: sticky;
  top: 8px;
  z-index: 10;
  backdrop-filter: blur(18px);
}

.primary-nav button {
  background: transparent;
  color: var(--muted);
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
}

.primary-nav button.active {
  background: var(--ink);
  color: #fff;
}

.optional-tab {
  opacity: 0.72;
}

.trust-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0;
}

.trust-strip span {
  align-items: center;
  background: rgba(255, 253, 250, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: flex;
  font-size: 0.84rem;
  font-weight: 700;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  text-align: center;
}

.notification-tray {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.toast {
  background: #102522;
  border-radius: 16px;
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--danger);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-card {
  background: linear-gradient(145deg, #fffdfa 0%, #eef8f4 100%);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  margin-top: 14px;
  padding: clamp(24px, 5vw, 58px);
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(2.25rem, 7vw, 4.6rem);
  letter-spacing: 0;
  line-height: 0.98;
  margin-bottom: 0;
  max-width: 850px;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: 0;
  line-height: 1.08;
  margin-bottom: 8px;
}

h3 {
  margin-bottom: 8px;
}

.hero-card p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
  max-width: 680px;
}

.hero-actions,
.section-head,
.field-row,
.card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.step-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 16px 0;
}

.step-row article,
.panel,
.upload-card,
.item-card,
.exchange-card,
.notification-card,
.insights-panel {
  background: rgba(255, 253, 250, 0.9);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 12px 36px rgba(32, 33, 31, 0.06);
}

.step-row article {
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 18px;
}

.step-row b {
  align-items: center;
  background: var(--soft);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.step-row span,
.small,
.muted {
  color: var(--muted);
}

.upload-card,
.panel,
.insights-panel {
  padding: clamp(18px, 4vw, 30px);
}

.item-form,
.auth-forms,
#profile-form,
#payment-form {
  display: grid;
  gap: 12px;
}

input,
textarea,
select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  min-height: 48px;
  outline: none;
  padding: 12px 14px;
  width: 100%;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(15, 118, 110, 0.65);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.dropzone {
  align-items: center;
  background: #f8faf8;
  border: 1.5px dashed #b9c5bf;
  border-radius: 22px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  min-height: 142px;
  padding: 18px;
  text-align: center;
}

.dropzone input {
  display: none;
}

.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-preview img {
  aspect-ratio: 1;
  border-radius: 14px;
  height: 72px;
  object-fit: cover;
  width: 72px;
}

progress {
  accent-color: var(--accent);
  height: 8px;
  width: 100%;
}

.section-head {
  justify-content: space-between;
  margin: 18px 0 12px;
}

.section-head span {
  color: var(--muted);
}

.card-list,
.exchange-progress {
  display: grid;
  gap: 12px;
}

.item-card,
.exchange-card,
.notification-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.item-top,
.exchange-top,
.profile-top {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.thumb-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.thumb-row img {
  aspect-ratio: 1.2;
  border-radius: 16px;
  height: 82px;
  object-fit: cover;
  width: 100px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  align-items: center;
  background: var(--soft);
  border-radius: 999px;
  color: var(--accent-strong);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  min-height: 28px;
  padding: 0 10px;
}

.badge.warn {
  background: #fff4df;
  color: var(--gold);
}

.badge.dark {
  background: var(--ink);
  color: #fff;
}

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

.metric {
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 750;
}

.metric strong {
  display: block;
  font-size: 1.2rem;
  margin-top: 4px;
}

.progress-rail {
  background: #e8e4d9;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress-rail span {
  background: var(--accent);
  display: block;
  height: 100%;
}

.profile-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
}

.profile-card {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.avatar {
  align-items: center;
  background: var(--ink);
  border-radius: 20px;
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  height: 56px;
  justify-content: center;
  width: 56px;
}

.check-row {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 8px;
}

.check-row input {
  min-height: auto;
  width: auto;
}

.sticky-action {
  align-items: center;
  background: rgba(255, 253, 250, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  bottom: 16px;
  box-shadow: var(--shadow);
  display: none;
  gap: 8px;
  left: 16px;
  padding: 6px;
  position: fixed;
  right: 16px;
  z-index: 20;
  backdrop-filter: blur(18px);
}

.sticky-action button {
  flex: 1;
}

details summary {
  cursor: pointer;
  font-weight: 850;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

@media (max-width: 800px) {
  .app-shell {
    padding: 12px 12px 94px;
  }

  #menu-toggle {
    display: inline-flex;
    align-items: center;
  }

  .primary-nav {
    display: none;
    border-radius: 22px;
    flex-wrap: wrap;
    position: static;
  }

  .primary-nav.open {
    display: flex;
  }

  .primary-nav button {
    flex: 1 1 calc(50% - 8px);
  }

  .trust-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step-row,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .field-row,
  .hero-actions,
  .section-head,
  .card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .field-row > *,
  .hero-actions > *,
  .section-head > *,
  .card-actions > * {
    width: 100%;
  }

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

  .item-top,
  .exchange-top,
  .profile-top {
    flex-direction: column;
  }

  .sticky-action {
    display: flex;
  }
}
