.system-services{padding:26px;border-color:#dce5e0;overflow:hidden}
.system-services-heading{display:flex;align-items:center;gap:13px;margin-bottom:24px}
.system-services-heading h2{margin:0;font-size:23px;letter-spacing:-.5px}
.system-services-symbol,.system-service-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;background:var(--mint);color:var(--green);border-radius:12px;width:44px;height:44px}
.system-services-symbol svg{width:25px;height:25px}
.system-services-tabs{display:grid;min-width:0;max-width:100%;overflow:visible;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding:5px;border-radius:13px;background:#f3f6f4;margin-bottom:26px}
.system-services-tabs a{display:flex;white-space:normal;max-width:100%;align-items:center;justify-content:center;gap:9px;min-width:0;min-height:48px;padding:11px 10px;border-radius:9px;color:#63786e;text-align:center;line-height:1.35;font-size:13px;text-decoration:none}
.system-services-tabs a svg{width:20px;height:20px;flex-shrink:0}
.system-services-tabs a span{display:block;font-size:inherit;min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:normal}
.system-services-tabs a.active{background:#fff;color:var(--green);box-shadow:0 2px 8px #193c2d0a;font-weight:650}
.system-services-tabs a:hover{background:#e9efeb}
.system-services-tabs a.active:hover{background:#fff}
.system-services-tabs a:focus-visible,.system-service-rights summary:focus-visible,.system-service-link:focus-visible{outline:2px solid var(--green);outline-offset:3px}
.system-service-section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 18px}
.system-service-section-heading h3{margin:0;font-size:17px;letter-spacing:-.2px}
.system-service-section-heading button{font-size:12px;min-height:40px}
.system-service-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.system-service-card{padding:22px;border:1px solid #dfe7e2;border-radius:13px;background:linear-gradient(145deg,#fbfdfb,#fff 65%);min-width:0}
.system-service-card-heading{display:flex;gap:13px;align-items:flex-start}
.system-service-card-heading>div{min-width:0}
.system-service-card h3{font-size:17px;margin:1px 0 10px;overflow-wrap:anywhere;letter-spacing:-.2px}
.system-service-icon{width:39px;height:39px;border-radius:11px}
.system-service-icon svg{width:22px;height:22px}
.system-service-badges{display:flex;flex-wrap:wrap;gap:6px}
.system-service-card .badge{white-space:normal;line-height:1.4;font-size:11px}
.system-service-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:24px 0}
.system-service-facts>div{min-width:0}
.system-service-facts dt{font-size:12px;font-weight:500;color:var(--muted);margin-bottom:6px}
.system-service-facts dd{font-size:14px;line-height:1.5;margin:0;overflow-wrap:anywhere}
.system-service-rights{margin:20px 0;border-top:1px solid #e7ece8;border-bottom:1px solid #e7ece8}
.system-service-rights summary{cursor:pointer;padding:13px 0;font-size:13px;font-weight:550}
.system-service-rights summary span{display:inline-flex;align-items:center;justify-content:center;margin-left:7px;background:#eef3ef;border-radius:5px;font-size:11px;min-width:21px;padding:2px 5px}
.system-service-rights ul{margin:0 0 17px;padding-left:20px;font-size:13px;line-height:1.8}
.system-service-actions{gap:9px;margin-top:22px;align-items:center}
.system-service-actions button,.system-service-actions .button{font-size:12px;line-height:1.4;max-width:100%;min-height:40px;white-space:normal}
.system-service-actions .system-service-remove{color:var(--muted);margin-left:auto}
.system-service-link{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:550;margin-top:18px;color:var(--green);text-decoration:none}
.system-service-link:hover{text-decoration:underline}
.system-service-link svg,.system-service-actions a svg{width:16px;height:16px;vertical-align:middle;flex-shrink:0}
.system-service-actions a{display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;border:1px solid var(--green);border-radius:8px;padding:10px 15px;font-weight:600;text-align:center}
.system-service-empty{grid-column:1/-1;margin:0;padding:32px 20px;background:#f8faf8;border:1px dashed #d8e3db;border-radius:12px;text-align:center;color:var(--muted);font-size:14px}
.system-service-assistant{margin-top:24px;padding:22px 0 0;border-top:1px solid #e6ebe7;display:flex;justify-content:space-between;align-items:center;gap:18px}
.system-service-assistant h3{margin:0 0 6px}
.system-service-assistant span{color:var(--muted);font-size:13px}
.system-service-assistant .actions button{font-size:12px}
.system-service-telegram{max-width:740px}
.system-service-permissions .check{margin:14px 0}
.system-telegram-stage{margin:0 0 20px;padding:12px 14px;background:var(--mint);border-radius:9px;line-height:1.5}
.system-telegram-form fieldset{margin:0 0 18px;border:1px solid #dfe7e2;border-radius:10px;padding:14px 16px}
.system-telegram-form legend{font-weight:650;padding:0 5px}
.system-telegram-form ul{padding-left:20px;line-height:1.6;margin:0}
.system-service-rights fieldset{border:0;padding:10px 0;margin:0}
.system-service-rights legend{font-weight:600;font-size:13px}
#dialog:has(.system-telegram-form){width:min(660px,calc(100% - 24px));max-height:calc(100dvh - 24px);overflow:hidden}
#dialog:has(.system-telegram-form) #dialog-form{display:flex;flex-direction:column;max-height:calc(100dvh - 78px);min-height:0}
#dialog:has(.system-telegram-form) .modal-head,#dialog:has(.system-telegram-form) .modal-actions,#dialog:has(.system-telegram-form) #dialog-error{flex-shrink:0}
#dialog:has(.system-telegram-form) #dialog-body{overflow-y:auto;min-height:0;overscroll-behavior:contain}
@media(max-width:1150px){.system-service-grid{grid-template-columns:1fr}.system-services-tabs a{flex-direction:column;gap:7px}}
@media(max-width:540px){.system-services{padding:20px 15px}.system-services-heading{margin-bottom:20px;gap:11px}.system-services-heading h2{font-size:21px}.system-services-symbol{width:39px;height:39px}.system-services-tabs{gap:3px;padding:4px;margin-bottom:23px}.system-services-tabs a{font-size:11px;padding:10px 3px;min-height:76px;gap:7px}.system-services-tabs a span{hyphens:auto}.system-service-section-heading{align-items:flex-start;flex-direction:column;gap:12px;margin-bottom:16px}.system-service-section-heading h3{font-size:17px}.system-service-section-heading button{width:100%;min-height:44px}.system-service-card{padding:19px 15px}.system-service-card-heading{gap:11px}.system-service-card h3{font-size:17px}.system-service-facts{gap:16px 10px;margin:22px 0}.system-service-facts dt{font-size:11px}.system-service-facts dd{font-size:13px}.system-service-actions button,.system-service-actions .button{flex:1 1 125px;min-height:44px}.system-service-actions .system-service-remove{flex:0 1 auto;margin-left:0}.system-service-telegram .system-service-facts{grid-template-columns:1fr}.system-service-assistant{align-items:flex-start;flex-direction:column}.system-service-assistant .actions{width:100%}.system-service-assistant .actions button{flex:1 1 130px;min-height:44px}}
@media(prefers-reduced-motion:reduce){.system-services *{scroll-behavior:auto}}
@media(max-width:540px){.system-services-tabs a:last-child:nth-child(odd){grid-column:1/-1}}

.system-service-api-address{margin:0 0 20px;padding:12px 14px;border:1px solid #e2eae5;border-radius:9px;background:#f5f8f6;min-width:0}
.system-service-api-address span{display:block;font-size:11px;color:var(--muted);margin-bottom:6px}
.system-service-api-address code{font-family:inherit;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.system-ai-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px 18px;padding:1px 2px 3px}
.system-ai-form label{min-width:0;line-height:1.45}
.system-ai-form .system-ai-wide{grid-column:1/-1}
.system-ai-form input,.system-ai-form select{min-height:45px}
#dialog:has(.system-ai-form){width:min(660px,calc(100% - 24px));max-height:calc(100dvh - 24px);overflow:hidden}
#dialog:has(.system-ai-form) #dialog-form{display:flex;flex-direction:column;max-height:calc(100dvh - 78px);min-height:0}
#dialog:has(.system-ai-form) .modal-head,#dialog:has(.system-ai-form) .modal-actions{flex-shrink:0}
#dialog:has(.system-ai-form) #dialog-body{overflow-y:auto;min-height:0;overscroll-behavior:contain}
#dialog:has(.system-ai-form) #dialog-error{flex-shrink:0;margin-bottom:0}
#dialog:has(.system-ai-form) .modal-actions button{white-space:normal;min-height:44px}
@media(max-width:540px){.system-ai-form{grid-template-columns:minmax(0,1fr);gap:15px}.system-ai-form input,.system-ai-form select{font-size:16px}#dialog:has(.system-ai-form){padding:18px}#dialog:has(.system-ai-form) #dialog-form{max-height:calc(100dvh - 62px)}#dialog:has(.system-ai-form) .modal-head h2{font-size:19px;line-height:1.3}#dialog:has(.system-ai-form) .modal-actions{margin-top:16px;padding-top:15px}#dialog:has(.system-ai-form) .modal-actions button{flex:1 1 100px;font-size:12px;padding:10px}}

.system-telegram-layout{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:start}
.system-telegram-layout .system-service-telegram{max-width:none}
.system-telegram-library{grid-column:1/-1}
.system-telegram-library-section{padding-top:20px;border-top:1px solid #e4ebe6}
.system-telegram-library-section+.system-telegram-library-section{margin-top:24px}
.system-telegram-library-section h4{font-size:15px;line-height:1.4;margin:0;font-weight:650}
.system-telegram-library-section .system-service-section-heading{gap:12px}
.system-telegram-connector-group summary span{font-size:11px;color:var(--green);margin-left:6px;white-space:nowrap}
.system-telegram-learning-stats{border-bottom:0;margin-bottom:0}
.system-telegram-learning-stats .system-telegram-statistics{margin-top:8px;margin-bottom:0}
.system-telegram-layout .system-service-rights:last-child{margin-bottom:0}
.system-telegram-connectors .system-telegram-connector-group{border-top:1px solid #e7ece8}
.system-telegram-connectors .system-telegram-connector-group summary{display:list-item;padding:12px 0;font-weight:500}
.system-telegram-connectors .system-telegram-connector-group ul{list-style:none;padding:0 0 12px;margin:0}
.system-telegram-connector-group li{padding:11px 0;line-height:1.5}
.system-telegram-connector-group li+li{border-top:1px solid #edf1ee}
.system-telegram-connector-group li>div{display:flex;justify-content:space-between;gap:12px;align-items:baseline}
.system-telegram-connector-group strong{font-size:13px;font-weight:550}
.system-telegram-connector-group p{font-size:12px;line-height:1.5;margin:6px 0 0;color:#776644;overflow-wrap:anywhere}
.system-telegram-capability-status{font-size:11px;color:var(--green);flex-shrink:0}
.system-telegram-capability-status.unavailable{color:#8a6827}
.system-telegram-tag{display:inline-block;font-size:10px;color:#60726a;background:#edf2ef;border-radius:4px;padding:2px 6px;margin:5px 5px 0 0}
.system-telegram-budget{padding:17px 18px;background:#eff6f2;border:1px solid #dce8e0;border-radius:11px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.system-telegram-budget>div{min-width:0}
.system-telegram-budget>div>span:not(:only-child){display:block;font-size:12px;color:#5c7165;margin-bottom:5px}
.system-telegram-budget strong{font-size:18px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.system-telegram-budget>div:last-child{grid-column:1/-1;display:flex;justify-content:space-between;gap:12px;align-items:baseline}
.system-telegram-budget>div:last-child>span{margin:0}
.system-telegram-budget-track{grid-column:1/-1;height:7px;border-radius:8px;overflow:hidden;background:#dae7df}
.system-telegram-budget-track>span{display:block;height:100%;background:var(--green);border-radius:inherit}
.system-telegram-statistics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0 0 20px}
.system-telegram-statistics>div{border:1px solid #e0e9e3;background:#f7faf8;border-radius:9px;padding:14px;min-width:0}
.system-telegram-statistics dt{font-size:12px;color:#617469;line-height:1.5;min-height:36px}
.system-telegram-statistics dd{font-size:23px;font-weight:650;font-variant-numeric:tabular-nums;margin:10px 0 0;color:var(--green);overflow-wrap:anywhere}
.system-telegram-patterns{list-style:none;margin:0;padding:0;max-height:500px;overflow-y:auto;overscroll-behavior:contain}
.system-telegram-pattern{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:18px 0;border-top:1px solid #e5ece7}
.system-telegram-pattern>div{min-width:0}
.system-telegram-pattern strong{font-size:14px;line-height:1.5;display:block;overflow-wrap:anywhere}
.system-telegram-pattern-action{display:block;margin:4px 0 9px;font-size:12px;color:#687c6e;overflow-wrap:anywhere}
.system-telegram-pattern>button{flex-shrink:0;min-height:40px;font-size:12px}
@media(max-width:1150px){.system-telegram-layout{grid-template-columns:1fr}.system-telegram-statistics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:540px){.system-telegram-statistics{gap:10px}.system-telegram-statistics>div{padding:12px}.system-telegram-statistics dd{font-size:21px}.system-telegram-pattern{gap:12px;align-items:flex-start;flex-wrap:wrap}.system-telegram-pattern>div{flex:1 1 190px}.system-telegram-pattern>button{min-height:44px}.system-telegram-connector-group li>div{flex-wrap:wrap;gap:4px 12px}.system-telegram-budget{padding:15px}.system-telegram-layout{gap:15px}}
@media(max-width:540px){.system-services-tabs{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.system-services-tabs a{min-height:72px;padding:9px 7px;font-size:12px}.system-telegram-library-section .system-service-section-heading{align-items:flex-start}.system-telegram-library-section{padding-top:18px}.system-telegram-library-section+.system-telegram-library-section{margin-top:21px}}

.telegram-workspace{max-width:1300px;margin:0 auto;min-width:0}
.telegram-topline{display:flex;align-items:center;justify-content:space-between;gap:22px;flex-wrap:wrap;margin-bottom:12px}
.telegram-brand{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;background:#e7f3f8;border-radius:11px;color:#269acb}
.telegram-brand svg{width:25px;height:25px}
.telegram-tabs{grid-template-columns:repeat(3,minmax(0,1fr));margin:0 0 22px}
.telegram-notifications{margin-bottom:22px;padding:25px 28px}
.telegram-notifications>.section-intro{font-size:13px;max-width:760px;line-height:1.65;margin:0 0 23px}
.telegram-notification-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 30px}
.telegram-notification-row{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:22px 0;border-top:1px solid #e5ece7;min-width:0}
.telegram-notification-row>div{min-width:0}
.telegram-notification-row h3{font-size:14px;margin:0 0 6px;font-weight:600}
.telegram-notification-row p{font-size:12px;line-height:1.6;color:var(--muted);margin:0}
.telegram-notification-row .service-switch-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.telegram-notification-master{grid-column:1/-1;background:#eef5f1;border:1px solid #dbe8df;border-radius:12px;margin-bottom:8px;padding:19px 20px}
.telegram-muted-notice{background:#f1f4f2;border-radius:9px;padding:12px 15px;font-size:13px;line-height:1.6;color:#62746b}
.telegram-content>.system-service-section-heading{margin-top:30px}
.telegram-content .system-notification-delivery{max-width:740px}
@media(max-width:800px){.telegram-notification-list{grid-template-columns:minmax(0,1fr)}.telegram-notification-master{grid-column:auto}.telegram-notifications{padding:21px}.telegram-notification-row{gap:18px;padding:20px 0}.telegram-notification-master{padding:17px}.telegram-topline>.service-switch{min-height:44px}}
@media(max-width:540px){.telegram-topline{gap:14px}.telegram-topline>.service-switch{width:100%}.telegram-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}.telegram-tabs a:last-child:nth-child(odd){grid-column:auto}.telegram-tabs a{font-size:11px;padding:9px 5px}.telegram-notifications{padding:18px 15px}.telegram-notification-row p{font-size:12px}.telegram-notification-master{padding:15px 12px}}

/* Service cards share a factual baseline and a consistent action height. */
.system-service-section-heading{flex-wrap:wrap}
.system-service-card{display:flex;flex-direction:column}
.system-service-card>.system-service-actions{margin-top:auto;padding-top:20px}
.system-service-facts{gap:16px;margin:20px 0}
.system-service-facts dt{min-height:3em;line-height:1.5}
.system-service-facts dd,.system-telegram-budget strong,.system-telegram-statistics dd{font-variant-numeric:tabular-nums lining-nums}
.system-service-actions button,.system-service-actions .button,.system-service-actions a,.system-service-section-heading button,.system-telegram-pattern>button{min-height:var(--control-height,44px)}
.system-ai-form{align-items:end;gap:var(--form-gap,16px)}
.system-telegram-statistics>div{display:flex;flex-direction:column}
.system-telegram-statistics dd{margin-top:auto;padding-top:10px}
.system-telegram-budget>div:last-child{flex-wrap:wrap}
.telegram-notification-row .service-switch{min-height:var(--control-height,44px)}
@media(max-width:540px){.system-service-facts dt{min-height:0}.system-service-card>.system-service-actions{padding-top:16px}}
@media(max-width:380px){.system-service-facts,.system-telegram-budget{grid-template-columns:minmax(0,1fr)}.system-telegram-budget>div:last-child{grid-column:auto}.system-telegram-statistics{gap:8px}.system-telegram-statistics>div{padding:10px}.system-telegram-statistics dt{font-size:11px}.system-service-card-heading{gap:9px}}
