*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font-family:var(--hub-font);font-size:var(--hub-font-size);color:var(--hub-text);background:var(--hub-bg)}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.48}
a{color:var(--hub-primary);text-decoration:none}
#hub-app{height:100vh;display:flex;flex-direction:column}

/* Shell */
.hub-shell{display:flex;flex:1;min-height:0;position:relative}
.hub-sidebar{width:var(--hub-sidebar-width,280px);background:var(--hub-sidebar-bg);color:var(--hub-sidebar-text);border-right:1px solid var(--hub-sidebar-border);flex-shrink:0;overflow:auto;padding:10px 8px 14px;transition:width .12s}
.hub-shell.is-collapsed .hub-sidebar{width:54px;padding:10px 6px}
.hub-brand{font-weight:700;font-size:14px;padding:10px 8px 14px;display:flex;align-items:center;justify-content:space-between;gap:6px}
.hub-mark{height:34px;width:34px;display:none;place-items:center;border-radius:10px;background:var(--hub-primary);color:#fff;font-weight:800}
.hub-nav-item{display:flex;gap:9px;align-items:center;width:100%;border:0;background:transparent;color:inherit;text-align:left;padding:8px 10px;border-radius:var(--hub-radius);position:relative;min-height:32px}
.hub-nav-item:hover,.hub-nav-row:hover>.hub-nav-item{background:var(--hub-sidebar-hover)}
.hub-nav-item.is-active{background:var(--hub-primary);color:#fff}
.hub-nav-item .hub-count{margin-left:auto;font-size:11px;opacity:.65}
.hub-nav-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}
.hub-nav-icon{width:18px;text-align:center;flex-shrink:0}
.hub-nav-section{text-transform:uppercase;letter-spacing:1.1px;font-size:10px;font-weight:800;margin:18px 9px 8px;opacity:.58}
.hub-nav-row{display:flex;align-items:center;position:relative;border-radius:var(--hub-radius)}
.hub-nav-row .hub-nav-more{opacity:0;border:0;background:transparent;color:inherit;width:24px;height:24px;border-radius:6px;margin-right:2px;flex-shrink:0}
.hub-nav-row:hover .hub-nav-more,.hub-nav-more:focus{opacity:1}
.hub-nav-more:hover{background:var(--hub-sidebar-hover)}
.hub-nav-chev{border:0;background:none;color:inherit;width:18px;height:22px;padding:0;opacity:.7;flex-shrink:0}
.hub-nav-lvl1{padding-left:20px}.hub-nav-lvl2{padding-left:40px}
.hub-nav-chev-spacer{width:18px;height:22px;flex-shrink:0}
.hub-shell.is-collapsed .hub-nav-chev-spacer{display:none}
.hub-nav-badge{background:var(--hub-primary);color:#fff;border-radius:9px;font-size:10px;padding:1px 6px;margin-left:auto}
.hub-shell.is-collapsed .hub-nav-label,.hub-shell.is-collapsed .hub-nav-section,.hub-shell.is-collapsed .hub-nav-more,.hub-shell.is-collapsed .hub-count,.hub-shell.is-collapsed .hub-nav-chev,.hub-shell.is-collapsed .hub-brand-name,.hub-shell.is-collapsed .hub-nav-badge,.hub-shell.is-collapsed .hub-nav-lvl1 .hub-nav-label{display:none}
.hub-shell.is-collapsed .hub-mark{display:grid}
.hub-shell.is-collapsed .hub-brand{flex-direction:column}
.hub-shell.is-collapsed .hub-nav-lvl1,.hub-shell.is-collapsed .hub-nav-lvl2{padding-left:0}
.hub-shell.is-collapsed .hub-nav-item{justify-content:center;padding:8px 0}
.hub-workspace{flex:1;min-width:0;display:flex;flex-direction:column}
.hub-top{height:54px;background:var(--hub-surface);border-bottom:1px solid var(--hub-border);display:grid;grid-template-columns:minmax(0,1fr) minmax(140px,min(520px,32vw)) auto;align-items:center;gap:14px;padding:0 20px;flex-shrink:0}
.hub-top-left{display:flex;align-items:center;gap:10px;min-width:0}
.hub-top-right{display:flex;align-items:center;gap:9px;justify-content:flex-end}
.hub-crumbs{color:var(--hub-text-muted);white-space:nowrap}
.hub-crumbs b{color:var(--hub-text);font-weight:600}
.hub-search{border:1px solid var(--hub-border);background:var(--hub-head);border-radius:8px;padding:8px 13px;color:var(--hub-text-muted);text-align:left;width:100%}
.hub-iconbtn{border:1px solid var(--hub-border);background:var(--hub-surface);border-radius:8px;height:32px;min-width:32px;padding:0 8px;display:inline-flex;align-items:center;gap:6px}
.hub-iconbtn:hover{background:var(--hub-hover)}
.hub-burger{display:none}
.hub-main{overflow:auto;flex:1;padding:24px 28px 55px}
.hub-backdrop-nav{display:none}

/* Page primitives */
.hub-page{max-width:1440px;margin:0 auto}
.hub-page-header{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:19px}
.hub-page-header .hub-actions{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap}
.hub-eyebrow{font-size:11px;color:var(--hub-text-muted);font-weight:700;letter-spacing:.6px;text-transform:uppercase}
.hub-title{font-size:23px;letter-spacing:-.65px;margin:3px 0 0;font-weight:740}
.hub-muted{color:var(--hub-text-muted)}
.hub-card{background:var(--hub-surface);border:1px solid var(--hub-border);border-radius:var(--hub-radius);padding:17px}
.hub-card h3{margin:0 0 13px;font-size:14px}
.hub-btn{border:1px solid var(--hub-border);background:var(--hub-surface);color:var(--hub-text);padding:8px 13px;border-radius:var(--hub-radius);display:inline-flex;align-items:center;gap:6px}
.hub-btn:hover{filter:brightness(.96)}
.hub-btn-primary{background:var(--hub-primary);border-color:var(--hub-primary);color:var(--hub-primary-text)}
.hub-btn-ghost{background:transparent;border-color:transparent;color:var(--hub-primary)}
.hub-btn-danger{background:transparent;border-color:var(--hub-danger);color:var(--hub-danger)}
.hub-btn-sm{padding:4px 9px;font-size:12px}
.hub-input,.hub-select,.hub-field textarea{border:1px solid var(--hub-border);padding:9px 10px;border-radius:6px;background:var(--hub-surface);color:var(--hub-text);width:100%}
.hub-input:focus,.hub-select:focus,.hub-field textarea:focus,.hub-btn:focus-visible{outline:2px solid var(--hub-primary);outline-offset:1px}
.hub-field{display:flex;flex-direction:column;gap:6px;margin-bottom:13px}
.hub-label{font-size:11px;color:var(--hub-text-muted);font-weight:650}
.hub-form-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
.hub-form-row>.hub-field{flex:1;min-width:140px;margin-bottom:0}
.hub-error{color:var(--hub-danger);font-size:12px;margin:4px 0}
.hub-tabs{display:flex;gap:4px;border-bottom:1px solid var(--hub-border);margin:18px 0 12px;overflow-x:auto}
.hub-tab{border:0;background:transparent;color:var(--hub-text-muted);padding:11px 15px;white-space:nowrap;border-bottom:2px solid transparent}
.hub-tab.is-active{border-color:var(--hub-primary);color:var(--hub-primary);font-weight:750}
.hub-pill{font-size:10px;padding:4px 8px;border-radius:5px;white-space:nowrap;font-weight:650;display:inline-block;background:var(--hub-status-todo-bg);color:var(--hub-status-todo-fg)}
.hub-chip{font-size:11px;padding:4px 8px;border-radius:5px;background:var(--hub-head);border:1px solid var(--hub-border);display:inline-block}
.hub-badge{background:var(--hub-primary);color:#fff;border-radius:9px;font-size:10px;padding:1px 6px;font-weight:700}
.hub-avatar{width:26px;height:26px;display:inline-grid;place-items:center;border-radius:50%;background:#e0dafc;color:#5d48a6;font-size:10px;font-weight:800;flex-shrink:0;border:0}
.hub-empty{padding:28px;text-align:center;color:var(--hub-text-muted)}
.hub-table-simple{border-collapse:collapse;width:100%;text-align:left;font-size:12px}
.hub-table-simple th{font-size:10px;color:var(--hub-text-muted);text-transform:uppercase;letter-spacing:.5px;white-space:nowrap;padding:10px 12px;background:var(--hub-head);border-bottom:1px solid var(--hub-border)}
.hub-table-simple td{border-bottom:1px solid var(--hub-border);padding:10px 12px}
.hub-table-simple tbody tr:hover{background:var(--hub-hover)}
.hub-table-simple tr.is-click{cursor:pointer}
.hub-scroll-x{overflow-x:auto;border:1px solid var(--hub-border);border-radius:var(--hub-radius);background:var(--hub-surface)}
/* Bank import review: a wide modal whose table scrolls under sticky headings. */
.hub-dialog-backdrop:has(.hub-dialog-review),.hub-dialog-backdrop:has(.hub-bank-log-dialog){align-items:center;padding:12px;overflow:hidden}
.hub-dialog.hub-dialog-review,.hub-dialog.hub-bank-log-dialog{width:min(1120px,calc(100vw - 24px));height:min(90dvh,900px);max-height:calc(100dvh - 24px);padding:0;display:flex;flex-direction:column;overflow:hidden;min-height:0}
.hub-dialog-review>.hub-dialog-titlebar,.hub-bank-log-dialog>.hub-dialog-titlebar{flex:none;margin:0;padding:16px 24px;background:#f2f4fe;border-bottom:1px solid var(--hub-border);color:#2b2f6b}
.hub-review{display:flex;flex-direction:column;flex:1;min-height:0}
.hub-review-content{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:18px 24px}
.hub-review-footer{flex:none;position:relative;background:#fff;margin:0;padding:12px 24px;border-top:1px solid var(--hub-border);box-shadow:0 -3px 10px rgba(20,32,65,.05)}
.hub-review-content h3{color:#25345d;margin:12px 0}
.hub-review-content .hub-table-simple th{color:#293550;background:#eef1fa}
.hub-review-content .hub-table-simple td{padding:10px 12px}
.hub-review-content .hub-table-simple tbody tr:nth-child(even){background:#f7f9fd}
.hub-review-scroll{max-height:none;overflow:auto;max-width:100%}
.hub-bank-activity{overflow-y:auto;min-height:0;flex:1;padding:12px 20px}
.hub-bank-log-dialog .hub-bank-activity{display:flex;flex-direction:column;overflow:hidden;gap:10px}
.hub-bank-log-dialog .hub-bank-activity>.hub-form-row,.hub-bank-log-dialog .hub-bank-activity>.hub-tabs,.hub-bank-log-dialog .hub-bank-activity>.hub-bank-log-footer{flex:none}
.hub-bank-log-dialog .hub-bank-log-footer{background:var(--hub-surface);border-top:1px solid var(--hub-border)}
.hub-bank-log-dialog .hub-bank-log-table-wrap{overflow:auto;flex:1;min-height:0}
.hub-bank-log-dialog .hub-bank-log-table th{position:sticky;top:0;z-index:1;background:#eef1fa;color:#25345d}
.hub-bank-log-dialog .hub-bank-log-table td,.hub-bank-log-dialog .hub-bank-log-table th{padding:10px 12px}
.hub-bank-log-dialog .hub-bank-log-footer{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px 0}
.hub-bank-log-status{display:flex;align-items:center;gap:6px;min-height:16px}
.hub-spinner{display:inline-block;width:12px;height:12px;border:2px solid var(--hub-border);border-top-color:var(--hub-primary);border-radius:50%;animation:hub-spin 0.8s linear infinite}
.hub-spinner[hidden]{display:none}
@keyframes hub-spin{to{transform:rotate(360deg)}}
@media(max-width:640px){.hub-review-content{padding:12px}.hub-review-footer{padding:10px 12px;flex-wrap:wrap}.hub-dialog-review>.hub-dialog-titlebar,.hub-bank-log-dialog>.hub-dialog-titlebar{padding:12px}}

.hub-review-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin:0 0 14px}
.hub-review-summary div{border:1px solid var(--hub-border);border-radius:var(--hub-radius);padding:10px 12px;background:var(--hub-surface)}
.hub-review-summary span{display:block;color:var(--hub-text-muted);font-size:10px;text-transform:uppercase;letter-spacing:.5px}
.hub-review-summary strong{display:block;margin-top:5px;font-size:15px;font-variant-numeric:tabular-nums}
.hub-review-scroll{max-height:36vh;overflow:auto;border:1px solid var(--hub-border);border-radius:var(--hub-radius);background:var(--hub-surface)}
.hub-review-scroll .hub-table-simple thead th{position:sticky;top:0;z-index:2}
.hub-review-money{text-align:right;font-variant-numeric:tabular-nums}
.hub-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:20px}
.hub-stat{border:1px solid var(--hub-border);background:var(--hub-surface);padding:17px;border-radius:var(--hub-radius)}
.hub-stat span{color:var(--hub-text-muted);font-size:11px}
.hub-stat strong{display:block;font-size:25px;margin-top:11px}
.hub-split{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px}
.hub-feed{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--hub-border)}
.hub-feed:last-child{border:0}
.hub-link{border:0;background:none;padding:0;color:var(--hub-primary);font-weight:650;text-align:left}
.hub-link:hover{text-decoration:underline}
.hub-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px}

/* Popover / menu / dialog / toast */
.hub-popover{position:absolute;z-index:1000;background:var(--hub-surface);color:var(--hub-text);border:1px solid var(--hub-border);border-radius:8px;box-shadow:var(--hub-shadow);padding:6px;min-width:180px;max-width:calc(100vw - 16px)}
.hub-menu{display:flex;flex-direction:column}
.hub-menu-item{border:0;background:transparent;text-align:left;padding:7px 10px;border-radius:6px;display:flex;gap:8px;align-items:center;width:100%}
.hub-menu-item:hover{background:var(--hub-hover)}
.hub-menu-item.is-disabled{opacity:.45;cursor:not-allowed}
.hub-menu-item.is-disabled:hover{background:transparent}
.hub-menu-item.is-danger{color:var(--hub-danger)}
.hub-menu-sep{height:1px;background:var(--hub-border);margin:4px 0}
.hub-menu-label{font-size:10px;text-transform:uppercase;letter-spacing:.8px;color:var(--hub-text-muted);padding:6px 10px 2px;font-weight:700}
.hub-dialog-backdrop{position:fixed;inset:0;background:rgba(15,22,40,.5);z-index:900;display:flex;align-items:flex-start;justify-content:center;padding:8vh 12px 12px;overflow:auto}
.hub-dialog{background:var(--hub-surface);color:var(--hub-text);border-radius:12px;box-shadow:var(--hub-shadow);width:min(480px,100%);padding:20px}
.hub-dialog h2{margin:0 0 14px;font-size:16px}
.hub-dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
.hub-toasts{position:fixed;left:16px;bottom:16px;z-index:1200;display:flex;flex-direction:column;gap:8px}
.hub-toast{background:#202b3d;color:#fff;padding:10px 14px;border-radius:8px;box-shadow:var(--hub-shadow);max-width:340px}
.hub-toast-error{background:var(--hub-danger)}
.hub-palette{width:min(620px,100%);padding:0;overflow:hidden}
.hub-palette input{border:0;border-bottom:1px solid var(--hub-border);padding:14px 16px;width:100%;background:transparent;font-size:15px;outline:none}
.hub-palette-list{max-height:380px;overflow:auto;padding:6px}
.hub-palette-item{display:flex;gap:10px;align-items:center;padding:8px 10px;border-radius:6px;cursor:pointer}
.hub-palette-item.is-sel{background:var(--hub-primary-soft)}
.hub-palette-group{font-size:10px;text-transform:uppercase;letter-spacing:.8px;color:var(--hub-text-muted);padding:8px 10px 2px;font-weight:700}

/* Login */
.hub-login{min-height:100vh;display:grid;place-items:center;background:var(--hub-bg);padding:16px}
.hub-login .hub-card{width:min(380px,100%);padding:28px}

/* Inbox */
.hub-inbox{display:grid;grid-template-columns:minmax(260px,380px) minmax(0,1fr);gap:0;border:1px solid var(--hub-border);border-radius:var(--hub-radius);background:var(--hub-surface);min-height:420px;overflow:hidden}
.hub-inbox-list{border-right:1px solid var(--hub-border);overflow:auto;max-height:70vh}
.hub-inbox-row{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid var(--hub-border);background:transparent;padding:12px 14px}
.hub-inbox-row:hover{background:var(--hub-hover)}
.hub-inbox-row.is-active{background:var(--hub-primary-soft)}
.hub-inbox-row.is-unread .hub-inbox-msg{font-weight:700}
.hub-inbox-msg{display:block;font-size:13px;margin-bottom:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hub-inbox-meta{font-size:11px;color:var(--hub-text-muted)}
.hub-inbox-detail{padding:24px}
.hub-inbox-body{font-size:18px;line-height:1.45;font-weight:600;margin:0 0 14px}

/* Responsive */
@media (max-width:760px){
  .hub-sidebar{position:fixed;z-index:800;top:0;bottom:0;left:0;width:260px;transform:translateX(-100%);transition:transform .15s}
  .hub-shell.is-collapsed .hub-sidebar{width:260px}
  .hub-shell.nav-open .hub-sidebar{transform:none}
  .hub-shell.is-collapsed .hub-nav-label,.hub-shell.is-collapsed .hub-nav-section,.hub-shell.is-collapsed .hub-count,.hub-shell.is-collapsed .hub-brand-name{display:initial}
  .hub-shell.is-collapsed .hub-mark{display:none}
  .hub-shell.is-collapsed .hub-nav-item{justify-content:flex-start;padding:8px 10px}
  .hub-shell.nav-open .hub-backdrop-nav{display:block;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:700}
  .hub-burger{display:inline-flex}
  .hub-top{grid-template-columns:minmax(0,1fr) auto auto;padding:0 10px;gap:6px}
  .hub-search{width:36px;height:32px;padding:0;font-size:0;text-align:center;flex-shrink:0}
  .hub-search::before{content:"\1F50D";font-size:15px;line-height:30px}
  #hub-avatar-btn .hub-muted{display:none}
  .hub-crumbs .hub-crumb-part,.hub-crumbs .hub-crumb-sep{display:none}
  .hub-main{padding:16px 12px 40px}
  .hub-stats{grid-template-columns:1fr}
  .hub-split,.hub-inbox{grid-template-columns:1fr}
  .hub-inbox-list{border-right:0;border-bottom:1px solid var(--hub-border);max-height:260px}
  .hub-search span.hub-kbd{display:none}
}
.hub-sidebar .hub-iconbtn{background:transparent;border-color:transparent;color:inherit}
.hub-sidebar .hub-iconbtn:hover{background:var(--hub-sidebar-hover)}
#hub-app>*{min-width:0;max-width:100%}

[hidden]{display:none!important}
.hub-opt-row{display:flex;gap:6px;align-items:center;margin-bottom:4px}.hub-opt-row input[type=color]{width:28px;height:28px;padding:0;border:1px solid var(--hub-border,#e3e6ee);border-radius:6px;background:none}

/* Owner-approved resizable sidebar. Hidden when navigation is collapsed or mobile. */
.hub-sidebar-resizer{position:absolute;top:0;bottom:0;left:calc(var(--hub-sidebar-width,280px) - 4px);width:8px;cursor:col-resize;z-index:15;background:transparent}
.hub-sidebar-resizer:hover,.hub-sidebar-resizer.is-resizing{background:var(--hub-primary-soft)}
.hub-shell.is-collapsed .hub-sidebar-resizer{display:none}
@media(max-width:760px){.hub-sidebar-resizer{display:none}}

/* List views use all remaining workspace width, without imposing a fixed 1440px ceiling. */
.hub-page.hub-list-page{max-width:none;width:100%;margin:0}
.hub-main:has(.hub-list-page){padding-left:16px;padding-right:16px}
.hub-nav-icon{font-size:17px;line-height:1.2}
.hub-list-icon{font-size:22px;vertical-align:middle}

/* Owner comparison with ClickUp: legible icons at both sidebar widths. */
.hub-sidebar .hub-nav-icon{font-size:22px;width:25px;min-width:25px;line-height:1.15;display:inline-flex;align-items:center;justify-content:center}
.hub-sidebar .hub-nav-item{gap:10px}
.hub-list-icon{font-size:26px;display:inline-flex;min-width:28px;line-height:1;align-items:center;justify-content:center;vertical-align:middle;margin-right:5px}
.hub-shell.is-collapsed .hub-nav-icon{font-size:23px;width:30px;min-width:30px}
@media(max-width:760px){.hub-sidebar .hub-nav-icon{font-size:21px;width:24px;min-width:24px}}

/* Owner-accepted list workspace spacing; keep the table fluid. */
.hub-main:has(.hub-list-page){padding-left:24px;padding-right:24px}
.hub-list-page .hub-page-header{margin-bottom:0}

/* Single compact List identity in the top breadcrumb, replacing the duplicate
   page heading. The List icon precedes the Space; actions follow the List. */
.hub-crumbs{display:flex;align-items:center;gap:5px;min-width:0}
.hub-crumbs .hub-crumb-list-icon{width:18px;min-width:18px;margin:0;font-size:18px;line-height:1;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.hub-crumbs .hub-crumb-list-actions{width:26px;height:26px;min-width:26px;flex-shrink:0;margin-left:4px;padding:0;justify-content:center;font-size:18px;line-height:1}
.hub-crumbs .hub-crumb-trail{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hub-crumbs .hub-crumb-current{display:inline}


/* Hub visual acceptance: strong contrast and deliberate navy, not washed-out ink. */
.hub-dialog-titlebar {
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  margin-bottom:15px;
}
.hub-dialog-titlebar h2{margin:0;font-size:17px;font-weight:750;color:var(--hub-text)}
/* The one close control for every Hub modal: a bare centred × with no box, no
   border and no background. On hover - and on keyboard focus - it becomes a
   subtle rounded square with a red ×, a red border and a pale-red fill. */
.hub-dialog-close{
  display:grid;place-items:center;flex:none;width:32px;height:32px;
  border:1px solid transparent;background:transparent;
  color:var(--hub-text-muted);border-radius:8px;font-size:20px;line-height:1;
  cursor:pointer;transition:background .12s ease,border-color .12s ease,color .12s ease;
}
.hub-dialog-close:hover{
  color:var(--hub-danger);border-color:var(--hub-danger);background:var(--hub-danger-soft);
}
.hub-dialog-close:focus-visible{
  outline:3px solid var(--hub-danger);outline-offset:2px;
  color:var(--hub-danger);border-color:var(--hub-danger);background:var(--hub-danger-soft);
}
.hub-dialog-review>.hub-dialog-titlebar,.hub-bank-log-dialog>.hub-dialog-titlebar{
  margin:0;padding:14px 22px;background:var(--hub-head);
  border-bottom:1px solid var(--hub-border);flex:none;
}
.hub-dialog-review>.hub-dialog-titlebar h2,.hub-bank-log-dialog>.hub-dialog-titlebar h2{
  margin:0;color:var(--hub-sidebar-bg);
}
/* One Automation Settings dialog: one header, one navigation row, one visible
   section, one footer and one close control. */
.hub-dialog.hub-automation-dialog{
  padding:0;height:min(88dvh,860px);max-height:calc(100dvh - 24px);
  display:flex;flex-direction:column;overflow:hidden;
}
.hub-automation-dialog>.hub-dialog-titlebar{
  flex:none;padding:16px 20px;margin:0;background:var(--hub-head);
  border-bottom:1px solid var(--hub-border);
}
.hub-automation-dialog>.hub-dialog-titlebar h2{color:var(--hub-sidebar-bg)}
.hub-automation-body{
  flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;
}
.hub-automation-dialog [role="tabpanel"][hidden]{display:none!important}
.hub-automation-dialog [role="tabpanel"]{
  flex:1;min-height:0;overflow-y:auto;padding:16px 20px 20px;
}
.hub-automation-dialog [role="tabpanel"] h3{
  font-size:16px;color:var(--hub-sidebar-bg);margin:18px 0 10px;font-weight:750;
}
.hub-automation-dialog .hub-pop-form{padding:0;gap:0;max-height:none;overflow:visible}
.hub-automation-settings .hub-automation-help{
  margin:0 0 12px;color:var(--hub-text);font-size:13px;line-height:1.5;
}
/* The navigation row scrolls sideways when the sections do not fit, and never
   scrolls vertically: the row is a fixed strip, so the overflow is hidden on
   the vertical axis. Without that the row shows a vertical scrollbar at its
   right edge, and the negative margin that pulled the active underline over
   the rule clipped it. */
.hub-automation-tabs{
  display:flex;gap:6px;padding:5px 20px 0;border-bottom:2px solid var(--hub-border);
  overflow-x:auto;overflow-y:hidden;flex:none;
}
.hub-automation-tab{
  flex:none;border:0;background:transparent;color:var(--hub-text);
  font-weight:700;font-size:13px;padding:10px 13px;border-bottom:3px solid transparent;
  white-space:nowrap;
}
.hub-automation-tab.is-active{
  color:var(--hub-primary);border-bottom-color:var(--hub-primary);
}
.hub-automation-tab:hover{background:var(--hub-hover)}
.hub-automation-tab:focus-visible{
  outline:2px solid var(--hub-primary);outline-offset:-2px;border-radius:6px;
}
.hub-automation-dialog .hub-form-row{display:flex;align-items:center;gap:14px;margin-bottom:12px}
.hub-automation-dialog .hub-form-row>span:first-child{
  min-width:150px;color:var(--hub-text);font-weight:650;
}
.hub-automation-dialog .hub-input,.hub-automation-dialog .hub-select{
  border-color:#96a8c1;min-height:38px;
}
.hub-automation-dialog .hub-automation-button-row{gap:12px;margin:14px 0}
.hub-automation-dialog .hub-automation-button-row .hub-btn{padding:9px 12px;font-size:13px}

/* The Automation configuration form is a compact form. The form is held to a
   comfortable editing width instead of stretching every control across the
   whole dialog, and related short fields share one row: the frequency and the
   time zone side by side, the hour and the minute as compact controls next to
   the weekday. The same stacked label-over-control field Hub uses everywhere
   else is reused here, so the section reads like the Source section next to it. */
.hub-automation-config{max-width:700px}
.hub-automation-config .hub-field{gap:6px;margin-bottom:14px}
.hub-automation-config .hub-input,.hub-automation-config .hub-select{
  width:100%;height:38px;
}
.hub-config-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px 18px;align-items:start;margin-bottom:14px;
}
.hub-config-grid .hub-field{margin-bottom:0;min-width:0}
.hub-config-grid .hub-input,.hub-config-grid .hub-select{max-width:320px}
/* The hour and the minute are two-digit controls: they stay compact and the
   weekday takes the rest of the row. */
.hub-config-grid--time{grid-template-columns:92px 92px minmax(0,320px)}
.hub-config-grid--time .hub-input{width:92px;max-width:92px}
@media(max-width:640px){
  .hub-config-grid{grid-template-columns:minmax(0,1fr)}
  .hub-config-grid--time{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hub-config-grid--time>.hub-field:last-child{grid-column:1 / -1}
}

/* Manual CSV import: the same dialog surface as the Automation Settings - one
   header with the shared close control, one progress indicator for the four
   steps, one scrolling body and one persistent footer. */
.hub-dialog-backdrop:has(.hub-import-dialog){align-items:center;padding:12px;overflow:hidden}
.hub-dialog.hub-import-dialog{
  padding:0;height:min(88dvh,860px);max-height:calc(100dvh - 24px);
  display:flex;flex-direction:column;overflow:hidden;
}
.hub-import-dialog>.hub-dialog-titlebar{
  flex:none;padding:16px 20px;margin:0;background:var(--hub-head);
  border-bottom:1px solid var(--hub-border);
}
.hub-import-dialog>.hub-dialog-titlebar h2{color:var(--hub-sidebar-bg)}
.hub-import-shell{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.hub-import-steps{
  flex:none;display:flex;align-items:center;gap:18px;flex-wrap:wrap;
  margin:0;padding:12px 20px;list-style:none;border-bottom:1px solid var(--hub-border);
}
.hub-import-step{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--hub-text-muted)}
.hub-import-step-number{
  display:grid;place-items:center;flex:none;width:22px;height:22px;border-radius:50%;
  border:1px solid var(--hub-border);background:var(--hub-surface);
  font-size:11px;font-weight:700;color:var(--hub-text-muted);
}
.hub-import-step.is-current{color:var(--hub-text);font-weight:700}
.hub-import-step.is-current .hub-import-step-number{
  border-color:var(--hub-primary);background:var(--hub-primary);color:var(--hub-primary-text);
}
.hub-import-step.is-done .hub-import-step-number{
  border-color:var(--hub-accent,#2e8b57);color:var(--hub-accent,#2e8b57);
}
.hub-import-body{flex:1;min-height:0;overflow-y:auto;padding:16px 20px 20px}
.hub-import-title{margin:0 0 6px;font-size:15px;font-weight:750;color:var(--hub-sidebar-bg)}
.hub-import-note{margin:0 0 14px;font-size:13px;line-height:1.5;color:var(--hub-text-muted)}
.hub-import-summary{margin:0 0 12px;font-size:13px;color:var(--hub-text)}
.hub-import-toolbar{display:flex;gap:8px;margin:0 0 12px}
.hub-import-choices{display:flex;gap:10px;flex-wrap:wrap;margin-top:8px}
.hub-import-choices label{font-size:13px;color:var(--hub-text)}
.hub-import-form .hub-field{margin-bottom:12px}
.hub-import-table td{vertical-align:top}
.hub-import-sample{color:var(--hub-text-muted)}
.hub-import-table tr.is-error td{background:rgba(180,40,40,.12)}
.hub-import-table td.is-skipped{opacity:.5}
.hub-import-results{margin:0 0 12px;font-size:13px;color:var(--hub-text)}
.hub-import-results div{padding:3px 0}
/* The file selection control: a native file input keeps the operating system
   picker and the assistive technology, and the visible control opens it. */
.hub-file-picker{
  display:flex;align-items:center;gap:12px;padding:10px 12px;
  border:1px solid var(--hub-border);border-radius:var(--hub-radius);
  background:var(--hub-surface);
}
/* The upload step accepts a CSV dropped from the computer: one drop zone,
   highlighted while a file is over it, above the native file control. */
.hub-dropzone{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  padding:26px 16px;margin-bottom:12px;text-align:center;cursor:pointer;
  border:2px dashed var(--hub-border);border-radius:var(--hub-radius);
  background:var(--hub-head);color:var(--hub-text-muted);
  transition:border-color .15s ease,background-color .15s ease;
}
.hub-dropzone:hover{border-color:var(--hub-primary);background:var(--hub-hover)}
.hub-dropzone:focus-visible{outline:2px solid var(--hub-primary);outline-offset:2px}
.hub-dropzone.is-dragging{
  border-color:var(--hub-primary);background:var(--hub-primary-soft);color:var(--hub-text);
}
.hub-dropzone-icon{font-size:26px;line-height:1;color:var(--hub-text-muted)}
.hub-dropzone.is-dragging .hub-dropzone-icon{color:var(--hub-primary)}
.hub-dropzone-title{font-size:14px;font-weight:700;color:var(--hub-text)}
.hub-dropzone-hint{font-size:12px;color:var(--hub-text-muted)}
.hub-file-name{
  flex:1;min-width:0;font-size:13px;color:var(--hub-text);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.hub-file-input{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;
}
.hub-import-footer{
  flex:none;display:flex;justify-content:flex-end;align-items:center;gap:10px;
  padding:12px 20px;border-top:1px solid var(--hub-border);background:var(--hub-surface);
}
.hub-import-footer .hub-btn{min-height:36px;padding:8px 14px}
@media(max-width:640px){
  .hub-import-steps{padding:10px 12px;gap:12px}
  .hub-import-body{padding:12px}
  .hub-import-footer{padding:10px 12px;flex-wrap:wrap}
  .hub-import-dialog>.hub-dialog-titlebar{padding:12px}
}

/* Compact settings surface: the label sits in a fixed left column and its
   control in a compact right column, so the panel reads as one professional
   settings form instead of a stack of full-width form rows. On a narrow
   screen the label stacks above its control. */
.hub-settings-row{
  display:grid;grid-template-columns:190px minmax(0,1fr);gap:6px 16px;
  align-items:center;margin-bottom:12px;
}
.hub-settings-row[hidden]{display:none!important}
.hub-settings-row--pair{
  grid-template-columns:auto auto auto auto;justify-content:start;gap:6px 10px;
}
.hub-settings-row--pair.is-minute-only{grid-template-columns:auto auto}
.hub-settings-control{display:flex;flex-direction:column;gap:6px;min-width:0}
.hub-settings-row .hub-input,.hub-settings-row .hub-select{
  width:100%;max-width:320px;min-height:38px;height:38px;
}
.hub-settings-row--pair .hub-input{width:92px;max-width:92px}
.hub-settings-label{
  font-size:13px;font-weight:650;letter-spacing:.01em;color:var(--hub-text);
}
.hub-settings-value{
  display:flex;align-items:center;min-height:38px;font-size:14px;color:var(--hub-text);
}
.hub-settings-note{margin:0;font-size:13px;line-height:1.5;color:var(--hub-text-muted)}
/* Restrained separation between groups of related settings. */
.hub-schedule-group{border-top:1px solid var(--hub-border);padding-top:14px;margin-top:4px}
.hub-schedule-group-title{
  margin:0 0 12px;font-size:12px;font-weight:750;letter-spacing:.05em;
  text-transform:uppercase;color:var(--hub-text);
}
.hub-schedule-state{margin:0 0 12px;font-size:13px;line-height:1.5;color:var(--hub-text)}
/* The field mapping editor is mounted inside the Field Mapping section. */
.hub-map-mount .hub-map{background:#f6f7fb;border:1px solid #dfe3f1;border-radius:12px;overflow:hidden}
.hub-map-mount .hub-map-body{overflow:visible;min-height:0;padding:14px}
@media(max-width:640px){
  .hub-settings-row{grid-template-columns:minmax(0,1fr);gap:4px}
  .hub-settings-row--pair{grid-template-columns:minmax(0,1fr)}
  .hub-settings-row--pair.is-minute-only{grid-template-columns:minmax(0,1fr)}
  .hub-automation-dialog [role="tabpanel"]{padding:14px 14px 18px}
}
.hub-readiness-heading{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  flex-wrap:wrap;margin-bottom:16px;
}
.hub-readiness-heading strong{color:var(--hub-sidebar-bg);font-size:18px;font-weight:800}
.hub-readiness-ready{color:#14763b;font-weight:750}
.hub-readiness-blocked{color:#b42318;font-weight:750}
.hub-readiness-neutral{color:var(--hub-text);font-weight:600}
.hub-readiness-list{list-style:none;padding:0;margin:0}
.hub-readiness-item{
  display:grid;grid-template-columns:18px minmax(110px,1fr) auto auto;
  align-items:center;gap:14px;padding:13px 2px;border-bottom:1px solid var(--hub-border);
}
.hub-readiness-item .hub-readiness-label{font-weight:650;color:var(--hub-text)}
.hub-readiness-edit{color:var(--hub-primary);border-color:var(--hub-primary);font-weight:700;min-width:80px;justify-content:center}
.hub-automation-footer{
  display:flex;flex-direction:column;gap:8px;align-items:stretch;
  padding:12px 20px;background:var(--hub-surface);border-top:1px solid var(--hub-border);flex:none;
}
.hub-automation-footer-actions{display:flex;justify-content:flex-end;gap:12px;align-items:center}
.hub-automation-footer-status:empty{display:none}
.hub-settings-status:empty{display:none}
.hub-settings-status{font-size:13px;line-height:1.5;color:var(--hub-text)}
.hub-automation-save{font-weight:750;min-width:125px;justify-content:center}
.hub-automation-settings .hub-error{font-weight:650}
@media(max-width:640px){
 .hub-readiness-item{grid-template-columns:18px 1fr auto;gap:7px}
 .hub-readiness-item .hub-readiness-edit{grid-column:3}
 .hub-readiness-item [class*="hub-readiness-"]:nth-child(3){grid-column:2}
 .hub-automation-dialog .hub-form-row>span:first-child{min-width:105px}
 .hub-automation-footer{padding:12px 14px}
}

/* Automation overview uses a simple readable action panel. */
.hub-automation-overview-dialog{max-height:88dvh;overflow:auto}
.hub-automation-overview-dialog h3{font-size:16px;color:var(--hub-sidebar-bg);margin:20px 0 12px}
.hub-automation-overview-card>strong{font-size:16px;color:var(--hub-sidebar-bg)}
.hub-automation-overview-card .hub-automation-state{
  color:var(--hub-text);font-weight:600;margin:10px 0 16px;line-height:1.5;
}
.hub-automation-overview-actions{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.hub-automation-overview-actions .hub-btn{
  font-size:13px;min-height:36px;font-weight:650;padding:8px 12px;
  border-color:#9eafc9;color:var(--hub-sidebar-bg);
}
.hub-automation-overview-actions .hub-btn:hover{
  background:var(--hub-primary-soft);border-color:var(--hub-primary)
}

/* One global actionable notification inbox: crisp body text, clear actions. */
.hub-notification-panel{width:min(400px,calc(100vw - 32px));max-width:100%;color:var(--hub-text)}
.hub-notifications-header{
  display:flex;align-items:center;justify-content:space-between;
  gap:14px;padding:8px 8px 9px;border-bottom:1px solid var(--hub-border);
}
.hub-notifications-header strong{font-size:15px;font-weight:800;color:var(--hub-sidebar-bg)}
.hub-notification-history-link{
  border:0;background:transparent;color:var(--hub-primary);
  font-weight:750;padding:7px;cursor:pointer;
}
.hub-notifications-subtitle{
  font-size:12px;color:var(--hub-text);padding:6px 8px;margin:0;
}
.hub-notifications-empty{padding:18px 10px;font-weight:600;color:var(--hub-text)}
.hub-notification-item{
  display:flex;align-items:center;justify-content:space-between;
  gap:14px;padding:14px 9px;border-bottom:1px solid var(--hub-border);
}
.hub-notification-item.is-unread{border-left:3px solid var(--hub-primary)}
.hub-notification-message{display:flex;flex:1;min-width:0;flex-direction:column;gap:6px}
.hub-notification-title{color:var(--hub-text);font-size:13px;font-weight:750;line-height:1.4;overflow-wrap:anywhere}
.hub-notification-time{font-size:12px;color:var(--hub-text-muted);font-weight:550}
.hub-notification-actions{display:flex;align-items:center;gap:8px;flex:none;flex-wrap:wrap;justify-content:flex-end}
.hub-notification-actions .hub-btn{white-space:nowrap;font-weight:700}
.hub-notification-dismiss{color:var(--hub-primary);border-color:#9badc3}
.hub-notification-footer{display:flex;justify-content:flex-end;padding:8px}
@media(max-width:440px){
 .hub-notification-item{align-items:flex-start;flex-direction:column}
 .hub-notification-actions{justify-content:flex-start}
}
