:root {
  --green-950: #043b27;
  --green-800: #075f3b;
  --green-700: #087a48;
  --green-100: #dff5e8;
  --green-50: #f0faf4;
  --ink: #10231a;
  --muted: #607067;
  --line: #dce7e0;
  --surface: #fff;
  --warm: #fffaf0;
  --shadow: 0 18px 60px rgba(5, 67, 40, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #f7faf8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, textarea, input { font: inherit; }
button { color: inherit; }

.topbar {
  min-height: 72px;
  padding: 14px clamp(18px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(255,255,255,.14);
  background: var(--green-950);
  color: white;
}
.brand { color: white; text-decoration: none; display: flex; align-items: center; gap: 12px; font-weight: 800; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden;
}
.brand-mark img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.brand-name { letter-spacing: -.02em; }
.status-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.status-badge {
  padding: 8px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  font-size: 12px; background: rgba(255,255,255,.08);
}
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #f2b84b; }
.status-badge.connected .status-dot { background: #55dda0; box-shadow: 0 0 0 4px rgba(85,221,160,.12); }

main { overflow: hidden; }
.hero {
  min-height: 470px;
  padding: 72px clamp(20px, 7vw, 110px) 125px;
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(40px, 6vw, 80px);
  color: white;
  background:
    radial-gradient(circle at 82% 30%, rgba(61, 182, 112, .25), transparent 27%),
    radial-gradient(circle at 98% 90%, rgba(255,255,255,.07), transparent 29%),
    linear-gradient(135deg, #043b27 0%, #075f3b 72%, #096a42 100%);
}
.eyebrow { margin: 0 0 10px; color: #47b97d; font-weight: 850; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.hero .eyebrow { color: #8de3b4; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(42px, 7vw, 78px); line-height: .98; letter-spacing: -.055em; }
h1 span { color: #79d9a6; }
.hero-text { margin: 24px 0; color: #d7e9df; font-size: clamp(17px, 2vw, 21px); line-height: 1.6; }
.trust-note {
  max-width: 680px; padding: 16px; display: grid; grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px; align-items: start; border: 1px solid rgba(141,227,180,.2); border-radius: 16px;
  background: rgba(0,35,21,.16);
}
.trust-note p { margin: 0; color: #c7ddd1; font-size: 14px; line-height: 1.55; }
.trust-note strong, .trust-note p span { display: block; }
.trust-note strong { margin-bottom: 3px; color: #e6f5ed; font-size: 15px; }
.shield {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(121,217,166,.15); color: #91e9ba; font-weight: 900;
}

.hero-image {
  display: grid; place-items: center;
}
.hero-image img {
  width: 100%; max-width: 480px; height: auto; object-fit: contain; border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0,31,18,.3);
}

.workspace, .examples, .results, .disclaimer {
  width: min(1180px, calc(100% - 32px));
  margin-left: auto; margin-right: auto;
}
.workspace {
  position: relative; margin-top: -70px; padding: clamp(24px, 4vw, 46px);
  border: 1px solid var(--line); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow);
}
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 30px; }
.section-heading h2, .result-header h2 { margin: 0; font-size: clamp(25px, 4vw, 36px); letter-spacing: -.035em; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 14px; }
.input-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 20px; }
.field-card { min-width: 0; }
.field-label { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; font-size: 14px; font-weight: 800; }
.field-label span { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--green-100); color: var(--green-800); font-size: 12px; }
.drop-zone {
  min-height: 230px; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1.5px dashed #a8c8b5; border-radius: 18px; background: var(--green-50); cursor: pointer; text-align: center; transition: .2s ease;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--green-700); background: #e8f8ee; transform: translateY(-1px); }
.drop-zone.disabled { opacity: .45; pointer-events: none; border-style: solid; border-color: #c4d6ca; background: #f0f5f2; cursor: not-allowed; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { width: 46px; height: 46px; margin-bottom: 13px; border-radius: 14px; display: grid; place-items: center; background: white; color: var(--green-700); font-size: 25px; box-shadow: 0 8px 22px rgba(7,95,59,.1); }
.drop-zone small { margin-top: 5px; color: var(--muted); }
#imagePreview { display: none; max-height: 170px; max-width: 100%; border-radius: 12px; object-fit: contain; }
.drop-zone.has-image > :not(input):not(img):not(button) { display: none; }
.drop-zone.has-image #imagePreview, .drop-zone.has-image #removeImage { display: block; }
.text-button { display: none; margin-top: 10px; border: 0; background: transparent; color: #a33; font-size: 13px; cursor: pointer; }
textarea {
  display: block; width: 100%; min-height: 230px; padding: 18px; resize: vertical;
  border: 1px solid #cbdad1; border-radius: 18px; color: var(--ink); background: #fcfefd; line-height: 1.55; outline: none;
}
textarea:focus { border-color: var(--green-700); box-shadow: 0 0 0 4px rgba(8,122,72,.1); }
textarea:disabled { opacity: .45; background: #f0f5f2; cursor: not-allowed; }
.field-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.primary-button {
  min-width: 220px; min-height: 52px; padding: 13px 24px; border: 0; border-radius: 14px;
  display: flex; justify-content: center; align-items: center; gap: 10px; background: var(--green-800); color: white; font-weight: 850; cursor: pointer;
  box-shadow: 0 12px 28px rgba(7,95,59,.2); transition: .2s ease;
}
.primary-button:hover { background: var(--green-700); transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .75; transform: none; }
.spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
.primary-button.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-actions { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 26px; }
.form-error { display: none; margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: #fff0ef; color: #8d2722; font-size: 13px; }
.form-error.visible { display: block; }
.trace-consent {
  margin-top: 18px; padding: 13px 15px; display: flex; align-items: flex-start; gap: 11px;
  border: 1px solid var(--line); border-radius: 14px; background: #f8fbf9; cursor: pointer;
}
.trace-consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--green-700); }
.trace-consent span, .trace-consent strong, .trace-consent small { display: block; }
.trace-consent strong { color: var(--green-950); font-size: 13px; }
.trace-consent small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }

.mode-hint {
  display: none; margin-top: 10px; padding: 8px 14px; border-radius: 10px;
  background: #eef7f1; color: var(--green-800); font-size: 12px; font-weight: 600;
}
.mode-hint.visible { display: flex; align-items: center; gap: 6px; }
.mode-hint .hint-icon { font-size: 14px; }

.reset-button {
  display: none; padding: 13px 24px; border: 1.5px solid #c4d6ca; border-radius: 14px;
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 700; cursor: pointer; transition: .2s ease;
}
.reset-button:hover { border-color: var(--green-700); color: var(--green-800); background: var(--green-50); }
.reset-button.visible { display: inline-flex; align-items: center; gap: 8px; }

.examples { padding: 78px 0 38px; }
.section-heading.compact { margin-bottom: 20px; }
.example-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.example-card {
  padding: 17px; border: 1px solid var(--line); border-radius: 17px; display: flex; gap: 13px; align-items: center;
  background: white; text-align: left; cursor: pointer; transition: .2s ease;
}
.example-card:hover { border-color: #8fc0a4; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(5,67,40,.08); }
.example-icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--green-100); color: var(--green-800); font-size: 11px; font-weight: 900; }
.example-card strong, .example-card small { display: block; }
.example-card small { margin-top: 3px; color: var(--muted); }
.example-grid-images {
  margin-top: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}
.example-image-card {
  height: 100%; flex-direction: column; align-items: stretch; padding: 10px; gap: 10px;
}
.example-thumb {
  display: block; width: 100%; height: 300px; object-fit: contain;
  border: 1px solid var(--line); border-radius: 10px; background: #f5f5f5;
}
.example-image-card strong { font-size: 13px; }
.example-image-card small { font-size: 11px; }

.results { padding: 42px 0 50px; }
.result-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.risk-badge { padding: 13px 20px; border-radius: 999px; font-size: clamp(17px, 3vw, 25px); font-weight: 900; }
.risk-looks-normal { background: #dff6e8; color: #12613a; }
.risk-verify-first { background: #fff1c9; color: #825b00; }
.risk-suspicious { background: #ffe0bd; color: #934500; }
.risk-likely-scam { background: #ffe0df; color: #9b2924; }
.risk-inappropriate { background: #ffe0df; color: #9b2924; }
.result-source { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.result-source.cached-result {
  display: inline-flex; width: fit-content; padding: 6px 10px; border-radius: 999px;
  background: var(--green-100); color: var(--green-800); font-weight: 800;
}
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.result-card { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 10px 30px rgba(5,67,40,.045); }
.result-card p, .result-card li { color: #45554c; line-height: 1.65; }
.result-card ul, .result-card ol { margin: 15px 0 0; padding-left: 22px; }
.card-title { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; }
.card-title > span { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--green-100); color: var(--green-800); font-weight: 900; }
.card-title h3 { margin: 0; font-size: 17px; }
.copy-button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbf9; color: var(--muted); font-size: 11px; cursor: pointer; }
.copy-button:hover { color: var(--green-800); border-color: #a6c9b5; }
.reply-card { background: var(--green-50); }
.explanation-card { grid-column: 1 / -1; }
.disclaimer { margin-top: 10px; margin-bottom: 70px; padding: 22px; border: 1px solid #ead9ad; border-radius: 18px; background: var(--warm); }
.disclaimer strong { color: #765400; }
.disclaimer p { margin: 7px 0 0; color: #675f4e; line-height: 1.6; font-size: 14px; }
footer { padding: 24px clamp(18px, 5vw, 72px); display: flex; justify-content: space-between; gap: 18px; color: #c4d9cc; background: var(--green-950); font-size: 12px; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .hero-image { display: none; }
}

@media (max-width: 800px) {
  .topbar { align-items: flex-start; }
  .hero { grid-template-columns: 1fr; padding-top: 55px; }
  .input-grid, .example-grid, .result-grid { grid-template-columns: 1fr; }
  .explanation-card { grid-column: auto; }
  .section-heading, .result-header { align-items: flex-start; flex-direction: column; }
  .field-meta { flex-direction: column; }
  .example-grid-images { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

@media (max-width: 520px) {
  .topbar { min-height: 64px; padding: 11px 14px; align-items: center; gap: 10px; }
  .brand { gap: 9px; min-width: 0; }
  .brand-mark { width: 32px; height: 32px; flex: 0 0 32px; }
  .brand-name { font-size: 12px; white-space: nowrap; }
  .status-badge { max-width: 126px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hero { min-height: 390px; padding: 48px 20px 105px; }
  .workspace { width: calc(100% - 20px); padding: 22px 16px; border-radius: 22px; }
  .examples, .results, .disclaimer { width: calc(100% - 24px); }
  .primary-button { width: 100%; }
  .result-card { padding: 19px; }
  .card-title { grid-template-columns: 30px 1fr; }
  .copy-button { grid-column: 2; justify-self: start; }
  .example-grid-images { grid-template-columns: 1fr; }
  .example-thumb { height: 320px; }
  footer { flex-direction: column; }
}

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