/* Digital Hub V149 · app-card standard, KPI grid, one sidebar (expanded = collapsed rhythm),
   bottom-pinned account button with menu (same pattern as HiwiLog and EventScope). */

/* ── App cards: logo · name · role · description · divider · one Open button ── */
#appCardsV147.h147-apps{grid-template-columns:repeat(auto-fill,minmax(320px,1fr))!important;align-items:stretch!important}
.h149-card{display:flex!important;flex-direction:column;gap:0!important;padding:22px 22px 20px!important;min-height:252px}
.h149-head{display:grid;grid-template-columns:52px minmax(0,1fr);gap:14px;align-items:center}
.h149-title{min-width:0}
.h149-title h2{margin:0;font-size:20px;font-weight:760;line-height:1.2;color:var(--h7-ink);letter-spacing:-.005em}
.h149-role{display:block;margin-top:3px;font-size:13px;font-weight:650;color:var(--h7-blue);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.h149-desc{margin:16px 0 0;font-size:14.5px;line-height:1.5;color:var(--h7-muted);
  /* the description area is the same height on every card, so the divider and button line up */
  min-height:calc(1.5em * 3);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.h149-foot{margin-top:auto;padding-top:16px;border-top:1px solid var(--h7-line-soft,var(--h7-line));display:flex;justify-content:flex-start;align-items:center;min-height:62px;box-sizing:border-box}
.h149-card .h149-desc+.h149-foot{margin-top:auto}
.h149-card>.h149-desc{margin-bottom:18px}
.h149-open{min-width:190px;justify-content:center}
.h149-card .h147-wait{font-size:14px;font-weight:650;color:var(--h7-amber);background:var(--h7-amber-tint);padding:9px 14px;border-radius:10px}
@media (max-width:640px){
  .h149-card{min-height:0;padding:18px!important}
  .h149-head{grid-template-columns:44px minmax(0,1fr)}
  .h149-desc{min-height:0;-webkit-line-clamp:4}
  .h149-open{width:100%}
}

/* ── Hub at a glance: four tiles → 4 / 2×2, never a lone tile ── */
.h147-tiles.h149-tiles{grid-template-columns:repeat(4,minmax(0,1fr))!important}
@media (max-width:1100px){.h147-tiles.h149-tiles{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
.h149-sec-links{display:inline-flex;gap:18px;align-items:center;flex-wrap:wrap}
.h149-sec-links a:first-child{color:var(--h7-muted);font-weight:650}
@media (max-width:520px){.h149-sec-links a:first-child{display:none}}

/* ── Phones: content clears the bottom navigation ── */
@media (max-width:820px){
  body.hub-manager-mode #appView .main-panel,body.hub-manager-mode #appView main{padding-bottom:calc(96px + env(safe-area-inset-bottom))!important}
}

/* ── Sidebar ≥901px: one layout for desktop and small laptops, collapsible everywhere ── */
@media (min-width:901px){
  :is(html,#q149#q149) body #appView.hub-manager-shell{grid-template-columns:248px minmax(0,1fr)!important}
  :is(html,#q149#q149) body #appView.hub-manager-shell.sidebar-collapsed{grid-template-columns:76px minmax(0,1fr)!important}
  :is(html,#q149#q149) body #appView.hub-manager-shell #hubSidebar{position:sticky!important;top:0!important;height:100vh!important;height:100dvh!important;
    width:auto!important;transform:none!important;left:auto!important;display:flex!important;flex-direction:column!important;padding:12px 12px 14px!important;box-sizing:border-box!important;overflow:visible!important}
  /* fixed-height brand block in both states, so the toggle and the nav never move vertically */
  :is(html,#q149#q149) body #appView #hubSidebar .hub-sidebar-top{position:static!important;height:96px!important;min-height:96px!important;flex:0 0 96px!important;padding:0!important;margin:0 0 10px!important;overflow:visible!important}
  :is(html,#q149#q149) body #appView #hubSidebar #hubSidebarToggle{display:grid!important;position:absolute!important;top:80px!important;right:-16px!important;left:auto!important;bottom:auto!important;transform:none!important;width:32px!important;height:32px!important;z-index:5!important}
  :is(html,#q149#q149) body #appView #hubSidebar .sidebar-nav{margin:0!important;padding:0!important;flex:0 0 auto!important;display:grid!important;grid-template-rows:none!important;grid-auto-rows:min-content!important;gap:4px!important;height:auto!important;overflow:visible!important}
  :is(html,#q149#q149) body #appView #hubSidebar .sidebar-nav>.nav-link{min-height:44px!important;height:44px!important;max-height:44px!important;padding:0 12px!important;gap:12px!important;align-items:center!important;justify-content:flex-start!important;border-radius:12px!important;box-sizing:border-box!important}
  :is(html,#q149#q149) body #appView #hubSidebar .sidebar-nav>.hub-management-label{display:block!important;height:28px!important;margin:6px 0 0!important;padding:10px 12px 0!important;box-sizing:border-box!important;line-height:18px!important;font-size:11px!important;overflow:hidden!important;white-space:nowrap!important}
  :is(html,#q149#q149) body #appView #hubSidebar .sidebar-spacer{display:block!important;flex:1 1 auto!important;min-height:12px!important}
  :is(html,#q149#q149) body #appView #hubSidebar .sidebar-footer{flex:0 0 auto!important;display:block!important;padding:10px 0 0!important;margin:0!important;border-top:1px solid var(--h7-line-soft,var(--h7-line))!important;position:relative!important}
  :is(html,#q149#q149) body #appView #hubSidebar .sidebar-footer>.profile-card,:is(html,#q149#q149) body #appView #hubSidebar .sidebar-footer>#logoutButton{display:none!important}
  /* the sidebar carries the account control for Hub Managers on laptops */
  :is(html,#q149#q149) body #appView.hub-manager-shell .topbar .h149-top{display:none!important}

  /* collapsed: same rhythm, icon-only */
  :is(html,#q149#q149) body #appView #hubSidebar.is-collapsed .brand-logo-full,:is(html,#q149#q149) body #appView #hubSidebar.is-collapsed .brand-copy{display:none!important}
  :is(html,#q149#q149) body #appView #hubSidebar.is-collapsed .brand-logo-mini{display:block!important;width:40px!important;height:40px!important;margin:6px auto 0!important}
  :is(html,#q149#q149) body #appView #hubSidebar.is-collapsed .sidebar-nav>.nav-link{width:52px!important;padding:0!important;justify-content:center!important;margin:0 auto!important}
  :is(html,#q149#q149) body #appView #hubSidebar.is-collapsed .sidebar-nav>.nav-link>span:not(.nav-icon):not(.nav-count){display:none!important}
  :is(html,#q149#q149) body #appView #hubSidebar.is-collapsed .sidebar-nav>.nav-link .nav-count{position:absolute!important;top:4px!important;right:4px!important;min-width:16px!important;height:16px!important;font-size:10px!important;padding:0 4px!important}
  :is(html,#q149#q149) body #appView #hubSidebar.is-collapsed .sidebar-nav>.hub-management-label{color:transparent!important;position:relative!important}
  :is(html,#q149#q149) body #appView #hubSidebar.is-collapsed .sidebar-nav>.hub-management-label::after{content:"";position:absolute;left:14px;right:14px;top:16px;height:1px;background:var(--h7-line)}
}

/* ── Account button + menu (all sidebar widths, including the tablet overlay) ── */
.h149-acct{appearance:none;width:100%;display:grid;grid-template-columns:36px minmax(0,1fr) 18px;gap:10px;align-items:center;padding:8px 10px;border-radius:14px;
  border:1px solid var(--h7-line);background:var(--h7-panel);color:var(--h7-ink);font:inherit;text-align:left;cursor:pointer;box-sizing:border-box;transition:border-color .12s,background .12s}
.h149-acct:hover{border-color:var(--h7-blue)}
.h149-acct[aria-expanded="true"]{border-color:var(--h7-blue);background:var(--h7-soft)}
.h149-acct:focus-visible{outline:2px solid var(--h7-blue);outline-offset:2px}
.h149-av{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;font-size:12.5px;font-weight:760;color:var(--h7-blue);background:var(--h7-soft-2,var(--h7-soft));border:1px solid var(--h7-line)}
.h149-who{min-width:0;display:grid;gap:1px}
.h149-who strong{font-size:13.5px;font-weight:720;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.h149-who small{font-size:12px;color:var(--h7-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.h149-chev{width:18px;height:18px;color:var(--h7-muted);transition:transform .15s}
.h149-acct[aria-expanded="true"] .h149-chev{transform:rotate(180deg)}
.h149-menu{position:absolute;left:0;bottom:calc(100% + 8px);width:min(300px,calc(100vw - 24px));z-index:60;padding:10px;border-radius:16px;border:1px solid var(--h7-line);
  background:var(--h7-panel);box-shadow:0 18px 40px rgba(15,35,60,.18);display:grid;gap:8px}
.h149-menu[hidden]{display:none}
.h149-menu-id{display:grid;grid-template-columns:40px minmax(0,1fr);gap:10px;align-items:center;padding:6px 6px 10px;border-bottom:1px solid var(--h7-line-soft,var(--h7-line))}
.h149-menu-id .h149-av{width:40px;height:40px}
.h149-menu-id strong{display:block;font-size:14.5px;color:var(--h7-ink)}
.h149-menu-id>div>span{display:block;font-size:12.5px;color:var(--h7-muted);overflow:hidden;text-overflow:ellipsis}
.h149-menu-item{appearance:none;display:grid;grid-template-columns:34px minmax(0,1fr) 16px;gap:10px;align-items:center;width:100%;padding:9px 10px;border-radius:12px;border:1px solid var(--h7-line);
  background:var(--h7-panel);color:var(--h7-ink);font:inherit;text-align:left;cursor:pointer;text-decoration:none;box-sizing:border-box}
.h149-menu-item:hover{border-color:var(--h7-blue)}
.h149-menu-item:focus-visible{outline:2px solid var(--h7-blue);outline-offset:2px}
.h149-menu-item .ic{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:var(--h7-soft);color:var(--h7-blue)}
.h149-menu-item .ic svg{width:18px;height:18px}
.h149-menu-item b{display:block;font-size:13.5px;font-weight:700}
.h149-menu-item small{display:block;font-size:12px;color:var(--h7-muted)}
.h149-menu-item.danger .ic{background:var(--h7-red-tint);color:var(--h7-red)}
.h149-menu-item.danger:hover{border-color:var(--h7-red)}
@media (min-width:901px){
  :is(html,#q149#q149) body #appView #hubSidebar.is-collapsed .h149-acct{grid-template-columns:36px;justify-content:center;width:52px;margin:0 auto;padding:7px}
  :is(html,#q149#q149) body #appView #hubSidebar.is-collapsed .h149-acct .h149-who,:is(html,#q149#q149) body #appView #hubSidebar.is-collapsed .h149-acct .h149-chev{display:none}
}
html[data-theme="dark"] .h149-menu{box-shadow:0 18px 40px rgba(0,0,0,.5)}

/* ── Top-bar account control (members; everyone on tablets and phones) ── */
:is(html,#q149#q149) body #appView .topbar .hub-account-exit-control{display:none!important}
.h149-account{position:relative}
.h149-top .h149-acct{height:44px;width:auto;min-width:0;max-width:260px;grid-template-columns:32px minmax(0,auto) 16px;padding:5px 10px 5px 5px;border-radius:999px}
.h149-top .h149-av{width:32px;height:32px;font-size:12px}
.h149-top .h149-who{gap:0;line-height:1.2}.h149-top .h149-who strong{font-size:13px;line-height:1.2}.h149-top .h149-who small{font-size:11.5px;line-height:1.2}
.h149-top .h149-chev{transform:rotate(180deg);width:16px;height:16px}
.h149-top .h149-acct[aria-expanded="true"] .h149-chev{transform:none}
.h149-top .h149-menu{left:auto;right:0;bottom:auto;top:calc(100% + 8px)}
@media (max-width:640px){
  .h149-top .h149-acct{grid-template-columns:32px;padding:4px;border-radius:50%}
  .h149-top .h149-who,.h149-top .h149-chev{display:none}
}
.h149-card::before{display:none!important}

/* ── Apps: guided Add app / Add role / Edit details ── */
.a149-tile{display:grid;place-items:center;border-radius:12px;font-weight:780;letter-spacing:.02em;color:#fff;
  background:linear-gradient(135deg,hsl(var(--a149-h) 58% 42%),hsl(calc(var(--a149-h) + 28) 62% 52%))}
.a149-backdrop .a149-modal{width:min(980px,calc(100vw - 32px))!important;max-height:calc(100dvh - 32px)!important;display:flex!important;flex-direction:column!important;overflow:hidden!important}
.a149-body{overflow:auto;padding:4px 2px 8px;flex:1 1 auto}
.a149-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(260px,.9fr);gap:22px;align-items:start}
.a149-form{display:grid;gap:16px}
.a149-form fieldset{margin:0;padding:14px 16px 16px;border:1px solid var(--h7-line);border-radius:14px;display:grid;gap:12px;background:var(--h7-panel)}
.a149-form legend{display:flex;align-items:center;gap:8px;padding:0 6px;font-weight:720;font-size:14.5px;color:var(--h7-ink)}
.a149-form legend b{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:12px;background:var(--h7-blue);color:#fff}
.a149-field{display:grid;gap:5px}
.a149-field label{font-size:13.5px;font-weight:680;color:var(--h7-ink)}
.a149-field input,.a149-field textarea{width:100%;box-sizing:border-box;font:inherit;font-size:14.5px;padding:10px 12px;border-radius:10px;border:1px solid var(--h7-line);background:var(--h7-panel);color:var(--h7-ink);resize:vertical}
.a149-field input:focus-visible,.a149-field textarea:focus-visible{outline:2px solid var(--h7-blue);outline-offset:1px;border-color:var(--h7-blue)}
.a149-field [aria-invalid="true"]{border-color:var(--h7-red)}
.a149-hint{font-size:12.5px;color:var(--h7-muted);line-height:1.4}
.a149-err{font-size:12.5px;font-weight:650;color:var(--h7-red)}
.a149-keyrow{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--h7-muted)}
.a149-keyrow code,.a149-note code{font-size:12.5px;padding:2px 8px;border-radius:7px;background:var(--h7-soft);color:var(--h7-ink)}
.a149-link{appearance:none;border:0;background:none;padding:0;font:inherit;font-weight:680;color:var(--h7-blue);cursor:pointer;text-decoration:underline;text-underline-offset:2px}
.a149-note{margin:0;font-size:13px;line-height:1.5;color:var(--h7-muted)}
.a149-preview{position:sticky;top:0;display:grid;gap:8px}
.a149-prev-label{font-size:12px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--h7-muted)}
.a149-prev{min-height:0!important;pointer-events:none}
.a149-done{display:grid;grid-template-columns:48px minmax(0,1fr);gap:16px;padding:8px 4px}
.a149-done-ic{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;font-size:22px;font-weight:800;color:var(--h7-green);background:var(--h7-green-tint)}
.a149-done h3{margin:2px 0 6px;font-size:19px;color:var(--h7-ink)}
.a149-done p{margin:0 0 12px;color:var(--h7-muted);line-height:1.5}
.a149-done ol{margin:0;padding:0;list-style:none;display:grid;gap:8px}
.a149-done li{display:flex;gap:10px;align-items:center;font-size:14px;color:var(--h7-ink)}
.a149-done li b{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;font-size:12px;background:var(--h7-soft);color:var(--h7-blue)}
.a149-done li:first-child b{background:var(--h7-green-tint);color:var(--h7-green)}
.a149-form-single{max-width:620px}
.a149-nourl{margin:8px 0 0!important;padding:8px 12px;border-radius:10px;font-size:13px;background:var(--h7-amber-tint);color:var(--h7-ink)}
@media (max-width:760px){.a149-grid{grid-template-columns:minmax(0,1fr)}.a149-preview{position:static;order:-1}}
.h147-app-icon:has(.a149-tile){background:none!important;border:0!important}
.h147-app-icon .a149-tile{width:48px!important;height:48px!important;font-size:18px!important}

/* ── EventScope AI connection: recommended models ── */
.ai149-box{margin:14px 0 0;padding:14px 16px;border:1px solid var(--h7-line);border-radius:14px;background:var(--h7-soft)}
.ai149-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;flex-wrap:wrap}
.ai149-head strong{display:block;font-size:15px;color:var(--h7-ink)}
.ai149-head span{display:block;font-size:13px;color:var(--h7-muted);max-width:60ch}
.ai149-box ul{list-style:none;margin:12px 0 0;padding:0;display:grid;gap:8px}
.ai149-box li{display:grid;grid-template-columns:110px minmax(0,auto) minmax(0,1fr);gap:4px 12px;align-items:baseline;font-size:13px;color:var(--h7-ink-2)}
.ai149-box li b{color:var(--h7-ink)}
.ai149-box code{font-size:12.5px;padding:2px 8px;border-radius:7px;background:var(--h7-panel);border:1px solid var(--h7-line);color:var(--h7-ink);white-space:nowrap}
.ai149-box li small{color:var(--h7-muted)}
.ai149-foot{margin:12px 0 0;font-size:12.5px;color:var(--h7-muted)}
.ai149-warn{display:block;margin-top:4px;font-size:12.5px;font-weight:650;color:var(--h7-amber)}
@media (max-width:760px){.ai149-box li{grid-template-columns:minmax(0,1fr)}}
