/* ── Куда хотят (demand.js) ──────────────────────────────────────────────
   Hero = a dusk sky with an airport departures board in it. Fixed colours on
   purpose, like the loyalty hero and the gift cards: the board is an object and
   looks the same in every mood. Cards, bars and chips below run on tokens. */

/* ── Hero ── */
.dm-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px 30px; align-items: center;
  padding: 30px 32px; margin-bottom: 18px; border-radius: var(--r-xl);
  color: #f6efe3;
  background:
    radial-gradient(90% 120% at 0% 100%, rgba(232, 118, 63, 0.55), transparent 58%),
    radial-gradient(70% 90% at 30% 0%, rgba(140, 92, 190, 0.35), transparent 60%),
    linear-gradient(170deg, #2a2f55 0%, #1f2446 55%, #3a2d4a 100%);
  box-shadow: 0 30px 60px -36px rgba(21, 27, 51, 0.8);
}
/* Dotted flight route arcing over the sky, with a plane riding it. */
.dm-hero::before {
  content: ""; position: absolute; z-index: -1; left: -6%; right: 40%; top: 18%; height: 160%;
  border: 2px dashed rgba(255, 220, 190, .22); border-radius: 50%;
  border-bottom-color: transparent; border-left-color: transparent; transform: rotate(-8deg);
}
.dm-hero::after {
  content: "✈"; position: absolute; z-index: -1; top: 12%; left: 46%; font-size: 20px;
  color: rgba(255, 226, 199, .75); transform: rotate(18deg);
  animation: dm-fly 6s ease-in-out infinite;
}
@keyframes dm-fly { 50% { transform: translate(6px, -4px) rotate(14deg); } }

.dm-hero-main { min-width: 0; }
.dm-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: rgba(246, 239, 227, .72); }
.dm-hero-num { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 4px; }
.dm-count {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(44px, 6vw, 72px);
  line-height: 1; letter-spacing: -0.035em; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 30%, #ffc9a0 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dm-hero-unit { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #ffb37a; }
.dm-hero-lead { font-size: 15px; color: rgba(246, 239, 227, .86); }
.dm-hero-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.dm-kpi {
  padding: 12px 14px; border-radius: var(--r-md); min-width: 0;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(6px);
}
.dm-kpi-label { font-size: 12px; color: rgba(246, 239, 227, .65); }
.dm-kpi-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: #fff; }
.dm-kpi-sub { font-size: 11.5px; color: rgba(246, 239, 227, .55); line-height: 1.35; }
.dm-kpi.is-hot { background: rgba(232, 118, 63, .22); border-color: rgba(255, 179, 122, .38); }
.dm-kpi.is-hot .dm-kpi-value { color: #ffc195; }

/* Departures board */
.dm-board {
  min-width: 0; padding: 14px 14px 10px; border-radius: 14px;
  background: linear-gradient(180deg, #17191f, #0f1115);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 40px -24px rgba(0, 0, 0, .8);
}
.dm-board-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px 10px; }
.dm-board-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #ffd166;
}
.dm-board-title svg { width: 18px; height: 18px; fill: #ffd166; transform: rotate(45deg); }
.dm-board-clock { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; color: #ffd166; opacity: .8; letter-spacing: .06em; }
.dm-board-head, .dm-board-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 46px 158px; gap: 10px; align-items: center;
}
.dm-board-head {
  padding: 0 8px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255, 255, 255, .38); border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.dm-board-head span:nth-child(2) { text-align: center; }
.dm-board-row {
  width: 100%; border: none; background: none; cursor: pointer; text-align: left; color: inherit;
  padding: 7px 8px; border-radius: 8px; border-bottom: 1px solid rgba(255, 255, 255, .05);
  transition: background .15s ease;
}
.dm-board-row:last-child { border-bottom: none; }
.dm-board-row:hover { background: rgba(255, 209, 102, .07); }
.dm-board-dest { display: flex; align-items: center; gap: 9px; min-width: 0; }
.dm-board-flag { font-size: 20px; line-height: 1; flex: none; }
/* Split-flap cell: dark tile with the hinge line across the middle. */
.dm-flap {
  display: inline-block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 3px 7px; border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: #f4ecd8;
  background:
    linear-gradient(180deg, transparent calc(50% - .5px), rgba(0, 0, 0, .65) calc(50% - .5px), rgba(0, 0, 0, .65) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(180deg, #2a2d35 0 50%, #22252c 50% 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.dm-flap-num { justify-self: center; text-align: center; min-width: 38px; color: #ffd166; font-size: 15px; }
.dm-bs {
  justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
}
.dm-bs-go { color: #6fe3a6; }
.dm-bs-dates { color: #ffd166; }
.dm-bs-idea { color: #ff9f6e; animation: dm-blink 2.4s steps(1) infinite; }
@keyframes dm-blink { 85% { opacity: .35; } }

/* ── Cards ── */
.dm-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.dm-card { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
.dm-card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dm-card-head h3 { margin: 0; }
.dm-card-sub { font-size: 12.5px; color: var(--subtle); }

/* Ideas */
.dm-ideas { display: grid; gap: 10px; }
.dm-idea {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  width: 100%; padding: 12px 14px; text-align: left; cursor: pointer; color: inherit;
  background: var(--paper-2); border: 1px solid var(--stroke); border-radius: var(--r-lg);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.dm-idea:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); box-shadow: 0 12px 26px -20px rgba(43, 54, 85, .5); }
.dm-idea:first-child { background: linear-gradient(120deg, var(--accent-weak), var(--paper-2) 70%); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.dm-idea-flag {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; line-height: 1;
  background: var(--surface); box-shadow: 0 6px 16px -10px rgba(43, 54, 85, .6), inset 0 0 0 1px var(--stroke);
}
.dm-idea-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dm-idea-name { font-weight: 700; font-size: 15px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-idea-meta { font-size: 12px; color: var(--subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-idea-heat { display: block; height: 5px; border-radius: var(--r-pill); background: var(--elevated); overflow: hidden; max-width: 220px; }
.dm-idea-heat span { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--amber), var(--accent)); }
.dm-idea-num { display: flex; flex-direction: column; align-items: flex-end; text-align: right; line-height: 1.15; }
.dm-idea-num b { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.dm-idea-num small { font-size: 12px; color: var(--subtle); }
.dm-idea-num .dm-fresh { margin-top: 5px; }
.dm-all-good { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-md); background: var(--green-weak); color: var(--ink-2); }
.dm-all-good span { font-size: 28px; }

.dm-fresh {
  display: inline-block; padding: 1px 7px; border-radius: var(--r-pill); white-space: nowrap;
  font-size: 11.5px; font-weight: 700; color: var(--green); background: var(--green-weak);
}

/* Faces */
.dm-faces { display: inline-flex; align-items: center; padding-left: 6px; }
.dm-ava {
  flex: none; width: 26px; height: 26px; margin-left: -6px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--c, var(--accent)); color: #fff; font-weight: 600; font-size: 10.5px; overflow: hidden;
  border: 2px solid var(--surface);
}
.dm-ava img { width: 100%; height: 100%; object-fit: cover; }
.dm-ava-more { background: var(--elevated); color: var(--ink-2); }
.dm-idea .dm-ava { border-color: var(--paper-2); }

/* Regions */
.dm-regions { display: grid; gap: 6px; }
.dm-region {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  width: 100%; padding: 8px 10px; border-radius: var(--r-md); text-align: left; cursor: pointer; color: inherit;
  background: none; border: 1px solid transparent; transition: background .12s ease, border-color .12s ease;
}
.dm-region:hover { background: var(--paper-2); }
.dm-region.on { background: var(--accent-weak); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.dm-region-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: var(--paper-2); }
.dm-region.on .dm-region-icon { background: var(--surface); }
.dm-region-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dm-region-name { font-weight: 600; font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-region-name small { font-weight: 500; font-size: 11.5px; color: var(--subtle); }
.dm-region-bar { display: block; height: 6px; border-radius: var(--r-pill); background: var(--elevated); overflow: hidden; }
.dm-region-bar span { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--blue); }
.dm-region.on .dm-region-bar span { background: var(--accent); }
.dm-region-num { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.dm-region-num b { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--ink); }
.dm-region-num small { font-size: 11px; color: var(--subtle); }

/* ── Ranking ── */
.dm-list-head { align-items: center; }
.dm-list-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.dm-seg {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill);
  background: var(--elevated); max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.dm-seg button {
  border: none; background: none; cursor: pointer; white-space: nowrap;
  padding: 6px 12px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.dm-seg button span { font-size: 11px; opacity: .55; font-variant-numeric: tabular-nums; }
.dm-seg button:hover { color: var(--ink); }
.dm-seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.dm-search { position: relative; display: block; width: 180px; max-width: 100%; }
.dm-search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px;
  fill: none; stroke: var(--subtle); stroke-width: 2; stroke-linecap: round; pointer-events: none;
}
.dm-search input { width: 100%; padding: 7px 12px 7px 32px; border-radius: var(--r-pill); }
.dm-filter-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-weak);
  color: var(--accent-ink); font-size: 12.5px; font-weight: 600;
}

.dm-list { list-style: none; padding: 0; margin: 0; }
.dm-row {
  display: grid; grid-template-columns: 30px 40px minmax(140px, 1.1fr) minmax(140px, 1.3fr) 236px 176px;
  gap: 14px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--divider);
}
.dm-row:last-child { border-bottom: none; }
.dm-row:hover { background: var(--paper-2); }
.dm-rank { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--subtle); text-align: center; font-variant-numeric: tabular-nums; }
.dm-top .dm-rank { color: var(--accent-ink); }
.dm-flag {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; line-height: 1;
  background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--stroke);
}
.dm-top-1 .dm-flag { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-weak); }
.dm-who { display: flex; flex-direction: column; min-width: 0; }
.dm-name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-sub { font-size: 12px; color: var(--subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-bar-wrap { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dm-bar { display: block; height: 8px; border-radius: var(--r-pill); background: var(--elevated); overflow: hidden; }
.dm-bar-fill { display: block; height: 100%; width: var(--w); min-width: 6px; border-radius: inherit; background: linear-gradient(90deg, var(--amber), var(--accent)); }
.dm-bar-val { font-size: 12.5px; color: var(--subtle); white-space: nowrap; }
.dm-bar-val b { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--ink); }
.dm-status { min-width: 0; }
.dm-chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none;
}
a.dm-chip:hover { filter: brightness(.95); text-decoration: underline; }
.dm-go { color: var(--green); background: var(--green-weak); }
.dm-dates { color: var(--amber); background: var(--amber-weak); }
.dm-notour { color: var(--accent-ink); background: var(--accent-weak); }
.dm-people { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.dm-who-btn { white-space: nowrap; }
.dm-more { display: block; margin: 12px auto 0; }
.dm-none { padding: 18px 6px; }

.dm-empty { text-align: center; padding: 60px 20px; background: var(--surface); border: 1px dashed var(--field-border); border-radius: var(--r-xl); }
.dm-empty-art { font-size: 54px; margin-bottom: 8px; }
.dm-empty p { max-width: 52ch; margin: 6px auto 0; }

/* ── «Кто хочет» modal (rendered by app.js) ── */
.wl-row .wl-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wl-row .dm-ava { width: 32px; height: 32px; margin-left: 0; font-size: 12px; border: none; }

/* ── Entrance ── */
.dm-in .dm-board-row { animation: dm-flip .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 70ms + 120ms); transform-origin: 50% 0; }
.dm-in .dm-idea, .dm-in .dm-region { animation: dm-rise .45s ease both; animation-delay: calc(var(--i) * 50ms + 200ms); }
.dm-in .dm-bar-fill, .dm-in .dm-region-bar span, .dm-in .dm-idea-heat span { animation: dm-grow .8s cubic-bezier(.2, .8, .2, 1) both .25s; }
@keyframes dm-flip { from { opacity: 0; transform: perspective(500px) rotateX(-80deg); } }
@keyframes dm-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes dm-grow { from { width: 0; } }
@media (prefers-reduced-motion: reduce) {
  .dm-hero::after, .dm-bs-idea { animation: none; }
}

/* ── Narrow screens ── */
@media (max-width: 1180px) {
  .dm-row { grid-template-columns: 26px 36px minmax(0, 1fr) minmax(120px, 1fr) 76px; }
  .dm-status { grid-column: 3 / -1; grid-row: 2; }
  .dm-row .dm-faces { display: none; }
}
@media (max-width: 1080px) {
  .dm-hero { grid-template-columns: 1fr; }
  .dm-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dm-hero { padding: 22px 16px; }
  .dm-hero-kpis { grid-template-columns: 1fr 1fr; }
  .dm-hero-kpis .dm-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .dm-board { padding: 10px 8px 6px; }
  .dm-board-head, .dm-board-row { grid-template-columns: minmax(0, 1fr) 40px; }
  .dm-board-head span:nth-child(3), .dm-bs { grid-column: 1 / -1; }
  .dm-board-head span:nth-child(3) { display: none; }
  .dm-bs { padding-left: 29px; margin-top: -2px; }
  .dm-card { padding: 16px 12px; }
  .dm-idea { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
  .dm-idea-flag { width: 44px; height: 44px; font-size: 24px; }
  .dm-list-tools { margin-left: 0; width: 100%; }
  .dm-search { width: 100%; }
  .dm-row { grid-template-columns: 22px 34px minmax(0, 1fr) auto; gap: 10px; }
  .dm-flag { width: 34px; height: 34px; font-size: 19px; }
  .dm-bar-wrap { grid-column: 3 / -1; grid-row: 2; }
  .dm-status { grid-column: 3 / -1; grid-row: 3; }
  .dm-people { grid-column: 4; grid-row: 1; }
}
