:root {
  --bg: #09111f;
  --bg-2: #0e1728;
  --panel: rgba(18, 29, 48, .88);
  --panel-2: #111c30;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.16);
  --text: #eef4ff;
  --muted: #8fa0b9;
  --accent: #8bf0c7;
  --accent-2: #69b7ff;
  --danger: #ff8f9d;
  --shadow: 0 22px 80px rgba(0,0,0,.38);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 15%, rgba(105,183,255,.12), transparent 30%),
    radial-gradient(circle at 85% 0%, rgba(139,240,199,.10), transparent 28%),
    linear-gradient(180deg, #0b1322 0%, #08101c 100%);
}
button, input, textarea { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; }
.topbar { height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(8,16,28,.72); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #061017; background: linear-gradient(135deg, var(--accent), #c3ffe9); box-shadow: 0 7px 25px rgba(139,240,199,.18); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: .02em; }
.brand small { color: var(--muted); margin-top: 2px; font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.privacy-pill { border: 1px solid rgba(139,240,199,.18); background: rgba(139,240,199,.06); color: #a9d8c8; border-radius: 999px; padding: 8px 12px; font-size: 12px; }
.workspace { width: min(1480px, 100%); margin: 0 auto; padding: 34px 28px 48px; }
.welcome-panel { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); gap: 28px; align-items: start; }
.hero-copy { padding: 58px 18px 40px 8px; }
.eyebrow, .section-label { color: var(--accent); text-transform: uppercase; font-size: 11px; letter-spacing: .14em; font-weight: 800; }
.hero-copy h1 { font-size: clamp(44px, 5.6vw, 78px); line-height: .98; letter-spacing: -.055em; margin: 20px 0 24px; max-width: 850px; }
.hero-copy p { color: #a8b7cc; font-size: 18px; line-height: 1.65; max-width: 720px; margin: 0; }
.drop-zone, .url-loader, .feature-strip { grid-column: 2; }
.drop-zone { border: 1px dashed rgba(139,240,199,.35); border-radius: 26px; min-height: 332px; padding: 38px; background: linear-gradient(145deg, rgba(139,240,199,.055), rgba(105,183,255,.035)), var(--panel); box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; transition: .18s ease; outline: none; }
.drop-zone:hover, .drop-zone:focus, .drop-zone.dragging { transform: translateY(-2px); border-color: rgba(139,240,199,.72); background: linear-gradient(145deg, rgba(139,240,199,.095), rgba(105,183,255,.06)), var(--panel); }
.drop-icon { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 18px; font-size: 28px; color: #08111b; background: linear-gradient(135deg, var(--accent), #b8ffe4); }
.drop-zone h2 { font-size: 22px; margin: 0 0 8px; }
.drop-zone p { color: var(--muted); margin: 0 0 24px; font-size: 13px; }
.drop-actions, .panel-actions { display: flex; gap: 8px; align-items: center; }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 10px 15px; cursor: pointer; transition: .14s ease; font-weight: 700; font-size: 13px; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: #07120f; }
.btn.secondary { background: rgba(255,255,255,.045); border-color: var(--line); color: #d5deeb; }
.btn.small { padding: 8px 11px; font-size: 12px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.url-loader { margin-top: -12px; display: flex; gap: 18px; align-items: center; justify-content: space-between; padding: 18px 20px; border: 1px solid var(--line); background: rgba(17,28,48,.72); border-radius: 16px; }
.url-loader strong, .url-loader span { display: block; }
.url-loader strong { font-size: 13px; margin-bottom: 3px; }
.url-loader span { color: var(--muted); font-size: 11px; }
.url-loader form { display: flex; gap: 8px; min-width: min(500px, 60%); }
input, textarea { color: var(--text); background: #0a1322; border: 1px solid var(--line); outline: none; }
input:focus, textarea:focus { border-color: rgba(105,183,255,.55); box-shadow: 0 0 0 3px rgba(105,183,255,.08); }
.url-loader input { flex: 1; min-width: 0; border-radius: 10px; padding: 10px 12px; font-size: 12px; }
.feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: -12px; }
.feature-strip > div { padding: 16px; border-radius: 14px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.feature-strip strong, .feature-strip span { display: block; }
.feature-strip strong { font-size: 12px; }
.feature-strip span { color: var(--muted); font-size: 11px; margin-top: 5px; }
.hidden { display: none !important; }
.explorer { min-height: calc(100vh - 156px); display: grid; grid-template-columns: 285px minmax(0,1fr); gap: 18px; }
.sidebar, .main-pane { border: 1px solid var(--line); background: rgba(12,21,36,.82); border-radius: var(--radius); box-shadow: 0 16px 55px rgba(0,0,0,.18); }
.sidebar { min-height: 720px; overflow: hidden; }
.db-heading { padding: 18px; border-bottom: 1px solid var(--line); display: flex; gap: 11px; align-items: center; }
.db-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 10px; font-weight: 900; color: #061017; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.db-heading strong, .db-heading span { display: block; max-width: 195px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-heading strong { font-size: 13px; }
.db-heading span { color: var(--muted); font-size: 11px; margin-top: 4px; }
.sidebar-toolbar { padding: 12px; display: flex; gap: 7px; border-bottom: 1px solid var(--line); }
.sidebar-toolbar input { width: 100%; min-width: 0; border-radius: 9px; padding: 9px 10px; font-size: 12px; }
.icon-btn { width: 36px; min-width: 36px; border: 1px solid var(--line); background: rgba(255,255,255,.035); border-radius: 9px; cursor: pointer; }
.table-list { padding: 8px; }
.table-item { width: 100%; text-align: left; border: 1px solid transparent; background: transparent; padding: 10px 11px; border-radius: 9px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #c8d3e2; }
.table-item:hover { background: rgba(255,255,255,.035); }
.table-item.active { background: rgba(139,240,199,.08); border-color: rgba(139,240,199,.16); color: #eaffeF; }
.table-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.table-item small { color: var(--muted); font-size: 10px; }
.main-pane { padding: 18px; min-width: 0; }
.summary-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.metric { min-height: 86px; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: linear-gradient(145deg, rgba(255,255,255,.025), rgba(255,255,255,.012)); }
.metric span, .metric strong { display: block; }
.metric span { color: var(--muted); font-size: 11px; margin-bottom: 11px; }
.metric strong { font-size: 24px; letter-spacing: -.03em; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { background: transparent; border: 0; color: var(--muted); padding: 11px 13px; cursor: pointer; font-size: 12px; font-weight: 700; border-bottom: 2px solid transparent; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { display: none; padding-top: 18px; }
.tab-panel.active { display: block; }
.panel-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.panel-head.compact { margin-bottom: 8px; min-height: 46px; padding: 0 14px; }
.panel-head h2 { font-size: 20px; margin: 5px 0 0; }
.muted { color: var(--muted); font-size: 11px; }
.data-grid { border: 1px solid var(--line); border-radius: 13px; overflow: auto; max-height: 630px; min-height: 350px; background: rgba(7,14,25,.68); }
.empty-state { display: grid; place-items: center; color: var(--muted); text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: #cad5e5; font-size: 13px; margin-bottom: 6px; }
.empty-state span { font-size: 11px; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { position: sticky; top: 0; z-index: 2; background: #111d30; color: #b9c8db; text-align: left; font-size: 10px; letter-spacing: .04em; }
th, td { padding: 10px 12px; border-right: 1px solid rgba(255,255,255,.045); border-bottom: 1px solid rgba(255,255,255,.055); white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
tr:hover td { background: rgba(105,183,255,.025); }
td.null { color: #63728a; font-style: italic; }
.schema-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.schema-card { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: rgba(10,19,33,.64); }
.schema-card-head { padding: 13px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.schema-card-head strong { font-size: 12px; }
.schema-card-head span { color: var(--muted); font-size: 10px; }
.column-row { display: grid; grid-template-columns: minmax(0,1fr) 100px 54px; gap: 8px; padding: 9px 14px; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 10px; }
.column-row:last-child { border-bottom: 0; }
.column-row .col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d8e2ef; }
.column-row .col-type, .column-row .col-key { color: var(--muted); text-align: right; }
.query-layout { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: 12px; }
.editor-card, .results-card { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: rgba(7,14,25,.68); }
.editor-toolbar, .editor-footer { height: 46px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.editor-footer { border-bottom: 0; border-top: 1px solid var(--line); }
.shortcut { color: #6f8098; font-size: 10px; }
#sqlEditor { width: 100%; min-height: 520px; resize: vertical; border: 0; border-radius: 0; padding: 18px; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; background: #08111e; }
#sqlEditor:focus { box-shadow: none; }
.results-card .data-grid { border-width: 1px 0 0; border-radius: 0; min-height: 520px; max-height: 620px; }
.toast { position: fixed; bottom: 24px; right: 24px; max-width: 380px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .18s ease; padding: 11px 14px; background: #16243a; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); font-size: 12px; z-index: 50; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(255,143,157,.4); color: #ffd6dc; }
.loading-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; align-content: center; gap: 16px; background: rgba(5,10,18,.84); backdrop-filter: blur(10px); }
.loader { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.loading-overlay strong { font-size: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 980px) {
  .welcome-panel { grid-template-columns: 1fr; }
  .drop-zone, .url-loader, .feature-strip { grid-column: 1; }
  .hero-copy { padding-top: 30px; }
  .url-loader { flex-direction: column; align-items: stretch; }
  .url-loader form { min-width: 0; }
  .explorer { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
  .table-list { display: flex; overflow-x: auto; }
  .table-item { min-width: 180px; }
  .query-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .workspace { padding: 22px 14px 36px; }
  .topbar { padding: 0 14px; }
  .privacy-pill { display: none; }
  .hero-copy h1 { font-size: 43px; }
  .drop-zone { padding: 28px 18px; }
  .feature-strip, .summary-row { grid-template-columns: repeat(2, 1fr); }
  .url-loader form { flex-direction: column; }
  .main-pane { padding: 12px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
}
