.feature-scene {
  --demo-ink: #262b23;
  --demo-sub: #5c6258;
  --demo-line: #dde0d5;
  --demo-canvas: #fafbf7;
  container: feature-preview / inline-size;
  color: var(--demo-ink);
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.feature-scene [hidden] { display: none !important; }
.demo-surface {
  max-width: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d8dbcf;
  border-radius: 15px;
  box-shadow: 0 18px 36px -30px #29352388, 0 3px 9px #292c2310;
}
.demo-surface h4, .demo-surface p, .demo-surface ol, .demo-surface ul { margin: 0; }
.demo-surface h4 { font-size: 1.04rem; font-weight: 600; line-height: 1.26; letter-spacing: -.025em; }
.demo-surface button, .demo-surface select { appearance: none; font: inherit; }
.demo-surface button { cursor: pointer; touch-action: manipulation; }
.demo-surface button:disabled, .demo-surface select:disabled { cursor: default; }
.demo-surface :is(button,select):focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; z-index: 1; }
.demo-surface button:not(:disabled):active { transform: translateY(1px); }
.demo-icon { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; width: 18px; height: 18px; flex: none; }
.demo-mast {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 15px clamp(13px, 4cqw, 25px);
  background: var(--demo-canvas); border-bottom: 1px solid var(--demo-line);
}
.demo-page-title { display: flex; align-items: center; gap: 9px; font-size: .96rem; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; }
.demo-page-title .demo-icon { color: var(--accent-ink); }
.demo-meta, .demo-context, .demo-feedback { font-size: .77rem; line-height: 1.4; color: var(--demo-sub); }
.demo-meta { text-align: right; }
.demo-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.demo-pad { padding: clamp(14px, 4cqw, 25px); }
.demo-line { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.demo-surface .demo-segments {
  display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px;
  border: 1px solid var(--demo-line); background: #f0f2ea; border-radius: 9px;
}
.demo-segments button {
  min-height: 31px; border: 0; padding: 4px 10px; border-radius: 6px;
  background: transparent; color: var(--demo-sub); font-size: .79rem; font-weight: 600;
}
.demo-segments button[aria-pressed=true] { color: var(--accent-ink); background: #fff; box-shadow: 0 1px 3px #28302120; }
.demo-segments button:disabled { color: #62665d; background: transparent; box-shadow: none; }
.demo-select { display: inline-flex; align-items: center; position: relative; }
.demo-select::after {
  content: ""; position: absolute; right: 11px; top: calc(50% - 4px);
  width: 6px; height: 6px; border: solid var(--demo-sub); border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg); pointer-events: none;
}
.demo-select select {
  min-height: 36px; max-width: 100%; border: 1px solid var(--demo-line); border-radius: 7px;
  padding: 4px 29px 4px 10px; background: #fff; color: var(--demo-ink); font-size: .8rem; font-weight: 600; cursor: pointer;
}
.demo-surface .demo-action {
  min-height: 37px; padding: 7px 12px; border: 1px solid transparent; border-radius: 7px;
  background: var(--accent-fill); color: var(--on-accent); font-size: .81rem; font-weight: 600; line-height: 1.3;
}
.plan-property-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px clamp(13px, 4cqw, 25px);
  border-bottom: 1px solid var(--demo-line);
  background: var(--demo-canvas);
}
.plan-property-header img {
  width: 56px;
  height: 46px;
  object-fit: cover;
  border-radius: 6px;
}
.plan-property-meta { flex: 1; min-width: 0; }
.plan-property-meta strong, .plan-property-meta span { display: block; line-height: 1.3; }
.plan-property-meta strong { color: var(--demo-ink); font-size: 1rem; letter-spacing: -.025em; }
.plan-property-meta span { margin-top: 3px; color: var(--demo-sub); font-size: .76rem; }
.demo-units { padding: 5px clamp(8px, 2.5cqw, 18px) 14px; }
.demo-floorplan {
  position: relative;
  isolation: isolate;
  aspect-ratio: 520 / 316;
  width: 100%;
  margin: 0;
  background: #fffefa;
}
.plan-linework, .plan-access {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}
.plan-linework { z-index: 1; }
.plan-access { z-index: 2; }
.plan-upper-wall, .demo-floorplan:not([data-level="1"]) .plan-street-entry { display: none; }
.demo-floorplan:not([data-level="1"]) .plan-upper-wall { display: block; }
.demo-floorplan button {
  /* Hit regions share coordinates with the architectural drawing's viewBox. */
  position: absolute;
  left: calc(var(--plan-x) / 520 * 100%);
  top: calc(var(--plan-y) / 316 * 100%);
  width: calc(var(--plan-w) / 520 * 100%);
  height: calc(var(--plan-h) / 316 * 100%);
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #f7f7ef;
  transition: background-color .15s;
}
.plan-north-west { --plan-x: 16; --plan-y: 16; --plan-w: 204; --plan-h: 123; --tag-x: 52%; --tag-y: 54%; }
.plan-north-east { --plan-x: 220; --plan-y: 16; --plan-w: 284; --plan-h: 123; --tag-x: 32%; --tag-y: 58%; }
.plan-south-west { --plan-x: 16; --plan-y: 168; --plan-w: 160; --plan-h: 132; --tag-x: 45%; --tag-y: 40%; }
.plan-south-east { --plan-x: 258; --plan-y: 168; --plan-w: 246; --plan-h: 132; --tag-x: 43%; --tag-y: 45%; }
.demo-floorplan [data-unit-label] {
  position: absolute;
  z-index: 3;
  left: var(--tag-x);
  top: var(--tag-y);
  transform: translate(-50%, -50%);
  min-width: 1.9em;
  padding: .18em .36em;
  border: 1px solid #a1aa9b;
  border-radius: .3em;
  color: #364637;
  background: #fffefa;
  font-size: clamp(.67rem, 2.55cqw, .98rem);
  font-weight: 700;
  line-height: 1.15;
}
.demo-floorplan button[aria-pressed=true] { background: var(--accent-soft); }
.demo-floorplan button[aria-pressed=true] [data-unit-label] { border-color: var(--accent-ink); color: var(--on-accent); background: var(--accent-fill); }
.demo-floorplan button:focus-visible {
  z-index: auto;
  outline: 2px dashed var(--accent-ink);
  outline-offset: -3px;
}
.demo-floorplan button:not(:disabled):active, .demo-floorplan button:focus-visible { transform: none; }
.plan-hall, .plan-stairs {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  pointer-events: none;
  color: #4e5e50;
  font-weight: 600;
  line-height: 1;
}
.plan-hall { left: 50%; top: 48.65%; font-size: clamp(.57rem, 2.2cqw, .85rem); letter-spacing: .05em; }
.plan-stairs { left: 44.1%; top: 59.85%; font-size: clamp(.45rem, 1.7cqw, .64rem); }
.demo-units .demo-unit-note { padding-inline: 3%; }
@media (hover: hover) {
  .demo-floorplan button[aria-pressed=false]:hover { background: #e9eee5; }
}
@container feature-preview (max-width: 310px) {
  .plan-property-header { gap: 7px; padding-inline: 10px; }
  .plan-property-header img { width: 36px; height: 36px; }
  .plan-property-meta span { font-size: .7rem; }
}
.demo-unit-note, .demo-appointment > div { display: grid; gap: 3px; }
.demo-unit-note strong, .demo-appointment strong { font-size: .88rem; font-weight: 600; }
.demo-unit-note span, .demo-appointment small { font-size: .77rem; line-height: 1.4; color: var(--demo-sub); }

.demo-repair-intro { display: flex; align-items: center; gap: 15px; }
.demo-repair-intro img { width: clamp(65px,20cqw,104px); aspect-ratio: 1.1; height: auto; object-fit: cover; border-radius: 8px; flex: none; }
.demo-repair-intro h4 { margin: 4px 0; font-size: clamp(1.06rem,4cqw,1.48rem); }
.demo-repair-intro p, .demo-reminder-head p, .demo-letter p { color: var(--demo-sub); font-size: .85rem; line-height: 1.42; }
.demo-surface .demo-timeline { list-style:none; padding:0; display:flex; position:relative; isolation:isolate; margin-block:24px; }
.demo-timeline::before, .demo-timeline::after {
  content:""; position:absolute; z-index:-1; top:5px; left:6px; width:66.6667%; height:2px;
  background:var(--demo-line); border-radius:2px;
}
.demo-timeline::after {
  background:var(--accent-ink); transform-origin:left center; transform:scaleX(var(--repair-progress, 0));
  transition:transform .62s cubic-bezier(.3,.05,.18,1);
}
.demo-timeline li { flex: 1; position: relative; display: grid; gap: 6px; color: var(--demo-sub); font-size: .76rem; }
.demo-timeline i { width:12px; height:12px; position:relative; border:2px solid #a8afa1; border-radius:50%; background:white; transition:background-color .25s ease, border-color .25s ease; }
.demo-timeline .is-reached i { background:var(--accent-ink); border-color:var(--accent-ink); }
.demo-timeline li[aria-current=step] { font-weight:700; color:var(--accent-ink); }
.demo-repair-tools, .demo-booking { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px; }
.demo-repair-tools { padding-top:13px; border-top:1px solid var(--demo-line); justify-content:space-between; }
.demo-repair-tools label, .demo-lead-label { display:block; font-size:.76rem; font-weight:600; margin-bottom:5px; }
.demo-repair-tools + .demo-feedback { margin-top:12px; }

.demo-rent-stats { display:grid; grid-template-columns:1fr 1fr; padding-bottom:17px; margin-bottom:14px; border-bottom:1px solid var(--demo-line); }
.demo-rent-stats > div { display:grid; gap:4px; }
.demo-rent-stats > div + div { border-left:1px solid var(--demo-line); padding-left:18px; }
.demo-rent-stats span { font-size:.78rem; color:var(--demo-sub); }
.demo-rent-stats strong, .demo-report-total { font-size:clamp(1.65rem,6cqw,2.35rem); line-height:1.12; letter-spacing:-.055em; font-weight:600; }
.demo-surface .demo-ledger { list-style:none; padding:0; margin-top:10px; }
.demo-ledger li { display:flex; align-items:center; gap:10px; min-height:46px; padding-block:7px; }
.demo-ledger li + li { border-top:1px solid var(--demo-line); }
.demo-ledger-id { display:grid; place-items:center; width:31px; height:31px; border-radius:7px; background:#eef0e8; color:#525e4c; font-size:.78rem; }
.demo-ledger strong, .demo-amount { display:block; font-weight:600; font-size:.86rem; line-height:1.3; }
.demo-ledger small { display:block; color:var(--demo-sub); font-size:.72rem; line-height:1.25; margin-top:2px; }
.demo-amount { margin-left:auto; text-align:right; white-space:nowrap; }
.demo-ledger .demo-payment-paid { color:#396345; }
.demo-ledger .demo-payment-due { color:var(--accent-ink); }

.demo-week { margin:15px 0; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:5px; }
.demo-week button { display:grid; justify-items:center; gap:3px; padding:8px 1px; border-radius:8px; border:1px solid var(--demo-line); background:var(--demo-canvas); color:var(--demo-sub); }
.demo-week button span { font-size:.72rem; }
.demo-week button strong { font-size:1.2rem; line-height:1.1; font-weight:600; color:var(--demo-ink); }
.demo-week button[aria-pressed=true] { background:var(--accent-soft); border-color:var(--accent-ink); }
.demo-week button[aria-pressed=true] :is(span,strong) { color:var(--accent-ink); }
.demo-appointment { display:flex; align-items:center; gap:10px; margin-top:16px; }
.demo-appointment > .demo-icon { width:32px; height:32px; padding:7px; border-radius:7px; background:#eff1e9; color:#536149; }
.demo-slots { display:flex; flex-wrap:wrap; gap:6px; margin:12px 0 15px; }
.demo-slots button { font-size:.77rem; color:var(--demo-sub); border:1px solid var(--demo-line); border-radius:6px; background:white; min-height:32px; padding:4px 10px; }
.demo-slots button[aria-pressed=true] { border-color:var(--accent-ink); color:var(--accent-ink); }
.demo-booking { align-items:center; justify-content:space-between; border-top:1px solid var(--demo-line); padding-top:13px; }

.demo-report-total { display:block; margin-top:4px; }
.demo-report-top { display:grid; grid-template-columns:minmax(0,1fr) max-content; align-items:start; }
.demo-bars { display:flex; position:relative; isolation:isolate; margin:20px 0 15px; touch-action:pan-y pinch-zoom; user-select:none; }
.demo-bars::before { content:""; position:absolute; z-index:-2; inset:0 0 20px; border-block:1px dashed #d4d8ce; background:linear-gradient(transparent calc(50% - .5px),#e1e3db 50%,transparent calc(50% + .5px)); }
.demo-bars::after {
  content:""; position:absolute; z-index:-1; pointer-events:none; inset:-5px auto -2px 0;
  width:calc(100% / var(--report-columns, 6)); transform:translateX(calc(100% * var(--report-index, 5)));
  border-radius:6px; background:var(--accent-soft); opacity:0;
  transition:transform .19s cubic-bezier(.2,.75,.2,1), opacity .16s ease;
}
.demo-bars:focus-within::after { opacity:.7; }
@media (hover:hover) { .demo-bars:hover::after { opacity:.7; } }
.demo-bars button { flex:1; min-width:0; padding:0; border:0; color:var(--demo-sub); font-size:.74rem; line-height:20px; background:transparent; transition:color .15s ease; }
.demo-bar-track { display:block; position:relative; height:clamp(76px,20cqw,125px); }
.demo-bar-track i { position:absolute; inset:auto 17% 0; height:var(--bar-height,65%); background:var(--accent-border); border-radius:4px 4px 0 0; transition:height .28s ease,background-color .17s ease; }
.demo-bars button[data-current] { font-weight:700; color:var(--accent-ink); }
.demo-bars button[data-current] i { background:var(--accent-ink); }
.demo-report-total, [data-report-change] { font-variant-numeric:tabular-nums; }
.demo-report-foot { display:flex; align-items:center; justify-content:space-between; gap:6px; padding-top:13px; border-top:1px solid var(--demo-line); }
.demo-report-foot strong { font-size:.9rem; }

.demo-reminder-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.demo-reminder-head p { margin-top:2px; }
.demo-surface .demo-switch { position:relative; width:43px; height:26px; padding:0; border:1px solid #a8aea0; border-radius:100px; background:#bdc5b5; flex:none; }
.demo-switch i { display:block; position:absolute; top:3px; left:3px; height:18px; width:18px; background:white; box-shadow:0 1px 3px #20251c42; border-radius:50%; transition:transform .18s; }
.demo-switch[aria-checked=true] { background:var(--accent-ink); border-color:var(--accent-ink); }
.demo-switch[aria-checked=true] i { transform:translateX(16px); }
.demo-lead-label { margin-top:20px; }
.demo-letter { padding:15px; border:1px solid var(--demo-line); border-radius:10px; margin-top:17px; background:var(--demo-canvas); }
.demo-letter-top { display:flex; align-items:center; gap:6px; margin-bottom:14px; color:var(--demo-ink); }
.demo-letter-top .demo-icon { color:var(--accent-ink); width:16px; height:16px; }
.demo-letter-top strong { font-size:1.08rem; letter-spacing:-.06em; line-height:1; }
.demo-letter-top span { margin-left:auto; color:var(--demo-sub); font-size:.76rem; }
.demo-letter > strong { display:block; margin-bottom:4px; font-size:.94rem; }

@container feature-preview (max-width:430px) {
  .demo-mast { padding-block:11px; }
  .demo-ledger-id { display:none; }
  .demo-repair-intro { gap:10px; }
  .demo-repair-tools { justify-content:start; }
  .demo-rent-stats > div + div { padding-left:11px; }
  .demo-week { gap:3px; }
}
@container feature-preview (max-width:350px) {
  .demo-report-top { grid-template-columns:1fr; justify-items:start; }
}
@media (hover:hover) {
  .demo-surface button[aria-pressed=false]:hover { color:var(--accent-ink); }
  .demo-week button:hover { border-color:var(--accent-ink); }
  .demo-action:hover { filter:brightness(.96); }
}
@media (prefers-reduced-motion:reduce) {
  .feature-scene *, .feature-scene *::after { transition:none !important; animation:none !important; }
}

:root[data-theme="dark"] .feature-scene {
  --demo-ink: var(--ink);
  --demo-sub: var(--muted);
  --demo-line: var(--line);
  --demo-canvas: var(--surface-raised);
  --demo-control-line: #71776a;
}
:root[data-theme="dark"] .demo-surface {
  background: var(--surface);
  border-color: #50564b;
  box-shadow: 0 18px 36px -23px #0009, 0 3px 9px #0003;
}
:root[data-theme="dark"] .demo-segments { background: #1b1e19; }
:root[data-theme="dark"] .demo-segments button[aria-pressed=true] {
  background: var(--accent-soft);
  box-shadow: 0 1px 3px #0004;
}
:root[data-theme="dark"] .demo-segments button:disabled { color: #989c90; background: transparent; box-shadow: none; }
:root[data-theme="dark"] .demo-select select,
:root[data-theme="dark"] .demo-slots button { background: var(--demo-canvas); border-color: var(--demo-control-line); }
:root[data-theme="dark"] .demo-week button[aria-pressed=false] { border-color: var(--demo-control-line); }
:root[data-theme="dark"] .demo-slots button[aria-pressed=true] { border-color: var(--accent-ink); background: var(--accent-soft); }
:root[data-theme="dark"] .demo-floorplan { background: var(--surface); }
/* The transparent furniture and wall drawing switches to light graphite over the live unit controls. */
:root[data-theme="dark"] .plan-linework { filter: grayscale(1) invert(1) contrast(.82) brightness(1.12); }
:root[data-theme="dark"] .plan-street-entry path { stroke: #aab4a4; }
:root[data-theme="dark"] .plan-upper-wall { stroke: #c1c7b9; }
:root[data-theme="dark"] .demo-floorplan button[aria-pressed=false] { background: #2b3029; }
:root[data-theme="dark"] .demo-floorplan button[aria-pressed=false] [data-unit-label] { background: #242820; border-color: #8b9588; color: #e3e9dd; }
:root[data-theme="dark"] :is(.plan-hall,.plan-stairs) { color: #e1e7da; }
:root[data-theme="dark"] .demo-timeline li:not(.is-reached) i { background: var(--surface); border-color: #8d9586; }
:root[data-theme="dark"] :is(.demo-ledger-id, .demo-appointment > .demo-icon) { background: #353b30; color: #ced4c3; }
:root[data-theme="dark"] .demo-ledger .demo-payment-paid { color: #add6a6; }
:root[data-theme="dark"] .demo-bars::before {
  border-color: #50554b;
  background: linear-gradient(transparent calc(50% - .5px), #484e43 50%, transparent calc(50% + .5px));
}
:root[data-theme="dark"] .demo-bars button:not([data-current]) i {
  background: color-mix(in srgb, var(--accent-ink) 58%, var(--surface));
}
:root[data-theme="dark"] .demo-switch[aria-checked=false] { border-color: #888f80; background: #52594c; }
:root[data-theme="dark"] .demo-switch[aria-checked=true] i { background: #191c16; }
@media (hover:hover) {
  :root[data-theme="dark"] .demo-floorplan button[aria-pressed=false]:hover { background: #3d4439; }
  :root[data-theme="dark"] .demo-week button:hover,
  :root[data-theme="dark"] .demo-slots button:hover { border-color: var(--accent-ink); }
}
