:root {
  --ink: #142b43;
  --muted: #526578;
  --blue: #2156a0;
  --line: #d8e0e7;
  --paper: #fff;
  --yellow: #f5dc85;
  --amber: #835710;
  --green: #217253;
  --red: #b12c36;
  --bg: #eef2f5;
  --shadow: 0 8px 28px #233d5610;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  color: var(--ink);
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 650;
}
button:hover:not(:disabled) {
  border-color: var(--blue);
  background: #f3f7fd;
}
a {
  color: var(--blue);
}
:focus-visible {
  outline: 3px solid #3978ca;
  outline-offset: 3px;
}
/* Route headings receive focus for screen readers, without a control outline.
   Interactive controls retain the visible keyboard focus ring above. */
.view-heading:focus {
  outline: none;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: -60px;
  left: 16px;
  background: white;
  padding: 12px;
}
.skip-link:focus {
  top: 8px;
}
.button.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.button.primary:hover {
  background: #16457f;
}
.text-button {
  background: transparent;
  border-color: transparent;
  color: var(--blue);
  text-decoration: underline;
  font-size: 0.85rem;
}
.danger {
  color: var(--red);
}
.eyebrow {
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  color: var(--blue);
  text-transform: uppercase;
}
.workspace-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  background: #fff;
  display: block;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 8px max(20px, calc((100vw - 1280px) / 2));
}
.workspace-header-main {
  display: flex;
  align-items: center;
  gap: inherit;
  min-width: 0;
}
.save-feedback {
  margin-top: 3px;
  font-size: 11px;
  color: #426156;
}
.save-feedback-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 7px;
  line-height: 1.4;
  min-height: 16px;
}
.save-time {
  color: var(--muted);
}
.save-feedback[data-state="pending"],
.save-feedback[data-state="error"] {
  color: #86531c;
}
.save-feedback .save-progress {
  margin: 3px 0 0;
}
.save-feedback .save-progress[hidden] {
  display: block !important;
  visibility: hidden;
}
.saving-dialog .save-progress {
  margin: 16px 0;
}
body[data-view="account"] .save-feedback,
body[data-view="dashboard"] .save-feedback {
  display: none;
}
.workspace-home {
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand-content {
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand-content img {
  width: 31px;
  height: 42px;
  object-fit: contain;
}
.workspace-brand {
  font-size: 0.75rem;
  display: grid;
  gap: 4px;
  letter-spacing: 0.04em;
}
.workspace-brand span {
  font-size: 0.58rem;
}
.workspace-title {
  border-left: 1px solid var(--line);
  margin-left: 22px;
  padding-left: 28px;
  display: grid;
  gap: 4px;
}
.workspace-title strong {
  font-size: 0.85rem;
}
.dashboard-link {
  margin-left: auto;
  font-size: 0.8rem;
}
.workspace-notice {
  font-size: 0.7rem;
}
.disclosure-button {
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 400;
  text-align: left;
}
.workspace-toolbar {
  max-width: 1240px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px;
  font-size: 0.75rem;
}
.workspace-toolbar > div {
  display: flex;
  gap: 16px;
  align-items: center;
}
.edition-badge {
  padding: 7px 10px;
  border: 1px solid #cbd8e4;
  border-radius: 30px;
  font-size: 0.7rem;
  font-weight: 650;
  color: #355471;
  background: #f9fbfe;
}
.draft-status {
  color: var(--muted);
  font-size: 0.72rem;
}
.workspace-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 920px);
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px calc(var(--toolbar-height, 72px) + 24px);
  align-items: start;
}
.workspace-sidebar {
  position: sticky;
  top: 84px;
}
.workspace-index {
  display: grid;
  gap: 4px;
}
.workspace-index button {
  font-size: 0.78rem;
  text-align: left;
  line-height: 1.5;
  background: transparent;
  border: 0;
  padding: 9px 10px;
  min-height: 40px;
  font-weight: 500;
}
.workspace-index button:hover {
  background: #e0e9f4;
}
.guidance-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-top: 25px;
  box-shadow: var(--shadow);
}
.guidance-card h2 {
  font-size: 1.05rem;
  line-height: 1.4;
}
.guidance-card p {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
}
.guidance-card .guidance-note {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  font-size: 0.7rem;
}
.remaining-button {
  width: 100%;
  font-size: 0.78rem;
  background: #f0f5fb;
  color: var(--blue);
}
.workspace-main {
  min-width: 0;
}
.workspace-intro {
  margin: 0 0 12px;
}
.workspace-intro h1,
.review-heading h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.05rem;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin: 10px 0 12px;
  font-weight: 500;
}
.workspace-intro > p:not(.eyebrow),
.review-heading > p {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 700px;
}
.workspace-intro details {
  font-size: 0.74rem;
  margin: 18px 0;
  padding: 12px 14px;
  border-left: 3px solid #d7b963;
  background: #faf7ee;
  line-height: 1.7;
}
.workspace-intro summary {
  cursor: pointer;
  color: var(--amber);
  font-weight: 650;
}
.document-stack {
  display: grid;
  gap: 20px;
}
.document-page {
  background: #fff;
  box-shadow:
    0 2px 5px #17324d0a,
    0 10px 28px #17324d0a;
  border: 1px solid #d4dce3;
  padding: 24px 28px;
  min-height: 0;
  border-radius: 3px;
}
.document-masthead {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 16px;
  margin-bottom: 18px;
  font-size: 0.68rem;
  line-height: 1.55;
}
.document-masthead > div {
  display: grid;
}
.document-masthead > div:last-child {
  text-align: right;
}
.document-masthead span {
  color: var(--muted);
  font-size: 0.61rem;
}
.document-part {
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  margin: 14px 0;
}
.document-section {
  margin: 16px 0 22px;
  scroll-margin-top: 130px;
}
.document-section > h2,
.output-section > h2 {
  background: var(--yellow);
  border: 1px solid #e1c96c;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.45;
}
.document-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
.document-field {
  min-width: 0;
  position: relative;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  transition:
    border-color 0.18s,
    background-color 0.18s;
  scroll-margin: 140px 0 170px;
}
.document-field > label:not(.exception) {
  font-size: 0.77rem;
  font-weight: 650;
  line-height: 1.5;
  display: block;
  margin-bottom: 7px;
}
.field-reference {
  color: var(--muted);
  font-size: 0.61rem;
  margin-right: 7px;
  font-weight: 500;
}
.optional {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 8px;
}
.field-help {
  font-size: 0.71rem;
  line-height: 1.65;
  color: var(--muted);
  margin: 3px 0 10px;
}
.document-field input:not([type="checkbox"]):not([type="radio"]),
.document-field select,
.document-field textarea,
.scan-field input {
  min-height: 46px;
  width: 100%;
  max-width: 100%;
  background: #fafcfe;
  border: 1px solid #b7c5d2;
  border-radius: 3px;
  padding: 10px;
  font-size: 1rem;
  color: #132c45;
  line-height: 1.35;
}
.document-field select {
  white-space: normal;
  min-width: 0;
}
.document-field textarea {
  resize: vertical;
}
.document-field input:disabled {
  background: #eef1f4;
  opacity: 0.7;
}
.document-field input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--blue);
  flex-shrink: 0;
}
.exception {
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
  margin-top: 7px;
  min-height: 32px;
}
.field-checkbox,
.field-photo,
.field-passportPhoto,
.field-textarea {
  grid-column: 1/-1;
}
.field-checkbox {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.field-checkbox > label {
  flex: 1;
}
.field-checkbox .field-help {
  width: 100%;
  padding-left: 30px;
  order: 2;
}
.field-checkbox input {
  margin-top: 0;
}
.field-error {
  font-size: 0.72rem;
  color: var(--red);
  line-height: 1.5;
  margin: 4px 0 0;
  min-height: 0;
}
.field-error:empty {
  display: none;
}
.document-field.is-active {
  border-color: #4e80c1;
  background: #f5f9ff;
  box-shadow: 0 0 0 2px #3672bd0d;
}
.document-field.is-active:before {
  content: "➜";
  position: absolute;
  color: var(--blue);
  left: -22px;
  top: 14px;
  font-size: 20px;
}
.document-field.is-guided {
  animation: field-pulse 0.65s ease-out 1;
}
.document-field.is-complete:not(.is-active) > label .field-reference {
  color: var(--green);
}
.document-field.is-invalid {
  border-color: #ca6b70;
  background: #fff9f9;
}
.document-field.is-invalid input {
  border-color: var(--red);
}
.media-control {
  padding: 18px;
  border: 1px dashed #b7c7d7;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.photo-placeholder {
  width: 72px;
  min-height: 64px;
  border: 1px solid #c9d6e0;
  display: grid;
  place-items: center;
  background: #fff;
  font-size: 30px;
  color: #64809c;
  border-radius: 5px;
}
.document-photo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 4px;
}
.passport-preview {
  max-width: 160px;
  max-height: 110px;
  object-fit: contain;
}
.media-status {
  font-size: 0.75rem;
  line-height: 1.6;
  flex: 1;
  min-width: 130px;
  color: var(--muted);
}
.media-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.media-actions button {
  font-size: 0.75rem;
}
.photo-confirm {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.74rem;
  line-height: 1.6;
  width: 100%;
}
.photo-advice {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  width: 100%;
  font-size: 0.74rem;
  line-height: 1.6;
}
.photo-advice summary {
  cursor: pointer;
  font-weight: 650;
}
.photo-examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 15px 0;
}
.face-example {
  height: 85px;
  background: #fff;
  border: 1px solid #c8d8cc;
  display: grid;
  place-items: center;
  font-size: 60px;
  color: #59756b;
}
.face-example.incorrect {
  transform: rotate(-8deg);
  color: #a87b4a;
  background: repeating-linear-gradient(
    45deg,
    #f3e9d9,
    #f3e9d9 9px,
    #e9dbc3 9px,
    #e9dbc3 12px
  );
}
.family-tools {
  border-top: 1px solid var(--line);
  padding: 18px 8px;
  line-height: 1.7;
  font-size: 0.8rem;
}
.family-tools h3 {
  font-size: 0.9rem;
}
.second-entry {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 25px;
}
.second-entry input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.recommendation {
  padding: 12px;
  background: #f4f7fb;
  border-left: 3px solid #7b9bc2;
}
.document-end {
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
}
.workspace-bottom {
  position: fixed;
  bottom: var(--viewport-bottom, 0px);
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 8px max(24px, calc((100vw - 1200px) / 2))
    max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 25px #1a35540b;
  background: #fff;
}
.completion {
  display: grid;
  grid-template-columns: 42px 130px;
  align-items: center;
  gap: 5px 10px;
}
.completion strong {
  font-size: 1.1rem;
}
.completion progress {
  width: 100%;
  height: 6px;
  appearance: none;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  accent-color: var(--blue);
}
progress::-webkit-progress-bar {
  background: #e4ebf2;
}
progress::-webkit-progress-value {
  background: var(--blue);
  transition: width 0.25s;
}
.current-section {
  grid-column: 1/-1;
  font-size: 0.65rem;
  color: var(--muted);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.field-navigation {
  display: flex;
  gap: 8px;
}
.field-navigation button {
  font-size: 0.75rem;
}
.workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.workspace-actions button {
  font-size: 0.75rem;
}
.package-indicator {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.workspace-dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  max-width: 680px;
  width: calc(100% - 32px);
  max-height: min(85dvh, calc(var(--viewport-height, 100dvh) - 24px));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
  color: var(--ink);
  box-shadow: 0 20px 80px #152d4840;
}
html.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}
body.dialog-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
}
.workspace-dialog > *,
.scan-review > *,
.scan-field {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.workspace-dialog::backdrop {
  background: #10253e80;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 18px;
}
.dialog-heading h2 {
  font-family: Georgia, serif;
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 4px 0;
}
.dialog-close {
  font-size: 25px;
  border: 0;
  background: #f1f4f7;
  flex-shrink: 0;
  min-width: 44px;
  padding: 4px;
}
.workspace-dialog p,
.workspace-dialog li {
  font-size: 0.86rem;
  line-height: 1.7;
}
.workspace-dialog .button {
  margin: 5px 6px 5px 0;
}
.notice {
  padding: 14px;
  border: 1px solid #e6d9ae;
  background: #fcf8ea;
  border-radius: 6px;
  color: #6c541d;
  font-size: 0.8rem;
  line-height: 1.7;
}
.error {
  color: var(--red);
}
.missing-list {
  display: grid;
  gap: 7px;
}
.missing-item {
  text-align: left;
  padding: 14px;
}
.missing-item span {
  display: grid;
  gap: 5px;
}
.missing-item small {
  color: var(--muted);
  font-weight: 400;
}
.crop-preview {
  position: relative;
  width: min(100%, 360px);
  margin: auto;
}
.crop-preview canvas {
  width: 100%;
  aspect-ratio: 1;
  display: block;
}
.face-outline {
  position: absolute;
  border: 2px dashed #fff;
  box-shadow: 0 0 0 1px #18304770;
  border-radius: 50%;
  top: 15%;
  left: 27%;
  width: 46%;
  height: 58%;
  pointer-events: none;
}
.crop-controls {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.crop-controls label {
  font-size: 0.8rem;
  display: grid;
  gap: 5px;
}
.crop-controls input {
  width: 100%;
  height: 30px;
  accent-color: var(--blue);
}
.crop-controls input:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.workspace-dialog .crop-position-help {
  color: var(--muted);
  font-size: 0.78rem;
  margin: -6px 0 0;
}
.crop-reset {
  padding-left: 0;
}
.scan-field {
  display: grid;
  gap: 8px;
  margin: 15px 0;
  font-size: 0.8rem;
}
.package-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.package-choice {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px;
}
.package-choice.selected {
  border: 2px solid var(--blue);
}
.package-choice h3 {
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.package-choice p {
  font-size: 0.75rem;
}
.save-price {
  font-weight: 700;
  font-size: 1.1rem !important;
}
.benefit-list {
  padding-left: 20px;
}
.benefit-list li {
  padding: 5px;
}
.review-heading {
  margin-bottom: 28px;
}
.review-content {
  display: grid;
  gap: 18px;
}
.review-card,
.review-warnings,
.dashboard-card,
.dashboard-notice {
  background: #fff;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.review-card-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.review-card-heading h2 {
  font-size: 0.95rem;
  margin: 0;
  flex: 1;
}
.review-card-heading span {
  font-size: 0.7rem;
}
.status-amber {
  color: var(--amber);
}
.status-green {
  color: var(--green);
}
.review-card dl,
.worksheet-output dl {
  margin: 15px 0 0;
}
.review-card dl > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid #e8edf1;
  padding: 9px 0;
  gap: 14px;
  font-size: 0.78rem;
  line-height: 1.5;
}
.review-card dt {
  color: var(--muted);
}
.review-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.review-warnings {
  margin: 14px 0;
  background: #fffbef;
  font-size: 0.8rem;
  line-height: 1.7;
}
.review-warnings h2 {
  font-size: 1rem;
}
.review-warnings li {
  margin-bottom: 12px;
}
.review-actions {
  line-height: 1.7;
  font-size: 0.85rem;
}
.review-actions button {
  margin: 5px;
}
.dashboard-card {
  margin: 14px 0;
}
.dashboard-card h2 {
  font-family: Georgia, serif;
  font-size: 1.8rem;
  font-weight: 500;
}
.dashboard-card p,
.dashboard-notice p {
  font-size: 0.85rem;
  line-height: 1.7;
}
.dashboard-notice h2 {
  font-size: 1rem;
}
.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
body:not([data-view="document"]) .workspace-layout {
  grid-template-columns: minmax(0, 900px);
  justify-content: center;
}
.worksheet-output {
  background: #fff;
  padding: 40px;
  border: 1px solid var(--line);
  line-height: 1.6;
}
.worksheet-output h1 {
  font-family: Georgia, serif;
  font-size: 1.7rem;
  line-height: 1.3;
}
.worksheet-output header {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 16px;
  margin-bottom: 25px;
}
.worksheet-output header p {
  font-size: 0.75rem;
}
.worksheet-output dl > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  font-size: 0.78rem;
}
.worksheet-output dt {
  color: var(--muted);
}
.worksheet-output dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.output-section {
  margin: 25px 0;
  font-size: 0.8rem;
}
.output-section li {
  margin-bottom: 10px;
}
.preview-toolbar {
  font-size: 0.8rem;
  line-height: 1.6;
  margin: 15px 0 25px;
}
.preview-toolbar p {
  color: var(--muted);
}
@keyframes field-pulse {
  0% {
    box-shadow: 0 0 0 6px #3b76c121;
  }
  100% {
    box-shadow: 0 0 0 2px #3672bd0d;
  }
}
@media (max-width: 1100px) {
  .workspace-layout {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 25px;
  }
  .workspace-bottom {
    gap: 12px;
  }
  .completion {
    grid-template-columns: 35px 70px;
  }
  .completion progress {
    width: 70px;
  }
  .package-indicator {
    display: none;
  }
  .workspace-title {
    margin-left: 8px;
    padding-left: 15px;
  }
}
/* Compact document workspace */
.workspace-intro h1 {
  font:
    700 1.2rem/1.35 Arial,
    sans-serif;
  letter-spacing: -0.025em;
  margin: 0 0 4px;
}
.workspace-intro > p:not(.eyebrow) {
  font-size: 0.78rem;
  line-height: 1.5;
  margin: 0 0 4px;
}
.document-options {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.zoom-control {
  font-size: 0.7rem;
  min-height: 32px;
  padding: 4px 8px;
  background: transparent;
}
.document-large .document-page {
  font-size: 1.15rem;
}
.document-large .document-field > label:not(.exception) {
  font-size: 1rem;
}
.document-large
  .document-field
  input:not([type="checkbox"]):not([type="radio"]),
.document-large .document-field select {
  font-size: 1.15rem;
}
.document-field > label:not(.exception) {
  padding-right: 24px;
}
.field-help {
  display: none;
}

.field-help-toggle {
  position: absolute;
  right: 3px;
  top: 1px;
  min-width: 28px;
  min-height: 28px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  padding: 2px;
  color: var(--blue);
  font-size: 0.75rem;
  background: #eef4fa;
}
.fields-identity {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.fields-identity .document-field {
  grid-column: span 3;
}
.fields-identity .field-name {
  grid-column: span 2;
}
.fields-eligibility .document-field,
.fields-family .document-field {
  grid-column: 1/-1;
}
.radio-options {
  display: flex;
  gap: 12px;
  min-height: 44px;
  align-items: center;
  flex-wrap: wrap;
}
.radio-options label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  font-size: 0.9rem;
  cursor: pointer;
}
.radio-options input {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
  margin: 0;
}
.country-control {
  position: relative;
}
.country-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: min(220px, 30vh);
  overflow: auto;
  z-index: 12;
  background: white;
  border: 1px solid #9cb1c4;
  box-shadow: 0 6px 16px #142b4322;
  border-radius: 0 0 5px 5px;
}
.country-options [role="option"] {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 12px;
  border: 0;
  border-radius: 0;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
}
.country-options [aria-selected="true"],
.country-options [role="option"]:hover {
  background: #e8f0fc;
  color: #153e75;
}
.country-options p {
  padding: 12px;
  font-size: 0.8rem;
}
.scan-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 0 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.scan-entry-button {
  border: 0;
  min-height: 40px;
  padding: 8px 0;
  color: var(--blue);
  background: #eef4fd;
  border-radius: 5px;
  font-size: 0.8rem;
}
.scan-entry-button > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.scan-tap {
  flex: 0 0 20px;
}
.scan-entry-button:hover,
.scan-entry-button:focus-visible {
  background: #dfeafb;
  text-decoration: underline;
}
.scan-summary {
  font-weight: 650;
}
@media (prefers-reduced-motion: no-preference) {
  .scan-tap {
    animation: scan-invitation 0.8s ease-in-out 2;
  }
  @keyframes scan-invitation {
    50% {
      transform: translate(2px, 2px);
    }
  }
}
.scan-entry > span {
  font-size: 0.68rem;
  color: var(--muted);
}
.scan-choices {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin: 18px 0;
}
.scan-choices .scan-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  min-height: 60px;
  padding: 14px 10px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.35;
  box-shadow: 0 2px 5px #142b4308;
}
.scan-choice img {
  flex: 0 0 22px;
}
.scan-choices .scan-choice-camera {
  color: #fff;
  background: linear-gradient(160deg, #2b64b0, #1b4b8c);
  border-color: #2156a0;
  box-shadow:
    0 4px 10px #2156a01a,
    inset 0 1px 0 #ffffff26;
}
.scan-choices .scan-choice-camera:hover:not(:disabled) {
  background: #19477f;
}
.scan-choices .scan-choice-upload {
  color: var(--blue);
  background: #f8faff;
  border-color: #cbd9eb;
}
.scan-choices .scan-choice-upload:hover:not(:disabled) {
  background: #edf3fc;
  border-color: var(--blue);
}
.scan-intro .scan-privacy {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
  margin: 12px 0 18px;
}
.scan-intro .photo-confirm {
  align-items: center;
  min-height: 44px;
}
.scan-intro .photo-confirm input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 18px;
  accent-color: var(--blue);
}
.scan-selection-status:empty {
  display: none;
}
.scan-privacy-link {
  font-size: 0.74rem;
  color: var(--muted);
  text-underline-offset: 3px;
}
.scan-review {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: start;
}
.scan-progress {
  height: 3px;
  margin: -4px 0 18px;
  border-radius: 2px;
  overflow: hidden;
  background: #eef6f0;
}
.scan-progress::before {
  content: "";
  display: block;
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, #198552, #8ad3aa 65%, #fff);
  animation: scan-reading 1.8s linear infinite;
}
.scan-progress.save-progress::before {
  animation-delay: -0.55s;
}
@keyframes scan-reading {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(225%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .scan-progress::before {
    animation: none;
    width: 100%;
  }
}
.scan-image {
  position: sticky;
  top: 0;
  background: #eef2f5;
  padding: 8px;
  border-radius: 6px;
}
.scan-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
}
.scan-field label {
  font-weight: 600;
}
.scan-field input,
.scan-field select {
  display: block;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  width: 100%;
  font-size: 16px;
  padding: 8px;
  border: 1px solid #aabccc;
  border-radius: 4px;
}
.scan-field small {
  color: var(--muted);
  font-size: 0.7rem;
}
.scan-missing {
  border-left: 3px solid #e1c96c;
  padding-left: 9px;
}
.scan-warning {
  font-size: 0.75rem !important;
  color: var(--amber);
}
.scan-values {
  min-width: 0;
}
.compact-remaining {
  font-size: 0.68rem;
  color: var(--muted);
}
.completion progress {
  grid-column: 1/-1;
}
.actions-toggle {
  display: none;
}
.previous-field,
.next-field {
  font-size: 1.3rem;
  min-width: 44px;
  padding: 6px 10px;
}
.actions-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.actions-sheet {
  max-width: 460px;
  border: 0;
  border-radius: 24px;
  padding: 24px;
}
.actions-sheet .dialog-heading {
  align-items: center;
  margin-bottom: 8px;
}
.actions-sheet .dialog-heading h2 {
  font:
    700 1.15rem/1.35 Arial,
    sans-serif;
  letter-spacing: -0.02em;
}
.actions-sheet .dialog-close {
  border-radius: 50%;
  width: 44px;
  height: 44px;
  background: #eef2f6;
}
.actions-sheet .actions-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  margin: 0 0 20px;
}
.actions-completion {
  color: #215345;
  background: #eaf4ef;
  border-radius: 20px;
  padding: 3px 9px;
  font-weight: 600;
}
.actions-package {
  background: linear-gradient(125deg, #eef4fc, #f8fafc);
  border: 1px solid #d5e2f3;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
.actions-package-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.actions-package-caption {
  color: var(--muted);
  font-size: 0.68rem;
}
.actions-package h3 {
  font-size: 0.95rem;
  margin: 5px 0 0;
}
.actions-package-price {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.actions-package-price small {
  display: block;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 3px;
}
.actions-sheet .actions-buy {
  display: block;
  width: 100%;
  margin: 0;
  border-radius: 10px;
  min-height: 46px;
  font-size: 0.85rem;
  box-shadow: 0 3px 8px #2156a01a;
}
.actions-package-change {
  display: block;
  width: 100%;
  color: var(--blue);
  background: transparent;
  border: 0;
  font-size: 0.75rem;
  margin: 4px 0 -8px;
}
.preparation-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  text-align: left;
  font-size: 0.83rem;
  border: 0;
  border-radius: 0;
  padding: 10px 14px;
}
.actions-list .preparation-action + .preparation-action {
  border-top: 1px solid #e9eef3;
}
.action-icon {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--blue);
  background: #eef4fc;
}
.action-icon svg {
  width: 19px;
  height: 19px;
}
.action-chevron {
  margin-left: auto;
  color: #718194;
  font-size: 1.3rem;
  font-weight: 400;
}
.actions-exit {
  margin-top: 12px;
  border-radius: 12px;
  color: var(--muted);
}
.actions-exit .action-icon {
  background: #f1f4f7;
  color: var(--muted);
}
.dialog-open .workspace-bottom,
.field-editing .workspace-bottom {
  visibility: hidden;
  pointer-events: none;
}
@media (max-width: 800px) {
  .workspace-header {
    min-height: 58px;
    padding: 6px 12px;
    gap: 8px;
    position: sticky;
  }
  .brand-content {
    gap: 6px;
  }
  .brand-content img {
    width: 26px;
    height: 35px;
  }
  .workspace-brand {
    font-size: 0.62rem;
    letter-spacing: 0;
    gap: 3px;
  }
  .workspace-brand span {
    font-size: 0.49rem;
  }
  .workspace-title {
    display: none;
  }
  .dashboard-link {
    font-size: 0.65rem;
    padding: 7px;
    min-height: 40px;
  }
  .workspace-toolbar {
    padding: 6px 12px;
    gap: 8px;
  }
  .workspace-toolbar > div {
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
  }
  .edition-badge {
    font-size: 0.6rem;
    padding: 3px 6px;
  }
  .draft-status {
    font-size: 0.6rem;
  }
  .workspace-toolbar .text-button {
    font-size: 0.65rem;
    min-height: 32px;
    padding: 4px;
    white-space: nowrap;
  }
  .workspace-layout {
    display: block;
    padding: 6px 10px calc(var(--toolbar-height, 64px) + 16px);
  }
  .workspace-sidebar {
    display: none;
  }
  .workspace-intro {
    margin: 0 4px 10px;
  }
  .workspace-intro h1 {
    font-size: 1.05rem;
  }
  .workspace-intro > p:not(.eyebrow) {
    font-size: 0.7rem;
  }
  .document-options {
    gap: 8px;
  }
  .disclosure-button {
    font-size: 0.62rem;
    min-height: 28px;
  }
  .zoom-control {
    font-size: 0.62rem;
    min-height: 28px;
    padding: 2px 5px;
  }
  .document-options .workspace-notice {
    flex: 1;
  }
  .document-page {
    padding: 14px 12px;
    border-radius: 2px;
  }
  .document-masthead {
    font-size: 0.54rem;
    gap: 10px;
    padding-bottom: 9px;
    margin-bottom: 10px;
  }
  .document-masthead span {
    font-size: 0.51rem;
  }
  .document-masthead strong {
    max-width: 160px;
  }
  .document-part {
    font-size: 0.73rem;
    margin: 10px 0;
  }
  .document-section {
    margin: 12px 0 16px;
    scroll-margin-top: 80px;
  }
  .document-section > h2 {
    font-size: 0.75rem;
    padding: 7px 9px;
    margin-bottom: 8px;
  }
  .document-fields {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .document-field,
  .fields-identity .document-field {
    grid-column: 1/-1;
    padding: 7px 5px;
    scroll-margin-top: 90px;
  }
  .document-field > label:not(.exception) {
    font-size: 0.78rem;
    margin-bottom: 6px;
  }
  .document-field input:not([type="checkbox"]):not([type="radio"]),
  .document-field select {
    font-size: 16px;
    min-height: 44px;
    padding: 9px 8px;
  }
  .document-field.is-active:before {
    left: -12px;
    font-size: 13px;
    top: 12px;
  }
  .field-reference {
    font-size: 0.65rem;
  }
  .field-help-toggle {
    min-height: 32px;
    min-width: 32px;
    top: 0;
    right: 0;
  }
  .exception {
    font-size: 0.71rem;
    min-height: 32px;
  }
  .scan-entry {
    gap: 0;
    padding-bottom: 6px;
  }
  .scan-entry > span {
    display: none;
  }
  .scan-entry-button {
    font-size: 0.76rem;
    min-height: 36px;
    padding: 4px 0;
  }
  .media-control {
    padding: 12px;
    gap: 10px;
  }
  .media-status {
    font-size: 0.73rem;
    min-width: 100px;
  }
  .media-actions {
    width: 100%;
  }
  .media-actions button {
    flex: 1;
    font-size: 0.72rem;
  }
  .workspace-bottom {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
    gap: 10px;
    padding: 8px max(12px, env(safe-area-inset-left))
      max(8px, env(safe-area-inset-bottom));
    min-height: 60px;
    align-items: center;
  }
  .completion {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 6px;
  }
  .completion strong {
    font-size: 0.86rem;
  }
  .completion progress {
    width: 100%;
    height: 4px;
  }
  .compact-remaining {
    font-size: 0.65rem;
    white-space: nowrap;
  }
  .current-section {
    display: none;
  }
  .workspace-actions {
    display: none;
  }
  .actions-toggle {
    display: block;
    font-size: 1rem;
    padding: 6px;
    min-width: 44px;
    min-height: 44px;
  }
  .previous-field,
  .next-field {
    height: 44px;
    border: 0;
    background: #f1f5f9;
  }
  .next-field {
    background: var(--blue);
    color: white;
  }
  .keyboard-open .workspace-header {
    position: static;
  }
  .workspace-dialog {
    position: fixed;
    inset: auto 0 var(--viewport-bottom, 0px);
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: calc(var(--viewport-height, 100dvh) - 12px);
    border-radius: 18px 18px 0 0;
    padding: 18px max(16px, env(safe-area-inset-left))
      max(18px, env(safe-area-inset-bottom));
  }
  .workspace-dialog .dialog-heading h2 {
    font:
      700 1.15rem/1.35 Arial,
      sans-serif;
  }
  .workspace-dialog.actions-sheet {
    max-width: none;
    border-radius: 24px 24px 0 0;
    padding-top: 12px;
  }
  .actions-sheet::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 4px;
    background: #d8e0e7;
    margin: 0 auto 10px;
  }
  .scan-review {
    grid-template-columns: minmax(0, 1fr);
  }
  .scan-image {
    position: static;
  }
  .scan-image img {
    max-height: 180px;
  }
  .package-choices {
    grid-template-columns: 1fr;
  }
  .review-heading {
    padding: 8px 4px;
  }
  .review-card,
  .review-warnings,
  .dashboard-card,
  .dashboard-notice {
    padding: 16px;
  }
  .review-card dl > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .review-card-heading h2 {
    font-size: 0.85rem;
  }
  .worksheet-output {
    padding: 16px;
  }
  .worksheet-output h1 {
    font-size: 1.1rem;
  }
  .worksheet-output dl > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .document-stack {
    gap: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  :root,
  html,
  body {
    background: white;
  }
  .skip-link,
  .workspace-dialog,
  .workspace-header,
  .workspace-notice,
  .workspace-toolbar,
  .workspace-sidebar,
  .workspace-bottom,
  .preview-toolbar,
  .sr-only {
    display: none !important;
  }
  .workspace-layout {
    display: block;
    padding: 0;
    margin: 0;
    max-width: none;
  }
  .worksheet-output {
    padding: 0;
    border: 0;
  }
  .output-section {
    break-inside: auto;
  }
  .output-section:last-child {
    break-inside: avoid;
  }
  .worksheet-output h2 {
    break-after: avoid;
  }
  .worksheet-output dl > div {
    break-inside: avoid;
  }
  .worksheet-output dl > div {
    grid-template-columns: 45% minmax(0, 1fr);
  }
  .worksheet-output {
    min-height: 0;
    box-shadow: none;
  }
  .worksheet-output dd {
    color: #000;
  }
  .worksheet-output h2 {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  @page {
    size: A4;
    margin: 16mm;
  }
}
/* Account controls remain comfortable with a mobile keyboard open. */
#account-email,
#account-code {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem;
  margin: 0.5rem 0 1rem;
  border: 1px solid #afbdd1;
  border-radius: 0.5rem;
  font: inherit;
}

.question-group {
  margin: 12px 0 16px;
}
.question-group > h2 {
  background: var(--yellow);
  border: 1px solid #e1c96c;
  padding: 8px 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0 0 8px;
}
.question-group .document-fields {
  grid-template-columns: 1fr;
}
.question-group .name-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.worksheet-output {
  padding: 0;
  border: 0;
  background: transparent;
}
.worksheet-output .document-masthead {
  margin: 0;
  padding-bottom: 12px;
}
.output-identification {
  font-size: 0.68rem;
  color: var(--muted);
}
.worksheet-output .output-row {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0 0 8px;
}
.worksheet-output .columns-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.worksheet-output dl > div {
  display: block;
  border: 1px solid var(--line);
  padding: 10px;
  font-size: 0.8rem;
}
.worksheet-output dt {
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.worksheet-output dd {
  color: var(--ink);
}
.worksheet-output small {
  display: block;
  font-size: 0.65rem;
  margin-top: 7px;
  color: var(--muted);
}
@media (max-width: 800px) {
  .question-group > h2 {
    font-size: 0.77rem;
    padding: 7px 9px;
  }
  .question-group .name-fields,
  .worksheet-output .columns-3 {
    grid-template-columns: 1fr;
  }
}
@media print {
  .worksheet-output .output-page {
    break-before: page;
  }
  .worksheet-output .output-page:first-child {
    break-before: auto;
  }
  .output-row {
    break-inside: avoid;
  }
}

.date-parts {
  display: grid;
  grid-template-columns: minmax(60px, 0.7fr) minmax(95px, 1.3fr) minmax(
      80px,
      1fr
    );
  gap: 10px;
  max-width: 440px;
}
.date-parts label {
  display: grid;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--muted);
}
.date-parts input,
.date-parts select {
  min-width: 0;
}

.radio-stacked {
  display: grid;
  gap: 0;
}
.radio-education {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
.radio-stacked label,
.radio-education label {
  font-size: 0.8rem;
}
@media (max-width: 800px) {
  .radio-education {
    grid-template-columns: 1fr;
  }
  .workspace-home {
    flex-shrink: 1;
    min-width: 0;
  }
  .workspace-brand {
    overflow-wrap: anywhere;
  }
  .dashboard-link {
    max-width: 45%;
  }
}

/* The paid viewer uses a server-authorized PDF; unpaid placeholders contain no answers. */
.pdf-page-surface {
  background: white;
  border: 1px solid #d6dfe8;
  border-radius: 8px;
  overflow: hidden;
  min-height: 240px;
}
.pdf-page-surface canvas {
  display: block;
  width: 100%;
  height: auto;
}
.pdf-paging {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 16px 0;
}
.pdf-paging .button {
  padding: 10px;
  font-size: 0.75rem;
}
.pdf-paging [role="status"] {
  font-size: 0.75rem;
  text-align: center;
}
.pdf-content > p,
.purchase-summary {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
}
.review-actions .purchase-summary {
  flex-basis: 100%;
}
.preview-redacted {
  opacity: 0.5;
  filter: blur(3px);
  user-select: none;
}
.preview-redacted h2 {
  font-size: 0.9rem;
  padding: 12px;
  background: #f4df8b;
}
.redacted-line {
  height: 12px;
  margin: 14px 0;
  background: #d7dfe7;
  border-radius: 4px;
}
.redacted-line:last-child {
  width: 65%;
}
.preview-lock {
  position: relative;
  margin-top: -230px;
  padding: 26px 20px;
  text-align: center;
  border: 1px solid #cfdbe9;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px #16324e18;
}
.preview-lock h2 {
  font-size: 1.15rem;
}
.preview-lock p {
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
}
.preview-lock-symbol {
  color: #245b9e;
  font-size: 2rem;
}
.preview-watermark {
  text-align: center;
  font: 700 0.7rem/1.6 sans-serif;
  letter-spacing: 0.08em;
  color: #52677c;
  margin-top: 32px;
}
@media print {
  .limited-preview .preview-lock,
  .limited-preview .preview-watermark {
    display: block;
  }
}
