:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #12151a;
  --muted: #5c6570;
  --line: #dde2e8;
  --brand: #1a6b58;
  --brand-light: #e8f5f1;
  --brand-ink: #0c3d32;
  --accent: #c48a2c;
  --danger: #b42318;
  --success: #1a6b58;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(18, 21, 26, 0.06), 0 16px 40px rgba(18, 21, 26, 0.08);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1014;
    --surface: #161a20;
    --ink: #eef1f4;
    --muted: #98a2ae;
    --line: #272d36;
    --brand: #3db896;
    --brand-light: #0f2a24;
    --brand-ink: #b8e8dc;
    --accent: #e0aa4a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 16px 48px rgba(0, 0, 0, 0.45);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 8px 14px;
  border-radius: 0 0 8px 0;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand .mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--brand), var(--accent));
  box-shadow: 0 2px 8px rgba(26, 107, 88, 0.25);
}

.brand small {
  display: block;
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-ink);
  background: var(--brand-light);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  padding: 6px 12px;
  border-radius: 999px;
}

.privacy-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.model-badge {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
}

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 860px) {
  main {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.intro {
  grid-column: 1 / -1;
}

.intro h1 {
  font-size: clamp(1.6rem, 1rem + 2.5vw, 2.4rem);
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.intro p {
  color: var(--muted);
  margin: 0;
  max-width: 62ch;
  font-size: 1.02rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card h2 {
  font-size: 1.05rem;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.card h3 {
  font-size: 0.92rem;
  margin: 0 0 8px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.field {
  margin-bottom: 18px;
}

.hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 6px 0 0;
}

input[type="number"],
select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 148px;
  text-align: center;
  cursor: pointer;
  font: inherit;
  color: var(--muted);
  background: var(--bg);
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.15s, color 0.15s;
}

.dropzone:hover,
.dropzone.drag {
  border-color: var(--brand);
  color: var(--brand-ink);
}

.dropzone img {
  max-height: 200px;
  max-width: 100%;
  border-radius: 8px;
  object-fit: contain;
}

.dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.dz-icon {
  font-size: 1.6rem;
  opacity: 0.6;
}

.consent-block {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  background: var(--brand-light);
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
}

.consent-block label {
  font-weight: 400;
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0;
}

.consent-block strong {
  display: block;
  color: var(--ink);
  margin-bottom: 2px;
}

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

button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 18px;
  background: var(--brand);
  color: #fff;
  transition: filter 0.15s, transform 0.05s;
}

button:hover:not(:disabled) {
  filter: brightness(1.07);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button.secondary {
  background: transparent;
  color: var(--brand);
  border-color: var(--line);
}

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

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

.actions {
  margin-top: 4px;
}

.samples {
  margin-top: 16px;
  font-size: 0.88rem;
}

.samples summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
}

.sample-row {
  margin-top: 10px;
}

.sample-row select {
  flex: 1;
  min-width: 160px;
}

.result-panel .placeholder {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.result-size {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.result-size .size {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--brand);
}

.result-size .adj {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 999px;
}

.confidence {
  margin: 16px 0;
}

.confidence .lbl {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.confidence .bar {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.confidence .bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--brand));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.method-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}

table.metrics {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.9rem;
}

table.metrics th,
table.metrics td {
  text-align: left;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
}

table.metrics th[scope="row"] {
  font-weight: 500;
  color: var(--muted);
}

table.metrics td.val {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

table.metrics td.range {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}

.why-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.9rem;
  margin-top: 12px;
}

.why-box h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
}

.why-box p {
  margin: 0;
  color: var(--muted);
}

.why-box strong {
  color: var(--brand-ink);
}

.alert {
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  color: var(--danger);
}

.learn-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.learn-state {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 10px 0 0;
}

.learn-state b {
  color: var(--ink);
}

footer {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 28px 16px 36px;
}

footer p {
  margin: 0;
}

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

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .privacy-pill .dot {
    animation: none;
  }
  .confidence .bar > span {
    transition: none;
  }
}
