:root {
  --ink: #241c16;
  --muted: #6b5e54;
  --paper: #f3eadc;
  --card: #fffaf3;
  --line: #e0d3c2;
  --teal: #0f4c5c;
  --clay: #c45c26;
  --clay-dark: #9c4318;
  --ok: #2f6b4f;
  --bad: #9b2c2c;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Nirmala UI", sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, #efe3cf 0%, transparent 55%),
    var(--paper);
  color: var(--ink);
  min-height: 100vh;
}

.page {
  width: min(720px, calc(100% - 32px));
  margin: 36px auto 64px;
}

.top h1 {
  margin: 4px 0 8px;
  font-size: 34px;
  letter-spacing: -0.03em;
}
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--teal);
  font-weight: 700;
}
.lede {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 17px;
}
.logout {
  margin: 0 0 16px;
  font-size: 13px;
}
.logout a { color: var(--teal); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(36, 28, 22, 0.06);
  margin-bottom: 16px;
}

.label {
  display: block;
  font-weight: 700;
  margin: 0 0 8px;
  font-size: 15px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 12px;
}
input[type="text"]:focus,
input[type="password"]:focus {
  outline: 2px solid var(--teal);
  border-color: var(--teal);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 8px;
}
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
}
.chip:hover, .chip.active {
  border-color: var(--teal);
  background: #e7f2f4;
  color: var(--teal);
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  margin: 4px 0 8px;
}
.hint {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.go {
  width: 100%;
  border: 0;
  background: var(--clay);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  padding: 13px 16px;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}
.go:hover { background: var(--clay-dark); }
.go:disabled {
  background: #cbb8a8;
  cursor: not-allowed;
}

.hidden { display: none; }
.status-msg { margin: 0 0 12px; font-size: 16px; line-height: 1.4; }

.bar {
  height: 8px;
  background: #eadfce;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}
.bar span {
  display: block;
  height: 100%;
  width: 12%;
  background: var(--teal);
  transition: width 0.35s ease;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stats div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.stats b { display: block; font-size: 20px; }
.stats span { color: var(--muted); font-size: 12px; }

.result { border-color: #b7d7c5; }
.error { border-color: #e3b6b6; }
.banner {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.banner.warn { background: #fbe8d5; color: #7a3e12; }
code { font-size: 13px; }

.download { margin-top: 8px; background: var(--ok); }
.download:hover { background: #24563f; }

#chips { margin-bottom: 20px; }
#area-chips { margin-bottom: 4px; }

@media (max-width: 640px) {
  .page { margin-top: 20px; }
}
