:root {
  --a:#FF0080; --b:#FF1493;
  --bg:#000000; --panel:#0a0a0d;
  --ink:#17131a; --mut:#6f6470; --line:#ececf2;
  --glow: 0 0 50px rgba(255,0,128,.32);
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { margin: 0; color: #fff; font-family: 'Segoe UI', system-ui, sans-serif; min-height: 100vh; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 34px 20px 46px; }

/* Settings button (top-right) */
.gear { position: fixed; top: 16px; right: 18px; z-index: 40; background: #17131a; color: #fff; border: 1.5px solid rgba(255,0,128,.5); border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 13px; cursor: pointer; }
.gear:hover { border-color: var(--a); box-shadow: 0 0 16px rgba(255,0,128,.35); }

/* Hero / logo */
.hero { text-align: center; margin-bottom: 26px; }
.logo-card { display: inline-block; background: linear-gradient(135deg, var(--a), var(--b)); border-radius: 22px; padding: 26px 54px; box-shadow: var(--glow); }
.logo { font-size: 52px; font-weight: 800; color: #fff; line-height: 1; letter-spacing: -1px; }
.logo b { color: #fff; } .logo sup { font-size: 16px; font-weight: 600; vertical-align: super; }
.logo-sub { color: rgba(255,255,255,.92); font-size: 15px; margin-top: 8px; font-weight: 500; }
.hero-tag { color: #fff; font-size: 20px; margin: 18px 0 0; font-weight: 400; }

/* Banner */
.banner { padding: 11px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; text-align: center; }
.banner.warn { background: #2a1c00; color: #ffcf7a; border: 1px solid #5a3d00; }
.banner.bad { background: #2a0010; color: #ff8fb3; border: 1px solid #5a0026; }
.banner.info { background: rgba(255,0,128,.12); color: #ffd0e6; border: 1px solid rgba(255,0,128,.45); }
.mode-badge { color: var(--a); font-weight: 600; margin-bottom: 4px; }
.mode-badge:empty { display: none; }

/* Main card */
.card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(255,0,128,.55), 0 0 44px rgba(255,0,128,.22); }
.tabs { display: flex; background: #050507; }
.tab { flex: 1; border: 0; background: transparent; color: #fff; padding: 16px 10px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; opacity: .82; }
.tab .ico { font-size: 14px; }
.tab:hover { opacity: 1; }
.tab.active { background: linear-gradient(135deg, var(--a), var(--b)); color: #fff; opacity: 1; }

.pane { display: none; padding: 26px 30px 30px; color: var(--ink); }
.pane.active { display: block; }

/* Query controls */
.toprow { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.inline { font-size: 13.5px; color: #333; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.chk { font-size: 13.5px; color: #333; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.chk input { accent-color: var(--a); width: 16px; height: 16px; }
.divider { height: 1.5px; background: linear-gradient(90deg, var(--a), var(--b)); opacity: .5; margin: 18px 0 20px; border-radius: 2px; }

select, input[type=text], input[type=password], input[type=number], textarea {
  font: inherit; font-size: 14px; border: 2px solid #e6dbe4; border-radius: 9px; padding: 9px 12px; background: #fff; color: var(--ink); outline: none;
}
select:focus, input:focus, textarea:focus { border-color: var(--a); }
textarea { width: 100%; resize: vertical; }

/* Schema upload card */
.schema-card { border: 1.5px solid #f4cfe4; background: linear-gradient(180deg, #fff6fb, #fff); border-radius: 12px; padding: 16px 18px; margin-bottom: 20px; }
.schema-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.schema-title { font-weight: 700; color: var(--a); font-size: 14.5px; }
.btn-pink-sm { background: linear-gradient(135deg, var(--a), var(--b)); color: #fff; border: 0; border-radius: 9px; padding: 8px 15px; font-weight: 600; font-size: 13px; cursor: pointer; }
.btn-pink-sm:hover { filter: brightness(1.06); }
.schema-options { background: #eef4ff; border-radius: 9px; padding: 12px 16px 12px 8px; margin-bottom: 14px; }
.schema-options ul { margin: 0; padding-left: 22px; color: #2f3a52; font-size: 12.8px; line-height: 1.75; }
.schema-options b { color: #1f2a44; }
.upload-area { display: grid; gap: 10px; margin-bottom: 14px; padding: 12px; border: 1.5px dashed #f0bcda; border-radius: 10px; }
.upload-area input[type=file] { font-size: 13px; }
.use-schema { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: #333; }
.use-schema select { flex: 1; }

/* Ask row */
.ask-row { display: flex; gap: 12px; margin-top: 6px; }
.ask-row input { flex: 1; font-size: 15px; padding: 13px 16px; border-radius: 11px; }
.ask-btn { background: linear-gradient(135deg, var(--a), var(--b)); color: #fff; border: 0; border-radius: 11px; padding: 0 26px; font-weight: 600; font-size: 15px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.ask-btn:hover { filter: brightness(1.06); }
.ask-btn:disabled { opacity: .55; cursor: not-allowed; }
.examples-wrap { margin-top: 14px; }
.ex-label { font-size: 13px; color: #555; }
.examples { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 9px; }
.chip { background: #fff; border: 1.5px solid #f0bcda; color: var(--a); border-radius: 999px; padding: 8px 15px; font-size: 13px; cursor: pointer; }
.chip:hover { background: var(--a); color: #fff; border-color: var(--a); }

/* Tools */
.lbl { display: block; font-size: 11px; letter-spacing: .4px; text-transform: uppercase; color: var(--mut); margin: 0 0 6px; }
.tool-btns { display: flex; gap: 8px; margin-left: auto; }
.ghost { background: #fff; border: 1.5px solid #e6dbe4; border-radius: 9px; padding: 9px 16px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.ghost:hover { border-color: var(--a); color: var(--a); }

/* Results */
.out { margin-top: 18px; }
.loading { color: var(--mut); font-size: 14px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--a); border-top-color: transparent; border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -2px; margin-right: 7px; }
@keyframes sp { to { transform: rotate(360deg); } }
.err { color: #c0143c; background: #ffe9ef; padding: 12px 14px; border-radius: 11px; }
.warn { color: #a15c00; background: #fff6e6; padding: 9px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 10px; }
.clarify { background: #fff0f7; padding: 12px 14px; border-radius: 11px; color: var(--ink); }
.cand { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 14px; margin: 12px 0; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.cand.blocked { opacity: .7; }
.chead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.label { font-weight: 700; font-size: 13.5px; }
.tag2 { font-size: 10px; color: #0a7d2c; background: #eaffea; padding: 1px 7px; border-radius: 999px; margin-left: 5px; }
.conf { flex: 1; height: 7px; background: #f0e2ea; border-radius: 7px; overflow: hidden; min-width: 60px; }
.bar { display: block; height: 100%; background: linear-gradient(90deg, var(--a), var(--b)); }
.pct { font-size: 11.5px; color: #a03; font-weight: 700; min-width: 36px; text-align: right; }
pre.sql { background: #12121a; color: #f5f0f8; padding: 14px; border-radius: 10px; overflow: auto; font-size: 13px; font-family: 'Cascadia Code', Consolas, monospace; white-space: pre-wrap; margin: 8px 0; }
.why { font-size: 12.5px; color: var(--mut); margin: 3px 0 6px; }
.assum { font-size: 12px; color: #7a9a3a; margin: 2px 0 6px; }
.blockmsg { color: #c0143c; font-size: 12.5px; margin-bottom: 6px; }
.actions { display: flex; gap: 8px; }
.actions button { border: 1.5px solid #e6dbe4; background: #fff; border-radius: 9px; padding: 7px 15px; font-size: 13px; cursor: pointer; font-weight: 600; color: var(--ink); }
.actions .copy { background: var(--a); color: #fff; border-color: var(--a); }
.actions .copy:disabled { opacity: .5; cursor: not-allowed; }
.toolbox { background: #faf5f8; border: 1px solid var(--line); border-radius: 11px; padding: 14px; font-size: 13.5px; white-space: pre-wrap; color: var(--ink); }

/* Execution results */
.sandbox-note { font-size: 12.5px; color: var(--a); font-weight: 600; }
.actions .run { background: linear-gradient(135deg, var(--a), var(--b)); color: #fff; border-color: transparent; }
.runmeta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: #0a7d2c; margin: 10px 0 8px; }
.runmeta b { font-size: 13px; }
.csv { margin-left: auto; background: #fff; border: 1.5px solid #e6dbe4; border-radius: 8px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--ink); }
.csv:hover { border-color: var(--a); color: var(--a); }
.tscroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; max-height: 420px; overflow-y: auto; }
.rtable { border-collapse: collapse; width: 100%; font-size: 12.8px; }
.rtable th { position: sticky; top: 0; background: linear-gradient(135deg, var(--a), var(--b)); color: #fff; text-align: left; padding: 9px 12px; font-weight: 600; white-space: nowrap; }
.rtable td { padding: 8px 12px; border-top: 1px solid #f3edf1; white-space: nowrap; }
.rtable tbody tr:nth-child(even) { background: #fdf7fb; }
.rtable tbody tr:hover { background: #fff0f7; }
.nullv { color: #b8a8b2; font-style: italic; }
.schema-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--mut); margin-bottom: 12px; }
.ghost.small-reset { padding: 6px 12px; font-size: 12px; }
.tcount { font-size: 11px; color: var(--mut); font-weight: 400; margin-left: 8px; }

/* History + Schema tabs */
.hist .h { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; margin-bottom: 9px; cursor: pointer; }
.hist .h:hover { background: #fff5fa; }
.hist .hq { font-weight: 600; font-size: 13.5px; }
.hist .hm { font-size: 11.5px; color: var(--mut); margin-top: 3px; }
.empty { text-align: center; color: var(--mut); padding: 34px 0; }
.schema-h { margin: 0 0 14px; font-size: 18px; color: var(--ink); }
.schema-view .tbl { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.schema-view .tname { font-weight: 700; color: var(--a); margin-bottom: 5px; }
.schema-view .cols { font-family: 'Cascadia Code', Consolas, monospace; font-size: 12.5px; color: #444; }

/* Buy + footer */
.buy-now { display: block; width: max-content; margin: 26px auto 0; background: linear-gradient(135deg, var(--a), var(--b)); color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: .5px; padding: 14px 44px; border-radius: 11px; box-shadow: var(--glow); }
.buy-now:hover { filter: brightness(1.08); }
.app-foot { text-align: center; color: #8a8a92; font-size: 12.5px; margin-top: 22px; line-height: 1.7; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 60; }
.sheet { background: #fff; color: var(--ink); border-radius: 18px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; padding: 22px; box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.sheet-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; margin-bottom: 16px; }
.logo.sm { font-size: 20px; color: var(--a); } .logo.sm b { color: var(--b); }
.sheet-head .x { margin-left: auto; background: none; border: 0; font-size: 24px; cursor: pointer; color: #999; }
.modes { display: grid; gap: 9px; margin-bottom: 14px; }
.mode { display: flex; gap: 10px; align-items: flex-start; border: 2px solid #eadfe6; border-radius: 12px; padding: 11px; cursor: pointer; }
.mode:has(input:checked) { border-color: var(--a); background: #fff5fa; }
.mode input { margin-top: 3px; accent-color: var(--a); }
.mode b { display: block; font-size: 13.5px; } .mode span { display: block; font-size: 12px; color: var(--mut); margin-top: 2px; }
.sheet .lbl { margin-top: 10px; }
.sheet input, .sheet select { width: 100%; margin-bottom: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.safe-cell { display: flex; align-items: flex-end; padding-bottom: 8px; }
.chk.block { margin: 12px 0; }
.sheet-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.primary { background: linear-gradient(135deg, var(--a), var(--b)); color: #fff; border: 0; padding: 11px 22px; border-radius: 11px; font-weight: 600; font-size: 14px; cursor: pointer; }
.smsg { font-size: 13px; } .smsg.ok { color: #0a7d2c; } .smsg.bad { color: #c0143c; }
.warn-note { font-size: 11.5px; color: var(--mut); margin-top: 14px; }

.hidden { display: none !important; }

@media (max-width: 620px) {
  .logo { font-size: 38px; } .hero-tag { font-size: 16px; }
  .pane { padding: 20px 16px; } .two { grid-template-columns: 1fr; }
  .ask-row { flex-direction: column; } .ask-btn { padding: 12px; justify-content: center; }
  .tab { font-size: 13px; padding: 13px 6px; } .tab .ico { display: none; }
}
