/* Nooklite Costbook — materials, fees, quotes, pantry, and print quote */

.costbook-hero h1,
.page-intro.costbook-intro h1 {
  max-width: 22ch;
}

.fee-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
}

.fee-presets button {
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}

.fee-presets button[aria-pressed="true"] {
  background: var(--forest-deep);
  border-color: var(--forest-deep);
  color: #f7f3ec;
}

.fee-note {
  margin: 0.35rem 0 0.85rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.material-table {
  display: grid;
  gap: 0.55rem;
}

.material-head,
.material-row,
.quote-head,
.quote-row {
  display: grid;
  gap: 0.45rem 0.5rem;
  align-items: end;
}

.material-head,
.quote-head {
  display: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.material-row,
.quote-row {
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.75rem 0.8rem;
  background: var(--paper);
}

.material-row .field-name,
.material-row .mat-cost,
.quote-row .field-name,
.quote-row .line-total {
  grid-column: 1 / -1;
}

.mat-cost,
.line-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.mat-cost .value,
.line-total .value {
  font-family: var(--font-serif);
  font-weight: 560;
  font-size: 1.05rem;
}

.material-row.is-invalid .mat-cost .value {
  color: var(--warn);
}

.row-remove {
  justify-self: start;
}

.formula-note {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.etsy-components {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--line);
}

.quote-totals {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.quote-totals div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.quote-totals .total {
  font-weight: 700;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}

.wholesale-flag {
  font-size: 0.8rem;
  font-weight: 700;
}

.wholesale-flag.good { color: var(--forest); }
.wholesale-flag.warn { color: var(--warn); }
.wholesale-flag.bad { color: var(--bad); }

.pro-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
}

.pro-tabs button {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
}

.pro-tabs button[aria-selected="true"] {
  background: var(--forest-deep);
  border-color: var(--forest-deep);
  color: #f7f3ec;
}

.demo-preview {
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

body.is-pro .demo-preview {
  display: none;
}

.pantry-list,
.library-list,
.quote-log {
  display: grid;
  gap: 0.65rem;
}

.saved-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.95rem;
  background: var(--paper);
  display: grid;
  gap: 0.35rem;
}

.saved-card h3 {
  font-size: 1.05rem;
  margin: 0;
}

.saved-card .meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.saved-card .card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.quote-print {
  display: none;
}

@media (min-width: 720px) {
  .material-head,
  .quote-head {
    display: grid;
    padding: 0 0.15rem;
  }

  .material-head,
  .material-row {
    grid-template-columns: minmax(7rem, 1.5fr) 5.6rem 5.4rem 5.4rem 5.8rem auto;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    align-items: end;
  }

  .quote-head,
  .quote-row {
    grid-template-columns: minmax(7rem, 1.5fr) 6.2rem 5.4rem 5.8rem auto;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    align-items: end;
  }

  .material-row .field-name,
  .material-row .mat-cost,
  .quote-row .field-name,
  .quote-row .line-total {
    grid-column: auto;
  }

  .mat-cost,
  .line-total {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.15rem;
  }

  .row-remove {
    justify-self: stretch;
  }
}

@media print {
  body.print-quote .site-header,
  body.print-quote .preview-banner,
  body.print-quote .page-intro,
  body.print-quote .calc-section,
  body.print-quote .pro-section,
  body.print-quote .pricing,
  body.print-quote .faq-section,
  body.print-quote .site-footer,
  body.print-quote .modal-root,
  body.print-quote .no-print {
    display: none !important;
  }

  body.print-quote .quote-print {
    display: block !important;
    width: 100%;
    max-width: 40rem;
    margin: 0 auto;
    color: #111;
    background: #fff;
  }

  body.print-quote .quote-print h1 {
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
  }

  body.print-quote .quote-print table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
  }

  body.print-quote .quote-print th,
  body.print-quote .quote-print td {
    text-align: left;
    padding: 0.4rem 0.35rem;
    border-bottom: 1px solid #ddd;
  }

  body.print-quote .quote-print td.num,
  body.print-quote .quote-print th.num {
    text-align: right;
  }

  body.print-quote.is-pro .quote-brand {
    display: none !important;
  }
}
