/* Connections hub – same navy/teal design family as the landing.
 * UI only: existing auth, dialogs, selectors and backend services remain intact. */
.app-page main.dashboard-shell.channels-page-shell,
.app-page main.dashboard-shell.accounts-connections-shell {
  width:100%;max-width:1720px;min-width:0;margin:0 auto;
  display:grid;align-content:start;gap:21px
}
.connection-hero {
  position:relative;isolation:isolate;overflow:hidden;
  display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,330px);
  align-items:center;gap:32px;min-height:255px;
  padding:clamp(26px,3.2vw,48px);
  background:#091321;color:#edf4fc;border:1px solid #26364b;border-radius:24px
}
.connection-hero:before {
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:radial-gradient(ellipse at 15% 80%,#77e6df20,transparent 56%),
    radial-gradient(ellipse at 90% 5%,#889fff29,transparent 48%)
}
.connection-hero:after {
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  opacity:.4;background-image:radial-gradient(#77e6df55 1px,transparent 1px);
  background-size:23px 23px;mask-image:linear-gradient(90deg,transparent 25%,black)
}
.connection-eyebrow {display:inline-flex;align-items:center;gap:9px;color:#77e6df;font-size:12px;font-weight:750}
.connection-live-dot {width:7px;height:7px;flex:none;border-radius:50%;background:#77e6df;box-shadow:0 0 14px #77e6df77}
.connection-hero h1 {
  color:#edf4fc;margin:10px 0 11px;
  font-size:clamp(29px,3vw,44px);font-weight:850;
  letter-spacing:-.04em;line-height:1.55
}
.connection-hero p {max-width:660px;color:#adbed1;font-size:13px;line-height:2.15;margin:0}
.connection-hero-actions {display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-top:24px}
.connection-hero-primary,.connection-hero-secondary {
  display:inline-flex;align-items:center;justify-content:center;
  gap:11px;text-decoration:none;min-height:45px;
  border:1px solid transparent;border-radius:11px;
  padding:10px 18px;font:inherit;font-size:12px;font-weight:800;cursor:pointer
}
.connection-hero-primary {
  background:#77e6df;color:#091321;border-color:#77e6df;
  margin-top:24px
}
.connection-hero-actions .connection-hero-primary {margin-top:0}
.connection-hero-primary:hover {background:#a5f3ec;color:#091321;border-color:#a5f3ec;text-decoration:none}
.connection-hero-secondary {color:#edf4fc;background:#111f30;border-color:#42586a}
.connection-hero-secondary:hover {color:#77e6df;border-color:#77e6df;text-decoration:none}
.connection-hero-primary:focus-visible,.connection-hero-secondary:focus-visible {
  outline:3px solid #77e6df;outline-offset:4px
}
.connection-hero-art {min-height:205px;min-width:0;position:relative;display:grid;place-items:center;direction:ltr}
.connection-art-orbit {position:absolute;inset:30px 10px;border:1px dashed #77e6df70;border-radius:50%;transform:rotate(-16deg)}
.connection-art-orbit-two {inset:42px 3px;border-color:#8da9ff60;transform:rotate(28deg)}
.connection-art-core {
  width:100px;height:100px;position:relative;z-index:2;
  display:grid;place-items:center;border:1px solid #476c77;
  border-radius:29px;background:linear-gradient(135deg,#214950,#111f30);
  box-shadow:0 15px 42px #0008
}
.connection-art-core .ui-icon {width:43px;height:43px;color:#77e6df}
.connection-art-chip {
  position:absolute;z-index:3;padding:8px 13px;
  border-radius:12px;border:1px solid #38576a;
  background:#17283b;color:#edf4fc;white-space:nowrap;
  font-size:11px;font-weight:700;box-shadow:0 8px 21px #0005
}
.connection-art-top {top:4px;left:14px}
.connection-art-left {bottom:8px;left:1px}
.connection-art-right {bottom:28px;right:0}
.connection-flow {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.connection-flow-step {
  display:flex;align-items:center;gap:12px;
  border:1px solid var(--ui-line);background:var(--ui-surface);
  border-radius:15px;padding:17px;min-width:0
}
.connection-flow-step>span {
  flex:none;width:34px;height:34px;display:grid;place-items:center;
  border-radius:11px;color:var(--ui-brand);background:var(--ui-brand-soft);
  border:1px solid color-mix(in srgb,var(--ui-brand) 32%,var(--ui-line));
  font-size:14px;font-weight:850
}
.connection-flow-step>div {display:grid;gap:5px;min-width:0}
.connection-flow-step strong {font-size:12px;color:var(--ui-text);font-weight:800}
.connection-flow-step small {font-size:10px;line-height:1.8;color:var(--ui-muted)}
.connection-path-note {
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;
  gap:17px;padding:20px 22px;border-radius:17px;
  background:var(--ui-soft);
  border:1px solid color-mix(in srgb,var(--ui-brand) 27%,var(--ui-line))
}
.connection-path-icon {
  flex:none;display:grid;place-items:center;width:46px;height:46px;
  color:var(--ui-brand);background:var(--ui-brand-soft);border-radius:14px
}
.connection-path-icon .ui-icon {width:23px;height:23px}
.connection-path-note>div {min-width:0}
.connection-path-note strong {font-size:13px;color:var(--ui-text)}
.connection-path-note p {margin:4px 0 0;line-height:2;color:var(--ui-muted);font-size:11px}
.connection-path-note>a {white-space:nowrap}
.connection-platform-heading {
  display:flex;align-items:end;justify-content:space-between;gap:16px;
  scroll-margin-top:30px
}
.connection-platform-heading h2 {font-size:20px;margin:4px 0;color:var(--ui-text)}
.connection-platform-heading p {font-size:12px;color:var(--ui-muted);margin:0}
.connection-platform-hint {
  display:inline-flex;align-items:center;justify-content:center;
  padding:7px 12px;white-space:nowrap;color:var(--ui-brand);
  background:var(--ui-brand-soft);border:1px solid var(--ui-line);border-radius:100px;font-size:11px
}
/* Account tabs and security-sensitive login panels retain every existing hook. */
.app-page .accounts-connections-shell .connected-platform-tabs {
  display:flex;gap:10px;padding:10px;margin:0;
  max-width:100%;min-width:0;position:relative;top:auto;
  overflow-x:auto;scrollbar-width:thin;
  border:1px solid var(--ui-line);border-radius:17px;
  background:var(--ui-surface);box-shadow:none;overscroll-behavior-inline:contain
}
.app-page .accounts-connections-shell .connected-platform-tab {
  flex:1 0 128px;min-height:61px;
  padding:10px 15px;border-radius:12px;
  border:1px solid transparent;background:var(--ui-soft);
  color:var(--ui-muted);font-size:12px;font-weight:800;
  transition:background .17s,border-color .17s,color .17s
}
.app-page .accounts-connections-shell .connected-platform-tab:hover {background:var(--ui-brand-soft);color:var(--ui-text)}
.app-page .accounts-connections-shell .connected-platform-tab.is-active {
  border-color:color-mix(in srgb,var(--ui-brand) 45%,var(--ui-line));
  background:var(--ui-brand-soft);color:var(--ui-brand)
}
.app-page .accounts-connections-shell .connected-platform-tab img {width:30px;height:30px;flex:none}
.app-page .accounts-connections-shell .connected-platform-pane {min-width:0}
.app-page .accounts-connections-shell .connected-account-panel,
.app-page .accounts-connections-shell .telegram-account-panel,
.app-page .accounts-connections-shell .connected-destinations-panel,
.app-page .accounts-connections-shell .telegram-destinations-panel {
  padding:clamp(20px,2.5vw,32px);
  margin-block:0 18px;background:var(--ui-surface);
  border:1px solid var(--ui-line);border-radius:19px
}
.app-page .accounts-connections-shell .connected-account-heading,
.app-page .accounts-connections-shell .telegram-account-heading {
  border-bottom:1px solid var(--ui-line);padding-bottom:20px;margin-bottom:20px
}
.app-page .accounts-connections-shell .connected-account-identity .brand-icon,
.app-page .accounts-connections-shell .telegram-account-identity .brand-icon {
  width:54px;height:54px;padding:10px;
  border-radius:16px;border:1px solid var(--ui-line);background:var(--ui-soft)
}
.app-page .accounts-connections-shell .connected-account-identity h2,
.app-page .accounts-connections-shell .telegram-account-identity h2 {font-size:20px;color:var(--ui-text)}
.app-page .accounts-connections-shell .connected-account-identity p,
.app-page .accounts-connections-shell .telegram-account-identity p {font-size:11px;color:var(--ui-muted)}
.app-page .accounts-connections-shell .connected-account-actions,
.app-page .accounts-connections-shell .telegram-actions {gap:12px}
.app-page .accounts-connections-shell .connected-account-actions .button,
.app-page .accounts-connections-shell .telegram-actions .button {min-height:45px;padding-inline:19px}
.app-page .accounts-connections-shell .connected-account-form,
.app-page .accounts-connections-shell .telegram-login-form {padding:19px;border:1px solid var(--ui-line);border-radius:15px;background:var(--ui-soft);max-width:470px}
.app-page .accounts-connections-shell .connected-account-form input,
.app-page .accounts-connections-shell .telegram-login-form input {background:var(--ui-surface);border:1px solid var(--ui-line);min-height:48px;color:var(--ui-text)}
.app-page .accounts-connections-shell .connected-account-form label,
.app-page .accounts-connections-shell .telegram-login-form label {color:var(--ui-text);font-size:12px;font-weight:700}
.app-page .accounts-connections-shell .connected-account-form .muted,
.app-page .accounts-connections-shell .telegram-login-form .muted {font-size:11px;line-height:1.9}
.app-page .accounts-connections-shell .telegram-qr-panel {
  border-radius:17px;background:var(--ui-soft);border-color:var(--ui-line)
}
.app-page .accounts-connections-shell .telegram-qr-frame {
  background:#fff;border:9px solid #fff;border-radius:15px
}
.app-page .accounts-connections-shell .connected-destinations-heading,
.app-page .accounts-connections-shell .telegram-destinations-heading {
  padding-bottom:17px;border-bottom:1px solid var(--ui-line);margin-bottom:20px
}
.app-page .accounts-connections-shell .destination-filter {
  color:var(--ui-muted);border:1px solid var(--ui-line);
  border-radius:11px;min-height:40px;background:var(--ui-soft);
  padding:9px 14px;font-size:11px
}
.app-page .accounts-connections-shell .destination-filter:hover {
  border-color:var(--ui-brand);color:var(--ui-text)
}
.app-page .accounts-connections-shell .destination-filter.is-active {
  background:var(--ui-brand-soft);border-color:var(--ui-brand);color:var(--ui-brand)
}
.app-page .accounts-connections-shell .connected-destination-row,
.app-page .accounts-connections-shell .telegram-dialog-row {
  border-radius:14px;border:1px solid var(--ui-line);
  background:var(--ui-soft);padding:16px
}
.app-page .accounts-connections-shell .connected-destination-row:hover,
.app-page .accounts-connections-shell .telegram-dialog-row:hover {
  border-color:color-mix(in srgb,var(--ui-brand) 45%,var(--ui-line))
}
/* Bot-based channel management: statuses remain API-driven, never guessed. */
.app-page .channels-page-shell .channels-stats {
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px
}
.app-page .channels-page-shell .channel-stat-card {
  border:1px solid var(--ui-line);border-radius:17px;
  background:var(--ui-surface);padding:21px;min-height:105px;box-shadow:none
}
.app-page .channels-page-shell .channel-stat-card strong {font-size:29px;font-weight:850;color:var(--ui-text)}
.app-page .channels-page-shell .channel-stat-card span {font-size:11px;color:var(--ui-muted)}
.app-page .channels-page-shell .channel-stat-icon {
  width:43px;height:43px;border-radius:13px;background:var(--ui-brand-soft);color:var(--ui-brand)
}
.app-page .channels-page-shell .service-bots-panel,
.app-page .channels-page-shell .channels-list-panel {
  padding:clamp(20px,2.4vw,30px);border:1px solid var(--ui-line);
  border-radius:19px;background:var(--ui-surface)
}
.app-page .channels-page-shell .channels-list-heading {margin-bottom:20px;gap:14px;flex-wrap:wrap}
.app-page .channels-page-shell .channels-list-heading h2 {font-size:18px;color:var(--ui-text)}
.app-page .channels-page-shell .channels-list-hint {font-size:11px;font-weight:600;line-height:1.8;color:var(--ui-muted)}
.app-page .channels-page-shell .service-bots-help {font-size:12px;line-height:2.1;margin-bottom:21px;color:var(--ui-muted)}
.app-page .channels-page-shell .service-bot-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,245px),1fr));gap:12px}
.app-page .channels-page-shell .service-bot-card {
  border:1px solid var(--ui-line);border-radius:15px;
  background:var(--ui-soft);padding:19px;gap:14px
}
.app-page .channels-page-shell .service-bot-copy strong {font-size:13px;color:var(--ui-text)}
.app-page .channels-page-shell .service-bot-copy small {font-size:11px;color:var(--ui-muted)}
.app-page .channels-page-shell .service-bot-link {color:var(--ui-brand)}
.app-page .channels-page-shell .service-bot-card>.status-chip {font-size:11px}
.app-page .channels-page-shell .service-bot-actions .button {min-height:38px;font-size:11px;padding:7px 12px}
.app-page .channels-page-shell .channels-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.app-page .channels-page-shell .channel-card {
  border:1px solid var(--ui-line);border-radius:16px;
  background:var(--ui-soft);padding:19px;gap:16px;min-width:0
}
.app-page .channels-page-shell .channel-card:hover {border-color:var(--ui-brand);box-shadow:none}
.app-page .channels-page-shell .channel-card .integration-identity h3 {font-size:14px;color:var(--ui-text)}
.app-page .channels-page-shell .channel-card .integration-identity small {font-size:11px;color:var(--ui-muted)}
.app-page .channels-page-shell .channel-card .channel-platform-logo {width:44px;height:44px;border-radius:12px}
.app-page .channels-page-shell .channel-card-details {
  background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:12px
}
.app-page .channels-page-shell .channel-card-details>div {
  min-height:43px;border-color:var(--ui-line);padding:9px 12px
}
.app-page .channels-page-shell .channel-card-details span {font-size:11px;color:var(--ui-muted)}
.app-page .channels-page-shell .channel-card-details strong {font-size:11px;color:var(--ui-text)}
.app-page .channels-page-shell .channel-card-actions {flex-wrap:wrap;gap:9px}
.app-page .channels-page-shell .channel-card-actions .button {font-size:11px;min-height:37px;padding:7px 12px;border-radius:10px}
.app-page .channels-page-shell .channels-add-button {min-height:44px;padding-inline:18px}
.app-page .channels-page-shell .channels-dialog {
  border-radius:20px;border:1px solid var(--ui-line);
  padding:clamp(18px,2.2vw,29px);background:var(--ui-surface)
}
.app-page .channels-page-shell .channels-dialog h2 {color:var(--ui-text);font-size:20px}
.app-page .channels-page-shell .channels-dialog-lead {font-size:12px;line-height:2;color:var(--ui-muted)}
.app-page .channels-page-shell .channels-form {gap:15px}
.app-page .channels-page-shell .channels-form .field-block>span {font-size:12px;color:var(--ui-text)}
.app-page .channels-page-shell .channels-active-toggle {background:var(--ui-soft);border:1px solid var(--ui-line);border-radius:12px;padding:13px}
.app-page .channels-page-shell .selected-service-bot {
  border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-soft);padding:14px
}
.app-page .channels-page-shell .channel-verification-code {
  background:var(--ui-soft);border:1px dashed var(--ui-brand);
  border-radius:12px;padding:18px;color:var(--ui-text);font-size:20px
}
@media(max-width:1050px){
  .connection-hero {grid-template-columns:minmax(0,1fr) 210px}
  .connection-path-note {grid-template-columns:auto minmax(0,1fr)}
  .connection-path-note>a {grid-column:2;justify-self:start}
  .app-page .channels-page-shell .channels-grid {grid-template-columns:1fr}
}
@media(max-width:760px){
  .app-page main.dashboard-shell.channels-page-shell,
  .app-page main.dashboard-shell.accounts-connections-shell {gap:17px}
  .connection-hero {grid-template-columns:1fr;min-height:0;padding:27px 20px;border-radius:20px}
  .connection-hero-art {display:none}
  .connection-hero h1 {font-size:clamp(27px,7vw,34px)}
  .connection-hero p {font-size:12px}
  .connection-hero-actions {flex-direction:column;align-items:stretch}
  .connection-hero-actions>* {width:100%}
  .connection-flow {grid-template-columns:1fr;gap:9px}
  .connection-flow-step {padding:11px 14px;min-height:55px}
  .connection-path-note {grid-template-columns:1fr;gap:11px;padding:16px}
  .connection-path-icon {width:40px;height:40px}
  .connection-path-note>a {grid-column:auto;justify-self:stretch}
  .connection-platform-heading {align-items:start;flex-wrap:wrap}
  .connection-platform-heading h2 {font-size:18px}
  .app-page .accounts-connections-shell .connected-platform-tab {
    min-height:57px;flex:0 0 108px;padding:9px 10px;gap:7px;font-size:11px
  }
  .app-page .accounts-connections-shell .connected-platform-tab img {width:25px;height:25px}
  .app-page .accounts-connections-shell .connected-account-panel,
  .app-page .accounts-connections-shell .telegram-account-panel,
  .app-page .accounts-connections-shell .connected-destinations-panel,
  .app-page .accounts-connections-shell .telegram-destinations-panel {
    padding:19px;border-radius:16px
  }
  .app-page .accounts-connections-shell .connected-account-heading,
  .app-page .accounts-connections-shell .telegram-account-heading {align-items:start;gap:9px}
  .app-page .accounts-connections-shell .connected-account-identity .brand-icon,
  .app-page .accounts-connections-shell .telegram-account-identity .brand-icon {width:43px;height:43px;padding:7px}
  .app-page .accounts-connections-shell .connected-account-identity h2,
  .app-page .accounts-connections-shell .telegram-account-identity h2 {font-size:17px}
  .app-page .accounts-connections-shell .connected-account-actions .button,
  .app-page .accounts-connections-shell .telegram-actions .button {flex:1 1 165px}
  .app-page .channels-page-shell .channels-stats {grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .app-page .channels-page-shell .channel-stat-card {padding:13px;min-height:102px;display:grid;gap:8px}
  .app-page .channels-page-shell .channel-stat-icon {width:30px;height:30px}
  .app-page .channels-page-shell .channel-stat-card strong {font-size:23px}
  .app-page .channels-page-shell .channel-stat-card span {font-size:10px}
  .app-page .channels-page-shell .service-bots-panel,
  .app-page .channels-page-shell .channels-list-panel {padding:18px;border-radius:16px}
  .app-page .channels-page-shell .channels-list-hint {display:block}
  .app-page .channels-page-shell .service-bot-grid {grid-template-columns:1fr}
  .app-page .channels-page-shell .channels-dialog {max-height:92vh;overflow-y:auto}
}

/* Guided empty states keep the user moving without creating fake destinations. */
.app-page .channels-page-shell .channels-empty-state,
.app-page .accounts-connections-shell .connection-destinations-empty {
  grid-column:1/-1;display:grid;justify-items:center;align-content:center;
  gap:10px;min-height:225px;padding:28px 19px;text-align:center;
  background:var(--ui-soft);border:1px dashed var(--ui-line);border-radius:16px
}
.app-page .channels-page-shell .channels-empty-state h3,
.app-page .accounts-connections-shell .connection-destinations-empty strong {
  font-size:15px;color:var(--ui-text);margin:0
}
.app-page .channels-page-shell .channels-empty-state p,
.app-page .accounts-connections-shell .connection-destinations-empty p {
  color:var(--ui-muted);font-size:12px;line-height:2;max-width:410px;margin:0
}
.app-page .channels-page-shell .channels-empty-state .button {margin-top:9px;min-height:43px}
.channels-empty-symbol,.connection-empty-symbol {
  width:57px;height:57px;display:grid;place-items:center;border-radius:17px;
  color:var(--ui-brand);background:var(--ui-brand-soft);
  border:1px solid color-mix(in srgb,var(--ui-brand) 31%,var(--ui-line));
  font-size:29px
}
