/* Sections 07-10 of automation 05 (AI Voice Receptionist): #features, #dashboard, #stack and #industries.
   Every rule is scoped under its section id; every class invented here starts with vr-.
   Frames and shared pieces come from features.css, dashboard.css and site.css. */

/* ---------- 07 / Features: every title reserves two lines, so each body starts on the same y ---------- */

#features .features-tile .cell-t {
  min-height: 2.3em;
  max-width: 14ch;
  text-wrap: pretty;
}

#features .features-tile .cell-p {
  text-wrap: pretty;
}

@media (min-width: 1280px) {
  #features .features-tile .cell-t {
    max-width: 20ch;
  }
}

/* ---------- 08 / Dashboard: window body (rail | main) ---------- */

#dashboard .vr-dash-body {
  display: block;
}

@media (min-width: 1280px) {
  #dashboard .vr-dash-body {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
  }
}

#dashboard .vr-dash-main {
  min-width: 0;
}

/* Labels and sub-lines wrap rather than truncate: the cards are narrow at 1280 and 390 */
#dashboard .vr-dash .dashboard-stat-l,
#dashboard .vr-dash .dashboard-stat-s,
#dashboard .vr-dash .dashboard-meta {
  white-space: normal;
  text-overflow: clip;
}

#dashboard .vr-dash .dashboard-stat-l {
  text-wrap: balance;
}

/* The window title may wrap on phones instead of being cut off */
#dashboard .vr-dash .dashboard-bar-title {
  white-space: normal;
  line-height: 1.4;
}

@media (max-width: 639px) {
  #dashboard .vr-dash .dashboard-bar {
    height: auto;
    min-height: 40px;
    padding-block: 10px;
  }
}

/* The footer keeps "Synced from your phone line and calendar" on phones too */
#dashboard .vr-dash .dashboard-foot-sync {
  display: inline;
}

/* The brand mark: the Tallow Creek TC tile (see the greeting's preview for the same look) */
#dashboard .vr-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 28%;
  background: linear-gradient(145deg, #36b3a2, #1c6b61);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #fff;
}

#dashboard .vr-rail .dashboard-rail-brand {
  padding-left: 4px;
}

/* ---------- Two columns under the cards ---------- */

#dashboard .vr-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

#dashboard .vr-block {
  min-width: 0;
}

#dashboard .vr-block + .vr-block {
  border-top: 1px solid var(--line);
}

#dashboard .vr-block .dashboard-toolbar {
  padding-bottom: 16px;
}

@media (min-width: 1024px) {
  #dashboard .vr-columns {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    grid-template-areas:
      "hours rec"
      "log out";
  }

  #dashboard .vr-hours {
    grid-area: hours;
  }

  #dashboard .vr-rec {
    grid-area: rec;
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  #dashboard .vr-log {
    grid-area: log;
  }

  #dashboard .vr-out {
    grid-area: out;
    border-left: 1px solid var(--line);
  }
}

/* Shared body padding under a toolbar */
#dashboard .vr-body {
  display: grid;
  gap: 14px;
  padding: 0 20px 22px;
}

/* ---------- Calls by hour ---------- */

#dashboard .vr-hours-plot {
  display: flex;
  align-items: flex-end;
  height: 150px;
  margin: 0 20px;
  border-bottom: 1px solid var(--line);
}

#dashboard .vr-col {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding: 0 1.5px;
}

#dashboard .vr-col-bar {
  display: block;
  width: 100%;
  height: 0;
  background: hsl(42 30% 94% / 0.22);
  border-radius: 2px 2px 0 0;
  transform-origin: center bottom;
}

#dashboard .vr-col-bar--after {
  background: var(--accent);
}

#dashboard .vr-ticks {
  position: relative;
  height: 14px;
  margin: 8px 20px 0;
}

#dashboard .vr-tick {
  position: absolute;
  top: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ash);
  white-space: nowrap;
}

#dashboard .vr-hours {
  padding-bottom: 20px;
}

#dashboard .vr-hours-sum {
  margin: 14px 20px 0;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ash);
  font-variant-numeric: tabular-nums;
}

/* ---------- Missed-call recovery ---------- */

#dashboard .vr-big {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  color: var(--bone);
}

#dashboard .vr-big--gold {
  font-size: 34px;
  color: var(--accent);
}

#dashboard .vr-label {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--bone-70);
  text-wrap: pretty;
}

#dashboard .vr-split {
  display: flex;
  height: 10px;
  background: var(--line);
}

#dashboard .vr-split-a,
#dashboard .vr-split-b {
  display: block;
  height: 100%;
  min-width: 0;
}

#dashboard .vr-split-a {
  background: var(--bone-50);
}

#dashboard .vr-split-b {
  background: var(--accent);
}

#dashboard .vr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: -4px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ash);
  font-variant-numeric: tabular-nums;
}

#dashboard .vr-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#dashboard .vr-sw {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
}

#dashboard .vr-sw--a {
  background: var(--bone-50);
}

#dashboard .vr-sw--b {
  background: var(--accent);
}

#dashboard .vr-rule {
  height: 1px;
  background: var(--line);
  margin: 2px 0 0;
}

#dashboard .vr-parts {
  margin: -6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ash);
  font-variant-numeric: tabular-nums;
}

/* ---------- Call log: a grid of rows, one line each; two lines on phones ---------- */

#dashboard .vr-log-list {
  padding: 0 20px 20px;
}

#dashboard .vr-calls {
  margin: 0;
  padding: 0;
  list-style: none;
}

#dashboard .vr-log-head,
#dashboard .vr-call {
  display: grid;
  grid-template-columns: 86px minmax(0, 0.9fr) minmax(0, 1.6fr) 112px 44px 26px;
  align-items: center;
  column-gap: 14px;
}

#dashboard .vr-log-head {
  height: 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ash);
  white-space: nowrap;
}

#dashboard .vr-call {
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 0.2s var(--ease-std);
}

#dashboard .vr-call:last-child {
  border-bottom: 0;
}

#dashboard .vr-call:hover {
  background: var(--elev);
}

#dashboard .vr-call-meta {
  display: contents;
}

#dashboard .vr-call-when {
  order: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ash);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#dashboard .vr-call-who {
  order: 2;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--bone);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#dashboard .vr-call-why {
  order: 3;
  min-width: 0;
  font-size: 15px;
  color: var(--bone-70);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#dashboard .vr-call-out {
  order: 4;
  justify-self: start;
}

#dashboard .vr-call-len {
  order: 5;
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ash);
  font-variant-numeric: tabular-nums;
}

#dashboard .vr-call-play {
  order: 6;
}

/* Outcome tag: the same mono chip for every outcome, tone decides the colour */
#dashboard .vr-out-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 7px 3px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ash);
  white-space: nowrap;
}

#dashboard .vr-out-tag--ok {
  border-color: color-mix(in srgb, var(--ok) 55%, transparent);
  color: var(--ok);
}

#dashboard .vr-out-tag--info {
  border-color: color-mix(in srgb, var(--info) 55%, transparent);
  color: var(--info);
}

#dashboard .vr-out-tag--ash {
  border-color: var(--line);
  color: var(--ash);
}

#dashboard .vr-out-tag--danger {
  border-color: color-mix(in srgb, var(--danger) 60%, transparent);
  color: var(--danger);
}

#dashboard .vr-play-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--bone-70);
  cursor: default;
}

#dashboard .vr-play-btn svg {
  width: 9px;
  height: 9px;
  margin-left: 1px;
}

/* Phone: each call is two lines (caller and outcome, then when · reason · length and play) */
@media (max-width: 639px) {
  #dashboard .vr-log-list {
    padding: 0 14px 12px;
  }

  #dashboard .vr-log-head {
    display: none;
  }

  #dashboard .vr-call {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "who out"
      "meta meta";
    row-gap: 6px;
    column-gap: 12px;
    padding: 12px 0;
    position: relative;
  }

  #dashboard .vr-call-who {
    grid-area: who;
    font-size: 16px;
  }

  #dashboard .vr-call-out {
    grid-area: out;
    justify-self: end;
  }

  #dashboard .vr-call-meta {
    display: block;
    grid-area: meta;
    min-width: 0;
    padding-right: 40px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: var(--ash);
    white-space: normal;
    text-wrap: pretty;
  }

  #dashboard .vr-call-when,
  #dashboard .vr-call-why,
  #dashboard .vr-call-len {
    display: inline;
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
  }

  #dashboard .vr-call-why::before,
  #dashboard .vr-call-len::before {
    content: " \00b7  ";
  }

  #dashboard .vr-call-play {
    position: absolute;
    right: 0;
    bottom: 12px;
  }
}

/* ---------- Outcomes: four bars on a track ---------- */

#dashboard .vr-bars {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0 20px 22px;
  list-style: none;
}

#dashboard .vr-bar-row {
  display: grid;
  gap: 8px;
  min-width: 0;
}

#dashboard .vr-bar-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

#dashboard .vr-bar-name {
  min-width: 0;
  font-size: 15px;
  line-height: 1.3;
  color: var(--bone);
}

#dashboard .vr-bar-val {
  flex: none;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--ash);
  font-variant-numeric: tabular-nums;
}

#dashboard .vr-track {
  display: block;
  height: 4px;
  background: var(--line);
}

#dashboard .vr-fill {
  display: block;
  height: 100%;
  width: 0;
  background: hsl(42 30% 94% / 0.22);
  transform-origin: left center;
}

#dashboard .vr-fill--gold {
  background: var(--accent);
}

/* Bars and columns grow once when the window is seen. The finished sizes are set inline by the
   script, so ?static=1 and reduced motion show the finished state and nothing animates back. */
#dashboard .vr-dash--play .vr-col-bar {
  animation: vr-rise 0.8s var(--ease-out) both;
  animation-delay: var(--d, 0s);
}

#dashboard .vr-dash--play .vr-fill {
  animation: vr-grow 0.9s var(--ease-out) both;
  animation-delay: var(--d, 0s);
}

@keyframes vr-rise {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes vr-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* ---------- Phone: the blocks stack, the labels wrap ---------- */

@media (max-width: 639px) {
  #dashboard .vr-hours-plot {
    margin: 0 14px;
    height: 128px;
  }

  #dashboard .vr-ticks {
    margin: 8px 14px 0;
  }

  #dashboard .vr-hours-sum {
    margin: 14px 14px 0;
  }

  #dashboard .vr-body {
    padding: 0 14px 20px;
  }

  #dashboard .vr-bars {
    padding: 0 14px 20px;
  }

  #dashboard .vr-block .dashboard-toolbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  #dashboard .vr-block + .vr-block {
    border-top: 1px solid var(--line);
  }
}

/* ---------- 09 / Stack: seven tools on hairlines ----------
   Each cell draws its own hairlines, so any column count works. 7 across from 1280,
   4 + 3 from 1024, 2 wide from 640 and one wide below that. */

#stack .vr-stack {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#stack .vr-stack > * {
  min-width: 0;
  padding: 28px 22px;
  border-left: 0;
  border-top: 0;
}

#stack .vr-stack .features-glyph {
  margin-bottom: 24px;
}

/* The caption sits 24px under the grid at every width */
#stack .features-caption {
  margin-top: 24px;
}

#stack .vr-tool-text {
  display: grid;
  gap: 8px;
  min-width: 0;
}

/* Names reserve two lines, so every description starts on the same y (long names wrap) */
#stack .vr-tool-text .features-tool-n {
  min-height: 2.4em;
  line-height: 1.2;
  text-wrap: balance;
}

#stack .vr-tool-r {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ash);
  text-wrap: pretty;
}

#stack .vr-stack > *:hover .vr-tool-r {
  color: var(--bone-70);
}

@media (min-width: 1280px) {
  #stack .vr-stack {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  #stack .vr-stack > *:nth-child(n + 2) {
    border-left: 1px solid var(--line);
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  #stack .vr-stack > *:nth-child(4n + 2),
  #stack .vr-stack > *:nth-child(4n + 3),
  #stack .vr-stack > *:nth-child(4n + 4) {
    border-left: 1px solid var(--line);
  }

  #stack .vr-stack > *:nth-child(n + 5) {
    border-top: 1px solid var(--line);
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  #stack .vr-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #stack .vr-stack > *:nth-child(2n) {
    border-left: 1px solid var(--line);
  }

  #stack .vr-stack > *:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 639px) {
  #stack .vr-stack {
    grid-template-columns: minmax(0, 1fr);
  }

  #stack .vr-stack > *:nth-child(n + 2) {
    border-top: 1px solid var(--line);
  }

  /* One tool per row: glyph on the left, name with its line of copy beside it */
  #stack .vr-stack > * {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 0;
  }

  #stack .vr-stack .features-glyph {
    flex: none;
    margin: 2px 0 0;
  }

  #stack .vr-tool-r {
    font-size: 1rem;
  }

  #stack .vr-tool-text .features-tool-n {
    min-height: 0;
  }
}

/* ---------- 10 / Built for: name and one line per row ---------- */

#industries .vr-ind-row {
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  padding: 24px 0;
}

#industries .vr-ind-text {
  display: grid;
  gap: 8px;
  min-width: 0;
}

#industries .vr-ind-row .features-hex {
  margin-top: 8px;
}

#industries .vr-ind-line {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ash);
  text-wrap: pretty;
}

@media (max-width: 767px) {
  #industries .vr-ind-row {
    min-height: 0;
    padding: 20px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #dashboard .vr-dash--play .vr-col-bar,
  #dashboard .vr-dash--play .vr-fill {
    animation: none;
  }
}

/* ---------- Layout fixes at desktop widths (dashboard) ---------- */

@media (min-width: 1024px) {
  /* The recovery panel shares the top row with the chart: no top rule, so it lines up with the cards */
  #dashboard .vr-columns > .vr-rec {
    border-top: 0;
  }

  /* The chart grows to fill its row, so no dead band under its caption */
  #dashboard .vr-hours-plot {
    height: 200px;
  }

  /* Outcomes spread their four bars over the full height of the card */
  #dashboard .vr-out {
    display: flex;
    flex-direction: column;
  }

  #dashboard .vr-out .vr-bars {
    flex: 1 1 auto;
    align-content: center;
    row-gap: 30px;
  }
}

/* The call-row play control keeps its 26px look and gets a 44px hit area */
#dashboard .vr-play-btn::after {
  content: "";
  position: absolute;
  inset: -9px;
}

@media (min-width: 640px) {
  #dashboard .vr-play-btn {
    position: relative;
  }
}

/* ---------- Deliverables: balanced line breaks ---------- */

#deliverables .closing-item-t {
  text-wrap: balance;
}
