/* Dingzhen VIS V1.1 — layout and interaction refinements. */

/* Official wordmark: 36 px screen height with at least 0.3X clear space. */
.topbar {
  height: 72px;
  border-top: 0;
  background: #ffffff;
}
.brand {
  gap: 16px;
  padding: 11px 0;
}
.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: auto;
  height: 36px;
  max-width: none;
}
.brand-fallback {
  display: flex;
  align-items: center;
  min-height: 36px;
  color: var(--brand-deep);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .04em;
}
.brand-product {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  line-height: 1.35;
}
.brand-product strong {
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
}
.brand-product small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
}
.topbar nav {
  gap: 18px;
}
.user-menu {
  position: relative;
}
.user-menu > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  list-style: none;
  user-select: none;
}
.user-menu > summary::-webkit-details-marker {
  display: none;
}
.user-menu > summary::after {
  content: "▾";
  color: var(--brand-deep);
  font-size: 12px;
}
.user-menu > summary:hover,
.user-menu[open] > summary {
  border-color: var(--line);
  background: #f5f8f5;
  color: var(--brand-deep);
}
.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 240px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(32, 43, 37, .12);
}
.user-menu-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.user-menu-identity strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}
.user-menu .role-badge {
  display: inline-flex;
  flex: 0 0 auto;
}
.user-menu-panel form {
  margin: 10px 0 0;
}
.user-menu-panel .link-button {
  width: 100%;
  min-height: 36px;
  color: var(--muted);
  text-align: left;
}
.user-menu-panel .link-button:hover {
  color: var(--brand-deep);
}

/* Compact, consistent working area. */
.page-shell {
  padding-top: 24px;
}
.page-heading {
  margin-bottom: 18px;
}
.page-heading h1 {
  font-size: 30px;
}
.back {
  margin-bottom: 12px;
}
.eyebrow {
  margin-bottom: 4px;
}
.lead {
  margin-top: 6px;
}
.panel {
  margin-bottom: 16px;
  padding: 20px;
}
.section-heading {
  margin-bottom: 16px;
}
.button.primary,
.button.primary:hover {
  border-color: var(--brand-deep);
  background: var(--brand-deep);
  color: #ffffff;
}
.button.primary:hover {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(46, 151, 113, .15);
}
.reference-radar-candidate {
  fill: rgba(46, 151, 113, .16);
}

/* Candidate upload becomes an on-demand panel; the list keeps full width. */
.upload-resume-panel {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}
.upload-resume-panel > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}
.upload-resume-panel > summary::-webkit-details-marker {
  display: none;
}
.upload-resume-summary {
  flex: 0 0 auto;
}
.upload-resume-summary-note {
  color: var(--muted);
  font-size: 12px;
}
.upload-resume-panel[open] > summary {
  border-bottom: 1px solid var(--line);
}
.upload-resume-body {
  padding: 2px 16px 16px;
}
.upload-resume-body h2 {
  margin-top: 12px;
  font-size: 18px;
}
.upload-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}
.upload-resume-text {
  grid-column: 1 / -1;
}
.upload-resume-text textarea {
  min-height: 104px;
}
.upload-resume-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}
.upload-resume-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.upload-resume-footer .button {
  flex: 0 0 auto;
}
.candidate-filters {
  margin-bottom: 12px;
  padding: 10px;
}
.decision-save[hidden] {
  display: none !important;
}

/* Bring the interview questions forward. */
.guide-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.guide-version-toolbar {
  align-items: center;
  margin: 12px 0;
}
.guide-version-option {
  min-width: 104px;
  padding: 7px 10px;
}
.guide-version-option.active {
  border-color: var(--brand);
  background: var(--sprout);
  color: var(--brand-deep);
}
.guide-focus-disclosure {
  margin: 0 0 12px;
  padding: 0;
  overflow: hidden;
}
.guide-focus-disclosure > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  color: #674b38;
}
.guide-focus-disclosure > summary > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guide-focus-disclosure > p {
  margin: 0;
  padding: 0 14px 12px;
}
.guide-content-heading {
  margin-top: 12px;
  margin-bottom: 12px;
}
.guide-card {
  padding: 14px 16px;
}

/* Reports: neutral reading surface with progressive disclosure. */
.report-technical {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
}
.report-technical > summary {
  cursor: pointer;
  color: var(--muted);
}
.report-technical > p {
  margin: 8px 0 0;
}
.report-lead {
  margin: 16px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  background: #ffffff;
}
.report-lead > p:not(.step-label) {
  color: var(--ink);
  font-size: 16px;
}
.response-quality {
  background: #fbfdfc;
}
.score-domain-card,
.ams-score-card,
.reference-comparison {
  box-shadow: none;
}
.facet-domain > summary {
  background: #f2f7f3;
}
.report-version {
  border-top: 1px solid var(--line);
}
.report-version-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 4px;
  cursor: pointer;
  list-style: none;
}
.report-version-summary::-webkit-details-marker {
  display: none;
}
.report-version-summary > span:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.report-version-summary strong {
  font-size: 16px;
}
.report-version-summary small {
  color: var(--muted);
}
.report-version .builtin-report {
  margin-top: 0;
  padding-top: 12px;
  border-top: 0;
}
.report-version .report-findings {
  margin-top: 14px;
}

/* Offer keeps its safety flow with a tighter editing surface. */
.offer-form {
  gap: 10px;
}
.offer-form .panel {
  margin-bottom: 0;
  padding: 14px 18px;
}
.offer-form label {
  margin-top: 9px;
}
.offer-form-actions {
  margin-top: 2px;
  margin-bottom: 0;
}
.offer-document-header {
  text-align: left;
}
.offer-document-header h1 {
  text-align: center;
}

/* Print-only official wordmark, never below the VIS 11 mm minimum. */
.print-brand-row,
.report-print-brand {
  display: none;
}

@media (max-width: 800px) {
  .guide-panel-actions {
    justify-content: flex-start;
  }
  .upload-resume-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .topbar {
    height: 64px;
    padding: 0 14px;
  }
  .brand {
    gap: 12px;
    padding: 10px 0;
  }
  .brand-logo {
    height: 32px;
  }
  .brand-product,
  .topbar nav > .jobs-nav,
  .user-menu > summary .user-name {
    display: none;
  }
  .user-menu > summary {
    min-height: 44px;
    padding: 8px;
  }
  .user-menu-panel {
    position: fixed;
    top: 60px;
    right: 14px;
    width: min(280px, calc(100vw - 28px));
  }
  .page-shell {
    padding-top: 18px;
  }
  .page-heading h1 {
    font-size: 26px;
  }
  .panel {
    padding: 17px;
  }
  .upload-resume-panel > summary {
    justify-content: center;
    flex-direction: column;
    gap: 6px;
  }
  .upload-resume-summary {
    width: 100%;
  }
  .upload-resume-summary-note {
    text-align: center;
  }
  .upload-fields {
    grid-template-columns: 1fr;
  }
  .upload-resume-text {
    grid-column: auto;
  }
  .upload-resume-footer,
  .upload-resume-footer .button {
    width: 100%;
  }
  .guide-top-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .guide-top-heading .guide-panel-actions {
    width: 100%;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
  }
  .guide-top-heading [data-print-guide] {
    white-space: nowrap;
  }
  .guide-panel-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .guide-focus-disclosure > summary {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .guide-focus-disclosure > summary > span {
    white-space: normal;
  }
  .guide-version-option {
    min-width: 100px;
  }
  .report-version-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .offer-form-actions {
    bottom: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .user-menu > summary,
  .upload-resume-panel,
  .guide-version-option {
    transition: none;
  }
}

@media print {
  .print-brand-row {
    display: block;
    flex: 0 0 auto;
    margin-bottom: 3mm;
  }
  .print-brand-logo {
    display: block;
    width: auto;
    height: 11mm;
  }
  .report-print-brand {
    display: block;
    margin: 0 0 5mm;
    padding-bottom: 3mm;
    border-bottom: 1px solid var(--line);
  }
  .report-print-brand img {
    display: block;
    width: auto;
    height: 11mm;
  }
  .report-technical {
    break-inside: avoid;
  }
  .report-version {
    break-inside: auto;
  }
  .report-version > summary,
  .report-version.print-history-version {
    display: none !important;
  }
  .report-version .report-limitations {
    margin-top: 12px;
  }
  .report-version .ai-boundary {
    margin: 8px 0 0;
  }
}
