/* ==========================================================================
   RoomQuill — app.html only (the condition report builder)

   Loaded after style.css, so every token (--blue, --accent, --line, --radius,
   --shadow…) and every shared class (.btn, .field, .input, .select, .wrap,
   .section) comes from there. Only what the builder adds lives here.

   Tap targets: every control the walkthrough needs is at least 44px high,
   because this page is used standing in a room holding a phone.
   ========================================================================== */

/* ---------- Page head and shell ---------- */
.app-head {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  padding: 40px 0 34px;
}
.app-head h1 { margin-bottom: 10px; font-size: clamp(1.9rem, 4.4vw, 2.75rem); }
.app-head .intro { color: var(--muted); max-width: 66ch; margin: 0; }

.app-shell { max-width: 900px; margin: 0 auto; }
.app-shell[hidden] { display: none; }

/* ---------- Plan strip ---------- */
.plan-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: .92rem;
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  margin: 0 0 22px;
}
.plan-strip strong { font-family: var(--font-display); font-weight: 700; }
.plan-strip span { color: var(--blue); opacity: .9; }
.plan-strip .plan-who {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: .82rem;
  opacity: .72;
}
.plan-strip .plan-who[hidden] { display: none; }

/* ---------- Order note, shown once after checkout ---------- */
.order-note {
  margin: 0 0 24px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: #FDF3EC;
}
.order-note[hidden] { display: none; }
.order-note p { font-size: .92rem; margin: 0; }
.order-note strong { font-family: var(--font-display); }
.order-note .order-note-links { margin-top: 8px; font-size: .86rem; }

/* ---------- Access gate / no-JS panel ---------- */
.locked {
  max-width: 660px;
  margin: 0 auto;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 28px;
}
.locked[hidden] { display: none; }
.locked h2 { margin-bottom: 12px; }
.locked p { color: var(--muted); }
.locked-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 24px 0 18px;
}
.locked-note { font-size: .86rem; margin: 0; }

/* ---------- Where the data lives ---------- */
.rq-privacy {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 22px;
}
.rq-privacy h2 { font-size: 1.08rem; margin-bottom: 8px; }
.rq-privacy p { color: var(--muted); font-size: .93rem; }
.rq-privacy-note { margin-top: 10px; font-weight: 500; }

/* ---------- Panels ---------- */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 20px;
}
@media (min-width: 700px) { .panel { padding: 26px 28px; } }

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.18rem;
  margin: 0 0 16px;
}
.panel-num {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
}

.rq-lead { color: var(--muted); font-size: .95rem; margin: 0 0 18px; }

/* ---------- Report detail grid ---------- */
.rq-grid { display: grid; gap: 0 18px; }
@media (min-width: 680px) {
  .rq-grid { grid-template-columns: 1fr 1fr; }
  .rq-grid .field--wide { grid-column: 1 / -1; }
}

.rq-textarea {
  min-height: 72px;
  line-height: 1.55;
  resize: vertical;
}

/* ---------- Rooms ---------- */
.rq-rooms { display: grid; gap: 18px; }
.rq-rooms:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.rq-room {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-alt);
  padding: 16px;
}
@media (min-width: 700px) { .rq-room { padding: 18px 20px; } }

.rq-room-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.rq-room-title { margin: 0; font-size: 1.1rem; }

.rq-room-tools { display: flex; flex-wrap: wrap; gap: 8px; }

.rq-tool {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.rq-tool:hover:not(:disabled) { background: var(--blue-soft); border-color: #C3CEEB; color: var(--blue-deep); }
.rq-tool:disabled { opacity: .45; cursor: not-allowed; }
.rq-tool--danger { color: var(--damage); }
.rq-tool--danger:hover:not(:disabled) { background: #FBE7E7; border-color: #EFC2C2; color: var(--damage); }

.rq-room-name { margin-bottom: 16px; }

/* ---------- Elements ---------- */
.rq-el-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 14px; }
.rq-el-list > li { margin: 0; }

.rq-el {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px 12px;
}

.rq-el-grid { display: grid; gap: 0 14px; }
@media (min-width: 720px) {
  .rq-el-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

.rq-el .field { margin-bottom: 14px; }
.rq-el-foot { display: flex; justify-content: flex-end; }

.rq-empty {
  color: var(--muted);
  font-size: .93rem;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0;
}

/* ---------- Photographs ---------- */
.rq-photo-field { margin-bottom: 12px; }

.rq-file {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  font-family: var(--font-body);
  font-size: .95rem;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.rq-file:hover { border-color: var(--blue); }
.rq-file::file-selector-button {
  min-height: 36px;
  margin-right: 12px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg-alt);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .88rem;
  color: var(--ink);
  cursor: pointer;
}

.rq-thumbs {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.rq-thumbs > li { margin: 0; }

.rq-thumb {
  position: relative;
  width: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-alt);
}
.rq-thumb img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  display: block;
}
.rq-thumb-drop {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 600;
  color: var(--damage);
  cursor: pointer;
}
.rq-thumb-drop:hover { background: #FBE7E7; }

/* ---------- Add room / add element rows ---------- */
.rq-add-el,
.rq-add-room {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.rq-add-el .field,
.rq-add-room .field { flex: 1 1 220px; margin-bottom: 0; }
.rq-add-room { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- Summary ---------- */
.rq-tally {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (min-width: 620px) { .rq-tally { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .rq-tally { grid-template-columns: repeat(7, 1fr); } }

.rq-tally-item {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
}
.rq-tally-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}
.rq-tally-label {
  display: block;
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 2px;
}
.rq-tally-item--new,
.rq-tally-item--good { border-color: #BFE0C8; background: #EEF7F0; }
.rq-tally-item--new .rq-tally-num,
.rq-tally-item--good .rq-tally-num { color: var(--good); }
.rq-tally-item--fair { border-color: #EFD9AE; background: #FCF6EA; }
.rq-tally-item--fair .rq-tally-num { color: #96570A; }
.rq-tally-item--poor,
.rq-tally-item--damaged { border-color: #EFC2C2; background: #FCF0F0; }
.rq-tally-item--poor .rq-tally-num,
.rq-tally-item--damaged .rq-tally-num { color: var(--damage); }

.rq-clean-line { color: var(--muted); font-size: .92rem; margin-bottom: 20px; }

.rq-block { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.rq-block h3 { font-size: 1.05rem; margin-bottom: 6px; }
.rq-block-note { color: var(--muted); font-size: .89rem; margin-bottom: 12px; }

.rq-risk-list,
.rq-issue-list { list-style: none; margin: 0; padding: 0; }
.rq-risk-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.rq-risk-list > li:last-child { border-bottom: 0; }
.rq-risk-note { color: var(--muted); font-size: .9rem; flex: 1 1 100%; }

.rq-issue-list > li {
  padding: 7px 0 7px 22px;
  margin: 0;
  position: relative;
  font-size: .94rem;
  border-bottom: 1px solid var(--line);
}
.rq-issue-list > li:last-child { border-bottom: 0; }
.rq-issue-list > li::before {
  content: "";
  position: absolute;
  left: 0; top: 1.05em;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--wear);
}

.rq-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.rq-badge--poor { background: #FCF6EA; color: #96570A; }
.rq-badge--damaged { background: #FBE7E7; color: var(--damage); }

.rq-ok { color: var(--good); font-weight: 500; margin: 0; }
.rq-warn { color: #96570A; font-weight: 500; }

/* ---------- Output panel ---------- */
.rq-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.app-status { font-size: .95rem; color: var(--muted); margin: 16px 0 0; min-height: 1.4em; }
.app-status.is-error { color: #B42318; }
.rq-usage { font-size: .89rem; color: var(--muted); margin: 10px 0 0; }
.rq-upgrade {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid #EFD9AE;
  border-radius: var(--radius-sm);
  background: #FCF6EA;
  font-size: .92rem;
}
.rq-upgrade[hidden] { display: none; }
.rq-out-note { font-size: .86rem; color: var(--muted); margin: 14px 0 0; }

/* ---------- The printable document ---------- */
.rq-doc {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 20px;
}
@media (min-width: 700px) { .rq-doc { padding: 30px 32px; } }

.rq-doc-screen-title {
  font-size: 1.05rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 22px;
}

.rq-doc-head { border-bottom: 2px solid var(--blue); padding-bottom: 16px; margin-bottom: 20px; }
.rq-doc-kind {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 4px;
}
.rq-doc-addr {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 14px;
}

.rq-doc-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  margin: 0;
  font-size: .92rem;
}
@media (min-width: 620px) { .rq-doc-meta { grid-template-columns: auto 1fr auto 1fr; } }
.rq-doc-meta dt { color: var(--muted); }
.rq-doc-meta dd { margin: 0; font-weight: 500; }

.rq-doc-notes { margin-top: 14px; }
.rq-doc-notes h3 { font-size: .95rem; margin-bottom: 4px; }
.rq-doc-notes p { font-size: .93rem; white-space: pre-wrap; margin: 0; }

.rq-doc-room { margin-bottom: 26px; }
.rq-doc-room h3 { font-size: 1.1rem; margin-bottom: 10px; }
.rq-doc-empty { color: var(--muted); font-size: .92rem; }

.rq-doc-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rq-doc-table th,
.rq-doc-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.rq-doc-table thead th {
  font-family: var(--font-display);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}
.rq-doc-table tbody th { font-weight: 600; width: 28%; }
.rq-doc-table td { color: var(--ink); }
.rq-doc-table .rq-doc-risk { color: var(--damage); font-weight: 600; }

.rq-doc-photos { margin-top: 12px; }
.rq-doc-photos-label {
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 6px;
}
.rq-doc-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.rq-doc-strip img {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rq-doc-summary { border-top: 2px solid var(--blue); padding-top: 18px; }
.rq-doc-summary h3 { font-size: 1.1rem; margin-bottom: 8px; }
.rq-doc-summary h4 { font-size: .95rem; margin: 16px 0 6px; }
.rq-doc-summary ul { font-size: .92rem; }
.rq-doc-disclaimer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--muted);
}

/* ==========================================================================
   PRINT
   The printed page is the report and nothing else: no site chrome, no builder,
   no buttons. Rooms and tables are kept off page breaks where a browser will
   let them be.
   ========================================================================== */
@media print {
  :root { --shadow: none; --shadow-sm: none; --shadow-lg: none; }

  html, body { background: #fff; }
  body { font-size: 11pt; line-height: 1.45; color: #000; }

  @page { margin: 16mm 14mm; }

  /* Everything that is not the report */
  .site-header,
  .mobile-nav,
  .site-footer,
  .cookie-banner,
  .skip-link,
  .app-head,
  .plan-strip,
  .order-note,
  .rq-privacy,
  .panel,
  .rq-doc-screen-title,
  .rq-actions,
  .app-status,
  .rq-usage,
  .rq-upgrade,
  .rq-out-note,
  .locked,
  datalist { display: none !important; }

  .section { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .app-shell { max-width: none; margin: 0; }

  .rq-doc {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }

  .rq-doc-head {
    border-bottom: 2pt solid #000;
    page-break-after: avoid;
    break-after: avoid;
  }
  .rq-doc-kind { color: #000; }
  .rq-doc-addr { font-size: 17pt; }

  /* Keep a room with its heading, and off a page break if it fits. */
  .rq-doc-room {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 14pt;
  }
  .rq-doc-room h3 {
    page-break-after: avoid;
    break-after: avoid;
  }

  /* A long room has to break somewhere: break between rows, never inside one,
     and repeat the column headings on the next page. */
  .rq-doc-table { page-break-inside: auto; break-inside: auto; }
  .rq-doc-table thead { display: table-header-group; }
  .rq-doc-table tbody tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .rq-doc-table thead th { background: #F2F2F2 !important; color: #000; }
  .rq-doc-table .rq-doc-risk { color: #000; text-decoration: underline; }

  .rq-doc-photos { page-break-inside: avoid; break-inside: avoid; }
  .rq-doc-strip img { width: 34mm; height: 34mm; }

  .rq-doc-summary {
    page-break-before: auto;
    break-before: auto;
    page-break-inside: avoid;
    break-inside: avoid;
    border-top: 2pt solid #000;
  }

  a { color: #000; text-decoration: none; }
}

/* ---------- Branding, comparison and report files ---------- */
.rq-brand { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.rq-sub { margin: 0 0 12px; font-size: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pro-chip { display: inline-block; padding: 2px 9px; border-radius: var(--radius-pill); background: var(--blue-soft); color: var(--blue); font: 600 11.5px var(--font-body); letter-spacing: .02em; vertical-align: middle; }
.panel-title .pro-chip { margin-left: 6px; }
.rq-brand-preview { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.rq-brand-preview img { max-height: 48px; max-width: 160px; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: #fff; }
.rq-lock { margin: 12px 0 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--blue-soft); color: var(--ink); font-size: 14px; }
.rq-file-btn { cursor: pointer; }
.rq-file-btn.is-disabled { opacity: .5; pointer-events: none; }
.rq-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rq-visually-hidden:focus + * , .rq-file-btn:focus-within { outline: 3px solid var(--accent); }
.rq-table-wrap { overflow-x: auto; }
.rq-compare { margin-top: 16px; }
.rq-compare h3, .rq-doc-compare h3 { margin: 0 0 6px; }
.rq-compare-tally { margin: 0 0 10px; font-weight: 600; }
.rq-change { font-weight: 600; white-space: nowrap; }
.rq-change-worse .rq-change, .rq-change-missing .rq-change { color: var(--damage); }
.rq-change-better .rq-change { color: var(--good); }
.rq-change-same .rq-change, .rq-change-unrated .rq-change { color: var(--muted); }
.rq-change-added .rq-change { color: var(--blue); }
.rq-doc-compare { margin: 24px 0; page-break-inside: auto; }
.rq-doc-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font: 700 16px var(--font-display); }
.rq-doc-brand img { max-height: 44px; max-width: 180px; }

/* ---------- Demo page ---------- */
.rq-demo h2 { margin: 36px 0 14px; }
.rq-demo h2:first-child { margin-top: 0; }
.rq-files { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.rq-files li { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; overflow-wrap: anywhere; }
.rq-files span { display: block; color: var(--muted); font-size: 14px; }
.rq-doc--demo { margin-top: 16px; }
.rq-doc--demo img { max-width: 100%; height: auto; }
.rq-demo-cta { margin-top: 28px; text-align: center; }
@media (max-width: 700px) {
  .rq-doc .rq-doc-table { display: block; overflow-x: auto; }
  .rq-doc .rq-doc-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
