@charset "UTF-8";
@font-face{font-family:"PuHuiTi";src:url("/fonts/puhuiti-regular.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"PuHuiTi";src:url("/fonts/puhuiti-medium.woff2") format("woff2");font-weight:500 600;font-style:normal;font-display:swap}
@font-face{font-family:"PuHuiTi";src:url("/fonts/puhuiti-bold.woff2") format("woff2");font-weight:700 900;font-style:normal;font-display:swap}
:root{color-scheme:light;--bg:#fff;--text:#111;--muted:#6e6e6e;--label:#333;--field:#f2f2f2;--field-hover:#ededed;--danger:#d92d20;--field-icon:#6e6e6e;--line:#ececec;--btn:#111;--btn-text:#fff;--btn-active:#2c2c2c;--hover:#f2f2f2}
[data-theme="dark"]{color-scheme:dark;--bg:#0f0f0f;--text:#f2f2f2;--muted:#8b8b8b;--label:#c9c9c9;--field:#1b1b1b;--field-hover:#242424;--danger:#ff6369;--field-icon:#8a8a8a;--line:#262626;--btn:#f2f2f2;--btn-text:#111;--btn-active:#d8d8d8;--hover:#1c1c1c}
:root{font-family:"PuHuiTi","Microsoft YaHei","微软雅黑","Segoe UI",-apple-system,BlinkMacSystemFont,sans-serif;color:var(--text);background:var(--bg);font-size:15px;line-height:1.55;-webkit-font-smoothing:antialiased}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);transition:background-color .15s,color .15s}
h1,p{margin:0}
button,input{font:inherit;color:inherit}
button{cursor:pointer;touch-action:manipulation}
a{color:inherit;text-decoration:none}
.page{width:min(100%,430px);min-height:100svh;margin:0 auto;padding:calc(8px + env(safe-area-inset-top,0px)) 22px calc(10px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column}
.topbar{display:flex;align-items:center;justify-content:space-between;min-height:44px;flex-shrink:0}
.brand{display:flex;align-items:center;justify-content:flex-start;min-height:44px;color:var(--text);white-space:nowrap}
.brand svg{display:block;height:22px;width:auto}
.top-actions{display:flex;align-items:center;gap:2px}
.icon-btn{width:44px;height:44px;display:flex;align-items:center;justify-content:center;border:0;border-radius:10px;background:transparent;color:var(--muted);transition:background-color .15s,color .15s,transform .12s}
.icon-btn:active,.icon-btn.pressed{background:var(--field-hover);color:var(--text);transform:scale(.92)}
.icon-btn[aria-expanded="true"]{background:var(--field-hover);color:var(--text)}.menu-wrap{position:relative}
.menu{position:absolute;top:calc(100% + 4px);right:0;z-index:60;min-width:118px;padding:5px;border:1px solid var(--line);border-radius:10px;background:var(--bg);box-shadow:0 8px 24px #00000014;display:flex;flex-direction:column;gap:2px}
[data-theme="dark"] .menu{box-shadow:0 8px 24px #00000066}
.menu[hidden]{display:none}
.menu button{min-height:40px;padding:0 12px;border:0;border-radius:7px;background:transparent;color:var(--text);font-size:13px;text-align:left}
.menu button:hover,.menu button:focus-visible{background:var(--hover)}
.menu button[aria-checked="true"]{background:var(--hover);font-weight:600}
.icon-btn svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.content{flex:1;display:flex;flex-direction:column;min-height:0}
.view{width:100%;display:flex;flex-direction:column;align-items:center;min-height:0}
.view[hidden]{display:none}
.form-note,.form-error{width:100%;margin:2px 0 0;text-align:center;color:var(--text);font-size:12px;line-height:1.7;overflow-wrap:anywhere}
.form-note:empty,.form-error:empty{display:none}
.center{flex:1;display:flex;flex-direction:column;justify-content:center;min-height:0}
.app-icon{width:60px;height:60px;margin:0 auto;border-radius:17px;background:var(--field);display:flex;align-items:center;justify-content:center;color:var(--field-icon);flex-shrink:0;overflow:hidden}
.avatar-placeholder{width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.app-icon img{width:100%;height:100%;object-fit:cover;display:block}
.app-icon img[hidden]{display:none}
.app-icon.has-image .avatar-placeholder{display:none}
h1{margin-top:10px;text-align:center;font-size:23px;line-height:1.25;font-weight:700;letter-spacing:-.4px}
.subtitle{margin-top:5px;text-align:center;color:var(--muted);font-size:12.5px}
.form{margin-top:16px}
.field{margin-bottom:10px}
.field label{display:block;margin-bottom:5px;font-size:12px;font-weight:550;color:var(--label)}
.label-row{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:5px}
.label-row label{margin-bottom:0}
.field-error{color:var(--danger);font-size:12px;font-weight:500;line-height:1.5;text-align:right;overflow-wrap:anywhere}
.field-error:empty{display:none}
.control{position:relative;display:flex;align-items:center}
.field-icon{position:absolute;left:14px;width:19px;height:19px;fill:none;stroke:var(--field-icon);stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
input{width:100%;min-width:0;height:48px;padding:0 16px;border:0;border-radius:13px;background:var(--field);color:var(--text);font-size:16px;outline:none;transition:background .15s,box-shadow .15s}
.control input{padding:0 16px 0 43px}
input[type="number"]{padding-right:8px}
input::placeholder{color:var(--field-icon)}
input:focus{background:var(--field-hover);box-shadow:inset 0 0 0 1.5px var(--text)}
input[type="password"]{padding-right:52px}
.eye{position:absolute;right:2px;width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:var(--field-icon);display:flex;align-items:center;justify-content:center}
.eye:active{background:var(--field-hover)}
.eye svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.eye .slash{display:block}
.eye[aria-pressed="true"] .slash{display:none}
.forgot{display:block;min-height:44px;margin:-6px 0 -4px auto;padding:10px 0;border:0;background:none;color:var(--muted);font-size:12px}
.forgot:active{color:var(--text)}
.submit{margin-top:12px;width:100%;height:48px;border:0;border-radius:13px;background:var(--btn);color:var(--btn-text);font-size:15px;font-weight:600;letter-spacing:.35em;text-indent:.35em;transition:background .15s}
.submit:active{background:var(--btn-active)}
.register{display:flex;align-items:center;justify-content:center;gap:4px;min-height:44px;margin-top:2px;text-align:center;color:var(--muted);font-size:12px}
.register button{min-height:44px;padding:10px 0;border:0;background:none;color:var(--text);font-size:12px;font-weight:500}
.footer{margin-top:0;padding-top:10px;border-top:1px solid var(--line);text-align:center;color:var(--muted);font-size:11px;line-height:1.6}
*{-webkit-tap-highlight-color:transparent}
html{-webkit-tap-highlight-color:transparent}
button:focus-visible{outline:2px solid var(--text);outline-offset:3px}
input:focus-visible{outline:none}
button:focus:not(:focus-visible),.menu button:focus:not(:focus-visible){outline:none}
input{caret-color:var(--text)}
input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px var(--field) inset;-webkit-text-fill-color:var(--text);caret-color:var(--text)}
@media (hover:hover){
  .icon-btn:hover{background:var(--hover);color:var(--text)}
  .submit:hover{background:var(--btn-active)}
  .forgot:hover{color:var(--text)}
  .register button:hover{color:var(--text)}
  .eye:hover{color:var(--text)}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;scroll-behavior:auto!important}}
@media (min-width:760px){.page{padding-top:24px;padding-bottom:20px;max-width:440px}.app-icon{width:64px;height:64px}.form{margin-top:20px}.footer{margin-top:0}}

@media (max-height:640px){
  body[data-view="register"] .app-icon{width:48px;height:48px;border-radius:14px}
  body[data-view="register"] .avatar-placeholder{width:24px;height:24px}
  body[data-view="register"] h1{font-size:21px;margin-top:8px}
  body[data-view="register"] .subtitle{display:none}
  body[data-view="register"] .form{margin-top:12px}
  body[data-view="register"] .field{margin-bottom:8px}
  body[data-view="register"] input{height:44px}
  body[data-view="register"] .submit{height:46px;margin-top:10px}
  body[data-view="register"] .register{margin-top:4px}
}

.view-stack{position:relative;width:100%;transition:height .16s cubic-bezier(.2,.7,.3,1)}
.view.leaving{position:absolute;top:0;left:0;right:0;pointer-events:none}
.view.enter{animation:viewIn .14s cubic-bezier(.2,.7,.3,1) both}
.view.leave{animation:viewOut .09s ease both}
@keyframes viewIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes viewOut{to{opacity:0;transform:translateY(-8px)}}
@media (prefers-reduced-motion:reduce){.view-stack{transition:none}.view.enter,.view.leave{animation:none}}

.toast{position:fixed;top:calc(12px + env(safe-area-inset-top,0px));left:16px;right:16px;z-index:100;display:flex;align-items:flex-start;gap:14px;padding:16px;border:1px solid var(--line);border-radius:22px;background:var(--bg);box-shadow:0 18px 40px #0000001f;transform:translateX(calc(100% + 32px));opacity:0;transition:transform .34s cubic-bezier(.2,.7,.3,1),opacity .26s ease}
.toast[hidden]{display:none}
.toast.dragging{transition:none}
.toast{touch-action:pan-y}
.toast.show{transform:none;opacity:1}
.toast-icon{width:48px;height:48px;flex-shrink:0;border-radius:50%;background:var(--field);display:flex;align-items:center;justify-content:center;color:var(--text)}
.toast-icon svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.toast-body{flex:1;min-width:0;padding-top:2px}
.toast-title{margin:0;font-size:15px;font-weight:650;line-height:1.4;color:var(--text)}
.toast-desc{margin:4px 0 0;font-size:12.5px;line-height:1.65;color:var(--muted);overflow-wrap:anywhere}
[data-theme="dark"] .toast{box-shadow:0 18px 40px #00000080}
@media (min-width:520px){.toast{left:auto;width:400px}}
@media (prefers-reduced-motion:reduce){.toast{transition:none}}

.steps{list-style:none;display:flex;gap:16px;padding:0;margin:0 0 16px;width:100%;justify-content:center;flex-wrap:wrap}
.steps li{display:flex;align-items:center;gap:5px;font-size:11px;color:var(--muted);white-space:nowrap}
.steps li span{font-size:10px;font-weight:600;color:var(--field-icon)}
.steps li.active{color:var(--text);font-weight:600}
.steps li.active span{color:var(--text)}
.steps li.done span{color:var(--text)}
.bind-head{width:100%;display:flex;flex-direction:column;align-items:center}
.qr-card{width:100%;margin-top:22px;border:0;background:transparent;padding:0;display:flex;flex-direction:column;align-items:center}
.qr-frame{width:224px;height:224px;border:1px solid var(--line);border-radius:14px;display:flex;align-items:center;justify-content:center;margin:0 auto 14px;background:#fff;overflow:hidden;flex-shrink:0}
.qr-frame img{width:100%;height:100%;object-fit:contain;display:block}
.qr-frame img[hidden]{display:none}
.qr-placeholder{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--muted);font-size:12px}
.qr-placeholder[hidden]{display:none}
.qr-spinner{width:22px;height:22px;border:2px solid var(--line);border-top-color:var(--text);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.bind-meta{display:flex;align-items:center;justify-content:center;gap:8px;min-height:20px}
.bind-status{text-align:center;font-size:12px;line-height:20px;color:var(--muted);margin:0;min-height:0}
.bind-status:empty{display:none}
#bind-expiry{margin:0;height:20px;line-height:20px;font-size:12px}
.qr-card .full{margin-top:18px}
.bound-card{width:100%;margin-top:0;border:0;background:transparent;padding:0;display:flex;flex-direction:column;align-items:center;gap:6px}
.bound-card[hidden]{display:none}
.bound-icon{width:52px;height:52px;border-radius:50%;background:var(--field);display:flex;align-items:center;justify-content:center;color:var(--text);margin-bottom:6px}
.bound-icon svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.bound-card h2{font-size:18px;margin:0;font-weight:650}
.bound-card .full{margin-top:12px}
.bound-appid{margin:2px 0 0;text-align:center;font-size:11.5px;color:var(--muted)}
#bind-rebind{color:var(--muted);font-size:12px;min-height:44px;margin-top:10px}
@media (max-height:640px){
  body[data-view="bind"] .qr-frame{width:160px;height:160px}
  body[data-view="bind"] .qr-card{margin-top:8px;padding:12px}
  body[data-view="bind"] .steps{margin-bottom:8px}
}

[hidden]{display:none!important}

.button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 14px;border:1px solid var(--line);border-radius:12px;background:var(--bg);color:var(--text);font-size:13px;font-weight:500;white-space:nowrap;line-height:1.4;transition:background-color .15s,color .15s,border-color .15s,opacity .15s}
.button.full{width:100%}
.button.secondary{background:var(--bg);border-color:var(--line);color:var(--text)}
.button.ghost{background:transparent;border-color:transparent;color:var(--muted)}
.button.primary{background:var(--text);border-color:var(--text);color:var(--bg);font-weight:600}
.button.text{background:none;border-color:transparent;color:var(--muted);font-size:12.5px;min-height:40px}
.button.text:active{color:var(--text)}
.button:active{background:var(--hover)}
.button:disabled,.button.is-disabled{background:var(--field);border-color:var(--line);color:var(--field-icon);pointer-events:none;cursor:not-allowed}

body[data-view="bind"] .topbar{display:none}
body[data-view="bind"] .page{padding-top:calc(24px + env(safe-area-inset-top,0px))}

.is-hidden{visibility:hidden}
.is-gone{display:none!important}

.qr-status-icon{width:36px;height:36px;fill:none;stroke:var(--field-icon);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.qr-status-icon[hidden]{display:none}

.qr-message{display:flex;flex-direction:column;align-items:center;gap:10px;padding:0 20px;text-align:center;color:var(--muted);font-size:12px;line-height:1.6}
.qr-message p{margin:0}


#bind-refresh{width:100%}
#bind-refresh.primary{min-height:46px;font-size:14px}

body[data-view="profile"] .page{padding-top:calc(28px + env(safe-area-inset-top,0px))}
.profile-head{text-align:center}
.profile-form{width:100%;margin-top:22px}
textarea{width:100%;min-width:0;min-height:120px;padding:12px 14px;border:0;border-radius:14px;background:var(--field);color:var(--text);font:inherit;font-size:15px;line-height:1.7;outline:none;resize:vertical;transition:background .15s,box-shadow .15s}
textarea::placeholder{color:var(--field-icon)}
textarea:focus{background:var(--field-hover);box-shadow:inset 0 0 0 1.5px var(--text)}
.form-grid.compact{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 10px}
.profile-form .form-error,.profile-form .form-note{text-align:left;margin-top:6px}
@media (max-height:700px){body[data-view="profile"] .profile-form{margin-top:14px}body[data-view="profile"] .field{margin-bottom:8px}body[data-view="profile"] textarea{min-height:88px}}
@media (max-height:640px){
  body[data-view="profile"] .page{padding-top:calc(14px + env(safe-area-inset-top,0px))}
  body[data-view="profile"] .eyebrow{display:none}
  body[data-view="profile"] .subtitle{display:none}
  body[data-view="profile"] h1{font-size:22px;margin-top:0}
  body[data-view="profile"] .profile-form{margin-top:12px}
  body[data-view="profile"] textarea{min-height:72px}
  body[data-view="profile"] .profile-form .submit{min-height:46px}
}

body[data-view="model"] .page{padding-top:calc(28px + env(safe-area-inset-top,0px))}
.model-head{text-align:center}
.model-tabs{display:flex;gap:4px;width:100%;margin-top:18px;padding:4px;border:1px solid var(--line);border-radius:12px}
.model-tabs button{flex:1;min-height:40px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-size:13px}
.model-tabs button.selected{background:var(--field);color:var(--text);font-weight:600}
.model-tabs button:disabled{opacity:.45}
.model-form{width:100%;margin-top:18px}
.model-form .button.text{margin-top:6px}
.model-quota{margin-top:10px}
#custom-note{white-space:pre-wrap}
#go-model{margin-top:10px}
@media (max-height:700px){
  body[data-view="model"] .page{padding-top:calc(14px + env(safe-area-inset-top,0px))}
  body[data-view="model"] .eyebrow{display:none}
  body[data-view="model"] .subtitle{display:none}
  body[data-view="model"] h1{font-size:22px;margin-top:0}
  body[data-view="model"] .model-form{margin-top:12px}
  body[data-view="model"] .model-tabs{margin-top:12px}
}

body[data-view="dashboard"] .page{padding-top:calc(8px + env(safe-area-inset-top,0px))}
.dash-main{display:block;flex:1;width:100%}
.dash-wrap{width:100%;padding:8px 0 24px}
.dash-head{text-align:left;margin-bottom:2px}
.dash-head h1{margin-top:4px;text-align:left;font-size:26px}
.dash-head .subtitle{text-align:left}
.card{border:1px solid var(--line);border-radius:14px;background:var(--bg);padding:16px;margin-top:14px}
.card h2{font-size:15px;margin:0}
.bot-card .bot-line{display:flex;align-items:center;gap:9px}
.status-dot{width:8px;height:8px;border-radius:50%;background:var(--field);border:1px solid var(--field-icon)}
.status-dot.online{background:var(--text);border-color:var(--text)}
.bot-actions{display:flex;gap:8px;margin-top:14px}
.bot-actions .button{flex:1;min-width:0}
.dash-stats{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.stat{border:1px solid var(--line);border-radius:14px;padding:14px 16px;background:var(--bg)}
.stat span{font-size:11.5px;color:var(--muted)}
.stat strong{display:block;font-size:24px;line-height:1.4;font-weight:600;font-variant-numeric:tabular-nums}
.dash-grid{display:grid;grid-template-columns:1fr;gap:10px}
.dash-grid .card{margin-top:0}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.dash-value{margin:8px 0 0;font-size:15px;font-weight:600;overflow-wrap:anywhere}
.persona-text{max-height:60px;overflow:hidden}
.dash-wrap > .card:last-of-type{margin-top:14px}
.logs{margin-top:10px;max-height:260px;overflow-y:auto}
.log-row{display:flex;gap:10px;padding:8px 0;border-top:1px solid var(--line);font-size:11.5px}
.log-row:first-child{border-top:0}
.log-time{color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.log-message{color:var(--text);overflow-wrap:anywhere}
.empty{margin:16px 0;text-align:center;color:var(--muted);font-size:12px}
@media (max-height:640px){body[data-view="dashboard"] .subtitle{display:none}}

body[data-view="access"] .page{padding-top:calc(8px + env(safe-area-inset-top,0px))}
.mode-switch{display:flex;gap:4px;padding:4px;margin-top:12px;border:1px solid var(--line);border-radius:12px}
.mode-switch button{flex:1;min-height:38px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-size:12.5px}
.mode-switch button.selected{background:var(--field);color:var(--text);font-weight:600}
#private-list,#group-list{margin-top:14px}
#private-list[hidden],#group-list[hidden]{display:none}
#private-list label,#group-list label{display:block;margin-bottom:6px;font-size:12px;font-weight:550;color:var(--label)}
#private-list textarea,#group-list textarea{min-height:96px}
#save{margin-top:14px}
#access-error{margin-top:8px;text-align:left}
#access-note{margin-top:8px}

body[data-view="admin"] .page{padding-top:calc(8px + env(safe-area-inset-top,0px))}
#admin-console .model-tabs{margin-bottom:14px}
.check-row{display:flex;align-items:center;gap:10px;margin:2px 0 14px;font-size:13px;color:var(--text)}
.check-row input{width:20px;height:20px;margin:0;accent-color:var(--text)}
#tab-pool .form{margin-top:16px}
#tab-invites .card:first-child{margin-top:16px}
.invite-result{margin-top:14px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--field)}
.invite-result code{display:block;margin:8px 0;font:13px/1.6 ui-monospace,monospace;overflow-wrap:anywhere}
.record-list .record{position:relative;padding:12px 54px 12px 0;border-top:1px solid var(--line);font-size:12px}
.record-list .record:first-child{border-top:0}
.record strong{display:block;font-size:13px;font-weight:600;margin-bottom:2px}
.record p{margin:0;color:var(--muted);overflow-wrap:anywhere}
.record .button{position:absolute;right:0;top:8px}

.top-actions .button.text.selected{color:var(--text);font-weight:600}
.back-link{display:inline-flex;align-self:flex-start;margin-bottom:6px;color:var(--muted);font-size:12px}
.bar{display:flex;height:8px;margin-top:12px;border-radius:999px;overflow:hidden;background:var(--field)}
.bar span{display:block;height:100%}
.bar-ok{background:var(--text)}
.bar-fail{background:var(--field-icon)}
.bar-legend{display:flex;justify-content:space-between;margin-top:8px;font-size:11.5px;color:var(--muted)}
.bar-legend b{color:var(--text);font-weight:600}
.token-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.token-grid span{font-size:11.5px;color:var(--muted)}
.token-grid strong{display:block;font-size:20px;font-weight:600;font-variant-numeric:tabular-nums}
.account-list{margin:10px 0 0}
.account-list > div{display:flex;justify-content:space-between;gap:16px;padding:10px 0;border-top:1px solid var(--line);font-size:12.5px}
.account-list > div:first-child{border-top:0}
.account-list dt{color:var(--muted)}
.account-list dd{margin:0;text-align:right;overflow-wrap:anywhere}
.account-form{margin-top:14px}

@media (max-width:360px){
  .topbar .brand svg{height:18px}
  .top-actions .button.text{padding:0 6px;font-size:11px}
  .top-actions{gap:0}
}

@media (max-height:600px){
  .page{padding-bottom:calc(6px + env(safe-area-inset-bottom,0px))}
  .register{min-height:40px}
  .submit{height:46px;min-height:46px}
}

.danger-text{color:#c0392b!important}
[data-theme="dark"] .danger-text{color:#ff7b72!important}

body[data-view="no-admin"] .center,body[data-view="no-admin"] .dash-head,body[data-view="no-admin"] .dash-head h1,body[data-view="no-admin"] .subtitle{text-align:center}

.search-row{display:flex;gap:8px;margin:12px 0}
.search-row input{flex:1;height:42px;padding:0 14px;font-size:14px}
.search-row .button{width:auto;min-width:64px;min-height:42px;padding:0 16px;font-size:12.5px}
.record-actions{position:absolute;right:0;top:8px;display:flex;gap:2px}
.record-actions .button{position:static;padding:6px 6px;white-space:nowrap}
.pager{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:12px;font-size:11.5px;color:var(--muted)}
.pager button{padding:6px 8px}
.pager button:disabled{opacity:.4;pointer-events:none}

.trend{display:flex;align-items:flex-end;gap:7px;height:132px;margin-top:14px}
.trend-day{flex:1;min-width:0;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:3px}
.trend-value{font-size:10px;color:var(--muted);height:14px}
.trend-bar{display:block;width:100%;max-width:32px;border-radius:4px 4px 2px 2px;background:var(--text)}
.trend-label{font-size:9.5px;color:var(--muted);white-space:nowrap}

@media (max-width:360px){.top-actions a[href="/app/dashboard"]{display:none}}

.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:20;display:flex;height:calc(56px + env(safe-area-inset-bottom,0px));padding-bottom:env(safe-area-inset-bottom,0px);background:var(--bg);border-top:1px solid var(--line)}
.tabbar a{flex:1;display:flex;align-items:center;justify-content:center;min-height:56px;font-size:12px;color:var(--muted)}
.tabbar a.active{color:var(--text);font-weight:600}
body[data-view="dashboard"] .page,body[data-view="data"] .page,body[data-view="account"] .page{padding-bottom:calc(80px + env(safe-area-inset-bottom,0px))}

.record-user{padding-right:0}
.record-user .record-actions{position:static;justify-content:flex-start;margin-top:6px}

.advanced{margin:2px 0 4px}
.advanced summary{font-size:12px;color:var(--muted);padding:8px 0;cursor:pointer;list-style:none}
.advanced summary::-webkit-details-marker{display:none}
.advanced summary::before{content:'+';display:inline-block;width:16px;color:var(--text)}
.advanced[open] summary::before{content:'−'}
.advanced .check-row{margin:6px 0}

#bind-refresh:disabled{background:none!important;border-color:transparent!important;color:var(--muted);opacity:.55}

#bind-next{margin-top:38px}

.admin-auth{min-height:calc(100svh - 210px);display:flex;align-items:center;justify-content:center;width:100%}
.admin-auth-inner{width:100%;max-width:360px;display:flex;flex-direction:column;align-items:center;transform:translateY(38px)}
.admin-auth .app-icon{margin-bottom:10px}
.admin-auth h1{text-align:center;font-size:24px;margin:0}
.admin-auth .subtitle{text-align:center;margin-top:6px}
.admin-auth .form{margin-top:24px;width:100%}
.admin-auth .form .submit{margin-top:18px}

@media (max-height:640px){
  .admin-auth{min-height:calc(100svh - 170px)}
  .admin-auth-inner{transform:none}
  .admin-auth .subtitle{display:none}
  .admin-auth .form{margin-top:14px}
}

body.admin-booting .admin-auth{visibility:hidden}

.field-wrap{position:relative}

.field-head{display:flex;align-items:center;justify-content:space-between;min-height:20px;margin-bottom:4px}
.field-head label{margin:0}
.field-btn{display:inline-flex;align-items:center;height:20px;padding:0 8px;border:1px solid var(--line);border-radius:999px;background:var(--bg);color:var(--muted);font-size:10.5px;font-weight:500;line-height:1}
.field-btn:hover,.field-btn:focus-visible{border-color:var(--text);color:var(--text)}
.field-btn:active{color:var(--text)}
.field-menu{position:absolute;right:0;top:calc(100% + 4px);z-index:40;min-width:220px;max-width:100%;max-height:240px;overflow:auto;padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--bg);box-shadow:0 12px 30px #00000018;display:flex;flex-direction:column}
.field-menu[hidden]{display:none}
.field-menu button{text-align:left;border:0;background:none;color:var(--text);font:inherit;font-size:12.5px;padding:10px 12px;border-radius:8px;min-height:40px}
.field-menu button:hover,.field-menu button:focus-visible{background:var(--field)}

.picker{position:fixed;inset:0;z-index:120;display:flex;align-items:center;justify-content:center;padding:22px}
.picker[hidden]{display:none}
.picker-backdrop{position:absolute;inset:0;background:#00000059}
.picker-sheet{position:relative;width:100%;max-width:360px;max-height:72svh;display:flex;flex-direction:column;background:var(--bg);border:1px solid var(--line);border-radius:18px;box-shadow:0 24px 60px #00000033;overflow:hidden}
.picker-head{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--line);flex:none}
.picker-head h2{font-size:15px;margin:0;font-weight:600;text-align:left}
.picker-close{width:36px;height:36px;border:0;border-radius:50%;background:none;color:var(--muted);font-size:22px;line-height:1}
.picker-body{padding:6px;overflow:auto}
.picker-item{display:flex;flex-direction:column;gap:3px;width:100%;padding:11px 12px;border:0;border-radius:10px;background:none;color:var(--text);text-align:left;font:inherit}
.picker-item strong{font-size:13px;font-weight:550}
.picker-item span{font-size:10.5px;color:var(--muted);overflow-wrap:anywhere}
.picker-item:hover,.picker-item:focus-visible{background:var(--field)}
.picker-empty{padding:18px 12px;text-align:center;color:var(--muted);font-size:12px}

.field{position:relative}
.anchor-menu{position:absolute;left:0;right:0;top:22px;z-index:55;background:var(--bg);border:1px solid #cfcfcf;border-radius:10px;overflow-y:auto;overflow-x:hidden;max-height:min(48svh,360px);transform-origin:top right}
[data-theme="dark"] .anchor-menu{border-color:#3a3a3a}
.anchor-menu[hidden]{display:none}
.anchor-item{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:42px;padding:4px 12px;border:0;border-bottom:1px solid var(--line);background:none;color:var(--text);text-align:left;font:inherit}
.anchor-item:last-child{border-bottom:0}
.anchor-item:hover,.anchor-item:focus-visible{background:var(--field)}
.anchor-item.selected{background:var(--field)}
.anchor-item.selected .anchor-mark{background:var(--text);color:var(--bg)}
.anchor-main{display:flex;flex-direction:column;justify-content:center;gap:0;min-width:0;flex:1;padding:1px 0}
.anchor-mark{width:24px;height:24px;border-radius:6px;background:var(--field);color:var(--muted);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;flex:none}
.anchor-check{font-size:12px;color:var(--text);width:14px;text-align:right;flex:none}
.anchor-item strong{font-size:12px;line-height:1.35;font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.anchor-item small{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:9px;line-height:1.35;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.menu-scrim{position:fixed;inset:0;z-index:50;background:#0000002e}
.menu-scrim[hidden]{display:none}

.anchor-menu.up{top:auto;bottom:calc(100% + 6px);transform-origin:bottom right;animation-name:menuInUp}
.anchor-menu.up.closing{animation-name:menuOutUp}
@keyframes menuInUp{from{opacity:0;clip-path:inset(100% 0 0 0 round 10px)}to{opacity:1;clip-path:inset(0 0 0 0 round 10px)}}
@keyframes menuOutUp{from{opacity:1;clip-path:inset(0 0 0 0 round 10px)}to{opacity:0;clip-path:inset(100% 0 0 0 round 10px)}}

.model-form input.is-invalid{box-shadow:inset 0 0 0 1.5px var(--danger)!important}

.anchor-menu{animation:menuIn .22s cubic-bezier(.2,.7,.2,1) both}
.anchor-menu.closing{animation:menuOut .16s ease both}
.menu-scrim{animation:scrimIn .16s ease both}
.menu-scrim.closing{animation:scrimOut .13s ease both}
@keyframes menuIn{from{opacity:0;clip-path:inset(0 0 100% 0 round 10px);transform:translateY(-2px)}to{opacity:1;clip-path:inset(0 0 0 0 round 10px);transform:none}}
@keyframes menuOut{from{opacity:1;clip-path:inset(0 0 0 0 round 10px)}to{opacity:0;clip-path:inset(0 0 100% 0 round 10px)}}
@keyframes scrimIn{from{opacity:0}to{opacity:1}}
@keyframes scrimOut{from{opacity:1}to{opacity:0}}
.field-btn{transition:background .12s,color .12s,transform .12s}
.field-btn:active{transform:scale(.96)}
@media (prefers-reduced-motion: reduce){.anchor-menu,.anchor-menu.closing,.menu-scrim,.menu-scrim.closing,.field-btn{animation:none;transition:none}}

.toast[data-tone="error"] .toast-icon{color:var(--danger);background:#d92d2014}
.toast[data-tone="error"] .toast-icon svg{display:none}
.toast[data-tone="error"] .toast-icon::before{content:"!";font-size:22px;font-weight:600}

.field-btn.loading{gap:5px;color:var(--text)}
.field-btn.loading::before{content:"";width:10px;height:10px;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:btnSpin .7s linear infinite}
@keyframes btnSpin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion: reduce){.field-btn.loading::before{animation:none}}
body.app-booting .page{visibility:hidden}
select{width:100%;min-width:0;height:48px;padding:0 12px;border:0;border-radius:13px;background:var(--field);color:var(--text);font:inherit;font-size:15px;outline:none;transition:background .15s,box-shadow .15s}
select:focus{background:var(--field-hover);box-shadow:inset 0 0 0 1.5px var(--text)}

.select-wrap{position:relative}
.select-btn{display:flex;align-items:center;justify-content:space-between;width:100%;height:48px;padding:0 12px;border:0;border-radius:13px;background:var(--field);color:var(--text);font:inherit;font-size:15px;text-align:left}
.select-btn:focus-visible{outline:none;box-shadow:inset 0 0 0 1.5px var(--text)}
.select-chevron{width:11px;height:8px;fill:none;stroke:var(--field-icon);stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;flex:none}
.select-wrap.open .select-btn{background:var(--field-hover)}
.select-menu{position:absolute;left:0;right:auto;top:calc(100% + 5px);z-index:40;min-width:150px;width:max-content;max-width:calc(100vw - 36px);padding:5px;border:1px solid #cfcfcf;border-radius:10px;background:var(--bg);box-shadow:0 14px 34px #0000001f}
.field:nth-child(3) .select-menu{left:auto;right:0}
.select-wrap.up .select-menu{top:auto;bottom:calc(100% + 5px)}
.select-menu[hidden]{display:none}
.select-menu button{display:block;width:100%;min-height:42px;padding:0 12px;border:0;border-radius:7px;background:none;color:var(--text);text-align:left;font:inherit;font-size:12.5px;white-space:nowrap}
.select-menu button:hover{background:var(--field)}
.select-menu button.on{background:var(--text);color:var(--bg)}
.profile-form textarea{resize:none}

.profile-form .field{position:relative}
.template-menu{position:absolute;left:0;right:0;top:26px;z-index:30;background:var(--bg);border:1px solid #cfcfcf;border-radius:10px;box-shadow:0 18px 44px #00000029;overflow:hidden;animation:templateIn .16s ease both}
.template-menu[hidden]{display:none}
.template-scrim{position:fixed;inset:0;z-index:20;background:#00000024;animation:templateFade .16s ease both}
.template-scrim[hidden]{display:none}
.template-item{display:flex;flex-direction:column;gap:2px;width:100%;padding:9px 12px;border:0;border-bottom:1px solid var(--line);background:none;color:var(--text);text-align:left;font:inherit}
.template-item:last-child{border-bottom:0}
.template-item:hover,.template-item:focus-visible{background:var(--field)}
.template-item strong{font-size:12.5px;font-weight:600}
.template-item span{font-size:10px;color:var(--muted)}
@keyframes templateIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@keyframes templateFade{from{opacity:0}to{opacity:1}}

.param-list{border-top:1px solid var(--line);margin:2px 0 18px}
.param-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 0;border-bottom:1px solid var(--line)}
.param-name{font-size:12px;color:var(--text);flex:none}
.param-seg{display:flex;gap:3px;padding:3px;border:1px solid var(--line);border-radius:10px}
.param-seg button{height:30px;padding:0 9px;border:0;border-radius:7px;background:none;color:var(--muted);font:inherit;font-size:11px;white-space:nowrap}
.param-seg button.on{background:var(--text);color:var(--bg)}
@media (max-width:360px){.param-seg button{padding:0 7px;font-size:10.5px}}

.advanced-toggle{display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 14px;border:1px solid var(--line);border-radius:999px;background:var(--bg);color:var(--muted);font:inherit;font-size:11px;margin:0 0 16px}
.advanced-toggle:hover{border-color:var(--text);color:var(--text)}

body.modal-open{overflow:hidden}
.advanced-link{display:block;margin:14px auto 0;padding:6px 10px;border:0;background:none;color:var(--muted);font:inherit;font-size:12px}
.advanced-link:active{color:var(--text)}
.advanced-modal{position:fixed;inset:0;z-index:130;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000052;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);animation:advFadeIn .18s ease both}
.advanced-modal[hidden]{display:none}
.adv-shell{display:flex;flex-direction:column;width:100%;max-width:390px;max-height:calc(100svh - 48px);overflow-y:auto;background:var(--bg);border:1px solid var(--line);border-radius:22px;box-shadow:0 28px 70px #00000036;padding:18px 18px 16px;animation:advModalIn .2s cubic-bezier(.2,.7,.3,1) both}
.adv-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:2px}
.adv-head h2{font-size:19px;margin:0;font-weight:650;letter-spacing:-.02em}
.adv-close{width:34px;height:34px;border:0;border-radius:50%;background:var(--field);color:var(--muted);font-size:20px;line-height:1}
.adv-body{flex:none}
.adv-item{padding:10px 0 7px;border-bottom:1px solid var(--line)}
.adv-top{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:8px;font-size:13px}
.adv-top strong{font-size:13px;font-weight:600}
.adv-item input[type="range"]{width:100%;height:24px;margin:0;background:none;-webkit-appearance:none;appearance:none}
.adv-item input[type="range"]::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:linear-gradient(to right,var(--text) 0,var(--text) var(--p,0%),var(--line) var(--p,0%),var(--line) 100%)}
.adv-item input[type="range"]::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;margin-top:-8px;border:3px solid var(--bg);border-radius:50%;background:var(--text);box-shadow:0 1px 5px #00000026}
.adv-item input[type="range"]::-moz-range-track{height:4px;border-radius:2px;background:var(--line)}
.adv-item input[type="range"]::-moz-range-progress{height:4px;border-radius:2px;background:var(--text)}
.adv-item input[type="range"]::-moz-range-thumb{width:14px;height:14px;border:3px solid var(--bg);border-radius:50%;background:var(--text)}
.adv-ticks{display:flex;justify-content:space-between;margin-top:4px}
.adv-ticks button{border:0;background:none;color:var(--muted);font:inherit;font-size:10.5px;padding:4px 2px}
.adv-ticks button.on{color:var(--text);font-weight:600}
.adv-done{width:100%;height:46px;margin-top:10px;border:0;border-radius:13px;background:var(--text);color:var(--bg);font:inherit;font-size:14px;font-weight:600}
@keyframes advModalIn{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}
@keyframes advFadeIn{from{opacity:0}to{opacity:1}}
/* dashboard editorial */
body[data-view="dashboard"] .footer{display:none}
body[data-view="dashboard"] .dash-wrap{padding:14px 0 84px}
body[data-view="dashboard"] .dash-head{margin-bottom:0}
body[data-view="dashboard"] .dash-head h1{font-size:30px;letter-spacing:-.03em;margin:0;text-align:left}
body[data-view="dashboard"] .dash-head .subtitle{margin-top:8px;text-align:left;font-size:12px}
.dash-status{padding:26px 0 20px;border-bottom:1px solid var(--line)}
.status-main{display:flex;align-items:center;gap:9px}
.status-main .status-dot{width:9px;height:9px}
#bot-state{font-size:36px;line-height:1;font-weight:650;letter-spacing:-.03em;margin:0}
.status-error{margin:8px 0 0;font-size:11px;line-height:1.5;color:var(--danger);min-height:0}
.status-actions{display:flex;align-items:center;gap:8px;margin-top:18px}
.pill{height:38px;padding:0 18px;border:1px solid var(--line);border-radius:999px;background:var(--bg);color:var(--text);font:inherit;font-size:12.5px}
.pill.primary{background:var(--text);color:var(--bg);border-color:var(--text)}
.link-btn{border:0;background:none;color:var(--muted);font:inherit;font-size:11px;padding:4px 0;white-space:nowrap}
.link-btn:active{color:var(--text)}
.metric-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-bottom:1px solid var(--line);margin:0 0 4px}
.metric{padding:15px 0 16px 12px;border-left:1px solid var(--line)}
.metric:first-child{padding-left:0;border-left:0}
.metric span{display:block;font-size:10px;color:var(--muted);white-space:nowrap}
.metric strong{display:block;margin-top:7px;font-size:clamp(22px,7vw,29px);line-height:1;font-weight:550;letter-spacing:-.02em;font-variant-numeric:tabular-nums;white-space:nowrap}
.settings-list{border-bottom:1px solid var(--line)}
.setting-row{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:10px;align-items:start;padding:14px 0;border-top:1px solid var(--line)}
.setting-row:first-child{border-top:0}
.setting-label{font-size:10.5px;color:var(--muted);padding-top:2px}
.setting-value p{margin:0;font-size:14px;line-height:1.45;font-weight:600;overflow-wrap:anywhere}
.setting-value span{display:block;margin-top:3px;font-size:10.5px;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}
.setting-value .persona-text{max-height:32px;overflow:hidden}
.activity{margin-top:24px}
.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px}
.section-title h2{font-size:13px;margin:0;font-weight:600}
.activity .logs{margin-top:8px;max-height:220px}
/* dashboard app */
body[data-view="dashboard"]{background:var(--field)}
body[data-view="dashboard"] .page{background:transparent}
body[data-view="dashboard"] .footer{display:none}
body[data-view="dashboard"] .topbar{margin-bottom:0}
body[data-view="dashboard"] .dash-wrap{padding:10px 0 90px}
.app-head h1{font-size:28px;letter-spacing:-.03em;margin:0;text-align:left}
.app-head p{margin:5px 0 0;font-size:11.5px;color:var(--muted);text-align:left}
.hero-card{margin-top:20px;padding:18px;border-radius:22px;background:var(--bg);color:var(--text);border:1px solid var(--line)}
.hero-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.hero-status{display:flex;align-items:center;gap:9px;min-width:0}
.hero-card .status-dot{width:9px;height:9px;border-color:var(--field-icon);background:var(--field)}
.hero-card .status-dot.online{background:var(--text);border-color:var(--text)}
.hero-status h2{font-size:28px;line-height:1;font-weight:650;letter-spacing:-.03em;margin:0;color:var(--text)}
.hero-refresh{width:36px;height:36px;border:0;border-radius:50%;background:var(--field);color:var(--text);display:flex;align-items:center;justify-content:center}
.hero-refresh svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.hero-error{margin:10px 0 0;font-size:10.5px;line-height:1.5;color:var(--danger);min-height:0}
.hero-actions{display:flex;gap:8px;margin-top:20px}
.hero-btn{flex:1;height:42px;border:1px solid var(--line);border-radius:12px;background:transparent;color:var(--text);font:inherit;font-size:13px}
.hero-btn.primary{background:var(--text);border-color:var(--text);color:var(--bg);font-weight:600}
.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:10px}
.metric-tile{padding:14px 15px;border-radius:16px;background:var(--bg)}
.metric-tile span{display:block;font-size:10.5px;color:var(--muted)}
.metric-tile strong{display:block;margin-top:6px;font-size:24px;line-height:1.1;font-weight:600;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.group-label{margin:22px 2px 8px;font-size:10.5px;color:var(--muted)}
.group-card{border-radius:18px;background:var(--bg);overflow:hidden}
.setting-row{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:11px;align-items:center;padding:13px 14px;border-top:1px solid var(--line)}
.setting-row:first-child{border-top:0}
.setting-icon{width:34px;height:34px;border-radius:10px;background:var(--field);display:flex;align-items:center;justify-content:center;color:var(--text)}
.setting-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.setting-text{min-width:0}
.setting-text strong{display:block;font-size:13px;font-weight:600;line-height:1.4;overflow-wrap:anywhere}
.setting-text span{display:block;margin-top:2px;font-size:10px;line-height:1.45;color:var(--muted);overflow-wrap:anywhere}
.setting-text .persona-text{max-height:29px;overflow:hidden}
.row-action{border:0;background:none;color:var(--muted);font:inherit;font-size:11px;padding:6px 0 6px 6px;white-space:nowrap}
.activity-card{padding:4px 14px 8px}
.activity-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0 6px}
.activity-head h2{font-size:12px;margin:0;font-weight:600;color:var(--muted)}
.activity-card .logs{margin:0;max-height:190px;overflow-y:auto}
.activity-card .log-row{padding:9px 0;font-size:10.5px;border-top:1px solid var(--line)}
.activity-card .empty{margin:14px 0;font-size:11px}

.hero-bot{margin:10px 0 0;font-size:10.5px;line-height:1.5;color:var(--muted)}
.hero-botline{display:flex;align-items:center;justify-content:space-between;gap:10px}
.hero-botline .hero-bot{margin:10px 0 0}
.hero-unbind{border:0;background:none;color:var(--muted);font:inherit;font-size:10.5px;padding:10px 0 0}