/* ==========================================================================
   Command Garden — Component Styles
   ========================================================================== */

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: var(--space-3) 0;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  color: var(--color-deep-green);
  text-decoration: none;
  white-space: nowrap;
}

.nav__logo:hover {
  color: var(--color-deep-green);
}

.nav__logo-icon {
  font-size: var(--text-xl);
  line-height: 1;
}

.nav__logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.nav__logo-full {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-default);
  text-decoration: none;
}

.nav__link:hover {
  color: var(--color-deep-green);
  background: var(--color-cream);
}

.nav__link--active {
  color: var(--color-deep-green);
  background: var(--color-cream);
}

.nav__link--source {
  color: var(--color-earth);
  border: 1px solid var(--color-border);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
}

.nav__link--source:hover {
  border-color: var(--color-earth);
  color: var(--color-earth);
}

.nav__mobile-toggle {
  display: none;
  padding: var(--space-2);
  color: var(--color-text-muted);
}

@media (max-width: 639px) {
  .nav__mobile-toggle {
    display: flex;
  }

  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface-card);
    border-bottom: var(--border-default);
    padding: var(--space-4);
    box-shadow: var(--shadow-md);
  }

  .nav__links--open {
    display: flex;
  }

  .nav__link {
    width: 100%;
    justify-content: flex-start;
    padding: var(--space-3) var(--space-4);
  }
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-20) 0 var(--space-16);
  text-align: center;
  background: linear-gradient(
    180deg,
    var(--surface-primary) 0%,
    var(--color-cream) 100%
  );
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(26, 77, 46, 0.04) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: rgba(26, 77, 46, 0.06);
  border: 1px solid rgba(26, 77, 46, 0.12);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-deep-green);
  margin-bottom: var(--space-6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  background: var(--color-success);
  border-radius: var(--radius-full);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hero__logo {
  display: block;
  max-width: 300px;
  width: 65%;
  height: auto;
  margin: 0 auto var(--space-6);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero__title {
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  color: var(--color-deep-green);
  margin-bottom: var(--space-4);
  letter-spacing: -0.03em;
}

.hero__tagline {
  font-size: var(--text-2xl);
  font-weight: var(--weight-medium);
  color: var(--color-text-dark);
  max-width: 42ch;
  margin: 0 auto var(--space-4);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

.hero__description {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 52ch;
  margin: 0 auto var(--space-8);
  line-height: var(--leading-relaxed);
}

.hero__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 639px) {
  .hero {
    padding: var(--space-12) 0 var(--space-10);
  }

  .hero__title {
    font-size: var(--text-3xl);
  }

  .hero__tagline {
    font-size: var(--text-lg);
  }

  .hero__logo {
    max-width: 220px;
    width: 70%;
  }
}

/* ---------- Section ---------- */
.section {
  padding: var(--space-12) 0;
}

.section + .section {
  border-top: var(--border-default);
}

.section__header {
  margin-bottom: var(--space-8);
}

.section__label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-gold);
  margin-bottom: var(--space-2);
}

.section__title {
  font-size: var(--text-2xl);
  color: var(--color-text-dark);
  margin-bottom: var(--space-2);
}

.section__subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 60ch;
}

/* ---------- Card ---------- */
.card {
  background: var(--surface-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-normal) var(--ease-default),
    transform var(--duration-normal) var(--ease-default);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card--interactive {
  cursor: pointer;
}

.card--interactive:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.card__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.card__body {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.card__footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: var(--border-default);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
  line-height: 1.5;
  white-space: nowrap;
}

.badge--shipped {
  background: rgba(45, 122, 79, 0.1);
  color: var(--color-success);
}

.badge--failed {
  background: rgba(180, 64, 64, 0.1);
  color: var(--color-error);
}

.badge--pending {
  background: rgba(196, 163, 90, 0.1);
  color: var(--color-warning);
}

.badge--info {
  background: rgba(58, 122, 180, 0.1);
  color: var(--color-info);
}

.badge--pass {
  background: rgba(45, 122, 79, 0.1);
  color: var(--color-success);
}

.badge--fail {
  background: rgba(180, 64, 64, 0.1);
  color: var(--color-error);
}

/* ---------- Score Bar ---------- */
.score-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
}

.score-bar__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  min-width: 80px;
  text-align: right;
  white-space: nowrap;
}

.score-bar__track {
  flex: 1;
  height: 8px;
  background: var(--color-cream);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.score-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(
    90deg,
    var(--color-sage) 0%,
    var(--color-deep-green) 100%
  );
  transition: width var(--duration-slow) var(--ease-default);
  min-width: 2px;
}

.score-bar__fill--gold {
  background: linear-gradient(
    90deg,
    var(--color-accent-gold) 0%,
    var(--color-accent-gold-light) 100%
  );
}

.score-bar__value {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-dark);
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Score Table ---------- */
.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.score-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.score-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-default);
  vertical-align: middle;
}

.score-table tr:last-child td {
  border-bottom: none;
}

.score-table tr:hover td {
  background: var(--color-cream);
}

.score-table__candidate {
  font-weight: var(--weight-medium);
}

.score-table__score {
  font-variant-numeric: tabular-nums;
  text-align: center;
  font-weight: var(--weight-medium);
}

.score-table__total {
  font-weight: var(--weight-bold);
  color: var(--color-deep-green);
}

.score-table__winner td {
  background: rgba(26, 77, 46, 0.04);
}

.score-table__winner .score-table__candidate {
  color: var(--color-deep-green);
}

/* ---------- Candidate Card ---------- */
.candidate-card {
  background: var(--surface-card);
  border: var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: all var(--duration-normal) var(--ease-default);
}

.candidate-card__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-cream);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.candidate-card__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
  color: var(--color-text-dark);
}

.candidate-card__summary {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

.candidate-card__scores {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ---------- Winner Highlight ---------- */
.winner-highlight {
  background: linear-gradient(
    135deg,
    rgba(26, 77, 46, 0.03) 0%,
    rgba(196, 163, 90, 0.06) 100%
  );
  border: 2px solid var(--color-deep-green);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  position: relative;
  overflow: hidden;
}

.winner-highlight::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-deep-green),
    var(--color-accent-gold),
    var(--color-sage)
  );
}

.winner-highlight__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--color-deep-green);
  color: white;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}

.winner-highlight__title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-deep-green);
  margin-bottom: var(--space-3);
}

.winner-highlight__rationale {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  max-width: 65ch;
}

.winner-highlight__score {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: rgba(26, 77, 46, 0.08);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-deep-green);
}

/* ---------- Feedback Form ---------- */
.feedback-form {
  background: var(--surface-card);
  border: var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.feedback-form__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

.feedback-form__description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.feedback-form__field {
  margin-bottom: var(--space-4);
}

.feedback-form__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-2);
  color: var(--color-text-dark);
}

.feedback-form__textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--space-3) var(--space-4);
  border: var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-primary);
  resize: vertical;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  transition: border-color var(--duration-fast) var(--ease-default),
    box-shadow var(--duration-fast) var(--ease-default);
}

.feedback-form__textarea:focus {
  outline: none;
  border-color: var(--color-sage);
  box-shadow: 0 0 0 3px rgba(92, 138, 110, 0.15);
}

.feedback-form__textarea--error {
  border-color: var(--color-error);
}

.feedback-form__error {
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-top: var(--space-1);
  display: none;
}

.feedback-form__error--visible {
  display: block;
}

.feedback-form__char-count {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  text-align: right;
  margin-top: var(--space-1);
}

.feedback-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--color-deep-green);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  min-width: 120px;
}

.feedback-form__submit:hover {
  background: #164025;
  box-shadow: var(--shadow-sm);
}

.feedback-form__submit:active {
  transform: translateY(1px);
}

.feedback-form__submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Reaction Bar ---------- */
.reaction-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.reaction-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border: var(--border-default);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: var(--surface-card);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  user-select: none;
}

.reaction-bar__btn:hover {
  border-color: var(--color-sage);
  background: var(--color-cream);
  color: var(--color-text-dark);
}

.reaction-bar__btn--active {
  border-color: var(--color-sage);
  background: rgba(92, 138, 110, 0.1);
  color: var(--color-deep-green);
}

.reaction-bar__count {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 11px;
  width: 2px;
  background: var(--color-border);
}

.timeline-entry {
  position: relative;
  padding-bottom: var(--space-6);
}

.timeline-entry:last-child {
  padding-bottom: 0;
}

.timeline-entry__dot {
  position: absolute;
  left: calc(-1 * var(--space-8) + 4px);
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--surface-card);
  border: 2px solid var(--color-sage);
  z-index: 1;
}

.timeline-entry__dot--shipped {
  background: var(--color-success);
  border-color: var(--color-success);
}

.timeline-entry__dot--failed {
  background: var(--color-error);
  border-color: var(--color-error);
}

.timeline-entry__dot--today {
  background: var(--color-accent-gold);
  border-color: var(--color-accent-gold);
  box-shadow: 0 0 0 4px rgba(196, 163, 90, 0.2);
}

.timeline-entry__date {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.timeline-entry__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text-dark);
  margin-bottom: var(--space-2);
  margin-top: var(--space-1);
}

.timeline-entry__title a {
  color: inherit;
  text-decoration: none;
}

.timeline-entry__title a:hover {
  color: var(--color-deep-green);
}

.timeline-entry__summary {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

/* ---------- Artifact Link ---------- */
.artifact-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-default);
}

.artifact-link:hover {
  border-color: var(--color-sage);
  color: var(--color-deep-green);
  background: var(--color-cream);
}

.artifact-link__icon {
  font-size: var(--text-base);
  opacity: 0.7;
}

.artifact-link__name {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* ---------- Tag ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  background: var(--color-cream);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-earth);
  white-space: nowrap;
}

.tag--green {
  background: rgba(26, 77, 46, 0.08);
  color: var(--color-deep-green);
}

.tag--gold {
  background: rgba(196, 163, 90, 0.12);
  color: var(--color-accent-gold);
}

/* ---------- Garden Stats ---------- */
.garden-stats {
  background: var(--surface-secondary);
  padding: var(--space-10) 0;
  text-align: center;
}

.garden-stats h2 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-dark);
  margin-bottom: var(--space-6);
}

.garden-stats__list {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: var(--space-10);
  margin: 0;
  padding: 0;
}

.garden-stats__item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.garden-stats__item dt {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  order: 1;
  margin-top: var(--space-2);
}

.garden-stats__item dd {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--color-deep-green);
  line-height: var(--leading-tight);
  order: 0;
}

/* Skeleton modifier */
.garden-stats--skeleton .garden-stats__list {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: var(--space-10);
}

.garden-stats--skeleton .garden-stats__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.garden-stats--skeleton .garden-stats__item dt,
.garden-stats--skeleton .garden-stats__item dd {
  background: linear-gradient(
    90deg,
    var(--color-border-light) 25%,
    var(--color-cream) 50%,
    var(--color-border-light) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
}

.garden-stats--skeleton .garden-stats__item dd {
  width: 3rem;
  height: 2.25rem;
}

.garden-stats--skeleton .garden-stats__item dt {
  width: 6rem;
  height: 0.875rem;
}

@media (max-width: 639px) {
  .garden-stats__list {
    flex-direction: column;
    gap: var(--space-6);
  }

  .garden-stats--skeleton .garden-stats__list {
    flex-direction: column;
    gap: var(--space-6);
  }
}

/* ---------- Skeleton Loading ---------- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-cream) 25%,
    var(--color-border-light) 50%,
    var(--color-cream) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
  user-select: none;
}

.skeleton--text {
  height: 1em;
  margin-bottom: var(--space-2);
}

.skeleton--text-sm {
  height: 0.875em;
  width: 60%;
  margin-bottom: var(--space-2);
}

.skeleton--title {
  height: 1.5em;
  width: 70%;
  margin-bottom: var(--space-3);
}

.skeleton--card {
  height: 120px;
  border-radius: var(--radius-lg);
}

.skeleton--bar {
  height: 8px;
  border-radius: var(--radius-full);
}

.skeleton--badge {
  height: 22px;
  width: 64px;
  border-radius: var(--radius-full);
}

@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-card);
  border: var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 380px;
  pointer-events: auto;
  animation: toast-in var(--duration-normal) var(--ease-default);
  transition: all var(--duration-normal) var(--ease-default);
}

.toast--exiting {
  opacity: 0;
  transform: translateX(100%);
}

.toast__icon {
  font-size: var(--text-lg);
  line-height: 1;
  flex-shrink: 0;
}

.toast__content {
  flex: 1;
}

.toast__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-1);
}

.toast__message {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.toast__close {
  padding: var(--space-1);
  color: var(--color-text-light);
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.toast__close:hover {
  color: var(--color-text-muted);
  background: var(--color-cream);
}

.toast--success {
  border-left: 3px solid var(--color-success);
}

.toast--error {
  border-left: 3px solid var(--color-error);
}

.toast--info {
  border-left: 3px solid var(--color-info);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(16px) translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
}

@media (max-width: 639px) {
  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
  }

  .toast {
    max-width: none;
  }
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(26, 26, 26, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) var(--ease-default),
    visibility var(--duration-normal);
}

.modal-overlay--open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(16px) scale(0.98);
  transition: transform var(--duration-normal) var(--ease-default);
}

.modal-overlay--open .modal {
  transform: translateY(0) scale(1);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: var(--border-default);
}

.modal__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.modal__close {
  padding: var(--space-2);
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.modal__close:hover {
  background: var(--color-cream);
  color: var(--color-text-dark);
}

.modal__body {
  padding: var(--space-6);
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: var(--border-default);
}

/* ---------- Feedback Item ---------- */
.feedback-item {
  padding: var(--space-4);
  background: var(--color-cream);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.feedback-item:last-child {
  margin-bottom: 0;
}

.feedback-item__type {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-sage);
  margin-bottom: var(--space-2);
}

.feedback-item__text {
  font-size: var(--text-sm);
  color: var(--color-text-dark);
  line-height: var(--leading-relaxed);
}

.feedback-item__meta {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  text-decoration: none;
  border: none;
  line-height: 1;
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-deep-green);
  color: white;
  border-radius: var(--radius-full);
}

.btn--primary:hover {
  background: #164025;
  color: white;
  box-shadow: 0 4px 14px rgba(26, 77, 46, 0.25);
  transform: translateY(-1px);
}

.btn--secondary {
  background: transparent;
  color: var(--color-deep-green);
  border: 1px solid var(--color-deep-green);
  border-radius: var(--radius-full);
}

.btn--secondary:hover {
  background: rgba(26, 77, 46, 0.05);
  color: var(--color-deep-green);
}


.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: var(--border-default);
  border-radius: var(--radius-full);
}

.btn--ghost:hover {
  background: var(--color-cream);
  color: var(--color-text-dark);
}

.btn--sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

/* ---------- Filter Bar ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.filter-bar__group {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  border: var(--border-default);
  border-radius: var(--radius-md);
  padding: 2px;
  background: var(--surface-card);
}

.filter-bar__btn {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  border: none;
  background: none;
}

.filter-bar__btn:hover {
  color: var(--color-text-dark);
}

.filter-bar__btn--active {
  background: var(--color-deep-green);
  color: white;
}

.filter-bar__search {
  flex: 1;
  min-width: 200px;
  padding: var(--space-2) var(--space-3);
  border: var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--surface-card);
  transition: border-color var(--duration-fast) var(--ease-default);
}

.filter-bar__search:focus {
  outline: none;
  border-color: var(--color-sage);
  box-shadow: 0 0 0 3px rgba(92, 138, 110, 0.1);
}

@media (max-width: 639px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar__search {
    min-width: auto;
  }
}

/* ---------- Day Navigation ---------- */
.day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-top: var(--border-default);
  margin-top: var(--space-8);
}

.day-nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-default);
}

.day-nav__link:hover {
  border-color: var(--color-sage);
  color: var(--color-deep-green);
  background: var(--color-cream);
}

.day-nav__link--disabled {
  opacity: 0.3;
  pointer-events: none;
}

.day-nav__current {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
}

/* ---------- Rendered Markdown ---------- */
.rendered-md h1 {
  font-size: var(--text-2xl);
  margin: var(--space-6) 0 var(--space-4);
}

.rendered-md h2 {
  font-size: var(--text-xl);
  margin: var(--space-6) 0 var(--space-3);
}

.rendered-md h3 {
  font-size: var(--text-lg);
  margin: var(--space-4) 0 var(--space-3);
}

.rendered-md p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

.rendered-md ul,
.rendered-md ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.rendered-md ul {
  list-style: disc;
}

.rendered-md ol {
  list-style: decimal;
}

.rendered-md li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-relaxed);
}

.rendered-md blockquote {
  margin: var(--space-4) 0;
}

.rendered-md pre {
  margin: var(--space-4) 0;
}

.rendered-md a {
  color: var(--color-sage);
  text-decoration: underline;
  text-decoration-color: rgba(92, 138, 110, 0.3);
  text-underline-offset: 2px;
}

.rendered-md a:hover {
  color: var(--color-deep-green);
  text-decoration-color: var(--color-deep-green);
}

.rendered-md img {
  border-radius: var(--radius-md);
  margin: var(--space-4) 0;
}

/* ---------- Judge Card ---------- */
.judge-card {
  background: var(--surface-card);
  border: var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  transition: all var(--duration-normal) var(--ease-default);
}

.judge-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-light);
}

.judge-card__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
  line-height: 1;
}

.judge-card__name {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-deep-green);
  margin-bottom: var(--space-2);
}

.judge-card__role {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-accent-gold);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.judge-card__description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

.judge-card__model {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
  font-style: italic;
  opacity: 0.8;
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-4);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.empty-state__message {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  max-width: 40ch;
  margin: 0 auto;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: none;
  background: var(--color-deep-green);
  padding: var(--space-10) 0;
  margin-top: var(--space-12);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.site-footer__text {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.6);
}

.site-footer__link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.site-footer__link:hover {
  color: white;
}

.site-footer__meta {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.35);
  font-family: var(--font-mono);
}

@media (max-width: 639px) {
  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ---------- Test Results ---------- */
.test-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.test-result {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-card);
  border: var(--border-default);
  border-radius: var(--radius-md);
}

.test-result__icon {
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.test-result__name {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.test-result__duration {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  font-family: var(--font-mono);
}

/* ---------- Week Group ---------- */
.week-group {
  margin-bottom: var(--space-8);
}

.week-group__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-light);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: var(--border-default);
}

/* ---------- Pipeline (How It Works) ---------- */
.pipeline {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.pipeline__step {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  text-align: center;
  flex: 1;
  border: var(--border-default);
}

.pipeline__step-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: var(--space-3);
}

.pipeline__step-name {
  font-weight: var(--weight-bold);
  color: var(--color-text-dark);
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}

.pipeline__step-desc {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  margin: 0;
}

.pipeline__connector {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-gold);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  padding-top: var(--space-8);
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .pipeline {
    flex-direction: column;
    align-items: center;
  }

  .pipeline__step {
    width: 100%;
    max-width: 20rem;
  }

  .pipeline__connector {
    transform: rotate(90deg);
    padding-top: 0;
  }
}

/* ---------- Reviewer Breakdown (collapsible) ---------- */
.reviewer-breakdown__toggle {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-2) 0;
  list-style: none;
}

.reviewer-breakdown__toggle::-webkit-details-marker {
  display: none;
}

.reviewer-breakdown__toggle::before {
  content: '\25B6';
  display: inline-block;
  margin-right: var(--space-2);
  font-size: var(--text-xs);
  transition: transform 0.15s ease;
}

.reviewer-breakdown[open] > .reviewer-breakdown__toggle::before {
  transform: rotate(90deg);
}

.reviewer-breakdown__list {
  padding-top: var(--space-3);
}

.reviewer-card {
  border: var(--border-default);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  overflow: hidden;
}

.reviewer-card__header {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-card);
  list-style: none;
}

.reviewer-card__header::-webkit-details-marker {
  display: none;
}

.reviewer-card__identity {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.reviewer-card__icon {
  font-size: 1.2rem;
}

.reviewer-card__model {
  margin-left: var(--space-1);
}

.reviewer-card__body {
  padding: var(--space-4);
  border-top: var(--border-default);
}

/* ---------- Spec Collapsible (inline spec viewer) ---------- */
#spec-section .spec-collapsible {
  border: var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

#spec-section .spec-collapsible__toggle {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-3) var(--space-4);
  list-style: none;
}

#spec-section .spec-collapsible__toggle::-webkit-details-marker {
  display: none;
}

#spec-section .spec-collapsible__toggle::before {
  content: '\25B6';
  display: inline-block;
  margin-right: var(--space-2);
  font-size: var(--text-xs);
  transition: transform 0.15s ease;
}

#spec-section .spec-collapsible[open] > .spec-collapsible__toggle::before {
  transform: rotate(90deg);
}

#spec-section .spec-collapsible__content {
  padding: 0 var(--space-4) var(--space-4);
}

#spec-section .spec-collapsible__content .rendered-md {
  max-height: 80vh;
  overflow-y: auto;
}
