/* demo.css; include after public.css */
.demo {
  max-width: 860px;
  margin: 0 auto 3.5rem;
  text-align: left;
  position: relative;
}

/* stack framing: panel border + inset like the app */
.demo-frame {
  background: var(--panel2);
  border: 1px solid var(--line);
  box-shadow: 0 0 0 1px var(--inset) inset;
  padding: 10px;
}

/* --- fake window chrome --- */
.demo-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 10px;
}

.demo-dots {
  display: flex;
  gap: 5px;
}

.demo-dots span {
  width: 8px;
  height: 8px;
  border: 1px solid var(--line);
  background: var(--plate);
}

.demo-url {
  flex: 1;
  border: 1px solid var(--line2);
  background: var(--bg);
  color: var(--faint);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  padding: 5px 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- search bar replica --- */
.demo-search {
  display: grid;
  grid-template-columns: 1fr 140px 140px;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 0 0 1px var(--inset) inset;
}

.demo-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 0.72rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
}

.demo-field .caret {
  width: 7px;
  height: 13px;
  background: var(--text);
  flex-shrink: 0;
  animation: demo-caret 1.1s steps(1) infinite;
}

@keyframes demo-caret {
  50% { opacity: 0; }
}

.demo-select {
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  overflow: hidden;
}

.demo-select::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid var(--mid);
  margin-left: auto;
  flex-shrink: 0;
}

/* --- results meta --- */
.demo-results-meta {
  color: var(--dim);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  margin: 8px 2px 8px;
}

.demo-results-meta b { color: var(--meta); font-weight: 500; }

/* --- channel card replica --- */
.demo-channel {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 1rem;
  background: var(--panel2);
  border: 1px solid var(--line);
  padding: 16px 16px 0;
}

.demo-channel + .demo-channel { margin-top: 10px; }
.demo-channel:nth-of-type(even) { background: var(--bg); }

.demo-thumb {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--hover-line);
  background: var(--plate);
  color: var(--value);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  position: relative;
}

.demo-thumb::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dotted var(--dot);
}

.demo-channel-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.demo-channel-top h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.demo-channel-top h3 span { color: var(--dim); font-weight: 400; }

.demo-email {
  border: 1px solid var(--line);
  color: var(--mid);
  font-size: 0.62rem;
  padding: 5px 8px;
}

.demo-desc {
  color: var(--soft);
  font-size: 0.7rem;
  line-height: 1.6;
  margin-top: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.demo-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.demo-tags li {
  border: 1px solid var(--chip-line);
  color: var(--mid);
  padding: 3px 6px;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* --- metrics --- */
.demo-metrics {
  display: flex;
  flex-wrap: wrap;
  margin: 14px 0 12px;
}

.demo-metric {
  min-width: 92px;
  padding-right: 18px;
  margin-right: 18px;
  border-right: 1px solid var(--rule);
}

.demo-metric:last-child { border: 0; }

.demo-metric dt {
  color: var(--faint);
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.demo-metric dd {
  font-size: 0.72rem;
  color: var(--value);
}

/* --- card footer --- */
.demo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px dotted var(--dot);
  padding: 10px 0;
}

.demo-foot-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.demo-socials {
  list-style: none;
  display: flex;
  gap: 5px;
}

.demo-social {
  width: 26px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--chip-line);
  color: var(--mid);
}

.demo-social svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.demo-folder {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--chip-line);
  color: var(--mid);
  padding: 3px 6px;
  font-size: 0.58rem;
  letter-spacing: 0.05em;
}

.demo-folder svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

.demo-add {
  border: 1px solid var(--edge);
  background: var(--plate);
  color: var(--value);
  padding: 6px 11px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* --- fade hint: bottom rows dissolve into the panel --- */
.demo-fade {
  pointer-events: none;
}

.demo-fade .demo-line {
  height: 12px;
  margin: 0 16px;
  border-left: 1px solid var(--rule);
  background:
    repeating-linear-gradient(
      90deg,
      var(--line2) 0 34px, transparent 34px 44px
    );
}

.demo-caption {
  text-align: center;
  color: var(--faint);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  margin-top: 14px;
  text-transform: uppercase;
}

/* --- responsive --- */
@media (max-width: 640px) {
  .demo-search { grid-template-columns: 1fr; }

  .demo-channel {
    grid-template-columns: 56px minmax(0, 1fr);
    padding: 12px 12px 0;
  }

  .demo-thumb { width: 56px; height: 56px; font-size: 0.75rem; }
  .demo-thumb::after { inset: 4px; }

  .demo-metric { min-width: 74px; padding-right: 12px; margin-right: 12px; }
  .demo-foot { flex-direction: column; align-items: flex-start; gap: 8px; }

  .demo-channel-top .demo-email {
    display: none;
  }
}

@media (max-width: 500px) {
  .demo-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 14px;
    margin: 12px 0 10px;
  }

  .demo-metric {
    min-width: 0;
    padding: 8px 0 0;
    margin: 0;
    border: 0;
    border-top: 1px dotted var(--dot);
  }

  .demo-metric dt {
    font-size: 0.52rem;
    margin-bottom: 3px;
  }

  .demo-metric dd {
    font-size: 0.68rem;
  }

  .demo-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .demo-foot-left,
  .demo-socials {
    justify-content: flex-start;
  }

  .demo-add {
    width: 100%;
    text-align: center;
    padding: 9px 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-field .caret { animation: none; }
}
