:root {
  --muji-red: #7f0019;
  --muji-red-dark: #6f0014;
  --text-main: #111111;
  --text-muted: #666666;
  --text-light: #999999;
  --border: #d9d9d9;
  --border-soft: #eeeeee;
  --bg-page: #ffffff;
  --bg-soft: #f5f5f5;
  --bg-product: #eee4c8;
  --bg-warning: #edc2cb;
  --warning-text: #3a1118;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  background: #ffffff;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--text-main);
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: 14px;
}

button,
input,
select {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background: #ffffff;
}

.screen {
  width: 100%;
  max-width: 390px;
  min-height: 100vh;
  padding: 18px 20px 22px;
  background: var(--bg-page);
  position: relative;
}

.hidden {
  display: none !important;
}

/* Header */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.input-topbar {
  margin-bottom: 8px;
}

.brand-block {
  min-width: 0;
}

.muji-logo-img {
  display: block;
  width: 50px;
  height: auto;
  margin-bottom: 6px;
}

h1 {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--muji-red);
  letter-spacing: -0.01em;
}

.result-header h1,
.error-header h1 {
  margin: 0;
  font-size: 18px;
  color: var(--muji-red);
}

.back-icon {
  width: 18px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  color: var(--muji-red);
  font-size: 22px;
  line-height: 1;
  background: none;
  border: 0;
  padding: 0;
}

.lang-toggle {
  display: flex;
  border: 1px solid var(--muji-red);
  height: 26px;
  min-width: 76px;
  flex-shrink: 0;
}

.lang-toggle button {
  width: 38px;
  height: 24px;
  border: 0;
  background: #ffffff;
  color: var(--text-main);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  padding: 0;
}

.lang-toggle button.active {
  background: var(--muji-red);
  color: #ffffff;
}

/* Intro */

.intro-copy {
  margin: 6px 0 12px;
  color: var(--text-light);
  font-size: 10px;
  line-height: 1.45;
}

.status {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.status.error {
  background: var(--bg-warning);
  color: var(--warning-text);
}

/* Product card */

.product-card {
  background: var(--bg-product);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 18px;
}

.product-card .product-label {
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--text-main);
  text-decoration: underline;
}

.product-card h2 {
  margin: 0 0 8px;
  color: var(--muji-red);
  font-size: 18px;
  line-height: 1.15;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.product-card .product-meta {
  margin: 0;
  color: var(--text-main);
  font-size: 11px;
  line-height: 1.5;
}

/* Form */

.advisor-form {
  margin-top: 0;
}

.form-section {
  margin-bottom: 16px;
}

.form-section h2,
.measure-panel h2 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: none;
}

.field-row {
  min-width: 0;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
}

input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-main);
}

input::placeholder {
  color: #a9a9a9;
}

input:focus {
  outline: 1px solid var(--muji-red);
  border-color: var(--muji-red);
}

.help-text {
  margin: -2px 0 10px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-light);
}

/* Fit buttons */

/* Fit buttons */

.fit-segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.fit-option {
  margin: 0;
}

.fit-segment input {
  display: none;
}

.fit-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 132px;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  text-align: center;
  transition: all 0.2s ease;
}

.fit-card-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}

.fit-card-text {
  display: block;
  width: 100%;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.fit-segment input:checked + .fit-card {
  border: 2px solid var(--muji-red);
  background: #fff7f8;
  color: var(--muji-red);
}

/* Measurement toggle */

.measure-toggle {
  width: 100%;
  border: 1px solid var(--border-soft);
  background: var(--bg-soft);
  color: var(--text-main);
  min-height: 48px;
  border-radius: 0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin: 0 0 0;
}

.measure-toggle .plus {
  font-size: 16px;
  line-height: 1;
  color: var(--text-main);
  width: 16px;
  flex-shrink: 0;
}

.measure-toggle strong {
  display: block;
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-main);
}

.measure-toggle small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-muted);
}
/* Measurement panel */

.measure-group-panel.hidden {
  display: none !important;
}

.measure-panel {
  border: 1px solid var(--border-soft);
  background: #ffffff;
  padding: 0;
  margin: 12px 0;
}

.measure-panel h2 {
  padding: 12px 12px 8px;
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
}

.measure-accordion {
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
  margin: 0 10px 10px;
}

.measure-accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 12px;
  min-height: 38px;
  font-size: 10px;
  font-weight: 800;
  background: #f4f2f2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.measure-accordion summary::-webkit-details-marker {
  display: none;
}

.measure-accordion summary::after {
  content: "⌄";
  font-size: 14px;
  color: var(--text-main);
  line-height: 1;
}

.measure-accordion[open] summary::after {
  content: "⌃";
}

.measure-content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #ffffff;
  overflow: hidden;
}

.measure-input-list {
  min-width: 0;
}

.measure-input-list label {
  margin: 0 0 6px;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--text-main);
}

.measure-input-list input {
  width: 100%;
  max-width: 150px;
  height: 31px;
  margin: 0 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 7px 10px;
  font-size: 11px;
}

.measure-input-list input:last-child {
  margin-bottom: 0;
}

.measure-input-list input::placeholder {
  color: #a9a9a9;
}

.measure-visual {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: visible;
}

.measure-visual img {
  width: 100%;
  max-width: 104px;
  max-height: 150px;
  object-fit: contain;
  display: block;
  transform-origin: center right;
}

/* Image TOP & BOTTOM & DRESS */
#topMeasure .measure-visual img {
  transform: scale(1) translateX(-15px);
}
#bottomMeasure .measure-visual img,
#dressMeasure .measure-visual img {
  transform: scale(1.1) translateX(-9px);
}

@media (max-width: 390px) {
  .measure-content-layout {
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 10px;
    padding: 10px;
  }

  .measure-input-list label {
    font-size: 9px;
  }

  .measure-accordion summary {
    font-size: 9px;
    padding: 11px 10px;
  }
}
/* Buttons */

.primary-button {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--muji-red);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  margin-top: 12px;
}

.primary-button:hover {
  background: var(--muji-red-dark);
}

.secondary-button {
  width: 100%;
  height: 48px;
  border: 1px solid var(--muji-red);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--muji-red);
  font-size: 12px;
  font-weight: 700;
  margin-top: 12px;
}

.back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--muji-red);
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  margin-top: 20px;
}

.back-button:hover {
  background: var(--muji-red-dark);
}

.privacy-note {
  margin: 16px 0 0;
  color: #999999;
  font-size: 10px;
  line-height: 1.35;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.privacy-note span {
  display: inline-block;
  color: #999999;
  max-width: calc(100% - 20px);
}

.privacy-icon {
  width: 12px;
  height: 12px;
  object-fit: contain;
  flex-shrink: 0;
  margin-top: 1px;
}


/* Result screen */

.screen-result {
  padding-top: 28px;
}

.result-header,
.error-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-product-card {
  background: var(--bg-product);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}

.result-product-card .label {
  margin: 0 0 8px;
  font-size: 12px;
  text-decoration: underline;
}

.result-product-card h2 {
  margin: 0 0 10px;
  color: var(--muji-red);
  font-size: 18px;
  line-height: 1.15;
  font-weight: 800;
  text-transform: uppercase;
}

.result-product-card .meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-main);
}

.result-size-block {
  text-align: center;
  padding: 8px 0 10px;
}

.result-size-block .result-size-label {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
}

.result-size {
  margin: 0;
  font-size: 78px;
  line-height: 0.95;
  font-weight: 800;
  color: var(--muji-red);
  letter-spacing: -0.06em;
}

.confidence-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
  font-size: 14px;
  font-weight: 700;
}

.confidence-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--text-muted);
  border-radius: 999px;
  font-size: 10px;
  color: var(--text-muted);
}

.confidence-tooltip {
  display: inline-block;
  background: #eeeeee;
  color: #9b9b9b;
  font-size: 11px;
  line-height: 1.25;
  padding: 8px 10px;
  min-width: 128px;
  font-weight: 400;
}

.warning-box {
  background: var(--bg-warning);
  color: var(--warning-text);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.35;
}

.warning-box strong {
  font-weight: 800;
}

.warning-box .warning-title {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 2px;
}

.why-block {
  margin: 18px 0 12px;
}

.why-block h3,
.size-info-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 800;
}

.why-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.why-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.45;
}

.why-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 9px;
  height: 9px;
  background: var(--muji-red);
  border-radius: 999px;
}

.size-info-card {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fafafa;
  padding: 14px;
}

.size-info-card .size-info-size {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 800;
}

.size-info-card .info-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.45;
}

.size-info-card .info-row span:last-child {
  text-align: right;
  white-space: nowrap;
}

.result-actions {
  margin-top: 18px;
}

.result-privacy {
  margin-top: 18px;
}
/* Category detail block */


.category-detail-eyebrow {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.category-detail-card h3 {
  margin: 0;
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
}

.category-detail-sub {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.category-detail-visual {
  width: 72px;
  min-width: 72px;
  height: 88px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.category-detail-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.category-detail-fallback {
  color: var(--muji-red);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.category-size-pill span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.3;
}

.category-size-pill strong {
  color: var(--muji-red);
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}


.category-measure-label {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.25;
}

.measure-code {
  color: var(--muji-red);
  font-weight: 800;
  flex-shrink: 0;
}

.category-measure-label span:last-child {
  color: var(--text-muted);
}

.category-measure-item strong {
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
}

.category-measure-item.is-missing strong {
  color: var(--text-light);
}
/* Size calculation card - approved UX/UI */

.size-calc-card {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f7f7f7;
  padding: 12px 12px;
}

.size-calc-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;}
.size-calc-visual {
  margin-left: auto;
}

.size-calc-content {
  flex: 1 1 auto;
  min-width: 0;
}

.size-calc-card h3 {
  margin: 0 0 14px;
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 800;
}

.size-calc-size {
  margin: 0 0 12px;
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 800;
  text-transform: uppercase;
}

.size-calc-list {
  margin: 0;
  padding: 0;
}

.size-calc-row {
  display: grid;
  grid-template-columns:  118px 1fr;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--text-main);
  font-size: 9px;
  line-height: 1.25;
}

.size-calc-row:last-child {
  margin-bottom: 0;
}

.size-calc-row dt {
  margin: 0;
  font-weight: 400;
}

.size-calc-row dd {
  margin: 0;
  text-align: left;
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}

.size-calc-row.is-missing dd {
  color: var(--text-light);
}

.size-calc-visual {
  flex: 0 0 42%;
  min-width: 150px;
  max-width: 180px;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
    margin-left: auto;
  margin-top: 14px;
}

.size-calc-visual img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  display: block;
}

.size-calc-fallback {
  color: var(--muji-red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* Mobile adjustment */

@media (max-width: 390px) {
  .size-calc-card {
    padding: 18px 16px;
  }

  .size-calc-layout {
    align-items: center;
    gap: 8px;
  }

  .size-calc-content {
    flex: 1 1 58%;
  }

  .size-calc-card h3 {
    font-size: 16px;
    line-height: 1.25;
    margin-bottom: 14px;
  }

  .size-calc-size {
    font-size: 16px;
    line-height: 1.25;
    margin-bottom: 14px;
  }

  .size-calc-row {
    grid-template-columns: 104px 1fr;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    line-height: 1.2;
  }

  .size-calc-row dt {
    white-space: normal;
  }

  .size-calc-row dd {
    font-size: 12px;
    white-space: nowrap;
  }

  .size-calc-visual {
    flex: 0 0 42%;
    min-width: 138px;
    max-width: 160px;
    min-height: 170px;
  }

  .size-calc-visual img {
    max-height: 180px;
  }
}
/* Error screen */
.screen-error {
  padding-top: 18px;
}

.error-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.error-hero-card {
  border: 2px solid #1595ff;
  border-radius: 7px;
  background: #ffffff;
  padding: 18px 14px;
  text-align: center;
  margin-bottom: 10px;
}

.error-hero-card h2 {
  margin: 0 0 14px;
  color: var(--text-main);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 800;
  text-transform: uppercase;
}

.error-hero-card p {
  margin: 0 auto;
  max-width: 290px;
  color: var(--text-main);
  font-size: 12px;
  line-height: 1.45;
}

.error-guide-warning {
  background: #efc3cb;
  color: var(--warning-text);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 12px;
  line-height: 1.35;
}

.error-guide-warning-title {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-bottom: 2px;
}

.error-guide-warning-title span {
  color: var(--muji-red);
  font-size: 12px;
  line-height: 1.2;
}

.error-guide-warning-title strong {
  font-weight: 800;
}

.error-guide-warning p {
  margin: 0;
}

.size-guide-section {
  margin: 0 0 16px;
}

.size-guide-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--muji-red);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 800;
  text-transform: uppercase;
}

.size-guide-title img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  flex-shrink: 0;
}

.size-guide-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  background: #ffffff;
  font-size: 11px;
  line-height: 1.35;
}

.size-guide-table th,
.size-guide-table td {
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 8px 6px;
  text-align: center;
}

.size-guide-table th:last-child,
.size-guide-table td:last-child {
  border-right: 0;
}

.size-guide-table tbody tr:last-child td {
  border-bottom: 0;
}

.size-guide-table th {
  background: #f3f3f3;
  color: var(--text-main);
  font-size: 10px;
  font-weight: 800;
}

.size-guide-table td {
  color: var(--text-main);
  font-weight: 500;
}

.size-guide-table .size-guide-size {
  color: var(--muji-red);
  font-weight: 800;
}

.error-privacy {
  margin-top: 16px;
}

.error-actions {
  margin-top: 28px;
}

.error-shopping-button {
  margin-top: 0;
}

.error-shopping-button span {
  margin-left: 6px;
  font-size: 12px;
  line-height: 1;
}

.error-reenter-button {
  margin-top: 10px;
}

@media (max-width: 360px) {
  .error-hero-card h2 {
    font-size: 18px;
  }

  .size-guide-table {
    font-size: 10px;
  }

  .size-guide-table th,
  .size-guide-table td {
    padding: 7px 4px;
  }
}

/* Desktop wrapper */

@media (min-width: 720px) {
  .app-shell {
    align-items: flex-start;
  }

  .screen {
    border-left: 1px solid #f0c8c8;
    border-right: 1px solid #f0c8c8;
  }
}

/* Small mobile */

@media (max-width: 360px) {
  .screen {
    padding-left: 14px;
    padding-right: 14px;
  }

  .result-size {
    font-size: 68px;
  }

  .product-card h2,
  .result-product-card h2 {
    font-size: 16px;
  }

  .fit-segment {
    gap: 6px;
  }

  .fit-segment span {
    font-size: 9px;
  }
}
.bmi-only-detail-text {
  font-weight: 300;
}
.field-error {
  display: block;
  margin-top: 6px;
  color: #a6192e;
  font-size: 12px;
  font-weight: 500;
}

.field-invalid {
  border-color: #a6192e !important;
  background: #fff7f7 !important;
}

.field-shake {
  animation: field-shake 0.35s ease;
}

@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}