/* veil.css — Skewl-family visual language for the Veil demo shell.
   No external resources anywhere: system fonts, inline SVG only. */

:root {
  --sk-bg:#07080d; --sk-bg-2:#0c0e16; --sk-surface:#12141f; --sk-surface-2:#181b29;
  --sk-glass:rgba(22,25,40,.62); --sk-border:rgba(255,255,255,.08); --sk-border-strong:rgba(255,255,255,.14);
  --sk-text:#eef0fb; --sk-text-2:#a3a8c3; --sk-text-3:#6c7190;
  --sk-accent:#8b7cff; --sk-accent-2:#c86bff; --sk-accent-3:#4fd8ff;
  --sk-grad: linear-gradient(135deg,#8b7cff 0%,#c86bff 55%,#ff7ab6 100%);
  --sk-danger:#ff6b81; --sk-warn:#ffc760; --sk-success:#4ee3a4;
  --sk-radius:12px; --sk-radius-lg:18px; --sk-radius-xl:26px;
  --sk-shadow: 0 20px 50px -18px rgba(0,0,0,.7);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; background: #07080d; }
.app, .stage, .pane { max-width: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--sk-text);
  background: var(--sk-bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(139,124,255,.35); }

/* ------------------------------------------------------------ background */

.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora::after {            /* faint grid keeps the blobs from looking soupy */
  content: ''; position: absolute; inset: 0; opacity: .35;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
}
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.b1 { width: 52vw; height: 52vw; left: -14vw; top: -20vw; background: #6d5cff; animation: drift1 26s ease-in-out infinite; }
.b2 { width: 46vw; height: 46vw; right: -12vw; top: -14vw; background: #c86bff; opacity: .42; animation: drift2 32s ease-in-out infinite; }
.b3 { width: 40vw; height: 40vw; left: 30vw; bottom: -24vw; background: #4fd8ff; opacity: .22; animation: drift3 38s ease-in-out infinite; }

@keyframes drift1 { 50% { transform: translate3d(6vw, 4vw, 0) scale(1.1); } }
@keyframes drift2 { 50% { transform: translate3d(-5vw, 6vw, 0) scale(1.08); } }
@keyframes drift3 { 50% { transform: translate3d(4vw, -5vw, 0) scale(.92); } }

/* ---------------------------------------------------------------- layout */

.app {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  padding: 12px; gap: 10px;
}

.chrome, .toolbar {
  background: var(--sk-glass);
  border: 1px solid var(--sk-border);
  border-radius: var(--sk-radius-lg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

/* ------------------------------------------------------- chrome / tabbar */

.chrome { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-height: 52px; }

.brand { display: flex; align-items: center; gap: 9px; padding: 2px 6px 2px 2px; flex: 0 0 auto; }
.brand .mark { width: 26px; height: 26px; display: block; flex: 0 0 auto; }
.brand .word {
  font-size: 17px; font-weight: 800; letter-spacing: -.02em;
  background: var(--sk-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .badge {
  font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--sk-text-3); border: 1px solid var(--sk-border); border-radius: 999px; padding: 2px 7px;
}

.tabstrip {
  flex: 1 1 auto; display: flex; align-items: center; gap: 6px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; min-width: 0;
  padding: 2px;
}
.tabstrip::-webkit-scrollbar { display: none; }

.tab {
  display: flex; align-items: center; gap: 8px;
  flex: 0 1 190px; min-width: 96px; max-width: 220px;
  height: 36px; padding: 0 6px 0 11px;
  border-radius: 11px; border: 1px solid transparent;
  background: rgba(255,255,255,.035);
  color: var(--sk-text-2); font-size: 13px;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.tab:hover { background: rgba(255,255,255,.075); color: var(--sk-text); }
.tab.is-active {
  background: linear-gradient(180deg, rgba(139,124,255,.20), rgba(139,124,255,.08));
  border-color: rgba(139,124,255,.42); color: var(--sk-text);
  box-shadow: 0 6px 18px -10px rgba(139,124,255,.9);
}
.tab .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sk-grad); flex: 0 0 auto; }
.tab.is-loading .dot { background: var(--sk-warn); animation: pulse 1.1s ease-in-out infinite; }
.tab.is-error .dot { background: var(--sk-danger); }
.tab .label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.tab .close {
  width: 20px; height: 20px; flex: 0 0 auto; border: 0; border-radius: 6px;
  background: transparent; color: var(--sk-text-3); line-height: 1; font-size: 15px;
  display: grid; place-items: center; opacity: .0; transition: opacity .15s, background .15s, color .15s;
}
.tab:hover .close, .tab.is-active .close { opacity: 1; }
.tab .close:hover { background: rgba(255,107,129,.16); color: var(--sk-danger); }

@keyframes pulse { 50% { opacity: .3; } }

.icon-btn {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--sk-border);
  background: rgba(255,255,255,.04); color: var(--sk-text-2);
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.icon-btn:hover:not(:disabled) { background: rgba(255,255,255,.1); color: var(--sk-text); border-color: var(--sk-border-strong); }
.icon-btn:active:not(:disabled) { transform: scale(.94); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:focus-visible, .tab:focus-visible, .omni input:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--sk-accent); outline-offset: 2px;
}

/* --------------------------------------------------------------- toolbar */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; }

.omni {
  flex: 1 1 260px; min-width: 0;
  display: flex; align-items: center; gap: 9px;
  height: 38px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--sk-border);
  background: rgba(8,9,16,.66);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.omni:focus-within {
  border-color: rgba(139,124,255,.6);
  box-shadow: 0 0 0 3px rgba(139,124,255,.16);
  background: rgba(8,9,16,.86);
}
.omni .state { width: 16px; height: 16px; flex: 0 0 auto; display: grid; place-items: center; color: var(--sk-text-3); }
.omni .state svg { width: 14px; height: 14px; display: block; }
.omni.is-secure .state { color: var(--sk-success); }
.omni.is-error .state { color: var(--sk-danger); }
.omni input {
  flex: 1 1 auto; min-width: 0; height: 100%;
  border: 0; background: transparent; outline: none;
  font-size: 13.5px; letter-spacing: .005em;
}
.omni input::placeholder { color: var(--sk-text-3); }
.omni .spinner { width: 15px; height: 15px; flex: 0 0 auto; opacity: 0; transition: opacity .2s; }
.omni.is-loading .spinner { opacity: 1; }
.omni .spinner circle { fill: none; stroke: var(--sk-accent); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 26 60; transform-origin: center; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress {
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  border-radius: 2px 2px 0 0; overflow: hidden; opacity: 0; transition: opacity .25s;
}
.toolbar { position: relative; }
.toolbar.is-loading .progress { opacity: 1; }
.progress i { display: block; height: 100%; width: 40%; background: var(--sk-grad); animation: slide 1.15s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ----------------------------------------------------------------- stage */

.stage {
  flex: 1 1 auto; position: relative; min-height: 0;
  border-radius: var(--sk-radius-xl);
  border: 1px solid var(--sk-border);
  background: linear-gradient(180deg, rgba(18,20,31,.82), rgba(10,11,19,.9));
  box-shadow: var(--sk-shadow);
  overflow: hidden;
}
.pane { position: absolute; inset: 0; display: none; }
.pane.is-active { display: block; }
/* dark while empty so a mounting tab never flashes white */
.viewport { position: absolute; inset: 0; background: var(--sk-bg-2); display: none; }
.pane.show-view .viewport { display: block; }
.viewport iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ------------------------------------------------------------ home panel */

.panel {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  /* justify-content:center would clip the top of overflowing content in a
     column flex box; `margin:auto` on the child centres without clipping. */
  display: none; align-items: center; justify-content: flex-start;
  padding: 28px 20px;
}
.pane.show-home .home, .pane.show-error .error { display: flex; }

.home { flex-direction: column; text-align: center; }
/* min-width:0 everywhere a long <pre> line could inflate the flex/grid track
   and push the whole shell wider than the viewport. */
.home-inner { width: 100%; min-width: 0; max-width: 660px; margin: auto; }
.hero-mark { width: 58px; height: 58px; margin: 0 auto 12px; display: block; filter: drop-shadow(0 10px 26px rgba(139,124,255,.45)); }
.home h1 {
  margin: 0 0 10px; font-size: clamp(30px, 6vw, 42px); font-weight: 800; letter-spacing: -.035em;
  background: var(--sk-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home .sub { margin: 0 auto 20px; max-width: 460px; color: var(--sk-text-2); font-size: 14.5px; line-height: 1.6; }

.home-search { display: flex; gap: 8px; margin: 0 auto 20px; max-width: 520px; }
.home-search .omni { flex: 1 1 auto; height: 46px; background: rgba(8,9,16,.7); }
.home-search .omni input { font-size: 15px; }
.btn {
  border: 0; border-radius: 999px; padding: 0 20px; height: 46px; flex: 0 0 auto;
  font-size: 14px; font-weight: 650; color: #0a0a12;
  background: var(--sk-grad);
  box-shadow: 0 10px 26px -12px rgba(200,107,255,.9);
  transition: transform .16s ease, filter .16s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn.ghost {
  background: rgba(255,255,255,.05); color: var(--sk-text);
  border: 1px solid var(--sk-border-strong); box-shadow: none;
}
.btn.ghost:hover { background: rgba(255,255,255,.1); }

.quick { display: grid; min-width: 0; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 10px; margin-bottom: 18px; }
.quick a {
  display: flex; min-width: 0; align-items: center; gap: 10px; padding: 11px 12px;
  border-radius: var(--sk-radius); border: 1px solid var(--sk-border);
  background: rgba(255,255,255,.035); color: var(--sk-text-2);
  text-decoration: none; font-size: 13px; text-align: left;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.quick a > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick a:hover { background: rgba(255,255,255,.08); border-color: var(--sk-border-strong); color: var(--sk-text); transform: translateY(-2px); }
.quick .tile {
  width: 28px; height: 28px; flex: 0 0 auto; border-radius: 9px;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #0a0a12;
  background: var(--sk-grad);
}
.quick a:nth-child(3n+2) .tile { background: linear-gradient(135deg,#4fd8ff,#8b7cff); }
.quick a:nth-child(3n+3) .tile { background: linear-gradient(135deg,#ff7ab6,#ffc760); }

.snippet {
  text-align: left; min-width: 0; border: 1px solid var(--sk-border); border-radius: var(--sk-radius);
  background: rgba(7,8,13,.6); overflow: hidden;
}
.snippet header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--sk-border);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--sk-text-3);
}
.snippet pre {
  margin: 0; max-width: 100%; padding: 12px; overflow-x: auto;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.65; color: var(--sk-text-2);
}
.snippet .k { color: var(--sk-accent-3); }
.snippet .s { color: var(--sk-accent-2); }
.copy { border: 1px solid var(--sk-border); background: transparent; color: var(--sk-text-2); border-radius: 7px; padding: 3px 9px; font-size: 10.5px; letter-spacing: .06em; }
.copy:hover { color: var(--sk-text); border-color: var(--sk-border-strong); }

/* ----------------------------------------------------- error / empty card */

.error { flex-direction: column; }
.error-card {
  width: 100%; min-width: 0; max-width: 520px; margin: auto; text-align: center;
  padding: 30px 26px;
  border-radius: var(--sk-radius-lg); border: 1px solid var(--sk-border-strong);
  background: linear-gradient(180deg, rgba(24,27,41,.9), rgba(14,16,25,.9));
  box-shadow: var(--sk-shadow);
}
.error-glyph {
  width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 16px;
  display: grid; place-items: center; color: var(--sk-warn);
  background: rgba(255,199,96,.1); border: 1px solid rgba(255,199,96,.28);
}
.error-glyph svg { width: 26px; height: 26px; }
.error-card h2 { margin: 0 0 8px; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.error-card p { margin: 0 0 6px; color: var(--sk-text-2); font-size: 13.5px; line-height: 1.6; }
.error-card .detail {
  margin: 14px 0 0; padding: 9px 11px; border-radius: 9px;
  background: rgba(7,8,13,.7); border: 1px solid var(--sk-border);
  font-family: var(--mono); font-size: 11.5px; color: var(--sk-text-3);
  word-break: break-all; text-align: left;
}
.error-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 18px; }
.error-actions .btn { height: 40px; font-size: 13.5px; }
.api-row { display: flex; gap: 8px; margin-top: 14px; }
.api-row input {
  flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 13px;
  border-radius: 10px; border: 1px solid var(--sk-border); background: rgba(7,8,13,.7);
  font-size: 12.5px; font-family: var(--mono); outline: none;
}
.api-row input:focus { border-color: rgba(139,124,255,.6); }
.api-row .btn { height: 40px; padding: 0 16px; font-size: 13px; }

/* ---------------------------------------------------------------- footer */

.statusbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 0 6px; font-size: 11.5px; color: var(--sk-text-3); min-height: 16px;
}
.statusbar .sep { opacity: .4; }
.statusbar b { color: var(--sk-text-2); font-weight: 600; font-family: var(--mono); font-size: 11px; }
.statusbar .live { display: inline-flex; align-items: center; gap: 6px; }
.statusbar .live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--sk-text-3); box-shadow: 0 0 0 3px rgba(255,255,255,.04);
}
.statusbar.is-up .live::before { background: var(--sk-success); box-shadow: 0 0 0 3px rgba(78,227,164,.14); }
.statusbar.is-down .live::before { background: var(--sk-danger); box-shadow: 0 0 0 3px rgba(255,107,129,.14); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 720px) {
  .app { padding: 8px; gap: 8px; }
  .brand .badge { display: none; }
  .omni { flex-basis: 100%; order: -1; }
  .stage { border-radius: var(--sk-radius-lg); }
}
@media (max-width: 480px) {
  .brand .word { display: none; }
  .tab { flex-basis: 140px; min-width: 80px; }
  .panel { padding: 20px 14px; }
  .error-card { padding: 22px 16px; }
  .home-search { flex-direction: column; }
  .home-search .btn { width: 100%; }
  .statusbar .hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .omni .spinner circle { stroke-dasharray: 86; }
}
