:root {
  color-scheme: dark;
  --bg: #071018;
  --panel: #101c27;
  --line: rgba(255, 255, 255, 0.12);
  --muted: #9fb0bd;
  --ink: #f7fbff;
  --accent: #74e8c3;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(33, 160, 190, 0.15), transparent 34rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.app-header {
  margin-bottom: 24px;
}

.back,
.text-button {
  color: var(--accent);
}

.back {
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 6vw, 3.5rem);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#workspace {
  display: grid;
  gap: 22px;
}

.editor,
.internal-summary,
.notice {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(16, 28, 39, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

.editor-heading,
.line-heading,
.quote-brand,
.actions,
.payment-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 18px 0 26px;
}

label {
  display: grid;
  gap: 7px;
  color: #d7e3ea;
  font-size: 0.9rem;
  font-weight: 700;
}

small {
  color: var(--muted);
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #09131c;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(116, 232, 195, 0.12);
}

.money-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #09131c;
}

.money-input > span {
  padding-left: 12px;
  color: var(--muted);
}

.money-input input {
  border: 0;
  background: transparent;
}

.line-items {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.line-item {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 12, 18, 0.45);
}

.line-item .description {
  grid-column: 1 / -1;
}

.remove-item {
  align-self: end;
  min-height: 44px;
  border: 1px solid rgba(255, 121, 121, 0.25);
  border-radius: 10px;
  background: rgba(99, 26, 26, 0.35);
  color: #ffc4c4;
  cursor: pointer;
}

.button,
.text-button {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
}

.button {
  background: var(--accent);
  color: #06120f;
  text-decoration: none;
}

.button.secondary {
  border: 1px solid var(--line);
  background: #1a2a36;
  color: var(--ink);
}

.button.accent {
  background: #f7cf69;
  color: #1c1504;
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.text-button {
  background: transparent;
}

.status {
  min-height: 24px;
  color: #b8cbc5;
}

.payment-result {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(116, 232, 195, 0.25);
  border-radius: 14px;
  background: rgba(24, 76, 64, 0.2);
}

.payment-result label {
  flex: 1 1 320px;
}

.quote-paper {
  padding: clamp(24px, 6vw, 54px);
  border-radius: 4px;
  background: #fff;
  color: #15212a;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
}

.quote-paper .eyebrow {
  color: #14785e;
}

.quote-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: #56636c;
}

.customer-block {
  display: grid;
  gap: 4px;
  margin: 38px 0;
}

.customer-block span,
.quote-paper footer,
.quote-copy p {
  color: #56636c;
}

.customer-block strong {
  font-size: 1.25rem;
}

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

th,
td {
  padding: 13px 8px;
  border-bottom: 1px solid #dfe5e8;
  text-align: right;
}

th:first-child,
td:first-child {
  text-align: left;
}

.quote-totals {
  width: min(340px, 100%);
  margin: 24px 0 30px auto;
}

.quote-totals > div,
.internal-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0;
}

.grand-total {
  margin-top: 6px;
  border-top: 2px solid #17242d;
  font-size: 1.25rem;
}

.quote-copy {
  margin-top: 24px;
  white-space: pre-wrap;
}

.quote-copy h3 {
  margin-bottom: 8px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quote-paper footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid #dfe5e8;
}

.internal-summary {
  align-self: start;
}

.internal-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (min-width: 720px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .line-item {
    grid-template-columns: minmax(240px, 2fr) 80px 130px 130px 90px;
  }

  .line-item .description {
    grid-column: auto;
  }
}

@media (min-width: 1040px) {
  #workspace {
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  }

  .internal-summary {
    grid-column: 1;
  }

  .quote-paper {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media print {
  @page {
    margin: 0.55in;
  }

  body {
    background: #fff;
  }

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

  .no-print {
    display: none !important;
  }

  #workspace,
  .quote-paper {
    display: block !important;
  }

  .quote-paper {
    padding: 0;
    box-shadow: none;
  }
}
