* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #b8a0a0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 1060px;
  background-color: #b8a0a0;
  padding: 30px 40px;
}

header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}

.logout-btn {
  position: absolute;
  top: 0;
  right: 0;
  padding: 5px 14px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  background: rgba(0,0,0,0.15);
  color: #444;
  cursor: pointer;
}

.logout-btn:hover {
  background: rgba(0,0,0,0.25);
}

header h1 {
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 14px;
}

.scan-area {
  display: flex;
  justify-content: center;
}

.scan-area input {
  width: 260px;
  padding: 10px 16px;
  font-size: 15px;
  border: none;
  border-radius: 4px;
  background: #d4c4c4;
  color: #333;
  text-align: center;
  outline: none;
}

.scan-area input::placeholder {
  color: #888;
}

.scan-area input:focus {
  background: #e0d0d0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Attributes panel */
#attributesPanel {
  margin: 16px auto 20px;
  max-width: 560px;
}

.attributes-header {
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(0,0,0,0.1);
}

#attributesContent {
  font-size: 13px;
  color: #2a2a2a;
  line-height: 1.6;
  padding: 8px 10px;
  background: rgba(255,255,255,0.15);
}

#attributesContent .attr-row {
  display: flex;
  gap: 8px;
}

#attributesContent .attr-label {
  font-weight: 600;
  min-width: 100px;
  color: #444;
}

#attributesContent .attr-value {
  color: #222;
}

/* Grade warning */
.warning {
  margin: 10px auto;
  max-width: 560px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
}

.warning.low-battery {
  background: #f0c040;
  color: #333;
}

.warning.grade-f {
  background: #e05050;
  color: #fff;
}

.warning.year-uncertain {
  background: #5090d0;
  color: #fff;
}

/* Results layout */
.results-layout {
  display: flex;
  gap: 20px;
  margin: 10px 0;
}

.results-main {
  flex: 1;
  min-width: 0;
}

/* Other grades side panel */
.other-grades {
  width: 260px;
  flex-shrink: 0;
}

.other-grades-header {
  font-size: 12px;
  font-weight: 700;
  color: #444;
  padding: 6px 8px;
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
  margin-bottom: 6px;
  text-align: center;
}

.other-grade-row {
  padding: 6px 8px;
  margin: 3px 0;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  border-radius: 3px;
  border-left: 3px solid transparent;
  transition: background 0.15s;
}

.other-grade-row:hover {
  background: rgba(255,255,255,0.3);
}

.other-grade-row.selected {
  background: rgba(100, 180, 100, 0.3);
}

.other-grade-ref {
  font-family: monospace;
  font-weight: 600;
  font-size: 11px;
  color: #555;
}

.other-grade-title {
  display: block;
  font-size: 11px;
  color: #333;
  margin-top: 2px;
  line-height: 1.4;
}

.other-grade-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 4px;
}

.grade-a { background: #4caf50; color: #fff; }
.grade-b { background: #8bc34a; color: #fff; }
.grade-c { background: #ff9800; color: #fff; }
.grade-d { background: #ff5722; color: #fff; }
.grade-e { background: #9e9e9e; color: #fff; }
.grade-f { background: #f44336; color: #fff; }

.other-grade-notes {
  font-size: 10px;
  color: #666;
  font-style: italic;
}

@media (max-width: 800px) {
  .results-layout {
    flex-direction: column;
  }
  .other-grades {
    width: 100%;
  }
}

/* Results */
#resultsPanel {
  margin: 0;
}

.option-row {
  padding: 8px 10px;
  margin: 4px 0;
  font-size: 14px;
  color: #222;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.option-row:hover {
  background: rgba(255,255,255,0.3);
}

.option-row.selected {
  background: rgba(100, 180, 100, 0.3);
  font-weight: 600;
}

.option-rank {
  font-weight: 700;
  min-width: 70px;
  color: #444;
}

.option-ref {
  font-family: monospace;
  font-weight: 600;
  color: #333;
  min-width: 120px;
}

.option-title {
  flex: 1;
  color: #222;
}

.option-accuracy {
  font-weight: 700;
  min-width: 50px;
  text-align: right;
  color: #444;
}

.option-accuracy.high {
  color: #2a7a2a;
}

.option-accuracy.medium {
  color: #8a6a00;
}

.option-accuracy.low {
  color: #aa3030;
}

.year-flag {
  font-size: 11px;
  background: #5090d0;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
}

.option-notes {
  font-size: 11px;
  background: rgba(0,0,0,0.12);
  color: #333;
  padding: 1px 7px;
  border-radius: 3px;
  margin-left: 4px;
  font-style: italic;
}

/* Feedback */
#feedbackPanel {
  margin: 16px auto;
  max-width: 560px;
}

.feedback-row {
  display: flex;
  gap: 8px;
}

.feedback-row input {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  background: rgba(255,255,255,0.35);
  color: #222;
  outline: none;
}

.feedback-row button {
  padding: 8px 16px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  background: #555;
  color: #fff;
  cursor: pointer;
}

.feedback-row button:hover {
  background: #444;
}

.feedback-row button.submitted {
  background: #3a8a3a;
  cursor: default;
}

.feedback-row input.submitted {
  background: rgba(100, 180, 100, 0.3);
  font-weight: 600;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 30px;
}

#resetBtn {
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  background: rgba(0,0,0,0.15);
  color: #333;
  cursor: pointer;
}

#resetBtn:hover {
  background: rgba(0,0,0,0.25);
}

/* Upload section */
.upload-section {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(0,0,0,0.15);
  text-align: center;
}

.upload-header {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 10px;
}

.upload-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.upload-row input[type="file"] {
  font-size: 13px;
  color: #333;
}

.upload-row button {
  padding: 8px 16px;
  font-size: 13px;
  border: none;
  border-radius: 4px;
  background: #555;
  color: #fff;
  cursor: pointer;
}

.upload-row button:hover {
  background: #444;
}

#uploadStatus {
  margin-top: 8px;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 4px;
}

#uploadStatus.success {
  background: rgba(100,180,100,0.3);
  color: #2a5a2a;
}

#uploadStatus.error {
  background: rgba(200,80,80,0.3);
  color: #6a2020;
}

.hidden {
  display: none !important;
}

/* Loading state */
.loading {
  text-align: center;
  color: #555;
  font-style: italic;
  padding: 20px;
}
