:root {
  --crystal-bg: #050d24;
  --crystal-deep: #08183b;
  --crystal-panel: #0a1d40;
  --crystal-blue: #0063ff;
  --crystal-blue-bright: #008cff;
  --crystal-cyan: #00dfff;
  --crystal-cyan-soft: #69e3ff;
  --crystal-magenta: #e000ab;
  --crystal-text: #f4f9ff;
  --crystal-muted: #91a9cc;
  --crystal-line: rgba(105, 227, 255, .24);
}

html:has(body.crystal-preview) {
  min-width: 320px;
  background: var(--crystal-bg);
  scrollbar-color: #176bb1 #050d24;
}

body.crystal-preview {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--crystal-text);
  background: var(--crystal-bg);
}

body.crystal-preview::before { display: none; }
.crystal-preview main { min-height: 100vh; }

.crystal-preview .query-experience {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  color: var(--crystal-text);
  background:
    radial-gradient(circle at 50% 43%, rgba(14, 48, 105, .38), transparent 48%),
    linear-gradient(180deg, #03091b, #050d24 46%, #030a1c);
}

.crystal-preview .crystal-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.crystal-preview .crystal-backdrop::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(2, 8, 25, .05), transparent 22% 78%, rgba(2, 8, 25, .04)),
    radial-gradient(ellipse at center, transparent 28%, rgba(2, 7, 21, .12) 72%, rgba(2, 7, 21, .34));
}

.crystal-preview .crystal-backdrop img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.crystal-preview .query-motion { display: none; }

.crystal-preview .query-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(370px, 1fr);
  grid-template-rows: 74px 76px minmax(420px, 1fr);
  gap: 16px 24px;
  width: min(1460px, calc(100% - 72px));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 0 26px;
}

/* Summit masthead */
.crystal-preview .topbar {
  position: relative;
  isolation: isolate;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;
  min-height: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(5, 13, 36, .55), rgba(5, 13, 36, .23) 67%, rgba(5, 13, 36, .04));
  -webkit-backdrop-filter: blur(5px) saturate(1.08);
  backdrop-filter: blur(5px) saturate(1.08);
  box-shadow: none;
}

.crystal-preview .topbar::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: url("header-crystals.svg") center / 100% 100% no-repeat;
  pointer-events: none;
}

.crystal-preview .topbar::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(38, 140, 207, .12) 17%, rgba(105, 227, 255, .35) 50%, rgba(38, 140, 207, .12) 83%, transparent);
  box-shadow: 0 2px 9px rgba(0, 223, 255, .1);
  pointer-events: none;
}

.crystal-preview .summit-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  color: #fff;
  white-space: nowrap;
}

.crystal-preview .summit-title strong {
  font-size: clamp(16px, 1.35vw, 21px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: .035em;
  text-shadow: 0 0 18px rgba(0, 140, 255, .28);
}

.crystal-preview .summit-title small {
  color: #9eb9dc;
  font-size: clamp(7px, .64vw, 10px);
  font-weight: 650;
  letter-spacing: .16em;
}

.crystal-preview .site-name {
  justify-self: end;
  color: #fff;
  font-size: clamp(15px, 1.38vw, 21px);
  font-weight: 750;
  letter-spacing: .03em;
  text-align: center;
  white-space: nowrap;
}

.crystal-preview .brand-label {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  gap: 3px;
  text-align: center;
  transform: translate(-50%, -50%);
}

.crystal-preview .event-name {
  color: #a9c7e8;
  font-size: clamp(10px, .85vw, 13px);
  font-weight: 600;
  letter-spacing: .035em;
  line-height: 1.2;
}

.crystal-preview .site-pi {
  margin: 0 .08em;
  color: var(--crystal-cyan-soft);
  text-shadow: 0 0 14px rgba(0, 223, 255, .55);
}

.crystal-preview .topbar-right {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 18px;
  min-width: 0;
}

.crystal-preview .history-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid rgba(105, 227, 255, .34);
  border-radius: 8px;
  color: #d8f3ff;
  background: rgba(7, 35, 77, .74);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition: background .2s, border-color .2s;
}

.crystal-preview .history-trigger:hover,
.crystal-preview .history-trigger:focus-visible {
  border-color: rgba(105, 227, 255, .8);
  background: rgba(13, 69, 135, .88);
}

.crystal-preview .history-trigger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.crystal-preview .history-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(1, 6, 19, .7);
  backdrop-filter: blur(4px);
}

.crystal-preview .history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  display: flex;
  flex-direction: column;
  width: min(480px, 100vw);
  padding: 28px 26px;
  border-left: 1px solid rgba(105, 227, 255, .3);
  color: #f4f9ff;
  background: linear-gradient(145deg, #0d2854, #071831 55%, #06132b);
  box-shadow: -24px 0 70px rgba(0, 2, 12, .55), inset 1px 0 rgba(105, 227, 255, .08);
}

.crystal-preview .history-header,
.crystal-preview .history-item-meta,
.crystal-preview .history-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crystal-preview .history-header small {
  color: #69e3ff;
  font-size: 10px;
  letter-spacing: .13em;
}

.crystal-preview .history-header h2 { margin: 5px 0 0; font-size: 23px; }
.crystal-preview .history-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(105, 227, 255, .24);
  border-radius: 9px;
  color: #d8efff;
  background: rgba(13, 48, 95, .6);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.crystal-preview .history-intro { margin: 12px 0 20px; color: #a9c3e2; font-size: 13px; }
.crystal-preview .history-filters { display: flex; gap: 7px; margin-bottom: 17px; }
.crystal-preview .history-filter {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(105, 227, 255, .18);
  border-radius: 8px;
  color: #a9c5e4;
  background: rgba(5, 23, 53, .65);
  cursor: pointer;
  font-size: 12px;
}
.crystal-preview .history-filter.is-active {
  border-color: rgba(105, 227, 255, .65);
  color: #fff;
  background: rgba(0, 99, 255, .43);
}
.crystal-preview .history-list { flex: 1; min-height: 0; overflow-y: auto; padding-right: 3px; }
.crystal-preview .history-message { padding: 26px 8px; color: #a9c3e2; font-size: 13px; line-height: 1.7; }
.crystal-preview .history-item {
  margin-bottom: 10px;
  padding: 15px;
  border: 1px solid rgba(105, 227, 255, .18);
  border-radius: 12px;
  background: linear-gradient(130deg, rgba(16, 54, 105, .76), rgba(7, 27, 61, .8));
  box-shadow: inset 0 1px rgba(150, 217, 255, .07);
}
.crystal-preview .history-item-meta { color: #9cbbdf; font-size: 11px; }
.crystal-preview .history-item-meta span { color: #72d9fb; font-weight: 700; }
.crystal-preview .history-item-query {
  display: -webkit-box;
  overflow: hidden;
  margin: 12px 0;
  color: #ebf5ff;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.crystal-preview .history-state { color: #a9c3e2; font-size: 11px; }
.crystal-preview .history-state-completed { color: #6eebd4; }
.crystal-preview .history-state-running,
.crystal-preview .history-state-queued { color: #76cfff; }
.crystal-preview .history-state-failed { color: #ffb3b9; }
.crystal-preview .history-item-action {
  padding: 4px 0;
  border: 0;
  color: #76deff;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.crystal-preview .history-item-action:hover { color: #fff; text-decoration: underline; }
.crystal-preview .history-more {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(105, 227, 255, .3);
  border-radius: 8px;
  color: #cceeff;
  background: rgba(7, 39, 85, .8);
  cursor: pointer;
}
.crystal-preview .history-more:hover { background: rgba(0, 99, 255, .35); }
.crystal-preview .history-drawer [hidden],
.crystal-preview .history-overlay[hidden] { display: none !important; }

.crystal-preview .service-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* Direction switch */
.crystal-preview .mode-switch {
  grid-column: 1 / -1;
  display: flex;
  align-self: stretch;
  justify-self: center;
  width: min(650px, 100%);
  margin: 0;
  padding: 4px;
  border: 1px solid rgba(105, 227, 255, .22);
  border-radius: 16px;
  background: rgba(5, 18, 47, .78);
  box-shadow:
    0 18px 40px rgba(0, 4, 18, .32),
    inset 0 1px 0 rgba(164, 224, 255, .08);
  backdrop-filter: blur(16px);
}

.crystal-preview .mode-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: 50%;
  min-width: 0;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #8fa8ca;
  background: transparent;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.crystal-preview .mode-tab:hover { color: #dff8ff; }

.crystal-preview .mode-tab.is-active {
  border-color: rgba(105, 227, 255, .68);
  color: #fff;
  background: linear-gradient(110deg, rgba(0, 99, 255, .92), rgba(0, 140, 255, .82));
  box-shadow:
    0 0 22px rgba(0, 99, 255, .26),
    inset 0 1px 0 rgba(214, 248, 255, .34);
}

.crystal-preview .mode-tab svg {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.crystal-preview .mode-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  text-align: left;
}

.crystal-preview .mode-copy strong { font-size: 15px; line-height: 1.2; }
.crystal-preview .mode-copy small { overflow: hidden; font-size: 11px; font-weight: 500; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; opacity: .82; }
.crystal-preview .mode-subtitle-mobile { display: none; }

.crystal-preview button:focus-visible,
.crystal-preview textarea:focus-visible,
.crystal-preview summary:focus-visible {
  outline: 2px solid var(--crystal-cyan-soft);
  outline-offset: 3px;
}

/* Shared glass panel language */
.crystal-preview .query-card,
.crystal-preview .progress-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid #3e94c1;
  border-radius: 22px;
  backdrop-filter: blur(20px) saturate(120%);
}

/* Input panel: deliberately a little lighter */
.crystal-preview .query-card {
  grid-column: 1;
  grid-row: 3;
  padding: 1px;
  background: linear-gradient(142deg, rgba(20, 66, 120, .9), rgba(9, 36, 78, .92) 46%, rgba(5, 23, 55, .95));
  box-shadow: 0 0 0 1px rgba(0, 223, 255, .16), 0 0 18px rgba(0, 140, 255, .1), 0 30px 68px rgba(0, 3, 17, .54), -8px 0 34px rgba(0, 140, 255, .07), inset 0 0 28px rgba(44, 144, 232, .05);
}

.crystal-preview .query-surface {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(12, 43, 88, .9), rgba(6, 26, 61, .94) 58%, rgba(4, 20, 49, .96));
}

.crystal-preview .query-toolbar {
  display: flex;
  align-items: center;
  height: 56px;
  flex: 0 0 auto;
  padding: 0 24px;
  border-bottom: 1px solid rgba(105, 227, 255, .14);
  color: #dff5ff;
  background: rgba(10, 39, 83, .38);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .04em;
}

.crystal-preview .query-toolbar::before {
  width: 3px;
  height: 16px;
  margin-right: 10px;
  border-radius: 4px;
  content: "";
  background: var(--crystal-cyan);
  box-shadow: 0 0 10px rgba(0, 223, 255, .55);
}

.crystal-preview .query-input-shell {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  margin: 12px;
  overflow: hidden;
  border: 1px solid rgba(95, 172, 242, .2);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(2, 13, 35, .82), rgba(3, 17, 43, .94));
  box-shadow: inset 0 10px 34px rgba(0, 4, 18, .38), inset 0 1px 0 rgba(98, 174, 236, .04);
}

.crystal-preview .query-sparkle {
  position: absolute;
  top: 23px;
  left: 22px;
  width: 25px;
  height: 25px;
  fill: var(--crystal-cyan);
  filter: drop-shadow(0 0 6px rgba(0, 223, 255, .4));
  pointer-events: none;
}

.crystal-preview textarea {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 25px 26px 40px 62px;
  resize: none;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: #e8f5ff;
  background: transparent;
  box-shadow: none;
  font-size: clamp(15px, 1.12vw, 17px);
  font-weight: 500;
  line-height: 1.66;
  scrollbar-color: #1d70b8 transparent;
}

.crystal-preview textarea::placeholder {
  color: #91aace;
  opacity: 1;
  font-size: clamp(13px, .95vw, 15px);
  white-space: pre-line;
}

.crystal-preview textarea:focus { box-shadow: inset 0 0 0 1px rgba(0, 223, 255, .32); }

.crystal-preview .char-count {
  position: absolute;
  right: 18px;
  bottom: 13px;
  color: #6f8db5;
  font-size: 12px;
  font-weight: 650;
}

.crystal-preview .keyword-panel { right: 68px; bottom: 10px; left: 61px; }
.crystal-preview .keyword-tag { border-color: rgba(0, 223, 255, .28); color: #bdefff; background: rgba(0, 106, 178, .3); }

.crystal-preview .query-tools {
  position: absolute;
  top: 13px;
  right: 17px;
  z-index: 5;
  color: #b8dcff;
}

.crystal-preview .query-tools > summary {
  padding: 7px 12px;
  border: 1px solid rgba(105, 227, 255, .26);
  border-radius: 9px;
  color: #b8dcff;
  background: rgba(4, 22, 52, .76);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  list-style: none;
}

.crystal-preview .query-tools > summary::-webkit-details-marker { display: none; }
.crystal-preview .query-tools > summary:hover,
.crystal-preview .query-tools[open] > summary { border-color: rgba(105, 227, 255, .66); color: #fff; background: rgba(0, 99, 255, .3); }

.crystal-preview .query-tools-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(280px, calc(100vw - 36px));
  padding: 9px;
  border: 1px solid rgba(105, 227, 255, .35);
  border-radius: 13px;
  color: #dceeff;
  background: rgba(5, 20, 48, .96);
  box-shadow: 0 20px 42px rgba(0, 3, 18, .62);
  backdrop-filter: blur(18px);
}

.crystal-preview .query-tools-panel #sample[hidden] { display: none !important; }
.crystal-preview .query-sample-options { display: grid; gap: 5px; }

.crystal-preview .query-sample-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #a9c9ec;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.crystal-preview .query-sample-option::after { content: "›"; color: var(--crystal-cyan); font-size: 21px; }
.crystal-preview .query-sample-option:hover { border-color: rgba(105, 227, 255, .22); color: #fff; background: rgba(0, 99, 255, .18); }

.crystal-preview .query-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 67px;
  flex: 0 0 auto;
  padding: 8px 17px;
  border-top: 1px solid rgba(105, 227, 255, .12);
  background: rgba(5, 24, 57, .38);
}

.crystal-preview #searchBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 184px;
  height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(105, 227, 255, .68);
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(105deg, #008cff, #0063ff 68%, #0052db);
  box-shadow: 0 10px 25px rgba(0, 82, 219, .34), inset 0 1px 0 rgba(214, 248, 255, .32);
  cursor: pointer;
  font-size: 15px;
  font-weight: 750;
  transition: filter .2s ease, transform .2s ease, box-shadow .2s ease;
}

.crystal-preview #searchBtn:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 13px 29px rgba(0, 99, 255, .42), 0 0 18px rgba(0, 223, 255, .13); }
.crystal-preview #searchBtn:disabled { cursor: wait; filter: saturate(.5); opacity: .62; transform: none; }
.crystal-preview .button-sparkle { width: 18px; height: 18px; fill: currentColor; }
.crystal-preview .button-arrow { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

/* Process panel: darker and quieter */
.crystal-preview .progress-card {
  grid-column: 2;
  grid-row: 3;
  display: flex;
  flex-direction: column;
  padding: 20px;
  color: #eff8ff;
  background: linear-gradient(150deg, rgba(7, 30, 66, .96), rgba(3, 16, 41, .97) 58%, rgba(2, 12, 33, .98));
  box-shadow: 0 0 0 1px rgba(0, 223, 255, .16), 0 0 18px rgba(0, 140, 255, .1), 0 30px 68px rgba(0, 3, 17, .58), 8px 0 32px rgba(0, 99, 255, .045), inset 0 0 28px rgba(19, 87, 155, .045);
}

.crystal-preview .progress-card > * { position: relative; z-index: 1; }
.crystal-preview .progress-topline { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.crystal-preview .progress-topline strong { font-size: 17px; letter-spacing: .03em; white-space: nowrap; }
.crystal-preview .progress-topline > span { color: var(--crystal-cyan-soft); font-size: 21px; font-weight: 800; text-shadow: 0 0 12px rgba(0, 223, 255, .22); }

.crystal-preview .progress-track {
  grid-column: 1 / -1;
  height: 6px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(85, 142, 205, .14);
  border-radius: 99px;
  background: rgba(1, 9, 27, .82);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .48);
}

.crystal-preview .progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--crystal-blue), var(--crystal-cyan));
  box-shadow: 0 0 10px rgba(0, 223, 255, .45);
  transition: width .35s ease;
}

.crystal-preview .stage-list { display: grid; grid-template-columns: 1fr; gap: 7px; flex: 0 0 auto; margin-top: 14px; }

.crystal-preview #stageList > span {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 39px;
  padding: 0 13px;
  border: 1px solid rgba(91, 147, 210, .16);
  border-radius: 10px;
  color: #9ab2d0;
  background: rgba(10, 38, 78, .28);
  font-size: 12px;
  font-weight: 700;
}

.crystal-preview #stageList > span.active { border-color: rgba(0, 223, 255, .58); color: #f1fcff; background: linear-gradient(90deg, rgba(0, 99, 255, .28), rgba(0, 140, 255, .1)); box-shadow: inset 3px 0 0 var(--crystal-cyan); }
.crystal-preview #stageList > span.done { border-color: rgba(0, 140, 255, .36); color: #c8ddf6; background: rgba(0, 80, 164, .18); }
.crystal-preview .stage-icon { width: 21px; height: 21px; flex: 0 0 auto; fill: none; color: #668cb8; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.crystal-preview #stageList > span.active .stage-icon,
.crystal-preview #stageList > span.done .stage-icon { color: var(--crystal-cyan-soft); }

.crystal-preview .progress-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  flex: 0 0 auto;
  margin: 13px 0 0;
  color: #91a9c7;
  font-size: 11px;
  white-space: nowrap;
}

.crystal-preview .progress-status strong { color: #cce0f5; }
.crystal-preview .live-indicator { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--crystal-cyan); box-shadow: 0 0 8px rgba(0, 223, 255, .75); }
.crystal-preview .status-divider { width: 1px; height: 13px; margin: 0 2px; background: #365578; }
.crystal-preview #pipelineText { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.crystal-preview #streamMeta { display: none; }

.crystal-preview .stream-details { min-height: 0; flex: 1 1 auto; margin-top: 10px; }
.crystal-preview .llm-output { display: flex; flex-direction: column; height: 100%; min-height: 0; margin: 0; overflow: hidden; border: 1px solid rgba(105, 227, 255, .14); border-radius: 11px; background: rgba(1, 9, 27, .72); box-shadow: inset 0 8px 24px rgba(0, 0, 0, .18); }
.crystal-preview .llm-output-title { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px; border-bottom: 1px solid rgba(105, 227, 255, .1); color: #9eb9d9; font-size: 11px; }
.crystal-preview .llm-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #397daf; }
.crystal-preview .llm-output.is-live .llm-live-dot { background: var(--crystal-cyan); box-shadow: 0 0 7px rgba(0, 223, 255, .7); }
.crystal-preview #streamOutputMeta { min-width: 0; margin-left: auto; overflow: hidden; color: #55769d; text-overflow: ellipsis; white-space: nowrap; }
.crystal-preview #streamOutput { min-height: 0; flex: 1 1 auto; margin: 0; padding: 10px 12px; overflow: auto; color: #8da9c8; background: transparent; font: 11px/1.58 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; scrollbar-color: #1d70b8 transparent; }
.crystal-preview .llm-output.is-live #streamOutput { color: #b8d3ef; }

.crystal-preview .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.crystal-preview [hidden] { display: none !important; }

@media (max-width: 1180px) {
  .crystal-preview .query-layout { grid-template-columns: minmax(0, 1.38fr) minmax(330px, 1fr); width: min(1100px, calc(100% - 42px)); }
  .crystal-preview .crystal-backdrop img { width: 118%; margin-left: -9%; max-width: none; }
}

@media (max-width: 900px) {
  .crystal-preview .query-experience { overflow: visible; }
  .crystal-preview .crystal-backdrop { position: fixed; }
  .crystal-preview .crystal-backdrop img { width: 170%; margin-left: -35%; opacity: .82; }
  .crystal-preview .query-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 76px 70px minmax(340px, auto) minmax(430px, auto);
    width: min(680px, calc(100% - 32px));
    min-height: 100dvh;
    gap: 13px;
    padding-bottom: 22px;
  }
  .crystal-preview .topbar,
  .crystal-preview .mode-switch,
  .crystal-preview .query-card,
  .crystal-preview .progress-card { grid-column: 1; }
  .crystal-preview .query-card { grid-row: 3; min-height: 340px; }
  .crystal-preview .progress-card { grid-row: 4; min-height: 430px; }
}

@media (max-width: 620px) {
  .crystal-preview .query-layout { grid-template-rows: 82px 64px minmax(330px, auto) minmax(420px, auto); width: min(100% - 22px, 520px); gap: 10px; }
  .crystal-preview .topbar { grid-template-columns: minmax(0, 1.05fr) minmax(0, .8fr); gap: 8px; }
  .crystal-preview .summit-title { white-space: normal; }
  .crystal-preview .summit-title strong { font-size: clamp(11px, 3.5vw, 14px); }
  .crystal-preview .summit-title small { font-size: clamp(5px, 1.85vw, 7px); letter-spacing: .035em; }
  .crystal-preview .site-name { font-size: clamp(10px, 3.1vw, 13px); line-height: 1.35; white-space: normal; }
  .crystal-preview .event-name { font-size: clamp(8px, 2.15vw, 10px); line-height: 1.3; }
  .crystal-preview .topbar-right { flex-direction: column; align-items: flex-end; gap: 5px; }
  .crystal-preview .history-trigger { min-height: 26px; padding: 3px 7px; font-size: 10px; }
  .crystal-preview .history-trigger svg { width: 13px; height: 13px; }
  .crystal-preview .history-drawer { padding: 20px 15px; }
  .crystal-preview .mode-switch { border-radius: 13px; }
  .crystal-preview .mode-tab { gap: 7px; padding: 0 8px; }
  .crystal-preview .mode-tab svg { width: 20px; height: 20px; }
  .crystal-preview .mode-copy strong { font-size: 13px; }
  .crystal-preview .mode-copy > small:not(.mode-subtitle-mobile) { display: none; }
  .crystal-preview .mode-subtitle-mobile { display: block; font-size: 9px; }
  .crystal-preview .query-card,
  .crystal-preview .progress-card { border-radius: 17px; }
  .crystal-preview .query-surface { border-radius: 15px; }
  .crystal-preview .query-toolbar { height: 50px; padding-left: 15px; font-size: 12px; }
  .crystal-preview .query-tools { top: 9px; right: 11px; }
  .crystal-preview .query-tools > summary { padding: 6px 9px; font-size: 11px; }
  .crystal-preview .query-input-shell { margin: 8px; }
  .crystal-preview .query-sparkle { top: 20px; left: 14px; width: 22px; height: 22px; }
  .crystal-preview textarea { padding: 20px 14px 36px 46px; font-size: 14px; }
  .crystal-preview .char-count { right: 12px; bottom: 10px; }
  .crystal-preview .query-footer { height: 59px; padding: 7px 10px; }
  .crystal-preview #searchBtn { width: 165px; height: 41px; font-size: 13px; }
  .crystal-preview .progress-card { padding: 15px; }
  .crystal-preview .progress-topline strong { font-size: 15px; }
  .crystal-preview .progress-topline > span { font-size: 18px; }
  .crystal-preview #stageList > span { min-height: 36px; font-size: 11px; }
}

@media (min-width: 901px) and (max-height: 850px) {
  .crystal-preview .query-layout { grid-template-rows: 62px 66px minmax(390px, 1fr); gap: 10px 20px; padding-bottom: 16px; }
  .crystal-preview .query-toolbar { height: 48px; }
  .crystal-preview .query-footer { height: 58px; }
  .crystal-preview .stage-list { gap: 5px; margin-top: 10px; }
  .crystal-preview #stageList > span { min-height: 34px; }
  .crystal-preview .progress-status { margin-top: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .crystal-preview *, .crystal-preview *::before, .crystal-preview *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
