:root {
       --blue: #0D80D8;
       --ink: #0A151E;
       --line: #d6dee4;
       --canvas: #e4eaee;
       --weight-heading: 900;
       --weight-subhead: 700;
       --weight-body: 400;
       --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

@font-face {
       font-family: "Inter";
       font-style: normal;
       font-weight: 400;
       font-display: swap;
       src: url("fonts/inter-regular-latin.woff2") format("woff2");
       unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
              U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
              U+2215, U+FEFF, U+FFFD;
}
@font-face {
       font-family: "Inter";
       font-style: normal;
       font-weight: 400;
       font-display: swap;
       src: url("fonts/inter-regular-latin-ext.woff2") format("woff2");
       unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
              U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
              U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
       font-family: "Inter";
       font-style: italic;
       font-weight: 400;
       font-display: swap;
       src: url("fonts/inter-italic-latin.woff2") format("woff2");
       unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
              U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
              U+2215, U+FEFF, U+FFFD;
}
@font-face {
       font-family: "Inter";
       font-style: italic;
       font-weight: 400;
       font-display: swap;
       src: url("fonts/inter-italic-latin-ext.woff2") format("woff2");
       unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
              U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
              U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
       font-family: "Inter";
       font-style: normal;
       font-weight: 700;
       font-display: swap;
       src: url("fonts/inter-bold-latin.woff2") format("woff2");
       unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
              U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
              U+2215, U+FEFF, U+FFFD;
}
@font-face {
       font-family: "Inter";
       font-style: normal;
       font-weight: 700;
       font-display: swap;
       src: url("fonts/inter-bold-latin-ext.woff2") format("woff2");
       unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
              U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
              U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
       font-family: "Inter";
       font-style: normal;
       font-weight: 900;
       font-display: swap;
       src: url("fonts/inter-black-latin.woff2") format("woff2");
       unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
              U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
              U+2215, U+FEFF, U+FFFD;
}
@font-face {
       font-family: "Inter";
       font-style: normal;
       font-weight: 900;
       font-display: swap;
       src: url("fonts/inter-black-latin-ext.woff2") format("woff2");
       unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
              U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
              U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* {
       box-sizing: border-box;
}

[hidden] {
       display: none !important;
}

body {
       font-family: var(--font);
       color: var(--ink);
       max-width: 1680px;
       margin: 0 auto;
       padding: 24px;
       background: #f7f9fb;
}

/* Form left, live preview right, with a full-width alert band between the headers and
   the content. Stacks on narrow screens. */
.layout {
       display: grid;
       grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
       gap: 0 18px;
       align-items: start;
}

@media (max-width: 1200px) {
       .layout {
              grid-template-columns: minmax(0, 1fr);
       }
}

.alerts {
       grid-column: 1 / -1;
}

.col-preview {
       position: sticky;
       top: 24px;
}

h1 {
       font-size: 22px;
       font-weight: var(--weight-heading);
}

h2 {
       font-size: 15px;
       font-weight: var(--weight-subhead);
       margin-top: 28px;
}

.brand {
       display: flex;
       align-items: center;
       gap: 18px;
       background: #fff;
       border: 1px solid var(--line);
       border-radius: 8px;
       padding: 6px 22px;
       margin-bottom: 18px;
}

.brand img {
       height: 84px;
}

.brand .divider {
       width: 1px;
       height: 40px;
       background: var(--line);
}

.brand h1 {
       margin: 0;
       font-size: 25px;
       font-weight: var(--weight-heading);
       letter-spacing: -0.02em;
}

.brand h1 .accent {
       color: var(--blue);
}

fieldset {
       border: 1px solid var(--line);
       border-radius: 8px;
       background: #fff;
       margin: 0 0 18px;
}

fieldset h2 {
       margin: 10px;
}

.section-note {
       display: inline-block;
       margin-left: 10px;
       padding: 2px 9px;
       border: 1px solid #ecd7a4;
       border-radius: 999px;
       background: #fdf6e8;
       color: #7d5a10;
       font-size: 11.5px;
       font-weight: var(--weight-body);
       letter-spacing: 0;
       vertical-align: middle;
}

label {
       display: block;
       font-size: 12px;
       font-weight: var(--weight-subhead);
       margin: 10px 0 3px;
}

input,
select {
       width: 100%;
       padding: 8px;
       border: 1px solid var(--line);
       border-radius: 6px;
       font-family: inherit;
       font-size: 13px;
       color: inherit;
}

.affix {
       position: relative;
       display: block;
}

.affix-symbol {
       position: absolute;
       top: 0;
       bottom: 0;
       display: flex;
       align-items: center;
       color: #6b7a86;
       font-size: 13px;
       line-height: normal;
       pointer-events: none;
}

.affix-pre .affix-symbol {
       left: 9px;
}

.affix-pre input {
       padding-left: 21px;
}

.affix-post .affix-symbol {
       right: 10px;
}

.affix-post input {
       padding-right: 22px;
}

.affix-post input::-webkit-outer-spin-button,
.affix-post input::-webkit-inner-spin-button {
       -webkit-appearance: none;
       margin: 0;
}

input.invalid,
select.invalid {
       border-color: #c0492c;
       background: #fdf7f6;
}

.field-error {
       margin: 4px 0 0;
       color: #8f2f19;
       font-size: 12px;
       line-height: 1.35;
}

.grid {
       display: grid;
       grid-template-columns: repeat(4, 1fr);
       gap: 0 14px;
       padding: 0 10px 12px;
}

.grid .span2 {
       grid-column: span 2;
}

.grid .span3 {
       grid-column: span 3;
}

.grid .span4 {
       grid-column: span 4;
}

.table-wrap {
       padding: 0 10px 12px;
       overflow-x: auto;
}

table {
       width: 100%;
       border-collapse: collapse;
       margin-top: 4px;
}

th {
       background: #f7f9fb;
       color: var(--ink);
       font-size: 12px;
       font-weight: var(--weight-subhead);
       text-align: left;
       padding: 7px 8px;
       border-bottom: 1px solid var(--line);
       white-space: nowrap;
}

th:first-child {
       border-top-left-radius: 6px;
}

th:last-child {
       border-top-right-radius: 6px;
}

td {
       padding: 7px 8px;
       border-bottom: 1px solid var(--line);
       font-size: 13px;
       line-height: 1.35;
       vertical-align: middle;
}

tbody tr:last-child td {
       border-bottom: 0;
}

td input,
td select {
       padding: 8px;
}

td.product-label {
       white-space: nowrap;
       font-weight: var(--weight-subhead);
}

th.col-qty {
       width: 108px;
}

th.col-price {
       width: 120px;
}

th.col-disc {
       width: 100px;
}

th.col-total {
       width: 130px;
}

.num {
       text-align: right;
}

td.unit,
td.total,
#newBusinessTotal {
       font-weight: var(--weight-subhead);
       white-space: nowrap;
}

button {
       background: var(--blue);
       color: #fff;
       border: 0;
       border-radius: 6px;
       padding: 10px 16px;
       font-family: inherit;
       font-size: 13px;
       font-weight: var(--weight-subhead);
       cursor: pointer;
}

.bar {
       display: flex;
       gap: 10px;
       align-items: center;
       margin-top: 14px;
}

.check label {
       display: flex;
       align-items: center;
       gap: 8px;
       font-weight: var(--weight-body);
       margin: 14px 0 3px;
}

.check input {
       width: auto;
}

.subsection {
       margin: 4px 10px 14px;
       border: 1px solid var(--line);
       border-radius: 6px;
       background: #f7f9fb;
}

.subsection .grid {
       padding: 0 10px 10px;
}

.subsection .grid label {
       margin-top: 10px;
}

@media (max-width: 760px) {
       .grid {
              grid-template-columns: repeat(2, 1fr);
       }

       .grid .span2,
       .grid .span4 {
              grid-column: span 2;
       }
}

.preview-canvas {
       position: relative;
       border: 1px solid var(--line);
       border-radius: 8px;
       background: var(--canvas);
       padding: 4px;
       overflow: hidden;
}

#previewStatus {
       display: none;
       position: absolute;
       top: 12px;
       right: 16px;
       z-index: 1;
       align-items: center;
       padding: 5px 11px;
       border: 1px solid var(--line);
       border-radius: 999px;
       background: #fff;
       color: #5c6b76;
       font-size: 12px;
       box-shadow: 0 1px 3px rgba(26, 39, 51, .12);
}

#previewStatus.busy {
       display: flex;
}

#previewFrame {
       display: block;
       width: 100%;
       height: calc(100vh - 120px);
       border: 0;
       border-radius: 5px;
       background: var(--canvas);
}

.preview-placeholder {
       display: flex;
       align-items: center;
       justify-content: center;
       gap: 10px;
       height: calc(100vh - 120px);
       border-radius: 5px;
       background: var(--canvas);
       color: #5c6b76;
       font-size: 13px;
}

#result {
       display: none;
       margin: 0 0 18px;
       padding: 13px 16px;
       border: 1px solid var(--line);
       border-left: 4px solid var(--line);
       border-radius: 8px;
       background: #fff;
       font-size: 13px;
       line-height: 1.45;
}

#result strong {
       font-weight: var(--weight-subhead);
}

#result.ok {
       background: #eef8f2;
       border-color: #b6e0c7;
       border-left-color: #2e9e5b;
       color: #1c6b3c;
}

#result.err {
       background: #fdf0ee;
       border-color: #f0c0b7;
       border-left-color: #c0492c;
       color: #8f2f19;
}

#result.warn {
       background: #fdf6e8;
       border-color: #ecd7a4;
       border-left-color: #c08a1e;
       color: #7d5a10;
}

#result.loading {
       background: #eef4f9;
       border-color: #b9d4ea;
       border-left-color: var(--blue);
       color: #235f8a;
}

#result a {
       color: inherit;
       font-weight: var(--weight-subhead);
}

.spinner {
       width: 16px;
       height: 16px;
       border: 2px solid #cdd6dc;
       border-top-color: var(--blue);
       border-radius: 50%;
       display: inline-block;
       vertical-align: -3px;
       margin-right: 8px;
       animation: spin .8s linear infinite;
}

@keyframes spin {
       to {
              transform: rotate(360deg);
       }
}