*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

[v-cloak] { display: none !important; }

html, body {
  min-height: 100%;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0f172a; color: #e2e8f0;
  min-height: 100vh;
}

/* ── Page shell ────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
}

/* ── Header ────────────────────────────────────────── */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
}
.page-header h1 {
  font-size: 1.75rem; font-weight: 700; color: #38bdf8; letter-spacing: -.5px;
  margin-bottom: .35rem;
}
.page-header .sub {
  color: #475569; font-size: .83rem;
}
.page-header .accent {
  display: inline-block; width: 3rem; height: 3px;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  border-radius: 2px; margin-bottom: .75rem;
}

/* ── Panel ─────────────────────────────────────────── */
.panel {
  display: flex; flex-direction: column;
  border: 1px solid #1e293b;
  overflow: hidden;
}
.panel-top    { border-radius: 10px 10px 0 0; }
.panel-bottom { border-radius: 0 0 10px 10px; border-top: none; }
.panel-full   { border-radius: 10px; }

.panel-header {
  background: #1e293b; padding: .6rem 1rem; font-size: .78rem; font-weight: 600;
  color: #94a3b8; text-transform: uppercase; letter-spacing: .08em;
  border-bottom: 1px solid #334155; display: flex; align-items: center;
  justify-content: space-between; flex-shrink: 0; gap: .5rem;
  min-height: 2.6rem;
}
.panel-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lang-tag {
  background: #334155; padding: .1rem .5rem; border-radius: 4px;
  font-size: .7rem; color: #7dd3fc; flex-shrink: 0;
}

textarea {
  background: #0d1117; color: #c9d1d9;
  border: none; outline: none; resize: none;
  padding: 1.1rem 1.2rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: .9rem; line-height: 1.7; tab-size: 2;
  width: 100%; display: block;
}
textarea::placeholder { color: #3d4f6b; }

/* ── Resize handles ────────────────────────────────── */
.resize-handle {
  height: 8px;
  background: #1a2744;
  border-left: 1px solid #1e293b;
  border-right: 1px solid #1e293b;
  cursor: ns-resize;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  user-select: none; flex-shrink: 0;
}
.resize-handle:hover,
.resize-handle.dragging { background: #1e3a5f; }
.resize-handle-bar {
  width: 36px; height: 3px; border-radius: 2px;
  background: #334155; pointer-events: none;
  transition: background .15s;
}
.resize-handle:hover .resize-handle-bar,
.resize-handle.dragging .resize-handle-bar { background: #38bdf8; }

/* ── Controls ──────────────────────────────────────── */
.controls {
  background: #1e293b;
  border: 1px solid #1e293b;
  border-top: none; border-bottom: none;
  padding: .75rem 1.1rem;
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}

.controls-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ── Buttons ───────────────────────────────────────── */
.btn-run {
  background: #0ea5e9; color: #fff; border: none; padding: .5rem 1.4rem;
  border-radius: 6px; font-size: .88rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: .4rem; transition: background .15s;
}
.btn-run:hover:not(:disabled) { background: #38bdf8; }
.btn-run:disabled              { background: #334155; cursor: not-allowed; }

.btn-clear {
  background: transparent; color: #94a3b8; border: 1px solid #334155;
  padding: .45rem .9rem; border-radius: 6px; font-size: .84rem; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-clear:hover { border-color: #64748b; color: #e2e8f0; }

.btn-help {
  background: #0f172a; color: #94a3b8; border: 1px solid #334155;
  padding: .45rem .9rem; border-radius: 6px; font-size: .82rem; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-help:hover { border-color: #7dd3fc; color: #e2e8f0; }

.btn-upload {
  background: #0ea5e920; color: #7dd3fc; border: 1px solid #0ea5e960;
  padding: .45rem .9rem; border-radius: 6px; font-size: .82rem; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-upload:hover { background: #0ea5e940; border-color: #7dd3fc; }

.btn-examples {
  background: #0ea5e920; color: #7dd3fc; border: 1px solid #0ea5e960;
  padding: .35rem .85rem; border-radius: 6px; font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s; white-space: nowrap;
}
.btn-examples:hover { background: #0ea5e940; border-color: #7dd3fc; }

.btn-download {
  background: #16423020; color: #34d399; border: 1px solid #34d39940;
  padding: .28rem .75rem; border-radius: 6px; font-size: .76rem; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s; white-space: nowrap;
}
.btn-download:hover { background: #34d39920; border-color: #34d399; }

/* ── Status / exec time ────────────────────────────── */
.status             { font-size: .8rem; color: #64748b; }
.status.running     { color: #fbbf24; }
.status.done        { color: #34d399; }
.status.error       { color: #f87171; }

.exec-time {
  font-size: .78rem; color: #475569;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Results panel ─────────────────────────────────── */
.results-panel {
  margin-top: 0;
  display: flex; flex-direction: column;
}
.results-scroll { flex: 1; overflow-y: auto; background: #0d1117; }

table { width: 100%; border-collapse: collapse; font-size: .81rem; }
thead th {
  background: #161b22; color: #8b949e; text-transform: uppercase;
  font-size: .69rem; letter-spacing: .07em; padding: .45rem 1rem; text-align: left;
  position: sticky; top: 0; border-bottom: 1px solid #21262d;
}
tbody tr:nth-child(even) { background: #0f1117; }
tbody tr:hover           { background: #161b22; }
tbody tr.data-row        { cursor: pointer; }
tbody tr.data-row:hover  { background: #1a2744; }
tbody td {
  padding: .4rem 1rem; border-bottom: 1px solid #161b22;
  font-family: 'JetBrains Mono', monospace; word-break: break-all;
}

.uri     { color: #79c0ff; }
.literal { color: #a5d6ff; }
.empty-state { padding: 2rem; text-align: center; color: #3d4f6b; font-size: .88rem; }
.error-row td { color: #f87171 !important; font-style: italic; }

/* ── Examples dropdown ─────────────────────────────── */
.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  min-width: 240px;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  overflow: hidden;
}

.dropdown-item {
  padding: .55rem 1rem;
  font-size: .83rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: background .1s, color .1s;
}
.dropdown-item:hover { background: #334155; color: #f1f5f9; }

.dropdown-empty {
  padding: .6rem 1rem;
  font-size: .8rem;
  color: #475569;
  font-style: italic;
}

/* ── Modal ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: #1e293b; border: 1px solid #334155; border-radius: 10px;
  width: min(720px, 92vw); max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: 0 25px 60px rgba(0,0,0,.5);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.4rem; border-bottom: 1px solid #334155;
  font-weight: 700; font-size: 1rem; color: #e2e8f0; flex-shrink: 0;
}
.modal-close {
  background: none; border: none; color: #64748b; font-size: 1.1rem;
  cursor: pointer; padding: .2rem .4rem; border-radius: 4px;
  transition: color .15s;
}
.modal-close:hover { color: #e2e8f0; }
.modal-body {
  padding: 1.4rem; overflow-y: auto; font-size: .88rem; line-height: 1.7;
  color: #cbd5e1;
}
.modal-body h4 { color: #38bdf8; margin: 1.1rem 0 .35rem; font-size: .9rem; }
.modal-body h4:first-child { margin-top: 0; }
.modal-body p  { margin-bottom: .5rem; }
.modal-body pre {
  background: #0d1117; border: 1px solid #334155; border-radius: 6px;
  padding: .8rem 1rem; font-family: 'JetBrains Mono', monospace;
  font-size: .8rem; line-height: 1.6; overflow-x: auto; margin: .5rem 0 1rem;
  color: #c9d1d9;
}
.modal-body code {
  background: #0d1117; padding: .1rem .35rem; border-radius: 3px;
  font-family: 'JetBrains Mono', monospace; font-size: .82rem; color: #7dd3fc;
}
.modal-body ul { padding-left: 1.4rem; }
.modal-body li { margin-bottom: .35rem; }

/* ── Provenance modal ──────────────────────────────── */
.prov-triple {
  background: #0d1117; border: 1px solid #334155; border-radius: 6px;
  padding: .7rem 1rem; margin-bottom: 1.2rem; display: flex; flex-direction: column; gap: .3rem;
}
.prov-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #475569; font-weight: 600;
}
.prov-triple code {
  font-family: 'JetBrains Mono', monospace; font-size: .82rem; color: #7dd3fc;
  word-break: break-all; background: none; padding: 0;
}
.prov-loading, .prov-empty { color: #475569; font-style: italic; font-size: .85rem; padding: .5rem 0; }
.prov-error { color: #f87171; font-size: .85rem; padding: .5rem 0; }

.prov-rule-block {
  border: 1px solid #334155; border-radius: 8px; margin-bottom: 1rem; overflow: hidden;
}
.prov-rule-title {
  background: #0f172a; padding: .45rem 1rem; font-size: .73rem; font-weight: 700;
  color: #38bdf8; text-transform: uppercase; letter-spacing: .07em;
}
.prov-rule-code {
  background: #0d1117; border: none; border-bottom: 1px solid #334155; border-radius: 0;
  padding: .75rem 1rem; font-family: 'JetBrains Mono', monospace;
  font-size: .79rem; line-height: 1.6; color: #c9d1d9; margin: 0; overflow-x: auto;
}
.prov-bindings-title {
  padding: .5rem 1rem .3rem; font-size: .73rem; font-weight: 600;
  color: #64748b; text-transform: uppercase; letter-spacing: .07em;
}
.prov-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.prov-table th {
  background: #161b22; color: #8b949e; text-transform: uppercase;
  font-size: .68rem; letter-spacing: .07em; padding: .35rem .9rem; text-align: left;
}
.prov-table td {
  padding: .35rem .9rem; border-top: 1px solid #1e293b;
  font-family: 'JetBrains Mono', monospace; word-break: break-all; color: #cbd5e1;
}
.prov-table tr:nth-child(even) td { background: #0a0f1a; }

/* ===== Tabs ===== */
.tab-bar { display: flex; gap: .25rem; margin-bottom: 1rem; border-bottom: 1px solid #1e2d3d; padding-bottom: 0; }
.tab-btn { background: none; border: none; color: #7a8ba0; padding: .5rem 1rem; border-radius: 6px 6px 0 0; cursor: pointer; font-family: inherit; font-size: .9rem; border-bottom: 2px solid transparent; transition: all .15s; }
.tab-btn:hover { color: #b8c9e0; background: #0f1923; }
.tab-btn.active { color: #58a6ff; border-bottom-color: #58a6ff; background: #0d1520; }

/* ===== Examples Dashboard ===== */
.examples-dash { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ex-pass { background: none !important; }
.ex-pass:hover { background: #0a2a0a !important; }
.ex-fail { background: none !important; }
.ex-fail:hover { background: #2a0a0a !important; }
.ex-err { background: none !important; }
.ex-err:hover { background: #2a2a0a !important; }
.ex-name { font-weight: 600; font-size: .85rem; }
.ex-file { font-size: .7rem; color: #5a6a7a; margin-top: 1px; }
.badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: .7rem; font-weight: 600; }
.badge-pass { background: #0a3a0a; color: #3fb950; }
.badge-fail { background: #3a0a0a; color: #f85149; }
.badge-err { background: #3a3a0a; color: #d2991d; }
.ex-issue { font-size: .7rem; color: #8b949e; margin-top: 3px; font-style: italic; max-width: 400px; }
.btn-small { padding: 2px 8px; font-size: .75rem; }



