/* QuoteJig app — "chalk on slate" (ported from the run-1 demo, same brand canon) */
@import url("assets/fonts/fonts-local.css");

:root {
  --slate: #1C2530;
  --slate-2: #2A3646;
  --paper: #F7F5F1;
  --white: #FFFFFF;
  --orange: #FF6B2C;
  --orange-deep: #E5551A;
  --blue: #2D6BE4;
  --graphite: #5A6472;
  --line: #D8D4CC;
  --ok: #1F8A4C;
  --bad: #C0392B;
  --shadow: 0 2px 8px rgba(28, 37, 48, .08);
  --sidebar-w: 224px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--slate);
  font: 15px/1.6 'Inter', sans-serif;
}
h1, h2, h3 { font-family: 'Barlow Semi Condensed', sans-serif; line-height: 1.15; margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: 'Inter', sans-serif; color: var(--slate); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

/* ============ Layout: slate sidebar + paper canvas ============ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--slate);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 22px 14px 16px;
  z-index: 20;
}
.lockup { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.lockup img { width: 34px; height: 34px; display: block; }
.wordmark { font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 700; font-size: 23px; letter-spacing: -.5px; color: var(--paper); }
.wordmark .jig { color: var(--orange); }

.nav-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: none; border: 0; color: var(--paper);
  font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 600; font-size: 17px;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 4px;
  opacity: .78;
}
.nav-btn:hover { background: var(--slate-2); opacity: 1; }
.nav-btn.active { background: var(--slate-2); opacity: 1; box-shadow: inset 3px 0 0 var(--orange); }
.nav-btn svg { flex: 0 0 auto; }

.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--slate-2); }
.llm-footnote { font-size: 11px; line-height: 1.5; color: #9BA4AF; margin: 0; }

.company-tile { display: flex; align-items: center; gap: 9px; padding: 0 8px; margin: 2px 0 22px; }
.company-initials {
  width: 30px; height: 30px; border-radius: 7px; background: var(--slate-2); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font: 700 13px 'Barlow Semi Condensed', sans-serif; letter-spacing: .5px;
  flex: 0 0 auto;
}
.company-name { font-size: 12.5px; color: #C9CFD6; line-height: 1.3; min-width: 0; }
.company-name b { color: var(--paper); display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 34px 40px 72px;
  max-width: 1100px;
}

/* mobile top bar (hidden on desktop) */
.mobile-topbar { display: none; }

/* ============ View headers ============ */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.view-title { font-size: 32px; font-weight: 700; }
.view-sub { color: var(--graphite); font-size: 14px; margin-top: 3px; }

/* chalk-line motif: one 45-degree orange stroke per view */
.chalk { display: inline-block; margin-left: 10px; vertical-align: 6px; }

.btn {
  font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 600; font-size: 17px;
  border-radius: 9px; padding: 10px 20px; border: 0; letter-spacing: .2px;
}
a.btn { text-decoration: none; display: inline-block; }
.btn-primary { background: var(--orange); color: var(--slate); }
.btn-primary:hover { background: var(--orange-deep); }
.btn-primary:disabled { background: var(--line); color: var(--graphite); cursor: not-allowed; }
.btn-secondary { background: var(--white); color: var(--slate); border: 1.5px solid var(--slate); }
.btn-secondary:hover { background: var(--slate); color: var(--paper); }
.btn-secondary:disabled { border-color: var(--line); color: var(--graphite); cursor: not-allowed; background: var(--white); }
.btn-quiet { background: none; border: 0; color: var(--graphite); font: 600 13.5px 'Barlow Semi Condensed', sans-serif; text-decoration: underline; padding: 6px 8px; }
.btn-quiet:hover { color: var(--slate); }

/* ============ Cards / tables ============ */
.card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th {
  font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 600; font-size: 13px;
  letter-spacing: .6px; text-transform: uppercase; color: var(--graphite);
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line);
}
td { padding: 12px 14px; border-bottom: 1px solid #ECE9E3; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.cell-money, th.cell-money { text-align: right; white-space: nowrap; font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 600; font-size: 15.5px; }
.cell-unit { color: var(--graphite); font-size: 13px; }

/* notices */
.notice { border-radius: 10px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 18px; }
.notice-info { background: #E3ECFC; border: 1px solid #B9CFF5; color: #1E4FAF; }
.notice-warn { background: #FFF6F0; border: 1px solid var(--orange); color: var(--slate); }
.notice-error { background: #FBEAE7; border: 1px solid var(--bad); color: var(--bad); }
.notice a { color: inherit; font-weight: 600; }
.notice button { margin-left: 8px; }

/* ============ Auth screen ============ */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px 40px; background: var(--slate); }
.auth-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-lockup img { width: 44px; height: 44px; }
.auth-lockup .wordmark { font-size: 30px; }
.auth-card { background: var(--white); border-radius: 14px; padding: 30px 30px 24px; width: 420px; max-width: 100%; box-shadow: 0 10px 34px rgba(0,0,0,.35); }
.auth-title { font-size: 26px; font-weight: 700; }
.auth-title .chalk { vertical-align: 4px; }
.auth-sub { color: var(--graphite); font-size: 14px; margin: 6px 0 18px; }
.auth-card .field { margin-bottom: 14px; }
.auth-hint { font-size: 12px; color: var(--graphite); margin: 6px 0 0; }
.auth-cta { width: 100%; margin-top: 4px; }
.auth-fine { font-size: 12px; color: var(--graphite); margin: 14px 0 0; line-height: 1.6; }
.auth-guarantee { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--slate); }
.auth-guarantee b { font-family: 'Barlow Semi Condensed', sans-serif; }
.auth-beta { margin: 22px auto 0; max-width: 420px; text-align: center; font-size: 12px; color: #9BA4AF; line-height: 1.6; }
.auth-sent { text-align: center; padding: 12px 0 4px; }
.auth-sent h2 { font-size: 22px; margin-bottom: 8px; }
.auth-sent p { color: var(--graphite); font-size: 14px; margin: 0 0 14px; }

/* ============ Quotes list ============ */
.stats-strip { display: flex; gap: 34px; align-items: flex-end; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 18px 22px 14px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-num { font: 700 30px/1 'Barlow Semi Condensed', sans-serif; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12.5px; color: var(--graphite); margin-top: 3px; }
.stat-note { margin-left: auto; align-self: center; font-size: 11.5px; color: var(--graphite); max-width: 200px; text-align: right; }

.quote-row { cursor: pointer; }
.quote-row:hover td { background: #FBFAF7; }
.cell-num { font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 600; white-space: nowrap; }
.cell-client { font-weight: 600; font-size: 14.5px; }
.cell-sub { color: var(--graphite); font-size: 12.5px; }
.cell-age { color: var(--graphite); font-size: 13px; white-space: nowrap; }
.blank-flag { display: inline-block; font: 600 11px 'Barlow Semi Condensed', sans-serif; color: var(--orange-deep); letter-spacing: .3px; }

.status-chip {
  display: inline-block; font: 600 12.5px 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .5px; border-radius: 999px; padding: 3px 12px;
}
.chip-draft { background: #EDEAE3; color: var(--graphite); }
.chip-sent { background: #E3ECFC; color: #1E4FAF; }
.chip-won { background: #E1F0E7; color: #16693A; }
.chip-lost { background: #F4E3E0; color: #9C3428; }

.empty-state { padding: 46px 24px; text-align: center; color: var(--graphite); }
.empty-state h3 { font-size: 20px; color: var(--slate); margin-bottom: 6px; }
.loading-state { padding: 40px 24px; text-align: center; color: var(--graphite); font-size: 14px; }

/* ============ New quote ============ */
.nq-form { padding: 22px; margin-bottom: 24px; }
.nq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.field label { display: block; font: 600 13px 'Barlow Semi Condensed', sans-serif; letter-spacing: .5px; text-transform: uppercase; color: var(--graphite); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 14.5px; background: var(--white);
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.notes-row { position: relative; }
.mic-btn {
  position: absolute; right: 10px; bottom: 10px;
  background: var(--white); border: 1.5px solid var(--slate); border-radius: 999px;
  font: 600 13px 'Barlow Semi Condensed', sans-serif; padding: 5px 14px; color: var(--slate);
}
.mic-btn:hover { background: var(--slate); color: var(--paper); }
.mic-btn.mic-live { background: var(--orange); border-color: var(--orange); color: var(--slate); }

.build-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.build-note { font-size: 12px; color: var(--graphite); max-width: 520px; }
.build-err { margin-top: 14px; }

/* ============ Editor (review-first) ============ */
.draft-panel { padding: 22px; }
.draft-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.draft-title { font-size: 23px; font-weight: 700; }
.draft-sub { color: var(--graphite); font-size: 13.5px; margin-top: 2px; }
.draft-status { display: flex; align-items: center; gap: 8px; }
.draft-matchline { font-size: 13.5px; color: var(--graphite); margin: 8px 0 14px; }
.orange-text { color: var(--orange-deep); }

.draft-table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.cell-conf { width: 26px; padding-right: 0; }
.conf-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-high { background: var(--ok); }
.dot-med { background: var(--graphite); }
.dot-warn { background: #F4B740; }
.dot-needs { background: var(--orange); }

.line-name { font-weight: 600; font-size: 14.5px; }
.line-cat { color: var(--graphite); font-size: 12px; }
.needs-badge {
  display: inline-block; margin-top: 3px;
  background: var(--orange); color: var(--slate);
  font: 600 11px 'Barlow Semi Condensed', sans-serif; letter-spacing: .5px; text-transform: uppercase;
  border-radius: 4px; padding: 2px 7px;
}
.line-needs td { background: #FFF6F0; }

/* assumed-quantity confirm state (amber) */
.confirm-badge {
  display: inline-block; margin-top: 3px;
  background: #F4B740; color: var(--slate);
  font: 600 11px 'Barlow Semi Condensed', sans-serif; letter-spacing: .5px; text-transform: uppercase;
  border-radius: 4px; padding: 2px 7px;
}
.line-confirm td { background: #FFF7E8; }
.qty-confirm-wrap { display: inline-flex; align-items: center; gap: 5px; }
.qty-input.qty-unconfirmed { border-color: #E0A21C; background: #FFF7E8; }
.qty-confirm-btn {
  flex: 0 0 auto; border: 1.5px solid #E0A21C; background: var(--white); color: #B9820F;
  border-radius: 6px; width: 26px; height: 26px; line-height: 1; font-size: 14px; padding: 0;
}
.qty-confirm-btn:hover { background: #F4B740; color: var(--slate); }
.save-book { display: block; margin-top: 6px; font-size: 11.5px; color: var(--graphite); white-space: nowrap; }
.save-book input { margin-right: 5px; vertical-align: -1px; }
.tot-confirm-warn { background: #FFF7E8; border-color: #E0A21C; }

.qty-input, .price-input {
  width: 76px; border: 1px solid var(--line); border-radius: 7px; padding: 7px 8px;
  font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; background: var(--white);
}
.price-input { width: 96px; }
.price-missing { border-color: var(--orange); background: #FFF6F0; }
.money-prefix { color: var(--graphite); font-size: 13px; margin-right: 2px; }
.cell-qty, .cell-price { white-space: nowrap; }
.cell-total { font-size: 15.5px; }
.cell-x { width: 30px; text-align: center; }
.line-remove { background: none; border: 0; color: var(--graphite); font-size: 17px; line-height: 1; padding: 4px 7px; border-radius: 6px; }
.line-remove:hover { background: #F1EEE8; color: var(--bad); }

.add-line-row { margin-top: 12px; }

.draft-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-top: 18px; flex-wrap: wrap; }
.conf-legend { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--graphite); }
.legend-item { display: flex; align-items: center; gap: 7px; }

.draft-totals { min-width: 320px; margin-left: auto; }
.tot-row { display: flex; justify-content: space-between; gap: 40px; padding: 5px 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.tot-row span:last-child { font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 600; font-size: 15.5px; }
.tot-note { font-size: 11.5px; color: var(--graphite); font-weight: 400; }
.tot-grand { border-top: 2px solid var(--slate); margin-top: 6px; padding-top: 9px; }
.tot-grand span { font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 700; font-size: 19px; }
.tot-grand span:last-child { font-size: 22px; }
.tot-blank-warn {
  margin-top: 10px; background: #FFF6F0; border: 1px solid var(--orange);
  color: var(--slate); border-radius: 8px; padding: 9px 12px; font-size: 12.5px;
}
.draft-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 14px; flex-wrap: wrap; }

/* share-link panel (after send) */
.share-panel { margin-top: 16px; background: #E3ECFC; border: 1px solid #B9CFF5; border-radius: 10px; padding: 14px 16px; }
.share-panel h3 { font-size: 16px; margin-bottom: 8px; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-row input { flex: 1; min-width: 200px; border: 1px solid #B9CFF5; border-radius: 8px; padding: 9px 11px; font-size: 13px; background: var(--white); color: var(--slate); }
.share-note { font-size: 12px; color: #1E4FAF; margin: 8px 0 0; }

/* ============ Price book ============ */
.pb-progress-card { padding: 16px 20px; margin-bottom: 18px; display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.pb-progress-num { font: 700 28px/1 'Barlow Semi Condensed', sans-serif; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pb-progress-num small { font-size: 14px; color: var(--graphite); font-weight: 600; }
.pb-progress-bar { flex: 1; min-width: 160px; height: 10px; background: #EDEAE3; border-radius: 999px; overflow: hidden; }
.pb-progress-fill { height: 100%; background: var(--orange); border-radius: 999px; }
.pb-explain { flex-basis: 100%; font-size: 12.5px; color: var(--graphite); margin: 0; }

.pb-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.pb-search {
  flex: 1; min-width: 200px; max-width: 380px;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 13px; font-size: 14px; background: var(--white);
}
.pb-cats { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.pb-cat-btn {
  background: var(--white); border: 1px solid var(--line); border-radius: 999px;
  font: 600 12.5px 'Barlow Semi Condensed', sans-serif; letter-spacing: .3px; padding: 5px 13px; color: var(--graphite);
}
.pb-cat-btn:hover { border-color: var(--slate); color: var(--slate); }
.pb-cat-btn.active { background: var(--slate); border-color: var(--slate); color: var(--paper); }
.pb-count { font-size: 12.5px; color: var(--graphite); margin: 0 0 10px 2px; }

.pb-table-wrap { overflow-x: auto; }
.pb-cat-row td {
  background: var(--paper); font: 600 13px 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .6px; text-transform: uppercase; color: var(--graphite); padding: 9px 14px;
}
.pb-input {
  width: 84px; border: 1px solid transparent; border-radius: 7px; padding: 6px 8px;
  font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; background: transparent;
}
.pb-input:hover { border-color: var(--line); background: var(--white); }
.pb-input:focus { border-color: var(--blue); background: var(--white); }
.pb-input.pb-blank { border-color: #EAD9CD; background: #FFF9F5; }
.pb-sell { font-size: 15px; }
.pb-sell-note { display: block; font: 400 10.5px 'Inter', sans-serif; color: var(--graphite); }
.pb-unpriced { font: 600 11px 'Barlow Semi Condensed', sans-serif; letter-spacing: .4px; text-transform: uppercase; color: var(--orange-deep); }
.pb-archive { background: none; border: 0; color: var(--graphite); font-size: 12px; text-decoration: underline; padding: 4px 6px; border-radius: 6px; }
.pb-archive:hover { color: var(--bad); }

/* modal */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(28, 37, 48, .55);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 18px;
}
.modal { background: var(--white); border-radius: 12px; padding: 24px; width: 460px; max-width: 100%; box-shadow: 0 8px 30px rgba(28,37,48,.25); max-height: 90vh; overflow-y: auto; }
.modal h3 { font-size: 21px; margin-bottom: 14px; }
.modal .field { margin-bottom: 12px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal-note { font-size: 12px; color: var(--graphite); margin: 2px 0 10px; }

/* ============ Settings ============ */
.set-card { padding: 22px; margin-bottom: 22px; }
.set-card h2 { font-size: 20px; margin-bottom: 14px; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.set-grid .field-wide { grid-column: 1 / -1; }
.set-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; align-items: center; }
.set-saved { font-size: 13px; color: var(--ok); font-weight: 600; }
.plan-banner { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 22px; }
.plan-name { font: 700 19px 'Barlow Semi Condensed', sans-serif; }
.plan-days { font-size: 13.5px; color: var(--graphite); }
.plan-days b { color: var(--orange-deep); }
.accent-row { display: flex; align-items: center; gap: 10px; }
.accent-row input[type="color"] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); cursor: pointer; }
.founding-status { font-size: 14px; }
.signout-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.signout-sub { font-size: 12.5px; color: var(--graphite); }

/* ============ Responsive: 375px ============ */
@media (max-width: 700px) {
  .sidebar { display: none; }
  .app-main { margin-left: 0; padding: 74px 14px 96px; }

  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; height: 56px;
    background: var(--slate); color: var(--paper); padding: 0 14px; z-index: 30;
  }
  .mobile-topbar .lockup { padding: 0; }
  .mobile-topbar .lockup img { width: 26px; height: 26px; }
  .mobile-topbar .wordmark { font-size: 19px; }
  .mobile-topbar .company-initials { width: 28px; height: 28px; margin: 0; }

  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 62px;
    background: var(--slate); z-index: 30; border-top: 1px solid var(--slate-2);
  }
  .bottom-nav .nav-btn {
    flex: 1; flex-direction: column; gap: 3px; justify-content: center; align-items: center;
    font-size: 12px; border-radius: 0; margin: 0; padding: 6px 2px;
  }
  .bottom-nav .nav-btn.active { box-shadow: inset 0 3px 0 var(--orange); background: var(--slate-2); }

  .view-title { font-size: 26px; }
  .stats-strip { gap: 18px; padding: 14px 16px 12px; }
  .stat-num { font-size: 24px; }
  .stat-note { display: none; }

  .quotes-table-wrap { overflow-x: auto; }
  #view-quotes th:nth-child(5), #view-quotes td:nth-child(5) { display: none; }
  #view-quotes th, #view-quotes td { padding: 10px 8px; }
  .cell-num { font-size: 13px; }

  .nq-grid { grid-template-columns: 1fr; }
  .draft-totals { min-width: 0; width: 100%; }
  .draft-foot { flex-direction: column; }
  .modal-grid { grid-template-columns: 1fr; }
  .set-grid { grid-template-columns: 1fr; }

  /* slim the editor table so it fits 375px */
  .draft-panel { padding: 16px 10px; }
  #view-editor th, #view-editor td { padding: 10px 3px; font-size: 12px; }
  .cell-conf { width: 14px; }
  .line-cat { display: none; }
  .line-name { font-size: 13px; }
  .qty-input { width: 36px; padding: 6px 3px; }
  .price-input { width: 62px; padding: 6px 4px; font-size: 13px; }
  .money-prefix { display: none; }
  .qty-confirm-btn { width: 22px; height: 24px; font-size: 12px; }
  .needs-badge, .confirm-badge { font-size: 10px; padding: 2px 5px; letter-spacing: .3px; }
  .cell-total { font-size: 13px; }
  #view-editor .cell-x { width: 20px; }
  .line-remove { padding: 4px 3px; }
  .save-book { white-space: normal; font-size: 10.5px; }
  .pb-input { width: 62px; padding: 6px 5px; }
  #view-pricebook th, #view-pricebook td { padding: 10px 6px; }

  th, td { padding: 10px 8px; }
  .cell-unit { display: none; }
  th.cell-unit { display: none; }

  .auth-card { padding: 24px 18px 20px; }
}
@media (min-width: 701px) {
  .bottom-nav { display: none; }
}

/* ============ Proposal page (proposal.html) ============ */
body.proposal-body { background: #EDEAE4; }

.pp-topbar { display: flex; justify-content: flex-end; align-items: center; max-width: 860px; margin: 0 auto; padding: 18px 20px 6px; }

.pp-sheet {
  background: var(--white); max-width: 860px; margin: 14px auto 60px;
  padding: 52px 58px 34px; box-shadow: 0 4px 22px rgba(28,37,48,.14);
}
.pp-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid; padding-bottom: 22px; flex-wrap: wrap; }
.pp-brand { display: flex; gap: 14px; align-items: center; }
.pp-logo {
  width: 52px; height: 52px; border-radius: 10px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font: 700 21px 'Barlow Semi Condensed', sans-serif; letter-spacing: 1px;
  flex: 0 0 auto;
}
.pp-company { font: 700 24px 'Barlow Semi Condensed', sans-serif; }
.pp-contact { color: var(--graphite); font-size: 12.5px; margin-top: 2px; }
.pp-meta { text-align: right; font-size: 13.5px; color: var(--graphite); font-variant-numeric: tabular-nums; }
.pp-doc-title { font: 700 26px 'Barlow Semi Condensed', sans-serif; letter-spacing: .5px; }

.pp-client { display: flex; gap: 18px 60px; padding: 20px 0 6px; flex-wrap: wrap; }
.pp-label { font: 600 11.5px 'Barlow Semi Condensed', sans-serif; letter-spacing: .8px; text-transform: uppercase; color: var(--graphite); }
.pp-strong { font-weight: 600; font-size: 15.5px; }

.pp-table { margin-top: 16px; }
.pp-table th { font-size: 12px; padding: 9px 10px; }
.pp-table td { padding: 9px 10px; font-size: 13.5px; }
.pp-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pp-cat td { font: 600 13px 'Barlow Semi Condensed', sans-serif; letter-spacing: .6px; text-transform: uppercase; color: var(--graphite); background: var(--paper); padding: 7px 10px; }
.pp-subtotal td { font-size: 12.5px; color: var(--graphite); border-bottom: 1px solid var(--line); }
.pp-subtotal td.pp-num { font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 600; color: var(--slate); }

.pp-total-row {
  display: flex; justify-content: space-between; border-top: 3px solid;
  margin-top: 4px; padding-top: 12px;
  font: 700 24px 'Barlow Semi Condensed', sans-serif; font-variant-numeric: tabular-nums;
}
.pp-terms { margin-top: 26px; font-size: 13px; color: var(--slate); }
.pp-terms p { margin: 5px 0 0; line-height: 1.6; max-width: 70ch; }

.pp-sign { margin-top: 28px; }
.pp-sign-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.pp-sign-field label { display: block; font: 600 11.5px 'Barlow Semi Condensed', sans-serif; letter-spacing: .8px; text-transform: uppercase; color: var(--graphite); margin-bottom: 5px; }
.pp-sign-field input { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 15px; width: 280px; max-width: 100%; }
.pp-sign-line { display: flex; justify-content: space-between; max-width: 460px; margin-top: 30px; padding-top: 6px; border-top: 1px solid var(--slate); font-size: 12px; color: var(--graphite); }
.pp-sign-note { font-size: 11.5px; color: var(--graphite); margin: 10px 0 0; }
.pp-accepted { background: #E1F0E7; color: #16693A; border-radius: 8px; padding: 12px 16px; font-size: 14.5px; }
.pp-declined { background: #F4E3E0; color: #9C3428; border-radius: 8px; padding: 12px 16px; font-size: 14.5px; }
.pp-err { font-size: 12.5px; color: var(--bad); margin: 8px 0 0; }

.pp-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--graphite); flex-wrap: wrap;
}
.pp-builtwith { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }

.pp-state { max-width: 560px; margin: 12vh auto 0; text-align: center; padding: 0 20px; }
.pp-state h1 { font-size: 26px; margin-bottom: 10px; }
.pp-state p { color: var(--graphite); }

@media (max-width: 700px) {
  .pp-sheet { padding: 26px 18px; margin: 8px 10px 40px; }
  .pp-head { border-bottom-width: 2px; }
  .pp-meta { text-align: left; }
  .pp-table th, .pp-table td { padding: 9px 5px; font-size: 12.5px; }
}

/* ============ Print: proposal only ============ */
@media print {
  body, body.proposal-body { background: #fff; }
  .pp-topbar, .no-print { display: none !important; }
  .pp-sheet { box-shadow: none; margin: 0; max-width: none; padding: 20px 8px; }
}
