/* Idea 90 — variant D «План в цвете»: design tokens (single source for hex). */
:root {
  --d-page: #e7edf2;
  --d-surface: #f3f5f6;
  --d-ink: #0f1e2e;
  --d-ink-2: #33475b;
  --d-muted: #5b6b7c;
  --d-line: #d9e3ec;
  --d-line-soft: #edf2f6;
  --d-card: #fff;
  --d-soft: #f1f4f6;
  --d-primary: #1d4e89;
  --d-accent: #e3b54b;
  --d-ok: #2f8f6b;
  --d-stop: #c2412d;

  --c-kitchen: #d98f6c;
  --c-bath: #9cc3db;
  --c-toilet: #b7d5e6;
  --c-bed: #a9c2b0;
  --c-hall: #e3b54b;
  --c-living: #d5cfc4;
  --c-balcony: #cdb892;
  --c-other: #b9c3cd;
  --c-none: #d9e3ec;
  --room-ink: var(--d-ink);

  --split-2: #d98f6c;
  --meter-fill: var(--d-primary);

  --display: "Wix Madefor Display", system-ui, sans-serif;
  --body: "Onest", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --w-display: 800;
  --w-display2: 700;

  --r-btn: 14px;
  --r-card: 24px;
  --r-input: 14px;

  --shadow-card: 0 1px 0 rgba(15, 30, 46, 0.04), 0 14px 34px -14px rgba(29, 78, 137, 0.24);
  --shadow: var(--shadow-card);
  --btn-shadow: 0 8px 20px -8px rgba(29, 78, 137, 0.7);

  --side-bg: rgba(255, 255, 255, 0.82);
  --nav-on-bg: #e8eef5;
  --nav-on-ink: #1d4e89;

  --chip-bg: #fff;
  --chip-ring: inset 0 0 0 1.5px #d9e3ec;
  --chip-on-bg: #eaf0f7;
  --chip-on-ink: #1d4e89;
  --chip-on-ring: inset 0 0 0 1.5px #1d4e89;

  --input-border: 1.5px solid #d9e3ec;
  --input-bg: #fbfcfe;

  --frame: #0f1e2e;
  --tab-bg: rgba(255, 255, 255, 0.95);
  --tab-r: 24px;
  --tab-ink: #5b6b7c;
  --tab-on: #1d4e89;
  --fab-r: 18px;
  --fab-bg: #1d4e89;
  --fab-ink: #fff;

  --d-focus-ring: 3px solid color-mix(in srgb, var(--d-primary) 45%, transparent);
}

.d-plaster {
  background-color: var(--d-surface);
  background-size: 160px 160px, auto, auto;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(55% 45% at 100% 0%, rgba(217, 143, 108, 0.2), transparent 70%),
    radial-gradient(50% 50% at 0% 100%, rgba(156, 195, 219, 0.32), transparent 70%);
}

.shell-main--app,
.shell-main:not(.shell-main--app),
.auth-stage {
  background-color: var(--d-surface);
  background-size: 160px 160px, auto, auto;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(55% 45% at 100% 0%, rgba(217, 143, 108, 0.2), transparent 70%),
    radial-gradient(50% 50% at 0% 100%, rgba(156, 195, 219, 0.32), transparent 70%);
}

/* Meter line — dimension line with roller smear */
.meter-d {
  position: relative;
  height: 14px;
  overflow: visible;
  background: transparent;
}

.meter-d::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  height: 2px;
  background: var(--d-ink);
  border-radius: 1px;
}

.meter-d::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 2px;
  height: 14px;
  background: var(--d-ink);
}

.meter-d > i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 5px 0 0 5px;
  background: var(--meter-fill);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 14' preserveAspectRatio='none'%3E%3Cpath d='M0 0h392c3 2 6 3 3 5s-3 3 0 5-2 3-3 4H0z'/%3E%3C/svg%3E")
    0 0 / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 14' preserveAspectRatio='none'%3E%3Cpath d='M0 0h392c3 2 6 3 3 5s-3 3 0 5-2 3-3 4H0z'/%3E%3C/svg%3E")
    0 0 / 100% 100% no-repeat;
}

.meter-d--over > i {
  width: 100% !important;
  background: var(--d-stop);
}

/* Room card fill wave */
.room-d .fill::after {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 6q50-8 100 0t100 0V40H0z'/%3E%3C/svg%3E")
    top / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 6q50-8 100 0t100 0V40H0z'/%3E%3C/svg%3E")
    top / 100% 100% no-repeat;
}

.side-d .side-proj {
  position: relative;
  overflow: hidden;
  padding-bottom: 18px;
}

.side-d .side-proj::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    #d98f6c 0 20%,
    #9cc3db 20% 40%,
    #a9c2b0 40% 60%,
    #e3b54b 60% 80%,
    #d5cfc4 80%
  );
}

/* Landing (01-landing) */
.landing-d {
  min-height: 100vh;
  background-color: var(--d-surface);
  background-size: 160px 160px, auto, auto;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(55% 45% at 100% 0%, rgba(217, 143, 108, 0.2), transparent 70%),
    radial-gradient(50% 50% at 0% 100%, rgba(156, 195, 219, 0.32), transparent 70%);
}

.l-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  gap: 16px;
  flex-wrap: wrap;
}

.l-nav nav {
  display: flex;
  gap: 28px;
  font-size: 15px;
  color: var(--d-muted);
}

.l-nav nav a {
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
}

.l-nav nav a:focus-visible {
  outline: var(--d-focus-ring);
  outline-offset: 3px;
}

.l-nav nav a[aria-current="page"] {
  color: var(--d-ink);
  font-weight: 600;
}

.l-hero {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 40px;
  padding: 36px 40px 52px;
  align-items: center;
}

.eyebrow {
  font: 500 13px var(--font-mono);
  color: var(--d-primary);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--d-primary);
  border-radius: 2px;
}

.l-hero h1 {
  font: 800 62px/1 var(--font-display);
  letter-spacing: -0.045em;
  margin: 0 0 22px;
}

.l-hero h1 span {
  background: linear-gradient(
    transparent 62%,
    color-mix(in srgb, var(--d-accent) 60%, transparent) 62% 92%,
    transparent 92%
  );
  padding: 0 4px;
  margin: 0 -4px;
}

.l-hero .lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--d-ink-2);
  max-width: 46ch;
  margin: 0 0 30px;
}

.l-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.l-note {
  margin: 26px 0 0;
  font-size: 14px;
  color: var(--d-muted);
}

.fan {
  position: relative;
  height: 440px;
}

.chipcard {
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 160px;
  height: 340px;
  margin-left: -80px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 40px -18px rgba(15, 30, 46, 0.38);
  transform-origin: 50% 92%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Prerender paints the fan first, then the circuit renders it again.
   The animation lives only on the interactive pass, so a refresh plays it once. */
.fan.is-ready .chipcard {
  animation: fan 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.fan.is-ready .chipcard:nth-child(1) { animation-delay: 0.05s; }
.fan.is-ready .chipcard:nth-child(2) { animation-delay: 0.1s; }
.fan.is-ready .chipcard:nth-child(3) { animation-delay: 0.15s; }
.fan.is-ready .chipcard:nth-child(4) { animation-delay: 0.2s; }
.fan.is-ready .chipcard:nth-child(5) { animation-delay: 0.25s; }

.landing-d .fan:not(.is-ready):not(.is-settled) .chipcard {
  opacity: 0;
}

.chipcard .c {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--d-ink);
}

.chipcard .c b {
  font: 700 19px var(--font-display);
  letter-spacing: -0.02em;
}

.chipcard .c small {
  font: 400 10px var(--font-mono);
  opacity: 0.8;
}

.chipcard .c em {
  font: 500 12px var(--font-mono);
  font-style: normal;
  margin-top: auto;
}

.chipcard:not(:last-child) .c em {
  display: none;
}

.chipcard .m {
  display: none;
}

.chipcard:last-child .m {
  display: block;
  padding: 12px 14px 14px;
  background: #fff;
}

.chipcard .m svg {
  display: block;
  width: 100%;
  height: auto;
}

.chipcard .m span {
  display: block;
  font: 500 10px var(--font-mono);
  color: var(--d-muted);
  margin-top: 6px;
}

.landing-d .logo-d .logo-d__icon {
  flex: none;
}

.l-nav nav a {
  cursor: pointer;
}

.landing-d .l-nav-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.landing-d .btn {
  font: 600 15px var(--font-body);
  border: 0;
  border-radius: var(--r-btn);
  padding: 13px 20px;
  min-height: auto;
  letter-spacing: normal;
  font-weight: 600;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.landing-d .btn-sm {
  padding: 9px 14px;
  font-size: 14px;
}

.landing-d .btn-primary {
  background: var(--d-primary);
  color: #fff;
  box-shadow: var(--btn-shadow);
}

.landing-d .btn-primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--d-primary) 92%, #000);
  color: #fff;
  transform: none;
}

.landing-d .btn-quiet {
  background: var(--d-card);
  color: var(--d-ink);
  box-shadow: inset 0 0 0 1.5px var(--d-line);
}

.landing-d .btn-quiet:hover:not(:disabled) {
  background: var(--d-card);
  color: var(--d-ink);
  border-color: transparent;
  transform: none;
}

.landing-d .btn:focus-visible {
  outline: var(--d-focus-ring);
  outline-offset: 2px;
  box-shadow: var(--btn-shadow);
}

@keyframes fan {
  from {
    transform: rotate(0);
  }
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 0 40px 40px;
}

.step {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  padding: 18px;
  box-shadow: inset 0 0 0 1px var(--d-line);
  position: relative;
  overflow: hidden;
}

.step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--c);
}

.step small {
  font: 500 12px var(--font-mono);
  color: var(--d-primary);
}

.step h3 {
  font: 700 18px var(--font-display);
  margin: 6px 0 4px;
}

.step p {
  margin: 0;
  font-size: 14px;
  color: var(--d-muted);
  line-height: 1.45;
}

.public-sheet {
  padding: 8px 40px 56px;
  max-width: 1080px;
}

.public-sheet h1 {
  font: 800 48px/1.05 var(--font-display);
  letter-spacing: -0.04em;
  margin: 0 0 16px;
}

.public-sheet .lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--d-ink-2);
  max-width: 62ch;
  margin: 0 0 28px;
}

.public-sheet .steps {
  padding: 0 0 22px;
}

.public-example h3 {
  margin-bottom: 8px;
}

.public-example p {
  margin: 0;
  color: var(--d-ink-2);
  line-height: 1.5;
}

.public-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.public-region {
  max-width: 320px;
}

.public-empty {
  align-items: flex-start;
  text-align: left;
  background: var(--d-card);
}

.public-empty p {
  margin: 0;
  max-width: 42ch;
}

.sample-total {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 8px;
}

.sample-total-num {
  font: 800 64px/0.95 var(--font-display);
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.sample-total-unit {
  font: 500 16px var(--font-mono);
  color: var(--d-muted);
}

.sample-split {
  margin: 0 0 8px;
  color: var(--d-ink-2);
  font-size: 15px;
}

.sample-heading {
  font: 700 22px/1.2 var(--font-display);
  letter-spacing: -0.03em;
  margin: 28px 0 14px;
}

.sample-rooms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sample-room {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
  align-items: baseline;
}

.sample-room-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 16px var(--font-display);
}

.sample-room-area {
  font: 500 14px var(--font-mono);
  color: var(--d-ink-2);
  font-variant-numeric: tabular-nums;
}

.sample-room-bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: var(--d-line-soft);
}

.sample-room-bar i {
  display: block;
  height: 100%;
  width: calc(var(--share) * 100%);
  max-width: 100%;
  border-radius: inherit;
  background: var(--c);
}

.sample-groups {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sample-group-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin: 0;
  font: 700 18px/1.3 var(--font-display);
}

.sample-group-head b {
  font: 500 14px var(--font-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sample-lines {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.sample-lines li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 16px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--d-line-soft);
  font-size: 14px;
}

.sample-line-qty,
.sample-line-sum {
  font: 500 13px var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sample-line-sum {
  color: var(--d-ink);
}

.sample-reserve {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--d-line);
  font: 600 16px var(--font-display);
}

.sample-reserve b {
  font: 500 14px var(--font-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.sample-foot {
  margin-top: 28px;
  color: var(--d-ink-2);
}

.sample-foot p {
  margin: 0 0 14px;
  max-width: 62ch;
}

.rate-card {
  padding: 8px 8px 4px;
}

.rate-scroll {
  overflow-x: auto;
}

.rate-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.rate-table caption {
  caption-side: top;
  text-align: left;
  padding: 12px 14px 8px;
  font: 500 13px var(--font-mono);
  color: var(--d-primary);
}

.rate-table th,
.rate-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--d-line-soft);
  text-align: left;
  vertical-align: baseline;
}

.rate-table thead th {
  font: 500 12px var(--font-mono);
  color: var(--d-muted);
  letter-spacing: 0.02em;
}

.rate-table tbody th {
  font: 500 15px var(--font-body);
  font-weight: 500;
}

.rate-table .num {
  text-align: right;
  font: 500 14px var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rate-table tbody tr:last-child th,
.rate-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 900px) {
  .l-hero,
  .steps {
    grid-template-columns: 1fr;
  }

  .l-hero h1 {
    font-size: 44px;
  }

  .l-nav nav {
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: 14px 22px;
  }

  .public-sheet {
    padding: 4px 20px 40px;
  }

  .public-sheet h1 {
    font-size: 36px;
  }

  .sample-total-num {
    font-size: 44px;
  }

  .sample-lines li {
    grid-template-columns: 1fr auto;
  }

  .sample-line-title {
    grid-column: 1 / -1;
  }

  .fan {
    height: 320px;
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chipcard,
  .fan.is-ready .chipcard {
    animation: none;
  }

  .landing-d .fan:not(.is-ready):not(.is-settled) .chipcard {
    opacity: 1;
  }
}

@media (scripting: none) {
  .landing-d .fan:not(.is-ready):not(.is-settled) .chipcard {
    opacity: 1;
  }
}
