/* ============================================================
   CV Match — Page-specific styles
   ============================================================ */

/* ---------------- Boot / config error ----------------
   Màn tải theo nhịp nhận diện: biểu tượng lộ dần rồi tên CV Match xuất hiện.
   Không dùng spinner, progress bar, đường trục hay thông tin
   kỹ thuật có thể làm lộ cấu trúc ứng dụng. */

.boot {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--s-6);
  background: var(--c-surface-alt);
  overflow: hidden;
}
.boot__inner {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  text-align: center;
}

/* Khối logo của màn tải */
.boot__logo {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--s-5);
}
.boot__icon {
  display: block;
  width: auto;
  height: 68px;
  clip-path: inset(0 0 100% 0);
  animation: boot-reveal 560ms var(--ease-out) 160ms forwards;
}
.boot__name {
  display: block;
  color: var(--c-brand-navy);
  font: 600 24px/1.1 var(--font-sans);
  letter-spacing: -0.025em;
  opacity: 0;
  transform: translateY(6px);
  animation: boot-name-in 420ms var(--ease-out) 320ms forwards;
}
.boot__status {
  margin: var(--s-6) 0 0;
  font: var(--t-sm);
  color: var(--c-text-3);
  opacity: 0;
  animation: boot-fade 320ms var(--ease-out) 760ms forwards;
}

/* Wordmark tĩnh cho màn lỗi cấu hình và lỗi khởi động */
.boot__mark {
  display: block;
  width: auto;
  height: 38px;
  margin: 0 auto;
}

@keyframes boot-reveal {
  to {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes boot-fade {
  to {
    opacity: 1;
  }
}
@keyframes boot-name-in {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 480px) {
  .boot {
    padding: var(--s-5) var(--s-4);
  }
  .boot__icon {
    height: 58px;
  }
  .boot__name {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot__icon,
  .boot__name,
  .boot__status {
    animation: none;
    clip-path: none;
    opacity: 1;
    transform: none;
  }
}

/* ---------------- Auth ---------------- */

.authbrand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  position: relative;
  z-index: 1;
}
.authbrand__mark {
  display: block;
  width: auto;
  height: 34px;
}

.authpitch {
  position: relative;
  z-index: 1;
  max-width: 460px;
}
.authpitch h2 {
  font: 700 30px/1.24 var(--font-sans);
  letter-spacing: -0.02em;
  margin-bottom: var(--s-4);
  animation: shr-rise var(--d-slow) var(--ease-out) both;
}
.authpitch p {
  font: 400 15px/1.7 var(--font-sans);
  color: rgba(255, 255, 255, 0.78);
  animation: shr-rise var(--d-slow) var(--ease-out) 80ms both;
}
.authpoints {
  margin-top: var(--s-7);
  display: grid;
  gap: var(--s-4);
}
.authpoint {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  animation: shr-slide-left var(--d-slow) var(--ease-out) both;
}
.authpoint:nth-child(1) { animation-delay: 140ms; }
.authpoint:nth-child(2) { animation-delay: 210ms; }
.authpoint:nth-child(3) { animation-delay: 280ms; }
.authpoint__icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.authpoint__icon svg {
  width: 16px;
  height: 16px;
}
.authpoint strong {
  display: block;
  font: var(--t-body-strong);
  margin-bottom: 2px;
}
.authpoint span {
  font: var(--t-sm);
  color: rgba(255, 255, 255, 0.7);
}
.authfoot {
  position: relative;
  z-index: 1;
  font: var(--t-xs);
  color: rgba(255, 255, 255, 0.55);
}

.authcard__head {
  margin-bottom: var(--s-6);
}
.authcard__head h1 {
  margin-bottom: var(--s-2);
}
.authcard__head p {
  font: var(--t-sm);
  color: var(--c-text-2);
}
.authcard .card {
  padding: var(--s-6);
  box-shadow: var(--e-2);
  animation: shr-rise var(--d-slow) var(--ease-out) both;
}
.authswitch {
  margin-top: var(--s-5);
  text-align: center;
  font: var(--t-sm);
  color: var(--c-text-2);
}
.authdivider {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: var(--s-5) 0;
  font: var(--t-xs);
  color: var(--c-text-3);
}
.authdivider::before,
.authdivider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--c-border);
}
.authgoogle {
  position: relative;
}
.authgoogle__mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: conic-gradient(from -45deg, #4285f4 0 25%, #34a853 0 50%, #fbbc05 0 75%, #ea4335 0);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 0 0 2px #fff;
}

.pwmeter {
  display: flex;
  gap: 4px;
  margin-top: var(--s-2);
}
.pwmeter i {
  flex: 1 1 0;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--c-neutral-100);
  transition: background-color var(--d-base) var(--ease-standard);
}
.pwmeter[data-level="1"] i:nth-child(1) { background: var(--c-danger-600); }
.pwmeter[data-level="2"] i:nth-child(-n + 2) { background: var(--c-warn-600); }
.pwmeter[data-level="3"] i:nth-child(-n + 3) { background: var(--c-info-600); }
.pwmeter[data-level="4"] i { background: var(--c-success-600); }

/* ---------------- Workspace / dashboard ---------------- */

.settingshub__section + .settingshub__section {
  padding-top: var(--s-4);
  margin-top: var(--s-4);
  border-top: 1px solid var(--c-border-subtle);
}
.settingshub__heading,
.settingshub__row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.settingshub__heading {
  align-items: flex-start;
  margin-bottom: var(--s-3);
}
.settingshub__icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--r-control);
  background: var(--c-blue-050);
  color: var(--c-blue-600);
}
.settingshub__copy,
.settingshub__heading > div {
  min-width: 0;
  flex: 1 1 auto;
}
.settingshub h3 {
  font: var(--t-body-strong);
}
.settingshub p {
  color: var(--c-text-2);
  font: var(--t-xs);
}
.techdetails summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--c-text-2);
  font: var(--t-body-strong);
}
.techdetails__body {
  padding-top: var(--s-3);
  border-top: 1px solid var(--c-border-subtle);
}

.worklist {
  display: grid;
  gap: var(--s-2);
}
.workitem {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-control);
  background: var(--c-surface);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--d-fast) var(--ease-standard),
    background-color var(--d-fast) var(--ease-standard),
    transform var(--d-fast) var(--ease-out);
  animation: shr-rise-sm var(--d-base) var(--ease-out) both;
}
.workitem:hover {
  border-color: var(--c-blue-200);
  background: var(--c-blue-050);
  transform: translateX(3px);
  text-decoration: none;
  color: inherit;
}
.workitem__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--c-surface-sunken);
  color: var(--c-text-2);
}
.workitem__icon svg {
  width: 17px;
  height: 17px;
}
.workitem__body {
  flex: 1 1 auto;
  min-width: 0;
}
.workitem__title {
  font: var(--t-body-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workitem__meta {
  font: var(--t-xs);
  color: var(--c-text-3);
  font-weight: 400;
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: 2px;
}
.workitem__go {
  flex: 0 0 auto;
  color: var(--c-text-3);
  transition: transform var(--d-base) var(--ease-spring), color var(--d-fast);
}
.workitem:hover .workitem__go {
  transform: translateX(3px);
  color: var(--c-blue-600);
}

.attention {
  display: grid;
  gap: var(--s-2);
}
.attention__item {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-control);
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border-subtle);
  font: var(--t-sm);
  animation: shr-rise-sm var(--d-base) var(--ease-out) both;
}
.attention__dot {
  flex: 0 0 auto;
  margin-top: 6px;
  color: var(--c-warn-600);
}

/* ---------------- JD workspace ---------------- */

.sourcetoggle {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--r-control);
  background: var(--c-surface-sunken);
  border: 1px solid var(--c-border);
  gap: 3px;
}
.sourcetoggle button {
  border: 0;
  background: transparent;
  padding: 6px var(--s-4);
  border-radius: var(--r-sm);
  font: var(--t-xs);
  color: var(--c-text-2);
  cursor: pointer;
  transition: all var(--d-fast) var(--ease-standard);
}
.sourcetoggle button[aria-pressed="true"] {
  background: var(--c-surface);
  color: var(--c-navy-700);
  font-weight: 700;
  box-shadow: var(--e-1);
}

.jdpreview {
  font: var(--t-sm);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 460px;
  overflow-y: auto;
  padding: var(--s-4);
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-control);
}

.filterlist {
  display: grid;
  gap: var(--s-3);
}
.filterrow {
  display: grid;
  grid-template-columns: minmax(140px, 30%) minmax(0, 1fr) auto;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-control);
  background: var(--c-surface);
  animation: shr-rise-sm var(--d-base) var(--ease-out) both;
}
.filterrow__key {
  font: var(--t-body-strong);
  min-width: 0;
  word-break: break-word;
}
.filterrow__ai {
  font: var(--t-micro);
  color: var(--c-blue-600);
  display: block;
  font-weight: 600;
  margin-top: 2px;
}

/* ---------------- Upload ---------------- */

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--s-8) var(--s-5);
  border: 2px dashed var(--c-border-strong);
  border-radius: var(--r-lg);
  background: var(--c-surface-alt);
  transition: border-color var(--d-base) var(--ease-standard),
    background-color var(--d-base) var(--ease-standard),
    transform var(--d-base) var(--ease-out);
}
.dropzone:hover {
  border-color: var(--c-blue-400);
  background: var(--c-blue-050);
}
.dropzone.is-over {
  border-color: var(--c-blue-600);
  background: var(--c-blue-050);
  transform: scale(1.01);
  box-shadow: var(--e-focus-glow);
}
.dropzone__icon {
  width: 60px;
  height: 60px;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  background: var(--c-blue-050);
  color: var(--c-blue-600);
  margin-bottom: var(--s-4);
  transition: transform var(--d-base) var(--ease-spring);
}
.dropzone:hover .dropzone__icon,
.dropzone.is-over .dropzone__icon {
  transform: translateY(-4px) scale(1.06);
}
.dropzone__icon svg {
  width: 28px;
  height: 28px;
}
.dropzone__title {
  font: var(--t-h3);
  margin-bottom: var(--s-2);
}
.dropzone__hint {
  font: var(--t-sm);
  color: var(--c-text-2);
  margin-bottom: var(--s-5);
}
.dropzone__sources {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
  justify-content: center;
}

.filelist {
  display: grid;
  gap: var(--s-2);
}
.fileitem {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-control);
  background: var(--c-surface);
  animation: shr-rise-sm var(--d-base) var(--ease-out) both;
  transition: border-color var(--d-fast) var(--ease-standard);
}
.fileitem[data-status="ready"] {
  border-left: 3px solid var(--c-success-600);
}
.fileitem[data-status="error"] {
  border-left: 3px solid var(--c-danger-600);
  background: var(--c-danger-050);
}
.fileitem[data-status="pending"],
.fileitem[data-status="extracting"] {
  border-left: 3px solid var(--c-blue-500);
}
.fileitem__icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--c-surface-sunken);
  color: var(--c-text-2);
}
.fileitem__icon svg {
  width: 16px;
  height: 16px;
}
.fileitem__body {
  flex: 1 1 auto;
  min-width: 0;
}
.fileitem__name {
  font: var(--t-body-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fileitem__meta {
  font: var(--t-xs);
  color: var(--c-text-3);
  font-weight: 400;
  margin-top: 2px;
  display: flex;
  gap: var(--s-2);
  align-items: center;
  flex-wrap: wrap;
}
.fileitem__actions {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
}

.counter {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
}
.counter strong {
  color: var(--c-text);
  font-size: 14px;
}

/* ---------------- Weights ---------------- */

.weightrow {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--c-border-subtle);
  animation: shr-rise-sm var(--d-base) var(--ease-out) both;
}
.weightrow:last-child {
  border-bottom: 0;
}
.weightrow__top {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.weightrow__name {
  flex: 1 1 auto;
  min-width: 0;
  font: var(--t-body-strong);
}
.weightrow__desc {
  font: var(--t-xs);
  color: var(--c-text-3);
  font-weight: 400;
  margin-top: 2px;
}
.weightrow__num {
  flex: 0 0 auto;
  width: 78px;
}
.weightrow__num .input {
  text-align: right;
  font-variant-numeric: tabular-nums;
  height: 34px;
  padding-block: 0;
}
.weightrow__children {
  margin-top: var(--s-2);
  padding-left: var(--s-5);
  border-left: 2px solid var(--c-border-subtle);
  display: grid;
  gap: var(--s-2);
}
.weightchild {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font: var(--t-sm);
  color: var(--c-text-2);
}
.weightchild__w {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--c-text);
}

.totalbar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  border-radius: 0 0 var(--r-surface) var(--r-surface);
  flex-wrap: wrap;
}
.totalbar__value {
  font: 700 22px/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  transition: color var(--d-base) var(--ease-standard);
}
.totalbar[data-valid="false"] .totalbar__value {
  color: var(--c-danger-600);
  animation: shr-shake var(--d-slow) var(--ease-standard);
}
.totalbar[data-valid="true"] .totalbar__value {
  color: var(--c-success-600);
}

/* ---------------- Analysis job ---------------- */

.jobhero {
  position: relative;
  overflow: hidden;
  padding: var(--s-7) var(--s-6);
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, var(--c-navy-900), var(--c-navy-700) 60%, var(--c-blue-600));
  color: #fff;
  box-shadow: var(--e-3);
}
.jobhero::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -110px;
  top: -140px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.12), transparent 64%);
  pointer-events: none;
}
.jobhero__state {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font: var(--t-micro);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  margin-bottom: var(--s-4);
}
.jobhero__pct {
  font: 700 44px/1 var(--font-sans);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--s-2);
}
.jobhero__msg {
  font: var(--t-body);
  color: rgba(255, 255, 255, 0.8);
  max-width: 62ch;
}
.jobhero .progress {
  background: rgba(255, 255, 255, 0.18);
  margin-top: var(--s-5);
}
.jobhero .progress__bar {
  background: #fff;
}
.jobhero__meta {
  display: flex;
  gap: var(--s-6);
  flex-wrap: wrap;
  margin-top: var(--s-5);
  font: var(--t-xs);
  color: rgba(255, 255, 255, 0.62);
}
.jobhero__meta b {
  display: block;
  color: #fff;
  font: var(--t-body-strong);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.jobhero[data-state="failed"] {
  background: linear-gradient(150deg, #6d1b1e, var(--c-danger-700) 60%, #c04b4f);
}
.jobhero[data-state="completed"] {
  background: linear-gradient(150deg, #0c4c39, var(--c-success-700) 58%, #2a9e75);
}

/* Chỉ báo job đang chạy trên topbar */
.jobpill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 32px;
  padding: 0 var(--s-3);
  border-radius: var(--r-pill);
  background: var(--c-blue-050);
  border: 1px solid var(--c-blue-200);
  color: var(--c-navy-700);
  font: var(--t-xs);
  text-decoration: none;
  animation: shr-pop var(--d-base) var(--ease-spring) both;
}
.jobpill:hover {
  background: var(--c-blue-100);
  text-decoration: none;
  color: var(--c-navy-700);
}

/* ---------------- Results / ranking ---------------- */

.verdictcell {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 0;
}
.verdictcell__body {
  min-width: 0;
}
.verdictcell__name {
  font: var(--t-body-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.verdictcell__sub {
  font: var(--t-xs);
  color: var(--c-text-3);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidencecell {
  max-width: 320px;
  font: var(--t-sm);
  color: var(--c-text-2);
}

.summarystrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--r-surface);
  overflow: hidden;
  background: var(--c-surface);
}
.summarystrip__cell {
  padding: var(--s-4) var(--s-5);
  border-right: 1px solid var(--c-border-subtle);
  animation: shr-rise-sm var(--d-base) var(--ease-out) both;
}
.summarystrip__cell:last-child {
  border-right: 0;
}
.summarystrip__label {
  font: var(--t-micro);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-text-3);
  margin-bottom: var(--s-2);
}
.summarystrip__value {
  font: 700 22px/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
}

/* ---------------- Candidate detail ---------------- */

.chatthread {
  display: grid;
  align-content: start;
  gap: var(--s-4);
  min-height: 180px;
  max-height: 56vh;
  overflow-y: auto;
  padding-right: 4px;
}

.criteriarow {
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-control);
  background: var(--c-surface);
  overflow: hidden;
  animation: shr-rise-sm var(--d-base) var(--ease-out) both;
  transition: border-color var(--d-fast) var(--ease-standard),
    box-shadow var(--d-fast) var(--ease-standard);
}
.criteriarow + .criteriarow {
  margin-top: var(--s-2);
}
.criteriarow:hover {
  border-color: var(--c-blue-200);
}
.criteriarow[aria-expanded="true"] {
  border-color: var(--c-blue-200);
  box-shadow: var(--e-1);
}
.criteriarow__head {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  padding: var(--s-4);
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.criteriarow__head:hover {
  background: var(--c-blue-050);
}
.criteriarow__name {
  flex: 1 1 auto;
  min-width: 0;
  font: var(--t-body-strong);
}
.criteriarow__chev {
  flex: 0 0 auto;
  color: var(--c-text-3);
  transition: transform var(--d-base) var(--ease-spring);
}
.criteriarow[aria-expanded="true"] .criteriarow__chev {
  transform: rotate(180deg);
}
.criteriarow__panel {
  padding: 0 var(--s-4) var(--s-4);
  border-top: 1px solid var(--c-border-subtle);
  animation: shr-rise-sm var(--d-base) var(--ease-out) both;
}
.criteriarow__panel > * + * {
  margin-top: var(--s-4);
}

.evidence {
  padding: var(--s-3) var(--s-4);
  border-left: 3px solid var(--c-blue-400);
  background: var(--c-blue-050);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font: var(--t-sm);
  line-height: 1.7;
  color: var(--c-text);
}
.evidence--weak {
  border-left-color: var(--c-warn-600);
  background: var(--c-warn-050);
}
.evidence--missing {
  border-left-color: var(--c-border-strong);
  background: var(--c-surface-sunken);
  color: var(--c-text-2);
  font-style: italic;
}

.deduction {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-2) 0;
  border-bottom: 1px dashed var(--c-border-subtle);
  font: var(--t-sm);
}
.deduction:last-child {
  border-bottom: 0;
}
.deduction__pts {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--c-danger-700);
  white-space: nowrap;
}

.candhero {
  display: flex;
  align-items: flex-start;
  gap: var(--s-5);
  flex-wrap: wrap;
  padding: var(--s-6);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--e-1);
}
.candhero__score {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  position: relative;
}
.candhero__score svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
  width: 108px;
  height: 108px;
}
.candhero__score circle {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
}
.candhero__score .ring-bg {
  stroke: var(--c-neutral-100);
}
.candhero__score .ring-fg {
  stroke: var(--c-blue-600);
  transition: stroke-dashoffset var(--d-slower) var(--ease-out);
}
.candhero__score[data-grade="A"] .ring-fg { stroke: var(--c-grade-a); }
.candhero__score[data-grade="B"] .ring-fg { stroke: var(--c-grade-b); }
.candhero__score[data-grade="C"] .ring-fg { stroke: var(--c-grade-c); }
.candhero__num {
  position: relative;
  font: 700 30px/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
}
.candhero__num small {
  display: block;
  font: var(--t-micro);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-text-3);
  margin-top: 4px;
}
.candhero__body {
  flex: 1 1 300px;
  min-width: 0;
}

/* ---------------- History ---------------- */

.histitem {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-4);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-control);
  background: var(--c-surface);
  text-decoration: none;
  color: inherit;
  animation: shr-rise-sm var(--d-base) var(--ease-out) both;
  transition: border-color var(--d-fast) var(--ease-standard),
    box-shadow var(--d-fast) var(--ease-standard),
    transform var(--d-fast) var(--ease-out);
}
.histitem:hover {
  border-color: var(--c-blue-200);
  box-shadow: var(--e-2);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.histitem__date {
  flex: 0 0 auto;
  width: 62px;
  text-align: center;
  padding-top: 2px;
}
.histitem__day {
  font: 700 20px/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
}
.histitem__mon {
  font: var(--t-micro);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-text-3);
  margin-top: 3px;
}
.histitem__body {
  flex: 1 1 auto;
  min-width: 0;
}

/* ---------------- Route gap / unavailable ---------------- */

.gapcard {
  border: 1px dashed var(--c-border-strong);
  border-radius: var(--r-lg);
  background: var(--c-surface-alt);
  padding: var(--s-8) var(--s-6);
}
.gaplist {
  display: grid;
  gap: var(--s-2);
  text-align: left;
  max-width: 560px;
  margin: 0 auto;
}
.gaplist li {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  font: var(--t-sm);
  color: var(--c-text-2);
  padding: var(--s-2) var(--s-3);
  background: var(--c-surface);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-sm);
}
.gaplist code {
  color: var(--c-navy-700);
  background: var(--c-blue-050);
  padding: 1px 5px;
  border-radius: var(--r-xs);
  font-size: 12px;
}
