/* ─────────────────────────────────────────────────────────────
   Rewire Design Calculator v2  —  rewire-calc-v2.css
   ───────────────────────────────────────────────────────────── */

/* ── Wrapper ──────────────────────────────────────────────── */
.rw2-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

/* ── Presets bar ──────────────────────────────────────────── */
.rw2-presets {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.75rem;
}

.rw2-preset-btn {
  padding: .45rem 1.1rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.rw2-preset-btn:hover { border-color: #f59e0b; color: #92400e; }
.rw2-preset-btn.rw2-active {
  border-color: #f59e0b;
  background: #f59e0b;
  color: #1e293b;
}

/* ── Global options card ─────────────────────────────────── */
.rw2-global {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: .9rem 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  align-items: center;
}
.rw2-global label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
}
.rw2-global input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: #f59e0b; }

#rw2-garage-count-wrap {
  display: none;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: #475569;
}
#rw2-garage-count {
  width: 58px;
  padding: .25rem .4rem;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: .875rem;
  text-align: center;
}

/* ── Floor card ──────────────────────────────────────────── */
.rw2-floor {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 1.1rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.rw2-floor-head {
  background: #1e293b;
  color: #ffffff;
  padding: .7rem 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.rw2-floor-name {
  background: transparent;
  border: none;
  border-bottom: 1px dashed rgba(255,255,255,.35);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  min-width: 120px;
  max-width: 220px;
  padding: .1rem .2rem;
}
.rw2-floor-name:focus { outline: none; border-bottom-color: #f59e0b; }

.rw2-floor-acts {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-left: auto;
  flex-wrap: wrap;
}

.rw2-add-sel {
  padding: .3rem .5rem;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 6px;
  background: rgba(255,255,255,.1);
  color: #ffffff;
  font-size: .82rem;
  cursor: pointer;
}
.rw2-add-sel option { background: #1e293b; }

/* ── Shared buttons ──────────────────────────────────────── */
.rw2-btn {
  padding: .38rem .9rem;
  border-radius: 7px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.rw2-btn-amber {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #1e293b;
}
.rw2-btn-amber:hover { background: #fbbf24; border-color: #fbbf24; }

.rw2-btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,.4);
  color: rgba(255,255,255,.85);
}
.rw2-btn-ghost:hover { border-color: #ef4444; color: #fca5a5; }

/* ── Room list ───────────────────────────────────────────── */
.rw2-rooms {
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.rw2-empty {
  text-align: center;
  color: #94a3b8;
  font-size: .875rem;
  padding: 1.25rem;
}

/* ── Room card ───────────────────────────────────────────── */
.rw2-room {
  border: 1px solid #e2e8f0;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  overflow: hidden;
  background: #fafafa;
}

.rw2-room-head {
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  padding: .5rem .75rem;
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.rw2-room-icon { font-size: 1.15rem; flex-shrink: 0; }

.rw2-room-name {
  flex: 1;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: .88rem;
  min-width: 90px;
  color: #1e293b;
  padding: .1rem .15rem;
  border-bottom: 1px dashed #cbd5e1;
}
.rw2-room-name:focus { outline: none; border-bottom-color: #f59e0b; }

.rw2-type-sel {
  padding: .22rem .45rem;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: .78rem;
  background: #ffffff;
  cursor: pointer;
  color: #374151;
}

.rw2-room-acts {
  display: flex;
  gap: .25rem;
  margin-left: auto;
}

.rw2-btn-sm {
  padding: .22rem .6rem;
  font-size: .75rem;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid;
  font-weight: 600;
  transition: background .1s, color .1s;
  white-space: nowrap;
}
.rw2-clone  { border-color: #3b82f6; color: #2563eb; background: #eff6ff; }
.rw2-clone:hover  { background: #dbeafe; }
.rw2-remove { border-color: #ef4444; color: #dc2626; background: #fef2f2; }
.rw2-remove:hover { background: #fee2e2; }

/* ── Points grid ──────────────────────────────────────────── */
.rw2-pts {
  padding: .55rem .75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .3rem;
}

.rw2-pt-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .18rem .25rem;
  border-radius: 4px;
}
.rw2-pt-row:hover { background: #f8fafc; }

.rw2-pt-label {
  flex: 1;
  font-size: .8rem;
  color: #4b5563;
  min-width: 0;
}

.rw2-pt-ctrl {
  display: flex;
  align-items: center;
  gap: .2rem;
  flex-shrink: 0;
}

.rw2-adj {
  width: 26px;
  height: 26px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  background: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #374151;
  transition: border-color .1s, background .1s;
}
.rw2-adj:hover { border-color: #f59e0b; background: #fffbeb; color: #92400e; }

.rw2-pt-count {
  width: 30px;
  text-align: center;
  font-size: .9rem;
  font-weight: 700;
  color: #1e293b;
}

.rw2-pt-sub {
  width: 52px;
  text-align: right;
  font-size: .78rem;
  font-weight: 500;
  color: #059669;
  flex-shrink: 0;
}

/* ── Options section ──────────────────────────────────────── */
.rw2-opts {
  padding: .5rem .75rem;
  background: #f8fafc;
  border-top: 1px solid #e8ecf0;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .9rem;
}

.rw2-opt {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  color: #374151;
  cursor: pointer;
  padding: .1rem 0;
}
.rw2-opt input[type="checkbox"] { width: .9rem; height: .9rem; accent-color: #f59e0b; cursor: pointer; }
.rw2-opt-price { color: #059669; font-size: .75rem; margin-left: .1rem; }

.rw2-opt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  width: 100%;
}

.rw2-kw-sel {
  font-size: .78rem;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  padding: .2rem .45rem;
  background: #ffffff;
  cursor: pointer;
  color: #1e293b;
}

/* ── Room footer ──────────────────────────────────────────── */
.rw2-room-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: .45rem .75rem;
  background: #1e293b;
  border-top: 1px solid #334155;
}
.rw2-room-detail { font-size: .72rem; color: #94a3b8; }
.rw2-room-total  { font-size: .88rem; font-weight: 700; color: #fbbf24; }

/* ── Add floor button ─────────────────────────────────────── */
.rw2-add-floor-wrap { text-align: center; margin: .5rem 0 1.5rem; }

#rw2-add-floor {
  padding: .6rem 2rem;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  color: #64748b;
  font-size: .875rem;
  font-weight: 600;
  transition: border-color .15s, color .15s, background .15s;
}
#rw2-add-floor:hover { border-color: #f59e0b; color: #92400e; background: #fffbeb; }

/* ── Summary card ─────────────────────────────────────────── */
.rw2-summary {
  background: #1e293b;
  color: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.rw2-sum-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: 1rem;
  color: #e2e8f0;
}
.rw2-sum-body { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.rw2-sum-row {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
  padding: .28rem 0;
  border-bottom: 1px solid #334155;
  color: #cbd5e1;
}
.rw2-sum-row span:last-child { font-weight: 600; color: #e2e8f0; }
.rw2-sum-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fbbf24;
  padding: .5rem 0 .1rem;
  margin-top: .25rem;
}
.rw2-sum-note { font-size: .72rem; color: #64748b; margin-bottom: 1rem; }
.rw2-sum-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.rw2-sum-btns .rw2-btn-ghost { border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.8); }
.rw2-sum-btns .rw2-btn-ghost:hover { border-color: #94a3b8; color: #e2e8f0; }

/* ── Materials card ───────────────────────────────────────── */
.rw2-materials {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.rw2-mat-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
}
.rw2-mat-scroll { overflow-x: auto; }
.rw2-mat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
  min-width: 420px;
}
.rw2-mat-table th {
  text-align: left;
  font-weight: 700;
  padding: .4rem .55rem;
  border-bottom: 2px solid #e2e8f0;
  color: #475569;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.rw2-mat-table th:not(:first-child),
.rw2-mat-table td:not(:first-child) { text-align: right; }
.rw2-mat-table td {
  padding: .3rem .55rem;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
}
.rw2-mat-ckt { background: #f0fdf4; }
.rw2-mat-ckt td { color: #166534; }
.rw2-mat-cu  { background: #fff7ed; }
.rw2-mat-cu td { color: #9a3412; }
.rw2-mat-total td { border-top: 2px solid #e2e8f0; border-bottom: none; color: #1e293b; }
.rw2-mat-note { font-size: .72rem; color: #94a3b8; margin-top: .75rem; }

/* ── CTA strip (below materials) ──────────────────────────── */
.rw2-cta {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-align: center;
  margin-top: 1.5rem;
}
.rw2-cta p { font-size: .875rem; color: #475569; margin-bottom: .75rem; }

/* ── Important notices accordion ─────────────────────────── */
.rw2-notices {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.rw2-notices-summary {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem 1.1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: .9rem;
  color: #1e293b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.rw2-notices-summary::-webkit-details-marker { display: none; }
.rw2-notices-summary i { color: #f59e0b; font-size: .95rem; flex-shrink: 0; }
.rw2-notices-toggle {
  margin-left: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  flex-shrink: 0;
}
.rw2-notices-toggle::after { content: '−'; font-weight: 900; color: #475569; }
.rw2-notices:not([open]) .rw2-notices-toggle::after { content: '+'; }

.rw2-notices-body {
  padding: .85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.rw2-notice {
  border-radius: 8px;
  padding: .85rem 1rem;
  border-left: 4px solid;
}
.rw2-notice-title {
  font-weight: 700;
  font-size: .88rem;
  margin-bottom: .4rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.rw2-notice p { font-size: .83rem; line-height: 1.6; margin: 0; }
.rw2-notice .mt-2 { margin-top: .5rem; }
.rw2-notice-list {
  list-style: disc;
  padding-left: 1.25rem;
  margin: .4rem 0 0;
  font-size: .82rem;
  line-height: 1.7;
}

.rw2-notice--amber  { background: #fffbeb; border-color: #f59e0b; }
.rw2-notice--amber .rw2-notice-title { color: #92400e; }
.rw2-notice--amber p, .rw2-notice--amber li { color: #78350f; }

.rw2-notice--blue   { background: #eff6ff; border-color: #3b82f6; }
.rw2-notice--blue .rw2-notice-title { color: #1e40af; }
.rw2-notice--blue p { color: #1e3a8a; }

.rw2-notice--red    { background: #fef2f2; border-color: #ef4444; }
.rw2-notice--red .rw2-notice-title { color: #991b1b; }
.rw2-notice--red p  { color: #7f1d1d; }

.rw2-notice--slate  { background: #f8fafc; border-color: #64748b; }
.rw2-notice--slate .rw2-notice-title { color: #1e293b; }
.rw2-notice--slate p, .rw2-notice--slate li { color: #334155; }

.rw2-notice--green  { background: #f0fdf4; border-color: #22c55e; }
.rw2-notice--green .rw2-notice-title { color: #166534; }
.rw2-notice--green p { color: #14532d; }

.rw2-notice-cta {
  display: inline-flex;
  align-items: center;
  background: #f59e0b;
  color: #1e293b;
  font-weight: 700;
  font-size: .8rem;
  padding: .3rem .75rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background .15s;
}
.rw2-notice-cta:hover { background: #fbbf24; }
.rw2-notice-link {
  font-size: .8rem;
  color: #2563eb;
  font-weight: 600;
}
.rw2-notice-link:hover { color: #1d4ed8; }

/* ═══════════════════════════════════════════════════════════
   PRINT STYLES
   Only summary + materials + headers/room names visible.
═══════════════════════════════════════════════════════════ */
@media print {
  #site-header,
  #site-footer,
  .rw2-presets,
  .rw2-global,
  .rw2-floor-acts,
  .rw2-room-acts,
  .rw2-opts,
  .rw2-adj,
  .rw2-pt-ctrl,
  .rw2-type-sel,
  .rw2-sum-btns,
  .rw2-mat-btns,
  .rw2-add-floor-wrap,
  .rw2-cta,
  button { display: none !important; }

  body { background: #fff !important; }

  .rw2-floor-head  { background: #1e293b !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rw2-room-foot   { background: #1e293b !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rw2-summary     { background: #1e293b !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .rw2-room-name,
  .rw2-floor-name  { pointer-events: none; border-bottom: none; }

  /* Print-only company header */
  .rw2-wrap::before {
    content: 'Thanet Electrical Ltd  \2014  thanet-electrical.co.uk  \2014  07553 553 536';
    display: block;
    text-align: center;
    font-weight: 700;
    font-size: .9rem;
    padding: .75rem;
    border-bottom: 2px solid #1e293b;
    margin-bottom: 1.25rem;
  }

  /* Show only count in point rows, hide +/- */
  .rw2-pt-row { break-inside: avoid; }
  .rw2-pts    { display: block; }
}
