:root { --accent: #2563eb; --navy: #0b1b3a; --text: #0f172a; --muted: #64748b; --line: #e2e8f0; --bg: #f6f8fc; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
input, textarea { width: 100%; font: inherit; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--text); }
input:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
.error { color: #b91c1c; font-size: 14px; margin-top: 10px; min-height: 1em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px; border: 0; background: var(--accent); color: #fff; font: 600 15px Inter, sans-serif; cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.wide { width: 100%; margin-top: 20px; padding: 13px; }
.btn.ghost { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); }
.btn.ghost-dark { background: #fff; color: var(--text); border: 1px solid var(--line); }
.logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--accent); overflow: hidden; flex: none; }
.logo.big { width: 64px; height: 64px; border-radius: 18px; font-size: 24px; margin: 0 auto 14px; }
.logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* sign-in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 520px at 85% -10%, rgba(34, 211, 238, .22), transparent 60%), radial-gradient(800px 480px at -10% 110%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 60%), var(--navy); }
.login-card { width: 100%; max-width: 410px; background: #fff; border-radius: 22px; padding: 34px 30px; box-shadow: 0 40px 90px rgba(0, 0, 0, .45); text-align: left; }
.login-card h1 { text-align: center; font-size: 24px; margin: 0; letter-spacing: -.02em; }
.login-card > p.muted:first-of-type { text-align: center; margin: 6px 0 8px; }
.login-card .secure { text-align: center; margin-top: 18px; }

/* dashboard */
.top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand small { display: block; color: #94a3b8; font-size: 12px; }
.user { position: relative; display: flex; align-items: center; gap: 10px; }
.user .av { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.badge.owner { background: #fef3c7; color: #92400e; border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.menu { position: absolute; right: 0; top: 52px; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(2, 8, 23, .2); min-width: 230px; padding: 6px; }
.menu-head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-head small { display: block; color: var(--muted); }
.menu button, .menu a { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 10px; font: 500 14px Inter, sans-serif; color: var(--text); cursor: pointer; }
.menu button:hover, .menu a:hover { background: #f1f5f9; }
.hero { color: #fff; padding: 48px 0 54px; background: radial-gradient(900px 480px at 90% -20%, rgba(34, 211, 238, .22), transparent 60%), radial-gradient(700px 420px at -10% 120%, color-mix(in srgb, var(--accent) 60%, transparent), transparent 60%), var(--navy); }
.eyebrow { color: #67e8f9; font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -.03em; margin: 10px 0; }
.hero p { color: #cbd5e1; font-size: 18px; margin: 0; max-width: 640px; }
main.wrap { padding: 36px 20px 120px; }
main section { margin-bottom: 34px; }
.sec-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
h2 { font-size: 20px; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; color: var(--text); box-shadow: 0 10px 30px rgba(2, 8, 23, .06); transition: transform .2s, box-shadow .2s; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(2, 8, 23, .12); }
.card .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: color-mix(in srgb, var(--accent) 12%, #fff); margin-bottom: 6px; }
.card b { font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; flex: 1; }
.card .go { color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 8px; }
.contact { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.contact p { margin: 4px 0 0; color: var(--muted); }
.cbtns { display: flex; gap: 10px; flex-wrap: wrap; }
.foot { color: var(--muted); font-size: 14px; padding: 26px 0 40px; border-top: 1px solid var(--line); }

/* chat windows */
.dock { position: fixed; right: 16px; bottom: 0; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 12px; z-index: 50; pointer-events: none; }
.chatwin { pointer-events: auto; width: 360px; height: 500px; background: #fff; border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; box-shadow: 0 20px 60px rgba(2, 8, 23, .28); display: flex; flex-direction: column; overflow: hidden; }
.chatwin.min { height: 46px; }
.cw-head { display: flex; align-items: center; gap: 6px; padding: 0 8px 0 14px; height: 46px; background: var(--navy); color: #fff; cursor: pointer; flex: none; }
.cw-head b { flex: 1; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-head button { background: none; border: 0; color: #cbd5e1; font-size: 15px; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.cw-head button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.cw-dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; flex: none; }
.cw-banner { font-size: 13px; padding: 8px 12px; background: #eff6ff; color: #1e3a8a; flex: none; }
.cw-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #f8fafc; }
.cw-m { max-width: 86%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.cw-m.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.cw-m.user a { color: #fff; text-decoration: underline; }
.cw-m.assistant, .cw-m.agent { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.cw-m.agent { border-color: #86efac; } .cw-m.agent small { display: block; color: #16a34a; font-weight: 700; font-size: 11px; }
.cw-m.system { align-self: center; background: #f1f5f9; color: var(--muted); font-size: 12.5px; text-align: center; }
.cw-m.typing { color: var(--muted); letter-spacing: 2px; }
.cw-m code { background: #f1f5f9; padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.cw-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); flex: none; }
.cw-form textarea { resize: none; min-height: 42px; max-height: 120px; padding: 10px 12px; }
.cw-form .btn { padding: 0 14px; }
.chatwin.min .cw-banner, .chatwin.min .cw-msgs, .chatwin.min .cw-form { display: none; }

.modal { position: fixed; inset: 0; background: rgba(2, 6, 23, .55); display: grid; place-items: center; z-index: 80; padding: 20px; }
.modal-card { background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 400px; }
.modal-card h3 { margin: 0 0 4px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 12px; opacity: 0; transition: all .25s; z-index: 90; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) {
  .dock { right: 0; left: 0; }
  .chatwin { width: 100%; height: calc(100vh - 60px); border-radius: 16px 16px 0 0; }
  .bar .btn span#userName { display: none; } .brand small { display: none; } .badge.owner { display: none; }
}
