/* IR Webcasting 環境チェック
 * 既存システム（Smarty版）の見た目に合わせたスタイル：
 *   グレーの見出し／ピンクのステップ表示とグレーの矢印／濃い赤の○／
 *   赤グラデーションのボタン／結果は項目ラベル（赤）＋総合評価（水色の帯）／オレンジの問い合わせボタン
 * 文字サイズはお年寄りの方向けに大きめ（本文18px）。モバイルファースト、768px以上でPC表示。
 */

:root {
  --title: #444444;
  --ink: #222222;
  --ink-2: #333333;
  --ink-3: #555555;
  --bg: #ffffff;
  --muted: #f6f6f6;
  --line: #dddddd;
  --border: #bbbbbb;

  --mark-red: #b80c0c;       /* ○の色（現行の濃い赤） */
  --step-current: #d93a40;   /* 現在のステップ・項目ラベル（現行#ff5a5aを文字が読める濃さに） */
  --step-idle-bg: #ffd6d6;   /* 他のステップ（現行の淡いピンク） */
  --step-idle-ink: #a8323a;
  --arrow: #c8c8c8;

  --btn-top: #ff4f6e;        /* 赤ボタン（現行の「次へ」） */
  --btn-bottom: #e0143c;
  --btn2-top: #f7a21b;       /* オレンジボタン（現行の「お問い合わせ」） */
  --btn2-bottom: #d96200;
  --eval-bg: #a7d7ea;        /* 総合評価の帯（現行の水色） */
  --eval-ink: #1f4f8a;

  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Meiryo", "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 18px; line-height: 1.7; color: var(--ink-2); background: var(--bg); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #1a1a1a; outline-offset: 2px; }
h1, h2, .status__text, .summary-hero__text { word-break: auto-phrase; text-wrap: pretty; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }

body.is-loading .app { display: none; }
body.is-ready .fallback { display: none; }
.fallback { max-width: 640px; margin: 0 auto; padding: 48px 24px; }
.fallback__title { margin: 0 0 16px; font-size: 24px; font-weight: 700; color: var(--title); }
.fallback p { margin: 0 0 12px; }

.site-header { padding-top: env(safe-area-inset-top); }
.site-header__inner { max-width: 1000px; min-height: 64px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { margin: 0; min-width: 0; }
.brand__name { font-size: clamp(16px, 4.6vw, 19px); line-height: 1.3; font-weight: 700; color: var(--title); letter-spacing: 0.02em; }
html[lang="ja"] .brand__name { white-space: nowrap; }
.lang-switch { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; font-size: 16px; color: var(--ink-3); text-decoration: none; flex-shrink: 0; }
.lang-switch:hover { color: var(--ink); text-decoration: underline; }
.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; }
.icon--chev { stroke-width: 2.5; }

.stepper { max-width: 1000px; margin: 0 auto; padding: 8px 20px 0; }
.stepper__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.stepper__item { position: relative; }
.stepper__bar { display: none; }
.stepper__label {
  display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 6px;
  background: var(--step-idle-bg); color: var(--step-idle-ink); font-weight: 700;
}
.stepper__item.is-current .stepper__label { background: var(--step-current); color: #ffffff; }
.stepper__num { font-size: 18px; }
.stepper__name, .stepper__suffix { display: none; }
.stepper__mobile { margin: 10px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 17px; }
.stepper__count { font-weight: 700; color: var(--step-current); }

.main { max-width: 640px; margin: 0 auto; padding: 32px 20px calc(170px + env(safe-area-inset-bottom)); }
.main--wide { padding-bottom: 32px; }

.mark { display: block; flex-shrink: 0; width: 96px; height: 96px; }
.mark--sm { width: 28px; height: 28px; }
.mark--ok { color: var(--mark-red); }
.mark--warn { color: #c46a00; }
.mark--ng { color: #222222; }
.mark--busy { color: var(--step-current); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mark--busy { animation: none; } }

.pill { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 2px solid currentColor; border-radius: 4px; font-size: 15px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.pill--ok { color: var(--mark-red); }
.pill--warn { color: #a65900; }
.pill--ng { color: #222222; }
.pill--busy { color: var(--ink-3); }

.status { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.status__title { margin: 4px 0 0; font-size: 24px; line-height: 1.5; font-weight: 700; color: var(--ink); }
.status__title:focus { outline: none; }
.status__text { margin: 0; font-size: 18px; line-height: 1.7; }

.details { margin: 24px 0 0; border-top: 1px solid var(--line); }
.details__row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.details dt { font-size: 16px; color: var(--ink-3); }
.details dd { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); text-align: right; }

.envbox { margin-top: 16px; padding: 16px; background: var(--muted); border: 1px solid var(--line); border-radius: 4px; }
.envbox__title { margin: 0 0 8px; font-size: 17px; font-weight: 700; color: var(--ink); }
.envbox__list { margin: 0; font-size: 16px; }
.envbox__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.envbox__row:last-child { border-bottom: 0; }
.envbox dt { color: var(--ink-3); }
.envbox dd { margin: 0; font-weight: 700; color: var(--ink); text-align: right; }

.progress { margin-top: 24px; }
.progress__row { margin: 0; display: flex; justify-content: space-between; font-size: 17px; color: var(--ink-3); }
.progress__pct { font-weight: 700; color: var(--ink); }
.progress__track { height: 10px; margin-top: 8px; background: #eeeeee; border-radius: 5px; overflow: hidden; }
.progress__fill { width: 0; height: 100%; background: var(--step-current); transition: width 0.2s linear; }

.video-box { position: relative; aspect-ratio: 16 / 9; margin-bottom: 16px; background: #222222; }
.video-box__eq { width: 100%; height: 100%; overflow: hidden; }
.video-box__eq > * { max-width: 100%; }
.video-box__video { display: block; width: 100%; height: 100%; object-fit: contain; background: #222222; }
.video-box__overlay { position: absolute; inset: 0; padding: 16px; background: rgba(0, 0, 0, 0.72); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.video-box__note { margin: 0; font-size: 17px; line-height: 1.6; color: #ffffff; }
.video-box__play { min-height: 56px; }

.sublist { list-style: none; margin: 0 0 32px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); }
.sublist__item { display: flex; flex-direction: column-reverse; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 0 12px; border-bottom: 1px solid var(--border); text-align: center; }
.sublist__item:nth-child(odd) { border-right: 1px solid var(--border); }
.sublist__item:nth-last-child(-n+2) { border-bottom: 0; }
.sublist__name { align-self: stretch; padding: 10px 8px; background: #f2f2f2; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 700; color: var(--ink); text-align: left; }
.sublist__item .pill { display: none; }
.view--check[data-check="video"] .status .mark { width: 64px; height: 64px; }
.view--end .status { padding-top: 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 0 24px; border: 0; border-radius: 4px;
  font: inherit; font-size: 19px; font-weight: 700; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn--primary { background: linear-gradient(var(--btn-top), var(--btn-bottom)); color: #ffffff; box-shadow: 0 2px 0 #a80f2e; }
.btn--primary:hover { filter: brightness(0.95); }
.btn--primary:active { box-shadow: none; transform: translateY(2px); }
.btn--primary:disabled { background: #e2e2e2; color: var(--ink-3); box-shadow: none; cursor: default; filter: none; transform: none; }
.btn--primary .icon--chev { fill: currentColor; stroke: none; }
.btn--secondary { background: linear-gradient(var(--btn2-top), var(--btn2-bottom)); color: #ffffff; box-shadow: 0 2px 0 #a84c00; }
.btn--secondary:hover { filter: brightness(0.95); }
.btn--secondary:active { box-shadow: none; transform: translateY(2px); }
.btn--ghost { min-height: 52px; padding: 0 8px; background: none; color: var(--ink-3); font-size: 17px; font-weight: 400; text-decoration: underline; }

.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.actionbar__inner { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.actionbar .btn { width: 100%; }
.powered { margin: 0; text-align: center; font-size: 13px; color: var(--ink-3); }
.powered a { color: inherit; text-decoration: none; }
.powered a:hover { text-decoration: underline; }
.powered--inline { margin-top: 32px; }

.intro { display: flex; flex-direction: column; gap: 8px; }
.intro__title { margin: 0; font-size: 19px; line-height: 1.7; font-weight: 400; color: var(--ink-2); }
.intro__lead { margin: 0; font-size: 18px; line-height: 1.7; }

.items { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 19px; font-weight: 700; color: var(--ink); }
.items__item { display: inline; }
.items__item:not(:last-child)::after { content: "/"; margin: 0 10px; font-weight: 400; color: var(--ink-3); }
.items__num { display: none; }

.notes { margin-top: 32px; }
.notes__title { margin: 0; font-size: 18px; font-weight: 400; color: var(--ink-2); }
.notes__list { list-style: none; margin: 12px 0 0; padding: 14px 16px; max-height: 280px; overflow-y: auto; background: #fafafa; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; font-size: 16px; line-height: 1.7; }
.notes__list li { position: relative; padding-left: 16px; }
.notes__list li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }

.result-list { list-style: none; margin: 0; padding: 20px 16px; display: grid; gap: 20px; border: 1px solid var(--border); }
.result-item { display: grid; grid-template-columns: auto 32px minmax(0, 1fr); grid-template-areas: "name mark body"; align-items: start; column-gap: 12px; }
.result-item .mark--sm { grid-area: mark; width: 32px; height: 32px; margin-top: 4px; }
.result-item__body { grid-area: body; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.result-item .pill { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.result-item__name {
  grid-area: name; display: flex; align-items: center; justify-content: center; width: 116px; min-height: 44px; padding: 6px 8px;
  border-radius: 6px; background: var(--step-current); color: #ffffff; font-size: 16px; font-weight: 700; line-height: 1.3; text-align: center;
}
.result-item__value { font-size: 17px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.result-item__hint { font-size: 16px; line-height: 1.6; color: var(--ink-2); }

.summary-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 20px; padding: 18px 20px; border: 1px solid var(--border); border-top: 0; background: var(--eval-bg); }
.summary-hero .mark { order: 2; width: 52px; height: 52px; }
.summary-hero__body { display: contents; }
.summary-hero__label { order: 1; margin: 0; font-size: 22px; font-weight: 700; color: var(--eval-ink); letter-spacing: 0.1em; }
.summary-hero__status { order: 3; margin: 0; font-size: 26px; line-height: 1.1; font-weight: 700; color: var(--eval-ink); }
.summary-hero__status:focus { outline: none; }
.summary-hero__text { order: 4; flex-basis: 100%; margin: 0; font-size: 17px; line-height: 1.6; color: var(--ink); text-align: center; }

.contact { margin-top: 28px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.contact__note { margin: 0; font-size: 17px; line-height: 1.7; text-wrap: balance; word-break: auto-phrase; }
.contact__btn { width: 100%; max-width: 320px; }
.retry { display: flex; margin: 16px auto 0; }

@media (min-width: 768px) {
  .site-header__inner { min-height: 80px; padding: 16px 32px; }
  .brand__name { font-size: 26px; white-space: normal; }

  .stepper { padding: 8px 32px 0; }
  .stepper__list { gap: 32px; }
  .stepper__label { flex-direction: column; height: 64px; line-height: 1.25; font-size: 16px; }
  .stepper__num { display: none; }
  .stepper__name, .stepper__suffix { display: block; }
  .stepper__item:not(:last-child)::before { content: ""; position: absolute; top: 27px; right: -27px; width: 10px; height: 10px; background: var(--arrow); }
  .stepper__item:not(:last-child)::after { content: ""; position: absolute; top: 20px; right: -31px; border-left: 14px solid var(--arrow); border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
  .stepper__mobile { display: none; }

  .main { padding: 56px 32px 40px; }
  .main--agree { max-width: 800px; }
  .main--wide { max-width: 960px; }

  .status .mark { width: 112px; height: 112px; }
  .status__title { font-size: 28px; }
  .status__text { font-size: 19px; }

  .actionbar { position: static; padding: 0 32px 40px; border-top: 0; }
  .actionbar .btn { width: 320px; align-self: center; }


  .result-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; padding: 28px 24px; }
  .summary-hero { padding: 20px 24px; }
}

.invalid { display: none; }
body.is-invalid .invalid { display: flex; flex-direction: column; align-items: center; gap: 24px; max-width: 640px; margin: 0 auto; padding: 56px 20px; text-align: center; }
body.is-invalid .stepper, body.is-invalid .main, body.is-invalid .actionbar { display: none; }
.invalid__text { margin: 0; font-size: 19px; line-height: 1.7; color: var(--ink); }
.invalid__link { width: 100%; max-width: 360px; }

.leave { width: calc(100% - 32px); max-width: 560px; padding: 28px 24px 20px; border: 0; border-radius: 8px; color: var(--ink-2); background: #ffffff; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25); }
.leave::backdrop { background: rgba(0, 0, 0, 0.55); }
.leave__title { margin: 0 0 14px; font-size: 22px; line-height: 1.5; font-weight: 700; color: var(--ink); }
.leave__text { margin: 0 0 10px; font-size: 18px; line-height: 1.7; }
.leave__actions { margin-top: 22px; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
@media (min-width: 768px) {
  .leave { padding: 36px 40px 28px; }
  .leave__actions { flex-direction: row-reverse; justify-content: center; gap: 16px; }
  .leave__actions .btn--secondary { min-width: 220px; }
}

.testmode { margin: 0; padding: 8px 16px; background: #222222; color: #ffeb3b; font-size: 15px; font-weight: 700; text-align: center; }

.summary-hero + .retry { margin-top: 28px; }
