/* Keep rules inside the page area; match screen/print content dimensions.
   Leave 2mm vertical tolerance and start subsequent pages explicitly. */
:root { color-scheme: light; --lp-print-ink: #1c1c1c; --lp-print-muted: #526168; --lp-print-line: #e3e3e3; --lp-print-paper: #f3f5f7; --lp-print-accent: #0f2540; }
@media screen { html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; } }
* { box-sizing: border-box; }
body { margin: 0; background: #fdfdfd; color: var(--lp-print-ink); font-family: Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; font-size: 9pt; font-weight: 400; line-height: 1.5; }
.lp-print-document { width: 100%; max-width: 100%; height: calc(100vh - 190px); overflow: auto; margin: 0 auto; }
.lp-print-page { position: relative; page: auto; width: 297mm; height: 210mm; margin: 18px auto; padding: 12mm; display: flex; flex-direction: column; background: #fff; overflow: visible; break-after: auto; }
.lp-print-page + .lp-print-page { break-before: page; page-break-before: always; }
.lp-print-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8mm; padding: 0 0 4mm; border-bottom: 2px solid #627c81; margin-bottom: 5mm; flex: 0 0 auto; }
.lp-print-kicker { margin: 0 0 2.5mm; color: var(--lp-print-muted); font-size: 8pt; letter-spacing: .12em; }
.lp-print-title { margin: 0; font: inherit; font-size: 20pt; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.lp-print-header__tag { margin: 1mm 0 0; padding: 1.5mm 3mm; background: var(--lp-print-paper); color: #425e65; white-space: nowrap; font-size: 9pt; letter-spacing: .08em; }
.lp-print-overview-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1.12fr 1fr 1fr; gap: 7mm; }
.lp-print-column { min-width: 0; min-height: 0; }
.lp-print-photo { height: 44mm; margin: 0 0 4mm; border: 1px solid var(--lp-print-line); background: var(--lp-print-paper); }
.lp-print-photo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.lp-print-photo-placeholder { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; gap: 2mm; color: #8a969c; font-size: 10pt; }
.lp-print-photo-placeholder span { font-size: 18pt; letter-spacing: .15em; }
.lp-print-price { margin: 0 0 3mm; padding: 2.5mm 3.5mm; background: var(--lp-print-paper); font-size: 23pt; font-weight: 400; line-height: 1.35; overflow-wrap: anywhere; }
.lp-print-price > span { display: block; margin-bottom: 1mm; font-size: 8pt; font-weight: 400; color: var(--lp-print-muted); }
.lp-print-address { margin: 0 0 4mm; font-size: 9pt; line-height: 1.7; overflow-wrap: anywhere; }
.lp-print-group { margin: 0 0 5mm; }
.lp-print-section-title { margin: 0 0 1mm; padding: 1mm 0 1.8mm; border-bottom: 1px solid #849c9f; color: #304f58; font: inherit; font-size: 13pt; font-weight: 500; letter-spacing: .08em; }
.lp-print-facts { margin: 0; }
.lp-print-fact { display: grid; grid-template-columns: 30% 1fr; gap: 2.5mm; border-bottom: 1px solid var(--lp-print-line); padding: 1.7mm 0; font-size: 9pt; line-height: 1.5; break-inside: avoid; }
.lp-print-fact dt { color: var(--lp-print-muted); font-size: 9pt; font-weight: 400; }
.lp-print-fact dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.lp-print-summary-note, .lp-print-rentroll-note { margin: 3mm 0 0; color: var(--lp-print-muted); font-size: 7pt; line-height: 1.5; }
.lp-print-footer { position: relative; margin-top: 4mm; padding: 2mm 9mm 0 0; border-top: 1px solid var(--lp-print-line); font-size: 7pt; line-height: 1.5; flex: 0 0 auto; overflow-wrap: anywhere; }
.lp-print-footer__dates { margin-bottom: 1mm; }
.lp-print-footer__links { display: flex; flex-wrap: wrap; gap: .5mm 7mm; }
.lp-print-footer a { color: inherit; text-decoration: none; }
.lp-print-page-number { position: absolute; right: 0; bottom: 0; font-size: 8pt; }
.lp-print-rentroll-metrics { display: grid; grid-template-columns: 1.25fr 1.25fr 1fr 1fr .7fr; gap: 5mm; margin-bottom: 4mm; }
.lp-print-rentroll-metrics > div { min-width: 0; overflow-wrap: anywhere; }
.lp-print-rentroll-metrics span { display: block; color: var(--lp-print-muted); font-size: 8pt; }
.lp-print-rentroll-metrics strong { font-size: 16pt; font-weight: 500; }
.lp-print-table-space { flex: 1 1 auto; min-height: 0; }
.lp-print-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9pt; }
.lp-print-table th, .lp-print-table td { padding: 2mm 3mm; border: 1px solid var(--lp-print-line); text-align: left; font-weight: 400; overflow-wrap: anywhere; }
.lp-print-table th { background: var(--lp-print-paper); }
.lp-print-table th:nth-last-child(-n+2), .lp-print-table td:nth-last-child(-n+2) { text-align: right; }
.lp-print-table tr { break-inside: avoid; }
.lp-print-rentroll-table th, .lp-print-rentroll-table td { padding-top: 1.3mm; padding-bottom: 1.3mm; }
.lp-print-table thead { display: table-header-group; }
.lp-print-page--flow { height: auto; min-height: 210mm; }
.lp-print-page--flow .lp-print-overview-body { display: block; }
.lp-print-page--flow .lp-print-column { height: auto; }
.lp-print-page--flow .lp-print-fact, .lp-print-page--flow .lp-print-table tr { break-inside: auto; }
.lp-print-continuation-body { flex: 1 1 auto; min-height: 0; }
.lp-print-page--flow .lp-print-continuation-body { flex: none; }
.lp-print-continuation .lp-print-fact { grid-template-columns: 22% 1fr; font-size: 9pt; break-inside: auto; }
.lp-print-document:not(.lp-print-ready) .lp-print-page { height: 210mm; min-height: 210mm; }
.lp-print-toolbar { position: sticky; top: 0; z-index: 20; background: #fdfdfd; box-sizing: border-box; width: calc(100% - 32px); max-width: 900px; margin: 32px auto 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 0; color: var(--lp-print-ink); font: 400 16px/1.8 Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; }
.lp-print-toolbar button, .lp-print-toolbar a { box-sizing: border-box; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--lp-print-accent); padding: 16px 32px; background: #fff; border-radius: 999px; color: var(--lp-print-accent); font: 400 16px/1.6 Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; cursor: pointer; text-decoration: none; transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease; }
.lp-print-toolbar button:disabled, .lp-print-toolbar button[aria-disabled="true"] { border-color: var(--lp-print-line); color: var(--lp-print-muted); background: var(--lp-print-paper); cursor: not-allowed; }
.lp-print-toolbar button:focus-visible, .lp-print-toolbar a:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--lp-print-accent); text-decoration: underline; text-underline-offset: .2em; }
.lp-print-toolbar p { flex: 1 1 420px; margin: 0; color: var(--lp-print-muted); font-size: 13px; line-height: 1.5; }
.lp-print-warning { box-sizing: border-box; width: calc(100% - 32px); max-width: 900px; margin: 16px auto; padding: 16px; border: 1px solid #9a6b28; border-radius: 12px; background: #fff8e9; font-size: 14px; line-height: 1.8; }
.lp-print-warning[hidden] { display: none; }
@media screen { .lp-print-document { overscroll-behavior: contain; scrollbar-gutter: stable; } .lp-print-page { padding: 12mm; width: 297mm; height: 210mm; box-shadow: 0 3px 18px #18364612; } .lp-print-toolbar { padding: 10px 16px; } .lp-print-page--flow, .lp-print-document:not(.lp-print-ready) .lp-print-page { height: 210mm; min-height: 210mm; } }
@media screen and (max-width: 600px) {
  .lp-print-toolbar { align-items: stretch; gap: 10px 12px; width: 100%; margin: 0; padding: 10px 16px; }
  .lp-print-toolbar button, .lp-print-toolbar a { width: auto; min-width: 0; padding: 9px 18px; overflow-wrap: anywhere; text-align: center; }
  .lp-print-toolbar p { flex-basis: 100%; width: 100%; font-size: 13px; }
  .lp-print-warning { width: calc(100% - 32px); margin: 8px auto; }
}
@media (hover: hover) and (pointer: fine) {
  .lp-print-toolbar button:not(:disabled):hover, .lp-print-toolbar a:hover { background: var(--lp-print-paper); }
}
@media (prefers-reduced-motion: reduce) {
  .lp-print-toolbar button, .lp-print-toolbar a { transition: none; }
}
@media print {
  html, body { width: auto !important; height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important; overflow-x: visible !important; position: static !important; transform: none !important; zoom: 1 !important; background: #fff !important; opacity: 1 !important; }
  .lp-print-document { width: auto !important; max-width: none !important; height: auto !important; min-height: 0 !important; max-height: none !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; transform: none !important; }
  .lp-print-toolbar, .lp-print-status-row, .lp-print-warning { display: none !important; }
  .lp-print-page { page: auto; width: 297mm; height: 210mm; margin: 0; padding: 12mm; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; }
}
.lp-print-price .lp-price-caption { display: block; max-width: 100%; margin: 1.5mm 0 0; color: #526b71; font-size: 8pt; font-weight: 400; line-height: 1.6; }
.lp-print-price .lp-price-caption__basis { display: inline-block; white-space: nowrap; }
.lp-print-income, .lp-print-rentroll { padding-bottom: 18mm; }
.lp-print-income .lp-print-group { max-width: 190mm; }
.lp-print-income .lp-print-fact { grid-template-columns: 42% 1fr; font-size: 9pt; padding: 3mm 0; }
.lp-print-income .lp-print-fact dt { font-size: 9pt; }
.lp-print-income .lp-print-summary-note { max-width: 220mm; }
.lp-print-income .lp-print-footer { margin-top: auto; }

.lp-print-column--visual .lp-print-summary-note { margin-top: 2mm; }

.lp-print-price .lp-print-price-unit { display: inline-block; margin-left: 1mm; white-space: nowrap; font-size: 9pt; font-weight: 400; }

.lp-print-costs { flex: 0 0 auto; margin: 0 0 4mm; padding: 2.5mm 3mm; background: var(--lp-print-paper); }
.lp-print-costs h2 { margin: 0 0 2mm; font-size: 9pt; font-weight: 500; }
.lp-print-costs dl { display: grid; grid-template-columns: 1fr 1fr 1.3fr 1fr 1fr; gap: 3mm; margin: 0; }
.lp-print-costs dt { font-size: 7.5pt; color: var(--lp-print-muted); }
.lp-print-costs dd { margin: 1mm 0 0; font-size: 13pt; font-weight: 400; }
.lp-print-costs p { margin: 1.5mm 0 0; font-size: 7pt; line-height: 1.5; color: var(--lp-print-muted); }
.lp-print-income:has(.lp-print-costs) .lp-print-fact { padding: 1.5mm 0; }
.lp-print-company { position: relative; width: 273mm; height: 34mm; font-size: 7pt; line-height: 1.5; color: var(--lp-print-ink); }
.lp-print-company__fixed-text { position: absolute; top: 0; left: 0; width: 273mm; height: 34mm; display: block; overflow: visible; pointer-events: none; font-family: Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; fill: #0f2540; }
.lp-print-company__fixed-text .detail { fill: #1c1c1c; }
.lp-print-company a { color: inherit; text-decoration: none; }
.lp-print-company__qr-item { position: absolute; top: 10.5mm; width: 16mm; height: 19.5mm; display: block; color: inherit; text-align: center; text-decoration: none; font-size: 7pt; line-height: 10.5pt; }
.lp-print-qr { width: 16mm; height: 16mm; background: #fff; }
.lp-print-company__qr-item span { position: absolute; left: 0; top: 16mm; width: 16mm; height: 3.5mm; display: block; margin: 0; white-space: nowrap; font-size: 7pt; line-height: 3.5mm; }
.lp-print-company__meta { position: absolute; left: 2mm; bottom: 0; color: var(--lp-print-muted); font-size: 6.5pt; line-height: 1; }
.lp-print-page-number { position: absolute; right: 55mm; bottom: 0; font-size: 6.5pt; line-height: 1; }
.lp-print-overview { padding-bottom: 50mm; }
.lp-print-overview > .lp-print-footer { position: absolute; left: 12mm; right: 12mm; bottom: 9mm; height: 34mm; margin: 0; padding: 0; border: 0; }
.lp-print-income > .lp-print-footer, .lp-print-rentroll > .lp-print-footer { position: absolute; left: 12mm; right: 12mm; bottom: 9mm; margin: 0; padding: 0; border: 0; }
.lp-print-footer--simple { font-size: 7pt; }
.lp-print-qr svg { display: block; width: 100%; height: 100%; }
.lp-print-footer { margin-top: 2mm; padding-right: 9mm; }
.lp-print-rentroll .lp-print-header { padding-bottom: 3mm; margin-bottom: 4mm; }
.lp-print-rentroll-metrics { margin-bottom: 3mm; }

.lp-print-column--visual .lp-print-photo { height: 38mm; margin-bottom: 3mm; }
.lp-print-column--visual .lp-print-price { margin-bottom: 2mm; }
.lp-print-column--visual .lp-print-address { margin-bottom: 2mm; }
.lp-print-column--visual .lp-print-group { margin-bottom: 2mm; }
.lp-print-column--visual .lp-print-fact { padding: .9mm 0; line-height: 1.5; }
.lp-print-column--visual [data-print-key="brokerage_fee"] { row-gap: .7mm; }
.lp-print-column--visual [data-print-key="brokerage_fee"] dd { display: contents; }
.lp-print-column--visual .lp-print-fee-amount { grid-column: 2; }

.lp-offer-footer .lp-print-company { width:186mm; height:34mm; }
.lp-offer-footer .lp-print-company__fixed-text { width:186mm; height:34mm; }
.lp-offer-footer .lp-print-company__qr-item--property { left:148mm !important; }
.lp-offer-footer .lp-print-company__qr-item--contact { left:167mm !important; }
.lp-offer-footer .lp-print-page-number { display:none; }

.lp-print-header__aside { display: flex; flex-direction: column; align-items: flex-end; flex: 0 0 auto; gap: 1.5mm; }


.lp-print-diagnostic { max-width: 277mm; margin: 12px auto; padding: 12px 16px; border: 1px solid #647781; background: #fff; color: #273d45; font-size: 9pt; }
.lp-print-diagnostic h2 { margin: 0 0 6px; font-size: 12pt; }
.lp-print-diagnostic p { margin: 0 0 8px; }
.lp-print-diagnostic textarea { display: block; width: 100%; min-height: 110px; padding: 8px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.lp-print-diagnostic__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.lp-print-diagnostic__actions button { min-height: 40px; padding: 6px 12px; }
.lp-print-diagnostic__status { margin-top: 6px !important; }
@media print { .lp-print-diagnostic { display: none !important; } }

.lp-print-screen-status { font-size: 8pt !important; color: var(--lp-print-muted); }
body[data-lp-print-diagnostics="1"] .lp-print-screen-status, body[data-lp-print-diagnostics="1"] .lp-print-status-row { display: none !important; }
@media print { .lp-print-screen-status { display: none !important; } }

/* Match the calculator preview with a flexible toolbar above an A4-only scroller. */
@media screen {
  html, body { width:100%; height:100%; min-height:0; margin:0; overflow:hidden; }
  body { display:flex; flex-direction:column; background:#f3f5f7; }
  .lp-print-toolbar { position:relative; z-index:20; flex:0 0 auto; top:auto; left:auto; right:auto; width:100%; max-width:none; min-height:68px; margin:0; padding:10px 16px; gap:12px; background:#fff; border-bottom:1px solid #e3e3e3; }
  .lp-print-toolbar button, .lp-print-toolbar a { min-height:48px; padding:9px 18px; }
  .lp-print-toolbar p { flex:1 1 420px; }
  .lp-print-status-row { order:1; flex:0 0 auto; box-sizing:border-box; width:calc(100% - 32px); max-width:277mm; margin:8px auto 12px; padding:8px 12px; border:1px solid #e3e3e3; background:#f3f5f7; color:#526168; }
  .lp-print-screen-status { margin:0; color:#526168; font-size:13px !important; line-height:1.5; }
  .lp-print-document, .lp-form-paper-scroller { order:2; position:relative; flex:1 1 auto; top:auto; left:auto; right:auto; box-sizing:border-box; width:100vw; max-width:none; height:auto; min-height:0; margin:0; padding:0 0 16px; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
  .lp-print-page { margin:12px auto; }
}
@media screen and (max-width:600px) {
  .lp-print-toolbar { width:100%; margin:0; padding: max(16px, env(safe-area-inset-top, 0px)) 16px 10px; gap:10px 12px; }
  .lp-print-toolbar button, .lp-print-toolbar a { flex:0 0 auto; min-width:0; padding:9px 18px; }
  .lp-print-toolbar p { flex-basis:100%; width:100%; font-size:13px; }
}
/* Listing dates occupy the reserved line above company details; page number aligns to the paper edge. */
.lp-print-footer__dates { position:absolute; left:2mm; right:0; top:-7mm; height:7mm; margin:0; display:flex; align-items:flex-end; padding-bottom:.6mm; color:var(--lp-print-muted); font-size:7pt; line-height:1.3; }
.lp-print-page-number { right:0; bottom:0; font-size:7pt; line-height:1.2; text-align:right; }

/* Match the calculator toolbar controls and hint typography. */
.lp-print-toolbar button, .lp-print-toolbar a { min-height:48px; padding:9px 18px; border:1px solid #647781; border-radius:3px; color:#273d45; font:400 14px/1.6 Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; }
.lp-print-toolbar p:not(.lp-print-screen-status) { color:#68797e; font-size:13px; line-height:1.5; }
.lp-print-status-row { box-sizing:border-box; width:calc(100% - 32px); max-width:277mm; margin:8px auto 12px; padding:8px 12px; border:1px solid #e3e3e3; background:#f3f5f7; color:#526168; }
.lp-print-status-row .lp-print-screen-status { margin:0; color:#526168; font-size:13px !important; line-height:1.5; }
@media screen {
  .lp-print-toolbar { order:0; }
  .lp-print-status-row { order:1; flex:0 0 auto; }
  body > .lp-print-warning { order:1; flex:0 0 auto; margin:8px auto; }
  .lp-print-document, .lp-form-paper-scroller { order:2; }
}
