.ofd-app {
  --ofd-green: #557f35;
  --ofd-green-dark: #365b22;
  --ofd-gold: #b99a68;
  --ofd-cream: #fbfaf6;
  --ofd-line: #e7e3d9;
  width: min(1600px, 100vw);
  margin: 0 0 0 50%;
  transform: translateX(-50%);
  color: #272727;
  background: #fff;
  font-family: "Noto Sans JP", sans-serif;
  overflow-anchor: none;
}
.ofd-app * { box-sizing: border-box; }
.ofd-app [hidden] { display: none !important; }
.ofd-test-view {
  display: grid;
  grid-template-columns: minmax(240px, 290px) 1fr;
  gap: 18px;
  padding: 18px;
  background: linear-gradient(135deg, #fbfaf5, #fff);
}
.ofd-sidebar {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  border: 1px solid #e9e5d9;
  border-radius: 10px;
  padding: 74px 24px 28px;
  text-align: center;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 6px 18px rgba(64, 55, 37, .06);
}
.ofd-sidebar::before,
.ofd-sidebar::after {
  content: "";
  position: absolute;
  z-index: 0;
  display: block;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.ofd-sidebar::before {
  top: -12px;
  right: -14px;
  width: 170px;
  height: 205px;
  background-image: url("images/foliage-top-right.png");
}
.ofd-sidebar::after {
  bottom: -8px;
  left: -10px;
  width: 240px;
  height: 152px;
  background-image: url("images/foliage-bottom-left.png");
}
.ofd-sidebar > * { position: relative; z-index: 1; }
.ofd-eyebrow {
  margin: 0 0 8px;
  color: var(--ofd-green);
  font-family: serif;
  font-weight: 600;
  letter-spacing: .12em;
}
.ofd-sidebar h1 {
  margin: 0;
  font-family: "Noto Serif JP", serif;
  font-size: clamp(27px, 2.2vw, 42px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: .08em;
}
.ofd-description {
  margin: 36px 0 0;
  font-family: "Noto Serif JP", serif;
  font-size: 14px;
  line-height: 2;
}
.ofd-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 28px 0;
  font-size: 13px;
  font-weight: 600;
}
.ofd-progress-card,
.ofd-mobile-progress {
  border: 1px solid #e3e1dc;
  border-radius: 7px;
  padding: 17px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .07);
  text-align: left;
}
.ofd-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.ofd-progress-label span { color: var(--ofd-green); font-weight: 700; }
.ofd-progress-label b { font-size: 22px; }
.ofd-progress {
  height: 9px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e8e8;
}
.ofd-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #85ad60, var(--ofd-green));
  transition: width .25s ease;
}
.ofd-progress-message { margin: 12px 0 0; text-align: center; font-size: 12px; }
.ofd-main { min-width: 0; }
.ofd-mobile-progress { display: none; }
.ofd-questions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.ofd-question {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--ofd-line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 3px 9px rgba(50, 45, 34, .05);
}
.ofd-question legend {
  float: left;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}
.ofd-question legend + * { clear: both; }
.ofd-question legend > span {
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  background: var(--ofd-green);
  font-size: 12px;
}
.ofd-options { display: grid; grid-template-columns: 1fr; gap: 3px; }
.ofd-options label {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 29px;
  border: 1px solid #eeece6;
  border-radius: 5px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.35;
  transition: .18s ease;
}
.ofd-options label:hover { border-color: #a3bd8b; background: #f8fbf5; }
.ofd-options input { position: absolute; opacity: 0; pointer-events: none; }
.ofd-options label:has(input:checked) {
  border-color: var(--ofd-green);
  background: #f0f6eb;
  box-shadow: inset 0 0 0 1px var(--ofd-green);
}
.ofd-options label > span { display: flex; align-items: center; gap: 7px; }
.ofd-options label > span::before {
  content: "";
  flex: 0 0 13px;
  width: 13px;
  height: 13px;
  border: 1px solid #bbb;
  border-radius: 50%;
  background: #fff;
}
.ofd-options label:has(input:checked) > span::before { border: 4px solid var(--ofd-green); }
.ofd-options input:focus-visible + span { outline: 2px solid #1d4ed8; outline-offset: 3px; }
.ofd-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}
.ofd-actions button,
.ofd-restart {
  appearance: none;
  border: 1px solid var(--ofd-green);
  border-radius: 999px;
  padding: 10px 24px;
  cursor: pointer;
  color: var(--ofd-green);
  background: #fff;
  font-weight: 700;
}
.ofd-actions .ofd-submit {
  color: #fff;
  background: linear-gradient(90deg, #669c3e, #47792c);
  box-shadow: 0 4px 10px rgba(71, 121, 44, .2);
}
.ofd-actions button:disabled { cursor: not-allowed; opacity: .4; }
.ofd-error { min-height: 1.5em; margin: 8px 0 0; color: #b42318; text-align: center; font-weight: 700; }
.ofd-privacy { margin: 8px 0 0; color: #666; text-align: center; font-size: 11px; }
.ofd-result-view {
  --ofd-active-color: #557f35;
  --ofd-result-gutter: 96px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: #fff;
}
.ofd-result-header {
  position: relative;
  min-height: 0;
  padding: 48px;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(90deg, #fff 0%, #fffdf8 52%, #f4eee0 100%);
}
.ofd-result-header::before,
.ofd-result-header::after {
  content: "";
  position: absolute;
  z-index: 1;
  display: block;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.ofd-result-header::before {
  top: -24px;
  right: -18px;
  width: 220px;
  height: 264px;
  background-image: url("images/foliage-top-right.png");
}
.ofd-result-header::after {
  bottom: -18px;
  left: -16px;
  width: 280px;
  height: 178px;
  background-image: url("images/foliage-bottom-left.png");
}
.ofd-result-header > div:first-child {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin-right: auto;
  margin-left: auto;
}
.ofd-result-header .ofd-eyebrow { color: var(--ofd-active-color); }
.ofd-result-header h2 {
  margin: 0;
  font-family: "Noto Serif JP", serif;
  font-size: clamp(44px, 5vw, 72px);
  font-weight: 500;
  letter-spacing: .1em;
}
.ofd-result-header > div > p:last-child { line-height: 1.8; }
.ofd-score-card {
  position: relative !important;
  z-index: 3;
  width: min(520px, 100%);
  margin: 28px auto 0;
  border: 1px solid var(--ofd-active-color);
  border-radius: 10px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, .92);
  text-align: left;
}
.ofd-score-card > span { color: var(--ofd-active-color); font-weight: 700; }
.ofd-score-card > strong { float: right; color: var(--ofd-active-color); font-family: serif; font-size: 48px; line-height: 1; }
.ofd-score-card small { font-size: 18px; }
.ofd-score-card .ofd-progress { clear: both; }
.ofd-score-card .ofd-progress > span { background: var(--ofd-active-color); }
.ofd-score-card p { margin: 8px 0 0; text-align: center; font-size: 12px; }
.ofd-result-card {
  width: min(1300px, calc(100% - var(--ofd-result-gutter)));
  margin: 28px auto;
  border: 1px solid #ded8cc;
  border-color: color-mix(in srgb, var(--ofd-result-color) 30%, #fff);
  border-radius: 18px;
  padding: 24px;
  background: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--ofd-result-color) 5%, #fff), #fff 45%);
  box-shadow: 0 7px 20px rgba(55, 43, 23, .07);
}
.ofd-result-title { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 20px; }
.ofd-result-range {
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  color: #fff;
  background: var(--ofd-result-color);
  font-family: serif;
  font-size: 28px;
  line-height: 1.05;
  text-align: center;
}
.ofd-result-range > span { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ofd-result-range b { display: block; font: inherit; line-height: 1.05; white-space: nowrap; }
.ofd-result-range small { display: inline; margin-left: 2px; font-size: 13px; }
.ofd-result-title h3 {
  margin: 0;
  border-bottom: 2px dotted var(--ofd-result-color);
  padding: 0 0 14px;
  color: var(--ofd-result-color);
  font-family: "Noto Serif JP", serif;
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 500;
}
.ofd-result-title h3::before,
.ofd-result-title h3::after {
  content: none !important;
  display: none !important;
}
.ofd-result-content { margin-top: 22px; }
.ofd-result-content.has-image {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 48%);
  gap: clamp(26px, 4vw, 58px);
  align-items: center;
}
.ofd-result-image-wrap { min-width: 0; }
.ofd-result-content img {
  display: block;
  width: 100%;
  max-height: 520px;
  border-radius: 18px;
  object-fit: contain;
}
.ofd-result-copy { font-family: "Noto Serif JP", serif; font-size: 15px; line-height: 1.9; }
.ofd-result-copy p:first-child { margin-top: 0; }
.ofd-result-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(1300px, calc(100% - var(--ofd-result-gutter)));
  margin: 26px auto;
}
.ofd-result-actions a {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 56px;
  border: 1px solid #b87001;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}
.ofd-primary-cta { color: #fff !important; background: #b87001; }
.ofd-detail-cta { border-color: #eecd70 !important; color: #4b3917 !important; background: #eecd70; }
.ofd-secondary-cta { color: #b87001 !important; background: #fff; }
.ofd-restart { grid-column: 1 / -1; justify-self: center; border: 0; color: #b87001; text-decoration: underline; }
.ofd-result-view > .ofd-privacy {
  width: min(1300px, calc(100% - var(--ofd-result-gutter)));
  margin-right: auto;
  margin-left: auto;
  padding-bottom: 24px;
}

@media (min-width: 1440px) {
  .ofd-test-view { grid-template-columns: minmax(250px, 300px) 1fr; }
  .ofd-sidebar { height: calc(100vh - 36px); min-height: 700px; }
  .ofd-questions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 9px; }
  .ofd-question { padding: 6px; }
  .ofd-question legend { margin-bottom: 4px; font-size: 11px; line-height: 1.35; }
  .ofd-question legend > span { flex-basis: 21px; width: 21px; height: 21px; font-size: 10px; }
  .ofd-options { gap: 2px; }
  .ofd-options label { min-height: 24px; padding: 2px 6px; font-size: 10.5px; line-height: 1.2; }
  .ofd-actions { margin-top: 7px; }
  .ofd-main { display: flex; flex-direction: column; }
  .ofd-privacy { margin-top: auto; }
}

@media (max-width: 1023px) {
  .ofd-test-view { grid-template-columns: 1fr; }
  .ofd-sidebar { min-height: 0; padding: 32px 22px; }
  .ofd-sidebar .ofd-progress-card { display: none; }
  .ofd-description { margin-top: 18px; }
  .ofd-meta { margin: 16px 0; }
  .ofd-mobile-progress {
    display: block;
    grid-column: 1 / -1;
    align-self: start;
    margin-bottom: 0;
  }
  .ofd-questions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ofd-result-view { --ofd-result-gutter: 48px; }
  .ofd-result-content.has-image { grid-template-columns: minmax(0, 1fr) minmax(300px, 44%); gap: 24px; }
}

@media (max-width: 640px) {
  .ofd-test-view { padding: 10px; }
  .ofd-sidebar { padding: 24px 16px; }
  .ofd-sidebar h1 { font-size: 27px; }
  .ofd-description { font-size: 13px; line-height: 1.8; }
  .ofd-meta { gap: 16px; }
  .ofd-mobile-progress {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 110px !important;
    z-index: 999;
    margin: 0 0 10px;
    border-radius: 0 0 8px 8px;
    padding: 7px 12px 8px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 5px 14px rgba(45, 40, 30, .12);
  }
  .ofd-mobile-progress .ofd-progress-label { font-size: 11px; }
  .ofd-mobile-progress .ofd-progress-label b { font-size: 16px; }
  .ofd-mobile-progress .ofd-progress { height: 5px; margin-top: 4px; }
  .ofd-questions { grid-template-columns: 1fr; }
  .ofd-question { padding: 12px; }
  .ofd-options label { min-height: 42px; font-size: 13px; }
  .ofd-actions { flex-wrap: wrap; }
  .ofd-actions button { padding: 11px 20px; }
  .ofd-result-view { --ofd-result-gutter: 20px; }
  .ofd-result-header { min-height: 0; padding: 30px 20px 28px; }
  .ofd-result-header::before { top: -16px; right: -30px; width: 150px; height: 180px; }
  .ofd-result-header::after { bottom: -12px; left: -30px; width: 190px; height: 122px; }
  .ofd-result-header h2 { font-size: 44px; }
  .ofd-score-card { width: 100%; margin-top: 24px; padding: 12px 16px; }
  .ofd-result-card { margin: 16px 0; padding: 16px; }
  .ofd-result-title { grid-template-columns: 75px 1fr; gap: 12px; }
  .ofd-result-range { width: 70px; height: 70px; font-size: 20px; }
  .ofd-result-range small { font-size: 10px; }
  .ofd-result-title h3 { font-size: 22px; }
  .ofd-result-content.has-image { grid-template-columns: 1fr; }
  .ofd-result-image-wrap { margin-top: 4px; }
  .ofd-result-copy { font-size: 14px; }
  .ofd-result-actions { grid-template-columns: 1fr; margin: 20px 0; }
  .ofd-restart { grid-column: 1; }
}
