:root {
  --bg: #F6F4EC;
  --surface: #FFFFFF;
  --ink: #2A2A27;
  --muted: #6B6A63;
  --border: #E4E1D3;
  --teal: #0F6E56;
  --teal-dark: #085041;
  --teal-tint: #E1F5EE;
  --coral: #D85A30;
  --coral-dark: #993C1D;
  --success-bg: #EAF3DE;
  --success-ink: #27500A;
  --danger-bg: #FCEBEB;
  --danger-ink: #791F1F;
  --pending-bg: #FAEEDA;
  --pending-ink: #854F0B;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand { font-weight: 500; font-size: 16px; }
.brand-accent { color: var(--teal); }
.topbar-link { color: var(--muted); font-size: 14px; text-decoration: none; }

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

h1 { font-size: 22px; font-weight: 500; margin: 0 0 8px; }
h2 { font-size: 18px; font-weight: 500; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }

.field { display: block; margin: 16px 0; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  background: var(--bg);
  color: var(--ink);
}
.field input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

.btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  text-align: center;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-accent { background: var(--coral); color: #fff; }
.btn-accent:hover { background: var(--coral-dark); }
.btn-secondary { background: var(--teal-tint); color: var(--teal-dark); }
.btn-small { width: auto; padding: 8px 14px; font-size: 13px; }
.btn-row { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.link-muted { display: block; margin-top: 14px; text-align: center; color: var(--muted); font-size: 14px; }

.demo-banner {
  background: var(--pending-bg);
  color: var(--pending-ink);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 12px;
}

.flash-stack { margin-bottom: 16px; }
.flash { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 8px; }
.flash-error { background: var(--danger-bg); color: var(--danger-ink); }
.flash-success { background: var(--success-bg); color: var(--success-ink); }

/* Signature element: a rising tide bar, echoing Akuraft's raft-forming
   mechanism - the fill line rises toward the 50-point mark like a barrier
   forming rather than a generic progress bar. */
.tide-track {
  height: 28px;
  border-radius: 999px;
  background: var(--teal-tint);
  overflow: hidden;
  position: relative;
  margin-top: 12px;
}
.tide-fill {
  height: 100%;
  min-width: 28px;
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
  position: relative;
  transition: width 0.6s ease;
  overflow: hidden;
}
.tide-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.18) 0 10px, transparent 10px 20px);
  animation: tide-move 3s linear infinite;
}
@keyframes tide-move { from { background-position: 0 0; } to { background-position: 40px 0; } }
@media (prefers-reduced-motion: reduce) { .tide-fill::after { animation: none; } }
.tide-caption { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

.scan-list { list-style: none; padding: 0; margin: 0; }
.scan-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  flex-wrap: wrap;
}
.scan-list li:last-child { border-bottom: none; }
.scan-meta { color: var(--muted); }
.scan-reason { color: var(--danger-ink); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge-approved { background: var(--success-bg); color: var(--success-ink); }
.badge-rejected { background: var(--danger-bg); color: var(--danger-ink); }
.badge-pending { background: var(--pending-bg); color: var(--pending-ink); }

.result-card { text-align: center; }
.result-approved h1 { color: var(--teal-dark); }
.result-rejected h1 { color: var(--danger-ink); }

.stat-row { display: flex; gap: 12px; margin: 16px 0; }
.stat { flex: 1; background: var(--bg); border-radius: 10px; padding: 14px; text-align: center; }
.stat-num { display: block; font-size: 22px; font-weight: 500; color: var(--teal-dark); }
.stat-label { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }

.tab-row { display: flex; gap: 8px; margin-bottom: 16px; }
.tab { padding: 8px 14px; border-radius: 999px; background: var(--bg); color: var(--muted); text-decoration: none; font-size: 13px; }
.tab-active { background: var(--teal); color: #fff; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0; }
.data-table th, .data-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--muted); font-weight: 500; }

code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
