*{box-sizing:border-box}body{margin:0;background:#f5f7f1;color:#243d33;font:16px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif}a{color:#24543e;text-underline-offset:4px}button,input,textarea,select{font:inherit}button,a,input,textarea,select{touch-action:manipulation}button{cursor:pointer}button:disabled{opacity:.6;cursor:wait}[hidden]{display:none!important}:focus-visible{outline:3px solid #a76c2e;outline-offset:4px}.skip{position:absolute;top:-90px;padding:12px;background:white;z-index:100}.skip:focus{top:5px}header{border-bottom:1px solid #d1dcc9;background:#fffdf7}.top{max-width:1300px;margin:auto;padding:18px 24px;display:flex;justify-content:space-between;align-items:center;gap:20px}.brand{font:700 25px Georgia,serif;text-decoration:none}.top nav{display:flex;gap:22px;font-size:14px}.top nav a{padding:10px 0}main{max-width:1300px;padding:25px 24px 65px;margin:auto}.crumb{font-size:13px;margin-bottom:22px}.hero{background:#eaf0e2;border:1px solid #d1dcc5;border-radius:15px;padding:27px}.eyebrow{font-size:12px;letter-spacing:1.2px;font-weight:750;text-transform:uppercase;color:#586c48;margin-top:0}h1{font:600 clamp(29px,4vw,39px)/1.15 Georgia,serif;margin:8px 0 15px}h2{font-size:22px;line-height:1.35}.hero p{max-width:900px}.notice-limit{padding:15px 18px;background:#f7efdd;border-left:4px solid #b17b34;border-radius:7px;font-size:14px}.primary,.secondary,.button-link{display:inline-flex;justify-content:center;align-items:center;min-height:46px;padding:10px 17px;border:1px solid #244f3b;border-radius:8px;font-weight:650;text-decoration:none}.primary,.button-link{background:#244f3b;color:white}.secondary{background:#fff;color:#244f3b}.hero .primary{margin-top:8px}.workspace{display:grid;grid-template-columns:310px minmax(0,1fr);align-items:start;gap:24px;margin-top:25px}.panel{background:#fff;border:1px solid #d0dbca;border-radius:12px;padding:18px}.panel summary{font-weight:700;cursor:pointer;min-height:44px}.row{margin:15px 0}.row label{display:block;font-size:14px;font-weight:650}.row input,.row textarea,.row select{width:100%;padding:10px;margin-top:6px;border:1px solid #a7b59d;border-radius:7px;min-height:46px;background:#fff}.row textarea{resize:vertical}.row small{display:block;margin-top:10px;color:#6a5739;font-size:12px;line-height:1.5}.paper-wrap{min-width:0}.paper-note{margin:0 0 12px;font-size:14px;color:#5c6d58}.paper{padding:35px 34px;background:white;border:1px solid #ced8c7;box-shadow:0 3px 14px #29432b0d;min-width:0}.paper-head .edit{font:700 23px/1.35 Georgia,serif}.paper-date{margin:20px 0}.paper-row{margin:19px 0}.paper-row h3{font-size:12px;text-transform:uppercase;letter-spacing:.5px;color:#62715a;margin:0 0 5px}.edit{display:flex;align-items:flex-start;gap:10px;justify-content:space-between;white-space:pre-wrap;text-align:left;width:100%;min-height:44px;padding:9px 10px;color:#263d32;background:#f5f8f1;border:1px dashed #afbea4;border-radius:6px;font:inherit;overflow-wrap:anywhere}.edit>span:first-child{min-width:0}.edit:hover{background:#eaf1e1}.edit-hint{font:600 11px/1.5 system-ui,sans-serif;color:#526b43;white-space:nowrap;align-self:flex-start;padding-top:3px}.paper-date .edit{display:inline-flex;max-width:260px;vertical-align:middle}.paper-sign{margin-top:32px}.signature-line{height:70px;border-bottom:1px solid #51634d;max-width:420px}.paper-sign p,.paper-foot{font-size:12px;color:#596a54}.paper-foot{border-top:1px solid #e0e6da;padding-top:18px;margin-top:25px}.actions{background:#fff;border:1px solid #ced8c7;padding:22px;border-radius:12px;margin-top:22px}.action-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.actions p{font-size:14px}.actions .notice-limit{font-size:13px}.status{padding:12px 0;font-size:14px;min-height:48px;overflow-wrap:anywhere}.ready{font-size:14px;color:#3b5c36}.conflict{padding:20px;background:#fff0d7;border:2px solid #b58136;border-radius:10px;margin-top:20px}.conflict button{margin:5px}dialog{border:1px solid #b9c9ae;border-radius:13px;padding:25px;width:min(620px,calc(100vw - 24px));max-height:calc(100dvh - 30px);overflow:auto;color:#243d33}dialog::backdrop{background:#183e3566}dialog h2{margin-top:0}dialog label{display:block;font-size:14px;font-weight:650}dialog input,dialog textarea,dialog select{width:100%;padding:12px;min-height:48px;border:1px solid #a7b99c;border-radius:7px;margin:8px 0 15px}dialog textarea{min-height:130px;resize:vertical}.dialog-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}.error{color:#92351b;font-size:14px}.help{background:#fff;border:1px solid #d1dcc8;border-radius:12px;margin-top:28px;padding:24px}.help p,.help li{font-size:14px}.help details{border-top:1px solid #d9e1d1;padding:14px 0}.help summary{font-weight:650;cursor:pointer;min-height:32px}footer{background:#eaf0e2;border-top:1px solid #d1dcc8;padding:25px}.footer-inner{max-width:1252px;margin:auto;font-size:13px}footer a{display:inline-flex;min-height:40px;align-items:center;margin-right:22px}@media(max-width:899px){.workspace{display:flex;flex-direction:column}.panel,.paper-wrap{width:100%}.paper{padding:28px 24px}.top{flex-direction:column;align-items:flex-start;gap:5px}.panel{padding:12px 18px}.panel summary::after{content:' (optional panel)';font-size:12px;font-weight:400;color:#607054}}@media(max-width:560px){main{padding:20px 13px 45px}.top{padding:17px}.brand{font-size:24px}.hero{padding:22px 18px}.paper{padding:24px 16px}.paper-head .edit{font-size:20px}.paper-date .edit{margin-top:5px;max-width:100%}.actions{padding:19px 16px}.action-row>*{flex:1;min-width:130px}.dialog-actions button{flex:1}.help{padding:21px 18px}.notice-limit{padding:13px;font-size:13px}.edit{min-height:48px}.signature-line{height:80px}dialog{padding:20px}.row input,.row textarea,.row select{font-size:16px}}@media print{body{background:white}header,.crumb,.hero,.panel,.paper-note,.actions,.help,footer,.skip,.conflict,dialog{display:none!important}main{padding:0;max-width:none}.workspace{display:block;margin:0}.paper{border:0;box-shadow:none;padding:0}.edit{display:block;border:0;background:none;padding:0;min-height:0}.edit-hint{display:none}.paper-row{break-inside:avoid}.paper-sign{break-inside:avoid}.paper-head .edit{font-size:23px}}
/* Letter layout: editable areas follow the same reading order as the PDF. */
.paper{font-family:Georgia,"Times New Roman",serif;line-height:1.7;color:#202820}
.paper-head{text-align:center;margin-bottom:27px}.paper-head .edit{justify-content:center;text-align:center;font-size:23px}.paper-head .edit-hint{margin-left:auto}
.paper-date{text-align:right;margin:20px 0 30px}.paper-date .edit{width:auto;min-width:155px;text-align:left}
.letter-address{margin:0 0 28px}.letter-address p{margin:16px 0}.letter-address .edit{margin-top:5px}
.letter-paragraph{margin:23px 0;line-height:2.4}.letter-paragraph .edit{display:inline-flex;width:auto;max-width:100%;vertical-align:middle;padding:4px 9px;line-height:1.7;min-height:40px}
.letter-body{margin:22px 0}.letter-body .edit{line-height:1.8}.letter-payment{margin:24px 0}.letter-payment strong{display:block;font-weight:600;margin-bottom:7px}
.letter-closing{margin-top:32px}.letter-closing>p{margin-bottom:12px}.letter-closing .edit{margin-top:7px}.paper-sign{margin-top:14px}.paper-sign .signature-line{height:65px}.paper-sign p{margin:5px 0;font-family:system-ui,sans-serif}.paper-foot{font-family:system-ui,sans-serif}
@media(max-width:560px){.paper-head .edit{font-size:19px}.paper-date{margin-bottom:24px}.letter-paragraph{line-height:2.5}.letter-paragraph .edit{min-height:46px}.letter-closing{margin-top:25px}}
@media print{.letter-paragraph .edit{display:inline;border:0;padding:0;line-height:inherit}.letter-address .edit{display:block;padding:0}.paper-date .edit{display:inline;padding:0}.letter-body .edit,.letter-payment .edit,.letter-closing .edit{padding:0;border:0}.paper-head .edit{text-align:center}.letter-closing,.paper-sign{break-inside:avoid}}

.signature-type{font:italic 30px/1.4 Georgia,serif;color:#101b15;overflow-wrap:anywhere;min-height:12px}.signature-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:12px}#signatureDrawnPreview{display:block;width:min(100%,450px);height:auto;max-height:130px}#signatureCanvas{display:block;width:100%;height:auto;aspect-ratio:10/3;background:#fff;border:1px solid #71806c;border-radius:7px;touch-action:none}#signatureStatus{font-size:13px}#signatureDialog{font-family:system-ui,sans-serif}.paper-sign .signature-actions button{font:600 14px system-ui,sans-serif}#signatureDialog .signature-type{margin:6px 0 20px}.signature-agreement{display:flex;gap:10px;align-items:flex-start;margin:14px 0}.signature-agreement input{width:21px;min-height:21px;flex-shrink:0;margin:2px 0}#signatureScopeInfo{font-size:13px;padding:10px;background:#f7efdd}@media print{.signature-actions,#signatureStatus{display:none!important}}
.entry-group{border:1px solid #cedbd3;border-radius:9px;padding:12px;margin:14px 0}.entry-group h2{font-size:17px;margin:0 0 8px}.people{background:#f1f6ed}.rent{background:#edf4fa}.notice-fields{background:#fbf5e9}.entry-group input,.entry-group textarea{background:white}.row input::placeholder,.row textarea::placeholder,.rent-period input::placeholder{font-size:14px;font-style:italic;color:#68736c;opacity:1}.row input:focus::placeholder,.row textarea:focus::placeholder,.rent-period input:focus::placeholder{color:transparent}.rent-period{min-width:0;border:1px solid #c2d4e2;border-radius:8px;margin:10px 0;padding:10px;background:#fff}.rent-period legend{font-weight:700;font-size:14px}.rent-period label{display:block;font-size:13px;margin:7px 0 3px}.rent-period input{width:100%;min-width:0;padding:10px;border:1px solid #9aafbf;border-radius:6px;min-height:44px}.rent-period button{font-size:12px;min-height:40px;padding:8px}.row-balance,.small{font-size:13px}.total-row{display:flex;justify-content:space-between;gap:8px;font-size:14px;padding-top:9px;border-top:1px solid #b7c9d3;flex-wrap:wrap}.notice-rent h3{font-size:14px;margin:18px 0 10px}.rent-table-scroll{overflow:auto}.rent-table{width:100%;border-collapse:collapse;font:13px/1.5 system-ui,sans-serif;table-layout:fixed}.rent-table th,.rent-table td{border:1px solid #cbd6cc;padding:8px 6px;text-align:left;overflow-wrap:anywhere}.rent-table th{background:#eaf1e7}.rent-table th:first-child{width:37%}.notice-total{font-size:14px}.notice-rent>button{font:600 13px system-ui,sans-serif}.letter-address span,.letter-closing span,#show-legalBasis{white-space:pre-wrap;overflow-wrap:anywhere}.signature-date-box{padding:12px;border:1px solid #8fa99a;background:#edf6ef;border-radius:8px}.signature-date-box p{font-size:13px;margin:0}.help h3{font-size:18px;margin-top:25px}.paper-sign .signature-actions,.paper-sign #signatureStatus{font-family:system-ui,sans-serif}@media(max-width:560px){.dialog-actions{flex-direction:column}.dialog-actions button{width:100%}.panel summary::after{content:''}.rent-table{font-size:12px}.rent-table td,.rent-table th{padding:7px 4px}}@media print{#editRent{display:none!important}.rent-table-scroll{overflow:visible}}

.letter-address .edit-hint,.letter-closing .edit-hint,.edit-hint{flex-shrink:0;white-space:nowrap;overflow-wrap:normal}
