* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: #f4f1ea; color: #1d1a16; }
#app { max-width: 720px; margin: 0 auto; padding: 12px; }
.app-header { background: #5b1220; color: #f7e7c3; border-radius: 10px; padding: 16px; text-align: center; }
.app-header h1 { margin: 0; font-size: 1.5rem; }
.app-header .subtitle { margin: 4px 0 0; color: #d9a441; font-weight: 600; letter-spacing: .04em; }
.card { background: #fff; border: 1px solid #ddd3c0; border-radius: 10px; padding: 14px; margin-top: 12px; }
.card h2 { margin: 0 0 10px; font-size: 1.1rem; color: #5b1220; }
label { display: block; margin: 8px 0; font-size: .92rem; font-weight: 600; }
input, select, textarea { width: 100%; padding: 10px; margin-top: 4px; border: 1px solid #b9ac93; border-radius: 6px; font-size: 1rem; background: #fff; }
button { padding: 10px 14px; border: 1px solid #5b1220; background: #fff; color: #5b1220; border-radius: 6px; font-size: .95rem; font-weight: 600; cursor: pointer; min-height: 44px; }
button.primary { background: #5b1220; color: #f7e7c3; }
.toggle-row { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle { flex: 1 1 200px; }
.toggle.active { background: #5b1220; color: #f7e7c3; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.add-row select, .add-row input { flex: 1 1 140px; }
.add-row button { flex: 0 0 auto; }
.hint { font-size: .82rem; color: #6b6252; margin: 6px 0; }
#part-results:empty { display: none; }
.part-result { display: flex; gap: 8px; align-items: center; justify-content: space-between; border: 1px solid #e2d9c6; border-radius: 8px; padding: 10px; margin-top: 8px; }
.part-result-info { font-size: .92rem; }
.part-result-add { flex: 0 0 auto; }
.cell-label { display: block; font-size: .8rem; font-weight: 600; margin: 8px 0 2px; }
.grid .cell-label { margin-top: 0; }
.stepper { display: flex; gap: 4px; align-items: stretch; }
.stepper input { flex: 1 1 auto; text-align: center; margin-top: 0; }
.step-btn { flex: 0 0 44px; padding: 8px 0; font-size: 1.15rem; line-height: 1; }
.line-item, .rental-item, .room-item { border: 1px solid #e2d9c6; border-radius: 8px; padding: 10px; margin-top: 10px; }
.line-item h3, .rental-item h3, .room-item h3 { margin: 0 0 6px; font-size: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 8px; }
.grid label { margin: 0; font-size: .8rem; }
.grid input { padding: 8px; }
.store-prices { font-size: .8rem; color: #6b6252; margin-top: 6px; line-height: 1.5; }
.store-prices .best { color: #14532d; font-weight: 700; }
.remove-btn { margin-top: 8px; border-color: #a33; color: #a33; }
.room-photo { max-width: 100%; border-radius: 6px; margin-top: 8px; }
.totals { margin-top: 10px; font-size: 1rem; }
.totals table { width: 100%; border-collapse: collapse; }
.totals td { padding: 5px 2px; border-bottom: 1px solid #eee3cd; }
.totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand td { font-weight: 800; font-size: 1.15rem; border-top: 2px solid #5b1220; }
.actions button { margin: 4px 4px 4px 0; }
.app-footer { text-align: center; color: #6b6252; font-size: .85rem; padding: 18px 8px 30px; }
.app-footer .tool-name { font-weight: 700; color: #5b1220; }

/* Client report — hidden on screen, the only thing that prints */
#report { display: none; }
@media print {
  #app { display: none !important; }
  #report { display: block !important; font-family: Georgia, "Times New Roman", serif; color: #000; padding: 24px; }
  #report h1 { font-size: 1.4rem; margin: 0 0 2px; }
  #report h2 { font-size: 1.05rem; margin: 18px 0 6px; border-bottom: 1px solid #000; padding-bottom: 3px; }
  #report table { width: 100%; border-collapse: collapse; margin-top: 6px; }
  #report th, #report td { text-align: left; padding: 5px 4px; border-bottom: 1px solid #bbb; font-size: .92rem; }
  #report td.num, #report th.num { text-align: right; font-variant-numeric: tabular-nums; }
  #report .grand td { font-weight: 800; font-size: 1.05rem; border-top: 2px solid #000; }
  #report .meta { font-size: .95rem; line-height: 1.5; }
}

/* ---- Upgraded picker, rates, job work, country ---- */
.part-result { flex-direction: column; align-items: stretch; justify-content: flex-start; }
.part-result-top { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.labour-line { font-size: .85rem; color: #14532d; font-weight: 600; }
.on-job { color: #14532d; font-weight: 700; font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid #b9ac93; background: #fff; border-radius: 999px; padding: 8px 12px; font-size: .85rem; min-height: 40px; font-weight: 600; color: #1d1a16; }
.chip.picked { background: #f5a623; border-color: #a86e00; color: #231a00; }
.jw-chip { font-size: .82rem; padding: 6px 10px; min-height: 36px; }
.own-price { margin-top: 8px; }
.own-price label { margin: 0; }
.own-price.own-active input { border-color: #a86e00; background: #fff8e6; }
.picked-line { font-size: .85rem; font-weight: 700; color: #5b1220; margin: 8px 0 0; }
.line-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.line-top h3 { margin: 0; }
.remove-x { flex: 0 0 auto; min-height: 36px; padding: 4px 12px; font-size: 1.1rem; line-height: 1; border-color: #a33; color: #a33; }
.line-meta { font-size: .85rem; color: #6b6252; margin: 4px 0 8px; }
.toggle-row + .toggle-row { margin-top: 8px; }
#labour-state { font-weight: 700; color: #5b1220; }
.pct-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
button.mini { min-height: 36px; padding: 6px 10px; font-size: .85rem; }
.off-tag { color: #14532d; font-weight: 700; font-size: .85rem; }
.pct-note { font-size: .82rem; color: #8a6d00; margin: 4px 0 0; }
.pct-note:empty { display: none; }

/* ---- Subscription gate pop-up ---- */
.sub-modal { display: none; position: fixed; inset: 0; background: rgba(20, 12, 8, .62); z-index: 50; align-items: center; justify-content: center; padding: 16px; }
.sub-modal.open { display: flex; }
.sub-card { background: #fff; border-radius: 12px; border: 2px solid #5b1220; max-width: 420px; width: 100%; padding: 20px; text-align: center; }
.sub-card h2 { margin: 0 0 8px; color: #5b1220; font-size: 1.25rem; }
.sub-card p { margin: 8px 0; font-size: .95rem; }
.sub-options { list-style: none; margin: 12px 0; padding: 0; }
.sub-options li { border: 1px solid #ddd3c0; border-radius: 8px; padding: 10px; margin-top: 8px; font-size: 1.05rem; }
.sub-card button { margin-top: 10px; }
.sub-options .sub-buy { margin-top: 6px; }
.sub-note { font-size: .85rem; color: #8a6d00; font-weight: 600; }
.sub-note:empty { display: none; }
.sub-legal { border: 1px solid #5b1220; border-radius: 8px; padding: 10px 12px; margin: 12px 0; text-align: left; }
.sub-legal h3 { margin: 0 0 6px; font-size: .9rem; color: #5b1220; text-transform: uppercase; letter-spacing: .04em; }
.sub-legal p { margin: 0; font-size: .8rem; line-height: 1.45; }
