/* HomeCheck additions to the prototype's report styles (styles.css, report-v2.css,
   report-overrides.css are the prototype's own and stay as they came). What the
   prototype has no states for: a section still loading, the price block and the two
   panels of «Главное перед покупкой» (the mockup), the group headings, the sidebar's «Применить»,
   the tables of the income and mortgage sections from the current HomeCheck. */

/* A section still being built: in its place, so the report keeps its shape while it fills */
.section-loading{display:flex;gap:12px;align-items:center;padding:20px 18px;margin-top:6px;border-radius:10px;background:#f5f8fd;border:1px dashed #c9d8ea;font-size:14px;color:#44546a}
.section-loading strong{color:#142b4b}
.loading-spinner{width:18px;height:18px;border-radius:50%;border:2.5px solid #d3e0ef;border-top-color:#2d8cff;animation:hc-spin .8s linear infinite;flex:none}
@keyframes hc-spin{to{transform:rotate(360deg)}}
.report-filling{display:inline-flex;gap:10px;align-items:center;max-width:320px;font-size:13px;line-height:1.45;color:#44546a}
@media (prefers-reduced-motion:reduce){.loading-spinner{animation:none}}

.report-flash{margin-top:10px;padding:10px 12px;border-radius:8px;background:#e3f0e9;color:#17694b;font-size:13px}
.report-credentials p{margin:4px 0 0;font-size:14px;user-select:all}

/* The public sample says so on top: the address, the deals and the figures are made up */
.report-sample-note{display:inline-block;margin-top:10px;padding:8px 12px;border-radius:8px;background:#fff6e5;color:#8b5c15;font-size:13px;line-height:1.45}
.report-v2 .sidebar-price input[readonly],.report-v2 #area-input[readonly]{background:#f3f7fc;color:#44546a}

/* Sidebar: area and price first; floor, floors and rooms smaller, each in a line; nothing counts until «Применить» */
.report-v2 .sidebar-price .secondary-params{display:flex;flex-direction:column;gap:6px;margin-top:4px}
.report-v2 .sidebar-price .secondary-params label{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;color:#5b6b80;white-space:nowrap}
.report-v2 .sidebar-price .secondary-params input[type=number]{width:64px;flex:none;font-size:14px;min-height:32px;padding:4px 8px}
.report-v2 .sidebar-price .apply-button{width:100%;justify-content:center;margin-top:4px}
.report-v2 .sidebar-price .apply-button:disabled{opacity:.6;cursor:progress}
@media(max-width:760px){.report-v2 .sidebar-price .secondary-params,.report-v2 .sidebar-price .apply-button,.report-v2 .sidebar-price .params-saved{grid-column:1/-1}}
.params-saved{margin:8px 0 0}
/* Locked while the report is (re)built: the fieldset only carries `disabled`, the layout is its children's */
.params-fieldset{display:contents;border:0;margin:0;padding:0;min-width:0}
.report-v2 .params-fieldset:disabled input,.report-v2 .params-fieldset:disabled #area-input,.report-v2 .params-fieldset:disabled #asking-input{background:#f3f7fc;color:#8392a5;cursor:not-allowed}
.report-v2 .params-fieldset:disabled .apply-button,.report-v2 .params-fieldset:disabled .button{opacity:.55;cursor:not-allowed}
.params-locked{margin:8px 0 0;padding:8px 10px;border-radius:8px;background:#fff6e5;color:#8b5c15;line-height:1.45}
@media(max-width:760px){.report-v2 .sidebar-price .params-locked{grid-column:1/-1}}

/* «Главное перед покупкой» by the mockup: the card «Цена квартиры», then the attention and the clear panels */
.report-v2 .main-block{padding:22px}
.report-v2 #important .main-heading{font-size:28px;letter-spacing:-.5px;margin:0 0 16px}
.price-card{border:1px solid #e3e8ef;border-radius:12px;padding:16px 18px;margin-bottom:14px;background:#fff}
.price-card-head{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.price-card-head h3{margin:0;font-size:18px}
.price-card-icon{display:inline-flex;color:#142b4b}.price-card-icon .hc-icon{width:26px;height:26px}
.price-card-why{margin-left:auto;display:inline-flex;white-space:nowrap;flex:none;align-items:center;gap:6px;border:1px solid #e3e8ef;background:#f7f9fc;border-radius:8px;padding:6px 10px;font:inherit;font-size:13px;color:#142b4b;cursor:pointer}
.price-card-why .hc-icon{width:15px;height:15px}
.price-card-why:hover{border-color:#9fb3cb}
.price-card-body{display:grid;grid-template-columns:minmax(220px,40%) minmax(0,1fr);gap:18px;align-items:stretch}
.price-card-main{background:#eef4fd;border-radius:10px;padding:16px 20px;display:flex;flex-direction:column;justify-content:center}
.price-card-main.is-text p{font-size:15px;line-height:1.5;color:#142b4b;margin:0}
.price-card-value{display:flex;align-items:center;gap:10px}
.price-card-value a{font-size:38px;font-weight:700;letter-spacing:-1px;line-height:1.15;color:#0b2545;text-decoration:none}
.price-card-value a:hover{color:#1768ce}
.price-card-value .info-tip-button{width:22px;height:22px}
.price-card-main>p{margin:6px 0 0;font-size:14px;color:#44546a}
.price-card-columns{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);align-items:start}
.price-card-column{display:flex;flex-direction:column;gap:6px;padding:4px 16px}
.price-card-column+.price-card-column{border-left:1px solid #e3e8ef}
.price-card-column span{font-size:13px;color:#5b6b80}
.price-card-column strong{font-size:19px;font-weight:700;color:#0b2545}
.price-card-column strong.tone-up{color:#d6332c}
.price-card-column strong.tone-down{color:#b5650d}
.price-card-column small{font-size:13px;color:#5b6b80;line-height:1.4}
.price-card-lead{margin:12px 0 0;font-size:14px;line-height:1.5;color:#44546a}
.price-card-deals{margin-top:12px}
.price-card-deals summary{font-size:13px;color:#1768ce;cursor:pointer}
.price-card-deals ul{list-style:none;margin:8px 0 0;padding:0}
.price-card-deals li{display:grid;grid-template-columns:1fr auto auto;gap:14px;padding:7px 0;border-bottom:1px solid #e3eaf3;font-size:13px;font-variant-numeric:tabular-nums}
.price-card-deals li:last-child{border-bottom:0}
.price-card-deals-note{margin:8px 0 0;font-size:12px;line-height:1.45;color:#5b6b80}

/* «Сравнение цены»: the estimate per m² — its own mark under the zones, the accent colour (brandbook). */
.report-v2 .scale-estimate-row{position:relative;height:58px;margin-top:6px}
.report-v2 .scale-estimate{position:absolute;top:8px;transform:translateX(-50%);border:1px solid #049BE1;background:#fff;color:#0b6fa3;border-radius:8px;padding:4px 10px;font-size:13px;line-height:1.3;text-align:center;white-space:nowrap;cursor:pointer}
.report-v2 .scale-estimate::before{content:'';position:absolute;left:50%;top:-8px;margin-left:-6px;border:6px solid transparent;border-top:0;border-bottom:7px solid #049BE1}
.report-v2 .scale-estimate b{display:inline;margin-left:4px;font-size:14px}
.report-v2 .scale-estimate small{display:block;font-size:11px;color:#5b6b80}
.price-card-deals li.is-cheaper b{color:#5b6b80;font-weight:500}

.purchase-panel{border:1px solid #e3e8ef;border-radius:12px;margin-bottom:14px;overflow:hidden;background:#fff}
.purchase-panel.is-attention{border-color:#f1a7a3}
.purchase-panel-head{display:flex;align-items:center;gap:12px;padding:12px 18px}
.is-attention .purchase-panel-head{background:#fdeceb}
.is-clear .purchase-panel-head{background:#eaf6ef}
.purchase-panel-head h3{margin:0;font-size:18px}
.purchase-panel-icon{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%}
.is-attention .purchase-panel-icon{color:#d6332c;border:2px solid #d6332c}
.is-clear .purchase-panel-icon{color:#fff;background:#1f9d62}
.purchase-panel-icon .hc-icon{width:18px;height:18px;color:inherit;stroke-width:2.6}
.purchase-panel ul{list-style:none;margin:0;padding:0 18px}
.purchase-row{position:relative;border-top:1px solid #edf1f6}
.purchase-row:first-child{border-top:0}
.purchase-row{display:grid;grid-template-columns:40px minmax(0,1fr) minmax(0,1fr) 20px;gap:14px;align-items:center;padding:12px 0;cursor:pointer}
.is-clear .purchase-row{grid-template-columns:40px minmax(0,1fr) 20px}
.purchase-row:hover strong{color:#1768ce}
.purchase-row:focus-visible{outline:2px solid #2d8cff;outline-offset:2px;border-radius:6px}
.purchase-row-icon{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%}
.is-attention .purchase-row-icon{background:#fdeceb;color:#d6332c}
.is-clear .purchase-row-icon{background:#eaf6ef;color:#1f9d62}
.purchase-row-icon .hc-icon{width:20px;height:20px;color:inherit}
.is-clear .purchase-row-icon .hc-icon{stroke-width:2.4}
.purchase-copy{display:flex;flex-direction:column;gap:3px;min-width:0}
.purchase-copy strong{display:flex;align-items:center;gap:8px;font-size:15px;line-height:1.4;color:#0b2545}
.is-clear .purchase-copy strong{font-weight:500}
.purchase-copy small{font-size:13px;color:#5b6b80}
.purchase-advice{font-size:14px;line-height:1.45;color:#44546a}
.purchase-chevron{display:inline-flex;color:#5b6b80}.purchase-chevron .hc-icon{width:18px;height:18px}
.purchase-pending{display:flex;gap:10px;align-items:center;margin:0;padding:10px 18px 14px;font-size:13px;color:#5b6b80}
@media(max-width:760px){
  .report-v2 #important .main-heading{font-size:23px}
  .price-card-body{grid-template-columns:1fr}
  .price-card-columns{grid-auto-flow:row;gap:12px}
  .price-card-column{padding:0}
  .price-card-column+.price-card-column{border-left:0;border-top:1px solid #e3e8ef;padding-top:12px}
  .price-card-value a{font-size:32px}
  .price-card-why{font-size:12px;padding:5px 8px}
  .purchase-row,.is-clear .purchase-row{grid-template-columns:36px minmax(0,1fr) 18px}
  .purchase-advice{grid-column:2;font-size:13px}
  .purchase-chevron{grid-column:3;grid-row:1}
}

/* ⓘ: a tooltip on hover with a mouse; on touch the help opens as a bottom sheet */
.info-tip{position:relative;display:inline-flex}
.info-tip-button{width:20px;height:20px;border-radius:50%;border:1.5px solid #4c6684;background:#fff;color:#4c6684;font:italic 600 12px/1 Georgia,serif;cursor:pointer;padding:0}
.info-tip-text{display:none}
@media (hover:hover){
  .info-tip:hover .info-tip-text,.info-tip:focus-within .info-tip-text{display:block;position:absolute;z-index:20;top:28px;left:-12px;width:min(340px,80vw);padding:12px 14px;border-radius:10px;background:#142b4b;color:#fff;font-size:12px;font-weight:400;letter-spacing:0;line-height:1.5;text-align:left;box-shadow:0 10px 30px #0b254533}
  .info-tip-text p{margin:0 0 6px}.info-tip-text p:last-child{margin:0}
}
@media (max-width:760px){
  /* The flat's history on a phone is the vertical list; the proportional time axis needs width */
  .report-v2 #unit-timeline .history-time-axis,.report-v2 #unit-timeline .history-connected{display:none}
  #help-dialog[open]{margin:auto 0 0;width:100%;max-width:none;border-radius:16px 16px 0 0;border:0;padding:22px 18px 28px}
}

/* «Подробный анализ», «Отзывы и инфраструктура», «Доход и ипотека»: the prototype's open panels under a group heading */
.group-heading{font-size:24px;letter-spacing:-.4px;margin:30px 0 12px}
.deal-table-below{margin-top:24px;padding-top:18px;border-top:1px solid #e5ebf2}

/* Tables of the income and mortgage sections */
.report-subhead{margin:20px 0 10px;font-size:14px;font-weight:650;color:#142b4b}
.report-table{width:100%;border-collapse:collapse;font-size:13px}
.report-table th,.report-table td{padding:10px 12px;border-bottom:1px solid #e5ebf2;text-align:left;font-variant-numeric:tabular-nums}
.report-table th{font-size:12px;font-weight:600;color:#5b6b80;background:#f7f9fc}
.report-table td small{display:block;font-size:11px;color:#6d7f93}
.report-table tr:last-child td{border-bottom:0}
.report-table .best-row{background:#f2f8ff}
.history-metrics small{display:block;font-size:12px;color:#5b6b80}

#help-dialog .help-close{float:right;border:0;background:none;font-size:22px;line-height:1;cursor:pointer;color:#5b6b80}
.rpt-panel-fresh{animation:none}

/* «Важно» under the price card: what the estimate is not, visible on the page and in the PDF. */
.report-v2 #important .main-disclaimer{margin:14px 0 0;padding:12px 14px;border-left:3px solid #0B2545;border-radius:0 8px 8px 0;background:#F4F8FE;color:#0B2545;font-size:14px;line-height:1.5}

/* A question about the report (Feedback): the link on the page, the QR code in the PDF. */
.report-feedback{margin:24px 0 8px;padding:16px 18px;border:1px solid #d9e4f0;border-radius:12px;background:#fff}
.report-feedback-link{font-weight:600;color:#1768CE}
.report-question-link{margin-left:12px;font-size:14px;color:#1768CE;white-space:nowrap}

@media print{
  .report-filling,.params-saved,.params-locked,.apply-button,.info-tip,.purchase-pending{display:none!important}
  .report-v2 #important .main-disclaimer{margin:6pt 0 0;padding:5pt 8pt;font-size:8.5pt;line-height:1.35;break-inside:avoid}
  .section-loading{border-style:solid}
}

/*
 * Page breaks of the PDF. Last in the cascade on purpose: the older print
 * rules above it set breaks section by section and contradict each other.
 *
 * The first sheet holds the heading and «Главное перед покупкой» together:
 * at the screen's spacing the two are ~60pt taller than an A4 sheet, the
 * main block cannot break inside and went whole to the second sheet,
 * leaving the first one with the address alone. So both are tightened in
 * print, and the main block may still break between its parts if a report
 * with many findings outgrows the sheet — a split block beats an empty page.
 *
 * A heading never ends a sheet: every section's top (its title and the
 * lines that introduce it) avoids a break after it, so the break moves
 * above the title instead.
 */
@media print{
  .report-v2 .pdf-intro{padding:0 0 6pt;margin:0 0 6pt}
  .report-v2 .pdf-intro strong{font-size:11pt}
  .report-v2 .pdf-intro p{font-size:8pt;line-height:1.35;margin-top:3pt}
  .report-v2 .report-main,.report-v2 .report-heading{padding-top:0!important;margin-top:0!important}
  .report-v2 .report-heading{padding-bottom:6pt!important;margin-bottom:8pt!important}
  .report-v2 .report-heading h1{font-size:19pt;margin:2pt 0 3pt}
  .report-v2 .report-heading .small,.report-v2 .object-identity{line-height:1.35;margin:2pt 0}
  .report-v2 .pdf-price{margin-top:4pt}

  .report-v2 .report-content #important{break-before:avoid;page-break-before:avoid;break-inside:auto;page-break-inside:auto;padding:10pt;margin-bottom:8pt}
  .report-v2 #important .main-heading{font-size:15pt;margin:0 0 6pt}
  .report-v2 #important .price-card,.report-v2 #important .purchase-panel{break-inside:avoid;page-break-inside:avoid;margin-top:6pt}
  .report-v2 #important .price-card-body{padding:8pt}
  .report-v2 #important .purchase-panel-head{padding:5pt 9pt}
  .report-v2 #important .purchase-row{padding:3pt 9pt;min-height:0;break-inside:avoid}
  /* Room for the estimate's limits under the sum: the price columns no longer wrap in three lines. */
  .report-v2 #important .price-card-main{padding:8pt 10pt;min-height:0}
  .report-v2 #important .price-card-column strong{font-size:12pt;line-height:1.2}
  .report-v2 #important .price-card-column small,.report-v2 #important .price-card-column span{font-size:8pt;line-height:1.3}

  /*
   * The income (~475pt) and the mortgage could not break inside: a few points
   * short of the sheet's end, the whole section moved on and left half a sheet
   * empty. They break between their parts now; a table stays whole with its
   * subheading.
   */
  .report-v2 #investment,.report-v2 #mortgage{break-inside:auto;page-break-inside:auto}
  .report-v2 .report-table{break-inside:avoid;page-break-inside:avoid}
  .report-v2 .report-subhead,.report-v2 .section-intro{break-after:avoid;page-break-after:avoid}

  /* A house list longer than a sheet: its latest sales in the section, all of them in the appendix. */
  .report-v2 .deals-appendix-link{margin:6pt 0 0;font-size:9pt;color:#142b4b;break-before:avoid;page-break-before:avoid}
  .report-v2 .deals-appendix-link a{color:#1768ce;text-decoration:underline}
  .report-v2 #deals-appendix:not([hidden]){display:block;break-before:page;page-break-before:always}
  .report-v2 #deals-appendix .section-top h2{font-size:15pt;margin:0 0 4pt}
  .report-v2 #deals-appendix-table{width:100%;border-collapse:collapse;margin-top:6pt}
  .report-v2 #deals-appendix-table td,.report-v2 #deals-appendix-table th{font-size:8.5pt;line-height:1.2;padding:2.5pt 6pt;text-align:left;border-bottom:.5pt solid #e3e8ef}
  .report-v2 #deals-appendix-table th{background:#edf3fb;color:#142b4b}
  .report-v2 #deals-appendix-table tbody tr:nth-child(even){background:#f7f9fc}
  .report-v2 #deals-appendix-table tr{break-inside:avoid;page-break-inside:avoid}
  .report-v2 #deals-appendix-table .quality-label{display:block;font-size:7.5pt}

  .report-v2 .report-feedback{display:flex;gap:12pt;align-items:center;padding:10pt;margin:12pt 0;break-inside:avoid;page-break-inside:avoid}
  .report-v2 .report-feedback-qr{flex:none;width:28mm;height:28mm}
  .report-v2 .report-feedback-qr svg{width:100%;height:100%;display:block}
  .report-v2 .report-feedback p{margin:0;font-size:9.5pt;line-height:1.45;color:#142b4b}
  .report-v2 .report-feedback a{color:#1768ce;word-break:break-all}

  /* The switch's buttons are hidden in print, its empty row was left: a break point under the title. */
  .report-v2 .market-scope-row{display:none!important}
  .report-v2 .group-heading,.report-v2 .main-heading,.report-v2 .section-top,.report-v2 h2,.report-v2 h3,
  .report-v2 #market-scope-note,.report-v2 .house-numbers,.report-v2 .house-period,.report-v2 .history-metrics,.report-v2 .comparison-period{break-after:avoid;page-break-after:avoid}
}

@media screen{#deals-appendix,#deals-appendix-link{display:none!important}}
