@font-face { font-family:Tajawal; src:url('/assets/fonts/Tajawal-Regular.ttf') format('truetype'); font-weight:400; font-display:swap; }
@font-face { font-family:Tajawal; src:url('/assets/fonts/Tajawal-Medium.ttf') format('truetype'); font-weight:500; font-display:swap; }
@font-face { font-family:Tajawal; src:url('/assets/fonts/Tajawal-Bold.ttf') format('truetype'); font-weight:700; font-display:swap; }
:root {
  color-scheme:light; font-family:Tajawal,Tahoma,Arial,sans-serif; font-size:17px;
  --navy:#10263d; --navy2:#183750; --ink:#19324a; --muted:#60758a;
  --canvas:#f4f7fb; --surface:#fff; --line:#dfe7f0; --cyan:#176fbd;
  --cyanlight:#edf5ff; --green:#17704a; --danger:#b43b44; --gold:#93651f;
  --radius:16px; --shadow:0 4px 20px #17324d05;
}
* { box-sizing:border-box; }
html { scroll-padding-top:110px; }
body { margin:0; background:var(--canvas); color:var(--ink); line-height:1.7; font-weight:500; }
[hidden] { display:none!important; }
button,input,select,textarea { font:inherit; color:inherit; }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
button,a { touch-action:manipulation; }
button { cursor:pointer; border:1px solid var(--line); background:var(--surface); border-radius:10px; padding:10px 17px; min-height:44px; font-weight:700; line-height:1.5; transition:background .15s,border-color .15s,box-shadow .15s; }
button:hover:not(:disabled) { background:#f0f5fb; border-color:#b9ccde; }
button:disabled { cursor:not-allowed; opacity:.48; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible { outline:3px solid #4b9ce5; outline-offset:3px; }
button.primary,.primary-link,a.primary { background:var(--cyan); color:#fff; border:1px solid var(--cyan); }
button.primary:hover:not(:disabled),.primary-link:hover,a.primary:hover { background:#105fa6; border-color:#105fa6; }
.primary-link,.secondary-link,a.primary { display:inline-flex; align-items:center; justify-content:center; gap:9px; padding:10px 17px; min-height:44px; border-radius:10px; font-weight:700; line-height:1.5; }
.secondary-link { border:1px solid var(--line); background:white; color:var(--cyan); }
.secondary-link:hover { border-color:#b9cfe4; background:var(--cyanlight); }
button.danger { color:var(--danger); background:#fff7f7; border-color:#ebc9cd; }
button.danger:hover:not(:disabled) { background:#ffeded; border-color:#d99da4; }
button.solid-danger { background:var(--danger); color:#fff; border-color:var(--danger); }
button.solid-danger:hover:not(:disabled) { background:#96303a; color:#fff; }
button.quiet { background:transparent; border:0; color:inherit; min-height:36px; padding:5px 8px; }
a { color:var(--cyan); text-decoration:none; }
a:hover { text-decoration:none; }
h1,h2,h3,p { margin:0; }
h1 { font-size:1.9rem; line-height:1.4; font-weight:700; }
h2 { font-size:1.2rem; line-height:1.55; }
h3 { font-size:1.06rem; line-height:1.6; }
.muted,.hint,.small { color:var(--muted); }
.small,.hint { font-size:.88rem; }
p.muted { margin-top:7px; }
.eyebrow { color:var(--cyan); font-size:.82rem; font-weight:700; margin-bottom:5px; letter-spacing:0; direction:inherit; }
bdi { unicode-bidi:isolate; }
.mono,.address,.code { direction:ltr; unicode-bidi:isolate; font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:.84rem; }
.sr-only { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.skip-link { position:fixed; top:8px; left:50%; transform:translate(-50%,-160%); z-index:100; background:white; padding:12px 20px; border:2px solid var(--cyan); border-radius:10px; }
.skip-link:focus { transform:translate(-50%,0); }
/* Application shell */
.workspace { display:grid; grid-template-columns:238px minmax(0,1fr); min-height:100vh; }
.sidebar { background:linear-gradient(165deg,#122c46,#0b1e31); color:#a9bfd2; padding:23px 16px; position:sticky; top:0; height:100dvh; display:flex; flex-direction:column; }
.sidebar-brand { display:flex; align-items:center; }
.brand { display:block; padding:0 8px 19px; width:100%; }
.brand img { display:block; width:100%; height:76px; object-fit:contain; }
.sidebar-label { font-size:.82rem; color:#94adc4; padding:0 13px 10px; }
.sidebar nav { display:grid; gap:5px; overflow-y:auto; min-height:0; scrollbar-width:thin; scrollbar-color:#3b5570 transparent; }
.nav-link { display:flex; align-items:center; gap:11px; color:#b9cadb; padding:9px 10px; min-height:52px; border:1px solid transparent; border-radius:12px; position:relative; font-size:.94rem; transition:background .16s,color .16s,border-color .16s; }
.nav-link:hover { background:#ffffff08; color:#fff; border-color:#ffffff0c; }
.nav-link.active { background:linear-gradient(100deg,#1d486a,#1b3c5a); color:#fff; border-color:#547c9c66; }
.nav-link.active::before { content:''; position:absolute; inset-inline-start:-1px; top:17px; bottom:17px; width:3px; background:#8dd5ff; border-radius:3px; }
.ui-icon { display:block; width:22px; height:22px; flex:none; }
.nav-icon { width:32px; height:32px; display:grid; place-items:center; flex:none; color:#8db4d2; background:#b1d9ff08; border-radius:9px; transition:background .16s,color .16s; }
.nav-link:hover .nav-icon { color:#ceeaff; background:#b1d9ff10; }
.nav-link.active .nav-icon { color:#addefe; background:#73c0f52b; }
.nav-text { min-width:0; line-height:1.45; }
.nav-section { margin-top:13px; padding:14px 12px 5px; border-top:1px solid #ffffff15; color:#89a6c2; font-size:.83rem; overflow-wrap:anywhere; }
.sidebar-bottom { display:flex; align-items:center; gap:7px; margin-top:auto; border-top:1px solid #ffffff15; padding-top:18px; font-size:.8rem; white-space:nowrap; }
.sidebar-bottom .quiet { margin-inline-start:auto; font-size:.79rem; }
.status-dot,.live-dot { display:inline-block; width:6px; height:6px; background:#69ccac; border-radius:50%; flex:none; }
.mobile-menu { display:none; }
.main-shell { min-width:0; }
.topbar { display:flex; align-items:center; flex-wrap:wrap; gap:20px; min-height:83px; padding:14px 32px; background:#fff; border-bottom:1px solid var(--line); position:sticky; top:0; z-index:20; }
.workspace-heading { min-width:0; }
.workspace-heading .eyebrow { font-family:Tajawal,Arial,sans-serif; font-size:.73rem; margin:0; color:var(--muted); }
.topbar-title { color:var(--ink); font-weight:700; font-size:1rem; overflow-wrap:anywhere; }
#page-back { min-height:46px; display:inline-flex; align-items:center; justify-content:center; gap:8px; flex:none; min-width:86px; color:var(--cyan); background:var(--cyanlight); border-color:#d4e4f4; padding:9px 13px; }
#page-back:disabled { opacity:1; color:#7b8fa1; border-color:var(--line); background:#f6f8fb; cursor:default; }
#page-back span { font-family:Arial,sans-serif; }
.bot-switch { display:flex; align-items:center; gap:10px; margin-inline-start:auto; color:var(--muted); font-size:.86rem; }
.bot-switch select { min-width:150px; max-width:240px; margin:0; }
.topbar-end { display:flex; align-items:center; gap:17px; margin-inline-start:auto; }
.founder-chip { display:flex; align-items:center; gap:8px; font-size:.86rem; color:var(--muted); }
.avatar { width:34px; height:34px; display:grid; place-items:center; border:1px solid #d6e4f1; border-radius:50%; background:#eef5fc; color:#3674ad; font-size:.83rem; }
.icon-button { padding:9px; display:grid; place-items:center; min-width:42px; min-height:42px; }
.safety-strip { display:flex; align-items:center; gap:16px; padding:10px 32px; background:#fffbf2; border-bottom:1px solid #efe5cf; color:#81642c; font-size:.84rem; }
.safety-strip>span { display:inline-flex; align-items:center; gap:7px; flex:none; font-weight:700; }
.safety-strip i { width:6px; height:6px; border-radius:50%; background:#bd913c; }
#content { padding:32px; max-width:1520px; margin:0 auto; min-height:calc(100vh - 200px); outline:none; }
#content[aria-busy=true] { cursor:progress; }
#content[aria-busy=true]>.network-grid { opacity:.55; }
.page-head,.network-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:26px; }
.page-head p.muted,.network-heading p:not(.eyebrow) { color:var(--muted); font-size:.97rem; line-height:1.8; max-width:850px; }
.network-heading p:not(.eyebrow) { margin-top:6px; }
.page-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; flex:none; }
footer { display:flex; justify-content:space-between; gap:15px; border-top:1px solid var(--line); padding:18px 32px; color:#71869a; font-size:.8rem; }
footer strong { color:#566f87; }
.refreshing .ui-icon { animation:rotate-refresh 1s linear infinite; }
@keyframes rotate-refresh { to { transform:rotate(-360deg); } }
/* Reusable content and form patterns */
.columns { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:24px; align-items:start; }
.columns>div { min-width:0; }
.panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:24px; margin-bottom:24px; min-width:0; box-shadow:var(--shadow); }
.panel-head { display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; gap:12px; margin-bottom:20px; }
.panel-head p { font-size:.91rem; color:var(--muted); margin-top:4px; max-width:800px; }
.panel>h2+p { color:var(--muted); font-size:.92rem; margin-top:6px; }
.row-between { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.stats-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:24px; }
.metric { background:white; border:1px solid var(--line); border-radius:var(--radius); padding:20px; min-width:0; }
.metric-label { color:var(--muted); font-size:.91rem; display:flex; justify-content:space-between; gap:8px; }
.metric-label>span { color:#7399bd; }
.metric-value { font-size:2rem; line-height:1.45; margin:7px 0 3px; font-variant-numeric:tabular-nums; font-weight:700; overflow-wrap:anywhere; }
.metric-foot { color:var(--muted); font-size:.8rem; line-height:1.7; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.form-grid .full { grid-column:1/-1; }
.promo-round { padding:16px; border:1px solid var(--line); border-radius:14px; margin-block:10px; align-items:start; grid-template-columns:minmax(0,1fr) minmax(0,2fr) auto; }
.promo-round .actions { margin:26px 0 0; }
@media(max-width:700px) { .promo-round { grid-template-columns:1fr; } .promo-round .actions { margin:0; } }
form>label+label { margin-top:18px; }
label { display:block; font-size:.94rem; font-weight:700; }
input,select,textarea { display:block; width:100%; min-width:0; padding:11px 13px; min-height:46px; border:1px solid #cddae7; border-radius:9px; background:#fff; margin-top:7px; font-size:1rem; line-height:1.55; transition:border-color .15s,box-shadow .15s; }
input:hover,select:hover,textarea:hover { border-color:#a7bdd2; }
input:focus,select:focus,textarea:focus { border-color:#6ba5d9; }
input::placeholder,textarea::placeholder { color:#8a9bac; opacity:1; }
input:disabled,select:disabled,textarea:disabled { background:#f4f6f9; color:#72869a; }
input[aria-invalid=true] { border-color:#bd5760; }
input[type=checkbox] { display:inline-block; width:18px; height:18px; min-height:18px; margin:4px 0 0; flex:none; accent-color:var(--cyan); }
input[type=file] { font-size:.87rem; padding:7px; }
input[type=file]::file-selector-button { border:0; border-radius:6px; background:#ecf3fa; color:#315d85; padding:7px 10px; margin-inline-end:10px; font:inherit; font-weight:700; cursor:pointer; }
input.ltr,textarea.ltr,input[type=url],input[type=password],input[type=date],input[type=datetime-local],input[type=number] { direction:ltr; text-align:start; unicode-bidi:isolate; }
textarea { min-height:110px; resize:vertical; }
.hint { display:block; font-weight:400; margin-top:7px; line-height:1.8; }
.actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-top:20px; }
.actions:empty { display:none; }
.switch-line { display:flex; align-items:flex-start; gap:10px; padding:9px 0; margin-top:10px; font-weight:500; }
.switch-line label { display:flex; gap:10px; align-items:flex-start; }
.note { background:#f0f6fc; border:1px solid #dce9f5; color:#476a8b; border-radius:10px; padding:13px 16px; margin-top:17px; font-size:.89rem; line-height:1.9; overflow-wrap:anywhere; }
.note.warn { background:#fffbf2; border-color:#efe1be; color:#82632c; }
.badge,.bot-status { display:inline-flex; align-items:center; gap:7px; padding:3px 10px; border-radius:7px; font-size:.81rem; font-weight:700; line-height:1.65; white-space:nowrap; background:#edf8f1; color:var(--green); }
.badge.warn { color:#8d6928; background:#fff5dd; }
.badge.neutral { color:#61788e; background:#f0f4f8; }
.badge.red { color:var(--danger); background:#fff0f1; }
.bot-status.active { color:#176b45; background:#eaf7ef; }
.bot-status.inactive { color:#a52f3c; background:#fff0f1; }
.bot-status i { width:6px; height:6px; background:currentColor; border-radius:50%; flex:none; }
.table-wrap { max-width:100%; overflow-x:auto; border:1px solid #e5ebf2; border-radius:11px; scrollbar-width:thin; }
table { border-collapse:collapse; width:100%; text-align:start; font-size:.9rem; white-space:nowrap; }
th { background:#f7f9fc; font-weight:700; color:#62778b; padding:12px 15px; font-size:.84rem; }
td { border-top:1px solid #eaf0f5; padding:14px 15px; vertical-align:middle; }
tr:hover td { background:#fafcff; }
td button { min-height:36px; padding:6px 11px; font-size:.82rem; }
td .muted { font-size:.82rem; }
table .wrap { white-space:normal; min-width:180px; max-width:420px; }
pre { white-space:pre-wrap; overflow-wrap:anywhere; direction:ltr; text-align:left; margin:9px 0 0; padding:12px; background:#f6f8fb; border-radius:7px; font: .78rem/1.8 ui-monospace,Consolas,monospace; }
details summary { cursor:pointer; font-weight:700; color:#335b80; line-height:1.8; }
details>summary+* { margin-top:16px; }
.empty { display:flex; align-items:center; justify-content:center; flex-direction:column; text-align:center; gap:9px; min-height:185px; padding:28px 20px; color:var(--muted); }
.empty-symbol { display:grid; place-items:center; width:48px; height:48px; background:#edf3f9; color:#7291ad; border-radius:14px; font-size:1.4rem; margin-bottom:4px; }
.empty strong { color:var(--ink); font-size:1.03rem; }
.empty p { max-width:420px; font-size:.94rem; line-height:1.85; }
.status-row { display:flex; align-items:center; gap:12px; padding:16px 0; border-bottom:1px solid #eaf0f5; }
.status-row:last-child { border:0; padding-bottom:0; }
.status-symbol { width:40px; height:40px; flex:none; display:grid; place-items:center; background:#edf4fc; color:#437dab; border-radius:11px; }
.status-copy { flex:1; min-width:0; }
.status-copy p { color:var(--muted); font-size:.84rem; }
.checklist { display:grid; gap:15px; }
.check-row { display:flex; align-items:center; gap:10px; font-size:.91rem; }
.check-row .number { display:grid; place-items:center; width:25px; height:25px; border-radius:50%; background:#edf3f8; color:#6b85a0; flex:none; font-size:.82rem; }
.check-row.done .number { color:#1d7955; background:#eaf7ef; }
.check-row a { margin-inline-start:auto; font-size:.86rem; flex:none; }
.intro-card { background:linear-gradient(130deg,#163957,#10263d); color:#fff; border:0; }
.intro-card .eyebrow { color:#96bddf; }
.intro-card p:not(.eyebrow) { color:#c4d7e7; margin-top:8px; font-size:.96rem; }
.intro-card button { margin-top:19px; background:#eaf4fe; color:#245c8d; border:0; }
.subnav { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:24px; }
.subnav button { color:#5f7890; background:#fff; }
.subnav button.active { color:#fff; background:var(--navy); border-color:var(--navy); }
.permission-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; max-height:510px; overflow:auto; padding:4px; }
.permission-group { padding:18px; border:1px solid var(--line); border-radius:11px; background:#f8fafd; min-width:0; }
.permission-group h3 { font-size:.99rem; margin-bottom:10px; }
.permission-group label { display:flex; align-items:flex-start; gap:8px; font-size:.88rem; font-weight:500; margin-top:10px; }
.permission-group label.withdrawal-fee-field { display:grid; grid-template-columns:minmax(0,1fr); align-items:stretch; font-weight:600; }
.withdrawal-fee-field input { width:100%; min-width:0; }
.withdrawal-fee-field .field-error { margin:0; }
.withdrawal-mode-group{border:0;padding:0;margin:0 0 24px;min-width:0}
.withdrawal-mode-group legend{font-weight:800;font-size:1.08rem;padding:0}
.withdrawal-mode-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.withdrawal-mode-options .withdrawal-mode-option{display:flex;align-items:flex-start;gap:12px;padding:18px;border:1px solid #d6e1eb;border-radius:16px;background:#fff;cursor:pointer;transition:border-color .16s,background .16s,box-shadow .16s}
.withdrawal-mode-option:has(input:checked){border-color:#1a73c8;background:#eff7ff;box-shadow:0 0 0 1px #1a73c8}
.withdrawal-mode-option:has(input:focus-visible){outline:3px solid #8cbaf1;outline-offset:3px}
.withdrawal-mode-options input{width:18px;height:18px;min-height:18px;flex:none;margin:5px 0 0;accent-color:#196db9}
.withdrawal-mode-option span{display:grid;gap:7px;min-width:0}
.withdrawal-mode-option strong{font-size:1rem;color:#17324b}
.withdrawal-mode-option small{font-size:.85rem;font-weight:400;line-height:1.9;color:#536b80}
.withdrawal-mode-note{border-inline-start:3px solid #247bc1;border-radius:8px;background:#f1f7fc;padding:12px 16px;font-size:.87rem;line-height:1.9;color:#285c85}
.withdrawal-fees-group{margin-block:20px}
@media(max-width:700px){.withdrawal-mode-options{grid-template-columns:minmax(0,1fr)}.withdrawal-mode-options .withdrawal-mode-option{padding:14px}}
.reward-row { margin-top:16px; background:#fafcfe; }
.reward-row .form-grid label { display:block; margin:0; }
.reward-row .row-between { margin-bottom:18px; }
.search { max-width:440px; margin-bottom:22px; }
.address { background:#f2f6fb; border:1px solid #e1e9f2; border-radius:9px; padding:14px; overflow-wrap:anywhere; line-height:1.8; }
.wallet-qr { display:block; width:224px; height:auto; max-width:100%; margin:18px auto; border:1px solid var(--line); border-radius:10px; }
.gift-result { background:#edf8f2; border:1px solid #b9dfca; border-radius:11px; padding:18px; margin-top:18px; }
.gift-result .code { font-size:1.35rem; letter-spacing:2px; user-select:all; margin:8px 0; }
.bot-brand-preview { display:flex; align-items:center; gap:15px; margin-bottom:20px; }
.bot-brand-preview p { font-size:.9rem; }
.danger-zone { border-color:#ecd4d7; box-shadow:none; }
.danger-zone h2 { color:#a93c47; }
.danger-zone button { margin-top:18px; }
/* Dashboard */
.primary-link svg { width:20px; height:20px; }
.report-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px; padding:10px; margin-bottom:27px; background:white; border:1px solid var(--line); border-radius:13px; }
.period-buttons { display:flex; gap:4px; background:#f0f4f9; padding:4px; border-radius:9px; }
.period-button { display:flex; align-items:center; justify-content:center; gap:7px; min-height:37px; padding:7px 13px; border:0; background:transparent; color:#60778f; font-size:.89rem; white-space:nowrap; }
.period-button.selected { background:#fff; color:var(--cyan); box-shadow:0 2px 6px #183b5810; }
.period-button svg,.report-date>svg { width:17px; height:17px; }
.report-date { display:flex; align-items:center; flex-wrap:wrap; gap:9px; padding:0 8px; color:#637a90; font-size:.83rem; }
.timezone { border-inline-start:1px solid var(--line); padding-inline-start:10px; font-size:.81rem; }
.section-caption { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:18px; margin-bottom:18px; }
.section-caption .muted { font-size:.86rem; }
.bot-filters { display:flex; gap:9px; }
.bot-filters input,.bot-filters select { margin:0; min-height:42px; padding:8px 11px; font-size:.86rem; }
.bot-filters input { width:255px; }
.bot-filters select { width:125px; }
.network-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; align-items:stretch; }
.network-card { background:#fff; border:1px solid var(--line); border-radius:18px; padding:23px 23px 0; min-width:0; min-height:365px; display:flex; flex-direction:column; box-shadow:var(--shadow); overflow:hidden; }
.bot-card-heading { display:flex; align-items:center; gap:14px; min-height:83px; margin-bottom:15px; }
.bot-avatar { width:66px; height:66px; border-radius:14px; border:1px solid #dce6f0; object-fit:cover; flex:none; }
.bot-avatar.initials { display:grid; place-items:center; background:#edf5ff; color:#457fad; font-size:1.4rem; font-weight:700; }
.bot-identity { min-width:0; flex:1; }
.bot-identity h2 { font-size:1.25rem; line-height:1.35; overflow-wrap:anywhere; }
.bot-identity p { font-size:.83rem; color:#657c91; margin:4px 0 7px; overflow-wrap:anywhere; }
.gear-button { width:36px; min-height:36px; height:36px; display:grid; place-items:center; padding:7px; align-self:flex-start; border-radius:9px; background:#f7f9fc; color:#5e7c97; }
.gear-button svg { width:21px; height:21px; }
.finance-table { margin-bottom:9px; }
.currency-head,.finance-row { display:grid; grid-template-columns:1.1fr 1fr 1fr; gap:8px; align-items:center; text-align:end; }
.currency-head { color:#698096; font-size:.8rem; padding:8px 0; font-weight:700; }
.finance-row { border-top:1px solid #edf1f6; min-height:52px; padding:12px 0; }
.finance-label { display:flex; align-items:center; gap:7px; color:#546f88; text-align:start; font-size:.93rem; }
.finance-label svg { width:18px; height:18px; color:#5791be; flex:none; }
.finance-value { font-size:1.12rem; font-weight:700; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; line-height:1.5; }
.registration-total { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-top:auto; padding:17px 0; border-top:1px solid var(--line); }
.registration-total>span { font-size:.91rem; }
.registration-total svg { width:20px; height:20px; margin-inline-end:6px; vertical-align:middle; color:#7699b5; }
.registration-hint { display:block; font-size:.8rem; color:#6b8196; line-height:1.7; margin-top:2px; }
.registration-total strong { font-size:1.8rem; line-height:1; font-variant-numeric:tabular-nums; }
.card-actions { display:flex; margin:0 -23px; border-top:1px solid #e8edf4; background:#fbfcfe; }
.card-open { flex:1; display:flex; align-items:center; justify-content:space-between; gap:10px; border:0; border-radius:0; padding:13px 23px; background:transparent; color:#326faa; font-size:.9rem; }
.card-open svg { width:17px; height:17px; }
.card-delete { border:0; border-inline-start:1px solid #e8edf4; border-radius:0; background:transparent; color:#a45862; font-size:.86rem; padding:12px 18px; }
.card-delete:hover:not(:disabled) { color:var(--danger); background:#fff2f3; }
.total-card { background:linear-gradient(135deg,#173a5c,#10273f); border-color:#193b5a; color:#fff; }
.total-card-heading { display:flex; gap:12px; align-items:center; min-height:83px; margin-bottom:15px; }
.total-symbol { width:43px; height:43px; display:grid; place-items:center; color:#a0d3ff; border:1px solid #527597; border-radius:12px; background:#ffffff05; flex:none; }
.total-symbol svg { width:24px; height:24px; }
.total-card-heading p { color:#a9c4dd; font-size:.82rem; }
.total-card-heading h2 { font-size:1.16rem; }
.total-bot-count { margin-inline-start:auto; flex:none; border:1px solid #58748f; border-radius:6px; padding:3px 8px; font-size:.78rem; color:#d4e5f4; }
.total-card .currency-head,.total-card .registration-hint { color:#acc5dc; }
.total-card .finance-label { color:#d4e4f2; }
.total-card .finance-label svg,.total-card .registration-total svg { color:#9ac8eb; }
.total-card .finance-row,.total-card .registration-total { border-color:#385570; }
.total-footer { display:flex; align-items:center; gap:8px; border-top:1px solid #385570; padding:14px 0; font-size:.78rem; color:#adc6dd; margin-top:0; }
.add-bot-card { display:flex; align-items:center; justify-content:center; flex-direction:column; padding:28px; border:1px dashed #bdcfe1; border-radius:18px; text-align:center; min-height:300px; background:#f8fafd; color:#65829c; }
.add-bot-card:hover { border-color:#84acd0; background:#f1f7fe; }
.add-bot-card>span { width:52px; height:52px; display:grid; place-items:center; border:1px solid #d7e5f2; background:#edf5fc; color:#5c91bf; border-radius:14px; margin-bottom:18px; }
.add-bot-card>span svg { width:25px; height:25px; }
.add-bot-card h2 { color:#4e708d; font-size:1.2rem; }
.add-bot-card p { font-size:.96rem; margin-top:9px; color:#6b849a; }
.add-bot-card strong { display:flex; align-items:center; gap:12px; margin-top:21px; color:#447da9; font-size:.91rem; }
.add-bot-card strong svg { width:17px; height:17px; }
.report-footnote { display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; gap:17px; color:#6e8297; font-size:.82rem; margin-top:22px; }
.report-footnote>div { max-width:820px; }
.report-footnote strong { color:#4e6880; }
.report-footnote p+p { margin-top:5px; }
.report-footnote>span { display:flex; align-items:center; gap:6px; white-space:nowrap; }
.report-footnote svg { width:15px; height:15px; }
.deleted-bot { display:flex; align-items:center; gap:17px; padding:21px 0; border-top:1px solid #e8edf4; }
.deleted-avatar { width:54px; height:54px; display:grid; place-items:center; flex:none; background:#f0f3f7; color:#8293a5; border:1px solid #dfe6ee; border-radius:13px; font-size:1.2rem; }
.deleted-identity { flex:1; min-width:0; }
.deleted-identity p { color:var(--muted); font-size:.86rem; overflow-wrap:anywhere; }
.deleted-identity .hint { margin-top:3px; font-size:.81rem; }
/* Bot creation and editing */
.onboarding-context { margin-bottom:5px; color:var(--cyan); font-size:.82rem; font-weight:700; }
.onboarding-context p:not(.eyebrow) { color:var(--muted); margin-top:6px; }
.onboarding-layout { display:grid; grid-template-columns:minmax(185px,225px) minmax(0,1fr); gap:22px; align-items:start; }
.draft-list { padding:19px; }
.draft-list h2 { font-size:1rem; }
.draft-choice { display:flex; flex-direction:column; align-items:flex-start; gap:5px; width:100%; margin-top:12px; padding:13px; text-align:start; overflow-wrap:anywhere; }
.draft-choice span { font-size:.86rem; font-weight:500; }
.draft-choice bdi { max-width:100%; overflow-wrap:anywhere; font-size:.8rem; color:var(--muted); }
.draft-choice small { font-size:.79rem; color:var(--cyan); }
.draft-choice.selected { background:var(--cyanlight); border-color:#94bce2; }
.existing-bots-heading { margin-top:21px; padding-top:20px; border-top:1px solid var(--line); }
.onboarding-workspace { min-width:0; }
.onboarding-steps { list-style:none; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; padding:0 0 22px; margin:0 0 23px; border-bottom:1px solid var(--line); }
.onboarding-steps button { display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:7px; width:100%; height:100%; border:1px solid transparent; background:#f7f9fc; padding:11px 6px; min-height:83px; font-size:.86rem; color:#6b8298; }
.onboarding-steps b { display:grid; place-items:center; width:26px; height:26px; border:1px solid #dce5ef; background:#fff; border-radius:50%; font-size:.85rem; }
.onboarding-steps [aria-current=step] button { background:#edf5ff; border-color:#b2d2ee; color:#1766a8; }
.onboarding-steps [aria-current=step] b { background:var(--cyan); border-color:var(--cyan); color:white; }
#telegram-draft-form>label,.username-control { display:block; margin:21px 0; }
#telegram-draft-form>p { color:var(--muted); font-size:.94rem; }
#telegram-draft-form h2+p { margin-top:8px; }
.name-status { min-height:25px; color:var(--muted); font-size:.89rem; margin-top:7px; }
.name-status[data-state=taken] { color:var(--danger); }
.name-suggestions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.name-suggestions p { width:100%; font-size:.88rem; }
.name-suggestions button { direction:ltr; font-size:.88rem; min-height:36px; padding:6px 10px; }
.setup-resource { display:flex; flex-wrap:wrap; align-items:center; gap:12px; background:#f4f8fc; padding:16px; border-radius:10px; overflow-wrap:anywhere; }
.setup-instructions,.setup-steps { padding-inline-start:23px; font-size:.97rem; line-height:1.9; margin:18px 0; }
.setup-instructions li,.setup-steps li+li { margin-top:11px; }
#creation-link-slot { margin:18px 0; }
#onboarding-feedback,#manager-progress { font-size:.93rem; color:var(--cyan); line-height:1.85; overflow-wrap:anywhere; }
.onboarding-footer { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-top:25px; padding-top:22px; border-top:1px solid var(--line); }
.onboarding-footer>span { flex:1; color:var(--muted); font-size:.83rem; }
.asset-requirements { padding:17px; margin-top:24px; background:#f5f8fc; border-radius:10px; }
.setup-summary { display:grid; gap:5px; margin-top:20px; }
.setup-summary>div { display:flex; align-items:center; justify-content:space-between; gap:15px; border-bottom:1px solid var(--line); padding:12px 0; }
.setup-summary strong { font-size:.92rem; }
.draft-asset { display:grid; grid-template-columns:110px minmax(0,1fr); gap:18px; align-items:center; border-top:1px solid var(--line); padding:19px 0; }
.draft-asset img { max-width:100%; object-fit:contain; border:1px solid #e3eaf2; border-radius:10px; background:#fff; }
.asset-empty { display:grid; place-items:center; text-align:center; min-height:85px; padding:10px; color:#7d93a7; border:1px dashed #d0deeb; background:#fafcff; border-radius:10px; font-size:.82rem; }
.onboarding-workspace details { margin:21px 0; }
/* Telegram connections and publishing */
.manager-setup { max-width:980px; }
.manager-setup h2 { overflow-wrap:anywhere; }
.telegram-controls { margin-top:27px; padding-top:22px; border-top:1px solid var(--line); }
.telegram-controls p,.publication-preview dd,.publication-result { font-size:.93rem; line-height:1.9; }
.publication-preview,.publication-result,.runtime-controls { margin-top:18px; padding:19px; border:1px solid #d9e6f1; border-radius:12px; background:#f7faff; }
.publication-preview { border-color:#98bfdf; }
.publication-preview dt { font-weight:700; }
.publication-preview dd { margin:4px 0 16px; white-space:pre-wrap; overflow-wrap:anywhere; }
.publication-preview img { max-width:100%; object-fit:contain; background:#e9eff5; border-radius:10px; }
.publication-preview button { margin:5px; }
.publication-result ul { padding-inline-start:21px; }
.runtime-health { color:var(--muted); font-size:.9rem; line-height:1.9; margin:12px 0; }
.runtime-controls input { max-width:30rem; }
.account-connection { margin-bottom:24px; }
.account-qr { display:flex; align-items:center; gap:24px; margin:23px 0; }
.account-qr img { background:white; border:1px solid var(--line); border-radius:12px; flex:none; max-width:100%; height:auto; padding:7px; }
.account-connection details { margin:18px 0; }
.channel-progress { padding:19px; border-radius:12px; background:#f4f8fc; margin:20px 0; }
.channel-progress li { margin:9px 0; }
/* Login, feedback and dialogs */
.login-shell { min-height:100dvh; display:grid; place-items:center; background:radial-gradient(ellipse at 25% 10%,#224c68,#0d2439 65%); padding:25px; }
.login-card { background:#fff; width:min(480px,100%); padding:32px; border-radius:22px; box-shadow:0 24px 90px #0004; }
.brand-plate { margin:-32px -32px 26px; padding:26px; background:#102a40; border-radius:22px 22px 0 0; text-align:center; }
.brand-plate img { width:100%; max-width:325px; height:92px; object-fit:contain; }
.login-card h1 { margin-top:5px; }
.login-card form { margin:24px 0 16px; }
.login-card button { width:100%; margin-top:19px; }
.login-feedback { margin:12px 0; font-size:.91rem; min-height:1.8em; line-height:1.8; }
.login-feedback[data-state=error],.inline-feedback.error { color:#a23944; background:#fff3f4; border:1px solid #edc9ce; border-radius:9px; padding:11px 13px; }
.login-feedback[data-state=pending] { color:#627e98; }
.login-feedback[data-state=success] { color:var(--green); }
.login-reload { margin:10px 0 16px; font-size:.86rem; }
.form-error { color:var(--danger); font-size:.92rem; margin-top:11px; }
.inline-feedback { margin-top:14px; font-size:.9rem; }
#toast { position:fixed; bottom:23px; inset-inline-end:23px; z-index:80; padding:15px 21px; border-radius:12px; max-width:480px; background:#193b56; color:#fff; box-shadow:0 8px 35px #11273930; font-size:.94rem; line-height:1.8; }
#toast.error { background:#913d48; }
dialog { border:1px solid #dce5ef; border-radius:18px; width:calc(100% - 36px); max-width:490px; padding:28px; color:var(--ink); box-shadow:0 30px 100px #0618294d; max-height:calc(100dvh - 40px); overflow:auto; }
dialog::backdrop { background:#06192c88; backdrop-filter:blur(3px); }
dialog h2 { margin:8px 0 10px; }
dialog p { font-size:.96rem; }
#confirm-message { white-space:pre-line; line-height:1.9; }
dialog .actions { justify-content:flex-end; border-top:1px solid var(--line); padding-top:20px; }
.loading { padding:60px; text-align:center; color:var(--muted); }
/* Responsive layouts preserve readable controls and a clear primary action. */
@media(min-width:1550px) { .network-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:1250px) {
  .workspace { grid-template-columns:215px minmax(0,1fr); }
  .sidebar { padding:22px 12px; }
  .topbar,#content { padding-left:24px; padding-right:24px; }
  .safety-strip { padding-left:24px; padding-right:24px; }
  .columns { grid-template-columns:1fr; gap:0; }
  .onboarding-layout { grid-template-columns:1fr; }
  .onboarding-workspace { grid-row:1; }
  .draft-list { grid-row:2; }
  .draft-list { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
  .draft-list h2,.existing-bots-heading { width:100%; margin:0; }
  .draft-choice { width:auto; max-width:100%; margin:0; }
  .existing-bots-heading { padding-top:13px; }
  .stats-grid { gap:12px; }
  .metric { padding:17px; }
  .permission-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .bot-switch { margin-inline-start:0; }
}
@media(max-width:950px) {
  .workspace { grid-template-columns:190px minmax(0,1fr); }
  .sidebar { padding:19px 10px; }
  .nav-link { padding:10px; font-size:.91rem; }
  .sidebar-bottom { flex-wrap:wrap; white-space:normal; }
  .network-grid { grid-template-columns:1fr; }
  .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .founder-chip { display:none; }
  .topbar { gap:12px; }
  .bot-switch { max-width:180px; }
  .report-toolbar { align-items:flex-start; }
  .section-caption { align-items:flex-start; }
}
@media(max-width:760px) {
  :root { font-size:17px; }
  html { scroll-padding-top:90px; }
  .workspace { display:block; }
  .sidebar { position:relative; height:auto; padding:9px 17px; }
  .sidebar-brand { justify-content:space-between; }
  .brand { width:165px; padding:0; }
  .brand img { height:56px; }
  .mobile-menu { display:grid; place-items:center; background:#ffffff0a; border-color:#ffffff2b; color:#d6e6f5; min-height:40px; width:42px; padding:6px; font-size:1.2rem; }
  .mobile-menu:hover:not(:disabled),.mobile-menu:focus-visible,.mobile-menu[aria-expanded="true"] { background:#244966; color:#fff; border-color:#82acd0; }
  .sidebar-label,.sidebar nav,.sidebar-bottom { display:none; }
  .sidebar nav.mobile-open { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); border-top:1px solid #ffffff1c; padding-top:13px; margin-top:8px; overflow:visible; }
  .sidebar nav.mobile-open .nav-section { grid-column:1/-1; }
  .sidebar:has(.mobile-open) .sidebar-bottom { display:flex; padding:12px 0 3px; margin-top:12px; }
  .nav-icon { display:grid; }
  .nav-link { font-size:.91rem; padding:9px; }
  .topbar { padding:12px 17px; min-height:72px; gap:12px; }
  .workspace-heading { flex:1; min-width:80px; }
  .workspace-heading .eyebrow { font-size:.68rem; }
  .topbar-title { font-size:.94rem; }
  .bot-switch { order:4; width:100%; max-width:none; justify-content:space-between; font-size:.87rem; }
  .bot-switch select { min-width:0; max-width:75%; flex:1; }
  .topbar-end { margin-inline-start:0; }
  #page-back { min-width:75px; padding:9px 10px; font-size:.94rem; }
  .safety-strip { padding:10px 17px; gap:10px; align-items:flex-start; font-size:.79rem; }
  .safety-strip>span { padding-top:1px; }
  #content { padding:23px 17px 30px; }
  h1 { font-size:1.6rem; }
  .page-head,.network-heading { gap:14px; flex-wrap:wrap; margin-bottom:22px; }
  .page-head p.muted,.network-heading p:not(.eyebrow) { font-size:.93rem; }
  .network-heading .primary-link { display:inline-flex; }
  .page-actions { width:100%; }
  .primary-link,.secondary-link,a.primary { font-size:.93rem; padding:10px 14px; }
  .panel { padding:20px; margin-bottom:20px; }
  .form-grid { grid-template-columns:1fr; gap:17px; }
  .permission-grid { grid-template-columns:1fr; max-height:440px; }
  .stats-grid { gap:11px; }
  .metric { padding:16px; }
  .metric-value { font-size:1.7rem; }
  .metric-label { font-size:.87rem; }
  .metric-foot { font-size:.78rem; }
  .report-toolbar { display:block; padding:9px; margin-bottom:23px; }
  .period-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
  .period-button { font-size:.93rem; min-height:40px; }
  .report-date { margin-top:10px; padding:5px; font-size:.84rem; }
  .section-caption { gap:15px; }
  .bot-filters { width:100%; }
  .bot-filters input { flex:1; width:0; }
  .bot-filters select { width:120px; }
  .network-grid { grid-template-columns:1fr; gap:18px; }
  .network-card { min-height:350px; padding:20px 20px 0; }
  .card-actions { margin:0 -20px; }
  .card-open { padding:13px 20px; }
  .bot-avatar { width:62px; height:62px; }
  .finance-value { font-size:1.2rem; }
  .onboarding-steps { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; padding-bottom:18px; margin-bottom:20px; }
  .onboarding-steps button { min-height:76px; font-size:.9rem; }
  .draft-list { padding:17px; }
  .draft-choice { width:100%; }
  .onboarding-footer>span { flex-basis:100%; order:3; }
  .onboarding-footer { gap:9px; }
  .onboarding-footer button { flex:1; }
  .draft-asset { grid-template-columns:88px minmax(0,1fr); gap:13px; }
  .draft-asset button { width:100%; }
  .draft-asset input { font-size:.82rem; }
  .setup-summary>div { flex-wrap:wrap; }
  .account-qr { flex-direction:column; align-items:stretch; gap:18px; }
  .account-qr img { align-self:center; }
  .publication-preview,.publication-result,.runtime-controls { padding:16px; }
  .deleted-bot { flex-wrap:wrap; gap:12px; }
  .deleted-bot>button { margin-inline-start:66px; width:calc(100% - 66px); }
  .login-shell { padding:17px; }
  .login-card { padding:26px; }
  .brand-plate { margin:-26px -26px 24px; padding:23px; }
  .brand-plate img { height:85px; }
  footer { padding:17px; flex-direction:column; gap:4px; }
  #toast { inset-inline:14px; bottom:14px; max-width:none; }
  dialog { padding:23px; }
  table { font-size:.86rem; }
  th,td { padding:12px; }
}
@media(max-width:390px) {
  #content { padding-inline:13px; }
  .panel { padding:17px; }
  .nav-link { gap:5px; font-size:.85rem; }
  .nav-icon { width:27px; height:29px; }
  .draft-asset { grid-template-columns:1fr; }
  .draft-asset img { width:110px; }
  .draft-asset .asset-empty { min-height:62px; }
  .bot-card-heading { gap:10px; }
  .bot-avatar { width:54px; height:54px; }
  .finance-label { font-size:.87rem; }
}
/* Focused bot creator and identity studio. */
.bot-studio,.creator-shell { --studio-border:#dce5ef; --studio-soft:#f6f9fd; --studio-blue:#176fbd; width:100%; min-width:0; margin:0 auto 24px; }
.bot-studio { max-width:1180px; background:#fff; border:1px solid var(--studio-border); border-radius:20px; box-shadow:0 8px 32px #15355206; }
.creator-shell { max-width:960px; }
.studio-surface { min-width:0; }
.creator-shell>.studio-surface { padding:24px; border:1px solid var(--studio-border); border-radius:18px; background:#fff; box-shadow:0 8px 25px #173b5805; }
.studio-header { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:24px 28px; }
.studio-header h1,.studio-header h2 { font-size:1.38rem; line-height:1.5; overflow-wrap:anywhere; }
.studio-header p { color:var(--muted); font-size:.9rem; margin-top:3px; max-width:660px; }
.studio-header>.actions { margin:0; flex:none; gap:8px; }
.studio-identity { display:flex; align-items:center; gap:16px; min-width:0; }
.studio-identity>div { min-width:0; }
.studio-identity bdi { display:inline-block; max-width:100%; color:#638098; font-size:.86rem; overflow-wrap:anywhere; }
.studio-avatar { width:66px; height:66px; flex:none; display:grid; place-items:center; overflow:hidden; border:1px solid #d4e2ef; border-radius:18px; background:linear-gradient(145deg,#e8f3fe,#f5f9ff); color:#2b6da5; font-size:1.6rem; font-weight:700; }
.studio-avatar img { display:block; width:100%; height:100%; object-fit:cover; }
.studio-tabs { display:flex; align-items:stretch; gap:6px; padding:0 28px; border-top:1px solid #edf1f6; border-bottom:1px solid var(--studio-border); background:#fbfcfe; overflow-x:auto; overscroll-behavior-inline:contain; scrollbar-width:thin; }
.studio-tabs [role=tab] { position:relative; flex:0 0 auto; min-width:96px; min-height:55px; padding:14px 18px; border:0; border-radius:0; color:#657c92; background:transparent; font-size:.94rem; white-space:nowrap; }
.studio-tabs [role=tab]:hover:not(:disabled) { background:#f0f6fd; color:#1d659f; }
.studio-tabs [role=tab][aria-selected=true] { color:#155f9c; background:#eef5fd; }
.studio-tabs [role=tab][aria-selected=true]::after { content:''; position:absolute; inset-inline:17px; bottom:0; height:3px; border-radius:3px 3px 0 0; background:var(--studio-blue); }
.studio-tabs [role=tab]:focus-visible { z-index:1; outline-offset:-4px; border-radius:7px; }
.studio-pane { min-width:0; padding:26px 28px; scroll-margin-top:110px; }
.studio-pane>h2 { font-size:1.13rem; }
.studio-pane>h2+p,.studio-pane>p.muted { margin-top:5px; font-size:.91rem; }
.studio-pane>.note:first-child { margin-top:0; }
.studio-pane .hint { font-size:.83rem; line-height:1.75; }
.studio-pane .actions { margin-top:16px; }
.studio-details-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(250px,.58fr); gap:28px; align-items:start; }
.identity-template-card { margin:0 0 22px; padding:18px 20px; border:1px solid #cfdeec; border-radius:18px; background:linear-gradient(135deg,#f8fbff,#eef6ff); box-shadow:0 10px 28px rgba(18,67,105,.06); }
.identity-template-card[data-state="current"] { border-color:#a8d6bd; background:linear-gradient(135deg,#f7fcf9,#eef9f3); }
.identity-template-card[data-state="custom"] { border-color:#ead7aa; background:linear-gradient(135deg,#fffdf8,#fff8e9); }
.identity-template-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.identity-template-heading h3 { margin:8px 0 4px; }
.identity-template-heading p { margin:0; color:var(--muted); }
.identity-template-card details { margin-top:14px; }
.identity-template-card summary { cursor:pointer; font-weight:700; color:var(--ink); }
.identity-template-preview { display:grid; grid-template-columns:90px minmax(0,1fr); gap:0; margin:14px 0 0; border:1px solid #dce7f1; border-radius:14px; overflow:hidden; background:#fff; }
.identity-template-preview dt,.identity-template-preview dd { margin:0; padding:12px 14px; border-bottom:1px solid #e7edf3; white-space:pre-wrap; }
.identity-template-preview dt { font-weight:700; background:#f5f8fb; }
.identity-template-preview dt:last-of-type,.identity-template-preview dd:last-of-type { border-bottom:0; }
.studio-details-grid>div { min-width:0; }
.studio-fields { display:grid; gap:18px; }
.studio-field { min-width:0; }
.studio-field-note { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-top:6px; color:#6b8195; font-size:.79rem; line-height:1.65; }
.studio-field-note>span { min-width:0; }
.studio-field-note>bdi { flex:none; color:#7890a5; font-size:.74rem; font-variant-numeric:tabular-nums; }
.studio-details-grid label { font-size:.91rem; }
.studio-details-grid label+label,.studio-details-grid .username-control { margin-top:18px; }
.studio-details-grid input,.studio-details-grid textarea { margin-top:6px; font-size:.96rem; background:#fff; }
.studio-details-grid textarea { min-height:100px; line-height:1.75; }
.studio-details-grid textarea[rows="2"] { min-height:79px; }
.studio-details-grid textarea[rows="4"] { min-height:131px; }
.studio-details-grid input[readonly] { color:#577087; background:#f5f8fb; border-style:dashed; }
.studio-preview { border:1px solid #dce6f0; border-radius:15px; padding:20px; background:linear-gradient(155deg,#f0f6fd,#fbfdff); min-width:0; overflow-wrap:anywhere; }
.studio-preview>h3 { font-size:.91rem; color:#516d86; margin-bottom:16px; }
.studio-preview .studio-avatar { width:54px; height:54px; border-radius:16px; font-size:1.25rem; }
.studio-preview .studio-identity { gap:11px; align-items:flex-start; }
.studio-preview .studio-identity h2,.studio-preview .studio-identity h3 { font-size:1.02rem; }
.studio-preview p { font-size:.88rem; line-height:1.85; white-space:pre-wrap; }
.studio-preview>p { margin-top:14px; }
.studio-preview .note { font-size:.79rem; background:#ffffffa6; padding:10px 12px; margin-top:16px; }
.studio-preview>.eyebrow { margin:0 0 18px; font-size:.77rem; color:#6a8399; }
.studio-preview-profile { text-align:center; }
.studio-preview-profile .studio-avatar { width:62px; height:62px; margin:0 auto 11px; border-radius:19px; }
.studio-preview-profile h3 { font-size:1.06rem; line-height:1.6; }
.studio-preview-profile bdi { display:block; margin-top:3px; font-size:.74rem; color:#6d8397; }
.studio-preview-profile p { margin-top:12px; font-size:.85rem; }
.studio-message { border:1px solid #e1e9f0; border-radius:12px 12px 4px 12px; background:#fff; padding:13px 15px; margin-top:20px; box-shadow:0 3px 9px #23476904; font-size:.85rem; line-height:1.9; white-space:pre-wrap; overflow-wrap:anywhere; }
.studio-message:empty { display:none; }
.studio-section-head { margin-bottom:22px; }
.studio-section-head h2 { font-size:1.13rem; }
.studio-section-head p { color:var(--muted); font-size:.88rem; margin-top:4px; }
.studio-group-title { margin-top:24px; font-size:1rem; color:#365c7a; }
.studio-group-title+.studio-assets-grid { margin-top:12px; }
.studio-assets-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:17px; margin-top:20px; }
.studio-asset-card { min-width:0; border:1px solid var(--studio-border); border-radius:14px; overflow:hidden; background:#fff; }
.studio-asset-preview { position:relative; display:grid; place-items:center; width:100%; height:190px; overflow:hidden; background:#f0f4f9; border-bottom:1px solid #e6edf4; }
.studio-asset-preview.square { width:100%; height:190px; }
.studio-asset-preview img { display:block; width:100%; height:100%; min-height:0; object-fit:contain; }
.studio-asset-preview.square img { object-fit:contain; }
.studio-asset-preview .asset-empty { width:100%; height:100%; border:0; border-radius:0; background:transparent; min-height:0; font-size:.87rem; padding:18px; }
.studio-asset-preview>span { color:#7d94a9; font-size:.86rem; text-align:center; padding:15px; }
.studio-asset-meta { display:grid; align-content:start; gap:7px; padding:16px; }
.studio-asset-meta h3 { font-size:1rem; }
.studio-asset-meta p,.studio-asset-meta .hint { font-size:.8rem; line-height:1.75; color:var(--muted); margin:0; overflow-wrap:anywhere; }
.studio-asset-meta button { width:100%; margin-top:5px; font-size:.87rem; min-height:42px; color:#22649c; border-color:#d5e3f1; background:#f5f9ff; }
.studio-asset-meta button:hover:not(:disabled) { background:#eaf3ff; border-color:#a8c8e5; }
.studio-asset-card>.studio-asset-state { border-top:1px solid #edf1f5; margin:0; padding:9px 16px; color:#72889b; background:#fafcfe; font-size:.75rem; }
.studio-asset-preview>span:first-child { align-self:end; padding:12px 12px 0; font-size:2.2rem; line-height:1.2; color:#9bb2c7; }
.studio-asset-preview>span+span { align-self:start; padding:7px 12px 12px; }
.studio-savebar { position:sticky; bottom:12px; z-index:12; display:flex; flex-direction:row; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:12px; margin:0 18px 18px; padding:15px 18px; border:1px solid #d8e4ef; border-radius:13px; background:#fffffff5; box-shadow:0 5px 22px #183c5710; backdrop-filter:blur(12px); }
.studio-savebar>div:first-child { flex:1 1 190px; min-width:0; }
.studio-savebar #draft-save-state { display:block; color:#73889a; font-size:.78rem; }
.studio-savebar>p,.studio-savebar>span,.studio-savebar>.hint { margin:0; margin-inline-end:auto; flex:1 1 250px; color:#667d91; font-size:.84rem; line-height:1.7; }
.studio-savebar .primary { min-width:160px; box-shadow:0 3px 8px #176fbd1a; }
.studio-savebar .actions { margin:0; gap:8px; }
.studio-savebar .switch-line { flex:1 1 240px; margin:0; padding:0; font-size:.84rem; }
.studio-savebar #onboarding-feedback { flex-basis:100%; font-size:.85rem; }
.studio-savebar #onboarding-feedback:empty { display:none; }
.creator-shell>.studio-header { padding:0 2px 20px; }
.creator-steps { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); list-style:none; padding:0; margin:0 0 22px; gap:8px; }
.creator-steps>li { min-width:0; }
.creator-steps>li>button { display:flex; align-items:center; justify-content:flex-start; gap:9px; width:100%; min-height:60px; padding:11px 13px; border:1px solid #dfe7f1; background:#fff; color:#71869a; border-radius:12px; font-size:.9rem; }
.creator-steps b { display:grid; place-items:center; width:27px; height:27px; flex:none; border-radius:50%; border:1px solid #dde6ef; background:#f7f9fc; font-size:.82rem; line-height:1; }
.creator-steps [aria-current=step]>button { border-color:#afcfe9; background:#eef6ff; color:#1b65a3; box-shadow:0 2px 6px #176fbd05; }
.creator-steps [aria-current=step] b { background:var(--studio-blue); border-color:var(--studio-blue); color:#fff; }
.creator-step { min-width:0; padding:23px 3px 26px; border-top:1px solid #e7edf4; }
.creator-step>.eyebrow { font-size:.77rem; margin-bottom:6px; color:#7590a8; }
.creator-step>h2 { font-size:1.24rem; }
.creator-step>p.muted { font-size:.92rem; max-width:720px; margin-top:5px; }
.creator-fields { max-width:700px; margin-top:24px; }
.creator-fields>label { max-width:100%; }
.creator-fields .username-control { margin-bottom:0; }
.creator-fields [data-check-name] { font-size:.84rem; min-height:38px; padding:7px 12px; }
.creator-resource { display:flex; align-items:center; gap:13px; padding:17px; margin:19px 0; border:1px solid #e0e8f1; border-radius:12px; background:#f8fbfe; min-width:0; }
.creator-resource>div { min-width:0; flex:1; }
.creator-resource strong { display:block; font-size:1.02rem; overflow-wrap:anywhere; }
.creator-resource bdi { display:block; font-size:.81rem; color:#6d8397; overflow-wrap:anywhere; }
.creator-resource .studio-avatar { width:49px; height:49px; border-radius:13px; font-size:1.25rem; }
.creator-resource .badge { font-size:.76rem; }
.creator-checklist { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); list-style:none; counter-reset:creator-check; gap:14px; padding:0; margin:22px 0; }
.creator-checklist>li { position:relative; padding:0; counter-increment:creator-check; font-size:.91rem; }
.creator-checklist>li::before { content:counter(creator-check); display:grid; place-items:center; width:24px; height:24px; margin-bottom:8px; border:1px solid #d9e4ee; border-radius:8px; color:#537c9f; background:#f3f7fb; font-size:.76rem; font-weight:700; }
.creator-checklist p { color:#74889b; font-size:.83rem; line-height:1.8; margin-top:4px; }
.studio-help { padding:14px 16px; margin-top:22px; border:1px solid #e3eaf2; border-radius:10px; background:#fafcfe; }
.studio-help>summary { font-size:.88rem; font-weight:500; }
.studio-help p { color:#6a8095; font-size:.87rem; line-height:1.8; }
.creator-shell .studio-savebar { margin:0; bottom:12px; padding:16px 0 0; border-inline:0; border-bottom:0; border-radius:0; box-shadow:none; background:#fff; }
.studio-channel-card { max-width:790px; padding:20px; border:1px solid #dce6f0; border-radius:14px; background:#fcfdff; }
.studio-channel-card .creator-resource { margin:0 0 20px; border:0; padding:0; background:none; }
.studio-toggle-row { display:flex; align-items:flex-start; gap:12px; padding:17px; border:1px solid #dce8f4; border-radius:11px; background:#f3f8ff; font-size:.9rem; }
.studio-toggle-row input { margin-top:4px; }
.studio-toggle-row strong { display:block; }
.studio-toggle-row small { display:block; margin-top:5px; font-size:.81rem; line-height:1.8; font-weight:400; color:#6a8299; }
.studio-connections { margin-top:20px; padding-top:20px; border-top:1px solid #e4ebf2; }
.studio-connections h3 { font-size:1rem; }
.studio-connections>button { margin-top:13px; font-size:.87rem; }
.channel-set { min-width:0; margin-top:20px; }
.channel-setup-readiness { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:17px 20px; margin-bottom:20px; border:1px solid #e2e8f0; border-radius:12px; background:#f7f9fc; color:#314961; }
.channel-setup-readiness strong { font-size:.96rem; }
.channel-setup-readiness p { margin:5px 0 0; font-size:.83rem; line-height:1.8; }
.channel-ready-count { flex:none; text-align:center; font-size:.76rem; }
.channel-ready-count bdi { display:block; font-size:1.25rem; font-weight:700; }
.channel-setup-readiness[data-state=working] { border-color:#c5dff6; background:#eff7ff; color:#185c99; }
.channel-setup-readiness[data-state=complete] { border-color:#b8ddcc; background:#eef9f3; color:#176c4c; }
.channel-setup-readiness[data-state=error] { border-color:#f0c9ca; background:#fff5f5; color:#a7383e; }
.channel-config-status .badge.warn { background:#fff0f0; color:#a7383e; }
@media(max-width:600px) { .channel-setup-readiness { padding:14px; gap:12px; align-items:flex-start; } .channel-ready-count bdi { font-size:1.1rem; } }
.channel-set-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:17px; }
.channel-config-card { display:flex; flex-direction:column; min-width:0; padding:20px; border:1px solid #dae5ef; border-radius:14px; background:#fff; transition:border-color .15s,background .15s; }
.channel-config-card[data-enabled=false] { border-style:dashed; background:#fafcfe; }
.channel-config-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.channel-config-heading h3 { font-size:1.04rem; line-height:1.6; }
.channel-visibility { display:inline-block; font-size:.72rem; line-height:1.7; color:#637f97; background:#edf3f8; border-radius:5px; padding:1px 7px; margin-top:5px; }
.channel-visibility.public { background:#e9f4ff; color:#3173a9; }
.channel-enable { display:flex; align-items:center; flex:none; gap:7px; font-size:.75rem; font-weight:500; color:#6a8298; padding:4px 0; }
.channel-enable input { position:relative; appearance:none; -webkit-appearance:none; width:36px; min-width:36px; height:22px; min-height:22px; margin:0; padding:0; border:1px solid #b8c9d9; border-radius:20px; background:#d9e3ed; cursor:pointer; transition:background .15s,border-color .15s; }
.channel-enable input::after { content:''; position:absolute; width:14px; height:14px; top:3px; left:3px; border-radius:50%; background:#fff; box-shadow:0 1px 3px #163a542e; transition:transform .15s; }
.channel-enable input:checked { border-color:#176fbd; background:#176fbd; }
.channel-enable input:checked::after { transform:translateX(14px); }
.channel-enable input:disabled { opacity:.55; cursor:not-allowed; }
.channel-config-help { font-size:.84rem; line-height:1.8; color:#6e8599; margin:13px 0 17px; }
.channel-title-label { font-size:.84rem; }
.channel-title-label input { font-size:.92rem; min-height:43px; padding:9px 11px; }
.channel-config-card .username-control { margin:16px 0 0; }
.channel-config-card .username-control label { font-size:.84rem; }
.channel-config-card .username-control input { font-size:.89rem; padding:9px 11px; min-height:43px; }
.channel-config-card .name-status { font-size:.77rem; min-height:0; line-height:1.75; }
.channel-config-card [data-check-name] { min-height:34px; font-size:.78rem; padding:6px 9px; margin-top:5px; }
.channel-config-card .name-suggestions { gap:5px; }
.channel-artwork { display:flex; align-items:center; gap:12px; padding:15px 0; margin-top:8px; }
.channel-artwork .studio-asset-preview,.channel-artwork .studio-asset-preview.square { flex:none; width:64px; height:64px; border:1px solid #dee8f1; border-radius:13px; background:#f3f7fb; }
.channel-artwork .studio-asset-preview>span:first-child { align-self:center; padding:0; font-size:1.9rem; }
.channel-artwork .studio-asset-preview>span+span { display:none; }
.channel-artwork>div:last-child { min-width:0; }
.channel-artwork button { min-height:36px; font-size:.8rem; padding:7px 11px; border-color:#dbe6ef; background:#f9fbfe; }
.channel-artwork .studio-asset-state { margin:5px 0 0; font-size:.74rem; line-height:1.6; }
.channel-config-status { display:flex; align-items:center; flex-wrap:wrap; justify-content:space-between; gap:9px; border-top:1px solid #e9eef4; padding-top:13px; margin-top:auto; }
.channel-config-status .badge { font-size:.76rem; }
.channel-config-status a { font-size:.8rem; }
.channel-config-card>.note { font-size:.79rem; padding:10px 12px; margin-top:12px; }
.channel-set-hint { margin-top:15px; font-size:.8rem; line-height:1.85; }
.channel-set-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-top:21px; }
.channel-set-actions button { font-size:.9rem; }
.channel-set-actions .hint { margin:0; font-size:.8rem; }
#channel-set-feedback { font-size:.86rem; line-height:1.85; color:#366e9b; margin-top:14px; overflow-wrap:anywhere; }
#channel-set-feedback:empty { display:none; }
.channel-main-publication { margin-top:24px; }
.creator-shell #telegram-draft-form>label,.creator-shell .username-control { margin:18px 0; }
.creator-shell #telegram-draft-form>label:first-child { margin-top:0; }
.creator-shell #telegram-draft-form>h2 { font-size:1.22rem; }
.creator-shell #telegram-draft-form>p { max-width:720px; font-size:.93rem; }
.creator-shell .onboarding-footer { margin-top:24px; padding-top:18px; }
.creator-shell .setup-instructions,.creator-shell .setup-steps { font-size:.93rem; margin:15px 0; line-height:1.85; }
.creator-shell .setup-instructions li,.creator-shell .setup-steps li+li { margin-top:7px; }
.creator-shell .setup-resource { padding:14px 16px; }
.creator-shell .note { margin-top:14px; }
.creator-shell .name-status { font-size:.85rem; min-height:23px; }
.creator-shell .name-suggestions { gap:6px; margin-top:7px; }
.creator-shell .name-suggestions:empty { display:none; }
.creator-shell .name-suggestions button { min-height:36px; padding:6px 10px; }
.studio-dialog { width:min(600px,calc(100% - 32px)); max-width:600px; max-height:calc(100dvh - 32px); padding:0; margin:auto; overflow:hidden; border:1px solid #d9e5f0; border-radius:20px; background:#fff; box-shadow:0 28px 100px #071c3859; }
.studio-dialog[open] { display:flex; flex-direction:column; }
.studio-dialog::backdrop { background:#081c32a8; backdrop-filter:blur(5px); }
.studio-dialog-header { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; flex:none; padding:23px 25px 19px; border-bottom:1px solid #e4ebf3; }
.studio-dialog-header h2 { font-size:1.18rem; margin:0; }
.studio-dialog-header p { color:var(--muted); font-size:.86rem; margin-top:4px; }
.studio-dialog-header>button { flex:none; min-height:36px; width:36px; padding:4px; border-radius:9px; font-size:1.15rem; color:#73889b; background:#f7f9fc; }
.studio-dialog-body { min-height:0; padding:22px 25px; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; }
.studio-dialog-body>p { font-size:.9rem; color:var(--muted); }
.studio-dialog-body>.note:first-child { margin-top:0; }
.studio-dialog-body .hint { font-size:.82rem; }
.studio-dialog-footer { display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:10px; flex:none; padding:16px 25px; border-top:1px solid #e4ebf3; background:#f9fbfd; }
.studio-dialog-footer>p { flex:1 1 220px; color:var(--muted); font-size:.82rem; margin:0; }
.studio-dialog-footer .primary { min-width:130px; }
.studio-dialog form { display:contents; }
.studio-file-picker { position:relative; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:5px; width:100%; min-height:57px; margin-top:15px; padding:14px 20px; border:1px dashed #adc9e3; border-radius:11px; background:#f3f8ff; color:#2366a0; text-align:center; cursor:pointer; font-size:.92rem; }
.studio-file-picker:hover { border-color:#6c9fc9; background:#eaf4ff; }
.studio-file-picker:focus-within { outline:3px solid #4b9ce5; outline-offset:3px; }
.studio-file-picker input[type=file] { position:absolute; inset:0; width:100%; height:100%; padding:0; margin:0; opacity:0; cursor:pointer; }
.studio-file-picker strong { font-size:.98rem; }
.studio-file-picker span,.studio-file-picker small { font-size:.82rem; color:#68859e; font-weight:400; }
.studio-upload-preview { display:grid; place-items:center; min-height:170px; max-height:300px; overflow:hidden; padding:12px; margin:0 0 12px; border:1px solid #dfe8f0; border-radius:12px; background:#f2f6fa; color:#8297ab; font-size:.9rem; }
.studio-upload-preview:empty { display:none; }
.studio-upload-preview img { display:block; max-width:100%; max-height:270px; width:auto; height:auto; object-fit:contain; border-radius:7px; }
.studio-upload-preview p { font-size:.87rem; color:var(--muted); overflow-wrap:anywhere; }
.studio-draft-list { display:grid; gap:10px; }
.studio-draft-list .draft-choice { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:4px 15px; width:100%; margin:0; padding:15px 16px; text-align:start; border:1px solid #dae5ef; border-radius:12px; background:#fff; }
.studio-draft-list .draft-choice:hover { background:#f5f9fe; border-color:#b5cfe5; }
.studio-draft-list .draft-choice.selected { background:#edf6ff; border-color:#a9cceb; }
.studio-draft-list .draft-choice>div { min-width:0; }
.studio-draft-list .draft-choice strong { display:block; font-size:.98rem; }
.studio-draft-list .draft-choice span,.studio-draft-list .draft-choice bdi { display:block; margin-top:3px; font-size:.8rem; color:#6e869c; }
.studio-draft-list .draft-choice bdi { grid-column:1; grid-row:2; }
.studio-draft-list .draft-choice>span { grid-column:2; grid-row:1/3; color:#3575a9; font-size:.77rem; }
.studio-draft-list>h3 { font-size:.91rem; color:#67839b; margin:8px 0 2px; }
.studio-draft-list>h3:not(:first-child) { margin-top:17px; }
.studio-draft-list .empty { min-height:140px; padding:20px; }
/* Results and operations stay readable without overwhelming the editor. */
.bot-studio .telegram-controls { padding:0; margin:0; border:0; }
.bot-studio .identity-update-summary { margin:0 0 18px; padding:15px 17px; border:1px solid #dbe6ef; border-radius:12px; background:#f8fbfe; }
.identity-update-summary>h2,.identity-update-summary>h3 { font-size:1rem; }
.identity-update-summary>p { color:#647d92; font-size:.85rem; line-height:1.8; margin-top:4px; }
.identity-component-chips { display:flex; flex-wrap:wrap; gap:7px; margin-top:11px; }
.identity-component-chip { display:inline-flex; align-items:center; gap:6px; padding:4px 9px; border:1px solid #dce5ee; border-radius:7px; color:#647c91; background:#fff; font-size:.79rem; line-height:1.65; }
.identity-component-chip[data-tone=good] { color:#236b4b; background:#eff9f3; border-color:#d1e9dc; }
.identity-component-chip[data-tone=warn] { color:#8c672a; background:#fff8e9; border-color:#ecdcb9; }
.identity-update-details { margin-top:12px; border-top:1px solid #e2eaf2; padding-top:10px; }
.identity-update-details summary { font-size:.84rem; font-weight:500; }
.identity-update-details>summary+* { margin-top:10px; }
.identity-update-details .publication-result { padding:12px; margin:10px 0 0; background:#fff; font-size:.84rem; }
.bot-studio .telegram-runtime-card { margin:0; padding:20px; border:1px solid #d9e5ef; border-radius:14px; background:#fff; }
.telegram-runtime-heading { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; }
.telegram-runtime-heading h2,.telegram-runtime-heading h3 { font-size:1.1rem; }
.telegram-runtime-card .runtime-health { font-size:.87rem; margin:10px 0 15px; }
.telegram-runtime-heading .runtime-health { margin:0; text-align:end; }
.telegram-runtime-card label { font-size:.89rem; }
.telegram-runtime-card .telegram-runtime-actions+label { margin-top:22px; padding-top:18px; border-top:1px solid #e7edf3; }
.telegram-runtime-card input { max-width:32rem; font-size:.95rem; }
.telegram-runtime-actions { display:flex; flex-wrap:wrap; align-items:center; gap:9px; margin-top:18px; }
.telegram-runtime-actions button { min-width:115px; font-size:.89rem; }
.telegram-controls-help { font-size:.85rem; color:#687f93; line-height:1.8; }
.telegram-controls-help>summary { margin-top:15px; font-size:.84rem; font-weight:500; }
.identity-component-chip>span { opacity:.8; }
.identity-component-chip>strong { font-weight:700; }
.identity-update-result { margin-bottom:20px; }
.identity-update-details ul { margin:10px 0; padding-inline-start:20px; font-size:.85rem; line-height:1.9; }
.identity-update-details li+li { margin-top:6px; }
.bot-studio .telegram-publication-panel { margin:18px 0 0; padding:16px 18px; border:1px solid #e1e8f0; border-radius:12px; background:#fafcfe; }
.telegram-publication-panel>summary { font-size:.94rem; }
.telegram-publication-panel .publication-preview,.telegram-publication-panel .publication-result { font-size:.87rem; padding:16px; }
.telegram-publication-panel .publication-preview dd { font-size:.87rem; }
@media(max-width:1100px) {
  .studio-details-grid { grid-template-columns:minmax(0,1fr) minmax(230px,.62fr); gap:22px; }
  .studio-header { padding:22px; }
  .studio-tabs { padding-inline:22px; }
  .studio-pane { padding:23px 22px; }
  .studio-assets-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
  .creator-steps>li>button { font-size:.84rem; gap:7px; padding:10px; }
}
@media(max-width:900px) {
  .studio-details-grid { grid-template-columns:minmax(0,1fr); gap:22px; }
  .studio-preview { max-width:none; }
  .creator-steps>li>button { flex-direction:column; justify-content:center; gap:6px; min-height:76px; padding:9px 6px; text-align:center; }
  .channel-set-grid { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:760px) {
  .identity-template-heading { display:grid; }
  .identity-template-heading button { width:100%; }
  .identity-template-preview { grid-template-columns:1fr; }
  .identity-template-preview dt { border-bottom:0; padding-bottom:4px; }
  .identity-template-preview dd { padding-top:4px; }
  .bot-studio { border-radius:16px; margin-bottom:18px; }
  .studio-header { padding:19px 18px; gap:15px; flex-wrap:wrap; }
  .studio-header h1,.studio-header h2 { font-size:1.23rem; }
  .studio-header p { font-size:.85rem; }
  .studio-header>.actions { margin-inline-start:auto; }
  .studio-header>.actions button { min-height:40px; font-size:.84rem; padding:8px 11px; }
  .studio-identity { gap:12px; }
  .studio-avatar { width:55px; height:55px; border-radius:15px; font-size:1.35rem; }
  .studio-tabs { gap:0; padding-inline:9px; }
  .studio-tabs [role=tab] { min-width:82px; flex:1 0 auto; min-height:52px; padding:13px 11px; font-size:.86rem; }
  .studio-tabs [role=tab][aria-selected=true]::after { inset-inline:12px; }
  .studio-pane { padding:21px 18px; }
  .studio-details-grid { gap:20px; }
  .studio-preview { padding:17px; }
  .studio-section-head { margin-bottom:20px; }
  .studio-assets-grid { gap:12px; margin-top:17px; }
  .studio-asset-meta { padding:13px; gap:6px; }
  .studio-asset-meta h3 { font-size:.94rem; }
  .studio-asset-meta button { font-size:.83rem; padding:9px; }
  .studio-asset-preview,.studio-asset-preview.square { height:165px; }
  .studio-savebar { bottom:0; gap:10px; margin:0; padding:14px 17px calc(14px + env(safe-area-inset-bottom,0px)); border-inline:0; border-bottom:0; border-radius:0 0 16px 16px; box-shadow:0 -4px 18px #173a5010; }
  .studio-savebar>p,.studio-savebar>span,.studio-savebar>.hint { flex-basis:100%; font-size:.8rem; }
  .studio-savebar>div:first-child { flex-basis:100%; }
  .studio-savebar>.primary { flex:1; min-width:0; }
  .studio-savebar .actions { width:100%; }
  .studio-savebar .actions .primary { flex:1; min-width:0; }
  .creator-shell>.studio-header { padding:0 0 17px; }
  .creator-shell>.studio-surface { padding:17px; border-radius:15px; }
  .creator-steps { gap:6px; margin-bottom:17px; }
  .creator-steps>li>button { font-size:.81rem; min-height:76px; padding:9px 5px; border-radius:10px; }
  .creator-steps b { width:25px; height:25px; font-size:.78rem; }
  .creator-step { padding:20px 0 23px; }
  .creator-step>h2 { font-size:1.14rem; }
  .creator-step>p.muted { font-size:.87rem; }
  .creator-fields { margin-top:21px; }
  .creator-shell .studio-savebar { bottom:0; padding-bottom:env(safe-area-inset-bottom,0px); }
  .creator-resource { flex-wrap:wrap; padding:14px; gap:11px; }
  .creator-resource>.badge { margin-inline-start:60px; }
  .creator-checklist { grid-template-columns:minmax(0,1fr); gap:16px; }
  .creator-checklist>li { padding-inline-start:35px; }
  .creator-checklist>li::before { position:absolute; inset-inline-start:0; top:0; margin:0; }
  .studio-channel-card { padding:17px; }
  .studio-toggle-row { padding:14px; gap:10px; }
  .channel-set { margin-top:18px; }
  .channel-set-grid { gap:13px; }
  .channel-config-card { padding:17px; }
  .channel-config-heading { gap:10px; }
  .channel-config-heading h3 { font-size:1rem; }
  .channel-enable { font-size:.72rem; gap:6px; }
  .channel-set-actions { gap:9px; margin-top:17px; }
  .channel-set-actions>button { width:100%; font-size:.85rem; }
  .channel-artwork .studio-asset-preview,.channel-artwork .studio-asset-preview.square { width:60px; height:60px; }
  .creator-shell #telegram-draft-form>h2 { font-size:1.12rem; }
  .creator-shell #telegram-draft-form>p { font-size:.87rem; }
  .creator-shell .onboarding-footer { margin-top:21px; padding-top:16px; }
  .studio-dialog { width:calc(100% - 24px); max-height:calc(100dvh - 24px); border-radius:16px; }
  .studio-dialog-header { padding:18px 18px 16px; gap:12px; }
  .studio-dialog-header h2 { font-size:1.11rem; }
  .studio-dialog-body { padding:19px 18px; }
  .studio-dialog-footer { padding:14px 18px calc(14px + env(safe-area-inset-bottom,0px)); gap:9px; }
  .studio-dialog-footer .primary { flex:1; min-width:0; }
  .studio-file-picker { min-height:54px; padding:13px 17px; }
  .studio-upload-preview { max-height:240px; }
  .studio-upload-preview img { max-height:210px; }
  .studio-draft-list .draft-choice { padding:13px 14px; }
  .bot-studio .identity-update-summary { padding:14px; }
  .identity-component-chips { gap:6px; }
  .identity-component-chip { font-size:.77rem; }
  .bot-studio .telegram-runtime-card { padding:17px; }
  .telegram-runtime-actions button { flex:1; min-width:110px; }
  .bot-studio .telegram-publication-panel { padding:14px; }
}
@media(max-width:440px) {
  .studio-assets-grid { grid-template-columns:minmax(0,1fr); }
  .studio-asset-preview,.studio-asset-preview.square { height:190px; }
  .studio-header { padding:18px 15px; }
  .studio-pane { padding:19px 15px; }
  .studio-tabs { padding-inline:5px; }
  .studio-tabs [role=tab] { min-width:72px; padding-inline:9px; font-size:.83rem; }
  .creator-steps>li>button { font-size:.75rem; gap:5px; min-height:78px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none!important; animation:none!important; scroll-behavior:auto!important; } }

/* Saved bot setup workspace. */
.pending-creations { max-width:1080px; margin:0 auto; }
.pending-creations-header { display:flex; justify-content:space-between; align-items:flex-start; gap:22px; margin-bottom:22px; }
.pending-creations-header p { margin:5px 0 12px; color:var(--muted); }
.pending-creations-header .actions { margin:0; flex:none; }
#pending-creations-feedback { margin-bottom:15px; }
.pending-creations-list { display:grid; gap:18px; }
.pending-creation-card { background:#fff; border:1px solid var(--line); border-radius:18px; padding:23px 25px; box-shadow:var(--shadow); }
.pending-creation-identity { display:flex; align-items:center; gap:13px; }
.pending-creation-identity>div { min-width:0; }
.pending-creation-identity h2 { font-size:1.14rem; overflow-wrap:anywhere; }
.pending-creation-identity .mono { display:block; color:var(--muted); overflow-wrap:anywhere; margin-top:2px; }
.pending-creation-identity .badge { margin-inline-start:auto; }
.pending-creation-identity .studio-avatar { width:49px; height:49px; flex:none; border-radius:14px; }
.pending-creation-progress { margin:20px 0; padding:15px 18px; border:1px solid #e4ebf3; background:#f7fafd; border-radius:12px; }
.pending-creation-progress strong { font-size:.94rem; }
.pending-creation-progress p { color:var(--muted); font-size:.91rem; margin-top:3px; }
.pending-creation-meta { display:flex; align-items:center; justify-content:space-between; gap:15px; }
.pending-creation-meta a { flex:none; }
.pending-creations-empty { border:1px dashed #cbd9e7; border-radius:18px; padding:55px 25px; text-align:center; background:#fff; }
.pending-creations-empty>span { display:grid; place-items:center; margin:0 auto 18px; width:56px; height:56px; border-radius:18px; background:#edf6fd; color:var(--cyan); font-size:1.5rem; }
.pending-creations-empty p { color:var(--muted); margin:8px 0 23px; }
@media(max-width:950px) {
  .pending-creations-header { flex-wrap:wrap; }
  .pending-creations-header .actions { flex-wrap:wrap; }
}
@media(max-width:600px) {
  .pending-creation-card { padding:19px 17px; }
  .pending-creation-identity { flex-wrap:wrap; }
  .pending-creation-identity .badge { margin-inline-start:0; }
  .pending-creation-meta { align-items:stretch; flex-direction:column; gap:13px; }
  .pending-creation-progress { margin:16px 0; padding:13px; }
}
@media(prefers-reduced-motion:reduce) {
  .nav-link,.nav-icon { transition:none; }
  .refreshing .ui-icon { animation:none; }
}

/* Request progress: only explicit pending work animates, never disabled controls. */
.loading-ring,
button[aria-busy=true]:not(.icon-button)::before,
.loading-status[aria-busy=true]::before,
.loading::before,
.channel-setup-readiness[data-state=working] strong::before {
  content:'';
  display:inline-block;
  inline-size:1em;
  block-size:1em;
  flex:none;
  border:2px solid currentColor;
  border-inline-end-color:transparent;
  border-block-end-color:transparent;
  border-radius:50%;
  vertical-align:-.14em;
  animation:loading-turn .8s linear infinite;
}
button[aria-busy=true]:not(.icon-button)::before,
.loading-status[aria-busy=true]::before,
.channel-setup-readiness[data-state=working] strong::before { margin-inline-end:.6em; }
button[aria-busy=true] { cursor:progress; opacity:1; }
button.primary[aria-busy=true] { background:#1766ad; border-color:#1766ad; box-shadow:0 0 0 3px #2579bd12; }
button[aria-busy=true]:not(.primary):not(.danger):not(.quiet) { background:#f0f7fe; border-color:#bcd7ee; color:#23689f; }
.loading-status[aria-busy=true] { color:var(--cyan); }
.loading-status[aria-busy=true]:empty::before { content:none; }
.loading { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; min-height:220px; font-size:.93rem; }
.loading::before { inline-size:30px; block-size:30px; border-width:3px; color:var(--cyan); }
#refresh[aria-busy=true] { border-color:#c7ddf0; background:#f1f7fd; }
#telegram-draft-form[aria-busy=true] .onboarding-footer,
#telegram-draft-form[aria-busy=true] .studio-savebar { border-color:#c0d9ef; background:#f3f8fe; box-shadow:0 3px 20px #176fbd0a; }
.onboarding-footer,.studio-savebar { transition:background .18s,border-color .18s,box-shadow .18s; }
.channel-setup-readiness[data-state=working] { box-shadow:0 3px 16px #176fbd08; }
.page-loading { position:sticky; top:83px; height:0; z-index:21; display:flex; justify-content:center; pointer-events:none; }
.page-loading::before { content:''; position:absolute; inset-inline:0; top:0; height:2px; background:linear-gradient(90deg,transparent 15%,#3792db 45%,#88c8f2 55%,transparent 85%); background-size:200% 100%; animation:loading-sweep 1.6s linear infinite; }
.page-loading-pill { display:inline-flex; align-items:center; justify-content:center; gap:10px; padding:9px 18px; min-height:42px; border:1px solid #d6e5f2; border-radius:999px; background:#fff; color:#246697; box-shadow:0 6px 24px #163e681a; font-size:.85rem; font-weight:700; white-space:nowrap; transform:translateY(12px); }
.page-loading-pill .loading-ring { inline-size:17px; block-size:17px; }
@keyframes loading-turn { to { transform:rotate(360deg); } }

/* Setup stays editable while stopped; launch is the final reviewed action. */
.setup-intro { padding:20px 24px; margin-block-end:24px; border:1px solid #d9e8f5; border-radius:16px; background:#f5faff; }
.setup-intro strong { color:#185b96; font-size:1.08rem; }
.setup-intro p { margin:7px 0 0; color:#61758a; font-size:.88rem; }
.studio-tabs { flex-wrap:wrap; gap:6px; }
.studio-tabs [role=tab] { white-space:nowrap; }
.setup-connection-pane { padding-block-start:8px; }
.setup-connection-pane .provider-page { margin:0; }
.setup-block { padding:24px; margin-block:20px; border:1px solid #dfE7ef; border-radius:16px; background:#fff; }
.setup-block h3 { margin-block-start:0; }
.setup-block form label { display:grid; gap:8px; margin-block:16px; }
.setup-block-heading,.setup-payment-connected,.setup-next { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.setup-payment-connected { padding:16px 20px; border:1px solid #cde6db; background:#f1faf6; border-radius:14px; color:#276750; }
.setup-next { padding-block:24px 4px; border-block-start:1px solid #e4ebf2; margin-block-start:28px; color:#6b7d8e; font-size:.9rem; }
.setup-empty { text-align:center; max-width:640px; margin:30px auto; padding:36px; background:#f7fafc; border:1px dashed #c3d6e7; border-radius:18px; }
.setup-empty p { color:#647a90; line-height:1.9; }
.setup-wallet-address { overflow-wrap:anywhere; font-size:.85rem; }
.setup-review { padding:24px; margin-block:24px; background:#f7fafe; border:1px solid #dbe6f0; border-radius:18px; }
.setup-review-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.setup-review-heading h2 { font-size:1.22rem; margin:0; }
.setup-review-heading p { color:#647a90; font-size:.88rem; margin-block:8px; }
.setup-checklist { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-block:20px; }
.setup-check { display:grid; grid-template-columns:28px 1fr auto; text-align:start; align-items:center; gap:10px; padding:14px 16px; border:1px solid #dce5ed; border-radius:12px; background:#fff; min-width:0; }
.setup-check>span { display:grid; place-items:center; width:26px; height:26px; border-radius:50%; background:#fbe8e8; color:#b53535; }
.setup-check[data-ready=true]>span { background:#e3f4eb; color:#24734d; }
.setup-check[data-ready=false] { border-color:#ebc5c5; }
.setup-check strong { font-size:.88rem; }
.setup-check small { color:#77889a; font-size:.77rem; }
.setup-issues { list-style:none; margin:16px 0 0; padding:0; display:grid; gap:8px; }
.setup-issues button { display:flex; width:100%; justify-content:space-between; text-align:start; color:#b02d39; background:#fff5f5; border:1px solid #edcecf; border-radius:10px; padding:12px 16px; font-size:.88rem; }
.setup-issues button:hover { background:#ffeded; border-color:#d87b83; }
.note.error,.provider-feedback[data-state=error] { background:#fff4f4; border:1px solid #edc5ca; border-radius:12px; padding:14px 18px; color:#ac2937; }
.field-error,.provider-field-error { display:block; margin:7px 0 0; color:#b12738; font-size:.82rem; line-height:1.6; font-weight:500; }
.provider-field-error[hidden] { display:none; }
input[aria-invalid=true],select[aria-invalid=true],textarea[aria-invalid=true] { border-color:#d14353!important; background:#fffafa; box-shadow:0 0 0 3px #d1435312; }
input[aria-invalid=true]:focus,select[aria-invalid=true]:focus,textarea[aria-invalid=true]:focus { outline-color:#d14353; box-shadow:0 0 0 4px #d1435321; }
.loading-status.error { color:#b12738; }
.provider-account-controls { padding-block:8px 16px; }
.provider-route-guidance { margin:14px 0 0; padding:11px 14px; border:1px solid #cfe2f7; border-radius:12px; background:#f2f8ff; color:#285e91; font-size:.9rem; }
.provider-account-body { border-block-start:1px solid #e5ecf3; padding-block-start:16px; }
.provider-account-options { margin-block-start:16px; padding:12px 16px; border:1px solid #e1e8f0; border-radius:12px; color:#5c7086; }
.provider-account-options summary { cursor:pointer; font-size:.88rem; }
.identity-component-chip[data-tone=warn] { background:#fff1f1; border-color:#edc5ca; color:#ac2937; }
@media(max-width:650px) {
  .setup-review,.setup-block { padding:18px 14px; }
  .setup-review-heading { flex-wrap:wrap; }
  .setup-checklist { grid-template-columns:1fr; }
  .setup-intro { padding:16px; }
  .setup-next>* { width:100%; }
  .setup-block-heading>button { width:100%; }
}
@keyframes loading-sweep { from { background-position:200% 0; } to { background-position:0 0; } }
@media(max-width:600px) {
  .page-loading { top:78px; }
  .page-loading-pill { padding:8px 15px; min-height:38px; font-size:.81rem; }
}
@media(prefers-reduced-motion:reduce) {
  .loading-ring,button[aria-busy=true]::before,.loading-status[aria-busy=true]::before,.loading::before,
  .channel-setup-readiness[data-state=working] strong::before,.page-loading::before { animation:none; }
  .page-loading::before { background-position:center; }
}

/* Operational alerts remain readable on a narrow founder-console pane. */
.ops-alert { display:flex;align-items:flex-start;gap:12px;padding:14px 16px;margin-block:12px;border:1px solid #f1d8a9;border-radius:12px;background:#fffbf2;color:#815c24;font-size:.9rem; }
.ops-alert>span { flex:none;display:grid;place-items:center;width:22px;height:22px;border:1px solid currentColor;border-radius:50%;font-weight:700;margin-top:2px; }
.ops-alert p { margin:0;line-height:1.8; }
.ops-good { border-color:#b7dacb;background:#f2faf6;color:#217353; }
