/* Compact sidebar shell and path-based pages */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; z-index: 20; display: flex; width: 205px; height: 100vh; flex: 0 0 205px; flex-direction: column; padding: 13px 10px 9px; border-right: 1px solid var(--line); background: #0c1316; }
.sidebar > .brand { margin: 0 3px 23px; }
.sidebar-label { margin: 0 8px 7px; color: #75837b; font-size: 7px; font-weight: 760; letter-spacing: .13em; }
.side-nav { display: grid; gap: 3px; }
.nav-item { display: flex; min-height: 35px; align-items: center; gap: 9px; padding: 0 9px; border: 1px solid transparent; border-radius: 6px; color: #9ba8a0; font-size: 10px; font-weight: 560; transition: background 130ms ease, color 130ms ease, border-color 130ms ease; }
.nav-item svg { width: 15px; height: 15px; flex: 0 0 auto; }
.nav-item:hover { background: #151f22; color: #e0e9e2; }
.nav-item.active { border-color: #344532; background: linear-gradient(90deg, #1b291c, #17211c); color: #c5e59c; }
.nav-count { display: inline-grid; min-width: 17px; height: 17px; margin-left: auto; place-items: center; border: 1px solid #34413a; border-radius: 5px; color: #a7b5aa; font-family: ui-monospace, monospace; font-size: 8px; }
.nav-soon { margin-left: auto; color: #77847a; font-size: 6px; font-weight: 750; letter-spacing: .08em; }
.sidebar-spacer { flex: 1; }
.sidebar-footer { display: flex; min-height: 42px; align-items: center; gap: 8px; padding: 6px 3px 0; border-top: 1px solid #273337; }
.footer-profile-mark { display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; border: 1px solid #39483a; border-radius: 7px; background: #19231c; color: #c8dcad; font-size: 8px; font-weight: 750; }
.footer-profile-copy { display: grid; min-width: 0; flex: 1; gap: 1px; }
.footer-profile-copy strong { overflow: hidden; color: #cbd5ce; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.footer-profile-copy small { color: #829087; font-size: 8px; }
.footer-login-link { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 5px; color: #87958c; }
.footer-login-link:hover { background: #1a2426; color: var(--accent); }
.footer-login-link svg { width: 15px; height: 15px; }
.app-main { min-width: 0; flex: 1; }
.topbar { min-height: 45px; justify-content: space-between; gap: 12px; padding: 0 clamp(12px, 1.7vw, 24px); }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: #7e8b84; font-size: 9px; }
.breadcrumb strong { color: #d4ded6; font-weight: 580; }
.breadcrumb-divider { color: #4e5c55; }
.topbar-actions { gap: 7px; }
.topbar-account { display: flex; align-items: center; gap: 8px; }
.topbar-settings-link { width: 44px; height: 44px; min-width: 44px; min-height: 44px; color: #b8c9be; }
.topbar-settings-link:hover, .topbar-settings-link[aria-current="page"] { border-color: rgba(110, 227, 164, .24); background: rgba(110, 227, 164, .08); color: #a5edc0; }
.topbar-settings-link:focus-visible { outline: 2px solid #8ce2ad; outline-offset: 2px; }
.topbar-settings-link svg { width: 18px; height: 18px; }
.topbar-profile-link { display: inline-flex; min-height: 34px; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: #b8c9be; font-size: 9px; font-weight: 650; text-decoration: none; transition: border-color 140ms ease, background 140ms ease, color 140ms ease; }
.topbar-profile-link:hover, .topbar-profile-link[aria-current="page"] { border-color: rgba(110, 227, 164, .24); background: rgba(110, 227, 164, .08); color: #a5edc0; }
.topbar-profile-link:focus-visible { outline: 2px solid #8ce2ad; outline-offset: 2px; }
.topbar-profile-link svg { width: 16px; height: 16px; }
.topbar-profile-link span { text-transform: lowercase; }
.topbar-user-copy { display: grid; min-width: 75px; max-width: 150px; gap: 1px; }
.topbar-user-copy strong { overflow: hidden; color: #d5ded8; font-size: 9px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user-copy small { overflow: hidden; color: #8d9a92; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-account .button { min-height: 34px; gap: 6px; }
.topbar-account .button svg { width: 14px; height: 14px; }
.workspace { width: min(100%, 1520px); padding: 12px clamp(12px, 1.7vw, 24px) 10px; }
.profile-page { display: grid; gap: 10px; }
.workspace:has(.profile-page:not([hidden])) > #runtime-banner { display: none; }
.profile-page-navigation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 13px; padding: 5px; border: 1px solid #25332d; border-radius: 13px; background: rgba(9, 17, 13, .58); }
.profile-page-link { display: flex; min-width: 0; min-height: 48px; align-items: center; justify-content: center; gap: 9px; padding: 9px 12px; border: 1px solid transparent; border-radius: 9px; color: #a7b6ac; text-decoration: none; transition: border-color 140ms ease, background 140ms ease, color 140ms ease; }
.profile-page-link:hover { border-color: #35473c; background: #142019; color: #e2eee6; }
.profile-page-link[aria-current="page"] { border-color: rgba(110, 227, 164, .3); background: rgba(110, 227, 164, .1); color: #b9edcb; }
.profile-page-link:focus-visible, .profile-feature-card:focus-visible { outline: 2px solid #8ce2ad; outline-offset: 2px; }
.profile-page-link svg { width: 18px; height: 18px; flex: 0 0 auto; }
.profile-page-link strong { overflow: hidden; color: inherit; font-size: 12px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.profile-page-navigation.is-profile-home { display: none; }
.profile-home-panel { display: grid; gap: 18px; padding: 22px; }
.profile-home-heading { display: grid; gap: 7px; }
.profile-home-heading h2 { margin: 0; color: #e1ece4; font-size: 20px; font-weight: 680; letter-spacing: -.02em; }
.profile-home-heading p { max-width: 700px; margin: 0; color: #9eada3; font-size: 13px; line-height: 1.55; }
.profile-home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-feature-card { display: grid; min-width: 0; min-height: 122px; grid-template-columns: 44px minmax(0, 1fr) 18px; align-items: center; gap: 14px; padding: 16px; border: 1px solid #2b3a32; border-radius: 12px; background: linear-gradient(145deg, rgba(19, 31, 24, .92), rgba(12, 20, 16, .82)); color: #dbe8de; text-decoration: none; transition: transform 140ms ease, border-color 140ms ease, background 140ms ease; }
.profile-feature-card:hover { transform: translateY(-1px); border-color: rgba(110, 227, 164, .36); background: linear-gradient(145deg, rgba(24, 40, 30, .98), rgba(14, 24, 18, .92)); }
.profile-feature-icon { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid rgba(110, 227, 164, .2); border-radius: 12px; background: rgba(110, 227, 164, .08); color: #a9e9bf; }
.profile-feature-icon svg { width: 21px; height: 21px; }
.profile-feature-copy { display: grid; min-width: 0; gap: 5px; }
.profile-feature-copy small { color: #88a393; font-size: 9px; font-weight: 750; letter-spacing: .11em; }
.profile-feature-copy strong { overflow: hidden; color: #e3eee6; font-size: 16px; font-weight: 690; text-overflow: ellipsis; white-space: nowrap; }
.profile-feature-copy > span { max-width: 520px; color: #9baaa0; font-size: 12px; line-height: 1.45; }
.profile-feature-arrow { align-self: start; color: #8fa195; font-size: 18px; line-height: 1; }
.profile-finance-panel { min-height: 210px; }
.profile-feature-state { display: grid; min-height: 145px; align-content: center; gap: 6px; padding: 12px 15px 18px; }
.profile-feature-state strong { color: #dce8df; font-size: 12px; font-weight: 620; }
.profile-feature-state p { max-width: 600px; margin: 0; color: #91a398; font-size: 10px; line-height: 1.55; }
.profile-finance-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px 12px 0; }
.profile-finance-totals article { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: rgba(7, 14, 11, .35); }
.profile-finance-totals span { color: #8da095; font-size: 9px; }
.profile-finance-totals strong { color: #dce8df; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 15px; font-weight: 560; }
.page-heading { min-height: 41px; margin-bottom: 8px; }
.page-heading h1 { font-size: 20px; }
.page-description { margin: 3px 0 0; color: #93a097; font-size: 9px; }
.runtime-banner { min-height: 36px; margin-bottom: 8px; }
.page-view { min-width: 0; }
.metrics-grid { gap: 8px; margin-bottom: 9px; }
.metric-card { min-height: 67px; padding: 7px 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 9px; }
.account-panel { min-width: 0; }
.account-table { min-width: 610px; }
.page-view > .account-panel { margin: 0; }
.add-account-panel { margin: 9px 0 0; padding: 0 10px 10px; }
.add-account-heading h2 { margin: 2px 0 0; color: #e0e9e2; font-size: 12px; font-weight: 620; }
.connect-form { grid-template-columns: minmax(120px, 1fr) minmax(155px, 1.15fr) minmax(150px, 1.15fr) auto; }
.automation-overview { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(340px, 1.2fr); align-items: start; gap: 9px; }
.automation-state-panel { display: grid; justify-items: start; gap: 8px; padding: 16px; }
.automation-state-panel h2 { margin: 0; color: #e2eae3; font-size: 15px; font-weight: 620; letter-spacing: -.02em; }
.automation-state-panel p { margin: 0; color: #96a39b; font-size: 10px; line-height: 1.55; }
.automation-checklist .panel-heading { min-height: 48px; }
.checklist-list { padding: 3px 12px 7px; }
.checklist-list > div { display: grid; min-height: 40px; grid-template-columns: 27px minmax(110px, .7fr) minmax(130px, 1.3fr); align-items: center; gap: 9px; border-bottom: 1px solid #243137; }
.checklist-list > div:last-child { border-bottom: 0; }
.checklist-list > div > span { color: #819087; font-family: ui-monospace, monospace; font-size: 9px; }
.checklist-list strong { color: #cbd5ce; font-size: 10px; font-weight: 580; }
.checklist-list small { color: #8a9890; font-size: 9px; text-align: right; }

@media (max-width: 1050px) {
  .sidebar { width: 185px; flex-basis: 185px; }
  .automation-overview { grid-template-columns: minmax(220px, .8fr) minmax(300px, 1.2fr); }
}
@media (max-width: 820px) {
  .sidebar { width: 61px; flex-basis: 61px; align-items: center; padding-right: 6px; padding-left: 6px; }
  .sidebar > .brand { margin-right: 0; margin-left: 0; }
  .sidebar .brand-copy, .sidebar-label, .nav-item > span, .footer-profile-copy, .footer-login-link { display: none; }
  .side-nav { width: 100%; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-count, .nav-soon { display: none !important; }
  .sidebar-footer { justify-content: center; width: 100%; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .automation-overview { grid-template-columns: 1fr; }
  .topbar { flex-wrap: nowrap; }
  .topbar-actions { margin-left: auto; }
  .topbar-user-copy { max-width: 110px; }
}
@media (max-width: 600px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: auto 0 0; z-index: 50; display: block; width: 100%; height: calc(55px + env(safe-area-inset-bottom)); padding: 3px 5px env(safe-area-inset-bottom); border: 0; border-top: 1px solid #2a373b; background: #0c1316f5; backdrop-filter: blur(12px); }
  .sidebar > .brand, .sidebar-label, .sidebar-spacer, .sidebar-footer { display: none; }
  .side-nav { display: flex; width: 100%; height: 100%; align-items: stretch; justify-content: space-around; gap: 2px; }
  .nav-item { display: flex; min-width: 0; min-height: 46px; flex: 1; flex-direction: column; justify-content: center; gap: 3px; padding: 2px 1px; border-radius: 5px; font-size: 7px; }
  .nav-item svg { width: 16px; height: 16px; }
  .nav-item > span:not(.nav-count):not(.nav-soon) { display: block; overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
  .nav-count, .nav-soon { display: none !important; }
  .app-main { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 42px; padding-right: 9px; padding-left: 9px; }
  .breadcrumb { gap: 5px; font-size: 8px; }
  .topbar-user-copy { display: none; }
  .profile-page-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; padding: 4px; }
  .profile-page-link { min-height: 48px; justify-content: flex-start; gap: 7px; padding: 8px; }
  .profile-page-link svg { width: 17px; height: 17px; }
  .profile-page-link strong { font-size: 11px; white-space: normal; line-height: 1.2; }
  .profile-home-panel { gap: 14px; padding: 16px; }
  .profile-home-heading h2 { font-size: 18px; }
  .profile-home-heading p { font-size: 12px; }
  .profile-home-grid { grid-template-columns: 1fr; gap: 9px; }
  .profile-feature-card { min-height: 104px; grid-template-columns: 40px minmax(0, 1fr) 16px; gap: 11px; padding: 13px; }
  .profile-feature-icon { width: 40px; height: 40px; }
  .profile-feature-copy { gap: 4px; }
  .profile-feature-copy strong { font-size: 15px; }
  .profile-feature-copy > span { font-size: 11px; }
  .profile-finance-totals { gap: 6px; padding-right: 9px; padding-left: 9px; }
  .profile-finance-totals article { min-height: 50px; padding: 7px; }
  .profile-finance-totals span { font-size: 8px; }
  .topbar-profile-link { min-height: 42px; }
  .topbar-account .button { min-height: 42px; }
  .login-shortcut { display: none; }
  .workspace { padding: 9px 10px 12px; }
  .page-description { max-width: 70vw; font-size: 8px; }
  .account-table { min-width: 0; }
  .connect-form { grid-template-columns: 1fr 1fr; }
  .connect-form > .button, .connect-form > .form-error { grid-column: 1 / -1; }
  .automation-overview { grid-template-columns: 1fr; }
  .checklist-list > div { grid-template-columns: 21px minmax(84px, .75fr) minmax(100px, 1.25fr); gap: 6px; }
}
.skip-link { border: 0; cursor: pointer; font: inherit; }


