:root {
  color-scheme: light dark;
  --blue: #0072CE;
  --sky: #5bc2e7;
  --charcoal: #333f48;
  --white: #FFFFFF;
  --page: #f4f8fb;
  --card: #FFFFFF;
  --text: #333f48;
  --muted: #667984;
  --line: #dce7ee;
  --sky-soft: #e7f7fc;
  --blue-soft: #eaf4fc;
  --focus: #0072CE;
  --success: #26734d;
  --success-bg: #e9f6ef;
  --danger: #a12f2b;
  --danger-bg: #fff0ee;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--page); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.app-shell { width: min(100% - 32px, 760px); min-height: 100vh; margin: 0 auto; padding-bottom: 32px; }
.topbar { min-height: 76px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 8px; color: var(--text); font-size: 15px; font-weight: 750; text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 11px; object-fit: contain; }
.brand img.group-logo { width: min(400px, calc(100vw - 32px)); height: auto; border-radius: 0; }
.brand-light { color: var(--muted); font-weight: 550; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.quiet-button { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font-size: 12px; font-weight: 650; }
.quiet-button:hover, .secondary-button:hover { border-color: var(--sky); background: var(--sky-soft); }
.intro { padding: 40px 0 24px; text-align: center; }
.eyebrow { margin: 0 0 12px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: 1.7px; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; color: var(--text); font-size: clamp(30px, 6vw, 43px); line-height: 1.14; letter-spacing: -1.3px; }
.section-intro { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.form-card, .auth-card, .result-card { border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 15px 48px #193b5012, 0 2px 8px #193b5008; }
.form-card { padding: 28px 32px 24px; }
.form-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.form-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.3px; }
.muted-copy { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.progress-copy { flex: 0 0 auto; padding: 7px 10px; border-radius: 30px; background: var(--sky-soft); color: var(--charcoal); font-size: 11px; font-weight: 700; }
.progress-track { height: 5px; margin: 22px 0 6px; overflow: hidden; border-radius: 10px; background: var(--line); }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .2s ease; }
.progress-bar[data-progress="5"] { width: 5%; }
.progress-bar[data-progress="10"] { width: 10%; }
.progress-bar[data-progress="15"] { width: 15%; }
.progress-bar[data-progress="20"] { width: 20%; }
.progress-bar[data-progress="25"] { width: 25%; }
.progress-bar[data-progress="30"] { width: 30%; }
.progress-bar[data-progress="35"] { width: 35%; }
.progress-bar[data-progress="40"] { width: 40%; }
.progress-bar[data-progress="45"] { width: 45%; }
.progress-bar[data-progress="50"] { width: 50%; }
.progress-bar[data-progress="55"] { width: 55%; }
.progress-bar[data-progress="60"] { width: 60%; }
.progress-bar[data-progress="65"] { width: 65%; }
.progress-bar[data-progress="70"] { width: 70%; }
.progress-bar[data-progress="75"] { width: 75%; }
.progress-bar[data-progress="80"] { width: 80%; }
.progress-bar[data-progress="85"] { width: 85%; }
.progress-bar[data-progress="90"] { width: 90%; }
.progress-bar[data-progress="95"] { width: 95%; }
.progress-bar[data-progress="100"] { width: 100%; }
.form-section { padding: 22px 0 18px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.section-title { margin: 0 0 14px; font-size: 15px; font-weight: 730; }
.field { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.field:last-child { margin-bottom: 0; }
.field-label { display: block; margin: 0 0 7px; color: var(--text); font-size: 13px; font-weight: 680; line-height: 1.5; }
.required-mark { padding-left: 3px; color: var(--danger); }
.help-text { margin: -1px 0 9px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 9px; }
.choice { position: relative; display: flex; min-height: 48px; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); color: var(--text); cursor: pointer; font-size: 13px; line-height: 1.45; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.choices-four .choice, .choices-five-brief .choice { min-width: 0; gap: 7px; padding: 8px; font-size: 12px; }
.choices-four .choice span, .choices-five-brief .choice span { min-width: 0; overflow-wrap: anywhere; }
.choice:hover { transform: translateY(-1px); border-color: var(--sky); background: var(--sky-soft); }
.choice:has(input:checked) { border-color: var(--blue); background: var(--sky-soft); box-shadow: 0 0 0 2px #5bc2e72b; }
.choice input { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; accent-color: var(--blue); }
.choice:focus-within, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #0072ce66; outline-offset: 2px; }
.text-input, .select-input { width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); }
textarea.text-input { min-height: 110px; resize: vertical; }
.text-input::placeholder { color: var(--muted); opacity: .8; }
.field-error { margin: 9px 0 0; color: var(--danger); font-size: 12px; line-height: 1.5; }
.field-error:not([hidden]) { padding: 9px 11px; border-radius: 8px; background: var(--danger-bg); }
.invalid-control { border-color: var(--danger) !important; }
.submit-dock { position: sticky; bottom: 0; z-index: 2; margin: 0 -32px -24px; padding: 16px 32px 20px; border-radius: 0 0 19px 19px; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(12px); }
.primary-button, .secondary-button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 9px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 720; text-decoration: none; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.primary-button { width: 100%; background: var(--blue); color: var(--white); box-shadow: 0 6px 15px #0072ce2b; }
.primary-button:hover:not(:disabled) { transform: translateY(-1px); background: #005fae; box-shadow: 0 8px 18px #0072ce38; }
.primary-button:disabled { cursor: not-allowed; opacity: .55; box-shadow: none; }
.secondary-button { border-color: var(--line); background: var(--card); color: var(--text); }
.link-button { width: auto; }
.privacy-note { margin: 10px 0 0; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.5; }
.loading-message { display: flex; min-height: 130px; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13px; }
.spinner { width: 17px; height: 17px; border: 2px solid #5bc2e766; border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-card { width: min(100%, 460px); margin: 62px auto 0; padding: 32px; }
.auth-card h1 { font-size: 30px; }
.auth-card form { margin-top: 24px; }
.input-label { display: block; margin: 17px 0 7px; font-size: 13px; font-weight: 680; }
.auth-card input { width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 88px; }
.password-toggle { position: absolute; top: 2px; right: 3px; min-width: 44px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--blue); font-size: 11px; font-weight: 700; }
.auth-submit { margin-top: 20px; }
.result-card { width: min(100%, 540px); margin: 70px auto 0; padding: 36px; text-align: center; }
.result-icon { display: grid; width: 55px; height: 55px; place-items: center; margin: 0 auto 17px; border-radius: 17px; background: var(--success-bg); color: var(--success); font-size: 26px; font-weight: 800; }
.result-icon.error { background: var(--danger-bg); color: var(--danger); }
.result-card h1 { font-size: 28px; }
.result-message { margin: 13px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.pdf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin: 0 0 12px; }
.retry-button { margin-bottom: 12px; }
.install-hint { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 5; width: min(390px, calc(100vw - 32px)); padding: 16px 44px 16px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); box-shadow: 0 10px 35px #112b3b2b; color: var(--text); font-size: 12px; line-height: 1.6; }
.install-hint button { position: absolute; top: 2px; right: 3px; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 23px; }
.footer { padding: 25px 0; color: var(--muted); text-align: center; font-size: 11px; }

@media (min-width: 792px) {
  .choices-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .choices-five-brief { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #263139;
    --card: #333f48;
    --text: #FFFFFF;
    --muted: #d1dee4;
    --line: #61717b;
    --sky-soft: #465f69;
    --blue-soft: #344e5e;
    --focus: #5bc2e7;
    --success: #9cddba;
    --success-bg: #314c43;
    --danger: #ffb5aa;
    --danger-bg: #553a3a;
  }
  .quiet-button { color: var(--text); }
  .progress-copy, .choice:has(input:checked) { color: var(--text); }
  .progress-track { background: #53616a; }
  .submit-dock { background: color-mix(in srgb, var(--card) 94%, transparent); }
  .primary-button { color: #FFFFFF; }
}

@media (max-width: 600px) {
  .app-shell { width: min(100% - 24px, 500px); padding-bottom: 18px; }
  .topbar { min-height: 65px; }
  .brand { gap: 8px; font-size: 13px; }
  .brand img:not(.group-logo) { width: 34px; height: 34px; }
  .brand img.group-logo { width: min(400px, calc(100vw - 24px)); }
  .quiet-button { min-height: 44px; padding: 0 10px; font-size: 11px; }
  .intro { padding: 34px 5px 22px; }
  .intro h1 { font-size: clamp(29px, 9vw, 38px); }
  .section-intro { font-size: 13px; }
  .form-card { padding: 22px 18px 19px; border-radius: 16px; }
  .form-heading h2 { font-size: 16px; }
  .form-section { padding: 19px 0 16px; }
  .submit-dock { margin: 0 -18px -19px; padding: 14px 18px calc(16px + env(safe-area-inset-bottom)); border-radius: 0 0 15px 15px; }
  .auth-card { margin-top: 36px; padding: 25px 20px; }
  .result-card { margin-top: 38px; padding: 29px 20px; }
  .pdf-actions { display: grid; grid-template-columns: 1fr; }
  .link-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
