:root {
  color-scheme: light;
  --accent: #a6161f;
  --accent-dark: #781018;
  --accent-soft: #fff0f1;
  --ink: #1d2025;
  --muted: #6a7079;
  --line: #e2e4e8;
  --surface: #ffffff;
  --canvas: #f5f5f3;
  --success: #19734a;
  --shadow: 0 14px 40px rgba(24, 25, 28, .08);
  --brand: var(--accent);
  --brand-soft: var(--accent-soft);
  --border: var(--line);
  --danger: var(--accent);
  --shadow-soft: var(--shadow);
  --radius: 18px;
  --radius-small: 11px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select,
input[type="checkbox"],
.file-button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(166, 22, 31, .22);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(1240px, calc(100% - 40px));
  margin-inline: auto;
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgb(201 201 201 / 96%);
  color: #fff;
  backdrop-filter: blur(18px);
}

.app-header__inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 13px;
  background: linear-gradient(145deg, #d72b37, #7d0f17);
  box-shadow: 0 7px 18px rgba(166, 22, 31, .35);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: .01em;
}

.brand small {
  margin-top: 1px;
  color: rgba(255, 255, 255, .56);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-nav[hidden] {
  display: none;
}

.nav-button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, .66);
  font-size: 13px;
  font-weight: 700;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 18%, rgba(159, 23, 23, .12), transparent 32%),
    #f6f7f9;
}

.login-screen[hidden],
#admin-app[hidden] {
  display: none !important;
}

.login-card {
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
  color: var(--ink);
  text-decoration: none;
}

.login-brand strong,
.login-brand small {
  display: block;
}

.login-card h1 {
  margin: 6px 0 10px;
  font-size: clamp(28px, 6vw, 40px);
}

.login-card__description {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.6;
}

.login-card .field {
  margin-top: 14px;
}

.login-message {
  min-height: 22px;
  margin: 10px 0;
  color: var(--muted);
}

.login-message.is-error {
  color: var(--danger);
}

.back-link {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
}

.admin-main {
  padding-bottom: 64px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.admin-stats article {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.admin-stats span,
.admin-table td small {
  display: block;
  color: var(--muted);
}

.admin-stats strong {
  display: block;
  margin-top: 8px;
  color: var(--brand);
  font-size: 30px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.table-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.compact-empty {
  min-height: 220px;
}

.source-workspace {
  display: grid;
  grid-template-columns: minmax(220px, .28fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.source-file-list {
  display: grid;
  gap: 8px;
}

.source-file {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.source-file span,
.source-file small {
  display: block;
}

.source-file small {
  margin-top: 4px;
  color: var(--muted);
}

.source-file.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.source-editor__heading {
  gap: 12px;
}

.source-status {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.code-editor {
  width: 100%;
  min-height: 560px;
  padding: 16px;
  resize: vertical;
  border: 1px solid #252a35;
  border-radius: 12px;
  outline: 0;
  background: #11151d;
  color: #e9eef9;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  tab-size: 2;
}

.code-editor:focus {
  box-shadow: 0 0 0 3px rgba(159, 23, 23, .18);
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.admin-dialog,
.source-preview-dialog {
  width: min(900px, calc(100% - 32px));
  max-height: 90vh;
  padding: 22px;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

.admin-dialog::backdrop,
.source-preview-dialog::backdrop {
  background: rgba(16, 20, 28, .58);
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-dialog pre {
  max-height: 60vh;
  overflow: auto;
  padding: 16px;
  border-radius: 12px;
  background: #11151d;
  color: #e9eef9;
  white-space: pre-wrap;
}

.source-preview-dialog {
  width: min(1180px, calc(100% - 32px));
  height: 90vh;
}

.source-preview-dialog iframe {
  width: 100%;
  height: calc(100% - 54px);
  border: 1px solid var(--border);
  border-radius: 12px;
}

@media (max-width: 780px) {
  .admin-stats,
  .source-workspace {
    grid-template-columns: 1fr;
  }

  .source-files {
    position: static;
  }

  .code-editor {
    min-height: 420px;
  }
}

.nav-button:hover,
.nav-button.is-active {
  background: rgba(255, 255, 255, .09);
  color: #fff;
}

.nav-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
}

.app-main {
  padding-block: 42px 70px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}

.page-heading h1 {
  margin: 3px 0 5px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -.035em;
}

.page-heading p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  color: var(--accent) !important;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.heading-actions,
.quote-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.quick-fill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  border: 1px solid #e3d4d6;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff, #fff8f8);
  box-shadow: 0 8px 24px rgba(82, 17, 22, .06);
  padding: 15px 17px;
}

.quick-fill__label strong,
.quick-fill__label span {
  display: block;
}

.quick-fill__label strong {
  color: #292c31;
  font-size: 13px;
}

.quick-fill__label span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.quick-fill__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.button,
.mini-button,
.icon-button {
  border: 0;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.button:hover,
.mini-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.button--primary {
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(166, 22, 31, .22);
  color: #fff;
}

.button--primary:hover {
  background: var(--accent-dark);
}

.button--ghost {
  border: 1px solid #d9dce1;
  background: var(--surface);
  color: #34383e;
}

.button--ghost:hover {
  border-color: #bec2c9;
  background: #fbfbfb;
}

.button--light {
  background: #fff;
  color: var(--accent-dark);
}

.button--light:hover {
  box-shadow: 0 8px 22px rgba(0, 0, 0, .16);
}

.button--block {
  width: 100%;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.editor-column {
  display: grid;
  gap: 18px;
}

.editor-sidebar {
  display: grid;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 2px 2px rgba(0, 0, 0, .01);
  padding: 22px;
}

.panel__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 19px;
}

.panel__heading > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel__heading--stack {
  align-items: flex-start;
  flex-direction: column;
}

.panel__heading h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.015em;
}

.step {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
}

.mini-button {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  background: #f1f2f4;
  color: #555b64;
  font-size: 11px;
  font-weight: 800;
}

.mini-button--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.field-grid--single {
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > span {
  color: #555b63;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}

.field input,
.field select,
.field textarea,
.compact-input {
  width: 100%;
  border: 1px solid #d9dce1;
  border-radius: var(--radius-small);
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field input,
.field select,
.compact-input {
  height: 43px;
  padding: 0 12px;
}

.field textarea {
  min-height: 95px;
  padding: 11px 12px;
  resize: vertical;
}

.field .autoComplete_wrapper {
  width: 100%;
}

.field .autoComplete_wrapper > input {
  width: 100%;
  min-height: 43px;
  padding: 10px 38px 10px 12px;
  border: 1px solid #d9dce1;
  border-radius: var(--radius-small);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  font-size: 13px;
}

.field .autoComplete_wrapper > input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(166, 22, 31, .12);
}

.field .autoComplete_wrapper > ul {
  z-index: 100;
  width: 100%;
  max-height: 280px;
  overflow: hidden;
  overflow-y: auto;
  border: 1px solid #d9dce1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(24, 25, 28, .14);
  font-size: 13px;
}

.country-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 12px;
  cursor: pointer;
}

.country-option small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.country-option[aria-selected="true"],
.country-option:hover {
  background: #fff1f2;
  color: var(--accent);
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.compact-input:hover {
  border-color: #b8bdc4;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.compact-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(166, 22, 31, .09);
  outline: 0;
}

.field input[aria-invalid="true"] {
  border-color: #d0222e;
  background: #fff8f8;
}

.preset-list {
  display: flex !important;
  flex-wrap: wrap;
  gap: 7px !important;
}

.preset-button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #a6161f;
  border-radius: 8px;
  background: var(--accent);
  box-shadow: 0 5px 12px rgba(166, 22, 31, .14);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.preset-button:hover,
.preset-button.is-active {
  border-color: #641017;
  background: var(--accent-dark);
  color: #fff;
}

.preset-button--customer {
  min-width: 48px;
}

.product-list {
  display: grid;
  gap: 13px;
}

.product-add-row {
  display: flex;
  margin-top: 14px;
}

.product-add-button {
  width: 100%;
  min-height: 42px;
}

.product-card {
  overflow: hidden;
  border: 1px solid #e2e4e7;
  border-radius: 14px;
  background: #fbfbfa;
}

.product-card__top {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 34px;
  gap: 12px;
  align-items: end;
  padding: 14px 14px 12px;
}

.product-index {
  display: grid;
  width: 36px;
  height: 43px;
  place-items: center;
  border-radius: 10px;
  background: #25272b;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.product-name input {
  background: #fff;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 4px;
  place-items: center;
  border-radius: 9px;
  background: #f1e8e9;
  color: var(--accent);
  font-size: 21px;
  line-height: 1;
}

.product-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  padding: 0 14px 14px;
}

.product-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px dashed #d7dade;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}

.product-result strong {
  color: var(--ink);
  font-size: 14px;
}

.option-list {
  display: grid;
  gap: 13px;
  margin: 19px 0;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.switch-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: #3e4349;
  font-size: 12px;
  font-weight: 800;
}

.switch-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #cdd0d5;
  transition: background .18s ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  content: "";
  transition: transform .18s ease;
}

.switch-label input:checked + .switch {
  background: var(--accent);
}

.switch-label input:checked + .switch::after {
  transform: translateX(14px);
}

.compact-input {
  width: 95px;
  height: 37px;
  text-align: right;
}

.input-suffix {
  position: relative;
}

.input-suffix .compact-input {
  padding-right: 29px;
}

.input-suffix span {
  position: absolute;
  top: 50%;
  right: 11px;
  color: var(--muted);
  font-size: 11px;
  transform: translateY(-50%);
}

.fee-hint {
  padding-left: 43px;
  color: var(--muted);
  font-size: 10px;
}

.summary-card {
  position: sticky;
  top: 90px;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #a91822, #711017);
  box-shadow: 0 20px 45px rgba(100, 15, 21, .24);
  color: #fff;
  padding: 22px;
}

.summary-card::before {
  position: absolute;
  top: -90px;
  right: -70px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  content: "";
}

.summary-card__heading {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
  font-size: 12px;
  font-weight: 800;
}

.summary-card__heading span:last-child {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
}

.summary-list {
  position: relative;
  display: grid;
  gap: 10px;
  margin: 17px 0;
}

.summary-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.summary-list dt {
  color: rgba(255, 255, 255, .65);
  font-size: 11px;
}

.summary-list dd {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.summary-total {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  margin: 0 -22px 18px;
  padding: 17px 22px 0;
  border-top: 1px solid rgba(255, 255, 255, .16);
}

.summary-total span {
  font-size: 12px;
  font-weight: 800;
}

.summary-total strong {
  font-size: 24px;
  letter-spacing: -.03em;
}

.quote-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.quote-document {
  width: min(100%, 1040px);
  margin-inline: auto;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  color: #080808;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.42;
  padding: clamp(24px, 4vw, 48px) 26px;
}

.quote-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 10vw, 130px);
}

.quote-overview__column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
}

.quote-main-logo {
  display: block;
  width: min(100%, 365px);
  height: 116px;
  object-fit: contain;
  object-position: left center;
}

.quote-company {
  min-height: 116px;
  padding-top: 16px;
}

.quote-company h2 {
  margin: 0 0 18px;
  color: #d32631;
  font-size: 21px;
  line-height: 1.1;
}

.quote-company p,
.quote-contact-block p {
  margin: 2px 0;
}

.quote-company a {
  color: #0000ee;
  text-decoration: underline;
}

.quote-contact-block {
  margin-top: 18px;
}

.quote-contact-block strong,
.quote-company strong {
  font-weight: 800;
}

.quote-title {
  padding: 17px 0 16px;
  text-align: center;
}

.quote-title h1 {
  margin: 0 0 15px;
  font-size: 23px;
  line-height: 1.1;
}

.quote-title p {
  margin: 0;
  font-family: inherit;
  font-size: 15px;
}

.quote-title time {
  color: var(--accent);
}

.quote-table-wrap,
.payment-table-wrap {
  overflow-x: auto;
}

.quote-table,
.payment-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
}

.quote-table {
  min-width: 620px;
}

.payment-table {
  min-width: 720px;
}

.quote-table th,
.quote-table td,
.payment-table th,
.payment-table td {
  border: 1px solid #d7d7d7;
}

.quote-table th,
.quote-table td {
  height: 38px;
  padding: 8px 12px;
  text-align: center;
  vertical-align: middle;
}

.quote-table thead th {
  background: #f5f5f5;
  font-weight: 800;
}

.line-note {
  display: block;
  margin-top: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 400;
}

.quote-table tfoot th {
  background: #f8f8f8;
  font-weight: 800;
}

.quote-adjustment th:last-child {
  color: #c81722;
}

.quote-grand-total th {
  height: 40px;
  font-size: 15px;
}

.payment-table-wrap {
  margin-top: 14px;
}

.payment-table thead th {
  height: 39px;
  background: #f5f5f5;
  font-weight: 800;
  text-align: center;
}

.payment-table tbody tr {
  height: 150px;
}

.payment-table td {
  padding: 12px;
  vertical-align: middle;
}

.payment-table__logo {
  width: 22%;
  text-align: center;
}

.payment-table__logo img {
  display: block;
  width: min(100%, 155px);
  max-height: 90px;
  margin-inline: auto;
  object-fit: contain;
}

.payment-table__info {
  width: 56%;
}

.payment-table__info p {
  margin: 1px 0;
}

.payment-table__info a {
  color: #0000ee;
  text-decoration: none;
}

.payment-table__qr {
  width: 22%;
  text-align: center;
}

.payment-table__qr img {
  display: block;
  width: 130px;
  height: 130px;
  margin-inline: auto;
  object-fit: contain;
}

.quote-footer {
  margin-top: 17px;
  font-family: inherit;
  font-size: 13px;
}

.quote-footer p {
  margin: 0 0 17px;
}

.quote-footer__note {
  color: var(--accent);
  text-decoration: underline;
  white-space: pre-line;
}

.saved-list {
  display: grid;
  gap: 12px;
}

.saved-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, .7fr) minmax(140px, .6fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  padding: 17px 18px;
}

.saved-card h3 {
  margin: 0 0 3px;
  font-size: 14px;
}

.saved-card p,
.saved-card time {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.saved-card__total {
  font-size: 16px;
  font-weight: 900;
}

.saved-card__actions {
  display: flex;
  gap: 7px;
}

.saved-card__actions .mini-button.is-danger {
  background: #fff0f1;
  color: var(--accent);
}

.empty-state {
  display: grid;
  min-height: 300px;
  place-items: center;
  border: 1px dashed #cdd0d5;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .48);
  padding: 40px;
  text-align: center;
}

.empty-state__icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 13px;
  place-items: center;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 25px;
}

.empty-state h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 15px;
  border-radius: 11px;
  background: #1e2125;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-sidebar {
    grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr);
  }

  .summary-card {
    position: static;
  }

  .saved-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .saved-card > :nth-child(2),
  .saved-card > :nth-child(3) {
    display: none;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 24px, 1240px);
  }

  .app-header__inner {
    min-height: 64px;
  }

  .brand small {
    display: none;
  }

  .brand strong {
    font-size: 13px;
  }

  .nav-button {
    padding-inline: 10px;
    font-size: 11px;
  }

  .app-main {
    padding-block: 28px 50px;
  }

  .page-heading,
  .quote-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-fill {
    align-items: flex-start;
    flex-direction: column;
  }

  .quick-fill__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .heading-actions,
  .quote-toolbar__actions {
    justify-content: flex-start;
  }

  .editor-sidebar {
    grid-template-columns: 1fr;
  }

  .field-grid,
  .product-fields {
    grid-template-columns: 1fr;
  }

  .product-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel {
    padding: 17px;
  }

  .panel__heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .quote-document {
    padding: 25px 18px;
  }

  .quote-overview {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .quote-company {
    min-height: 0;
    padding-top: 0;
  }

  .saved-card {
    grid-template-columns: 1fr;
  }

  .saved-card__actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 430px) {
  .brand span:last-child {
    display: none;
  }

  .app-nav {
    margin-left: auto;
  }

  .product-fields {
    grid-template-columns: 1fr;
  }

  .product-card__top {
    grid-template-columns: 30px minmax(0, 1fr) 32px;
    gap: 8px;
  }

  .product-index {
    width: 30px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  body {
    background: #fff;
    font-size: 11px;
  }

  .app-header,
  .quote-toolbar,
  #editor-view,
  #saved-view,
  .toast {
    display: none !important;
  }

  .app-main,
  .app-shell {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  #quote-view {
    display: block !important;
  }

  .quote-document {
    width: 100%;
    border: 0;
    box-shadow: none;
    overflow: visible;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 12px;
    padding: 0;
  }

  .quote-table-wrap,
  .payment-table-wrap {
    width: 100%;
    overflow: visible !important;
  }

  .quote-table,
  .payment-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
  }

  .payment-table__info {
    overflow-wrap: anywhere;
  }

  .payment-table__qr img {
    width: min(100%, 130px);
    height: auto;
    aspect-ratio: 1;
  }

  .quote-overview,
  .payment-table tr,
  .quote-table tr {
    break-inside: avoid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
