:root {
  --ink: #1b2430;
  --muted: #5b6673;
  --line: #d9dee3;
  --accent: #1f6feb;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --danger: #c23b3b;
  --highlight: #ffd400;
}

* { box-sizing: border-box; }

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

header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  gap: 12px 20px;
}

.header-logo { height: 28px; width: auto; display: block; }

header h1 { font-size: 18px; margin: 0; white-space: nowrap; }

#reviewer-bar { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); margin-left: auto; }
#reviewer-bar.hidden { display: none; }

.filing-label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.filing-label select {
  display: inline-block;
  margin-top: 0;
  width: auto;
  max-width: 220px;
  padding: 5px 8px;
  font-size: 13px;
}

@media (max-width: 680px) {
  header { justify-content: center; text-align: center; }
  #reviewer-bar { margin-left: 0; }
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px 28px;
}
.brand-text { font-size: 12px; color: var(--muted); white-space: nowrap; }

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

#login-screen, #search-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}

#login-screen { max-width: 320px; margin: 60px auto 0; }

#login-form label, #search-form label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

#search-form label { display: inline-block; margin-right: 16px; }

input, select {
  display: block;
  margin-top: 6px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 16px;
  background: var(--surface);
  color: var(--ink);
}

#search-form input { width: 90px; display: inline-block; }
#search-form select { width: auto; display: inline-block; max-width: 260px; }

#login-form button { margin-top: 14px; }

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
}

button:hover { opacity: 0.9; }

#logout-btn { background: transparent; color: var(--muted); border: 1px solid var(--line); }

.error { color: var(--danger); font-size: 13px; margin-top: 10px; }
.status { color: var(--muted); font-size: 13px; margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.hidden { display: none !important; }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

.progress-bar {
  margin-top: 14px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 40%;
  border-radius: 3px;
  background: var(--accent);
  animation: progress-slide 1.1s ease-in-out infinite;
}
@keyframes progress-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

#result { margin-top: 24px; }

#result-meta {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
}
#result-meta b { color: var(--ink); }

#image-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #222;
}

#sheet-image { display: block; max-width: 100%; height: auto; }

#highlight-box {
  position: absolute;
  border: 3px solid var(--highlight);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  display: none;
}
