/* Generated chart, report, K-line, and history presentation. */

.lz-result-page,
.lz-report-page,
.lz-history-page {
  width: min(100%, 1240px);
  margin-inline: auto;
  padding: clamp(16px, 2.8vw, 36px);
  color: var(--lz-ink, #35443b);
}

.lz-result-heading,
.lz-history-heading {
  position: relative;
  overflow: hidden;
  margin: 0 0 clamp(18px, 2.5vw, 30px);
  padding: clamp(22px, 3.6vw, 42px);
  border: 1px solid rgba(105, 126, 111, 0.13);
  border-radius: var(--lz-radius-xl, 30px);
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.78) 0 2%, transparent 18%),
    linear-gradient(128deg, rgba(207, 224, 199, 0.92), rgba(255, 246, 229, 0.95) 55%, rgba(231, 216, 245, 0.7));
  box-shadow: 0 18px 52px rgba(73, 89, 78, 0.09);
  text-align: left;
}

.lz-result-heading::after,
.lz-history-heading::after {
  position: absolute;
  right: clamp(22px, 6vw, 86px);
  bottom: -54px;
  width: clamp(100px, 15vw, 180px);
  aspect-ratio: 1;
  border: 1px solid rgba(121, 98, 172, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(255, 255, 255, 0.16), 0 0 0 48px rgba(121, 98, 172, 0.06);
  content: "";
  pointer-events: none;
}

.lz-result-heading h1,
.lz-history-heading h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  color: var(--lz-sage-900, #2f3d35);
  font-size: clamp(1.65rem, 3.2vw, 2.65rem);
  font-weight: 760;
  line-height: 1.2;
}

.lz-result-heading p,
.lz-history-heading p {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0;
  color: #69766f;
  line-height: 1.7;
}

.lz-history-heading .lz-form-eyebrow { margin-bottom: 12px; }

.lz-result-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  align-items: start;
  gap: 16px;
}

.lz-result-card,
.lz-result-markdown,
.lz-result-note,
.lz-history-record,
.lz-history-card {
  border: 1px solid rgba(99, 116, 104, 0.13);
  border-radius: var(--lz-radius-lg, 22px);
  background: rgba(255, 252, 244, 0.9);
  box-shadow: 0 14px 42px rgba(74, 89, 79, 0.08);
}

.lz-result-card {
  min-width: 0;
  padding: clamp(18px, 2.4vw, 26px) !important;
}

.lz-result-page .section-head,
.lz-report-page .section-head,
.lz-history-page .section-head {
  gap: 12px;
  margin-bottom: 15px;
}

.lz-result-page .section-title,
.lz-report-page .section-title,
.lz-history-page .section-title {
  color: #36463d;
  font-size: clamp(1.06rem, 1.8vw, 1.3rem);
  font-weight: 750;
}

.lz-result-page .data-grid,
.lz-report-page .data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lz-result-page .data-row,
.lz-report-page .data-row {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(95, 112, 100, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
}

.lz-result-page .data-row > span,
.lz-report-page .data-row > span {
  color: #818b85;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
}

.lz-result-page .data-row strong,
.lz-report-page .data-row strong {
  overflow-wrap: anywhere;
  color: #37483f;
  font-size: 0.91rem;
  line-height: 1.55;
}

.lz-result-upgrade {
  background:
    radial-gradient(circle at 100% 0, rgba(215, 198, 245, 0.38), transparent 38%),
    rgba(255, 251, 241, 0.94);
}

.lz-result-upgrade__form { gap: 10px; }

.lz-result-upgrade__form .lz-field__control {
  width: 100%;
  min-height: 92px;
  border: 1px solid rgba(100, 113, 104, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  resize: vertical;
}

.lz-result-upgrade__form .lz-field__control:focus-visible {
  border-color: #7963ad;
  box-shadow: 0 0 0 3px rgba(121, 99, 173, 0.14);
  outline: none;
}

.lz-result-note {
  margin-top: 14px;
  padding: 15px 18px !important;
  background: linear-gradient(135deg, rgba(233, 240, 225, 0.9), rgba(255, 247, 233, 0.92));
  line-height: 1.7;
}

.lz-result-note > strong { color: #6b5a91 !important; }

.lz-result-section,
.lz-report-section {
  margin-top: clamp(18px, 2.8vw, 30px);
}

.lz-result-markdown {
  min-width: 0;
  padding: clamp(18px, 2.7vw, 30px) !important;
  color: #3d4c44;
  line-height: 1.86;
}

.lz-result-markdown h1,
.lz-result-markdown h2,
.lz-result-markdown h3,
.lz-result-markdown h4 {
  margin: 1.5em 0 0.65em;
  color: #34453c;
  line-height: 1.4;
}

.lz-result-markdown h1:first-child,
.lz-result-markdown h2:first-child,
.lz-result-markdown h3:first-child { margin-top: 0; }

.lz-result-markdown p { margin: 0.75em 0; }

.lz-result-markdown blockquote {
  margin: 1.2em 0;
  padding: 12px 16px;
  border-left: 3px solid #8e78c5;
  border-radius: 0 12px 12px 0;
  background: rgba(237, 232, 249, 0.58);
  color: #5d5865;
}

.lz-result-markdown table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.lz-result-markdown th,
.lz-result-markdown td {
  padding: 9px 12px;
  border: 1px solid rgba(90, 108, 96, 0.15);
  text-align: left;
}

.lz-result-markdown img { max-width: 100%; height: auto; border-radius: 14px; }
.lz-prewrap { margin-top: 10px; white-space: pre-wrap; }

.lz-result-login-actions {
  justify-content: center;
  margin-block: 20px 4px;
}

.lz-result-actions-card .cosmic-actions,
.lz-result-page .cosmic-actions,
.lz-report-page .cosmic-actions {
  gap: 10px;
}

.lz-kline-card {
  min-height: 390px;
  overflow: hidden;
  padding: 0 !important;
}

.lz-kline-card .kline-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: rgba(119, 98, 167, 0.42) transparent;
}

.lz-kline-card .kline-scroll:focus-visible {
  border-radius: inherit;
  box-shadow: inset 0 0 0 3px rgba(119, 98, 167, 0.25);
  outline: none;
}

.lz-kline-card svg { display: block; }
.lz-kline-card .kline-hit { fill: transparent !important; stroke: none !important; }

.lz-kline-card g[tabindex] { cursor: pointer; outline: none; }
.lz-kline-card g[tabindex]:focus .kline-body,
.lz-kline-card g[tabindex].active .kline-body {
  filter: drop-shadow(0 0 5px rgba(103, 80, 159, 0.7));
  stroke: #574181;
  stroke-width: 2px;
}

.kline-section-head {
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.kline-legend-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.kline-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(64, 58, 82, 0.72);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.kline-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(73, 57, 118, 0.12);
}

.kline-legend-swatch.red { background: rgba(223, 77, 77, 0.78); }
.kline-legend-swatch.green { background: rgba(48, 152, 104, 0.78); }

.ziwei-side-card {
  align-self: stretch;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.ziwei-side-copy { margin: 0; line-height: 1.9; }
.ziwei-side-actions { display: grid; gap: 10px; }

.lz-report-heading {
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.78) 0 3%, transparent 20%),
    linear-gradient(128deg, rgba(222, 231, 214, 0.92), rgba(255, 246, 229, 0.96) 58%, rgba(240, 213, 197, 0.62));
}

.lz-report-markdown { background: rgba(255, 254, 250, 0.94); }

.lz-history-page { max-width: 1100px; }

.lz-history-section { margin-top: 0 !important; }

.lz-history-list {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.lz-history-list--jobs { margin-bottom: 20px !important; }

.lz-history-record {
  min-width: 0;
  padding: 17px !important;
  cursor: default;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.clickable-record.lz-history-record { cursor: pointer; }

.clickable-record.lz-history-record:hover,
.clickable-record.lz-history-record:focus-visible,
.lz-history-card:hover,
.lz-history-card:focus-visible {
  border-color: rgba(116, 94, 166, 0.3);
  box-shadow: 0 18px 46px rgba(70, 86, 75, 0.13);
  outline: none;
  transform: translateY(-1px);
}

.history-scope,
.lz-history-scope {
  position: relative;
  max-height: 430px;
  overflow: hidden;
  margin-bottom: 18px;
}

.history-scope.expanded,
.lz-history-scope.expanded {
  max-height: none;
  overflow: visible;
}

.history-scope::after,
.lz-history-scope::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 58px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(248, 247, 240, 0.98));
  content: "";
  pointer-events: none;
}

.history-scope.expanded::after,
.lz-history-scope.expanded::after { display: none; }

.history-row-compact .list-row-main,
.history-row-compact .list-row-main strong,
.history-row-compact .list-row-main span { min-width: 0; }

.history-row-compact .list-row-main strong,
.history-row-compact .list-row-main span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-toggle {
  width: 100%;
  justify-content: center;
  margin: -4px 0 18px;
}

.history-type-line {
  display: flex !important;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  white-space: normal !important;
}

.lz-history-upgrade-form { width: 100%; }

.lz-history-upgrade-form textarea {
  min-height: 78px;
  border-radius: 13px;
  resize: vertical;
}

.lz-history-empty {
  padding: clamp(30px, 6vw, 68px);
  border: 1px dashed rgba(104, 121, 109, 0.24);
  border-radius: 22px;
  background: rgba(255, 252, 244, 0.72);
}

.lz-history-page--legacy,
.lz-history-page--compact { max-width: 780px; }

.lz-history-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 92px;
  padding: 16px 18px;
  color: #405048;
  text-decoration: none;
  transition: 160ms ease;
}

.lz-history-card:hover { color: #624d92; text-decoration: none; }

.lz-history-card__copy,
.lz-history-card__copy strong,
.lz-history-card__copy small { display: block; min-width: 0; }
.lz-history-card__copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lz-history-card__copy small { margin-top: 4px; color: #7a857e; }
.lz-history-card__action { color: #745fa5; font-size: 0.84rem; font-weight: 700; white-space: nowrap; }

.lz-history-card--stacked {
  display: flex;
  min-height: 130px;
  flex-direction: column;
  align-items: stretch;
}

.lz-history-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lz-history-card__top time { color: #818a85; font-size: 0.78rem; }

.lz-history-card__snippet {
  display: -webkit-box;
  overflow: hidden;
  color: #69766f;
  font-size: 0.86rem;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lz-history-card--stacked .lz-history-card__action { align-self: flex-end; margin-top: auto; }

@media (max-width: 840px) {
  .lz-result-page,
  .lz-report-page,
  .lz-history-page { padding: 14px 12px 104px; }

  .lz-result-overview { grid-template-columns: 1fr; }

  .lz-result-page .data-grid,
  .lz-report-page .data-grid { grid-template-columns: 1fr 1fr; }

  .lz-result-heading,
  .lz-history-heading { border-radius: 22px; }
}

@media (max-width: 560px) {
  .lz-result-page,
  .lz-report-page,
  .lz-history-page { padding-inline: 8px; }

  .lz-result-heading,
  .lz-history-heading { padding: 22px 18px; }

  .lz-result-heading::after,
  .lz-history-heading::after { right: -28px; opacity: 0.7; }

  .lz-result-page .data-grid,
  .lz-report-page .data-grid { grid-template-columns: 1fr; }

  .lz-result-card,
  .lz-result-markdown { padding: 16px !important; border-radius: 18px; }

  .kline-legend-wrap {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .lz-result-login-actions { display: grid; grid-template-columns: 1fr; }

  .lz-history-record .list-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .lz-history-record .list-row-tail {
    grid-column: 2;
    justify-self: start;
  }

  .lz-history-record .cosmic-actions { display: grid; grid-template-columns: 1fr; }
  .lz-history-record .cosmic-actions .cosmic-btn { width: 100%; justify-content: center; }

  .lz-history-card { grid-template-columns: 40px minmax(0, 1fr); padding: 14px; }
  .lz-history-card > .lz-history-card__action { grid-column: 2; justify-self: start; }
  .lz-history-card--stacked { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .lz-history-record,
  .lz-history-card { transition: none; }

  .clickable-record.lz-history-record:hover,
  .lz-history-card:hover { transform: none; }
}

@media print {
  .lz-report-page {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #111 !important;
  }

  .lz-report-page .lz-result-heading,
  .lz-report-page .lz-result-card,
  .lz-report-page .lz-result-note,
  .lz-report-page .lz-result-markdown {
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #111 !important;
  }

  .lz-report-page .report-actions,
  .lz-report-page .recommended-print-hidden { display: none !important; }
}
