/* Shared header assets use the motions static route on all three app servers. */
:root {
  --brand-red: #ef4050;
  --action-blue: #20486d;
  --action-gradient:
    radial-gradient(ellipse at 70% 0%, #8ec9ff29, transparent 65%),
    linear-gradient(112deg, #20486d 0%, #2d5b80 55%, #204466 100%);
  --action-hover-gradient:
    radial-gradient(ellipse at 70% 0%, #8ec9ff38, transparent 65%),
    linear-gradient(112deg, #285479 0%, #35678d 55%, #285072 100%);
  --action-border: #315777;
  --action-shadow: inset 0 1px 0 #ffffff30, 0 3px 7px #20486d24;
}
header.ssra-header {
  height: auto;
  min-height: 82px;
  padding: 9px 32px;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--action-gradient);
  color: #f4f7fb;
  border-bottom: 1px solid #6286a7;
  box-shadow: inset 0 1px 0 #ffffff24, 0 3px 12px #143a5b1f;
}
.ssra-header .brand-group {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}
.ssra-header .hpc-lockup {
  display: flex;
  align-items: center;
  width: 250px;
  height: 64px;
  flex-shrink: 0;
}
.ssra-header .hpc-symbol {
  display: block;
  width: 77px;
  height: 64px;
  flex-shrink: 0;
  /* Show the original symbol only; the lettering is rendered as live text. */
  background: url('/motions/assets/hpc-logo.png') left top / auto 64px no-repeat;
  filter: brightness(0) invert(1);
  clip-path: inset(0 0 2px 0);
}
.ssra-header .hpc-wordmark {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 5px;
  white-space: nowrap;
  font-family: 'Segoe UI', Arial, sans-serif;
}
.ssra-header .hpc-wordmark strong {
  color: var(--brand-red);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0;
}
.ssra-header .hpc-wordmark > span {
  /* Keep natural word spacing and center the subtitle beneath the title. */
  text-align: center;
  padding-top: 3px;
  border-top: 1px solid #b6c5d7;
  color: #e2e9f2;
  font-size: 10.5px;
  line-height: 1.1;
}
.ssra-header .brand-divider {
  width: 1px;
  height: 38px;
  background: #ffffff38;
  flex-shrink: 0;
}
.ssra-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-red);
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: nowrap;
}
.ssra-header .brand .ssra-app-icon {
  display: block;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}
.ssra-header .brand small,
.ssra-header .brand span {
  color: #d0dfed;
}
.ssra-header .badge {
  color: #eff6fd;
  border-color: #ffffff40;
  background: linear-gradient(180deg, #ffffff14, #ffffff06);
  box-shadow: inset 0 1px 0 #ffffff12;
  flex-shrink: 0;
}
@media (max-width: 1100px) {
  .ssra-header .brand small,
  .ssra-header .brand span { display: none; }
}
@media (max-width: 600px) {
  header.ssra-header { padding: 12px 16px; gap: 12px; }
  .ssra-header .brand-group { gap: 16px; }
  .ssra-header .hpc-lockup { width: 217px; height: 54px; }
  .ssra-header .hpc-symbol { width: 65px; height: 54px; background-size: auto 54px; }
  .ssra-header .hpc-wordmark strong { font-size: 21px; }
  .ssra-header .hpc-wordmark > span { font-size: 9.5px; }
  .ssra-header .brand { font-size: 20px; }
  .ssra-header .brand .ssra-app-icon { width: 38px; height: 38px; }
  .ssra-header .brand-divider { height: 30px; }
  .ssra-header .badge { font-size: 11px; padding: 5px 9px; }
}

/* One navigation row for every workspace section. */
nav.workflow-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  max-width: none;
  padding: 0 0 1px;
  margin: 0 0 28px;
  overflow-x: auto;
  border-bottom: 1px solid #d5e0eb;
  scrollbar-width: thin;
}
.workflow-nav .workflow-step {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 12px 20px;
  border-bottom: 3px solid transparent;
  border-radius: 7px 7px 0 0;
  color: #52677c;
  text-decoration: none;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  transition: background-color .15s, color .15s;
}
.workflow-nav .workflow-step:last-child { margin-left: auto; }
.workflow-nav a:hover { background: #eaf0f6; color: #20486d; }
.workflow-nav a:focus-visible { outline: 3px solid #77a9dd; outline-offset: -3px; }
.workflow-nav [aria-current="page"] {
  border-bottom-color: #2d628b;
  background: #e7eff6;
  color: #20486d;
}

/* One action style across Hazard, Ground Motions, Site Response, and Results. */
main button.primary,
main a.results-button {
  background: var(--action-gradient);
  border: 1px solid var(--action-border);
  border-radius: 8px;
  box-shadow: var(--action-shadow);
  color: #fff;
  font: inherit;
  font-weight: 650;
  line-height: 1.35;
  padding: 12px 18px;
  text-decoration: none;
  transition: background .15s, box-shadow .15s;
}
main button.primary:hover:not(:disabled),
main a.results-button:hover {
  background: var(--action-hover-gradient);
  border-color: #3b6485;
  box-shadow: inset 0 1px 0 #ffffff38, 0 4px 10px #20486d38;
  color: #fff;
}
main button.primary:active:not(:disabled),
main a.results-button:active {
  background: var(--action-blue);
  box-shadow: inset 0 2px 4px #12375338;
}
main button.primary:focus-visible,
main a.results-button:focus-visible {
  outline: 3px solid #80b6df;
  outline-offset: 3px;
}
main button.primary:disabled {
  background: #e3eaf1;
  border-color: #cfd9e3;
  color: #687b8d;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}
main .result-tabs button[aria-selected="true"] {
  background: var(--action-gradient);
  box-shadow: var(--action-shadow);
  color: #fff;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--action-blue); }
@media (max-width: 700px) {
  nav.workflow-nav { gap: 2px; margin-bottom: 22px; }
  .workflow-nav .workflow-step { padding: 12px 14px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .workflow-nav .workflow-step,
  main button.primary,
  main a.results-button { transition: none; }
}

/* Shared workspace rhythm and readable supporting information. */
main { padding-bottom: 56px; }
nav.project-bar { margin-bottom: 0; }
.project-status:empty { display: none; }
main .card { border-color: #dfe6ee; border-radius: 12px; box-shadow: 0 3px 12px #203b5510; margin-bottom: 24px; }
main h1 { font-size: clamp(23px, 2.2vw, 28px); letter-spacing: -.5px; }
main h2 { line-height: 1.4; }
main p { max-width: 100ch; }
main .warning ul { margin: 0; padding-left: 18px; }
main .warning li + li { margin-top: 6px; }
main button { border-radius: 8px; transition: background-color .15s, border-color .15s; }
main button:disabled { cursor: not-allowed; }
main .study-tabs button[aria-selected="true"] { background: var(--action-gradient)!important; color: #fff!important; border-color: var(--action-border); box-shadow: var(--action-shadow); }
main .study-tabs button[aria-selected="false"] { color: #425e77; }
main .study-tabs { gap: 8px; }
main :is(.study-tabs,.result-tabs) { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
main :is(.study-tabs,.result-tabs) button { flex: 0 0 auto; white-space: nowrap; }
main :is(#cancel,#cancel-motion,#cancel-batch,#cancel-study):not(:disabled) { color: #a1283b; border-color: #d9a5ae; background: #fff; }
main .table-scroll { border: 1px solid #e3eaf1; border-radius: 8px; }
main td { font-variant-numeric: tabular-nums; }
main tbody tr:hover { background: #f6f9fc; }
main details > summary { font-weight: 600; line-height: 1.5; margin-bottom: 0; }
main details[open] > summary { margin-bottom: 14px; }
main details.explanation { background: #f6f9fc; border: 1px solid #e3eaf1; border-radius: 8px; padding: 12px 16px; margin: 16px 0; font-size: 13px; }
main details.explanation p:last-child { margin-bottom: 0; }
.section-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 22px; }
.section-jumps a { padding: 9px 14px; border: 1px solid #d6e1ec; border-radius: 8px; color: #365b7b; background: #fff; text-decoration: none; font-size: 13px; font-weight: 600; }
.section-jumps a:last-child { background: #e7eff6; border-color: #b9cddd; }
section[id], details[id] { scroll-margin-top: 20px; }
.study-setup > summary { font-size: 16px; }
.study-setup[open] > summary { margin-bottom: 24px; }
.study-setup > .card { box-shadow: none; border: 0; border-radius: 0; padding: 0; margin-bottom: 0; }
.study-setup > .card + .card { border-top: 1px solid #e3eaf1; margin-top: 24px; padding-top: 24px; }
main :is(.plot,.study-plot,.interactive-chart) { min-width: 0; margin-top: 20px; margin-bottom: 28px; }
main .plot { height: 580px; }
#spectra .plot { height: 620px; min-height: 620px; }
#surface-hazard-results .plot { margin-top: 16px; }
.study-plot:empty { min-height: 0; height: 0; margin: 0; }
#study-results .study-tabs { padding-bottom: 16px; border-bottom: 1px solid #e0e7ee; }
@media (max-width: 700px) {
  header.ssra-header { gap: 10px; }
  main .card { padding: 18px; }
  .study-setup > .card { padding: 0; }
  main .plot { height: 600px; }
}
