:root {
  --ink: #172433;
  --muted: #65717e;
  --line: #d6e3e8;
  --panel: #ffffff;
  --wash: #f5f8f9;
  --teal: #008b91;
  --teal-dark: #006d73;
  --cyan-soft: #e7f5f5;
  --amber: #d98538;
  --coral: #e86c5a;
  --mint: #7abf9e;
  --shadow: 0 18px 44px rgba(24, 42, 55, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(130deg, #edf3f6 0%, #fafafa 44%, #eef6f2 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Yu Gothic", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(680px, 1fr);
  gap: 20px;
  max-width: 1480px;
  margin: 0 auto;
}

.input-panel,
.report-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(214, 227, 232, 0.9);
  box-shadow: var(--shadow);
}

.input-panel {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 8px;
  padding: 22px;
}

.report-panel {
  border-radius: 8px;
  padding: 22px;
}

.panel-heading,
.report-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.report-actions {
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.privacy-note {
  margin: 14px 0 0;
  border: 1px solid #b9dcdd;
  border-radius: 8px;
  background: #f1f8f8;
  color: var(--teal-dark);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.quick-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0 0;
  padding: 18px 0 0;
}

.form-section {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 0;
}

.form-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.form-section summary::-webkit-details-marker {
  display: none;
}

.form-section summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.form-section[open] summary::after {
  transform: rotate(225deg);
}

.form-section fieldset {
  border-top: 0;
  margin: 0;
  padding: 8px 0 0;
}

.form-section legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

legend {
  padding-right: 10px;
  color: var(--teal-dark);
  font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #324252;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbdbe1;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 139, 145, 0.13);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.measurement-inputs {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.measurement-head,
.measurement-row {
  display: grid;
  grid-template-columns: minmax(84px, 0.82fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.measurement-head {
  background: #f1f8f8;
  color: var(--teal-dark);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.measurement-head span {
  text-align: left;
}

.measurement-row {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
}

.measurement-row label {
  margin: 0;
}

.measurement-row input {
  text-align: right;
}

.measure-name {
  color: #314253;
  font-size: 14px;
  font-weight: 900;
}

.measure-name small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.shoe-inputs {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.shoe-input-head,
.shoe-input-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 0.75fr) minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 8px;
  align-items: center;
}

.shoe-input-head {
  background: #f1f8f8;
  color: var(--teal-dark);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.shoe-input-head span,
.shoe-input-row span {
  text-align: left;
}

.shoe-input-row {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
}

.shoe-input-row > span {
  color: #314253;
  font-size: 13px;
  font-weight: 900;
}

.shoe-input-row textarea {
  min-height: 56px;
  resize: vertical;
}

.reason-template-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.reason-template-bar span {
  width: 100%;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.reason-template-bar button {
  border: 1px solid #b9dcdd;
  border-radius: 999px;
  background: #f1f8f8;
  color: var(--teal-dark);
  cursor: pointer;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.check-grid span,
.segmented label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.check-grid input,
.segmented input {
  width: auto;
  accent-color: var(--teal);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.icon-button,
.text-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--teal-dark);
  cursor: pointer;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  flex: 0 0 40px;
}

.text-button {
  gap: 8px;
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 800;
}

.form-actions {
  position: sticky;
  bottom: -22px;
  z-index: 2;
  margin: 22px -22px -22px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 14px 22px;
  backdrop-filter: blur(10px);
}

.form-error {
  margin-bottom: 10px;
  border: 1px solid #e3a4a4;
  border-radius: 8px;
  background: #fff3f3;
  color: #8a2929;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.primary-button {
  width: 100%;
  gap: 8px;
  min-height: 48px;
  border-color: var(--teal-dark);
  border-radius: 6px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  font-weight: 900;
}

.icon-button:hover,
.text-button:hover {
  border-color: var(--teal);
  background: var(--cyan-soft);
}

.primary-button:hover {
  filter: brightness(1.04);
}

.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report {
  width: min(100%, 1060px);
  min-height: 1240px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #d7e3e8;
  box-shadow: 0 24px 56px rgba(20, 34, 44, 0.14);
  padding: 30px 34px 34px;
}

.report-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 780px;
  text-align: center;
}

.empty-icon {
  display: inline-flex;
  width: 112px;
  height: 112px;
  border-radius: 16px;
  overflow: hidden;
}

.empty-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.report-empty h2 {
  margin: 20px 0 8px;
  color: var(--ink);
  font-size: 28px;
}

.stale-notice {
  margin: -12px 0 18px;
  border: 1px solid #e4c89d;
  border-radius: 8px;
  background: #fff8ec;
  color: #765223;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 800;
}

.report-empty p {
  max-width: 560px;
  margin: 0;
  color: #3b4b5c;
  font-size: 15px;
  line-height: 1.7;
}

.empty-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.empty-steps span {
  border-radius: 999px;
  background: #dff0ec;
  color: var(--teal-dark);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 900;
}

.report-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.report-title {
  margin: 0 0 22px;
  color: #162536;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
  font-weight: 900;
}

.meta-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #263746;
  font-size: 15px;
  font-weight: 700;
}

.mini-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--teal);
  flex: 0 0 30px;
}

.mini-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-icon img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 6px;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 18px 0 10px;
  color: var(--teal-dark);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 900;
}

.section-title small {
  font-size: 14px;
}

.runner-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.runner-overview {
  display: grid;
  grid-template-columns: minmax(260px, 0.58fr) minmax(0, 1fr);
  gap: 14px;
}

.runner-goal,
.runner-fact {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(150deg, #fff 0%, #f8fbfb 100%);
}

.runner-goal {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.runner-goal .card-icon {
  margin: 0;
}

.runner-goal span,
.runner-fact b {
  display: block;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.runner-goal strong {
  display: block;
  margin: 7px 0 4px;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.25;
}

.runner-goal p {
  margin: 0;
  color: var(--teal);
  font-size: 20px;
  font-weight: 900;
}

.runner-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.runner-fact {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 9px;
  align-items: center;
  min-height: 76px;
  padding: 10px 12px;
}

.runner-fact .mini-icon {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.runner-fact .mini-icon img {
  width: 38px;
  height: 38px;
}

.runner-fact span {
  display: block;
  margin-top: 3px;
  color: #263746;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.info-card {
  min-height: 162px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(150deg, #fff 0%, #f8fbfb 100%);
  padding: 16px 13px;
  text-align: center;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: transparent;
  color: var(--teal);
  overflow: hidden;
}

.card-icon svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-card h3 {
  margin: 0 0 12px;
  color: var(--teal-dark);
  font-size: 16px;
}

.info-card p,
.info-card li {
  color: #1e2e3d;
  font-size: 15px;
  line-height: 1.55;
}

.info-card p {
  margin: 0;
}

.info-card strong {
  display: block;
  margin-top: 6px;
  color: var(--teal);
  font-size: 24px;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  text-align: left;
}

.measurement-summary {
  display: grid;
  grid-template-columns: minmax(290px, 0.78fr) minmax(0, 1.22fr);
  gap: 14px;
  align-items: stretch;
}

.measurement-table-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfd;
  padding: 14px;
}

.measurement-table-block h3 {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: 17px;
  font-weight: 900;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.summary-item {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 146px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfd;
  padding: 12px 15px 12px 12px;
}

.summary-visual {
  position: relative;
  width: 118px;
  aspect-ratio: 1 / 1;
  border: 1px solid #cfe1e6;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.summary-visual img {
  display: block;
  max-width: none;
  height: 100%;
  object-fit: cover;
}

.summary-visual.measurement img {
  width: 400%;
}

.summary-visual.measurement.girth img {
  transform: translateX(-25%);
}

.summary-visual.measurement.height img {
  transform: translateX(-75%);
}

.summary-visual.pronation img {
  width: 300%;
}

.summary-visual.pronation.neutral img {
  transform: translateX(-33.3333%);
}

.summary-visual.pronation.under img {
  transform: translateX(-66.6666%);
}

.summary-copy {
  min-width: 0;
}

.summary-copy span {
  display: block;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.summary-copy strong {
  display: block;
  margin: 6px 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.25;
}

.summary-copy p {
  margin: 0;
  color: #354556;
  font-size: 12.5px;
  line-height: 1.55;
}

.tryon-panel {
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfb;
  padding: 14px 16px;
}

.tryon-panel span,
.shoe-points strong {
  display: block;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.tryon-panel strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #dff0ec;
  color: var(--teal-dark);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.measure-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.measure-table th,
.measure-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: center;
}

.measure-table th:last-child,
.measure-table td:last-child {
  border-right: 0;
}

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

.measure-table th {
  color: var(--teal-dark);
  background: #f6fbfb;
  font-size: 15px;
}

.measure-table td {
  font-size: 22px;
}

.measure-table td:first-child {
  color: #314253;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
}

.analysis-box,
.shoe-row,
.summary-item,
.info-card {
  break-inside: avoid;
}

.analysis-flow {
  display: grid;
  grid-template-columns: 1fr 28px 1fr 28px 1.25fr;
  gap: 14px;
  align-items: center;
}

.analysis-box {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

.analysis-box h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  color: var(--teal-dark);
  font-size: 18px;
}

.analysis-box ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
}

.flow-arrow {
  width: 0;
  height: 0;
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  border-left: 16px solid var(--teal);
}

.shoe-list {
  display: grid;
  gap: 9px;
}

.shoe-row {
  display: grid;
  grid-template-columns: 40px 230px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 136px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 18px 12px 10px;
}

.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  font-size: 21px;
  font-weight: 900;
}

.shoe-photo-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  overflow: hidden;
}

.shoe-photo {
  display: block;
  width: 220px;
  max-width: 100%;
  height: 120px;
  object-fit: contain;
}

.shoe-art {
  width: 220px;
  max-width: 100%;
  height: auto;
}

.shoe-sole {
  fill: #e8edf0;
}

.shoe-upper {
  fill: var(--shoe-main, #3aa7c5);
}

.shoe-accent {
  fill: var(--shoe-accent, #172433);
}

.shoe-lace {
  fill: none;
  stroke: rgba(23, 36, 51, 0.62);
  stroke-width: 5;
  stroke-linecap: round;
}

.shoe-name {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 22px;
  line-height: 1.2;
  font-weight: 900;
}

.shoe-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-line;
}

.fit-pill {
  display: inline-flex;
  border-radius: 99px;
  background: #dff0ec;
  color: var(--teal-dark);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.scene-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  color: var(--teal-dark);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.scene-icons svg {
  width: 30px;
  height: 30px;
  margin-bottom: 3px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scene-icons img {
  display: block;
  width: 34px;
  height: 34px;
  margin: 0 auto 3px;
  object-fit: cover;
  border-radius: 7px;
}

.shoe-points {
  display: grid;
  gap: 8px;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: static;
    max-height: none;
  }

  .runner-overview,
  .runner-facts,
  .tryon-panel,
  .runner-grid,
  .summary-grid,
  .measurement-summary,
  .two-column,
  .analysis-flow {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    margin: 0 auto;
    transform: rotate(90deg);
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px;
  }

  .input-panel,
  .report-panel,
  .report {
    padding: 16px;
  }

  .meta-row,
  .runner-overview,
  .runner-facts,
  .tryon-panel,
  .runner-grid,
  .summary-grid,
  .measurement-summary,
  .shoe-row {
    grid-template-columns: 1fr;
  }

  .summary-item {
    grid-template-columns: 104px 1fr;
  }

  .summary-visual {
    width: 104px;
  }

  .shoe-input-head,
  .shoe-input-row {
    grid-template-columns: 1fr;
  }

  .shoe-row {
    text-align: center;
  }

}

@media print {
  body {
    background: #fff;
  }

  .input-panel,
  .report-actions {
    display: none;
  }

  .app-shell,
  .report-panel,
  .report {
    display: block;
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  .workspace {
    display: block;
  }

  .report {
    width: 100%;
    min-height: 0;
  }

  .report-header,
  section {
    break-inside: avoid;
  }
}
