.shell-test,
.shell-registry,
.shell-guide {
  padding-top: 12px;
}

body[data-page="test"],
body[data-page="guide"] {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

body[data-page="test"] .shell-test,
body[data-page="guide"] .shell-guide {
  flex: 1;
  display: flex;
  flex-direction: column;
}

body[data-page="test"]:has([data-consult]:not([hidden])) .shell-test,
body[data-page="guide"]:has([data-consult]:not([hidden])) .shell-guide {
  padding-bottom: 0;
}

body[data-page="test"] .chrome {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
}

body[data-page="test"] .chrome .top {
  position: static;
  background: transparent;
}

.progress-count {
  justify-self: center;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.progress-count[hidden] { display: none; }

.progress-count b {
  color: var(--fg);
  font-weight: 500;
}

.progress-count::before { content: "[ "; }
.progress-count::after { content: " ]"; }

.progress-track,
.match-bar {
  width: min(100%, var(--page));
  margin: 0 auto;
  height: 1px;
  position: relative;
  background: transparent;
}

.progress-track[hidden] { display: none; }

.progress-track::before,
.match-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--line);
  opacity: 0.2;
}

.match-bar { width: auto; margin: 0; flex: 1; }

.progress-fill,
.match-bar .bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  background: var(--fill);
  transform-origin: left center;
  transition: transform 0.4s ease;
}

.pct-0 { transform: scaleX(0); }
.pct-5 { transform: scaleX(0.05); }
.pct-10 { transform: scaleX(0.1); }
.pct-15 { transform: scaleX(0.15); }
.pct-20 { transform: scaleX(0.2); }
.pct-25 { transform: scaleX(0.25); }
.pct-30 { transform: scaleX(0.3); }
.pct-35 { transform: scaleX(0.35); }
.pct-40 { transform: scaleX(0.4); }
.pct-45 { transform: scaleX(0.45); }
.pct-50 { transform: scaleX(0.5); }
.pct-55 { transform: scaleX(0.55); }
.pct-60 { transform: scaleX(0.6); }
.pct-65 { transform: scaleX(0.65); }
.pct-70 { transform: scaleX(0.7); }
.pct-75 { transform: scaleX(0.75); }
.pct-80 { transform: scaleX(0.8); }
.pct-85 { transform: scaleX(0.85); }
.pct-90 { transform: scaleX(0.9); }
.pct-95 { transform: scaleX(0.95); }
.pct-100 { transform: scaleX(1); }

.kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kicker.bracket::before { content: "[ "; }
.kicker.bracket::after { content: " ]"; }

.page-hero h1 {
  text-align: left;
  font-size: 26px;
}

.page-lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.q-title {
  margin: 24px 0 18px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-align: left;
}

.q-hint {
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.opts {
  display: grid;
  gap: 10px;
}

.opt {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.opt-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.opt:hover { opacity: 0.92; }

.opt.is-on {
  background: var(--fill);
  color: var(--on-fill);
}

.opt.is-on .opt-sub { color: inherit; opacity: 0.72; }

.opt-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.opt-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.opt-mark {
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.opt.is-on .opt-mark::after {
  content: "";
  width: 8px;
  height: 8px;
  background: currentColor;
}

.nav-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 24px;
}

.nav-row .btn:only-child,
.nav-row .btn[data-full] {
  grid-column: 1 / -1;
}

.step[hidden] { display: none; }

.result[hidden] { display: none; }

.result.screen-enter {
  animation: ds-rise 0.32s ease both;
}

@keyframes ds-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.track-pill {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result h1 {
  text-align: left;
  font-size: 28px;
  margin: 14px 0 0;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.cursor {
  display: inline-block;
  width: 10px;
  height: 24px;
  background: var(--fg);
  animation: ds-blink 1.1s step-end infinite;
  transform: translateY(2px);
  flex-shrink: 0;
}

@keyframes ds-blink { 50% { opacity: 0; } }

.match-row {
  margin: 16px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-bar {
  height: 1px;
  background: transparent;
  position: relative;
}

.match-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.grade-line {
  margin: 10px 0 0;
  font-size: 16px;
}

.salary-box {
  margin: 32px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
}

.salary-box .label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.salary-box .sum {
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.salary-box .sum small {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}

.salary-box .sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.salary-box .duty {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.pay-line {
  font-family: var(--font-mono);
  font-size: 13px;
}

.block { margin: 32px 0 0; }

.block h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
}

.block p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.block p + p,
.block p + ul,
.block ul + p {
  margin-top: 10px;
}

.block ul:not(.alt-list):not(.sources) {
  margin: 0;
  padding-left: 1.15em;
  display: grid;
  gap: 6px;
}

.block ul:not(.alt-list):not(.sources) li {
  font-size: 15px;
  line-height: 1.5;
}

.alt-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.alt-list li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.alt-list a,
.alt-list .alt-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
}

.alt-list a:hover {
  background: var(--fill);
  color: var(--on-fill);
}

.alt-list strong,
.alt-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.alt-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.alt-list a:hover span { color: inherit; opacity: 0.72; }

.sources {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sources li {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sources a {
  color: var(--fg);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.sources .src-note {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.fine {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: grid;
  gap: 10px;
  margin: 22px 0 18px;
}

.search {
  width: 100%;
  min-height: 48px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
}

.filter.is-on {
  background: var(--fill);
  color: var(--on-fill);
}

.count {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.prof-list {
  display: grid;
  gap: 10px;
}

.prof-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
}

.prof-card:hover {
  background: var(--fill);
  color: var(--on-fill);
}

.prof-card:hover .muted { color: inherit; opacity: 0.72; }

.prof-card .muted {
  color: var(--muted);
  font-size: 13px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.detail[hidden] { display: none; }

.grade-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.grade-table th,
.grade-table td {
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.grade-table th { font-weight: 500; }

.grade-table tr:last-child td { border-bottom: 0; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
}

.tag {
  padding: 3px 8px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-family: var(--font-mono);
}

.empty {
  margin: 24px 0;
  color: var(--muted);
}

.cta-row {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.cta-consult { margin-top: 16px; }

.consult {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 48px calc(-1 * var(--gutter)) 0;
  padding: 0;
  border: 0;
  scroll-margin-top: 72px;
  background: var(--fill);
  color: var(--on-fill);
  box-shadow: 0 0 0 100vmax var(--fill);
  clip-path: inset(0 -100vmax -100vmax -100vmax);
}

.consult[hidden] { display: none; }

.consult-panel {
  flex: 1;
  padding: 32px var(--gutter) 72px;
  background: transparent;
  color: inherit;
}

.consult-panel .kicker {
  color: inherit;
  opacity: 0.72;
  margin: 0 0 14px;
}

.consult h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.25;
  text-align: left;
}

.consult-lead {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
}

.consult-format {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.5;
}

.consult-fine {
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.45;
  color: inherit;
  opacity: 0.65;
}

.consult [data-form-panel] { margin-top: 0; }

.consult-panel .form label {
  color: inherit;
}

.consult-panel .form input:not(.hp) {
  color: inherit;
  border-bottom-color: currentColor;
}

.consult-panel .form input::placeholder {
  color: inherit;
  opacity: 0.45;
}

.consult-panel .toggle {
  color: inherit;
  border-color: currentColor;
}

.consult-panel .toggle.is-on {
  background: var(--on-fill);
  color: var(--fill);
}

.consult-panel .btn[data-submit] {
  background: var(--on-fill);
  color: var(--fill);
  border-color: var(--on-fill);
}

.consult-panel .btn[data-submit]:hover { opacity: 0.88; }

.consult-panel input:focus-visible,
.consult-panel button:focus-visible {
  box-shadow: 0 0 0 2px var(--fill), 0 0 0 4px var(--on-fill);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle {
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.toggle.is-on {
  background: var(--fill);
  color: var(--on-fill);
}

.consult .form { margin: 0; }

.consult-done {
  text-align: left;
  margin: 0;
}

.consult-panel .done p {
  margin: 0;
  color: inherit;
}

.icon-btn[data-reg-back]:not([hidden]) ~ a[data-home-icon] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; opacity: 0; }
  .result.screen-enter { animation: none; }
  .progress-fill,
  .match-bar .bar-fill { transition: none; }
}
