/* Recon — light paper theme, emerald accent.
 * Deliberately distinct from solver.kxant.org (dark, purple-cyan). */

:root {
  --bg: #fafaf6;
  --surface: #ffffff;
  --surface-muted: #f0efe9;
  --text: #1c1a16;
  --muted: #6f6c63;
  --border: #e2e0d6;
  --accent: #0d7a5f;
  --accent-ink: #ffffff;
  --danger: #b3261e;
  --warn-bg: #fff7e0;
  --warn-border: #e8c96a;
  --radius: 12px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", "Noto Sans Myanmar", "Myanmar Text", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

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

.mono, code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }

/* top bar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 18px; }
.mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); font-size: 17px;
}
.brand-name .accent { color: var(--accent); }
.badge {
  font-size: 12px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
  background: var(--surface-muted);
}

/* hero */
.hero { padding: 32px 0 8px; }
.hero h1 { font-size: 28px; line-height: 1.35; margin: 0 0 8px; }
.hero h1 .accent { color: var(--accent); }
.hero .sub { margin: 0; color: var(--muted); font-size: 16px; }

/* mode toggle */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.mode {
  text-align: left; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; font-family: inherit; color: var(--text);
  min-height: 56px;
}
.mode .mode-name { display: block; font-weight: 700; font-size: 15px; }
.mode .mode-desc { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.mode.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: #eef7f3; }

.field input[type="file"] {
  width: 100%; min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; font-family: inherit;
  background: var(--bg); color: var(--text);
}
#binaryPanel h2 { font-size: 18px; margin: 0 0 8px; }
#binReport h3 { font-size: 17px; margin: 24px 0 8px; }

/* panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}
.panel h2 { font-size: 18px; margin: 0 0 12px; }

.field { display: block; margin-bottom: 4px; }
.label { display: block; font-weight: 600; margin-bottom: 6px; }
.label .req { color: var(--danger); }
.field input[type="url"], .field input[type="text"] {
  width: 100%; min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 16px; font-family: inherit;
  background: var(--bg); color: var(--text);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.hint { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }

.panel-foot { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }

.btn {
  min-height: 44px; padding: 10px 20px;
  border-radius: 8px; border: 1px solid transparent;
  font-size: 16px; font-weight: 600; font-family: inherit;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }

.err {
  color: var(--danger); background: #fdecea;
  border: 1px solid #f5c6c2; border-radius: 8px;
  padding: 10px 12px; margin: 14px 0 0; font-size: 15px;
}

.progress { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--muted); }
.spinner {
  width: 20px; height: 20px; flex: none;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* report */
.report-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; flex-wrap: wrap; margin: 28px 0 4px;
}
.report-head h2 { font-size: 22px; margin: 0; word-break: break-word; }
.url-line { margin: 4px 0 0; color: var(--muted); font-size: 14px; word-break: break-all; }

#report h3 { font-size: 17px; margin: 24px 0 8px; }
#report h3 .count { color: var(--muted); font-weight: 600; font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px; font-size: 14px;
}
.mono-chips .chip { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }

.warn {
  background: var(--warn-bg); border: 1px solid var(--warn-border);
  border-radius: 8px; padding: 10px 12px; margin-top: 12px; font-size: 14px;
}
.warn p { margin: 4px 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.endpoints { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.endpoints th, .endpoints td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.endpoints thead th { background: var(--surface-muted); font-size: 13px; color: var(--muted); }
.endpoints tbody tr:last-child td { border-bottom: none; }
.endpoints td.path { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.method {
  display: inline-block; font-weight: 700; font-size: 12px;
  border-radius: 6px; padding: 2px 8px; color: #fff; white-space: nowrap;
}
.method.GET { background: #0d7a5f; }
.method.POST { background: #9a6a00; }
.method.PUT { background: #6a5acd; }
.method.PATCH { background: #b3560e; }
.method.DELETE { background: #b3261e; }
.method.WS { background: #37474f; }
.method.HEAD, .method.OPTIONS { background: #6f6c63; }
.copy-btn {
  min-height: 36px; padding: 4px 12px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-muted); cursor: pointer; font-family: inherit;
}
.copy-btn.copied { background: var(--accent); color: #fff; border-color: var(--accent); }

.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px;
  font-size: 14px;
}
.form-card .mono { word-break: break-all; }
.form-card .fields { color: var(--muted); margin: 6px 0 0; }

.foot { margin: 32px 0 48px; font-size: 14px; color: var(--muted); }
.foot p { margin: 6px 0; }

@media (max-width: 560px) {
  .hero h1 { font-size: 24px; }
  .panel { padding: 16px; }
  .report-head { flex-direction: column; }
  .report-head .btn { width: 100%; }
}
