:root {
  color-scheme: light;
  --ink: #152338;
  --sub: #53637b;
  --muted: #667690;
  --edge: #e2e9f3;
  --surface: #fff;
  --canvas: #f4f7fb;
  --blue: #174eca;
  --blue-light: #edf4ff;
  --navy: #102138;
  --green: #116347;
  --amber: #875500;
  --danger: #a82b38;
  --radius: 15px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); min-width: 320px; font-size: 16px; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #669df9; outline-offset: 3px; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(1.65rem,3vw,2.2rem); line-height: 1.15; letter-spacing: -.035em; }
h2 { font-size: 1.15rem; line-height: 1.35; }
h3 { font-size: 1rem; }
p { line-height: 1.6; }
small, .small { font-size: .83rem; color: var(--muted); }
.subtle { color: var(--sub); }
.mono { font: .83rem ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.initial { padding: 12vh 24px; text-align: center; color: var(--sub); }
.app { min-height: 100vh; }
.sidebar { z-index: 5; position: fixed; inset: 0 auto 0 0; width: 245px; background: var(--navy); color: #d9e4f4; display: flex; flex-direction: column; padding: 26px 18px 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { text-decoration: none; }
.mark { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 12px; background: linear-gradient(145deg,#4c87fa,#275de2); color: #fff; font-size: 1.45rem; font-weight: 800; letter-spacing: -.09em; box-shadow: 0 8px 20px #1c51cf35; padding-right: 2px; }
.brand strong { display: block; font-size: 1.12rem; letter-spacing: -.02em; }
.brand small { color: #a4b5cd; display: block; margin-top: 3px; }
.sidebar nav { margin-top: 32px; overflow: auto; display: grid; gap: 5px; flex: 1; align-content: start; }
.sidebar a.nav-link { color: #c4d2e7; border-radius: 9px; display: flex; align-items: center; gap: 11px; padding: 10px 11px; font-size: .92rem; min-height: 43px; }
.sidebar a.nav-link:hover { background: #1c3452; text-decoration: none; color: #fff; }
.sidebar a.nav-link[aria-current="page"] { background: #254d94; color: #fff; font-weight: 650; }
.nav-symbol { width: 21px; text-align: center; font: 1.10rem system-ui, sans-serif; }
.sidebar-user { border-top: 1px solid #334961; margin-top: 10px; padding: 15px 4px 0; display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #cee0ff; background: #29405f; flex-shrink: 0; font-size: .9rem; font-weight: 700; }
.identity { flex: 1; min-width: 0; }
.identity strong, .identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity small { color: #a9bad1; margin-top: 3px; }
.logout { padding: 7px 8px; border-radius: 8px; background: #233a58; color: #e9f0ff; border: 0; font-size: .82rem; }
.frame { margin-left: 245px; }
.top { padding: 0 28px; height: 71px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border-bottom: 1px solid var(--edge); }
.top-left, .top-right, .row { display: flex; align-items: center; gap: 11px; }
.top small { font-size: .88rem; }
.menu-btn { display: none !important; }
.content { max-width: 1480px; margin: 0 auto; padding: 26px 28px 38px; }
.page-heading { display: flex; gap: 17px; align-items: center; justify-content: space-between; margin-bottom: 23px; }
.page-heading p { margin-top: 7px; color: var(--sub); }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.end { justify-content: flex-end; }
.stack { display: grid; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.grid3 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; }
.card { padding: 18px; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.card h2 + .small, .card h3 + .small { margin-top: 5px; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 17px; }
.hero { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; align-items: center; margin-bottom: 18px; padding: 26px 28px; overflow: hidden; border-radius: 17px; color: #fff; background: radial-gradient(ellipse at 95% 140%,#3679f0 3%,transparent 60%), linear-gradient(122deg,#122e64,#1843a3 61%,#1b59cf); }
.hero::after { content: ""; pointer-events: none; position: absolute; width: 320px; height: 320px; right: -49px; top: -82px; border: 1px solid #e9f2ff25; border-radius: 50%; box-shadow: 0 0 0 30px #e9f2ff10, 0 0 0 60px #e9f2ff0d, 0 0 0 90px #e9f2ff08; }
.hero > div { position: relative; z-index: 1; }
.hero .eyebrow { color: #c7dcff; font-size: .88rem; font-weight: 700; margin-bottom: 9px; }
.hero h1 { font-size: clamp(1.65rem,3.1vw,2.55rem); }
.hero .subtle { color: #d0dfff; margin-top: 8px; max-width: 600px; }
.hero-actions { justify-content: flex-end; flex-wrap: wrap; }
.metric .small { color: var(--sub); font-size: .87rem; }
.metric strong { display: block; margin: 8px 0 5px; font-size: 1.76rem; letter-spacing: -.07em; overflow-wrap: anywhere; }
.metric .number-blue { color: var(--blue); }
button, .btn { border: 1px solid #d2ddec; color: var(--ink); background: white; border-radius: 8px; padding: 9px 13px; min-height: 39px; display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 6px; font-size: .88rem; font-weight: 650; line-height: 1.15; }
button:hover, .btn:hover { background: #f1f6ff; text-decoration: none; }
.primary { background: #2058dc; border-color: #2058dc; color: #fff; }
.primary:hover { background: #1848b4; }
.hero .primary { color: #19499f; background: #fff; border-color: #fff; }
.hero .primary:hover { background: #e6efff; }
.hero .secondary { color: #eef5ff; background: #2859bc; border-color: #83a8f0; }
.hero .secondary:hover { background: #396bcf; }
.compact { padding: 6px 9px; min-height: 32px; font-size: .83rem; }
button.danger { color: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
.version { white-space: nowrap; }
.pill { border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: .81rem; font-weight: 650; padding: 5px 9px; line-height: 1.25; background: #edf1f7; color: #52627d; white-space: nowrap; }
.pill.good { background: #e6f7ed; color: #176345; }
.pill.warn { background: #fff3da; color: #825200; }
.pill.bad { background: #fbe8ec; color: #a02939; }
.pill.blue { background: #eaf1ff; color: #2355ae; }
.note { border: 1px solid #d8e5fb; border-radius: 10px; padding: 11px 13px; color: #2d527b; background: #f0f6ff; font-size: .88rem; }
.note.warn { background: #fff7e6; border-color: #f5dfb0; color: #885800; }
.empty { padding: 32px 13px; color: var(--sub); text-align: center; border: 1px dashed var(--edge); border-radius: 10px; }
.scroll-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: .89rem; }
thead { background: #f6f8fc; font-size: .82rem; color: #50617a; }
th { font-weight: 700; }
th, td { padding: 11px 10px; border-bottom: 1px solid #edf0f6; vertical-align: middle; }
td:first-child,th:first-child { padding-left: 13px; }
tbody tr:hover { background: #f9fbff; }
td .row { gap: 5px; }
td small { display: block; margin-top: 2px; }
.table-title { font-weight: 650; }
.chart { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 12px; height: 156px; padding: 4px 0 0; }
.chart-col { display: grid; grid-template-rows: 1fr 20px; justify-items: center; align-items: end; text-align: center; min-width: 0; }
.chart-col .bar-area { height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 5px; width: 100%; }
.chart-col .bar { width: min(68%,34px); min-height: 3px; border-radius: 5px 5px 1px 1px; background: linear-gradient(#5988ff,#2860db); }
.bar[data-level="0"] {height: 3px; opacity: .4;}
.bar[data-level="1"] {height: 10%}
.bar[data-level="2"] {height: 20%}
.bar[data-level="3"] {height: 30%}
.bar[data-level="4"] {height: 40%}
.bar[data-level="5"] {height: 50%}
.bar[data-level="6"] {height: 60%}
.bar[data-level="7"] {height: 70%}
.bar[data-level="8"] {height: 80%}
.bar[data-level="9"] {height: 90%}
.bar[data-level="10"] {height: 100%}
.chart-col small { white-space: nowrap; font-size: .75rem; }
.funnel { display: grid; gap: 12px; }
.funnel > div { display: grid; gap: 3px; }
.funnel span { color: var(--sub); font-size: .84rem; }
meter { width: 100%; height: 14px; accent-color: #386ee6; }
meter::-webkit-meter-bar { border: none; background: #eff3fa; border-radius: 9px; }
meter::-webkit-meter-optimum-value { background: #3a72ec; border-radius: 9px; }
.legend { display: flex; align-items: start; gap: 12px; flex-wrap: wrap; font-size: .86rem; color: var(--sub); }
.link-field { color: #31415c; }
.model-symbol { display: grid; place-items: center; min-width: 40px; height: 40px; border-radius: 10px; background: #eaf2ff; color: #2459c2; font-size: 1rem; font-weight: 800; }
.model-card .panel-heading { align-items: center; }
.model-card .bottom { margin-top: 13px; }
.model-card .small { white-space: normal; }
.card p + p { margin-top: 7px; }
.price { font-size: 1.62rem; font-weight: 750; letter-spacing: -.07em; margin: 8px 0; }
label.field { display: grid; gap: 6px; color: #283951; font-size: .89rem; font-weight: 650; }
.field input,.field select,.field textarea,input.search { display: block; width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #cfdaea; border-radius: 8px; background: #fff; color: var(--ink); font-size: .92rem; }
.field textarea { resize: vertical; min-height: 82px; line-height: 1.5; }
.field small { font-weight: 400; }
fieldset { border: 1px solid var(--edge); border-radius: 9px; padding: 10px 11px; margin: 0; }
legend { font-size: .89rem; font-weight: 700; }
.checks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.checks label, label.check { font-size: .88rem; display: flex; align-items: center; gap: 6px; }
dialog { border: 1px solid #d6e3f4; color: var(--ink); border-radius: 14px; width: min(530px,calc(100vw - 24px)); max-height: 92vh; padding: 20px; box-shadow: 0 25px 90px #172e5750; }
dialog::backdrop { background: #11253c8e; }
.dialog-title { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.form-error { color: var(--danger); font-size: .86rem; min-height: 0; }
.form-error:empty { display: none; }
.dialog-form { display: grid; gap: 12px; }
.toast { z-index: 10; position: fixed; inset: auto 20px 18px auto; background: #17345d; color: white; padding: 11px 13px; border-radius: 8px; max-width: min(420px,calc(100vw - 40px)); font-size: .9rem; box-shadow: 0 8px 28px #13244362; }
.toast:empty { display: none; }
.qr { width: 148px; height: 148px; align-self: center; border: 1px solid var(--edge); border-radius: 8px; }
.qr-center { justify-self: center; }
code.copy-value,pre { display: block; padding: 12px; overflow: auto; border-radius: 9px; background: #eaf0f8; color: #1c3555; font: .82rem ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.chat-layout { display: grid; grid-template-columns: 215px minmax(0,1fr); gap: 16px; }
.thread-list { max-height: 490px; overflow: auto; }
.thread { width: 100%; display: flex; justify-content: flex-start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread.selected { border-color: #8faff4; background: #edf3ff; }
.chat-log { display: grid; gap: 11px; align-content: start; min-height: 243px; max-height: 55vh; overflow: auto; padding: 7px 2px; }
.message { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); border-radius: 10px; background: #f0f5fd; padding: 10px 12px; font-size: .93rem; line-height: 1.55; }
.message.user { background: #e9f0ff; justify-self: end; max-width: 91%; }
.message.assistant { background: #f3f6fa; }
.message .small { display: block; margin-bottom: 4px; }
.promo { max-width: 1240px; margin: 0 auto; padding: 0 25px 50px; }
.promo-header { min-height: 73px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--edge); }
.promo-header .brand small { color: var(--sub); }
.landing { display: grid; grid-template-columns: 1.15fr minmax(320px,.85fr); gap: 30px; align-items: center; padding: 38px 0 29px; }
.landing-main { border-radius: 20px; padding: 36px 30px; background: radial-gradient(circle at 100% 70%,#3479f8,transparent 65%),linear-gradient(147deg,#102d62,#1f4eac); color: #fff; }
.landing h1 { font-size: clamp(2.2rem,5vw,3.6rem); }
.landing-main p { margin: 14px 0 25px; color: #d7e5ff; }
.landing-main .scope-chip { background: #ffffff1c; color: #e3edff; border-color: #ffffff45; }
.scope-chip { display: inline-flex; align-items: center; border: 1px solid var(--edge); background: #f7faff; border-radius: 9px; font-size: .84rem; padding: 7px 9px; }
.demo-accounts { margin-top: 9px; }
.demo-accounts summary { cursor: pointer; color: var(--sub); font-size: .88rem; }
.demo-accounts .row { margin-top: 9px; }
.ticket-post { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 12px; background: #f5f8fc; border-radius: 8px; line-height: 1.55; }
.ticket-post .small { margin-bottom: 4px; }
.search { max-width: 240px; }
@media(max-width:1090px) {
  .grid4 { grid-template-columns: repeat(2,1fr); }
  .grid3 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hero { grid-template-columns: 1fr; }
  .hero-actions { justify-content: flex-start; }
}
@media(max-width:860px) {
  .sidebar { transform: translateX(-100%); transition: transform .18s ease-out; box-shadow: 9px 0 30px #11243c35; }
  body.menu-open .sidebar { transform: translateX(0); }
  .frame { margin-left: 0; }
  .top, .content { padding-left: 17px; padding-right: 17px; }
  .menu-btn { display: inline-flex !important; }
  .landing { grid-template-columns: 1fr; gap: 15px; padding-top: 19px; }
  .promo, .content { padding-bottom: 32px; }
  .landing-main { padding: 26px 21px; }
}
@media(max-width:590px) {
  .grid2, .grid3, .chat-layout { grid-template-columns: 1fr; }
  .grid4 { gap: 9px; }
  .card { padding: 13px; }
  .content { padding-top: 19px; }
  .top { height: 59px; }
  .top-right .btn { display: none; }
  .hero { padding: 19px 17px; }
  .page-heading { flex-wrap: wrap; }
  .page-heading .row { flex-wrap: wrap; }
  .checks { grid-template-columns: 1fr 1fr; }
  .thread-list { max-height: 145px; }
  .chat-log { min-height: 160px; }
  .promo-header .top-right { display: none; }
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }
