/* Pillar Forward — interactive demo simulations (demos page only). */

.demo__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(2rem, 1rem + 3.5vw, 4.5rem);
  align-items: start;
}
.demo__grid--flip > .demo__copy {
  order: 2;
}
@media (max-width: 1020px) {
  .demo__grid {
    grid-template-columns: 1fr;
  }
  .demo__grid--flip > .demo__copy {
    order: 0;
  }
}
.demo__copy {
  position: sticky;
  top: calc(var(--nav-height) + 2rem);
}
@media (max-width: 1020px) {
  .demo__copy { position: static; }
}
.demo__copy .lede {
  margin-top: 1rem;
}
.demo__facts {
  display: grid;
  gap: 0;
  margin: 1.8rem 0 1rem;
  border-top: 1px solid var(--glass-line);
}
.demo__facts > div {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--glass-line);
}
.demo__facts dt {
  font-family: var(--mono-f);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 0.25em;
}
.demo__facts dd {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-2);
}
@media (max-width: 520px) {
  .demo__facts > div { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* --- the app window ---------------------------------------------------- */

.app {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--glass-line-2);
  background: linear-gradient(180deg, #0f2038, #0a1729);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 60px 120px -60px rgba(0, 0, 0, 0.95),
    0 0 0 8px rgba(255, 255, 255, 0.015),
    0 0 80px -30px rgba(var(--accent-rgb), 0.25);
}
.app__bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--glass-line);
}
.app__dots {
  display: inline-flex;
  gap: 6px;
}
.app__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #33496b;
}
.app__dots i:first-child { background: #ff6158; opacity: 0.8; }
.app__dots i:nth-child(2) { background: #f9d48c; opacity: 0.8; }
.app__dots i:nth-child(3) { background: #2ed898; opacity: 0.8; }
.app__title {
  font-family: var(--mono-f);
  font-size: 0.76rem;
  color: var(--text-2);
}
.app__live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono-f);
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}
.app__live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-bright);
}
.app__live.is-running {
  color: var(--accent-light);
}
.app__live.is-running::before {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 1s ease-in-out infinite;
}
.app__live.is-waiting {
  color: #fff;
}
.app__live.is-waiting::before {
  background: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}
.app__live.is-done {
  color: var(--revenue);
}
.app__live.is-done::before {
  background: var(--revenue);
  box-shadow: 0 0 10px var(--revenue);
}
@keyframes pulse {
  50% { opacity: 0.35; }
}
.app__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.9rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--glass-line);
}
.app__label {
  font-family: var(--mono-f);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.app__run {
  margin-left: auto;
}
.app__body {
  padding: 1rem;
  min-height: 460px;
}
.app__section {
  margin-bottom: 0.6rem;
  font-family: var(--mono-f);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.pill {
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--glass-line-2);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--fast);
}
.pill:hover {
  border-color: var(--accent-line);
}
.pill.is-on {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  color: #fff;
}
.pill[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.panel {
  padding: 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-line);
  animation: rise 0.5s var(--ease) both;
}
.panel + .panel {
  margin-top: 0.7rem;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
}

/* --- LeadFlow ------------------------------------------------------------ */

.lf {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
}
@media (max-width: 640px) {
  .lf { grid-template-columns: 1fr; }
}
.formcard {
  padding: 0.85rem;
  border-radius: 12px;
  background: #f4f1ea;
  color: #1b2333;
  font-size: 0.84rem;
  box-shadow: 0 12px 30px -15px rgba(0, 0, 0, 0.8);
}
.formcard__row {
  display: grid;
  grid-template-columns: 4.6rem 1fr;
  gap: 0.4rem;
  padding: 0.18rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.formcard__row span {
  color: #6b7280;
}
.formcard__row b {
  font-weight: 600;
  min-height: 1.2em;
}
.formcard__msg {
  margin-top: 0.5rem;
  min-height: 4.5em;
  line-height: 1.45;
}
.caret::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 1px;
  vertical-align: -0.15em;
  background: currentColor;
  animation: pulse 0.8s steps(1) infinite;
}

.steps {
  display: grid;
  gap: 0.25rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}
.steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.42rem 0.6rem;
  border-radius: 8px;
  font-size: 0.84rem;
  color: var(--dim);
  transition: background var(--fast), color var(--fast);
}
.steps li::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line-bright);
  box-sizing: border-box;
}
.steps li.is-run {
  color: #fff;
  background: rgba(var(--accent-rgb), 0.08);
}
.steps li.is-run::before {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
.steps li.is-done {
  color: var(--text-2);
}
.steps li.is-done::before {
  border: 0;
  background: rgba(var(--revenue-rgb), 0.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.6 2.5L12 5.3' fill='none' stroke='%232ed898' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
}
.steps li.is-skip {
  text-decoration: line-through;
  opacity: 0.6;
}
.steps__human {
  font-weight: 500;
}
.steps li.steps__human.is-wait {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}
.steps li.steps__human.is-wait::before {
  border-color: #fff;
  animation: pulse 1.2s ease-in-out infinite;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.tag {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid var(--accent-line);
  font-size: 0.78rem;
  color: #fff;
  animation: rise 0.35s var(--ease) both;
}
.tag span {
  color: var(--accent-light);
  font-family: var(--mono-f);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 0.1em;
}
.tag--hot {
  background: rgba(255, 97, 88, 0.12);
  border-color: rgba(255, 97, 88, 0.45);
}
.tag--cool {
  background: rgba(120, 150, 200, 0.12);
  border-color: rgba(120, 150, 200, 0.4);
}

.meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.meter__bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-light), var(--revenue));
  background-size: 300px 100%;
  transition: width 1.1s var(--ease);
}
.meter__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 0.5rem;
}
.meter__row b {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: #fff;
}
.meter__row span {
  font-size: 0.82rem;
  color: var(--accent-light);
  text-align: right;
}

.draft {
  min-height: 7.5em;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-line);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
}
.draft[contenteditable="true"] {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
.approve {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.35);
  animation: rise 0.4s var(--ease) both;
}
.approve__who {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-right: auto;
  font-size: 0.82rem;
  color: #fff;
}
.approve__who::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.2s ease-in-out infinite;
}
.approve.is-approved {
  border-style: solid;
  border-color: var(--revenue-line);
  background: var(--revenue-dim);
}

.sheet {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  font-size: 0.78rem;
}
.sheet__row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.6fr 1.1fr;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--glass-line);
  color: var(--text-2);
}
.sheet__row:last-child {
  border-bottom: 0;
}
.sheet__head {
  background: rgba(0, 0, 0, 0.3);
  font-family: var(--mono-f);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.sheet__old {
  opacity: 0.55;
}
.sheet__new {
  color: #fff;
  background: rgba(var(--revenue-rgb), 0.1);
  animation: flashrow 1.6s var(--ease) both;
}
@keyframes flashrow {
  0% { background: rgba(var(--revenue-rgb), 0.45); }
  100% { background: rgba(var(--revenue-rgb), 0.1); }
}

.toast {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin-top: 0.7rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: rgba(244, 241, 234, 0.96);
  color: #1b2333;
  font-size: 0.82rem;
  line-height: 1.45;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.9);
  animation: toast 0.6s var(--ease) both;
}
.toast__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--gold-sheen);
  color: var(--on-accent);
}
.toast b {
  display: block;
  font-size: 0.78rem;
  color: #111827;
}
.toast small {
  color: #6b7280;
}
@keyframes toast {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
}

/* --- DocOps -------------------------------------------------------------- */

.docs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}
@media (max-width: 640px) {
  .docs { grid-template-columns: 1fr; }
}
.doc {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-line);
  overflow: hidden;
  transition: border-color var(--mid);
}
.doc.is-scanning {
  border-color: var(--accent);
}
.doc.is-scanning::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 40px;
  top: -40px;
  background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), 0.35), transparent);
  animation: scan 1.1s linear infinite;
}
@keyframes scan {
  to { top: 100%; }
}
.doc__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.doc__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 36px;
  border-radius: 4px;
  background: #f4f1ea;
  color: #8a6a2e;
  font-family: var(--mono-f);
  font-size: 0.55rem;
  font-weight: 600;
}
.doc__name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
}
.doc__type {
  font-size: 0.7rem;
  color: var(--dim);
}
.fields {
  display: grid;
  gap: 0.05rem;
  margin: 0.7rem 0 0;
  font-size: 0.74rem;
}
.fields > div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.28rem 0;
  border-bottom: 1px dashed var(--glass-line);
  animation: rise 0.35s var(--ease) both;
}
.fields dt {
  color: var(--dim);
}
.fields dd {
  margin: 0;
  color: #fff;
  text-align: right;
}
.fields .is-money {
  color: var(--revenue);
  font-weight: 600;
}
.fields .is-missing dd {
  color: var(--danger);
}
.fields .is-warn dd {
  color: var(--amber);
}
.doc__state {
  margin-top: auto;
  padding-top: 0.6rem;
  font-family: var(--mono-f);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.doc__state.is-flag {
  color: var(--amber);
}
.doc__state.is-ok {
  color: var(--revenue);
}

.docreport {
  margin-top: 0.8rem;
}
.docreport__sum {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.docreport__sum > div {
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--glass-line);
}
.docreport__sum b {
  display: block;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: #fff;
}
.docreport__sum span {
  font-size: 0.72rem;
  color: var(--muted);
}
.actions {
  display: grid;
  gap: 0.35rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}
.actions li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-line);
  font-size: 0.8rem;
  animation: rise 0.4s var(--ease) both;
}
.actions li > span:first-child {
  font-family: var(--mono-f);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 138, 61, 0.15);
  color: var(--amber);
}
.actions li.is-ok > span:first-child {
  background: rgba(var(--revenue-rgb), 0.15);
  color: var(--revenue);
}
.actions li > span:last-child {
  font-family: var(--mono-f);
  font-size: 0.66rem;
  color: var(--dim);
}
.actions li.is-sent > span:last-child {
  color: var(--revenue);
}

/* --- OpsBrief ------------------------------------------------------------ */

.grid-table {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  font-size: 0.74rem;
}
.grid-table__row {
  display: grid;
  grid-template-columns: 0.75fr 1.5fr 1fr 0.5fr 0.8fr 0.9fr 0.9fr;
  gap: 0.4rem;
  padding: 0.42rem 0.6rem;
  border-bottom: 1px solid var(--glass-line);
  color: var(--text-2);
  transition: background 0.4s, color 0.4s;
}
.grid-table__row:last-child {
  border-bottom: 0;
}
.grid-table__row > span:nth-child(n + 4) {
  font-family: var(--mono-f);
  font-size: 0.7rem;
}
.grid-table__head {
  background: rgba(0, 0, 0, 0.3);
  font-family: var(--mono-f);
  font-size: 0.6rem !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.grid-table__head > span {
  font-size: 0.6rem !important;
}
.grid-table__row.is-scan {
  background: rgba(var(--accent-rgb), 0.12);
}
.grid-table__row.is-risk {
  background: rgba(255, 138, 61, 0.1);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--amber);
}
.grid-table__row.is-money {
  background: rgba(var(--revenue-rgb), 0.08);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--revenue);
}
.grid-table__row.is-late {
  background: rgba(255, 97, 88, 0.1);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--danger);
}
@media (max-width: 640px) {
  .grid-table__row {
    grid-template-columns: 0.8fr 1.4fr 1fr 0.9fr;
  }
  .grid-table__row > span:nth-child(4),
  .grid-table__row > span:nth-child(5),
  .grid-table__row > span:nth-child(7) {
    display: none;
  }
}

.mail {
  margin-top: 0.8rem;
  padding: 0;
  overflow: hidden;
  background: #f4f1ea;
  color: #1b2333;
  border: 0;
}
.mail__head {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.78rem;
}
.mail__head span {
  display: inline-block;
  width: 4.2rem;
  color: #6b7280;
}
.mail__head b {
  color: #111827;
}
.mail__body {
  padding: 0.9rem;
  font-size: 0.84rem;
  line-height: 1.55;
}
.mail__body h4 {
  margin: 0.8rem 0 0.35rem;
  font-size: 0.72rem;
  font-family: var(--mono-f);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a6a2e;
  font-weight: 600;
}
.mail__body h4:first-child {
  margin-top: 0;
}
.mail__body ol,
.mail__body ul {
  margin: 0;
  padding-left: 1.2rem;
}
.mail__body li {
  margin: 0.25rem 0;
  animation: rise 0.4s var(--ease) both;
}
.mail__body .money {
  color: #0f8a5f;
  font-weight: 600;
}
.mail__foot {
  margin-top: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.72rem;
  color: #6b7280;
}

@media (max-width: 640px) {
  .app__title { display: none; }
  .app__body { min-height: 0; }
  /* The run button wraps under the pills anyway; give it the full row. */
  .app__run { flex: 1 1 100%; margin-left: 0; }
}
