* { box-sizing: border-box; }
:root {
  color-scheme: light;
  font-family: "Segoe UI", "Noto Sans Armenian", Arial, sans-serif;
  color: #142842;
  background: #eef3f7;
  font-synthesis: none;
  --ink: #142842;
  --muted: #4e6177;
  --border: #dce5ed;
  --teal: #096b66;
}
body { margin: 0; min-width: 280px; font-size: 1rem; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #29a49c; outline-offset: 3px; }
button[disabled] { opacity: .45; cursor: default; }
[hidden] { display: none !important; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.top-inner {
  max-width: 1240px; margin: 0 auto; padding: 16px 34px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; min-width: 0; }
.brand-logo { display: block; width: clamp(116px, 16vw, 178px); max-width: 100%; height: auto; object-fit: contain; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.language { position: relative; flex: none; }
.language svg {
  position: absolute; inset-inline-start: 9px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; fill: none; stroke: var(--teal); stroke-width: 1.5; pointer-events: none;
}
.language select {
  max-width: 100%; min-height: 38px; padding: 5px 9px; padding-inline-start: 33px;
  border: 1px solid var(--border); border-radius: 8px; background-color: #fbfdff;
  color: var(--ink); font-size: .88rem; font-weight: 650; cursor: pointer;
}
.section-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #12334c; color: #a8f2e2; flex: none;
}
svg { display: block; }
.section-icon svg, .step-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; }
.storage { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.storage > span:first-child { width: 8px; height: 8px; border-radius: 50%; background: #16877c; flex: none; }
.layout {
  max-width: 1240px; margin: 0 auto; padding: 30px 34px 40px;
  display: grid; grid-template-columns: 256px minmax(0, 1fr); align-items: start; gap: 24px;
}
.layout:has(> .sidebar[hidden]) { grid-template-columns: minmax(0, 1fr); }
.layout:has(> .sidebar[hidden]) > .workspace { width: 100%; max-width: 940px; margin-inline: auto; }
.sidebar { position: sticky; top: 20px; border: 1px solid var(--border); border-radius: 16px; background: #fff; padding: 14px; }
.progress-box { background: #eaf5f4; border: 1px solid #d9eeeb; border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.progress-box > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #154e4a; }
.progress-box strong, #percent { font-size: .87rem; font-weight: 750; }
.progress-box small { font-size: .76rem; color: #3d6463; }
progress { display: block; width: 100%; height: 7px; margin: 11px 0 5px; overflow: hidden; accent-color: #117d74; appearance: none; border: 0; border-radius: 9px; background: #cfe5e4; }
progress::-webkit-progress-bar { background: #cfe5e4; }
progress::-webkit-progress-value { background: #117d74; border-radius: 9px; }
progress::-moz-progress-bar { background: #117d74; }
#steps { display: grid; gap: 4px; }
.step {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: start;
  min-height: 46px; padding: 6px 8px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--muted); font-size: .87rem; line-height: 1.22; font-weight: 650;
}
.step:hover { background: #f0f5f8; }
.step[aria-current] { background: #e4f4f2; border-color: #d5ebe8; color: #075c56; }
.step-icon { color: #45677e; flex: none; }
.step-icon svg { width: 20px; height: 20px; }
.step[aria-current] .step-icon { color: #08746a; }
.check { margin-inline-start: auto; color: var(--teal); visibility: hidden; }
.step.done .check { visibility: visible; }
.hero {
  min-height: 204px; position: relative; isolation: isolate; overflow: hidden; border-radius: 18px;
  display: flex; align-items: center; padding: 30px 36px; margin-bottom: 22px;
  color: #fff; background: linear-gradient(115deg, #102d48, #143b57 57%, #14615f);
}
.hero-content { position: relative; z-index: 1; }
.eyebrow { color: #9fe5db; font-size: .73rem; font-weight: 750; letter-spacing: .12em; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.15rem); margin: 9px 0 6px; line-height: 1.15; font-weight: 770; letter-spacing: -.035em; }
.hero p { color: #d9e9f2; margin: 0; max-width: 35ch; }
.hero-art { position: absolute; inset-inline-end: 0; bottom: -4px; width: clamp(185px, 35%, 320px); pointer-events: none; }
.hero-art svg { width: 100%; }
[dir="rtl"] .hero { background: linear-gradient(245deg, #102d48, #143b57 57%, #14615f); }
[dir="rtl"] .hero-art { transform: scaleX(-1); }
[lang="fa"] { font-family: Tahoma, "Segoe UI", Arial, sans-serif; }
[lang="fa"] .eyebrow, [lang="fa"] .section-heading small, [lang="fa"] .hero h1 { letter-spacing: normal; }
.card {
  border: 1px solid var(--border); background: #fff; border-radius: 17px;
  box-shadow: 0 5px 16px #182c4310; padding: 27px 30px; scroll-margin-top: 16px;
}
.card-header { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; padding-bottom: 19px; border-bottom: 1px solid var(--border); }
.section-icon { background: #e3f3f1; color: #087369; width: 48px; height: 48px; }
.section-heading small { display: block; font-size: .72rem; letter-spacing: .11em; color: #196f68; font-weight: 750; }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); line-height: 1.25; margin: 3px 0 0; }
.section-description { grid-column: 1 / -1; margin: 13px 0 0; color: var(--muted); }
.form-group { padding: 21px 0 0; }
.form-group + .form-group { border-top: 1px solid #edf0f3; margin-top: 22px; }
h3 { font-size: 1.04rem; margin: 0 0 14px; line-height: 1.35; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 17px; }
.field { min-inline-size: 0; }
.field.wide { grid-column: 1 / -1; }
.field.start-row { grid-column-start: 1; }
.question-with-followups, .question-followups, .question-followups > .form-group { grid-column: 1 / -1; }
.question-followups:not(:has(> :not([hidden]))) { display: none; }
.question-followups > .form-group { margin: 0; padding: 0; }
.question-followups > .form-group + .form-group { margin: 0; border-top: 0; }
.field label { display: block; margin-bottom: 6px; font-size: .91rem; color: #253b54; font-weight: 640; }
.required { color: #a53632; }
.field input, .field select, .field textarea {
  display: block; width: 100%; min-width: 0; min-height: 45px; padding: 9px 12px;
  border: 1px solid #cbd7e2; border-radius: 8px; color: var(--ink); background: #fbfdff;
}
.field input[type="date"] { max-inline-size: 100%; }
.phone-control { display: flex; gap: 6px; direction: ltr; }
.phone-control input { flex: 1; }
.phone-control .phone-code { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 45px; padding: 0 8px; }
.phone-flag { display: inline-block; width: 24px; height: 18px; flex: none; border-radius: 2px; background: url("/brand/phone-flags.png") no-repeat; background-size: 240px 450px; }
#phone-dialog { width: min(440px, calc(100vw - 36px)); max-height: calc(100dvh - 36px); }
#phone-dialog h2 { margin-block: 0 14px; }
.phone-options { max-height: min(42dvh, 23rem); overflow-y: auto; list-style: none; margin: 10px 0 0; padding: 2px; }
.phone-options .phone-option { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px; text-align: start; }
.phone-option bdi { margin-inline-start: auto; flex: none; }
.phone-option[aria-pressed="true"] { background: #e3f3f1; border-color: #9ac8c2; }
.field input[type="date"]::-webkit-date-and-time-value { min-block-size: 1.4em; text-align: start; }
.field select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%234e6177' stroke-width='1.5' d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
[dir="rtl"] .field select { padding: 9px 12px 9px 32px; background-position: left 10px center; }
.field textarea { resize: vertical; }
.field-help { display: block; margin-top: 5px; color: var(--muted); font-size: .86rem; }
.field-error:not(:empty) { display: block; margin-top: 5px; color: #a53632; font-size: .86rem; }
.field [aria-invalid="true"] { border-color: #a53632; }
.field .unavailable-toggle {
  display: flex; align-items: center; gap: 8px; margin: 8px 0 0; min-height: 36px; cursor: pointer;
}
.field .unavailable-toggle input { width: 18px; height: 18px; min-height: 0; flex: none; accent-color: var(--teal); }
.field input:disabled { background: #eef2f5; color: var(--muted); }
.country-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 8px 0 0; list-style: none; }
.country-list:empty { display: none; }
.country-list li {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 10px;
  max-width: 100%; padding: 4px 9px; background: #eef5f5; border-radius: 7px; overflow-wrap: anywhere;
}
.country-list .legacy-country { background: #fff1df; }
.photo-field > label { display: block; font-weight: 700; }
.photo-field input[type="file"] {
  display: block; max-width: 100%; margin-top: 8px; padding: 7px; border: 1px solid var(--border);
  border-radius: 8px; background: #fbfdff; overflow: hidden;
}
.photo-field input[type="file"]::file-selector-button {
  border: 0; border-radius: 6px; padding: 7px 10px; background: #e8f4f1; color: var(--teal); font: inherit; cursor: pointer;
}
.photo-feedback { color: var(--muted); margin: 5px 0; }
.photo-feedback:empty { display: none; }
.photo-feedback.photo-error { color: #a53632; }
.photo-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.photo-actions:not(:empty) { margin-top: 10px; }
.photo-preview { display: block; width: 120px; height: 120px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; }
.original { color: var(--muted); margin-top: 5px; font-size: .85rem; }
.original summary { cursor: pointer; width: fit-content; }
.original span { display: block; margin: 5px 0 0; }
.repeat-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 13px 0 8px; color: var(--muted); font-size: .86rem; }
.repeat-heading:has(+ .form-grid) + .form-grid { padding: 12px; border: 1px solid var(--border); border-radius: 9px; }
.actions { display: flex; gap: 12px; justify-content: space-between; margin-top: 17px; }
.questionnaire-actions { flex-wrap: wrap; }
#ceac-handoff { margin-inline-start: auto; }
#copy-view-toggle[aria-pressed="true"] { border-color: #096b66; color: #075853; }
.copy-view-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.copy-view-tools label { grid-column: 1 / -1; font-weight: 650; }
.copy-view-tools select, .copy-view-row textarea { min-width: 0; width: 100%; padding: 8px; border: 1px solid #cbd7e2; border-radius: 7px; font: inherit; color: inherit; background: #fff; }
.copy-view-status { min-height: 1.5em; margin: 6px 0 0; }
.copy-view-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.copy-view-row strong, .copy-view-choice { grid-column: 1 / -1; overflow-wrap: anywhere; }
.copy-view-row textarea { resize: vertical; }
.copy-view-row button { padding-inline: 10px; }
.primary, .plain, .danger { min-height: 44px; border: 1px solid transparent; border-radius: 9px; padding: 9px 16px; font-weight: 690; font-size: .9rem; }
.primary { background: #096b66; color: #fff; }
.primary:hover { background: #075853; }
.plain { background: #fff; border-color: #cbd7e2; color: var(--ink); }
.plain:hover:enabled { background: #eaf3f6; }
.add { margin-top: 12px; color: #096b66; }
.link { border: 0; background: transparent; color: #096b66; text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; font-size: .86rem; }
footer { color: var(--muted); margin-top: 23px; display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 12px; font-size: .82rem; }
.review-title { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.review-group h4 { margin: 13px 0 5px; }
.review-list { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.review-list dt, .review-list dd { border-bottom: 1px solid #edf0f3; padding: 8px 0; font-size: .91rem; overflow-wrap: anywhere; margin: 0; }
.review-list dt { color: var(--muted); padding-inline-end: 16px; }
.review-list dd { white-space: pre-wrap; }
.muted { color: var(--muted); margin: 0 0 8px; }
dialog { max-width: min(440px, calc(100vw - 36px)); padding: 24px; border: 1px solid var(--border); border-radius: 14px; color: var(--ink); }
dialog::backdrop { background: #102d4870; }
.intake-dialog { width: min(560px, calc(100% - 28px)); max-width: none; max-height: calc(100dvh - 28px); }
.intake-dialog h2 { margin-block: 0 14px; }
.intake-dialog .field + .field { margin-block-start: 12px; }
.intake-notice { margin-block: 15px 10px; padding: 12px; background: #f2f7f7; border-radius: 8px; }
.intake-notice h3 { margin: 0; }
.intake-notice small { color: var(--muted); }
.intake-notice p { margin: 6px 0 0; font-size: .9rem; }
.intake-check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.intake-check input { margin-block-start: .35em; flex: none; accent-color: var(--teal); }
#intake-feedback { color: #a53632; font-size: .9rem; }
.intake-edit { margin-block-end: 8px; }
.danger { background: #a53632; color: #fff; }
@media (max-width: 850px) {
  .layout { grid-template-columns: 202px minmax(0, 1fr); gap: 16px; padding-inline: 20px; }
  .top-inner { padding-inline: 20px; }
  .sidebar { padding: 9px; }
  .card { padding: 21px; }
}
@media (max-width: 660px) {
  .layout { display: block; padding: 15px 14px 28px; }
  .top-inner { padding: 12px 14px; }
  .top-actions { flex-direction: column-reverse; align-items: flex-end; gap: 6px; }
  .storage { font-size: .75rem; max-width: 142px; line-height: 1.25; }
  .sidebar { position: static; margin-bottom: 14px; border-radius: 12px; }
  .progress-box { margin-bottom: 7px; padding: 9px 11px; }
  #steps { display: flex; overflow-x: auto; scrollbar-width: thin; }
  .step { flex: 0 0 auto; width: auto; min-height: 41px; white-space: nowrap; gap: 7px; }
  .step .check { display: none; }
  .hero { min-height: 156px; padding: 20px; margin-bottom: 14px; }
  .hero-art { opacity: .4; width: 160px; inset-inline-end: -9px; }
  .hero p { font-size: .92rem; }
  .card { padding: 16px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .date-control {
    position: relative; min-width: 0; width: 100%; height: 45px; overflow: hidden;
    border: 1px solid #cbd7e2; border-radius: 8px; background: #fbfdff;
  }
  .field .date-control > input[type="date"] {
    -webkit-appearance: none; appearance: none;
    position: absolute; inset: 0; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%;
    height: 100%; min-height: 0; margin: 0; border: 0; border-radius: 0;
    background: transparent; outline: none;
  }
  .date-control:focus-within { outline: 3px solid #29a49c; outline-offset: 3px; }
}
@media (max-width: 435px) {
  .topbar:not(.home-header) .top-inner { flex-wrap: wrap; }
  .review-list { grid-template-columns: minmax(0, 1fr); }
  .review-list dt { border: 0; padding-bottom: 0; }
  .review-list dd { padding-top: 2px; }
}
@media print {
  @page { margin: 14mm; }
  .topbar, .sidebar, .hero-art, .hero p, .actions, footer, .review-title button,
  #shared-toolbar, #edit-intake, #pdf-export-status { display: none; }
  body { background: white; }
  .layout { display: block; padding: 0; width: 100%; }
  .hero { color: #142842; background: white; min-height: auto; padding: 0 0 16px; }
  .hero p, .eyebrow { color: #142842; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .review-title, .review-group h4 { break-after: avoid; }
  .review-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-list dt, .review-list dd { break-inside: avoid; }
}
