/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

:root {
  --ink: #1E1C1C;
  --muted: #746e69;
  --accent: #6f97b1;
  --accent-dark: #557f9a;
  --danger: #e34b4b;
  --paper: #f4f4f4;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); font-family: "Noto Sans JP", "Yu Gothic", sans-serif; background: #f7f5f1; }
a { color: inherit; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible { outline: 3px solid rgba(85, 127, 154, .55); outline-offset: 3px; }

.site-header {
  height: 80px;
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  align-items: center;
  padding: 10px 20px;
  background: #f1f1f1;
  border-bottom: 1px solid #8e8378;
  position: relative;
  z-index: 2;
}
.brand img { display: block; width: 220px; height: auto; }
.site-navigation { display: flex; justify-content: center; gap: 58px; font-size: 18px; font-weight: 600; }
.site-navigation a { text-decoration: none; }
.site-navigation a span {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1;
}
.site-navigation a span img {
  height: 30px;
}
.site-session-link { justify-self: end; display: flex; align-items: center; gap: 8px; }
.header-button { display: inline-block; min-width: 130px; padding: 6px 16px; border: 1px solid #765346; border-radius: 6px; background: white; text-align: center; font-size: 16px; font-weight: 500; text-decoration: none; }
.header-button:hover { background-color: #a18972; color: white; border: 1px solid #a18972; }
.site-session-link .header-button { min-width: 110px; transition: all 0.2s ease-in-out; cursor: pointer; }
.site-session-link .header-button span {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1;
}

.site-session-link .header-button span img {
  height: 18px;
}
.site-session-link form { margin: 0; }

.mobile-menu { display: none; }

.page-content { min-height: calc(100vh - 130px); background-color: #f1f1f1; }
.auth-page .page-content {
  min-height: calc(100vh - 130px);
  padding: 42px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #d9ba82;
  background-image: linear-gradient(rgba(255,255,255,.06), rgba(255,255,255,.06)), var(--auth-background);
  background-size: cover;
  background-position: center;
}

.site-footer {
  min-height: 50px;
  padding: 0 20px;
  background: #fafafa;
  text-align: center;
  font-size: 10px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}
.site-footer__brand { display: none; }
.site-footer nav { display: flex; justify-content: center; gap: 15px; color: #5b7282; }
.site-footer nav span {
    border-right: 2px solid #CCCCCC;
}
.site-footer a { text-underline-offset: 2px; font-size: 13px; line-height: 1.5; font-weight: 500; transition: all 0.2s ease-in-out; color: #1E1C1C; border-bottom: 1px solid #1E1C1C; }
.site-footer a:hover { color: #5b7282; border-bottom: 0; }
.site-footer small {
  font-size: 120%;
  font-weight: 500;
  margin: 0;
}


.top-hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  /* background-color: #d2ad6e; */
  background-image: linear-gradient(rgba(218, 184, 126, .2), rgba(218, 184, 126, .2)), var(--top-background);
  background-size: cover;
  background-position: center;
  background-repeat: repeat-x;
}
.top-hero__content {
  width: min(500px, 100%);
  display: grid;
  justify-items:
  center;align-content:
  center; text-align:
  center; height: 100vh;
  background-size: contain;
  background-position: center center;
}
.top-hero__logo { width: 90%; max-width: 100%; height: auto; margin-bottom: 30px; }
.top-hero__start {
  min-width: 430px;
  max-width: 100%;
  line-height: 1.2;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  transition: all 0.2s ease-in-out;
  height: 10rem;
}
.top-hero__start:hover { opacity: 0.8; }
.top-hero__facts {
  margin: 10px 0 0;
  width: 82%;
}
.top-hero__copy { margin: 0; font-size: 21px; line-height: 1.85; }

.legal-dialog {
  position: fixed;
  inset: 0;
  width: min(760px, calc(100% - 32px));
  height: min(720px, calc(100vh - 48px));
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #9b8a7c;
  border-radius: 9px;
  background: #fcfbf9;
  color: var(--ink);
  box-shadow: 0 12px 42px rgba(35, 27, 21, .3);
}
.legal-dialog[open] { display: flex; flex-direction: column; }
.legal-dialog::backdrop { background: rgba(48, 44, 41, .55); }
.legal-dialog__header { flex: 0 0 auto; padding: 18px 22px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid #d8cec6; }
.legal-dialog__header h1 { margin: 0; color: #765d4b; font-size: 23px; }
.legal-dialog__header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.legal-dialog__close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: #675d56; font-size: 28px; line-height: 1; cursor: pointer; }
.legal-dialog__close:hover { background: #eee8e3; }
.legal-dialog__body { flex: 1 1 auto; min-height: 0; padding: 22px 28px; overflow-y: auto; scroll-behavior: smooth; }
.legal-dialog__body h2 { margin: 23px 0 7px; color: #1E1C1C; font-size: 16px; font-weight: 500; }
.legal-dialog__body h2:first-of-type { margin-top: 16px; }
.legal-dialog__body p { margin: 0 0 11px; font-size: 13px; line-height: 1.85; }
.legal-document__meta { padding-bottom: 12px; border-bottom: 1px dashed #d8cec6; color: #655e59; font-size: 12px !important; }
.legal-dialog__footer { flex: 0 0 auto; padding: 12px 22px 16px; border-top: 1px solid #d8cec6; text-align: center; }
.legal-dialog__button { min-width: 180px; padding: 9px 25px; border: 1px solid #947c66; border-radius: 5px; background: #947c66; color: white; font: inherit; cursor: pointer; }

.diagnosis-consent-dialog__step { margin: 0 0 3px !important; color: #947c66 !important; font-size: 12px !important; font-weight: 700; letter-spacing: .06em; }
.diagnosis-consent-dialog .legal-dialog__header h2 { margin: 0; color: #765d4b; font-size: 23px; font-weight: 600; }
.diagnosis-consent-dialog__progress { flex: 0 0 auto; margin: 0; padding: 13px 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; border-bottom: 1px solid #d8cec6; list-style: none; }
.diagnosis-consent-dialog__progress li { position: relative; display: grid; justify-items: center; gap: 3px; color: #aaa19a; font-size: 11px; font-weight: 700; text-align: center; }
.diagnosis-consent-dialog__progress li::before { content: ""; width: 100%; border-top: 3px solid #d8cec6; }
.diagnosis-consent-dialog__progress li.is-current,
.diagnosis-consent-dialog__progress li.is-complete { color: #765d4b; }
.diagnosis-consent-dialog__progress li.is-current::before,
.diagnosis-consent-dialog__progress li.is-complete::before { border-color: #947c66; }
.diagnosis-consent-dialog__progress span { font-weight: 500; }
.diagnosis-consent-dialog__body > section[hidden] { display: none; }
.diagnosis-consent-dialog__footer { display: grid; grid-template-columns: minmax(140px, 180px) minmax(180px, 240px); justify-content: center; gap: 20px; }
.diagnosis-consent-dialog__back,
.diagnosis-consent-dialog__agree { min-height: 42px; padding: 9px 25px; border-radius: 5px; font: inherit; cursor: pointer; }
.diagnosis-consent-dialog__back { border: 1px solid #947c66; background: #fff; color: #765d4b; }
.diagnosis-consent-dialog__back:disabled,
.diagnosis-consent-dialog__agree:disabled { border-color: #d2d2d2; background: #d2d2d2; color: #fff; cursor: not-allowed; }

.auth-card { width: 300px; padding: 20px; background: rgba(247,247,247,.97); box-shadow: 0 2px 5px rgba(60,44,30,.18); }
.auth-card--registration { width: 340px; }
.auth-card--confirm, .auth-card--message { width: 300px; }
.auth-card h1 { margin: 4px 0 18px; color: var(--accent-dark); text-align: center; font-size: 22px; font-weight: 500; }
.auth-card p { margin: 8px 0; font-size: 13px; line-height: 1.65; text-align: center; }
.auth-card-logo { display: block; width: 72px; height: 40px; margin: 0 auto; }
.auth-form { display: grid; gap: 12px; }
.form-field { display: grid; gap: 5px; }
.form-field label, .readonly-field span { font-size: 11px; color: #5c5651; }
.form-field input:not([type="checkbox"]), .readonly-field strong { width: 100%; min-height: 27px; padding: 5px 7px; border: 1px solid #bdbdbd; background: white; font: inherit; font-size: 12px; }
.form-field input:focus { outline: 2px solid rgba(111,151,177,.4); border-color: var(--accent); }
.password-field { position: relative; }
.password-field input { padding-right: 34px !important; }
.password-toggle { position: absolute; right: 3px; top: 50%; width: 28px; height: 25px; padding: 0; display: grid; place-items: center; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; }
.password-toggle img { width: 20px; height: 20px; display: block; }
.field-hint { margin: 0 !important; color: var(--muted); font-size: 10px !important; text-align: left !important; }
.field-error, .error-message { margin: 0 !important; color: var(--danger); font-size: 10px !important; text-align: left !important; }
.primary-button { display: block; width: 100%; margin-top: 12px; padding: 7px 10px; border: 0; background: var(--accent); color: white; text-align: center; text-decoration: none; font-size: 13px; cursor: pointer; }
.primary-button:hover { background: var(--accent-dark); }
.auth-link { display: block; margin-top: 9px; color: var(--accent-dark); text-align: center; font-size: 11px; }
.auth-link--left { text-align: left; }
.auth-link--prominent { font-size: 14px; text-decoration: none; }
.auth-link--text-button { margin-top: 14px; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.auth-divider { height: 1px; margin: 13px 0; background: #ccc; }
.auth-caption { margin: 0 !important; color: #777; font-size: 9px !important; }
.agreement-list { display: grid; gap: 8px; margin: 4px 0; }
.agreement-list label { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 10px; line-height: 1.4; }
.agreement-list label > span { display: flex; align-items: center; gap: 5px; }
.agreement-list label a,
.agreement-list label a img { display: block; flex: 0 0 auto; }
.agreement-list input { margin: 0; accent-color: #5ea47a; }
.confirmation-list { margin: 0 0 14px; font-size: 12px; }
.confirmation-list dt { margin-top: 10px; color: #5f5a55; }
.confirmation-list dd { margin: 3px 0 0; }
.readonly-field { margin: 12px 0; }
.readonly-field span { display: block; margin-bottom: 4px; }
.readonly-field strong { display: block; background: #d6d6d6; font-weight: 400; }
.flash-message { position: fixed; top: 90px; left: 50%; z-index: 5; transform: translateX(-50%); padding: 9px 18px; border-radius: 4px; background: #eef6fa; color: #365a70; font-size: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.15); opacity: 1; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.flash-message--alert { background: #fff0f0; color: #a12d2d; }
.flash-message--hiding { transform: translate(-50%, -8px); opacity: 0; }
.contract-page { max-width: 560px; margin: 80px auto; padding: 32px; background: white; text-align: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.diagnosis-guide,
.diagnosis-step-page,
.diagnosis-completed { width: min(980px, calc(100% - 40px)); margin: 0 auto; padding: 14px 0 24px; }
.diagnosis-guide h1,
.diagnosis-completed > h1 { margin: 0 0 12px; font-size: 28px; }
.diagnosis-guide__summary { min-height: 130px; padding: 24px; display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 15px; border: 2px solid #e3d8cf; border-radius: 8px; background: white; }
.diagnosis-guide__symbol { width: 76px; height: 76px; display: grid; place-items: center; }
.diagnosis-guide__summary-title { display: none; }
.diagnosis-guide__summary p { margin: 0; font-size: 17px; line-height: 1.6; }
.diagnosis-guide__summary p strong { font-size: 23px; }
.diagnosis-guide__facts {
  display: flex;
  gap: 10px;
}
.diagnosis-guide__facts .diagnosis-guide__facts-item {
  min-width: 180px;
  padding: 10px 20px;
  border: 2px solid #e3d8cf;
  border-radius: 7px;
  text-align: center;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.diagnosis-guide__facts span {
  font-size: 16px;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.diagnosis-guide__facts .diagnosis-guide__facts-item img {
  width: auto;
  height: 40px;
}
.diagnosis-guide__steps { margin: 14px 0; display: flex; align-items: center; gap: 13px; }
.diagnosis-guide__step { min-width: 0; flex: 1; min-height: 245px; height: stretch; height: -webkit-fill-available; padding: 20px 12px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; border: 2px solid #e3d8cf; border-radius: 7px; background: white; text-align: center; justify-content:space-between; }
.diagnosis-guide__step > span,
.diagnosis-progress li span,
.diagnosis-completed__steps span { padding: 4px 18px; border-radius: 999px; background: #947c66; color: white; font-size: 12px; }
.diagnosis-guide__placeholder { width: auto; height: 110px; object-fit: contain; }
.diagnosis-guide__step strong { width: 100%; padding-bottom: 10px; border-bottom: 2px dashed #e3d8cf; font-size: 17px; }
.diagnosis-guide__step small { color: #947c66; font-size: 15px; font-weight: 600; }
.diagnosis-guide__step--result { font-size: 12px; }
.diagnosis-guide__step--result small { color: #1E1C1C; font-size: 12px; font-weight: 500; text-align: left; }
.diagnosis-guide__arrow { width: 19px; height: 39px; flex: 0 0 auto; object-fit: contain; }
.diagnosis-guide__notice { padding: 18px 24px 12px; display: grid; grid-template-columns: 220px 1fr 1.3fr; gap: 28px; align-items: center; border: 2px solid #e3d8cf; border-radius: 7px; background: white; }
.diagnosis-guide__notice-title { min-height: 88px; display: flex; align-items: center; gap: 18px; border-right: 1px solid #ccc; font-size: 24px; }
.diagnosis-guide__notice-title span { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: #f2efec; font-size: 36px; }
.diagnosis-guide__notice ul { margin: 0; padding: 0; list-style-position: inside; line-height: 1.7; font-size: 14px; }
.diagnosis-guide__notice em { color: #d94545; font-style: normal; }
.diagnosis-guide__documents-note { padding-left: 28px; border-left: 1px solid #ccc; }
.diagnosis-guide__documents-note > p { margin: 0; font-size: 13px; line-height: 1.7; }
.diagnosis-guide__start { grid-column: 1 / -1; min-width: 270px; margin: 15px auto 0; padding: 11px 30px; border: 0; border-radius: 6px; background: #a18972; color: white; font-size: 24px; font-weight: 700; cursor: pointer; display: flex; align-items:center; justify-content: center; gap: 8px; }
.diagnosis-guide__start:disabled { background: #ccc; cursor: not-allowed; }
.diagnosis-guide__start img { width: auto; height: 23px; }
.diagnosis-guide__error,
.diagnosis-guide__expired { margin: 0; color: #b33b35; font-size: 12px; }
.diagnosis-confirmation { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(48, 44, 41, .48); }
.diagnosis-confirmation__card { position: relative; width: min(520px, 100%); padding: 30px; border-radius: 8px; background: white; box-shadow: 0 8px 30px rgba(0, 0, 0, .22); text-align: center; }
.diagnosis-confirmation__close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #675d56; font-size: 28px; line-height: 1; cursor: pointer; }
.diagnosis-confirmation__close:hover { background: #eee8e3; }
.diagnosis-confirmation__card h2 { margin: 0 0 18px; font-size: 22px; }
.diagnosis-confirmation__card p { line-height: 1.8; }
.diagnosis-confirmation__actions { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.diagnosis-confirmation__actions form { margin: 0; }

.diagnosis-step-page__heading h1 { margin: 0; font-size: 27px; font-weight: 600; }
.diagnosis-step-page__heading p { margin: 2px 0 18px; font-size: 15px; }
.diagnosis-progress { margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 75px; list-style: none; }
.diagnosis-progress li { position: relative; display: flex; align-items: center; gap: 12px; color: #bbb; }
.diagnosis-progress li:not(:last-child)::after { content: ""; position: absolute; left: calc(100% + 10px); width: 55px; border-top: 2px dashed #ccc; }
.diagnosis-progress li.is-complete,
.diagnosis-progress li.is-current { color: var(--ink); }
.diagnosis-progress li.is-complete:not(:last-child)::after,
.diagnosis-progress li.is-current:not(:last-child)::after { border-color: #947c66; }
.diagnosis-progress__icon { width: 70px; height: 70px; display: block; object-fit: contain; }
.diagnosis-progress li > div:last-child { display: grid; gap: 7px; }
.diagnosis-progress li span { width: max-content; }
.diagnosis-progress li strong { font-size: 18px; }
.question-chips { margin-bottom: 20px; display: grid; grid-template-columns: repeat(10, 1fr); gap: 10px; }
.question-chip { height: 30px; border: 1px solid transparent; border-radius: 7px; background: white; color: #bbb; font: inherit; font-weight: 700; cursor: pointer; }
.question-chip span { display: none; }
.question-chip.is-answered { background: #ebe5df; color: #947c66; }
.question-chip.is-answered span { display: inline; }
.question-chip.is-current { border: 2px solid #947c66; }
.diagnosis-answer-form { margin: 0; }
.diagnosis-questions { height: 55vh; padding: 22px 24px; overflow-y: auto; border: 2px solid #e1d6cd; border-radius: 8px; background: white; scroll-behavior: smooth; scroll-padding-top: 20px; }
.diagnosis-question { min-width: 0; margin: 0 0 10px; padding: 11px 18px; display: grid; grid-template-columns: 56px minmax(145px, 1.35fr) minmax(550px, 4fr); align-items: center; gap: 14px; border: 2px solid #e1d6cd; border-radius: 8px; background: #fff; }
.diagnosis-question.is-current { background: #f8f5f3; }
.diagnosis-question__number { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: #e8e0d9; color: #947c66; font-weight: 700; }
.diagnosis-question__text { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.45; }
.diagnosis-question__choices { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.diagnosis-question__choices label { min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.25; cursor: pointer; }
.diagnosis-question__choices input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: #947c66; }
.diagnosis-question__choices input:focus-visible { outline: 3px solid rgba(148, 124, 102, .35); outline-offset: 2px; }
.diagnosis-save-status { height: 18px; margin: 2px 0 0; color: #6f7b70; text-align: right; font-size: 11px; }
.diagnosis-step-error { margin: 0 0 6px; color: #b33b35; text-align: right; font-size: 12px; }
.diagnosis-step-actions { display: grid; grid-template-columns: 350px 350px; justify-content: space-between; gap: 30px; }
.diagnosis-primary-button,
.diagnosis-secondary-button { width: 100%; min-height: 56px; padding: 10px 24px; display: grid; place-items: center; border-radius: 6px; font: inherit; font-size: 22px; font-weight: 700; text-decoration: none; cursor: pointer; }
.diagnosis-primary-button { border: 2px solid #a18972; background: #a18972; color: white; }
.diagnosis-primary-button:disabled { border-color: #c2c2c2; background: #c2c2c2; cursor: not-allowed; }
.diagnosis-secondary-button { border: 2px solid #a18972; background: transparent; color: #a18972; }

.diagnosis-completed > p { margin: -8px 0 18px; }
.diagnosis-completed__card { width: min(810px, 100%); margin: 0 auto; padding: 36px 58px 28px; border: 2px solid #e1d6cd; border-radius: 8px; background: white; text-align: center; }
.diagnosis-completed__logo { width: 400px; max-width: 100%; height: auto; margin: 0 auto; display: block; }
.diagnosis-completed__steps { margin: 22px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.diagnosis-completed__steps > .diagnosis-completed__step { min-height: 100px; padding: 13px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 2px solid #e1d6cd; border-radius: 7px; background: #faf8f6; }
.diagnosis-completed__step-icon { width: 70px; height: 70px; flex: 0 0 auto; object-fit: contain; }
.diagnosis-completed__step-status { display: grid; justify-items: center; gap: 6px; }
.diagnosis-completed__steps strong { font-size: 26px; line-height: 1; }
.diagnosis-completed__card > p { font-size: 16px; line-height: 1.9; }
.diagnosis-completed__retention { margin: 18px 0; padding: 14px 24px; display: grid; gap: 8px; border: 2px solid #e1d6cd; border-radius: 7px; background: #faf8f6; }
.diagnosis-completed__retention-item { width: fit-content; max-width: 100%; margin: 0 auto; display: flex; align-items: center; gap: 12px; font-size: 16px; }
.diagnosis-completed__retention-item > img { width: 21px; height: 24px; flex: 0 0 auto; }
.diagnosis-completed__retention-item > p { min-width: 0; margin: 0; display: grid; grid-template-columns: 5em 1em auto; text-align: left; line-height: 1.5; }
.diagnosis-completed__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.diagnosis-completed__actions form { margin: 0; }

.diagnosis-result-page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 14px 0 24px; }
.diagnosis-result-page__heading h1 { margin: 0; font-size: 28px; }
.diagnosis-result-page__heading p { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.result-summary,
.result-advice { border: 2px solid #e1d6cd; border-radius: 8px; background: white; }
.result-summary { padding: 12px 13px; }
.result-summary__top { min-height: 108px; display: grid; grid-template-columns: 1fr 1.25fr 1.55fr 2.5fr; align-items: stretch; }
.result-summary__item { padding: 4px 20px; display: grid; grid-template-rows: auto minmax(0, 1fr); align-items: stretch; gap: 0; border-right: 1px solid #ccc; text-align: center; }
.result-summary__item > span,
.result-summary__drink > span { align-self: start; text-align: center; font-size: 15px; font-weight: 600; }
.result-summary__content { min-height: 0; display: grid; place-items: center; align-content: center; gap: 13px; text-align: center; }
.result-summary__item .result-summary__content > strong { font-size: 19px; }
.result-summary__overall .result-summary__content > strong b { color: #9a7e65; font-size: 31px; font-weight: 500; }
.result-summary__overall em { padding: 3px 12px; border: 1px solid #d7cec6; border-radius: 3px; background: #f5f2ef; font-size: 12px; font-style: normal; }
.result-summary__type strong { display: flex; align-items: center; gap: 8px; font-size: 18px; white-space: nowrap; }
.result-summary__type-icon { width: 28px; height: 28px; object-fit: contain; }
.result-summary__drink { padding: 4px 12px 4px 48px; display: grid; grid-template-rows: auto minmax(0, 1fr); align-items: stretch; gap: 8px; }
.result-summary__drink > .result-summary__drink-card { min-height: 78px; padding: 7px 14px; display: flex; align-items: center; justify-content: flex-start; gap: 22px; border: 1px solid #ded3ca; border-radius: 3px; background: #fcfaf8; }
.result-summary__drink-icon { width: 56px; height: 56px; flex: 0 0 auto; display: grid; place-items: center; border: 2px solid #e1d6cd; border-radius: 50%; background: #f2efec; }
.result-summary__drink-icon img { width: 40px; height: 40px; object-fit: contain; }
.result-summary__drink p { margin: 0; display: grid; gap: 2px; }
.result-summary__drink p strong { font-size: 20px; }
.result-summary__drink p small { font-size: 12px; line-height: 1.45; }
.result-step-scores { margin-top: 10px; padding-top: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; border-top: 1px dashed #d8cec6; }
.result-step-score { min-height: 44px; padding: 8px 32px; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; border: 1px solid #ded3ca; border-radius: 6px; background: #fdfcfa; }
.result-step-score > strong { font-size: 16px; white-space: nowrap; }
.result-step-score > span { white-space: nowrap; font-size: 12px; }
.result-step-score > span b { color: #9a7e65; font-size: 25px; font-weight: 500; }
.result-step-score progress { width: 100%; height: 9px; border: 0; border-radius: 0; background: #ddd; accent-color: #9a7e65; }
.result-step-score progress::-webkit-progress-bar { background: #ddd; }
.result-step-score progress::-webkit-progress-value { background: #9a7e65; }
.result-step-score progress::-moz-progress-bar { background: #9a7e65; }
.result-advice { margin-top: 14px; padding: 14px 18px 18px; }
.result-advice h2 { margin: 0 0 9px; font-size: 21px; }
.result-advice__cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.result-advice__cards article { min-height: 160px; padding: 15px; display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 12px; border: 2px solid #e1d6cd; border-radius: 8px; }
.result-advice__cards img { width: 82px; height: 82px; }
.result-advice__cards h3 { margin: 0 0 9px; font-size: 18px; font-weight: 600; }
.result-advice__cards p { margin: 0; font-size: 14px; line-height: 1.7; }
.result-saved-message { margin: 14px 0; padding: 15px 18px; border: 2px solid #e1d6cd; border-radius: 8px; background: #f5f1ee; font-size: 16px; }
.result-saved-message:first-letter { color: #9a7e65; }
.result-actions { width: 800px; max-width: 100%; margin: 14px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.result-actions--guest { width: 400px; grid-template-columns: 1fr; }

.mypage { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 14px 0 38px; }
.mypage-header { margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.mypage-header > h1 { font-size: 28px; }
.mypage-profile,
.mypage-latest,
.mypage-history { border: 2px solid #e1d6cd; border-radius: 8px; background: white; }
.mypage-profile { min-height: 102px; padding: 8px 22px; display: grid; grid-template-columns: 82px minmax(280px, 1fr) minmax(360px, 1.45fr); align-items: center; gap: 20px; }
.mypage-profile__avatar { width: 80px; height: 80px; }
.mypage-profile__identity h2 { margin: 0 0 5px; font-size: 20px; }
.mypage-profile__identity p { margin: 3px 0; color: #5f5a55; font-size: 14px; }
.mypage-profile__actions { display: flex; align-items: center; justify-content: flex-end; gap: 20px; }
.mypage-resume-link { color: #65a9d8; font-size: 13px; text-align: center; }
.mypage-button { min-height: 50px; padding: 10px 22px; display: grid; place-items: center; border-radius: 6px; font-size: 19px; font-weight: 700; text-align: center; text-decoration: none; }
.mypage-button--primary { min-width: 250px; background: #a18972; color: white; }
.mypage-button--secondary { min-width: 228px; border: 1px solid #a18972; color: #a18972; background: white; }
.mypage-draft { max-width: 560px; display: grid; grid-template-columns: minmax(230px, 1fr) auto; align-items: center; gap: 4px 16px; }
.mypage-draft strong { font-size: 15px; }
.mypage-draft p { margin: 0; color: #746e69; font-size: 12px; line-height: 1.5; }
.mypage-draft .mypage-button { grid-column: 2; grid-row: 1 / span 2; min-width: 165px; font-size: 16px; }
.mypage-latest { margin-top: 14px; padding: 12px 13px; }
.mypage-latest > header { display: flex; align-items: center; gap: 9px; }
.mypage-latest h2,
.mypage-history h2 { margin: 0; font-size: 19px; }
.mypage-latest > header span { padding: 3px 10px; border: 1px solid #d8cec6; border-radius: 3px; background: #f5f2ef; font-size: 11px; }
.mypage-latest__summary { min-height: 112px; display: grid; grid-template-columns: 1.05fr 1.1fr 1.65fr 2.4fr; align-items: stretch; }
.mypage-latest__summary > div { padding: 12px 22px; display: grid; grid-template-rows: auto minmax(0, 1fr); align-items: stretch; gap: 0; border-right: 1px solid #ccc; text-align: center; }
.mypage-latest__summary > div:last-child { border-right: 0; }
.mypage-latest__summary > div > span { align-self: start; text-align: center; font-size: 13px; font-weight: 600; }
.mypage-latest__summary strong { font-size: 18px; }
.mypage-latest__summary em { padding: 3px 11px; border: 1px solid #d8cec6; border-radius: 3px; background: var(--stress-level-background, #f5f2ef); font-size: 11px; font-style: normal; }
.mypage-score { color: #9a7e65; font-size: 30px !important; font-weight: 500; }
.mypage-score small { margin-left: 5px; color: #302c29; font-size: 12px; }
.mypage-latest__summary .mypage-latest__drink { align-items: stretch; text-align: left; }
.mypage-latest__summary .result-summary__drink > span { font-size: 15px; }
.mypage-latest__summary .result-summary__drink p strong { font-size: 20px; }
.mypage-latest__summary .result-summary__drink p small { color: inherit; font-size: 12px; line-height: 1.45; }
.mypage-latest__steps { padding-top: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; border-top: 1px dashed #d8cec6; }
.mypage-latest__steps > div { min-height: 44px; padding: 8px 32px; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 9px; border: 1px solid #ded3ca; border-radius: 6px; background: #fdfcfa; }
.mypage-latest__steps strong { white-space: nowrap; font-size: 15px; }
.mypage-latest__steps span { white-space: nowrap; font-size: 11px; }
.mypage-latest__steps b { color: #9a7e65; font-size: 24px; font-weight: 500; }
.mypage-latest__steps progress { width: 100%; height: 8px; border: 0; background: #ddd; accent-color: #9a7e65; }
.mypage-latest__steps progress::-webkit-progress-bar { background: #ddd; }
.mypage-latest__steps progress::-webkit-progress-value { background: #9a7e65; }
.mypage-latest__steps progress::-moz-progress-bar { background: #9a7e65; }
.mypage-history { margin-top: 14px; padding: 12px; }
.mypage-history h2 { margin-bottom: 8px; }
.mypage-history__scroll { max-height: 246px; overflow: auto; }
.mypage-history table { width: 100%; border-collapse: collapse; font-size: 11px; }
.mypage-history th,
.mypage-history td { padding: 6px 8px; border: 1px solid #dfd7d1; text-align: center; white-space: nowrap; }
.mypage-history th { position: sticky; top: 0; z-index: 1; background: #f0edeb; font-size: 12px; }
.mypage-history__label { margin-left: 5px; padding: 2px 7px; border-radius: 3px; background: var(--stress-level-background, #f1e8df); }
.stress-level--low { --stress-level-background: #BDD7FF; }
.stress-level--slightly-low { --stress-level-background: #E3EBF7; }
.stress-level--normal { --stress-level-background: #D3EBC9; }
.stress-level--slightly-high { --stress-level-background: #FFECDE; }
.stress-level--high { --stress-level-background: #FFD9C6; }
.mypage-history__steps { font-size: 10px; }
.mypage-history__steps > span { white-space: nowrap; }
.mypage-detail-link { padding: 3px 9px; border: 1px solid #b9aea5; border-radius: 5px; text-decoration: none; }
.mypage-empty { margin-top: 14px; padding: 14px 18px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 14px; border: 2px dashed #e1d6cd; border-radius: 8px; background: rgba(255,255,255,.72); }
.mypage-empty > span { font-size: 31px; }
.mypage-empty h2 { margin: 0 0 3px; font-size: 17px; }
.mypage-empty p { margin: 0; color: #aaa29c; font-size: 15px; }
.mypage-profile__avatar { border-radius: 50%; object-fit: cover; border: 1px solid #ccc; }
.mypage-account-links { width: auto; display: flex; justify-content: flex-end; gap: 25px; font-size: 13px; text-decoration: none; }
.mypage-account-links a { border-bottom: 1px solid #1E1C1C; transition:all .2s ease-in-out; font-weight: 500; }
.mypage-account-links a:hover { color: #5b7282; border-bottom: 0; }

.account-overlay { position: fixed; inset: 0; z-index: 30; padding: 90px 20px 30px; display: grid; place-items: start center; align-items:center; overflow-y: auto; background: rgba(48, 44, 41, .68); }
.account-card { width: min(430px, 100%); padding: 25px 20px 20px; background: #fff; box-shadow: 0 9px 30px rgba(0, 0, 0, .18); text-align: center; }
.account-card--wide { width: min(520px, 100%); }
.account-card h1 { margin: 0 0 20px; color: #6c99b8; font-size: 24px; font-weight: 500; }
.account-card p { line-height: 1.7; }
.account-settings-list { margin: 0; text-align: left; }
.account-settings-list > div { min-height: 46px; display: grid; grid-template-columns: 1fr 2.5fr 52px; align-items: center; gap: 8px; }
.account-settings-list dt { font-size: 13px; }
.account-settings-list dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; }
.account-small-button { padding: 6px 10px; background: #6c99b8; color: #fff; text-align: center; text-decoration: none; }
.account-close-link { margin-top: 20px; display: inline-block; color: #477f9f; text-decoration: none; font-weight: 500; }
.account-form { display: grid; gap: 7px; text-align: left; }
.account-form label { margin-top: 7px; font-size: 13px; }
.account-form input[type="text"],
.account-form input[type="email"],
.account-form input[type="password"],
.account-form textarea { width: 100%; padding: 8px; border: 1px solid #c9c9c9; background: #fff; }
.account-form textarea { resize: vertical; }
.account-submit { width: 100%; min-height: 40px; margin-top: 18px; padding: 9px 15px; display: grid; place-items: center; border: 0; background: #6c99b8; color: #fff; text-align: center; text-decoration: none; cursor: pointer; }
.account-current-value { padding: 9px; background: #f7f5f3; font-size: 13px; }
.account-form-actions { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.account-cancel-button,
.account-delete-button { min-height: 38px; display: grid; place-items: center; border: 0; color: #fff; text-decoration: none; cursor: pointer; width: 100%; font-weight: 600; }
.account-cancel-button { background: #6c99b8; }
.account-delete-button { background: #EB4D4B; }
.withdrawal-warning,
.contact-demo-notice { color: #ef4f55; }
.account-danger-link { margin: 18px auto 0; padding: 0; border: 0; background: none; color: #ef4f55; cursor: pointer; display:block; font-weight: 500; }
.account-link-button { border: 0; background: none; cursor: pointer; }
.avatar-error { white-space: pre-line; color: #ef4f55; font-size: 12px; }
.avatar-file-picker { width: 240px; height: 200px; margin: 0 auto; display: grid; place-items: center; align-content: center; gap: 6px; border: 2px dashed #ccc; color: #aaa; cursor: pointer; }
.avatar-file-picker > span { font-size: 70px; font-weight: 200; line-height: .8; }
.avatar-file-picker small { font-size: 10px; line-height: 1.6; }
.avatar-file-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.avatar-preview { margin-top: 15px; }
.avatar-preview canvas { width: 240px; height: 240px; border-radius: 50%; background: #ddd; cursor: move; touch-action: none; margin: 0 auto; }
.avatar-preview label { margin: 12px auto 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.avatar-preview p { margin: 5px 0; color: #777; font-size: 11px; }
.contact-confirmation { text-align: left; }
.contact-confirmation dt { margin-top: 12px; font-size: 12px; }
.contact-confirmation dd { margin: 4px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.mypage-history__actions { display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.mypage-delete-link { padding: 4px 9px; border-radius: 3px; background: #e75b5b; color: white; text-decoration: none; }
.mypage-delete-link:hover { background: #c94545; }
.history-delete-card { width: min(430px, 100%); text-align: center; }
.history-delete-card__warning { color: #b33535; font-size: 12px !important; font-weight: 700; }

@media (max-width: 1023px) {
  .site-header { grid-template-columns: 200px 1fr 230px; }
  .brand img { width: 190px; }
  .site-navigation { gap: 24px; font-size: 15px; }
  .diagnosis-guide__summary { grid-template-columns: 65px 1fr; }
  .diagnosis-guide__facts { grid-column: 1 / -1; justify-content: center; }
  .diagnosis-guide__steps { gap: 7px; }
  .diagnosis-guide__arrow { width: 14px; height: auto; }
  .diagnosis-guide__notice { grid-template-columns: 180px 1fr; }
  .diagnosis-guide__documents-note { grid-column: 1 / -1; padding: 12px 0 0; border-top: 1px solid #ccc; border-left: 0; }
  .diagnosis-question { grid-template-columns: 52px 1fr; }
  .diagnosis-question__choices { grid-column: 2; min-width: 0; }
  .diagnosis-step-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .result-summary__top { grid-template-columns: repeat(3, 1fr); }
  .result-summary__drink { grid-column: 1 / -1; padding: 14px 0 0; }
  .result-summary__drink > div { justify-content: center; }
  .result-step-score { padding: 8px 14px; grid-template-columns: auto auto; }
  .result-step-score progress { grid-column: 1 / -1; }
  .result-advice__cards article { grid-template-columns: 65px 1fr; }
  .result-advice__cards img { width: 60px; height: 60px; }
  .mypage-profile { grid-template-columns: 75px 1fr; }
  .mypage-profile__actions { grid-column: 1 / -1; justify-content: center; padding-bottom: 8px; }
  .mypage-latest__summary { grid-template-columns: repeat(3, 1fr); }
  .mypage-latest__summary .mypage-latest__drink { grid-column: 1 / -1; place-items: center; gap: 10px; border-top: 1px solid #ddd; text-align: center; }
  .mypage-latest__steps > div { padding: 8px 14px; grid-template-columns: auto auto; }
  .mypage-latest__steps progress { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
  .site-header { height: auto; min-height: 72px; grid-template-columns: 1fr auto; padding: 8px 12px; }
  .brand img { width: 130px; height: auto; }
  .site-navigation { grid-column: 1 / -1; grid-row: 2; gap: 22px; padding-top: 6px; font-size: 13px; }
  .header-button, .site-session-link .header-button { min-width: auto; padding: 6px 7px; font-size: 12px; }
  .auth-page .page-content { min-height: calc(100vh - 132px); padding: 24px 14px; align-items: flex-start; }
  .auth-card, .auth-card--registration, .auth-card--confirm, .auth-card--message { width: min(100%, 360px); }
  .site-footer nav { flex-wrap: wrap; gap: 6px 14px; }
  .top-hero { min-height: 100vh; padding: 24px 18px; }
  .top-hero__logo { width: 280px; margin-bottom: 25px; }
  .top-hero__start { min-width: 0; width: min(330px, calc(100% - 16px)); padding: 14px 18px; font-size: 30px; }
  .top-hero__facts { margin-top: 0; padding: 6px 18px; font-size: 15px; width: 100%; }
  .top-hero__copy { font-size: 18px; }
  .legal-dialog { height: calc(100vh - 24px); }
  .legal-dialog__header { padding: 15px 16px 12px; }
  .legal-dialog__header h1 { font-size: 19px; }
  .legal-dialog__body { padding: 18px 17px; }
  .diagnosis-consent-dialog .legal-dialog__header h2 { font-size: 19px; }
  .diagnosis-consent-dialog__progress { padding: 10px 12px; gap: 8px; }
  .diagnosis-consent-dialog__progress li { font-size: 10px; }
  .diagnosis-consent-dialog__footer { grid-template-columns: 1fr 1fr; gap: 12px; }
  .diagnosis-consent-dialog__back,
  .diagnosis-consent-dialog__agree { min-width: 0; padding: 9px 12px; }
  .diagnosis-guide,
  .diagnosis-step-page,
  .diagnosis-completed { width: min(100% - 24px, 620px); padding-top: 18px; }
  .diagnosis-result-page { width: min(100% - 24px, 620px); padding-top: 18px; }
  .diagnosis-guide h1,
  .diagnosis-completed > h1,
  .diagnosis-step-page__heading h1 { font-size: 22px; }
  .diagnosis-guide__summary { padding: 18px; grid-template-columns: 52px 1fr; gap: 13px; }
  .diagnosis-guide__symbol { width: 52px; height: 52px; font-size: 25px; }
  .diagnosis-guide__summary p,
  .diagnosis-guide__summary p strong { font-size: 15px; }
  .diagnosis-guide__facts { flex-wrap: wrap; }
  .diagnosis-guide__facts span { min-width: 130px; flex: 1; font-size: 14px; }
  .diagnosis-guide__steps { overflow-x: auto; align-items: stretch; }
  .diagnosis-guide__step { min-width: 180px; }
  .diagnosis-guide__notice { padding: 16px; grid-template-columns: 1fr; gap: 14px; }
  .diagnosis-guide__notice-title { min-height: auto; border-right: 0; border-bottom: 1px solid #ccc; padding-bottom: 12px; }
  .diagnosis-guide__documents-note { padding-top: 12px; }
  .diagnosis-progress { gap: 7px; }
  .diagnosis-progress li { display: grid; justify-items: center; text-align: center; }
  .diagnosis-progress li:not(:last-child)::after { display: none; }
  .diagnosis-progress__icon { width: 48px; height: 48px; }
  .diagnosis-progress li > div:last-child { justify-items: center; }
  .diagnosis-progress li strong { font-size: 13px; }
  .diagnosis-progress li span { padding: 3px 9px; font-size: 10px; }
  .question-chips { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .diagnosis-questions { height: 55vh; min-height: 360px; padding: 12px; }
  .diagnosis-question { padding: 12px; grid-template-columns: 42px 1fr; gap: 10px; }
  .diagnosis-question__number { width: 40px; height: 40px; }
  .diagnosis-question__choices { grid-column: 1 / -1; grid-template-columns: 1fr; padding-left: 52px; }
  .diagnosis-question__choices label { min-height: 34px; font-size: 13px; }
  .diagnosis-step-actions,
  .diagnosis-completed__actions { grid-template-columns: 1fr; gap: 12px; }
  .diagnosis-primary-button,
  .diagnosis-secondary-button { min-height: 48px; font-size: 17px; }
  .diagnosis-completed__card { padding: 25px 16px; }
  .diagnosis-completed__logo { width: 280px; }
  .diagnosis-completed__steps { grid-template-columns: 1fr; }
  .diagnosis-completed__steps > .diagnosis-completed__step { width: min(100%, 300px); margin: 0 auto; }
  .diagnosis-completed__retention { padding: 14px; }
  .diagnosis-completed__retention-item { width: 100%; align-items: start; gap: 9px; font-size: 14px; }
  .diagnosis-completed__retention-item > p { flex: 1; grid-template-columns: 5em 1em minmax(0, 1fr); }
  .diagnosis-confirmation__actions { grid-template-columns: 1fr; }
  .diagnosis-result-page__heading h1 { font-size: 22px; }
  .diagnosis-result-page__heading p { font-size: 13px; }
  .result-summary__top { grid-template-columns: 1fr 1fr; }
  .result-summary__item { min-height: 105px; padding: 8px; }
  .result-summary__type { grid-column: 1 / -1; border-top: 1px solid #ddd; }
  .result-summary__drink { grid-column: 1 / -1; }
  .result-summary__drink > div { gap: 12px; }
  .result-step-scores,
  .result-advice__cards { grid-template-columns: 1fr; }
  .result-step-score { grid-template-columns: auto auto 1fr; }
  .result-step-score progress { grid-column: auto; }
  .result-advice { padding: 14px 12px; }
  .result-advice__cards article { min-height: 130px; }
  .result-actions { grid-template-columns: 1fr; gap: 12px; }
  .mypage { width: min(100% - 24px, 620px); padding-top: 18px; }
  .mypage > h1 { font-size: 22px; }
  .mypage-profile { padding: 15px; grid-template-columns: 60px 1fr; gap: 12px; }
  .mypage-profile__avatar { width: 58px; height: 58px; }
  .mypage-profile__identity h2 { font-size: 17px; }
  .mypage-profile__identity p { overflow-wrap: anywhere; font-size: 12px; }
  .mypage-profile__actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .mypage-button,
  .mypage-button--primary,
  .mypage-button--secondary { width: 100%; min-width: 0; min-height: 46px; font-size: 16px; }
  .mypage-draft { grid-template-columns: 1fr; text-align: left; }
  .mypage-draft .mypage-button { grid-column: 1; grid-row: auto; margin-top: 6px; }
  .mypage-latest__summary { grid-template-columns: 1fr 1fr; }
  .mypage-latest__summary > div { min-height: 100px; padding: 8px; }
  .mypage-latest__summary > div:nth-child(2) { border-right: 0; }
  .mypage-latest__summary > div:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid #ddd; border-right: 0; }
  .mypage-latest__steps { grid-template-columns: 1fr; }
  .mypage-latest__steps > div { grid-template-columns: auto auto 1fr; }
  .mypage-latest__steps progress { grid-column: auto; }
  .mypage-history__scroll { max-height: 52vh; }
  .mypage-history table { min-width: 960px; }
  .mypage-empty { grid-template-columns: 30px 1fr; }
  .mypage-empty .mypage-button { grid-column: 1 / -1; }
  .mypage-account-links { justify-content: center; flex-wrap: wrap; gap: 12px 20px; }
  .account-overlay { padding: 75px 12px 20px; }
  .account-card { padding: 22px 16px 18px; }
  .account-settings-list > div { grid-template-columns: 1fr 1.8fr 50px; }
  .account-form-actions { gap: 10px; }
}

/* Mobile usability: shared layout, typography, touch, and viewport behavior. */
@media (max-width: 767px), (orientation: landscape) and (max-width: 900px) and (max-height: 500px) {
  body { font-size: 16px; }

  .page-content {
    min-height: calc(100svh - 194px);
  }

  .site-header {
    height: 64px;
    min-height: 64px;
    padding: 6px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .brand {
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .brand img { width: clamp(112px, 36vw, 138px); }

  .site-navigation,
  .site-session-link { display: none; }

  .mobile-menu {
    display: block;
    justify-self: end;
  }

  .mobile-menu__toggle {
    position: relative;
    z-index: 42;
    width: 48px;
    height: 48px;
    padding: 12px 10px;
    display: grid;
    align-content: center;
    gap: 5px;
    cursor: pointer;
  }

  .mobile-menu__toggle-line {
    width: 100%;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: #765346;
    transform-origin: center;
    transition: transform .22s ease, opacity .16s ease;
  }

  .mobile-menu__toggle.is-open .mobile-menu__toggle-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mobile-menu__toggle.is-open .mobile-menu__toggle-line:nth-child(2) { opacity: 0; }
  .mobile-menu__toggle.is-open .mobile-menu__toggle-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .mobile-menu__overlay {
    position: fixed;
    z-index: 40;
    inset: 0;
    background: rgba(30, 28, 28, .58);
    backdrop-filter: blur(2px);
    overscroll-behavior: contain;
  }

  .mobile-menu__overlay[hidden] { display: none; }

  .site-header:has(.mobile-menu__overlay:not([hidden])) { z-index: 50; }

  .mobile-menu__panel {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(86vw, 360px);
    height: 100dvh;
    padding: max(84px, calc(env(safe-area-inset-top) + 72px)) 20px max(24px, env(safe-area-inset-bottom));
    overflow-y: auto;
    background:
      radial-gradient(circle at 100% 0, rgba(161, 137, 114, .18), transparent 38%),
      #fbf8f4;
    border-left: 1px solid #b9a38f;
    box-shadow: -8px 0 24px rgba(30, 28, 28, .2);
    overscroll-behavior: contain;
  }

  .mobile-menu__heading {
    margin: 0 4px 26px;
    padding-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #d8cec6;
    color: #765346;
  }

  .mobile-menu__heading-icon {
    width: 34px;
    height: 42px;
    flex: 0 0 auto;
    object-fit: contain;
  }
  .mobile-menu__heading div { display: grid; gap: 2px; }
  .mobile-menu__heading strong { font-size: 19px; letter-spacing: .08em; }
  .mobile-menu__heading small { color: #8d8178; font-size: 10px; letter-spacing: .12em; }

  .mobile-menu__navigation { display: grid; gap: 8px; }
  .mobile-menu__navigation form { margin: 0; }
  .mobile-menu__navigation a,
  .mobile-menu__logout {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    border-bottom: 1px solid #d8cec6;
    background: transparent;
    color: #2f2b28;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  .mobile-menu__navigation a::after,
  .mobile-menu__logout::after {
    content: "›";
    color: #a18972;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
  }

  .mobile-menu__navigation a:active,
  .mobile-menu__logout:active { background: #f0e9e2; }
  .mobile-menu__navigation .mobile-menu__danger { color: #b34444; }
  body.mobile-menu-open { overflow: hidden; }

  .site-footer {
    min-height: 0;
    padding: 8px 12px 10px;
    display: grid;
    justify-items: center;
    gap: 7px;
    justify-content: center;
  }

  .site-footer nav {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0 10px;
    flex-direction: column;
    align-items: center;
    align-content: center;
  }

  .site-footer nav span { display: none; }
  .site-footer a {
    min-inline-size: 44px;
    min-height: 44px;
    padding: 7px 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border: 0;
  }

  .site-footer__brand {
    width: min(62vw, 220px);
    min-height: 64px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .site-footer__brand img {
    width: 100%;
    height: auto;
    display: block;
  }

  .site-footer small { font-size: 10px; line-height: 1.5; }

  .top-hero {
    min-height: 100svh;
    padding: 0;
  }

  .top-hero__content {
    height: 100%;
    min-height: calc(100svh - clamp(44px, 12vh, 96px));
  }

  .top-hero__logo { width: 100%; }
  .top-hero__start {
    width: 90%;
    min-height: 96px;
    height: clamp(7.5rem, 21vh, 7rem);
  }

  .auth-page .page-content {
    min-height: calc(100svh - 194px);
    padding: 20px 12px 28px;
  }

  .auth-card,
  .auth-card--registration,
  .auth-card--confirm,
  .auth-card--message {
    width: min(100%, 390px);
    padding: 20px clamp(16px, 5vw, 24px);
  }

  .auth-card h1 { font-size: clamp(20px, 6vw, 23px); }
  .auth-card p,
  .confirmation-list { font-size: 14px; }
  .form-field { gap: 7px; }
  .form-field label,
  .readonly-field span { font-size: 14px; }
  .form-field input:not([type="checkbox"]),
  .readonly-field strong {
    min-height: 44px;
    padding: 9px 11px;
    font-size: 16px;
  }

  .password-field input { padding-right: 50px !important; }
  .password-toggle {
    right: 0;
    width: 44px;
    height: 44px;
  }

  .field-hint,
  .field-error,
  .error-message { font-size: 13px !important; line-height: 1.5; }
  .primary-button {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
  }

  .auth-link {
    min-height: 44px;
    margin-top: 4px;
    padding: 10px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
  }

  .auth-link--left { justify-content: flex-start; }
  .agreement-list { gap: 4px; }
  .agreement-list label { min-height: 44px; font-size: 14px; }
  .agreement-list input { width: 20px; height: 20px; }
  .auth-caption { font-size: 11px !important; line-height: 1.55; }

  .legal-dialog {
    width: calc(100% - 20px);
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    overscroll-behavior: contain;
  }

  .legal-dialog__header { min-height: 64px; }
  .legal-dialog__close,
  .diagnosis-confirmation__close {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .legal-dialog__body {
    padding: 16px;
    overscroll-behavior: contain;
  }

  .legal-dialog__body p { font-size: 14px; line-height: 1.8; }
  .legal-dialog__footer {
    padding: 10px 14px max(12px, env(safe-area-inset-bottom));
  }
  .legal-dialog__button,
  .diagnosis-consent-dialog__back,
  .diagnosis-consent-dialog__agree { min-height: 44px; font-size: 15px; }
  .diagnosis-consent-dialog__progress li { font-size: 11px; }

  .diagnosis-guide,
  .diagnosis-step-page,
  .diagnosis-completed,
  .diagnosis-result-page,
  .mypage { width: min(calc(100% - 24px), 620px); }

  .diagnosis-guide { padding-bottom: clamp(110px, 18vh, 160px); }

  .diagnosis-guide__summary {
    padding: 14px;
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas:
      "symbol title"
      "description description"
      "facts facts";
    gap: 10px 12px;
    align-items: center;
  }

  .diagnosis-guide__symbol {
    grid-area: symbol;
    width: 72px;
    height: 72px;
  }

  .diagnosis-guide__summary-title {
    grid-area: title;
    margin: 0;
    display: block;
    font-size: 20px;
    line-height: 1.4;
  }

  .diagnosis-guide__summary > p {
    grid-area: description;
    font-size: 15px;
    line-height: 1.7;
  }

  .diagnosis-guide__summary > p br { display: none; }

  .diagnosis-guide__facts {
    grid-area: facts;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .diagnosis-guide__facts .diagnosis-guide__facts-item {
    min-width: 0;
    padding: 8px 5px;
    gap: 5px;
  }

  .diagnosis-guide__facts .diagnosis-guide__facts-item img { height: 34px; }
  .diagnosis-guide__facts span { min-width: 0; font-size: 13px; }

  .diagnosis-guide__start { min-height: 52px; font-size: 20px; }
  .diagnosis-guide__steps {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    overflow: visible;
  }
  .diagnosis-guide__step {
    width: 100%;
    min-width: 0;
    min-height: 270px;
    scroll-snap-align: none;
    text-align: center;
  }

  .diagnosis-guide__placeholder { height: 140px; }
  .diagnosis-guide__step--result small { text-align: center; }
  .diagnosis-guide__arrow {
    justify-self: center;
    line-height: 1;
    transform: rotate(90deg);
  }

  .diagnosis-step-page {
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  body:has(.diagnosis-step-page) .site-footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .diagnosis-step-page__heading p,
  .diagnosis-guide__documents-note > p { font-size: 14px; line-height: 1.7; }

  .question-chips { gap: 6px; }
  .question-chip {
    width: 100%;
    height: 44px;
    min-width: 44px;
    padding: 5px 2px;
    font-size: 14px;
  }

  .question-chip.is-current { box-shadow: inset 0 0 0 1px #947c66; }

  .diagnosis-questions {
    height: auto;
    min-height: 0;
    padding: 10px;
    overflow: visible;
    scroll-behavior: auto;
  }

  .diagnosis-question {
    margin-bottom: 12px;
    padding: 14px 12px;
    scroll-margin-top: 12px;
  }

  .diagnosis-question:last-child { margin-bottom: 0; }
  .diagnosis-question__text { font-size: 15px; line-height: 1.6; }
  .diagnosis-question__choices { padding-left: 0; }
  .diagnosis-question__choices label {
    min-height: 48px;
    padding: 8px 10px;
    border: 1px solid #e6ddd6;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.45;
  }

  .diagnosis-question__choices label:has(input:checked) {
    border-color: #947c66;
    background: #f4efeb;
  }

  .diagnosis-question__choices input { width: 24px; height: 24px; }
  .diagnosis-save-status { min-height: 20px; height: auto; font-size: 13px; }
  .diagnosis-step-error { font-size: 14px; }

  .diagnosis-step-actions {
    position: fixed;
    z-index: 12;
    left: 50%;
    bottom: 0;
    width: min(calc(100% - 24px), 620px);
    padding: 10px 0 max(10px, env(safe-area-inset-bottom));
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    transform: translateX(-50%);
    background: rgba(241, 241, 241, .96);
    box-shadow: 0 -7px 14px rgba(35, 27, 21, .12);
  }

  .diagnosis-primary-button,
  .diagnosis-secondary-button {
    min-height: 52px;
    padding: 8px;
    font-size: clamp(13px, 4vw, 17px);
    line-height: 1.3;
  }

  .diagnosis-completed__actions { grid-template-columns: 1fr; }
  .diagnosis-completed__actions .diagnosis-primary-button,
  .diagnosis-completed__actions .diagnosis-secondary-button,
  .result-actions .diagnosis-primary-button,
  .result-actions .diagnosis-secondary-button { min-height: 52px; }

  .diagnosis-confirmation {
    min-height: 100dvh;
    padding: 12px;
    overscroll-behavior: contain;
  }
  .diagnosis-confirmation__card {
    max-height: calc(100dvh - 24px);
    padding: 28px 16px 18px;
    overflow-y: auto;
  }
  .diagnosis-confirmation__actions { gap: 10px; }

  .result-summary__item > span,
  .result-summary__drink > span,
  .mypage-latest__summary > div > span { font-size: 14px; }
  .result-summary__type strong { white-space: normal; }
  .result-summary__drink p small,
  .mypage-latest__summary .result-summary__drink p small { font-size: 14px; }
  .result-step-score > span,
  .mypage-latest__steps span { font-size: 13px; }
  .result-advice__cards article { padding: 14px; grid-template-columns: 72px minmax(0, 1fr); }
  .result-advice__cards img { width: 68px; height: 68px; object-fit: contain; }
  .result-advice__cards p { font-size: 14px; }

  .mypage-header {
    margin-bottom: 12px;
    display: grid;
    justify-items: stretch;
    gap: 8px;
  }
  .mypage-header > h1 { margin: 0; font-size: 22px; line-height: 1.4; }
  .mypage-account-links {
    display: none;
  }

  .mypage-profile__identity p { font-size: 14px; line-height: 1.55; }
  .mypage-resume-link { min-height: 44px; padding: 10px 4px; display: grid; place-items: center; font-size: 14px; }
  .mypage-latest > header { flex-wrap: wrap; }
  .mypage-latest > header span { font-size: 12px; }

  .mypage-history { padding: 12px 10px; }
  .mypage-history__scroll {
    max-height: none;
    overflow: visible;
  }
  .mypage-history table,
  .mypage-history tbody { display: block; width: 100%; min-width: 0; }
  .mypage-history thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .mypage-history tbody { display: grid; gap: 12px; }
  .mypage-history tr {
    padding: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px;
    border: 1px solid #d8cec6;
    border-radius: 7px;
    background: #fdfcfa;
  }
  .mypage-history td {
    min-width: 0;
    padding: 0;
    display: grid;
    align-content: start;
    gap: 4px;
    border: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 14px;
  }
  .mypage-history td::before {
    content: attr(data-label);
    color: #746e69;
    font-size: 12px;
    font-weight: 600;
  }
  .mypage-history td:first-child { display: none; }
  .mypage-history__steps,
  .mypage-history__actions { grid-column: 1 / -1; }
  .mypage-history__steps { grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: 13px; }
  .mypage-history__steps::before,
  .mypage-history__actions::before { grid-column: 1 / -1; }
  .mypage-history__step {
    padding: 7px;
    display: block;
    border-radius: 4px;
    background: #f1ede9;
    text-align: center;
  }
  .mypage-history__step::before {
    content: attr(data-step-label);
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 600;
  }
  .mypage-history__step::after { content: "/100"; margin-left: 2px; }
  .mypage-history__step-separator { display: none; }
  .mypage-history__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .mypage-detail-link,
  .mypage-delete-link {
    min-height: 44px;
    padding: 9px 12px;
    display: grid;
    place-items: center;
    text-align: center;
  }

  .mypage-empty p { font-size: 14px; line-height: 1.55; }

  .account-overlay {
    min-height: 100dvh;
    padding: 12px;
    align-items: start;
    overscroll-behavior: contain;
  }
  .account-card {
    width: min(100%, 520px);
    margin: auto 0;
    padding: 20px 16px max(18px, env(safe-area-inset-bottom));
  }
  .account-card h1 { font-size: clamp(20px, 6vw, 24px); }
  .account-card p { font-size: 14px; }
  .account-settings-list { display: grid; gap: 4px; }
  .account-settings-list > div {
    min-height: 0;
    padding: 10px 0 12px;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 5px;
    border-bottom: 1px solid #e5ddd7;
  }
  .account-settings-list dt { font-size: 14px; font-weight: 600; }
  .account-settings-list dd { font-size: 15px; line-height: 1.5; }
  .account-small-button {
    width: 100%;
    min-height: 44px;
    margin-top: 3px;
    display: grid;
    place-items: center;
  }
  .account-form { gap: 8px; }
  .account-form label { font-size: 14px; }
  .account-form input[type="text"],
  .account-form input[type="email"],
  .account-form input[type="password"],
  .account-form select,
  .account-form textarea {
    min-height: 44px;
    font-size: 16px;
  }
  .account-submit,
  .account-cancel-button,
  .account-delete-button,
  .account-close-link,
  .account-danger-link {
    min-height: 44px;
    padding: 10px 12px;
  }
  .account-close-link,
  .account-danger-link { display: inline-flex; align-items: center; justify-content: center; }
  .account-form-actions { gap: 10px; }

  .avatar-file-picker { width: min(100%, 280px); min-height: 200px; height: auto; }
  .avatar-file-picker small { font-size: 12px; }
  .avatar-preview canvas {
    width: min(76vw, 280px);
    height: min(76vw, 280px);
    max-width: 100%;
  }
  .avatar-preview label { min-height: 44px; }
  .avatar-preview input[type="range"] { min-height: 44px; }
  .avatar-preview p { font-size: 13px; }

  .contact-confirmation dt { font-size: 14px; }
  .contact-confirmation dd { font-size: 15px; line-height: 1.55; }
}

@media (max-width: 767px) and (orientation: landscape), (orientation: landscape) and (max-width: 900px) and (max-height: 500px) {
  .legal-dialog,
  .diagnosis-confirmation__card { max-height: calc(100dvh - 12px); }
  .legal-dialog { height: calc(100dvh - 12px); }
  .account-overlay { padding-block: 6px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .top-hero { min-height: 100dvh; padding: 10px 24px; }
  .top-hero__content {
    width: min(800px, 100%);
    height: auto;
    min-height: calc(100dvh - 20px);
    grid-template-columns: minmax(160px, .8fr) minmax(280px, 1.2fr);
    grid-template-rows: auto auto auto;
    column-gap: 20px;
  }
  .top-hero__logo { grid-column: 1; grid-row: 1 / -1; width: min(100%, 260px); margin: 0; }
  .top-hero__start { grid-column: 2; width: min(100%, 360px); min-height: 88px; height: 88px; }
  .top-hero__facts { grid-column: 2; width: min(100%, 340px); margin-top: 2px; }
  .top-hero__copy { grid-column: 2; }
  .top-hero__copy { font-size: 14px; line-height: 1.45; }
}
