.page {
  width: min(1080px, 95%);
  margin: 1.5rem auto 2rem;
}

.brand-header {
  gap: 1rem;
}

.brand-header-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  justify-self: center;
  text-align: center;
}

.brand-logo-accenture {
  width: 170px;
  top: 0;
}

.brand-logo-app {
  width: 220px;
  max-width: 38vw;
  top: 0;
}

.card {
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}

.welcome-card {
  background: linear-gradient(135deg, #f6fffc 0%, #ebf8f4 100%);
}

.welcome-copy {
  margin-top: 0.35rem;
  color: #35564e;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.metric-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.metric-item {
  border: 1px solid #b8ddd6;
  border-radius: 6px;
  padding: 0.7rem;
  background: #ffffff;
}

.metric-item strong {
  display: block;
  margin-top: 0.3rem;
  color: #006858;
  font-size: 1.2rem;
}

.metric-label {
  color: #3f635a;
  font-size: 0.88rem;
}

.table-wrap {
  overflow-x: auto;
}

.analytics-container {
  margin-top: 0.8rem;
}

.user-analytics-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.9rem;
  overflow: hidden;
}

.user-analytics-header {
  background: #d5ede8;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.user-analytics-header .username {
  font-weight: 700;
  font-size: 1rem;
  margin-right: 0.5rem;
}

.user-analytics-header .role-badge {
  font-size: 0.75rem;
  background: #9ecdc4;
  color: #004d42;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

.user-analytics-body {
  padding: 0.5rem 1rem 0.75rem;
}

.handbook-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
}

.handbook-table th {
  background: #d5ede8;
  color: #006858;
  font-weight: 600;
  border-bottom: 1px solid #9ecdc4;
  padding: 0.4rem 0.5rem;
}

.handbook-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #c0ddd8;
}

.handbook-table tr:last-child td {
  border-bottom: none;
}

.no-handbooks {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.4rem 0;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.78rem;
  margin-right: 0.35rem;
}

.pill-passed {
  background: #e6f4ec;
  color: #1a5c30;
  border: 1px solid #a8d8bc;
}

.pill-failed {
  background: #fde8ee;
  color: #8b1a2e;
  border: 1px solid #e8a0b0;
}

.pill-open {
  background: #e8f1f8;
  color: #003064;
  border: 1px solid #b8d0e8;
}

.interactive-pill {
  cursor: pointer;
}

.interactive-pill:hover {
  filter: brightness(0.98);
}

.failed-tests-panel {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid #e8a0b0;
  border-radius: 8px;
  background: #fff8fa;
}

.failed-tests-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.failed-tests-list {
  margin: 0;
  padding-left: 1.25rem;
}

.failed-tests-list li {
  margin-bottom: 0.3rem;
}

.defects-section {
  margin-top: 0.3rem;
  font-size: 0.88rem;
}

.defects-section strong {
  color: #006858;
}

.defect-list {
  margin: 0;
  padding-left: 1rem;
}

.defect-list li {
  margin-bottom: 0.4rem;
}

.chapter-feedback-section {
  margin-top: 0.65rem;
  font-size: 0.88rem;
}

.chapter-feedback-section strong {
  color: #006858;
}

.chapter-feedback-list.admin-like {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.chapter-feedback-item {
  border: 1px solid #c0ddd8;
  border-radius: 6px;
  background: #f7fcfb;
  padding: 0.55rem 0.7rem;
}

.chapter-feedback-rating {
  display: inline-block;
  margin-top: 0.2rem;
  color: #1a5c30;
  font-weight: 600;
}

.chapter-feedback-remark {
  margin-top: 0.35rem;
  color: var(--text);
  white-space: pre-wrap;
}

.chapter-feedback-list {
  margin: 0;
  padding-left: 1.1rem;
}

.chapter-feedback-list li {
  margin-bottom: 0.45rem;
}

.feedback-rating {
  display: inline-block;
  margin-left: 0.6rem;
  font-size: 0.9rem;
  color: #2f5e53;
}

.feedback-remark {
  margin-top: 0.25rem;
  color: #3f6159;
}

.handbook-row {
  margin-top: 0.5rem;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 0.8rem;
}

.row-single {
  grid-template-columns: 1fr;
}

.item {
  background: #ffffff;
  border: 1px solid #b8ddd6;
  border-radius: 6px;
  padding: 0.72rem;
}

.item h3 {
  margin: 0;
  font-size: 0.9rem;
  color: #4a6a62;
}

.item p {
  margin: 0.35rem 0 0;
  font-size: 1.08rem;
  font-weight: 600;
  color: #006858;
}

.info {
  line-height: 1.4;
}

.card h2 {
  margin-top: 0;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.55rem 0.65rem;
}

.btn-group {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-save-tester {
  box-shadow: 0 8px 16px rgba(79, 22, 143, 0.18);
}

.btn-clear-tester {
  background: linear-gradient(135deg, #67708b, #7f88a6);
}

.btn-export-json {
  background: linear-gradient(135deg, #177457, #2e9a77);
}

.info-status {
  margin-top: 0.75rem;
}

.action-row {
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-refresh {
  padding: 0.55rem 0.9rem;
}

.user-hint {
  margin-top: 0.55rem;
  font-size: 0.86rem;
  color: var(--muted);
}

#btnToggleEnvironment {
  display: block;
  width: auto;
  text-align: left;
  padding: 10px 14px;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  background: #4a7a6e;
  color: white;
  border-radius: 4px;
}

#btnToggleEnvironment:hover {
  background-color: rgba(0, 104, 88, 0.05);
  border-radius: 4px;
}

#environmentContent {
  display: none;
}

#environmentContent.expanded {
  display: block;
}

@media (max-width: 760px) {
  .row {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
}
