:root{--navy:#143859;--blue:#1464a0;--bg:#f3f6fa;--white:#fff;--ink:#223c51;--muted:#617487;--line:#dce4ec;--error:#a52d27;--radius:7px;font-family:Tahoma,sans-serif;color:var(--ink);background:var(--bg);font-size:14px;line-height:1.5}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button,a,input,textarea,select{touch-action:manipulation}button{cursor:pointer}button:disabled{cursor:wait;opacity:.55}input,textarea,select{width:100%;border:1px solid #c8d5e1;background:white;color:var(--ink);border-radius:5px;padding:9px 11px;min-height:40px}textarea{resize:vertical;line-height:1.5}input:disabled,textarea:disabled,select:disabled{background:#f4f7fa;color:#617487}label{display:block;font-weight:600;margin-bottom:6px}h1,h2,p{margin:0}h1{font-size:25px;line-height:1.25;color:var(--navy);font-weight:650}h2{font-size:16px;font-weight:650;color:var(--navy)}a{color:var(--blue)}[hidden]{display:none!important}:focus-visible{outline:3px solid #7fb8e8;outline-offset:3px}.primary,.secondary{display:inline-flex;align-items:center;justify-content:center;gap:6px;border-radius:6px;min-height:40px;padding:9px 15px;font-weight:600;text-decoration:none;white-space:nowrap}.primary{background:var(--blue);color:white;border:1px solid var(--blue)}.primary:hover{background:#105488}.secondary{background:white;color:var(--navy);border:1px solid #c8d5e1}.secondary:hover{background:#edf4fa}.text-button{color:var(--blue);border:0;background:none;padding:7px 0;text-align:left;font-weight:600}.icon-button{border:0;background:none;color:var(--muted);width:36px;height:36px;font-size:22px;border-radius:5px}.icon-button:hover{background:#e8eff6;color:var(--navy)}.muted,.field-hint{color:var(--muted);font-size:12px}.field-hint{margin-top:6px;line-height:1.45}.brand{font-size:29px;letter-spacing:2px;line-height:1.1;color:var(--navy);font-weight:750}.brand span{display:block;font-size:11px;font-weight:400;letter-spacing:0;margin-top:10px;color:var(--muted)}.app{display:flex;min-height:100vh}.sidebar{width:242px;flex:0 0 242px;padding:28px 18px 20px;background:#edf2f7;border-right:1px solid var(--line);height:100vh;position:sticky;top:0;display:flex;flex-direction:column}.sidebar .brand{padding-left:9px}.new-button{margin:30px 0 26px;width:100%;font-size:13px}.history-heading{display:flex;align-items:center;justify-content:space-between;padding-left:9px}.history-heading h2{font-size:12px;font-weight:600;color:var(--muted)}.history{overflow-y:auto;margin-top:7px;flex:1}.history-empty{padding:12px 9px;color:var(--muted);font-size:12px}.history-item{display:block;width:100%;padding:12px 10px;border:1px solid transparent;background:transparent;border-radius:7px;text-align:left;color:var(--ink);margin-bottom:4px}.history-item:hover{background:#e2ebf3}.history-item.active{background:white;border-color:#cedce8;border-left:3px solid var(--blue);padding-left:8px}.history-item strong,.history-item span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-item strong{font-size:13px;font-weight:600}.history-item span{font-size:11px;color:var(--muted);margin-top:4px}.sidebar-bottom{font-size:10px;color:var(--muted);border-top:1px solid var(--line);padding:16px 4px 0}.sidebar-bottom .text-button{display:block;font-size:12px;margin-top:7px}.template-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#43856b;margin-right:3px}.workspace{padding:30px 34px 50px;width:calc(100% - 242px);max-width:1900px}.page-header{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:24px}.heading-line{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.page-header p{margin-top:7px}.badge{font-size:11px;color:#4b657c;background:#e6edf5;border:1px solid #d7e2ed;border-radius:4px;padding:2px 7px}.badge.issued{background:#e5f2eb;color:#31664c;border-color:#cde5d8}.message{padding:12px 16px;margin-bottom:18px;background:#e6f1fa;border:1px solid #c4deef;border-radius:6px;white-space:pre-wrap}.message.error{background:#fff2f0;border-color:#eac6c1;color:var(--error)}.message:focus{outline:none}.editor-layout{display:flex;gap:22px;align-items:flex-start}.editor{min-width:0;flex:1}.sheet-section{background:white;border:1px solid var(--line);border-bottom:0;padding:23px 25px}.sheet-section:first-child{border-radius:var(--radius) var(--radius) 0 0}.sheet-section:last-child{border-bottom:1px solid var(--line);border-radius:0 0 var(--radius) var(--radius)}.sheet-section h2{margin-bottom:17px}fieldset{border:0;margin:0;padding:0;min-width:0}.details-grid{display:grid;grid-template-columns:minmax(220px,1.8fr) minmax(145px,.8fr) minmax(170px,1fr);gap:18px}.details-grid textarea{min-height:72px}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:16px}.section-heading h2{margin:0}.drop-zone{border:1px dashed #9eb8cf;background:#f7fafd;min-height:100px;border-radius:6px;display:flex;align-items:center;justify-content:center;gap:18px;padding:17px;cursor:pointer}.drop-zone:hover,.drop-zone.dragging{background:#edf5fc;border-color:var(--blue)}.drop-zone strong{font-size:13px;font-weight:600}.drop-zone span:not(.upload-symbol){display:block;font-size:11px;color:var(--muted);margin-top:3px}.upload-symbol{font-size:29px;font-weight:400;color:var(--blue);width:40px;height:40px;text-align:center;background:#e8f0f7;border-radius:6px}.text-source{margin-top:12px}.text-source summary{color:var(--blue);font-size:12px;cursor:pointer;padding:6px 0}.text-source textarea{margin:9px 0}.text-source button{font-size:12px;min-height:35px}.questions-panel{margin-top:14px;background:#fff8e8;border-left:3px solid #c59431;padding:13px 15px;font-size:12px}.questions-panel ul{padding-left:18px;margin:8px 0 12px}.count{font-size:11px;display:inline-block;padding:1px 6px;background:#ecf1f6;color:var(--muted);border-radius:4px;margin-left:4px;vertical-align:middle}.table-scroll{overflow:auto;margin:0 -25px}.items-table{border-collapse:collapse;width:100%;min-width:650px;font-size:12px;table-layout:fixed}.items-table th{background:#f4f7fa;color:var(--muted);text-align:left;font-size:11px;font-weight:600;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:10px 7px}.items-table td{border-bottom:1px solid #e7edf3;padding:9px 5px;vertical-align:top}.items-table th:first-child,.items-table td:first-child{padding-left:20px}.items-table th:last-child,.items-table td:last-child{padding-right:12px}.items-table .row-number{width:45px}.quantity-col{width:79px}.unit-col{width:62px}.price-col{width:112px}.amount-col{width:105px;text-align:right!important}.delete-col{width:40px}.items-table input,.items-table textarea{padding:7px 6px;min-height:35px;border-color:transparent;font-size:12px;border-radius:3px}.items-table input:hover,.items-table textarea:hover{border-color:#c8d5e1}.items-table input:focus,.items-table textarea:focus{border-color:var(--blue)}.items-table textarea{resize:vertical;min-height:52px;max-height:260px}.items-table .numeric-input{text-align:right;font-variant-numeric:tabular-nums}.items-table .row-index{color:#8495a4;padding-top:16px;font-size:11px}.line-total{text-align:right;padding-top:16px!important;font-variant-numeric:tabular-nums;white-space:nowrap}.delete-row{font-size:20px;width:27px;height:34px}.empty-items{text-align:center;color:var(--muted);font-size:12px;padding:23px 10px;border-bottom:1px solid var(--line)}.add-row{margin-top:9px;font-size:12px}.tax-grid{display:grid;grid-template-columns:minmax(200px,300px) 100px;gap:14px;margin-top:22px}.totals{display:flex;justify-content:flex-end;margin:18px 0}.totals dl{margin:0;width:290px}.totals dl div{display:flex;justify-content:space-between;gap:15px;padding:4px 0}.totals dt{color:var(--muted);font-size:12px}.totals dd{margin:0;font-variant-numeric:tabular-nums}.totals .grand-total{margin-top:9px;padding-top:13px;border-top:1px solid var(--line);font-size:22px;font-weight:650;color:var(--navy)}.totals .grand-total dt{font-size:15px;font-weight:600;color:var(--navy);padding-top:5px}.checkbox-label{display:flex;align-items:flex-start;gap:9px;font-size:12px;font-weight:400;margin:10px 0 0;cursor:pointer}.checkbox-label input{width:16px;height:16px;min-height:16px;margin:2px 0 0;flex:0 0 16px;accent-color:var(--blue)}.conditions-section textarea{display:block}.action-bar{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:18px 0}.action-bar>span{color:var(--muted);font-size:11px}.action-bar>div{display:flex;gap:9px}.action-bar button{font-size:12px}.downloads,.issued-notice{display:flex;align-items:center;gap:12px;background:#eaf5ee;border:1px solid #cce3d5;border-radius:6px;padding:16px}.downloads strong{margin-right:auto}.issued-notice{margin-bottom:18px;font-size:13px}.issued-notice button{margin-left:auto}.preview-panel{width:42%;min-width:320px;background:white;border:1px solid var(--line);border-radius:7px;padding:15px;position:sticky;top:20px}.preview-heading{display:flex;align-items:center;justify-content:space-between}.preview-panel>a{display:block;margin:10px 0;font-size:12px}.preview-panel iframe{width:100%;height:calc(100vh - 180px);min-height:480px;border:1px solid var(--line);background:#e9edf1}.login-screen{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:25px}.login-box{width:410px;background:white;padding:38px;border:1px solid var(--line);border-radius:9px;box-shadow:0 12px 50px #1438590b}.login-box .brand{margin-bottom:37px}.login-box h1{font-size:23px;margin-bottom:11px}.login-box .muted{font-size:13px;margin-bottom:25px}.login-box button{width:100%;margin-top:18px}.login-box .error{color:var(--error);font-size:13px;margin-top:15px}.loading-screen{display:grid;place-items:center;min-height:100vh;color:var(--muted)}.skip-link{position:absolute;left:15px;top:-70px;padding:10px;background:white;z-index:50}.skip-link:focus{top:12px}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.is-busy .drop-zone{pointer-events:none;opacity:.6}@media(min-width:1450px){.editor-layout:has(.preview-panel:not([hidden])) .details-grid{grid-template-columns:1fr 1fr}.editor-layout:has(.preview-panel:not([hidden])) .recipient-field{grid-column:1/-1}.editor-layout:has(.preview-panel:not([hidden])) .action-bar{align-items:flex-start;flex-direction:column}}@media(max-width:1449px){.editor-layout{flex-direction:column}.preview-panel{width:100%;position:static;min-width:0}.preview-panel iframe{height:800px}.workspace{padding:27px 24px}.details-grid{grid-template-columns:1fr 1fr}.recipient-field{grid-column:1/-1}}@media(max-width:800px){.app{display:block}.sidebar{position:static;width:100%;height:auto;padding:18px;display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;border-bottom:1px solid var(--line);border-right:0}.sidebar .brand{padding:0;font-size:24px}.brand span{font-size:10px;margin-top:6px}.new-button{margin:0;width:auto;min-height:38px}.history-heading{grid-column:1/-1;padding:0;margin-bottom:-12px}.history{grid-column:1/-1;display:flex;overflow-x:auto;gap:7px;max-height:93px;margin:0}.history-item{min-width:175px;max-width:210px;margin:0;padding:9px}.history-empty{padding:5px 0}.sidebar-bottom{grid-column:1/-1;padding:0;border:0;display:flex;align-items:center;gap:3px}.sidebar-bottom .text-button{margin:0 0 0 auto;font-size:11px}.workspace{width:100%;padding:23px 16px 35px}.page-header{margin-bottom:18px}.page-header h1{font-size:21px}.page-header .secondary{font-size:12px}.sheet-section{padding:20px 17px}.table-scroll{margin:0 -17px}.section-heading{align-items:flex-start;flex-direction:column;gap:3px}.action-bar{align-items:flex-start;flex-direction:column}.action-bar>div{width:100%}.action-bar button{flex:1}.downloads{flex-wrap:wrap}.downloads strong{width:100%}.preview-panel iframe{height:650px}.issued-notice{align-items:flex-start;flex-direction:column}.issued-notice button{margin:0}}@media(max-width:430px){.details-grid{gap:12px;grid-template-columns:1fr}.recipient-field{grid-column:auto}.drop-zone{gap:10px;padding:14px}.drop-zone strong{font-size:12px}.upload-symbol{flex:0 0 32px;width:32px;height:36px}.tax-grid{grid-template-columns:minmax(150px,1fr) 80px}.new-button{font-size:11px;padding:8px}.action-bar>div{flex-direction:column}.login-box{padding:27px}.heading-line{gap:6px}.page-header{align-items:flex-start}.page-header h1{font-size:19px}.preview-panel iframe{min-height:400px;height:550px}}

/* Keep the wide positions table inside its own scroll area on narrow screens. */
.delivery-fields { display: grid; gap: 16px; }

.editor,
#proposal-form,
#editor-fields,
.sheet-section {
  min-width: 0;
  min-inline-size: 0;
}
#proposal-form,
#editor-fields {
  width: 100%;
  max-width: 100%;
}
@media (max-width: 1449px) {
  .editor-layout > .editor {
    width: 100%;
    max-width: 100%;
  }
}

.table-scroll {
  position: relative;
}
.visually-hidden {
  left: 0;
  top: 0;
}

.action-error{margin:16px 0 0}
