/* Styles for the doctor's study and its petition builder. */
.office-stage {
    --office-ink: #342e24;
    --office-soft: #6d604c;
    --office-line: #d6c5a7;
    --office-green: #315e45;
    --office-paper: #fffaf0;
    color: var(--office-ink);
}

.office-stage::after { background: linear-gradient(90deg, rgba(24,22,17,.13), rgba(24,22,17,.37)); }
.office-stage .scene-heading { top: 18px; left: 24px; width: min(470px, calc(100vw - 280px)); padding: 11px 16px; }
.office-stage .scene-heading h1 { font-size: clamp(21px, 2.1vw, 29px); }
.office-stage .scene-heading .scene-eyebrow { font-size: 10px; }
.office-stage .scene-actions { top: 18px; }
.office-stage .back-button { min-height: 46px; padding: 6px 12px 6px 7px; font-size: 15px; }
.office-stage .back-button .nav-arrow { width: 28px; height: 28px; flex-basis: 28px; }

.office-workspace {
    position: absolute;
    z-index: 8;
    top: 158px;
    bottom: 20px;
    left: 50%;
    width: min(1140px, calc(100vw - 48px));
    transform: translateX(-50%);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #b8a184 #f3ead9;
    scrollbar-gutter: stable;
    border: 1px solid #cdb895;
    border-radius: 20px;
    color: var(--office-ink);
    background: var(--office-paper);
    box-shadow: 0 20px 60px rgba(22,18,12,.32), 0 0 0 5px rgba(61,48,30,.13);
    text-align: left;
}

.office-header { padding: 24px 30px 19px; background: #f4e9d5; }
.office-eyebrow { display: block; color: #78603b; font-size: 11px; line-height: 1.4; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.office-header h2 { margin: 7px 0 0; font: 700 clamp(25px, 2.4vw, 34px)/1.13 Georgia, "Times New Roman", serif; letter-spacing: -.02em; }
.office-steps { display: flex; align-items: center; gap: 25px; margin: 0; padding: 13px 30px; border-block: 1px solid #dfceb0; list-style: none; background: #f4e9d5; }
.office-steps li { display: flex; align-items: center; gap: 8px; color: #746956; font-size: 14px; line-height: 1.25; }
.office-steps li > span:first-child { display: grid; place-items: center; flex: 0 0 25px; width: 25px; height: 25px; border: 1px solid #bca98a; border-radius: 50%; font-size: 12px; font-weight: 800; }
.office-steps li.is-current { color: #355039; font-weight: 800; }
.office-steps li.is-current > span:first-child { color: #fff; border-color: #3e5a43; background: #3e5a43; }
.office-steps li.is-done { color: var(--office-green); }
.office-steps li.is-done > span:first-child { border-color: #9aab89; background: #e3eada; }
.office-paper { padding: 27px 30px 30px; background: linear-gradient(112deg, #fffaf0, #f8efdf); }
.office-lead { max-width: 870px; margin: 0 0 24px; color: var(--office-soft); font-size: 17px; line-height: 1.6; }

.office-case { max-width: 980px; margin: 0 auto; }
.office-case-documents { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.office-case-document { position: relative; min-width: 0; padding: 25px 26px; border: 1px solid #d4c09b; border-top: 4px solid #a68b5f; border-radius: 4px 4px 12px 12px; background: #fffdf5; box-shadow: 0 5px 14px rgba(81,61,32,.06); }
.office-case-document:nth-child(2) { border-top-color: #7e896b; }
.office-document-number { display: inline-block; color: #8a6b43; font: italic 15px/1.4 Georgia, "Times New Roman", serif; }
.office-case-document h3 { margin: 10px 0 13px; color: #443a29; font: 700 25px/1.18 Georgia, "Times New Roman", serif; }
.office-case-document p { margin: 0; color: #5e503c; font-size: 17px; line-height: 1.6; }
.office-case-question { margin-top: 24px; padding: 22px 25px; border: 1px solid #bec7ab; border-left: 4px solid #71875b; border-radius: 12px; background: #edf1e3; }
.office-case-question h3 { margin: 0 0 9px; color: #3e5335; font: 700 24px/1.2 Georgia, "Times New Roman", serif; }
.office-case-question p { margin: 0; color: #536147; font-size: 16px; line-height: 1.55; }
.office-fiction-note { margin: 21px 0 0; padding-top: 15px; border-top: 1px dashed #cdbb9c; color: #796b55; font-size: 13px; line-height: 1.5; }
.office-case-actions { margin-top: 24px; }

.office-context { position: relative; padding: 17px 20px; border: 1px solid #d6c5a5; border-radius: 11px; background: #f3ead8; }
.office-context-title { margin: 0 0 7px; color: #66502e; font-size: 14px; font-weight: 800; line-height: 1.35; }
.office-context p:not(.office-context-title) { margin: 0; color: #6b5b43; font-size: 14px; line-height: 1.5; }
.office-context p + p:not(.office-context-title) { margin-top: 5px; }
.office-context .office-text-button { min-height: 38px; margin-top: 5px; padding-block: 7px; }
.office-compose-help { margin: 20px 0; color: #665a46; font-size: 15px; line-height: 1.5; }
.office-builder { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; gap: 26px; }
.office-draft { min-width: 0; padding: 25px; border: 1px solid #cdb995; border-radius: 4px 4px 12px 12px; background: #fffdf5; box-shadow: 4px 4px 0 #e9dcc2, 5px 5px 0 #cdbb99; }
.office-draft-heading { padding-bottom: 17px; border-bottom: 1px solid #dfcfb2; }
.office-draft-heading h3 { margin: 7px 0 0; color: #403729; font: 700 28px/1.15 Georgia, "Times New Roman", serif; }
.office-slots { display: grid; gap: 15px; margin-top: 20px; }
.office-slot-row { min-width: 0; }
.office-slot { display: block; width: 100%; min-height: 112px; padding: 16px 17px; border: 1px dashed #bea77f; border-radius: 10px; color: var(--office-ink); background: #fcf6e9; text-align: left; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.office-slot:has(.office-slot-text:not(.is-empty)) { border-style: solid; background: #fffdf7; }
.office-slot:hover:not(:disabled) { border-color: #71845f; background: #f0f3e6; }
.office-slot[aria-pressed="true"] { border: 2px solid #68845b; padding: 15px 16px; background: #eff3e6; }
.office-slot-label { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; color: #7b6036; font-size: 12px; line-height: 1.3; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.office-slot-label > span:first-child { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border: 1px solid #c8b794; border-radius: 50%; color: #7c663f; background: #f1e7d1; font-size: 11px; }
.office-slot[aria-pressed="true"] .office-slot-label { color: #45623c; }
.office-slot[aria-pressed="true"] .office-slot-label > span:first-child { border-color: #637e57; color: #fff; background: #637e57; }
.office-slot-text { display: block; color: #433a2a; font: 17px/1.55 Georgia, "Times New Roman", serif; }
.office-slot-text.is-empty { color: #88775b; font: italic 15px/1.5 Georgia, "Times New Roman", serif; }
.office-slot:disabled { cursor: default; opacity: 1; }
.office-slot-row.is-correct .office-slot { border: 1px solid #9aaf84; padding: 16px 17px; background: #edf2e4; }
.office-slot-row.is-incorrect .office-slot { border: 1px solid #c09c72; padding: 16px 17px; background: #f7ead7; }
.office-slot-feedback { margin: 10px 0 0; padding: 0 3px; color: #775833; font-size: 14px; line-height: 1.5; }
.office-slot-feedback strong { display: block; margin-bottom: 3px; }
.office-slot-row.is-correct .office-slot-feedback { color: #4b663d; }
.office-draft-note { margin: 18px 0 0; padding-top: 13px; border-top: 1px dashed #d3c1a1; color: #807057; font-size: 12px; line-height: 1.5; }

.office-picker { min-width: 0; padding: 20px 0 0; }
.office-picker h3 { margin: 7px 0 10px; color: #3e4732; font: 700 25px/1.2 Georgia, "Times New Roman", serif; }
.office-choice-hint { margin: 0 0 18px; color: #6c5e48; font-size: 15px; line-height: 1.5; }
.office-options { display: grid; gap: 12px; }
.office-option { display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 72px; padding: 18px; border: 1px solid #c9b692; border-radius: 12px; color: #443927; background: #fffdf6; text-align: left; font-size: 16px; line-height: 1.5; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.office-option:hover:not(:disabled) { border-color: #758b62; background: #eff3e6; }
.office-option-mark { display: grid; place-items: center; flex: 0 0 25px; width: 25px; height: 25px; border: 1px solid #c2ae86; border-radius: 8px; color: #836a42; background: #f2e8d2; font-size: 12px; line-height: 1; font-weight: 800; }
.office-option[aria-pressed="true"] { border-color: #65815a; color: #2f4a33; background: #e8efde; box-shadow: inset 0 0 0 1px #65815a; }
.office-option[aria-pressed="true"] .office-option-mark { border-color: #58784e; color: #fff; background: #58784e; }
.office-option:disabled { cursor: default; opacity: 1; }
.office-review-note { min-width: 0; padding: 23px 25px; border: 1px solid #c6cbb1; border-radius: 13px; background: #f0f2e5; }
.office-review-note h3 { margin: 0 0 12px; color: #46583a; font: 700 25px/1.2 Georgia, "Times New Roman", serif; }
.office-review-note p { margin: 0; color: #637052; font-size: 16px; line-height: 1.55; }
.office-compose-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; padding-top: 21px; border-top: 1px solid var(--office-line); }
.office-progress { max-width: 580px; margin: 0; color: #675941; font-size: 14px; line-height: 1.5; }
.office-feedback { margin-top: 24px; padding: 23px 25px; border: 1px solid #b2c29c; border-radius: 13px; background: #eaf0df; }
.office-feedback.is-incorrect { border-color: #cbae84; background: #f7ebd8; }
.office-feedback h3 { margin: 0 0 9px; color: #3f5735; font: 700 25px/1.2 Georgia, "Times New Roman", serif; }
.office-feedback.is-incorrect h3 { color: #705330; }
.office-feedback p { margin: 0; color: #605a41; font-size: 16px; line-height: 1.55; }
.office-feedback button { margin-top: 18px; }

.office-stage .primary-button { min-height: 50px; border-radius: 12px; color: #fff; background: var(--office-green); box-shadow: 0 5px 12px rgba(37,76,50,.16); font-size: 16px; }
.office-stage .primary-button:hover:not(:disabled) { background: #244d35; }
.office-stage .primary-button:disabled { color: #606a54; background: #d9ddcf; opacity: 1; box-shadow: none; cursor: default; }
.office-stage .secondary-button { min-height: 48px; padding: 11px 17px; border-color: #c4b18e; border-radius: 12px; color: #4d412e; background: #fffaf0; font-size: 15px; }
.office-text-button { display: inline-block; min-height: 44px; margin-top: 13px; padding: 9px 0; border: 0; color: #4b6344; background: transparent; text-decoration: underline; text-underline-offset: 4px; font-size: 14px; font-weight: 700; cursor: pointer; }
.office-text-button:hover { color: #243f25; }

.office-result { max-width: 850px; margin: 0 auto; text-align: center; }
.office-stamp { display: inline-block; padding: 8px 17px; border: 2px solid #5b7850; border-radius: 5px; color: #436b41; font-size: 13px; font-weight: 800; line-height: 1.4; letter-spacing: .11em; text-transform: uppercase; transform: rotate(-2deg); }
.office-result-title { margin: 21px 0 12px; font: 700 clamp(27px, 2.5vw, 35px)/1.15 Georgia, "Times New Roman", serif; }
.office-result-copy { max-width: 650px; margin: 0 auto 25px; color: #655943; font-size: 17px; line-height: 1.55; }
.office-finished-document { padding: 27px 30px; border: 1px solid #cbb58f; border-radius: 3px 3px 10px 10px; background: #fffdf6; box-shadow: 4px 4px 0 #e9dcc2, 5px 5px 0 #cdbb99; text-align: left; }
.office-finished-document > h3 { margin: 8px 0 24px; color: #443a29; font: 700 27px/1.2 Georgia, "Times New Roman", serif; }
.office-finished-parts { display: grid; gap: 22px; }
.office-finished-parts > section { padding-left: 17px; border-left: 2px solid #d6c2a0; }
.office-finished-label { display: block; margin-bottom: 7px; color: #897046; font-size: 11px; line-height: 1.3; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.office-finished-parts p { margin: 0; color: #463b2b; font: 18px/1.65 Georgia, "Times New Roman", serif; }
.office-finished-document .office-fiction-note { margin-top: 24px; }
.office-finding { margin-top: 27px; padding: 23px 27px; border: 1px solid #bdc6a8; border-left: 5px solid #67825a; border-radius: 13px; background: linear-gradient(110deg, #e8eedf, #f4f3e5); text-align: left; }
.office-finding .office-eyebrow { color: #526c43; }
.office-finding h3 { margin: 7px 0 8px; color: #304b32; font: 700 27px/1.2 Georgia, "Times New Roman", serif; }
.office-finding p { margin: 0; color: #4e5c43; font-size: 16px; line-height: 1.5; }
.office-history { margin-top: 21px; padding: 20px 24px; border: 1px solid #d9c7a7; border-radius: 12px; background: #f7efde; text-align: left; }
.office-history h3 { margin: 0 0 8px; color: #655232; font-size: 16px; line-height: 1.3; }
.office-history p { margin: 0; color: #62543f; font-size: 15px; line-height: 1.55; }
.office-source { display: inline-block; margin-top: 10px; padding: 5px 0; color: #3b6344; text-decoration: underline; text-underline-offset: 3px; font-size: 13px; line-height: 1.5; }
.office-result-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: 25px; }
.office-result-actions .office-text-button { margin: 0; }
.office-persistence-note { margin: 20px 0 0; padding-top: 14px; border-top: 1px dashed #cebea0; color: #776b55; font-size: 12px; line-height: 1.5; }
.office-keepsake { margin-top: 12px; padding: 12px 14px; border-left: 3px solid #7c8561; border-radius: 0 8px 8px 0; color: #4b5839; background: #eef0e2; font-size: 14px; line-height: 1.45; }
.office-keepsake strong { display: block; margin-bottom: 3px; }
.office-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.office-stage [hidden] { display: none; }
.office-stage button:focus-visible,
.office-source:focus-visible { outline: 3px solid #a27629; outline-offset: 4px; }
.office-stage [tabindex="-1"]:focus { outline: 2px solid #9b814c; outline-offset: 5px; border-radius: 4px; }

@media (max-width: 1024px) {
    .office-stage .scene-heading { top: 12px; left: 12px; width: min(470px, calc(100vw - 240px)); padding: 10px 12px; }
    .office-stage .scene-heading h1 { font-size: 21px; }
    .office-stage .scene-actions { top: 12px; right: 12px; }
    .office-stage .back-button { left: 12px; }
    .office-workspace { top: 137px; bottom: 14px; width: calc(100vw - 28px); }
    .office-header { padding: 22px 24px 18px; }
    .office-steps { padding-inline: 24px; }
    .office-paper { padding: 24px; }
    .office-case-documents { gap: 17px; }
    .office-case-document { padding: 23px; }
    .office-builder { gap: 21px; }
    .office-draft { padding: 21px; }
    .office-option { padding: 16px; }
}

@media (max-width: 760px) {
    .office-builder { grid-template-columns: 1fr; gap: 23px; }
    .office-picker { order: -1; padding-top: 0; }
    .office-review-note { order: -1; }
    .office-case-documents { grid-template-columns: 1fr; }
    .office-case-document { padding: 21px 23px; }
    .office-case-document h3 { font-size: 24px; }
    .office-case-document p { font-size: 16px; }
    .office-slot { min-height: 100px; }
    .office-compose-footer { flex-direction: column; align-items: stretch; gap: 14px; }
    .office-compose-footer .primary-button { width: 100%; }
}

@media (max-width: 700px) {
    .office-stage .scene-heading { width: calc(100vw - 122px); padding: 9px 11px; }
    .office-stage .scene-heading h1 { font-size: 17px; }
    .office-stage .scene-heading .scene-eyebrow { display: none; }
    .office-stage .back-button { min-height: 44px; font-size: 14px; }
    .office-workspace { top: 118px; bottom: 10px; width: calc(100vw - 20px); border-radius: 15px; }
    .office-header { padding: 18px 17px 16px; }
    .office-header h2 { font-size: 26px; }
    .office-header .office-eyebrow { font-size: 10px; letter-spacing: .06em; }
    .office-steps { gap: 12px; justify-content: space-between; padding: 12px 17px; }
    .office-steps li { gap: 6px; font-size: 12px; }
    .office-steps li > span:first-child { flex-basis: 22px; width: 22px; height: 22px; font-size: 11px; }
    .office-paper { padding: 20px 17px 23px; }
    .office-lead { font-size: 16px; margin-bottom: 19px; }
    .office-case-document { padding: 20px; }
    .office-case-question { margin-top: 20px; padding: 19px; }
    .office-case-question h3 { font-size: 23px; }
    .office-case-question p { font-size: 15px; }
    .office-case-actions .primary-button { width: 100%; }
    .office-context { padding: 16px 17px; }
    .office-compose-help { font-size: 14px; margin-block: 18px; }
    .office-draft { padding: 19px; }
    .office-draft-heading h3 { font-size: 26px; }
    .office-slot { padding: 15px; }
    .office-slot[aria-pressed="true"] { padding: 14px; }
    .office-slot-row.is-correct .office-slot,
    .office-slot-row.is-incorrect .office-slot { padding: 15px; }
    .office-slot-text { font-size: 16px; }
    .office-slot-text.is-empty { font-size: 14px; }
    .office-picker h3 { font-size: 24px; }
    .office-choice-hint { font-size: 14px; }
    .office-option { gap: 10px; padding: 15px; font-size: 15px; }
    .office-review-note { padding: 20px; }
    .office-review-note h3 { font-size: 24px; }
    .office-review-note p { font-size: 15px; }
    .office-feedback { padding: 20px; }
    .office-feedback h3 { font-size: 23px; }
    .office-feedback p { font-size: 15px; }
    .office-feedback button { width: 100%; }
    .office-result-copy { font-size: 16px; }
    .office-finished-document { padding: 22px 19px; }
    .office-finished-document > h3 { font-size: 24px; margin-bottom: 21px; }
    .office-finished-parts { gap: 19px; }
    .office-finished-parts > section { padding-left: 13px; }
    .office-finished-parts p { font-size: 17px; line-height: 1.6; }
    .office-finding { padding: 20px 18px; }
    .office-finding h3 { font-size: 25px; }
    .office-history { padding: 18px; }
    .office-result-actions { flex-direction: column; align-items: stretch; }
    .office-result-actions .primary-button { width: 100%; }
}

@media (max-width: 390px) {
    .office-stage .scene-heading h1 { font-size: 16px; }
    .office-header h2 { font-size: 24px; }
    .office-steps { gap: 6px; padding-inline: 14px; }
    .office-steps li { gap: 5px; font-size: 11px; }
    .office-draft { padding: 16px; }
    .office-option { padding: 13px; font-size: 14px; }
    .office-option-mark { flex-basis: 23px; width: 23px; height: 23px; }
    .office-slot-label { font-size: 11px; }
    .office-slot-text { font-size: 16px; }
}

@media (max-height: 600px) and (min-width: 701px) {
    .office-stage .scene-heading { top: 10px; left: 12px; padding: 8px 12px; }
    .office-stage .scene-heading h1 { font-size: 20px; }
    .office-stage .scene-heading .scene-eyebrow { display: none; }
    .office-stage .scene-actions { top: 10px; right: 12px; }
    .office-stage .back-button { left: 12px; min-height: 42px; }
    .office-workspace { top: 112px; bottom: 10px; }
    .office-header { padding-block: 15px; }
    .office-header h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    .office-slot, .office-option { transition: none; }
}

/* Long petition wording stays readable instead of shrinking to fit a phone. */
@media (max-width: 800px), (max-width: 1100px) and (max-height: 500px) {
    .office-workspace { overflow-wrap: anywhere; scrollbar-gutter: auto; }
    .office-header { padding: 18px 14px 16px; }
    .office-eyebrow, .office-header .office-eyebrow { font-size: 14px; letter-spacing: .03em; }
    .office-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 14px; align-items: start; }
    .office-steps li { min-width: 0; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 14px; line-height: 1.35; }
    .office-steps li > span:first-child { flex-basis: 24px; width: 24px; height: 24px; font-size: 13px; }
    .office-paper { padding: 20px 14px 24px; }
    .office-case-documents, .office-builder { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .office-picker { order: -1; padding-top: 0; }
    .office-review-note { order: -1; }
    .office-case-document, .office-case-question, .office-draft,
    .office-review-note, .office-finished-document { padding: 19px 14px; }
    .office-case-document p, .office-case-question p, .office-compose-help,
    .office-context p:not(.office-context-title), .office-choice-hint,
    .office-option, .office-slot-text, .office-slot-text.is-empty,
    .office-slot-feedback, .office-review-note p, .office-feedback p,
    .office-history p { font-size: 16px; line-height: 1.55; }
    .office-option { min-width: 0; padding: 14px 12px; }
    .office-option > span:last-child { min-width: 0; }
    .office-slot-label, .office-fiction-note, .office-draft-note,
    .office-persistence-note, .office-source { font-size: 14px; letter-spacing: normal; }
    .office-context .office-text-button, .office-source { min-height: 44px; padding-block: 12px; }
    .office-stamp { max-width: 100%; font-size: 14px; letter-spacing: .05em; transform: none; }
    .office-compose-footer, .office-result-actions { flex-direction: column; align-items: stretch; }
    .office-workspace button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
    .office-workspace .primary-button, .office-workspace .secondary-button { width: 100%; }
}
