:root {
  --bg: #070b12;
  --bg2: #0b1220;
  --panel: #101a2b;
  --panel2: #142138;
  --line: #223450;
  --text: #e8eef8;
  --muted: #94a3bb;
  --accent: #63d2ff;
  --accent2: #8b7bff;
  --good: #47d18c;
  --warn: #ffb347;
  --bad: #ff6b7a;
  --radius: 14px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  background:
    radial-gradient(1100px 700px at 82% -10%, rgba(99, 210, 255, .16), transparent 60%),
    radial-gradient(900px 600px at 8% 8%, rgba(139, 123, 255, .14), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(7, 11, 18, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(34, 52, 80, .7);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); }
.logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, #12335a, #0b1c33);
  border: 1px solid #2a4d79; color: var(--accent);
  font-weight: 800; letter-spacing: .5px;
}
.topbar nav { display: flex; gap: 18px; font-size: 14px; }
.topbar nav a { color: var(--muted); }
.topbar nav a:hover { color: var(--text); }

main { width: min(1180px, 94vw); margin: 0 auto; }

.hero {
  display: grid; grid-template-columns: 1.12fr .88fr; gap: clamp(24px, 5vw, 64px);
  align-items: center; padding: clamp(40px, 7vw, 90px) 0 30px;
}
.pill {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
  background: rgba(99, 210, 255, .09); border: 1px solid rgba(99, 210, 255, .3);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1.06; letter-spacing: -.03em; }
.accent { color: var(--accent); }
.lede { color: #c3cee0; font-size: clamp(16px, 2vw, 19px); margin: 18px 0 26px; max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.ticks { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin-top: 28px; color: var(--muted); font-size: 14px; }
.ticks li::before { content: "✓"; color: var(--good); font-weight: 800; margin-right: 8px; }

.hero-card { perspective: 1200px; }
.mini-site {
  background: linear-gradient(180deg, #0e1830, #0a1325);
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow); transform: rotateY(-4deg) rotateX(2deg);
}
.mini-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: #0a1120; border-bottom: 1px solid var(--line); }
.mini-bar > span { width: 9px; height: 9px; border-radius: 50%; background: #2a3a55; }
.mini-bar > span:nth-child(1) { background: #ff6b7a; }
.mini-bar > span:nth-child(2) { background: #ffb347; }
.mini-bar > span:nth-child(3) { background: #47d18c; }
.mini-url { margin-left: 8px; font-size: 11px; color: var(--muted); background: #0d1627; border: 1px solid var(--line); padding: 4px 10px; border-radius: 6px; flex: 1; }
.mini-body { padding: 22px; }
.mini-logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, #17406e, #0d2444); color: var(--accent); font-weight: 800; margin-bottom: 12px; }
.mini-body h3 { font-size: 22px; }
.mini-body > p { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.mini-chat { display: grid; gap: 8px; }
.bubble { font-size: 12.5px; padding: 9px 12px; border-radius: 12px; max-width: 90%; }
.bubble.bot { background: #12213a; border: 1px solid var(--line); }
.bubble.user { background: #1b3c66; justify-self: end; }
.mini-input { margin-top: 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #0b1424; border-radius: 10px; padding: 9px 12px; color: #6f7f99; font-size: 12px; }
.mini-input button { margin-left: auto; background: #17406e; color: var(--accent); border: 0; border-radius: 7px; padding: 4px 9px; }

.panel { padding: clamp(28px, 5vw, 58px) 0; border-top: 1px solid rgba(34, 52, 80, .5); }
.panel-head { margin-bottom: 26px; }
.panel-head h2 { font-size: clamp(24px, 3.4vw, 36px); letter-spacing: -.02em; }
.panel-head p { color: var(--muted); margin-top: 8px; }

.form {
  background: linear-gradient(180deg, rgba(20, 33, 56, .75), rgba(10, 18, 32, .85));
  border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow);
}
.row { display: grid; gap: 16px; margin-bottom: 16px; }
.row.two { grid-template-columns: 1fr 1fr; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }
label { display: block; font-size: 13px; font-weight: 700; color: #cdd8ea; }
label .muted, .muted { color: var(--muted); font-weight: 500; }
.req { color: var(--accent); }
input, select, textarea {
  width: 100%; margin-top: 7px; background: #0a1323; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  font: inherit; font-size: 14px; outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: #3a6b9f; box-shadow: 0 0 0 3px rgba(99, 210, 255, .1); }
textarea { resize: vertical; min-height: 120px; padding-right: 70px; }
.textarea-wrap { position: relative; }
.mic {
  position: absolute; right: 10px; bottom: 12px; display: flex; align-items: center; gap: 6px;
  background: #16294a; border: 1px solid #2b4c78; color: var(--accent); border-radius: 999px;
  padding: 7px 12px; font-size: 12px; cursor: pointer;
}
.mic.rec { background: #5a1f2a; border-color: #a33b4a; color: #ffd8dd; animation: pulse 1.3s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 107, 122, .14); } }
.prefix-input { display: flex; align-items: center; }
.prefix-input input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.prefix-input span { margin-top: 7px; padding: 11px 10px; background: #0d1728; border: 1px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0; color: var(--muted); font-size: 12px; white-space: nowrap; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; display: block; }
.ai-row { display: flex; align-items: center; gap: 12px; margin: 6px 0 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: #16233a; color: var(--text);
  padding: 10px 16px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: transform .12s, background .15s, border .15s;
}
.btn:hover { text-decoration: none; border-color: #3a5a85; background: #1b2c49; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #1e6ea8, #15507e); border-color: #2b7fbe; color: #fff; }
.btn.primary:hover { background: linear-gradient(180deg, #2580c0, #185b8e); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 12px; font-size: 12.5px; }
.btn.big { width: 100%; padding: 14px; font-size: 16px; margin-top: 6px; }
.btn[disabled] { opacity: .55; cursor: wait; }
.fine { color: #7d8aa2; font-size: 11.5px; margin-top: 12px; }

.result { margin-top: 20px; border: 1px solid #2b6a4d; background: rgba(32, 90, 65, .18); border-radius: 12px; padding: 18px; }
.result h3 { color: var(--good); margin-bottom: 6px; }
.result .urlbox { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.result code { background: #08111f; border: 1px solid var(--line); padding: 9px 11px; border-radius: 8px; word-break: break-all; font-size: 12.5px; flex: 1; min-width: 220px; }
.result .warn { color: var(--warn); font-size: 12.5px; margin-top: 8px; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step .num { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: rgba(99, 210, 255, .1); color: var(--accent); font-weight: 800; margin-bottom: 12px; }
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 13.5px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { background: linear-gradient(180deg, #0e192c, #0b1424); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature h3 { font-size: 16px; margin-bottom: 6px; color: #dfe9f7; }
.feature p { color: var(--muted); font-size: 13.5px; }

.footer {
  width: min(1180px, 94vw); margin: 20px auto 0; padding: 26px 0 40px;
  border-top: 1px solid rgba(34, 52, 80, .6); color: var(--muted); font-size: 12.5px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ------------------------------------------------------------- tenant page */
.tenant-wrap { width: min(1080px, 94vw); margin: 0 auto; }
.tenant-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; flex-wrap: wrap; }
.tenant-brand { display: flex; align-items: center; gap: 14px; }
.tenant-mark {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(145deg, #17406e, #0c2340); border: 1px solid #2a4d79;
  color: var(--accent); font-size: 24px; font-weight: 800;
}
.tenant-brand h1 { font-size: clamp(22px, 3.4vw, 30px); line-height: 1.1; }
.tenant-meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin: 0 3px 1px; }
.tenant-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tenant-main { display: grid; gap: 18px; }
.tenant-hero, .assistant, .tenant-info > .info-card {
  background: linear-gradient(180deg, rgba(18, 30, 51, .85), rgba(10, 18, 32, .9));
  border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3.4vw, 34px);
}
.tenant-hero h2 { font-size: clamp(26px, 4vw, 42px); line-height: 1.12; letter-spacing: -.02em; margin-bottom: 12px; }
.tenant-hero > p { color: #c4cfe1; max-width: 72ch; white-space: pre-wrap; }
.tenant-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; font-size: 14px; }
.app-card { display: flex; align-items: center; gap: 16px; margin-top: 24px; padding: 16px; background: #0b1627; border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.app-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, #1d5a34, #123a22); color: #9df0bf; font-size: 22px; }
.app-card .btn { margin-left: auto; }

.assistant { display: flex; flex-direction: column; min-height: 420px; }
.assistant-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.assistant-title { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.ai-orb { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(145deg, #2a2a6e, #16163f); color: #b9b2ff; font-size: 13px; }
.rag-badge { font-size: 10.5px; font-weight: 600; color: var(--good); background: rgba(71, 209, 140, .1); border: 1px solid rgba(71, 209, 140, .3); padding: 3px 8px; border-radius: 999px; }
.speak-toggle { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 7px; cursor: pointer; }
.speak-toggle input { width: auto; margin: 0; accent-color: var(--accent); }

.chat { flex: 1; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 440px; padding: 6px 2px 14px; }
.msg { max-width: 86%; padding: 11px 14px; border-radius: 13px; font-size: 14.5px; white-space: pre-wrap; }
.msg.bot { background: #12213a; border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.user { background: #1b3c66; border: 1px solid #2a5687; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg.typing { color: var(--muted); font-style: italic; }
.composer { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; }
.composer input { margin: 0; }
.mic-btn {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 11px; border: 1px solid #2b4c78;
  background: #16294a; color: var(--accent); font-size: 18px; cursor: pointer;
}
.mic-btn.rec { background: #5a1f2a; border-color: #a33b4a; animation: pulse 1.3s infinite; }
.composer .send { flex: 0 0 auto; }
.assistant-foot { display: flex; justify-content: space-between; gap: 12px; color: #74829a; font-size: 11.5px; margin-top: 10px; flex-wrap: wrap; }
.assistant-foot span:last-child { text-align: right; }

.tenant-info { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.info-card h3 { font-size: 15px; margin-bottom: 12px; }
.info-card p { color: #c3cee0; font-size: 13.5px; margin-bottom: 12px; }
.info-card .small { font-size: 11.5px; }
.contact-form { display: grid; gap: 9px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.contact-form input, .contact-form textarea { margin-top: 0; font-size: 13px; padding: 9px 10px; }
.contact-form textarea { min-height: 78px; padding-right: 10px; }
.contact-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.tenant-foot { width: 100%; }

.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.card { width: min(560px, 94vw); background: linear-gradient(180deg, #101c31, #0b1424); border: 1px solid var(--line); border-radius: 16px; padding: 34px; text-align: center; box-shadow: var(--shadow); }
.card h1 { font-size: clamp(22px, 4vw, 30px); margin-bottom: 12px; }
.card p { margin-bottom: 18px; }
.card .btn { margin: 6px; }

/* ---------------------------------------------------------------- manage/admin */
.app-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; flex-wrap: wrap; }
.app-head h1 { font-size: 24px; }
.app-head .sub { color: var(--muted); font-size: 13px; }
.manage-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.card-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card-box h2 { font-size: 16px; margin-bottom: 12px; }
.card-box h3 { font-size: 14px; margin-bottom: 10px; }
.card-box label { margin-bottom: 10px; }
.card-box textarea { min-height: 90px; padding-right: 12px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 7px 0; border-bottom: 1px dashed #1c2b42; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.badge { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.badge.ready, .badge.live { background: rgba(71, 209, 140, .12); color: var(--good); border: 1px solid rgba(71, 209, 140, .3); }
.badge.indexing { background: rgba(255, 179, 71, .12); color: var(--warn); border: 1px solid rgba(255, 179, 71, .3); }
.badge.error, .badge.suspended { background: rgba(255, 107, 122, .12); color: var(--bad); border: 1px solid rgba(255, 107, 122, .3); }
.list { display: grid; gap: 8px; }
.list-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; background: #0b1526; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 13px; }
.list-item .sub { color: var(--muted); font-size: 11.5px; }
.list-item button { background: transparent; border: 1px solid #4a2630; color: #ff9ba6; border-radius: 7px; padding: 4px 9px; font-size: 11px; cursor: pointer; }
.msg-item { background: #0b1526; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 13px; }
.msg-item .meta { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.upload-row input[type=file] { font-size: 12px; padding: 8px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 60; background: #0f2035; border: 1px solid #2c4c74; color: var(--text); padding: 12px 16px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow); max-width: 380px; }
.toast.err { border-color: #6a2a34; color: #ffc9d0; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #1c2b42; vertical-align: top; }
.table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.table a { word-break: break-all; }

/* ------------------------------------------------------------------- widget */
.si-widget-btn {
  position: fixed; right: 18px; bottom: 18px; z-index: 9998;
  width: 56px; height: 56px; border-radius: 50%; border: 1px solid #2b7fbe;
  background: linear-gradient(145deg, #1e6ea8, #12466f); color: #fff; font-size: 22px;
  cursor: pointer; box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
.si-widget {
  position: fixed; right: 18px; bottom: 84px; z-index: 9999; width: min(380px, calc(100vw - 24px));
  background: #0d1729; border: 1px solid #2a4a72; border-radius: 16px; overflow: hidden;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .55); display: none; font-family: ui-sans-serif, system-ui, sans-serif;
}
.si-widget.open { display: block; }
.si-widget header { padding: 12px 14px; background: #10223b; border-bottom: 1px solid #223a5a; color: #e8eef8; font-weight: 700; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; }
.si-widget header button { background: none; border: 0; color: #94a3bb; font-size: 18px; cursor: pointer; }
.si-widget .body { height: 300px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.si-widget .m { max-width: 88%; padding: 8px 11px; border-radius: 11px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.si-widget .m.bot { background: #12213a; border: 1px solid #223450; color: #dbe5f4; align-self: flex-start; }
.si-widget .m.user { background: #1b3c66; color: #fff; align-self: flex-end; }
.si-widget .foot { display: flex; gap: 7px; padding: 10px; border-top: 1px solid #223450; }
.si-widget .foot input { flex: 1; margin: 0; background: #0a1323; border: 1px solid #223450; color: #e8eef8; border-radius: 8px; padding: 9px 10px; font-size: 13px; }
.si-widget .foot button { background: #1e6ea8; border: 0; color: #fff; border-radius: 8px; padding: 9px 12px; cursor: pointer; font-weight: 700; }
.si-widget .ftr { padding: 6px 12px 10px; color: #64748b; font-size: 10px; text-align: right; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-card { display: none; }
  .steps, .grid, .manage-grid, .tenant-info { grid-template-columns: 1fr 1fr; }
  .row.three { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .steps, .grid, .manage-grid, .tenant-info { grid-template-columns: 1fr; }
  .row.two { grid-template-columns: 1fr; }
  .ticks { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
  .topbar nav a:first-child { display: none; }
  .assistant-foot span:last-child { display: none; }
}
