:root {
  --a4-width: 210mm;
  --a4-height: 297mm;
  --bg: #f3eee6;
  --card: rgba(255, 251, 246, 0.9);
  --paper: #ffffff;
  --text: #24211d;
  --muted: #655f57;
  --line: rgba(36, 33, 29, 0.15);
  --primary: #1f6f5d;
  --accent: #a7572a;
  --shadow: 0 24px 60px rgba(58, 42, 20, 0.12);
  font-family: "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 28%),
    linear-gradient(180deg, #f4ecdf 0%, var(--bg) 58%, #f7f1e8 100%);
}

body.modal-open {
  overflow: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(31, 111, 93, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 111, 93, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent);
}

body.student-theme {
  --bg: #eef5f2;
  --card: rgba(250, 255, 252, 0.92);
  --paper: #ffffff;
  --text: #21312f;
  --muted: #5d6f6a;
  --line: rgba(33, 49, 47, 0.14);
  --primary: #2f7f86;
  --accent: #d48746;
  --shadow: 0 24px 60px rgba(38, 88, 92, 0.13);
  background:
    radial-gradient(circle at 14% 6%, rgba(255, 214, 148, 0.32), transparent 24%),
    radial-gradient(circle at 86% 16%, rgba(94, 179, 190, 0.22), transparent 26%),
    linear-gradient(180deg, #f5fbf7 0%, #edf6f3 54%, #fff6ea 100%);
}

body.student-theme::before {
  background-image:
    linear-gradient(rgba(47, 127, 134, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 127, 134, 0.045) 1px, transparent 1px);
}

body.student-theme .site-header,
body.student-theme .site-footer,
body.student-theme .hero,
body.student-theme .panel {
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(250, 255, 252, 0.9);
}

body.student-theme .site-header {
  display: none;
}

body.student-theme .hero-inline-note {
  border-color: rgba(47, 127, 134, 0.16);
  background: rgba(255, 255, 255, 0.68);
}

body.student-theme .feature-card,
body.student-theme .achievement-item,
body.student-theme .chat-input-panel,
body.student-theme .chat-answer-panel,
body.student-theme .preview-panel {
  border-color: rgba(47, 127, 134, 0.14);
}

.shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.site-header,
.site-footer {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  background: rgba(255, 251, 246, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.site-logo {
  display: block;
  width: auto;
  height: 52px;
  max-width: 100%;
}

.site-header .site-brand {
  flex: 0 0 auto;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.site-nav a[aria-current="page"] {
  color: #fff;
  background: var(--primary);
  border-color: transparent;
}

.hero,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  padding: clamp(28px, 4vw, 44px);
  margin-bottom: 22px;
}

.hero--chat {
  padding: 20px 22px 18px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 460px);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.hero-grid-compact {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
}

.hero-copy {
  min-width: 0;
}

.hero-visual {
  margin: 0;
  display: flex;
  justify-content: center;
}

.hero-visual img {
  display: block;
  width: min(100%, 520px);
  height: auto;
  border-radius: 28px;
}

.hero-visual-compact img {
  width: min(100%, 240px);
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.section-heading h3 {
  margin: 12px 0 0;
  line-height: 1.32;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  max-width: 12ch;
  letter-spacing: -0.02em;
}

.hero--chat h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  max-width: 10ch;
  line-height: 1.12;
}

.no-break {
  display: inline-block;
  white-space: nowrap;
}

.lead {
  margin: 18px 0 0;
  max-width: 50rem;
  color: var(--muted);
  line-height: 1.92;
}

.hero--chat .lead {
  max-width: 34rem;
  line-height: 1.68;
}

.preview-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.field-help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.lead a {
  color: var(--primary);
}

.hero-actions,
.layout,
.field-grid,
.inline-actions,
.stack {
  display: grid;
  gap: 12px;
}

.layout-single {
  display: grid;
  gap: 22px;
}

.guide-article {
  padding: clamp(24px, 4vw, 40px);
}

.guide-body {
  display: grid;
  gap: 28px;
}

.guide-section {
  display: grid;
  gap: 12px;
}

.guide-section h2 {
  margin: 0;
  font-size: clamp(1.28rem, 2.4vw, 1.75rem);
}

.guide-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.guide-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.8;
}

.guide-cta-box {
  display: grid;
  gap: 14px;
  padding: 20px 22px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(31, 122, 98, 0.08), rgba(255, 255, 255, 0.96)),
    var(--panel-bg);
}

.guide-cta-box-final {
  background:
    linear-gradient(135deg, rgba(184, 107, 43, 0.1), rgba(255, 255, 255, 0.98)),
    var(--panel-bg);
}

.guide-cta-label {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-text);
}

.guide-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.guide-cta-actions .primary-button,
.guide-cta-actions .ghost-button {
  min-width: 220px;
  justify-content: center;
}

.hero-actions {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 22px;
}

.hero-actions .primary-button,
.hero-actions .ghost-button {
  white-space: nowrap;
}

.hero-inline-note {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  width: fit-content;
  max-width: 100%;
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(31, 111, 93, 0.14);
  border-radius: 18px;
  color: var(--muted);
  line-height: 1.65;
  background: rgba(255, 255, 255, 0.64);
}

.hero-inline-note strong {
  color: var(--text);
  font-weight: 800;
}

.hero-inline-note span {
  color: var(--muted);
}

.hero--chat .hero-actions {
  margin-top: 18px;
}

.hero-samples {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(31, 111, 93, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(31, 111, 93, 0.09), rgba(255, 255, 255, 0.86));
}

.hero-samples-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
}

.hero-samples-label {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 800;
}

.hero-samples-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.sample-role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sample-role-card {
  display: grid;
  gap: 6px;
  min-height: 110px;
  padding: 16px;
  text-align: left;
  border: 1px solid rgba(31, 111, 93, 0.18);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 111, 93, 0.08);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.sample-role-card:hover,
.sample-role-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(31, 111, 93, 0.36);
  box-shadow: 0 16px 28px rgba(31, 111, 93, 0.12);
}

.sample-role-card strong {
  font-size: 1.02rem;
}

.sample-role-card span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.sample-role-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  color: var(--primary) !important;
  font-size: 0.72rem !important;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: 999px;
  background: rgba(31, 111, 93, 0.1);
}

.home-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.home-points div,
.placeholder-item {
  padding: 16px 18px;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.home-points div {
  display: grid;
  gap: 6px;
  border-style: solid;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62));
}

.home-points strong {
  font-size: 0.98rem;
  line-height: 1.45;
}

.home-points span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.document-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
  margin-top: 18px;
}

.document-choice-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.document-choice-card--primary {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(31, 111, 93, 0.1), rgba(255, 255, 255, 0.92));
  border-color: rgba(31, 111, 93, 0.2);
}

.document-choice-card__content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.document-choice-card--primary .card-media {
  width: 100%;
  height: auto;
  max-height: 320px;
  aspect-ratio: 16 / 10;
  align-self: stretch;
}

.document-choice-card--primary .document-choice-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31, 111, 93, 0.12);
}

.card-media,
.section-visual img,
.feature-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
}

.card-media {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid rgba(31, 111, 93, 0.1);
}

.section-visual {
  margin: 18px 0 0;
}

.document-choice-card h3,
.document-choice-card p {
  margin: 0;
}

.document-choice-card p {
  color: var(--muted);
  line-height: 1.85;
}

.document-choice-points {
  display: grid;
  gap: 8px;
  margin: 2px 0 4px;
  padding: 0;
  list-style: none;
}

.document-choice-points li {
  position: relative;
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.7;
}

.document-choice-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--primary);
  transform: translateY(-50%);
}

.document-choice-label {
  color: var(--primary) !important;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.choice-link {
  color: var(--primary);
  font-weight: 700;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.achievement-stack {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.achievement-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 24px;
  border: 1px solid rgba(31, 111, 93, 0.12);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(31, 111, 93, 0.08), rgba(255, 255, 255, 0.94));
}

.achievement-index {
  margin: 0;
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

.achievement-copy h3,
.achievement-copy p {
  margin: 0;
}

.achievement-copy h3 {
  font-size: 1.12rem;
  line-height: 1.55;
}

.achievement-copy p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.92;
  max-width: 60rem;
}

.feature-card {
  display: grid;
  align-content: start;
  padding: 22px;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.66));
}

.feature-illust {
  width: 104px;
  height: auto;
  margin-bottom: 6px;
}

.feature-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  margin-bottom: 14px;
  border: 1px solid rgba(31, 111, 93, 0.08);
}

.feature-card h3,
.feature-card p,
.step-number {
  margin: 0;
}

.feature-card h3 {
  font-size: 1.02rem;
  line-height: 1.5;
}

.feature-card p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.86;
}

.steps-grid {
  margin-top: 18px;
}

.section-heading {
  display: grid;
  gap: 8px;
}

.step-card {
  position: relative;
  overflow: hidden;
}

.step-card::after {
  position: absolute;
  inset: auto -20px -28px auto;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: rgba(31, 111, 93, 0.08);
  content: "";
}

.step-number {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.site-footer {
  margin-top: 22px;
  padding: 28px;
}

.site-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 24px;
}

.site-footer-grid h2,
.site-footer-grid p {
  margin: 0;
}

.site-footer-grid h2 {
  font-size: 0.95rem;
}

.site-footer-grid p,
.site-footer-grid a {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.85;
  text-decoration: none;
  display: block;
}

.footer-logo {
  height: 38px;
  margin-bottom: 10px;
}

.site-footer-copy {
  margin: 18px 0 0;
  padding-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  border-top: 1px solid rgba(36, 33, 29, 0.08);
}

.policy-panel h1 {
  margin: 10px 0 0;
}

.policy-copy {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.policy-copy h2,
.policy-copy p {
  margin: 0;
}

.policy-copy h2 {
  font-size: 1rem;
}

.policy-copy p {
  color: var(--muted);
  line-height: 1.8;
}

.consent-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.consent-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 16, 0.48);
}

.consent-dialog {
  position: relative;
  width: min(920px, calc(100% - 28px));
  max-height: calc(100dvh - 32px);
  margin: 16px auto;
  padding: 24px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  background: rgba(255, 251, 246, 0.98);
  box-shadow: var(--shadow);
}

.modal-close-button {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: block;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.modal-lead {
  max-width: none;
}

.consent-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.consent-choice-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
}

.consent-choice-card h3,
.consent-choice-card p {
  margin: 0;
}

.consent-choice-card p {
  color: var(--muted);
  line-height: 1.75;
}

.consent-choice-card-accent {
  border-color: rgba(31, 111, 93, 0.18);
  background: linear-gradient(180deg, rgba(31, 111, 93, 0.08), rgba(255, 255, 255, 0.92));
}

.consent-choice-label {
  color: var(--primary) !important;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.consent-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.consent-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.consent-check span {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.6;
}

.consent-error {
  color: #b44545 !important;
  font-weight: 700;
}

.consent-caption {
  font-size: 0.88rem;
}

.consent-caption a {
  color: var(--primary);
}

.lead-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 55;
  display: grid;
  gap: 10px;
  max-width: min(440px, calc(100% - 32px));
  padding: 14px 16px;
  color: #fff;
  border-radius: 18px;
  background: rgba(31, 111, 93, 0.96);
  box-shadow: 0 18px 30px rgba(31, 111, 93, 0.22);
  cursor: pointer;
}

.lead-toast__message {
  line-height: 1.6;
  padding-right: 28px;
}

.lead-toast__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  appearance: none;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
}

.lead-toast__action {
  width: fit-content;
  min-width: 120px;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  color: var(--primary);
  background: #fff;
}

.lead-toast__action[aria-disabled="true"],
.primary-button.is-disabled {
  pointer-events: none;
  opacity: 0.5;
}

.save-guide-panel h1 {
  margin: 10px 0 0;
  line-height: 1.22;
  font-size: clamp(1.9rem, 5vw, 3rem);
}

.save-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.save-guide-file {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(31, 111, 93, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.save-guide-status {
  margin: 16px 0 0;
  color: var(--primary);
  font-weight: 700;
}

.save-guide-selector {
  margin-top: 22px;
}

.save-guide-selector h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.save-guide-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.save-guide-choice {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(31, 111, 93, 0.16);
  border-radius: 16px;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
}

.save-guide-choice.is-active {
  color: #fff;
  background: var(--primary);
  border-color: transparent;
}

.save-guide-grid {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.save-guide-card {
  padding: 18px;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
}

.save-guide-card h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.save-guide-steps,
.save-guide-list {
  margin: 0;
  padding-left: 1.4rem;
  line-height: 1.8;
}

.save-guide-note {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.pdf-render-root {
  position: fixed;
  top: 0;
  left: -200vw;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
}

.pdf-render-root .paper-page {
  width: var(--a4-width);
  max-width: none;
  min-height: var(--a4-height);
  aspect-ratio: auto;
  margin: 0;
  padding: 12mm 10mm 12mm;
}

.pdf-render-root .doc-header {
  grid-template-columns: 1fr auto;
  gap: 0;
}

.pdf-render-root .doc-header h3 {
  text-align: center;
  transform: translateX(0.22em);
}

.pdf-render-root .doc-meta {
  text-align: right;
}

.placeholder-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.layout {
  align-items: start;
}

.panel {
  padding: clamp(24px, 3vw, 34px);
}

.wizard-meta,
.stepper,
.wizard-nav {
  display: grid;
  gap: 12px;
}

.wizard-meta {
  margin-top: 18px;
  margin-bottom: 10px;
  position: sticky;
  top: 12px;
  z-index: 12;
  padding: 12px;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 20px;
  background: rgba(255, 251, 246, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(58, 42, 20, 0.08);
}

.stepper {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.step-chip {
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted);
  border: 1px solid rgba(36, 33, 29, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.step-chip.is-active {
  color: #fff;
  background: var(--primary);
}

.step-chip.is-done {
  color: var(--primary);
  border-color: rgba(31, 111, 93, 0.2);
  background: rgba(31, 111, 93, 0.08);
}

.save-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.save-status.is-saved {
  color: var(--primary);
}

.save-status.is-error {
  color: #b44545;
}

.wizard-progress {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(31, 111, 93, 0.12);
  border-radius: 18px;
  background: rgba(31, 111, 93, 0.05);
}

.wizard-progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}

.wizard-progress-label,
.wizard-progress-meta {
  margin: 0;
}

.wizard-progress-label {
  color: var(--text);
  font-weight: 800;
}

.wizard-progress-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.wizard-progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(31, 111, 93, 0.12);
}

.wizard-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f6f5d 0%, #4ea18d 100%);
  transition: width 180ms ease;
}

.compact {
  margin-top: 28px;
}

.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.narrow-grid {
  grid-template-columns: 150px minmax(0, 1fr);
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.field span {
  font-size: 0.94rem;
  font-weight: 700;
}

.input-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.conditional-input.is-hidden {
  display: none;
}

.wizard-step {
  display: none;
}

.wizard-step.is-active {
  display: block;
}

.step-header {
  margin-top: 12px;
}

.step-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.step-header p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.review-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.review-card p {
  margin: 0 0 8px;
  color: var(--muted);
}

.review-card p:last-child {
  margin-bottom: 0;
}

.security-note-card {
  background: rgba(241, 247, 243, 0.9);
  border-color: rgba(32, 113, 87, 0.14);
}

.security-note-list {
  margin: 10px 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.security-note-list li + li {
  margin-top: 8px;
}

.helper-card {
  margin-top: 18px;
}

.helper-card-title {
  font-weight: 700;
  color: var(--text);
}

.required-note {
  font-weight: 700;
  color: #9a4a24;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 15px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(31, 111, 93, 0.16);
  border-color: rgba(31, 111, 93, 0.5);
}

.mini-button,
.chip-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(31, 111, 93, 0.14);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(31, 111, 93, 0.08);
  cursor: pointer;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.primary-button,
.secondary-button {
  color: #fff;
  background: var(--primary);
}

.accent-button {
  background: var(--accent);
}

.secondary-button {
  width: 100%;
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(36, 33, 29, 0.08);
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

.danger-button {
  color: #9f3535;
  border-color: rgba(159, 53, 53, 0.16);
  background: rgba(159, 53, 53, 0.08);
}

.text-button {
  justify-content: flex-start;
  min-height: auto;
  padding: 0;
  color: #b44545;
  background: transparent;
}

.career-card,
.career-row-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.64);
}

.history-section-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
}

.history-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-section-head h4 {
  margin: 0;
  font-size: 1.05rem;
}

.history-section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.history-section-action {
  display: flex;
  justify-content: flex-start;
}

.history-type-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(31, 111, 93, 0.14);
  border-radius: 999px;
  color: var(--primary);
  font-weight: 700;
  background: rgba(31, 111, 93, 0.08);
}

.history-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.address-helper-card {
  margin-top: 12px;
}

.final-education-fieldset {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  border: 0;
}

.final-education-fieldset > legend {
  padding: 0;
  font-weight: 800;
  color: var(--ink);
}

.final-education-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.choice-card input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
}

.choice-card span {
  line-height: 1.5;
  font-weight: 700;
}

.document-preview {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.paper-page {
  width: var(--a4-width);
  min-height: var(--a4-height);
  padding: 12mm 10mm 12mm;
  background: var(--paper);
  color: #111;
  border: 1px solid #808080;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
}

.doc-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  margin-bottom: 6mm;
}

.doc-header h3 {
  margin: 0;
  text-align: center;
  font-size: 14pt;
  letter-spacing: 0.45em;
  transform: translateX(0.22em);
}

.doc-meta {
  min-width: 42mm;
  text-align: right;
  font-size: 8.5pt;
  line-height: 1.5;
}

.doc-meta p {
  margin: 0;
}

.doc-section {
  margin-top: 4.2mm;
  font-size: 9pt;
  line-height: 1.55;
}

.doc-section h4 {
  margin: 0 0 2mm;
  font-size: 9.2pt;
}

.doc-paragraphs p,
.doc-list p {
  margin: 0 0 1.4mm;
}

.doc-box {
  padding: 2.2mm 2.4mm;
  border: 1px solid #7e7e7e;
}

.doc-box .doc-list p:last-child,
.doc-box .doc-paragraphs p:last-child {
  margin-bottom: 0;
}

.resume-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid #7e7e7e;
}

.resume-table th,
.resume-table td {
  border: 1px solid #7e7e7e;
  padding: 1.8mm 2mm;
  vertical-align: top;
  font-size: 8.4pt;
  line-height: 1.55;
  word-break: break-word;
}

.resume-table th {
  width: 24mm;
  background: #f5f5f5;
  text-align: center;
  font-weight: 700;
}

.resume-table .year-col {
  width: 16mm;
}

.resume-table .month-col {
  width: 12mm;
}

.empty-state {
  color: #666;
}

.career-preview {
  margin-top: 2.8mm;
}

.career-heading {
  margin: 0 0 0.8mm;
  font-size: 9pt;
}

.career-business {
  margin: 0 0 2mm;
  font-size: 8.4pt;
}

.career-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid #7e7e7e;
}

.career-table th,
.career-table td {
  border: 1px solid #7e7e7e;
  padding: 1.2mm 1.6mm;
  vertical-align: top;
  font-size: 8.1pt;
}

.career-table th {
  background: #f5f5f5;
  text-align: center;
  font-weight: 700;
}

.career-table th:first-child,
.career-table td:first-child {
  width: 26mm;
}

.career-role {
  margin: 0 0 1mm;
  font-weight: 700;
}

.detail-lines {
  display: grid;
  gap: 0.4mm;
}

.detail-lines p {
  margin: 0;
  white-space: pre-wrap;
}

.document-end {
  margin: 5mm 0 0;
  text-align: right;
  font-size: 8.6pt;
}

.wizard-nav {
  grid-template-columns: minmax(160px, 220px) repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  align-items: center;
  position: sticky;
  bottom: 12px;
  z-index: 11;
  padding: 12px;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 22px;
  background: rgba(255, 251, 246, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 30px rgba(58, 42, 20, 0.1);
}

.wizard-nav-note {
  margin: 10px 0 0;
  color: #9f3535;
  font-size: 0.84rem;
  line-height: 1.6;
  padding: 0 6px;
}

.chat-doc-grid,
.chat-answer-grid {
  display: grid;
  gap: 10px;
}

.chat-doc-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chat-doc-card,
.chat-answer-chip {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 16px;
  text-align: left;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
}

.chat-doc-card strong,
.chat-answer-chip strong {
  font-size: 1rem;
}

.chat-doc-card span,
.chat-answer-chip span,
.chat-answer-note {
  color: var(--muted);
  line-height: 1.6;
}

.chat-shell {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.chat-progress {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(31, 111, 93, 0.12);
  border-radius: 20px;
  background: rgba(31, 111, 93, 0.05);
}

.chat-progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.chat-progress-label,
.chat-progress-meta {
  margin: 0;
}

.chat-progress-label {
  color: var(--text);
  font-weight: 800;
}

.chat-progress-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.chat-progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(31, 111, 93, 0.12);
}

.chat-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f6f5d 0%, #4ea18d 100%);
  transition: width 180ms ease;
}

.chat-thread {
  display: grid;
  gap: 10px;
  max-height: 540px;
  overflow: auto;
  padding: 8px 4px 4px;
}

.chat-bubble {
  max-width: min(88%, 540px);
  padding: 14px 16px;
  border-radius: 20px;
  white-space: pre-wrap;
  line-height: 1.7;
  box-shadow: 0 10px 24px rgba(58, 42, 20, 0.07);
}

.chat-bubble-assistant {
  justify-self: start;
  border: 1px solid rgba(36, 33, 29, 0.08);
  background: rgba(255, 255, 255, 0.92);
}

.chat-bubble-user {
  justify-self: end;
  color: #fff;
  background: var(--primary);
}

.chat-quick-replies {
  display: grid;
  gap: 10px;
}

.chat-quick-replies-head {
  margin: 0;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 800;
}

.chat-quick-replies-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-reply-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(31, 111, 93, 0.18);
  border-radius: 999px;
  color: var(--primary);
  font-weight: 700;
  background: rgba(31, 111, 93, 0.1);
  cursor: pointer;
}

.chat-helper-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(31, 111, 93, 0.14);
  border-radius: 22px;
  background: rgba(31, 111, 93, 0.05);
}

.chat-helper-title {
  margin: 0;
  color: var(--primary);
  font-weight: 800;
}

.chat-helper-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.chat-helper-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.chat-helper-field {
  display: grid;
  gap: 6px;
}

.chat-helper-field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.chat-helper-grid-zip {
  grid-template-columns: 108px minmax(0, 1fr) auto;
}

.chat-helper-select,
.chat-helper-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
}

.chat-helper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-suggestion-list {
  display: grid;
  gap: 8px;
}

.chat-suggestion-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.chat-suggestion-card strong {
  font-size: 0.95rem;
}

.chat-suggestion-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.chat-zip-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 14px;
  color: var(--primary);
  font-weight: 800;
  border: 1px solid rgba(31, 111, 93, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
}

.chat-helper-note-strong {
  color: var(--text);
  font-weight: 700;
}

.chat-composer {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
}

.chat-composer textarea {
  min-height: 108px;
  max-height: 300px;
}

.chat-composer-actions,
.chat-answer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-answer-panel {
  margin-top: 18px;
}

.chat-answer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.chat-answer-chip.is-empty {
  opacity: 0.72;
}

.chat-answer-chip.is-current {
  border-style: dashed;
  background: rgba(31, 111, 93, 0.06);
  cursor: default;
}

.chat-paper-empty {
  display: grid;
  place-items: center;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .layout > * {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
  }

  .preview-panel {
    position: static;
  }

  .document-preview {
    justify-items: center;
    overflow-x: hidden;
  }
}

@media (max-width: 959px) {
  .site-header,
  .site-footer-grid,
  .hero-grid,
  .hero-actions,
  .home-points,
  .feature-grid,
  .consent-choice-grid,
  .document-choice-grid,
  .chat-doc-grid,
  .chat-answer-grid,
  .sample-role-grid,
  .final-education-grid,
  .field-grid,
  .history-grid,
  .input-with-action,
  .inline-actions,
  .narrow-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .site-brand {
    width: 100%;
    justify-content: flex-start;
  }

  .site-logo {
    width: min(100%, 252px);
    height: auto;
  }

  .site-nav {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .site-nav a {
    width: 100%;
  }

  .achievement-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .guide-cta-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .guide-cta-actions .primary-button,
  .guide-cta-actions .ghost-button {
    width: 100%;
    min-width: 0;
  }

  .hero-inline-note {
    display: grid;
    width: 100%;
  }

  .document-choice-card--primary {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 18px;
  }

  .document-choice-card--primary > * {
    min-width: 0;
  }

  .document-choice-card--primary .card-media {
    display: block;
    order: -1;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 200px;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: center;
    margin: 0;
  }

  .document-choice-card__content {
    gap: 10px;
  }

  .document-choice-points {
    gap: 6px;
  }

  .hero-visual {
    order: -1;
  }

  .hero-visual img,
  .hero-visual-compact img {
    width: min(100%, 260px);
  }

  .hero--chat {
    padding: 18px 18px 16px;
  }

  .hero--chat h1 {
    max-width: none;
  }

  .paper-page {
    width: min(100%, calc(100vw - 96px), 360px);
    max-width: 360px;
    min-height: auto;
    aspect-ratio: 210 / 297;
    margin-inline: auto;
    padding: 18px 14px 20px;
  }

  .chat-bubble {
    max-width: 100%;
  }

  .chat-shell {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
  }

  .chat-composer {
    position: sticky;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    z-index: 8;
    gap: 12px;
    padding: 12px;
    border-radius: 20px;
    background: rgba(255, 251, 246, 0.96);
    box-shadow: 0 14px 32px rgba(36, 33, 29, 0.12);
    backdrop-filter: blur(10px);
  }

  .chat-composer textarea {
    min-height: 132px;
    max-height: 220px;
  }

  .chat-composer-actions,
  .chat-answer-head {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-helper-grid,
  .chat-helper-grid-zip {
    grid-template-columns: 1fr;
  }

  .wizard-meta {
    position: static;
    padding: 10px 10px 8px;
  }

  .stepper {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(132px, 1fr);
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .stepper::-webkit-scrollbar {
    display: none;
  }

  .step-chip {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .save-status {
    font-size: 0.8rem;
  }

  .wizard-progress {
    gap: 6px;
    padding: 10px 12px;
  }

  .wizard-progress-label {
    font-size: 0.95rem;
  }

  .wizard-progress-meta {
    font-size: 0.8rem;
  }

  .wizard-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    bottom: 8px;
    padding: 8px;
    gap: 8px;
  }

  .wizard-nav .secondary-button {
    grid-column: 1 / -1;
  }

  .wizard-nav .ghost-button,
  .wizard-nav .secondary-button {
    min-height: 42px;
    padding: 0 10px;
    font-size: 0.92rem;
  }

  .wizard-nav .ghost-button {
    min-width: 0;
  }

  .wizard-nav-note {
    margin-top: 8px;
    font-size: 0.76rem;
    line-height: 1.45;
  }

  .doc-header {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .doc-header h3,
  .doc-meta {
    text-align: center;
  }
}

@media print {
  body {
    background: #fff;
  }

  body::before,
  .site-header,
  .site-footer,
  .hero,
  .form-panel,
  .section-heading {
    display: none !important;
  }

  .shell,
  .layout,
  .preview-panel,
  .document-preview {
    width: 100%;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 0;
    box-shadow: none;
  }

  .paper-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    box-shadow: none;
    break-after: page;
  }
}
