/* ==========================================================================
   1. DESIGN TOKENS & MODERN WEB GUIDANCE FOUNDATIONS
   ========================================================================== */
:root {
  --brand-color: #8c6d46;
  --brand-dark: #6e5231;
  --brand-terracotta: #a8553a;
  --forest-dark: #222823;
  --ui-bg: #f3f2ee;
  --ui-panel: #ffffff;
  --ui-border: #dfddd6;
  --ui-text: #1f2220;
  --ui-muted: #666560;
  --poster-serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "MS PMincho", Georgia, serif;
  --poster-sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --poster-display: "Cormorant Garamond", "Times New Roman", "Noto Serif JP", serif;
  --poster-script: "Alex Brush", "Snell Roundhand", "Apple Chancery", cursive;
  color-scheme: light;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--poster-sans);
  background-color: var(--ui-bg);
  color: var(--ui-text);
  accent-color: var(--brand-color);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Modern Web Guidance: improve-text-layout-and-legibility */
h1, h2, h3, .app-title, .card-title, .property-title, .quality-title {
  text-wrap: balance;
}

p, li, .hero-desc, .quality-body, .point-desc, .panel-hint {
  text-wrap: pretty;
}

/* Modern Web Guidance: form-fields-automatically-fit-contents */
.sidebar-form textarea {
  field-sizing: content;
  height: auto;
  width: 100%;
  min-block-size: 2.8lh;
  max-block-size: 9lh;
  resize: vertical;
}

/* Modern Web Guidance: brand-consistent-forms fallback for accent-color */
.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f5f1eb;
  border: 1px solid #d9cfc1;
  font-size: 13px;
  font-weight: 500;
  color: #3d3326;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.toggle-pill:hover {
  background: #ece5da;
}

@supports not (accent-color: var(--brand-color)) {
  input[type="checkbox"].visually-hidden {
    position: absolute !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: nowrap !important;
  }

  .toggle-pill {
    position: relative;
    padding-left: 2.2rem;
  }

  .toggle-pill input[type="checkbox"] + span::before {
    content: "";
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    border: 2px solid #b5a895;
    background: #fff;
    border-radius: 3px;
    box-sizing: border-box;
  }

  .toggle-pill input[type="checkbox"]:focus-visible + span::before {
    outline: 2px solid #000;
    outline-offset: 2px;
  }

  .toggle-pill input[type="checkbox"]:checked + span::before {
    background-color: var(--brand-color);
    border-color: var(--brand-color);
  }

  .toggle-pill input[type="checkbox"]:checked + span::after {
    content: "✓";
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-weight: bold;
    font-size: 0.78rem;
  }

  input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
  }

  input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, var(--brand-color) var(--progress, 50%), #ccc var(--progress, 50%));
    border-radius: 4px;
  }

  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 15px;
    width: 15px;
    border-radius: 50%;
    background: var(--brand-color);
    cursor: pointer;
    margin-top: -4.5px;
  }
}

/* ==========================================================================
   2. APPLICATION SHELL & TOOLBAR
   ========================================================================== */
.app-header {
  height: 62px;
  background: #1b201c;
  color: #fff;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #2e3530;
  flex-shrink: 0;
  z-index: 20;
}

.brand-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #c6a069, #8c6d46);
  color: #fff;
  font-family: var(--poster-display);
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.app-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f7f5f0;
}

.app-subtitle {
  font-size: 11.5px;
  color: #a9b0aa;
  margin-top: 1px;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-group,
.export-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.divider-v {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.16);
  margin: 0 2px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, #b08b5e, #8c6d46);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #bfa074, #9b7a50);
}

.btn-accent {
  background: linear-gradient(135deg, #b86044, #9c4c33);
  color: #fff;
}

.btn-accent:hover {
  background: linear-gradient(135deg, #c66d50, #ab563c);
}

.btn-secondary {
  background: #2b322d;
  color: #eae8e1;
  border-color: #424b44;
}

.btn-secondary:hover {
  background: #37403a;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #e4e2db;
  border-color: rgba(255, 255, 255, 0.14);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
}

.scale-select {
  background: #2b322d;
  color: #f0eee8;
  border: 1px solid #424b44;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

/* ==========================================================================
   3. WORKSPACE & LEFT SIDEBAR EDITOR
   ========================================================================== */
.app-workspace {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.editor-sidebar {
  width: 430px;
  background: var(--ui-panel);
  border-right: 1px solid var(--ui-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

.sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #f6f5f1;
  border-bottom: 1px solid var(--ui-border);
  padding: 6px 6px 0;
  gap: 4px;
}

.tab-btn {
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  padding: 9px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ui-muted);
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--ui-text);
  background: rgba(140, 109, 70, 0.07);
}

.tab-btn.active {
  background: #fff;
  color: var(--brand-dark);
  border-color: var(--ui-border);
  box-shadow: 0 -2px 0 var(--brand-color) inset;
}

.sidebar-form {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.tab-panel.active {
  display: flex;
}

.panel-card {
  background: #faf9f6;
  border: 1px solid #e5e2da;
  border-radius: 8px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: #2c261e;
  border-left: 3px solid var(--brand-color);
  padding-left: 8px;
}

.btn-link {
  background: #f0e8dc;
  border: 1px solid #d5c4ac;
  color: #6b4e2b;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-link:hover {
  background: #e5d8c5;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-row label {
  font-size: 11.5px;
  font-weight: 600;
  color: #57534c;
}

.field-row input[type="text"],
.field-row textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #d3cfc6;
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: #1c1b18;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-row input[type="text"]:focus,
.field-row textarea:focus {
  outline: none;
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px rgba(140, 109, 70, 0.18);
}

.field-row input.flash-highlight,
.field-row textarea.flash-highlight,
.photo-slot-card.flash-highlight {
  animation: pulseHighlight 1.2s ease;
}

@keyframes pulseHighlight {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(184, 96, 68, 0);
  }
  30% {
    border-color: var(--brand-terracotta);
    box-shadow: 0 0 0 4px rgba(184, 96, 68, 0.32);
  }
}

.field-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.span-2 {
  grid-column: span 2;
}

.spec-edit-group {
  background: #fff;
  border: 1px solid #e9e6de;
  border-radius: 6px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spec-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-dark);
}

.panel-hint {
  font-size: 12px;
  color: #5c574f;
  background: #f5efe6;
  border: 1px solid #e2d5c1;
  border-radius: 6px;
  padding: 9px 11px;
  line-height: 1.5;
}

/* Photo Controls in Tab 2 */
.photo-slot-card {
  background: #faf9f6;
  border: 1px solid #e4e0d7;
  border-radius: 8px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photo-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.photo-slot-title {
  font-size: 13px;
  font-weight: 700;
  color: #2b251d;
}

.photo-slot-body {
  display: flex;
  gap: 10px;
  align-items: center;
}

.photo-thumb-box {
  width: 76px;
  height: 58px;
  border-radius: 5px;
  border: 1px solid #d5d0c5;
  background: #eee;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-actions-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.photo-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sliders-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 4px;
  border-top: 1px dashed #e2ded4;
}

.slider-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slider-item label {
  font-size: 10.5px;
  color: #666;
  display: flex;
  justify-content: space-between;
}

.slider-item input[type="range"] {
  width: 100%;
  cursor: pointer;
}

.points-editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   4. RIGHT PREVIEW STAGE & ZOOM CONTROLS
   ========================================================================== */
.preview-stage {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at center, #e5e4df 0%, #cfcec8 100%);
  overflow: hidden;
}

.zoom-bar {
  position: absolute;
  bottom: 18px;
  right: 22px;
  background: rgba(27, 32, 28, 0.9);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 5px 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  z-index: 15;
}

.zoom-btn {
  background: transparent;
  border: none;
  color: #f3f1ec;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.zoom-btn.zoom-fit {
  font-size: 11.5px;
  font-weight: 500;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.zoom-label {
  font-size: 12px;
  min-width: 42px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.canvas-viewport {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 28px;
}

.canvas-scaler {
  transform-origin: top center;
  transition: transform 0.12s ease-out;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28);
  background: #fff;
}

/* ==========================================================================
   5. THE A4 POSTER CANVAS (1055px × 1491px 1:1 EXACT REPRODUCTION)
   ========================================================================== */
.poster-canvas {
  width: 1055px;
  height: 1491px;
  background: #ffffff;
  color: #1a1a1a;
  font-family: var(--poster-serif);
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Interactive hover affordances on canvas (disabled during export/print) */
.poster-canvas:not(.exporting) [data-edit-target],
.poster-canvas:not(.exporting) .photo-dropzone {
  cursor: pointer;
  transition: outline-color 0.12s ease, background-color 0.12s ease;
}

.poster-canvas:not(.exporting) [data-edit-target]:hover {
  outline: 1.5px dashed rgba(184, 96, 68, 0.75);
  outline-offset: 2px;
}

.poster-canvas:not(.exporting) .photo-dropzone:hover {
  outline: 2px solid rgba(184, 96, 68, 0.85);
  outline-offset: -2px;
}

.poster-canvas:not(.exporting) .photo-dropzone.drag-over {
  outline: 4px dashed #c85a32;
  outline-offset: -4px;
  filter: brightness(1.06);
}

/* Placeholder badges visibility toggle */
.poster-canvas.hide-placeholders .placeholder-badge {
  display: none !important;
}

.photo-frame {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.replaceable-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center center;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   SECTION 1: TOP HERO (0..441px)
   -------------------------------------------------------------------------- */
.hero-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 1055px;
  height: 441px;
  display: flex;
}

.hero-left {
  width: 382px;
  height: 441px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.hero-left-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-left-content {
  position: relative;
  z-index: 2;
  padding: 36px 22px 24px 56px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.hero-top-sub {
  font-family: var(--poster-serif);
  font-size: 14.4px;
  line-height: 1.62;
  letter-spacing: 0.06em;
  color: #f4f2ec;
  white-space: pre-line;
}

.hero-brand-lockup {
  margin-top: 18px;
  line-height: 1;
}

.hero-brand-nesto {
  font-family: var(--poster-display);
  font-size: 94px;
  font-weight: 600;
  letter-spacing: 0.025em;
  line-height: 0.86;
  color: #f7f4ec;
}

.hero-brand-living {
  font-family: var(--poster-display);
  font-size: 94px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 0.94;
  margin-top: 2px;
  color: #c8a265;
  background: linear-gradient(90deg, #dfc088 0%, #b5894a 52%, #d8b577 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-catch {
  margin-top: 19px;
  font-family: var(--poster-serif);
  font-size: 21.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: #ffffff;
}

.hero-divider {
  margin-top: 18px;
  width: 278px;
  height: 1px;
  background: rgba(201, 171, 121, 0.62);
}

.hero-desc {
  margin-top: 18px;
  font-family: var(--poster-serif);
  font-size: 14.8px;
  line-height: 1.72;
  letter-spacing: 0.03em;
  color: #f0eee8;
  white-space: pre-line;
}

/* Right Main Photo (673 × 441) */
.hero-right {
  width: 673px;
  height: 441px;
  position: relative;
  overflow: hidden;
  background: #2c2823;
}

.placeholder-badge {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--poster-serif);
  pointer-events: none;
}

.badge-main {
  top: 21px;
  right: 27px;
  width: 181px;
  height: 64px;
  background: rgba(34, 31, 26, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.78);
  color: #ffffff;
  font-size: 15px;
  line-height: 1.42;
  letter-spacing: 0.04em;
}

/* Script overlay on main photo (hidden when unmodified default photo is used, shown when photo changed or text edited) */
.hero-script-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
}

.hero-script-overlay.active {
  opacity: 1;
  background: linear-gradient(155deg, transparent 52%, rgba(25, 20, 15, 0.42) 100%);
}

.hero-script-overlay [data-edit-target] {
  pointer-events: auto;
}

.hero-script-text {
  position: absolute;
  right: 18px;
  bottom: 72px;
  font-family: var(--poster-script);
  font-size: 56px;
  line-height: 0.92;
  color: rgba(255, 255, 255, 0.94);
  transform: rotate(-10deg);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  white-space: pre-line;
  text-align: center;
}

.hero-right-sub {
  position: absolute;
  right: 26px;
  bottom: 20px;
  font-family: var(--poster-serif);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  white-space: pre-line;
}

/* --------------------------------------------------------------------------
   SECTION 2: PROPERTY TITLE & PRICE BAR (441..598px)
   -------------------------------------------------------------------------- */
.title-price-section {
  position: absolute;
  top: 441px;
  left: 0;
  width: 1055px;
  height: 157px;
  padding: 17px 32px 0;
  display: flex;
  align-items: flex-start;
}

.title-col {
  width: 530px;
  flex-shrink: 0;
}

.property-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 316px;
  height: 31px;
  padding: 0 16px;
  background: linear-gradient(90deg, #9c6a49 0%, #7d5236 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.property-title {
  margin-top: 8px;
  font-family: var(--poster-serif);
  font-size: 55px;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: 0.015em;
  color: #111111;
  white-space: nowrap;
}

.property-sub {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 500;
  color: #1f1f1f;
  letter-spacing: 0.015em;
}

.title-price-divider {
  width: 1px;
  height: 112px;
  background: #7c7c7c;
  margin-top: 12px;
  margin-left: 1px;
  margin-right: 31px;
  flex-shrink: 0;
}

.price-col {
  flex: 1;
  padding-top: 16px;
}

.price-label {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: 0.06em;
}

.price-value-row {
  display: flex;
  align-items: baseline;
  margin-top: -2px;
}

.price-value {
  font-family: var(--poster-serif);
  font-size: 84px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #8c6e43;
  background: linear-gradient(180deg, #9e7e50 0%, #7a5d34 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.price-tax {
  font-size: 15px;
  font-weight: 500;
  color: #222222;
  margin-left: 4px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   SECTION 3: 5-COLUMN KEY SPECS BAR (598..715px)
   -------------------------------------------------------------------------- */
.specs-bar {
  position: absolute;
  top: 598px;
  left: 32px;
  width: 991px;
  height: 117px;
  background: #f4f3ef;
  display: flex;
  align-items: stretch;
  padding: 14px 0;
}

.spec-item {
  position: relative;
  padding: 2px 14px 2px 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-right: 1px solid #c7c5be;
}

.spec-item:last-child {
  border-right: none;
}

.spec-col-1 { width: 196px; }
.spec-col-2 { width: 196px; }
.spec-col-3 { width: 189px; }
.spec-col-4 { width: 225px; }
.spec-col-5 { width: 185px; }

.spec-icon {
  width: 35px;
  height: 35px;
  object-fit: contain;
  flex-shrink: 0;
  margin-top: 2px;
}

.spec-text-wrap {
  flex: 1;
  min-width: 0;
}

.spec-label {
  font-size: 16px;
  font-weight: 600;
  color: #1f1f1f;
  line-height: 1.25;
  margin-bottom: 6px;
}

.spec-main-lg {
  font-size: 27px;
  font-weight: 600;
  color: #111111;
  line-height: 1.15;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.spec-sub {
  font-size: 13.5px;
  color: #2b2b2b;
  margin-top: 3px;
  white-space: nowrap;
}

.spec-line {
  font-size: 17px;
  font-weight: 500;
  color: #181818;
  line-height: 1.42;
  white-space: nowrap;
}

.spec-walk-line .num-lg,
.spec-age-line .num-lg {
  font-size: 26px;
  font-weight: 600;
  margin: 0 2px;
}

/* --------------------------------------------------------------------------
   SECTION 4: MIDDLE SECTION (731..1132px)
   -------------------------------------------------------------------------- */
.middle-section {
  position: absolute;
  top: 731px;
  left: 32px;
  width: 991px;
  height: 401px;
  display: flex;
  justify-content: space-between;
}

/* Left Floorplan Box (288 × 401) */
.floorplan-box {
  width: 288px;
  height: 401px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.floorplan-header {
  height: 35px;
  background: #232b24;
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floorplan-body {
  width: 288px;
  height: 366px;
  background: #f7f7f5;
  position: relative;
  overflow: hidden;
}

.floorplan-body .replaceable-img {
  object-fit: contain;
}

.badge-floorplan {
  top: 146px;
  left: 55px;
  width: 177px;
  height: 66px;
  background: rgba(212, 212, 210, 0.82);
  color: #1f1f1f;
  font-size: 17px;
  line-height: 1.42;
  letter-spacing: 0.05em;
}

/* Right Column (687 × 401) */
.middle-right {
  width: 687px;
  height: 401px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.subphotos-grid {
  width: 687px;
  height: 177px;
  display: grid;
  grid-template-columns: 235px 223px 217px;
  gap: 6px;
}

.subphoto-card {
  position: relative;
  height: 177px;
  overflow: hidden;
  background: #ddd;
}

.room-tab {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  min-width: 84px;
  height: 33px;
  padding: 0 14px;
  background: linear-gradient(90deg, #986344 0%, #7d4e33 100%);
  color: #ffffff;
  font-family: var(--poster-serif);
  font-size: 18px;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-subphoto {
  bottom: 0;
  left: 34px;
  right: 34px;
  height: 44px;
  background: rgba(24, 21, 18, 0.56);
  color: #ffffff;
  font-size: 13px;
  line-height: 1.35;
}

/* Recommended Points Box (687 × 212) */
.points-box {
  width: 687px;
  height: 212px;
  display: flex;
  flex-direction: column;
}

.ribbon-header {
  height: 38px;
  background: #f4f3ef;
  display: flex;
  align-items: center;
}

.ribbon-tab {
  width: 288px;
  height: 38px;
  background: linear-gradient(90deg, #7d5e3b 0%, #9c7b54 100%);
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 100%, 0 100%);
  color: #ffffff;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding-left: 22px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ribbon-sub {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: #1f1f1f;
  padding-right: 8px;
}

.points-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 77px);
  column-gap: 12px;
  row-gap: 10px;
}

.point-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-right: 1px solid #e6e4de;
  padding-right: 6px;
}

.point-item:nth-child(3n) {
  border-right: none;
  padding-right: 0;
}

.point-num {
  width: 45px;
  height: 45px;
  background: #f2efe9;
  color: #745533;
  font-size: 25px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.point-text {
  flex: 1;
  min-width: 0;
}

.point-title {
  font-size: 16px;
  font-weight: 600;
  color: #6b4c2b;
  line-height: 1.25;
  margin-bottom: 4px;
  white-space: nowrap;
}

.point-desc {
  font-size: 12.2px;
  color: #222222;
  line-height: 1.48;
  white-space: pre-line;
}

/* --------------------------------------------------------------------------
   SECTION 5: LOWER SECTION - NESTO QUALITY & RENOVATION (1149..1338px)
   -------------------------------------------------------------------------- */
.lower-section {
  position: absolute;
  top: 1149px;
  left: 0;
  width: 1055px;
  height: 189px;
  display: flex;
  justify-content: space-between;
}

.quality-box {
  width: 555px;
  height: 189px;
  position: relative;
  overflow: hidden;
}

.quality-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quality-content {
  position: relative;
  z-index: 2;
  padding: 20px 18px 14px 128px;
  text-align: center;
}

.quality-title {
  font-family: var(--poster-serif);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #111111;
  line-height: 1.15;
}

.quality-sub {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #151515;
}

.quality-body {
  margin-top: 11px;
  font-size: 13.4px;
  line-height: 1.68;
  color: #1c1c1c;
  white-space: pre-line;
}

/* Right: Renovation Contents (450 × 189, right-aligned to 1023px) */
.reno-box {
  width: 450px;
  height: 189px;
  margin-right: 32px;
  display: flex;
  flex-direction: column;
}

.reno-header {
  height: 41px;
}

.reno-tab {
  width: 238px;
  height: 41px;
  padding-left: 18px;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 100%, 0 100%);
}

.reno-sub {
  font-size: 13.2px;
  text-align: left;
  padding-left: 6px;
}

.reno-columns {
  margin-top: 12px;
  padding-left: 15px;
  display: grid;
  grid-template-columns: 274px 160px;
  column-gap: 4px;
}

.reno-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.reno-list li {
  font-size: 13.3px;
  color: #1f1f1f;
  line-height: 1.32;
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.reno-bullet {
  color: #856542;
  font-size: 11px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   SECTION 6: FOOTER SECTION (1338..1491px)
   -------------------------------------------------------------------------- */
.poster-footer {
  position: absolute;
  top: 1338px;
  left: 0;
  width: 1055px;
  height: 153px;
  background: #222625;
  color: #ffffff;
  padding: 15px 31px 0 32px;
}

.footer-main {
  display: flex;
  align-items: stretch;
  height: 92px;
}

.footer-col-company {
  width: 308px;
  border-right: 1px solid rgba(255, 255, 255, 0.42);
  padding-right: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.footer-company-name {
  font-size: 25.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  white-space: nowrap;
}

.footer-company-meta {
  font-size: 13px;
  color: #e8e8e5;
  line-height: 1.62;
  white-space: nowrap;
}

.footer-col-phone {
  width: 250px;
  border-right: 1px solid rgba(255, 255, 255, 0.42);
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.footer-phone-heading {
  font-size: 13.5px;
  letter-spacing: 0.03em;
}

.footer-phone-num {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.2;
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.phone-icon,
.footer-phone-img {
  width: 25px;
  height: 25px;
  object-fit: contain;
  flex-shrink: 0;
}

.footer-phone-hours {
  font-size: 12.5px;
  color: #dedede;
}

.footer-col-links {
  width: 184px;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.footer-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  white-space: nowrap;
}

.footer-mini-icon,
.footer-mini-img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  flex-shrink: 0;
}

.footer-col-cta {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.footer-cta-btn {
  width: 156px;
  height: 75px;
  background: linear-gradient(135deg, #b56045 0%, #9b4b32 100%);
  border-radius: 4px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
}

.cta-text {
  font-size: 15px;
  line-height: 1.48;
  white-space: pre-line;
}

.cta-arrow {
  font-size: 16px;
}

.footer-qr-box {
  width: 78px;
  height: 77px;
  background: #ffffff;
  color: #222222;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.42;
  color: #222222;
}

.footer-disclaimer {
  position: absolute;
  right: 31px;
  bottom: 14px;
  font-size: 11.5px;
  color: #cccccc;
  letter-spacing: 0.02em;
}

/* Toast notification */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1b201c;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  z-index: 100;
}

/* ==========================================================================
   6. A4 PRINT / PDF EXPORT MEDIA QUERY
   ========================================================================== */
@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  .no-print {
    display: none !important;
  }

  html, body {
    width: 210mm;
    height: 297mm;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .app-workspace,
  .preview-stage,
  .canvas-viewport {
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    overflow: visible !important;
    display: block !important;
  }

  .canvas-scaler {
    transform: scale(0.752) !important;
    transform-origin: top left !important;
    box-shadow: none !important;
    width: 1055px !important;
    height: 1491px !important;
  }
}
