/* Sidebar hardening — loaded last */
.sidebar{
  box-sizing:border-box;
  min-width:0;
  isolation:isolate;
}
.sidebar>*{min-width:0}
.sidebar .brand,.sidebar .trial-badge,.sidebar nav,.sidebar .sidebar-account-host,.sidebar .theme-switcher{flex:0 0 auto}
.sidebar nav{overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;overscroll-behavior:contain;padding-inline:1px}
.sidebar nav::-webkit-scrollbar{width:6px}
.sidebar nav::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--text-muted, #6b7280) 30%,transparent);border-radius:999px}
.sidebar .nav-item{overflow:visible!important;min-width:0;flex-shrink:0}
.sidebar .nav-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar .nav-item.active::before{right:0!important}
.sidebar .brand{min-width:0}
.sidebar .brand>div:last-child{min-width:0}
.sidebar .brand strong,.sidebar .brand span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar .trial-badge{min-width:0;overflow:hidden}
.sidebar .trial-badge>div{min-width:0}
.sidebar .trial-badge strong,.sidebar .trial-badge small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar .theme-switcher.sidebar-theme-switcher{margin-top:8px!important;flex-shrink:0}
.sidebar-account-host{flex-shrink:0!important;margin-top:8px!important}
.sidebar-account-host .account-trigger{min-width:0}
.sidebar-account-host .account-trigger-copy{overflow:hidden}

@media(min-width:1101px){
  .sidebar{display:grid!important;grid-template-rows:auto auto minmax(0,1fr) auto auto;gap:12px!important;height:100vh;height:100dvh;padding:18px 14px!important}
  .sidebar nav{align-self:stretch}
}

@media(max-width:1100px) and (min-width:701px){
  .sidebar{display:grid!important;grid-template-rows:auto auto minmax(0,1fr) auto auto;gap:10px!important;height:100vh;height:100dvh;padding:16px 10px!important}
  .sidebar .brand-mark{margin:auto}
  .sidebar .trial-badge{width:100%;min-height:44px}
  .sidebar .nav-item{min-height:42px}
  .sidebar .nav-item.active::before{right:0!important}
  .sidebar .theme-switcher.sidebar-theme-switcher{width:100%}

}

@media(max-width:700px){
  .sidebar{
    display:grid!important;
    grid-template-rows:auto auto minmax(0,1fr) auto auto;
    gap:8px!important;
    width:min(82vw,300px)!important;
    height:100dvh!important;
    max-height:100dvh!important;
    padding:14px 12px max(12px,env(safe-area-inset-bottom))!important;
    overflow:hidden!important;
    transform:translateX(105%);
    visibility:hidden;
    pointer-events:none;
    transition:transform .28s cubic-bezier(.2,.82,.2,1),visibility .28s step-end,box-shadow .28s ease;
  }
  .sidebar.mobile-open{
    transform:translateX(0)!important;
    visibility:visible;
    pointer-events:auto;
    transition:transform .28s cubic-bezier(.2,.82,.2,1),visibility 0s step-start,box-shadow .28s ease;
  }
  .sidebar .brand{min-height:58px!important;padding:0 4px 10px!important;margin:0!important}
  .sidebar .trial-badge{margin:0!important;min-height:48px}
  .sidebar nav{height:auto!important;min-height:0!important;padding-block:2px}
  .sidebar .nav-item{min-height:42px!important;padding-inline:11px!important}
  .sidebar .nav-item.active::before{right:0!important;top:9px!important;bottom:9px!important}
  .sidebar .theme-switcher.sidebar-theme-switcher{margin:0!important}
  .sidebar-account-host{margin:0!important;padding-top:8px!important}
  .mobile-sidebar-backdrop{touch-action:none}
  body.mobile-sidebar-open{overflow:hidden!important;overscroll-behavior:none}
}

@media(max-width:700px) and (max-height:680px){
  .sidebar{grid-template-rows:auto auto minmax(120px,1fr) auto auto;gap:6px!important;padding-top:10px!important}
  .sidebar .brand{min-height:48px!important;padding-bottom:6px!important}
  .sidebar .trial-badge{min-height:42px;padding-block:7px!important}
  .sidebar .nav-item{min-height:38px!important}

}

@media(prefers-reduced-motion:reduce){
  .sidebar,.mobile-sidebar-backdrop{transition:none!important}
}

/* Static sidebar user card and fixed logout */
.sidebar-user-area{
  display:grid!important;
  grid-template-columns:1fr;
  gap:8px;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  overflow:visible!important;
}
.sidebar-user-card{
  min-width:0;
  min-height:54px;
  display:grid;
  grid-template-columns:36px minmax(0,1fr);
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border:1px solid var(--line,var(--border));
  border-radius:13px;
  background:var(--card-muted,var(--surface-soft));
}
.sidebar-user-card .account-trigger-copy{min-width:0;display:flex!important}
.sidebar-user-card .account-trigger-copy strong,
.sidebar-user-card .account-trigger-copy small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar-logout{
  width:100%;
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  padding:0 12px;
  border:1px solid color-mix(in srgb,var(--red-text,#b42318) 22%,var(--line,var(--border)));
  border-radius:11px;
  background:color-mix(in srgb,var(--red-panel,#fff1f2) 72%,var(--card-bg,#fff));
  color:var(--red-text,#b42318);
  font-weight:700;
  overflow:hidden;
}
.sidebar-logout svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.sidebar-logout span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar-logout:hover{background:var(--red-panel,#fff1f2);border-color:color-mix(in srgb,var(--red-text,#b42318) 45%,var(--line,var(--border)))}
.sidebar-logout:active{transform:scale(.985)}
.sidebar-logout:disabled{opacity:.58;cursor:wait}

@media(min-width:1101px){
  .sidebar{grid-template-rows:auto auto minmax(0,1fr) auto auto!important}
  .sidebar .theme-switcher.sidebar-theme-switcher{grid-row:4}
  .sidebar-user-area{grid-row:5}
}
@media(max-width:1100px) and (min-width:701px){
  .sidebar-user-card{grid-template-columns:1fr;padding:8px}
  .sidebar-user-card .account-trigger-copy{display:none!important}
  .sidebar-user-card .account-avatar{margin:auto}
  .sidebar-logout{justify-content:center;padding:0}
  .sidebar-logout span{display:none}
}
@media(max-width:700px){
  .sidebar{grid-template-rows:auto auto minmax(0,1fr) auto auto!important}
  .sidebar .theme-switcher.sidebar-theme-switcher{grid-row:4;margin:0!important}
  .sidebar-user-area{grid-row:5;margin:0!important;padding-top:0!important;border-top:0!important;gap:7px}
  .sidebar-user-card{min-height:48px;padding:6px 8px;grid-template-columns:34px minmax(0,1fr)}
  .sidebar-logout{min-height:42px}
}
@media(max-width:700px) and (max-height:680px){
  .sidebar-user-card{display:none}
  .sidebar-user-area{gap:0}
  .sidebar-logout{min-height:40px}
}

/* Stable touch behavior: vertical finger movement scrolls; horizontal swipe closes */
@media(max-width:700px){
  .sidebar{touch-action:pan-y!important}
  .sidebar nav{touch-action:pan-y;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}
  .sidebar .theme-switcher,.sidebar .sidebar-account-host,.sidebar .sidebar-logout{touch-action:manipulation}
}


/* Sidebar without internal scrolling */
.sidebar nav{
  overflow:visible!important;
  scrollbar-width:none!important;
  overscroll-behavior:none!important;
}
.sidebar nav::-webkit-scrollbar{display:none!important}

@media(max-width:700px){
  .sidebar{
    overflow:hidden!important;
    touch-action:pan-x!important;
  }
  .sidebar nav{
    overflow:visible!important;
    touch-action:pan-x!important;
  }
  .sidebar .nav-item{
    min-height:clamp(34px,5.1dvh,42px)!important;
  }
}

@media(max-width:700px) and (max-height:760px){
  .sidebar{gap:5px!important;padding-top:9px!important}
  .sidebar .brand{min-height:44px!important;padding-bottom:5px!important}
  .sidebar .trial-badge{min-height:38px!important;padding-block:5px!important}
  .sidebar .nav-item{min-height:34px!important;font-size:12px!important}
  .sidebar .nav-item svg{width:17px!important;height:17px!important}
  .sidebar .theme-switcher.sidebar-theme-switcher button{height:34px!important}
  .sidebar-user-card{min-height:42px!important;padding-block:5px!important}
  .sidebar-logout{min-height:38px!important}
}

@media(max-width:700px) and (max-height:620px){
  .sidebar .brand span,.sidebar .trial-badge small,.sidebar-user-card small{display:none!important}
  .sidebar .brand{min-height:38px!important}
  .sidebar .trial-badge{min-height:34px!important}
  .sidebar .nav-item{min-height:31px!important}
  .sidebar .theme-switcher.sidebar-theme-switcher button{height:31px!important}
  .sidebar-user-card{min-height:36px!important}
  .sidebar-logout{min-height:34px!important}
}

/* Professional compact mobile sidebar */
@media(max-width:700px){
  .sidebar{
    width:min(78vw,286px)!important;
    grid-template-rows:auto auto minmax(0,1fr) auto!important;
    gap:0!important;
    padding:14px 14px max(12px,env(safe-area-inset-bottom))!important;
  }

  .sidebar .brand{
    min-height:52px!important;
    padding:0 2px 12px!important;
    margin:0 0 8px!important;
    border-bottom:1px solid var(--line,var(--border))!important;
  }
  .sidebar .brand-mark{
    width:38px!important;
    height:38px!important;
    border-radius:11px!important;
  }
  .sidebar .brand strong{font-size:14px!important}
  .sidebar .brand span{font-size:11px!important;margin-top:1px!important}

  .sidebar .trial-badge{
    width:max-content!important;
    max-width:100%!important;
    min-height:34px!important;
    margin:0 0 8px!important;
    padding:5px 8px!important;
    gap:7px!important;
    border:0!important;
    border-radius:9px!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  .sidebar .trial-badge:hover{
    transform:none!important;
    background:var(--card-hover,var(--surface-soft))!important;
  }
  .sidebar .trial-badge .plan-pill{
    padding:4px 7px!important;
    border-radius:7px!important;
    font-size:9px!important;
  }
  .sidebar .trial-badge strong{font-size:11px!important;font-weight:700!important}
  .sidebar .trial-badge small{font-size:9px!important;margin-top:0!important}

  .sidebar nav{
    padding:4px 0 10px!important;
  }
  .sidebar .nav-item{
    min-height:38px!important;
    margin:1px 0!important;
    padding-inline:10px!important;
    border-radius:9px!important;
    font-size:13px!important;
    font-weight:600!important;
  }
  .sidebar .nav-item svg{width:18px!important;height:18px!important}
  .sidebar .nav-item.active{
    background:color-mix(in srgb,var(--accent-soft) 72%,transparent)!important;
  }
  .sidebar .nav-item.active::before{
    width:2px!important;
    top:8px!important;
    bottom:8px!important;
  }

  .sidebar .theme-switcher.sidebar-theme-switcher{
    grid-row:auto!important;
    width:max-content!important;
    min-width:0!important;
    grid-template-columns:repeat(3,34px)!important;
    justify-self:start!important;
    gap:2px!important;
    margin:0 0 8px!important;
    padding:3px!important;
    border:1px solid var(--line,var(--border))!important;
    border-radius:10px!important;
    background:transparent!important;
  }
  .sidebar .theme-switcher.sidebar-theme-switcher button{
    width:34px!important;
    min-width:34px!important;
    height:32px!important;
    padding:0!important;
    border-radius:7px!important;
  }
  .sidebar .theme-switcher.sidebar-theme-switcher button svg,
  .sidebar .theme-switcher.sidebar-theme-switcher button .blc-icon{
    width:17px!important;
    height:17px!important;
  }
  .sidebar .theme-switcher.sidebar-theme-switcher button small,
  .sidebar .theme-switcher.sidebar-theme-switcher button::after{display:none!important}

  .sidebar-user-area{
    grid-row:auto!important;
    gap:2px!important;
    padding:9px 0 0!important;
    border-top:1px solid var(--line,var(--border))!important;
  }
  .sidebar-user-card{
    min-height:46px!important;
    grid-template-columns:32px minmax(0,1fr)!important;
    gap:9px!important;
    padding:5px 4px!important;
    border:0!important;
    border-radius:9px!important;
    background:transparent!important;
  }
  .sidebar-user-card .account-avatar{
    width:32px!important;
    height:32px!important;
    border-radius:9px!important;
    font-size:10px!important;
  }
  .sidebar-user-card .account-trigger-copy strong{font-size:12px!important}
  .sidebar-user-card .account-trigger-copy small{font-size:10px!important;margin-top:1px!important}

  .sidebar-logout{
    width:max-content!important;
    min-height:34px!important;
    justify-content:flex-start!important;
    gap:7px!important;
    padding:0 5px!important;
    border:0!important;
    border-radius:8px!important;
    background:transparent!important;
    color:var(--text-muted,var(--muted))!important;
    font-size:11px!important;
    font-weight:600!important;
  }
  .sidebar-logout svg{width:16px!important;height:16px!important}
  .sidebar-logout:hover{
    background:var(--card-hover,var(--surface-soft))!important;
    color:var(--red-text,#b42318)!important;
  }
}

@media(max-width:700px) and (max-height:760px){
  .sidebar .brand{min-height:46px!important;padding-bottom:8px!important}
  .sidebar .trial-badge{min-height:30px!important;margin-bottom:4px!important}
  .sidebar .nav-item{min-height:34px!important}
  .sidebar .theme-switcher.sidebar-theme-switcher{margin-bottom:5px!important}
  .sidebar-user-area{padding-top:6px!important}
  .sidebar-user-card{min-height:40px!important}
}

/* Compact professional mobile topbar */
@media(max-width:700px){
  .main{padding-top:0!important}
  .topbar{
    min-height:72px!important;
    height:auto!important;
    margin:0 0 24px!important;
    width:100%!important;
    max-width:100%!important;
    padding:10px 14px!important;
    display:grid!important;
    grid-template-columns:42px minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:10px!important;
    border-bottom:1px solid var(--line,var(--border))!important;
    background:color-mix(in srgb,var(--bg) 88%,transparent)!important;
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
    position:sticky;
    top:0;
    z-index:35;
  }
  .topbar>div:first-of-type{
    min-width:0;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:1px;
  }
  .topbar h1{
    margin:0!important;
    font-size:20px!important;
    line-height:1.15!important;
    font-weight:800!important;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .topbar p{
    display:block!important;
    margin:0!important;
    font-size:11px!important;
    line-height:1.35!important;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .top-actions{
    margin:0!important;
    display:flex!important;
    align-items:center!important;
    gap:4px!important;
  }
  .mobile-menu-btn,
  .top-actions .icon-btn,
  .top-actions .primary{
    width:38px!important;
    height:38px!important;
    min-height:38px!important;
    padding:0!important;
    border:0!important;
    border-radius:11px!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  .mobile-menu-btn:hover,
  .top-actions .icon-btn:hover,
  .top-actions .primary:hover{
    background:var(--card-hover,var(--surface-soft))!important;
    transform:none!important;
  }
  .top-actions .primary{
    color:var(--accent-text,#6d5dfc)!important;
  }
  .top-actions .primary span{display:none!important}
  .mobile-menu-btn svg,
  .top-actions svg{width:21px!important;height:21px!important}
  .notification-dot{
    width:6px!important;
    height:6px!important;
    top:7px!important;
    left:7px!important;
    border-width:1px!important;
  }
}

@media(max-width:380px){
  .topbar{grid-template-columns:38px minmax(0,1fr) auto!important;gap:6px!important;padding-inline:10px!important}
  .topbar h1{font-size:18px!important}
  .top-actions{gap:1px!important}
  .mobile-menu-btn,.top-actions .icon-btn,.top-actions .primary{width:36px!important;height:36px!important;min-height:36px!important}
}

/* Mobile topbar cleanup: remove redundant create action */
@media(max-width:700px){
  .topbar{
    min-height:78px!important;
    height:auto!important;
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:10px!important;
    padding:14px 0!important;
  }
  .topbar>div:first-of-type{
    min-width:0!important;
  }
  .topbar h1{
    font-size:21px!important;
    line-height:1.15!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .topbar p{
    display:block!important;
    margin-top:3px!important;
    font-size:12px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .top-actions{
    margin:0!important;
    display:flex!important;
    align-items:center!important;
    gap:6px!important;
  }
  #newEventBtn{
    display:none!important;
  }
  .mobile-menu-btn,.top-actions .icon-btn{
    width:38px!important;
    height:38px!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
    border-radius:10px!important;
  }
  .mobile-menu-btn svg,.top-actions .icon-btn svg{
    width:20px!important;
    height:20px!important;
  }
}


/* Dashboard focus and live insights */
.dashboard-insights{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 14px}
.insight-chip{min-width:0;min-height:58px;display:grid;grid-template-columns:9px minmax(0,1fr);align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line,var(--border));border-radius:14px;background:var(--card-bg,var(--surface));color:var(--text-strong,var(--text));text-align:right;box-shadow:var(--shadow-sm);transition:transform .18s ease,border-color .18s ease,background .18s ease}
.insight-chip:hover{transform:translateY(-1px);border-color:var(--accent-border,#cfc8ff);background:var(--card-hover,var(--surface-soft))}
.insight-chip span:last-child{min-width:0;display:flex;flex-direction:column}
.insight-chip strong,.insight-chip small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.insight-chip strong{font-size:13px;line-height:1.25}.insight-chip small{font-size:10px;color:var(--text-muted,var(--muted));margin-top:3px}
.insight-dot{width:8px;height:8px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 12%,transparent)}
.insight-dot.success{background:var(--success);box-shadow:0 0 0 4px color-mix(in srgb,var(--success) 12%,transparent)}
.insight-dot.warning{background:var(--warning);box-shadow:0 0 0 4px color-mix(in srgb,var(--warning) 12%,transparent)}
.dashboard-stats .stat{transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.dashboard-stats .stat:hover{transform:translateY(-2px);border-color:var(--accent-border,#d9d4ff);box-shadow:var(--shadow-md)}
.dashboard-stats .stat:nth-child(2){border-color:var(--accent-border,#d9d4ff);background:linear-gradient(145deg,var(--card-bg,var(--surface)),var(--accent-panel,var(--accent-soft)))}
@media(max-width:700px){
  #dashboard{padding-top:0}
  .dashboard-welcome{gap:10px!important;margin-bottom:12px!important}
  .dashboard-welcome h2{font-size:21px!important;line-height:1.2;margin-top:3px!important}
  .dashboard-welcome p{font-size:13px;line-height:1.45}
  .quick-actions{gap:8px!important}
  .quick-action{min-height:50px!important;border-radius:13px!important;padding:7px 6px!important}
  .quick-action svg{width:17px!important;height:17px!important}
  .dashboard-insights{display:flex;gap:8px;overflow-x:auto;margin:0 -14px 12px;padding:0 14px 2px;scrollbar-width:none;scroll-snap-type:x proximity}
  .dashboard-insights::-webkit-scrollbar{display:none}
  .insight-chip{flex:0 0 min(74vw,250px);min-height:54px;scroll-snap-align:start;box-shadow:none}
  .dashboard-stats{margin-top:0!important;gap:12px!important}
  .dashboard-stats .stat{min-height:132px!important;padding:16px!important}
  .dashboard-stats .stat-icon{margin-bottom:10px!important}
  .dashboard-stats .stat strong{font-size:28px!important;margin:9px 0 7px!important}
}
@media(max-width:380px){.dashboard-welcome h2{font-size:19px!important}.quick-action{font-size:10px!important}.insight-chip{flex-basis:82vw}}

/* Dashboard mobile hierarchy correction */
@media(max-width:700px){
  #dashboard{
    display:flex;
    flex-direction:column;
    gap:0;
  }
  .dashboard-welcome{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    min-height:0!important;
    height:auto!important;
    gap:14px!important;
    margin:0 0 14px!important;
  }
  .dashboard-welcome>div:first-child{
    flex:0 0 auto!important;
    min-height:0!important;
    height:auto!important;
  }
  .dashboard-welcome .eyebrow{font-size:10px!important}
  .dashboard-welcome h2{
    margin:4px 0 5px!important;
    font-size:20px!important;
    line-height:1.22!important;
  }
  .dashboard-welcome p{
    margin:0!important;
    font-size:12px!important;
    line-height:1.45!important;
  }
  .quick-actions{
    order:2;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
  }
  .quick-action{
    min-height:48px!important;
    padding:6px!important;
    border-radius:12px!important;
    box-shadow:none!important;
  }
  .dashboard-insights{
    order:initial;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:0!important;
    margin:0 0 14px!important;
    padding:4px 12px!important;
    overflow:visible!important;
    border:1px solid var(--line,var(--border));
    border-radius:14px;
    background:var(--card-bg,var(--surface));
  }
  .insight-chip{
    width:100%!important;
    min-height:43px!important;
    display:grid!important;
    grid-template-columns:8px minmax(0,1fr) auto!important;
    gap:10px!important;
    padding:8px 2px!important;
    border:0!important;
    border-bottom:1px solid var(--line,var(--border))!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    transform:none!important;
  }
  .insight-chip:last-child{border-bottom:0!important}
  .insight-chip::after{
    content:'‹';
    color:var(--text-faint,var(--muted));
    font-size:18px;
    line-height:1;
  }
  .insight-chip strong{font-size:12px!important}
  .insight-chip small{font-size:10px!important;margin-top:1px!important}
  .insight-dot{width:7px!important;height:7px!important;box-shadow:none!important}
  .dashboard-stats{margin-top:0!important}
}

/* Dashboard content-first order */
.dashboard-quick-actions{
  margin:14px 0 0;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.dashboard-quick-actions .quick-action{
  width:100%;
  justify-content:center;
}
@media(max-width:700px){
  #dashboard{
    display:flex;
    flex-direction:column;
    gap:0;
  }
  .dashboard-welcome{
    margin:0 0 10px!important;
  }
  .dashboard-welcome>div:first-child{
    flex:0 0 auto!important;
    min-height:0!important;
  }
  .dashboard-insights{
    margin-bottom:10px!important;
  }
  .dashboard-stats{
    order:3;
    margin:0!important;
  }
  .dashboard-quick-actions{
    order:4;
    margin:10px 0 0!important;
    gap:7px!important;
  }
  .dashboard-quick-actions .quick-action{
    min-height:44px!important;
    flex-direction:row!important;
    gap:6px!important;
    padding:0 8px!important;
    font-size:11px!important;
    box-shadow:none!important;
  }
  .dashboard-grid{
    order:5;
    margin-top:12px!important;
  }
  .lower-grid{
    order:6;
  }
}


/* Mobile-first separation: dashboard is overview, calculator is work */
.calculator-ai-wrap{margin-top:16px}
.calculator-ai-wrap .ai-panel{margin:0}

@media(max-width:700px){
  #dashboard .dashboard-welcome{margin-bottom:10px!important}
  #dashboard .dashboard-welcome>div:first-child{flex:0 0 auto!important;min-height:0!important}
  #dashboard .dashboard-welcome h2{font-size:20px!important;line-height:1.18!important;margin:2px 0 4px!important}
  #dashboard .dashboard-welcome p{font-size:12px!important;line-height:1.4!important;max-width:34ch}
  #dashboard .quick-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;margin-top:2px!important}
  #dashboard .quick-action{min-height:42px!important;flex-direction:row!important;justify-content:center!important;gap:7px!important;padding:6px 8px!important;font-size:11px!important;border-radius:12px!important}
  #dashboard .dashboard-insights{margin-bottom:10px!important}
  #dashboard .insight-chip{min-height:46px!important;padding:8px 10px!important}
  #dashboard .insight-chip strong{font-size:12px!important}
  #dashboard .insight-chip small{font-size:9px!important}
  #dashboard .dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  #dashboard .dashboard-stats .stat{min-height:112px!important;padding:13px!important;border-radius:16px!important}
  #dashboard .dashboard-stats .stat-icon{width:30px!important;height:30px!important;margin-bottom:8px!important;border-radius:9px!important}
  #dashboard .dashboard-stats .stat span{font-size:11px!important}
  #dashboard .dashboard-stats .stat strong{font-size:24px!important;margin:6px 0 5px!important}
  #dashboard .dashboard-stats .stat small{font-size:9px!important;line-height:1.3!important}
  #dashboard .dashboard-grid{gap:10px!important;margin-top:10px!important}
  #dashboard .revenue-panel{display:none!important}
  #dashboard .panel{padding:16px!important;border-radius:16px!important}
  #dashboard .panel-head h3{font-size:16px!important}
  #dashboard .task-row{padding:10px 0!important}
  #dashboard .event-item{grid-template-columns:44px minmax(0,1fr) auto!important;gap:9px!important;padding:11px 0!important}
  #dashboard .event-item time{width:42px!important;height:42px!important}
  #calculator .page-title{margin-bottom:14px!important}
  #calculator .page-title h2{font-size:22px!important}
  #calculator .page-title p{font-size:12px!important;line-height:1.4!important}
  #calculator .calc-layout{gap:12px!important}
  #calculator .form-card,#calculator .result-card{padding:16px!important;border-radius:16px!important}
  #calculator .field-grid{gap:10px!important}
  #calculator .calculator-ai-wrap{margin-top:12px}
  #calculator .calculator-ai-wrap .ai-panel{padding:16px!important;border-radius:16px!important}
  #calculator .ai-composer textarea{min-height:76px!important}
}


/* Hard page isolation */
.page[hidden],.page[aria-hidden="true"]{display:none!important}
.page.active-page:not([hidden]){display:block!important}

/* Dashboard professional layout */
#dashboard{max-width:1500px;margin-inline:auto}
.dashboard-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:22px}
.dashboard-head h2{margin:4px 0 5px;font-size:30px;line-height:1.15;letter-spacing:-.5px}
.dashboard-head p{margin:0;color:var(--text-muted,var(--muted));font-size:14px}
.dashboard-primary-action{flex:0 0 auto}
.dashboard-attention{margin-bottom:18px}
.dashboard-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:11px}
.dashboard-section-head h3{margin:3px 0 0;font-size:18px}
.dashboard-section-head>small{color:var(--text-muted,var(--muted));font-size:11px}
.attention-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.attention-card{width:100%;min-width:0;display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:12px;padding:15px;border:1px solid var(--line,var(--border));border-radius:16px;background:var(--card-bg,var(--surface));color:var(--text-strong,var(--text));text-align:right;box-shadow:var(--shadow-sm);transition:.18s}
.attention-card:hover{transform:translateY(-1px);border-color:var(--accent-border,#d9d4ff);box-shadow:var(--shadow-md)}
.attention-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:12px;background:var(--accent-panel,var(--accent-soft));color:var(--accent);font-size:18px;font-weight:800}
.attention-payments .attention-icon{background:var(--success-soft);color:var(--success)}
.attention-stock .attention-icon{background:var(--warning-soft);color:var(--warning)}
.attention-card>span:nth-child(2){min-width:0;display:grid;grid-template-columns:auto 1fr;column-gap:8px;align-items:baseline}
.attention-card strong{font-size:21px;line-height:1}
.attention-card b{font-size:13px}
.attention-card small{grid-column:1/-1;color:var(--text-muted,var(--muted));font-size:10px;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attention-card>i{font-style:normal;color:var(--text-muted,var(--muted));font-size:17px}
#dashboard .dashboard-stats{margin:0 0 16px;grid-template-columns:repeat(4,minmax(0,1fr))}
#dashboard .dashboard-stats .stat{min-height:132px;padding:17px}
#dashboard .dashboard-stats .stat strong{font-size:27px;margin:8px 0 6px}
#dashboard .dashboard-stats .stat small{color:var(--text-muted,var(--muted));font-size:10px}
.dashboard-main-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(310px,.55fr);gap:16px;align-items:start}
.dashboard-side-column{display:grid;gap:16px}
.dashboard-upcoming,.dashboard-finance,.dashboard-actions-panel{padding:20px}
.dashboard-upcoming .event-list{margin-top:9px}
.dashboard-event-row{width:100%;display:grid;grid-template-columns:52px minmax(0,1fr) auto 18px;align-items:center;gap:12px;padding:13px 0;border:0;border-bottom:1px solid var(--line,var(--border));background:transparent;color:var(--text-strong,var(--text));text-align:right}
.dashboard-event-row:last-child{border-bottom:0}
.dashboard-event-row:hover>span strong{color:var(--accent)}
.dashboard-event-row time{width:48px;height:48px;border-radius:12px;background:var(--accent-panel,var(--accent-soft));color:var(--accent);display:grid;place-items:center;font-size:10px;line-height:1}
.dashboard-event-row time b{display:block;font-size:18px}
.dashboard-event-row>span{min-width:0}
.dashboard-event-row>span strong,.dashboard-event-row>span small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dashboard-event-row>span strong{font-size:13px}
.dashboard-event-row>span small{margin-top:3px;color:var(--text-muted,var(--muted));font-size:10px}
.dashboard-event-row>i{font-style:normal;color:var(--text-muted,var(--muted))}
.finance-lines{display:grid;margin-top:12px}
.finance-lines>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 0;border-bottom:1px solid var(--line,var(--border))}
.finance-lines>div:last-child{border-bottom:0}
.finance-lines span{color:var(--text-muted,var(--muted));font-size:11px}
.finance-lines strong{font-size:17px}
.finance-lines .finance-total{margin-top:4px;padding:14px 12px;border:0;border-radius:12px;background:var(--accent-panel,var(--accent-soft))}
.finance-total strong{color:var(--accent)}
.dashboard-action-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:13px}
#dashboard .dashboard-action-grid .quick-action{min-height:62px;justify-content:center;flex-direction:column;padding:9px;font-size:10px;border-radius:12px}
.dashboard-empty{display:grid;place-items:center;text-align:center;min-height:210px;padding:24px;border:1px dashed var(--line,var(--border));border-radius:14px;background:var(--card-muted,var(--surface-soft))}
.dashboard-empty strong{font-size:15px}
.dashboard-empty span{color:var(--text-muted,var(--muted));font-size:11px;margin-top:-28px}
.dashboard-empty button{margin-top:-26px}

@media(max-width:1000px){
  .attention-grid{grid-template-columns:1fr 1fr}
  .attention-card:last-child{grid-column:1/-1}
  #dashboard .dashboard-stats{grid-template-columns:1fr 1fr!important}
  .dashboard-main-grid{grid-template-columns:1fr}
  .dashboard-side-column{grid-template-columns:1fr 1fr}
}
@media(max-width:700px){
  #dashboard{display:flex;flex-direction:column;padding-top:0!important}
  .dashboard-head{order:1;align-items:flex-start;margin-bottom:14px}
  .dashboard-head h2{font-size:22px;margin-top:2px}
  .dashboard-head p{font-size:11px;line-height:1.4;max-width:29ch}
  .dashboard-primary-action{min-width:44px;width:44px;height:44px;padding:0;border-radius:13px}
  .dashboard-primary-action span{display:none}
  .dashboard-attention{order:2;margin-bottom:13px}
  .dashboard-section-head{margin-bottom:8px}
  .dashboard-section-head h3{font-size:15px}
  .dashboard-section-head>small{font-size:9px}
  .attention-grid{display:flex;overflow-x:auto;gap:8px;margin-inline:-12px;padding:0 12px 3px;scroll-snap-type:x mandatory;scrollbar-width:none}
  .attention-grid::-webkit-scrollbar{display:none}
  .attention-card,.attention-card:last-child{grid-column:auto;flex:0 0 82vw;scroll-snap-align:start;padding:12px;grid-template-columns:38px minmax(0,1fr) auto}
  .attention-icon{width:38px;height:38px}
  .attention-card strong{font-size:18px}
  .attention-card b{font-size:11px}
  .attention-card small{font-size:9px}
  #dashboard .dashboard-stats{order:3;grid-template-columns:1fr 1fr!important;gap:9px!important;margin-bottom:12px}
  #dashboard .dashboard-stats .stat{min-height:106px!important;padding:12px!important}
  #dashboard .dashboard-stats .stat-icon{width:29px!important;height:29px!important;margin-bottom:7px!important}
  #dashboard .dashboard-stats .stat span{font-size:10px!important}
  #dashboard .dashboard-stats .stat strong{font-size:21px!important;margin:5px 0 4px!important}
  #dashboard .dashboard-stats .stat small{font-size:8px!important;line-height:1.25!important}
  .dashboard-main-grid{order:4;display:contents}
  .dashboard-upcoming{order:4;padding:15px!important;border-radius:16px!important}
  .dashboard-side-column{display:contents}
  .dashboard-finance{order:5;padding:15px!important;border-radius:16px!important}
  .dashboard-actions-panel{order:6;padding:15px!important;border-radius:16px!important}
  .dashboard-event-row{grid-template-columns:44px minmax(0,1fr) auto;gap:9px;padding:11px 0}
  .dashboard-event-row time{width:42px;height:42px}
  .dashboard-event-row>i{display:none}
  .dashboard-event-row .status{font-size:8px;padding:5px 7px}
  .dashboard-event-row>span small{font-size:9px}
  .dashboard-action-grid{grid-template-columns:1fr 1fr}
  #dashboard .dashboard-action-grid .quick-action{min-height:48px!important;flex-direction:row!important;font-size:9px!important}
  .dashboard-empty{min-height:170px}
}

/* Touch UX: hover belongs to mouse/trackpad only. */
@media (hover:none), (pointer:coarse){
  .quick-action:hover,
  .attention-card:hover,
  .insight-chip:hover,
  .dashboard-stats .stat:hover,
  .data-card:hover,
  .data-list .data-card:hover,
  .table-surface .data-card:hover,
  .dashboard-event-row:hover,
  .primary:hover,
  .secondary:hover,
  .icon-btn:hover,
  .mobile-menu-btn:hover,
  .trial-badge:hover,
  .nav-item:hover{
    transform:none!important;
    box-shadow:var(--shadow-sm)!important;
  }
  .quick-action:hover,
  .attention-card:hover,
  .insight-chip:hover,
  .dashboard-stats .stat:hover{
    border-color:var(--line,var(--border))!important;
    background:var(--card-bg,var(--surface))!important;
    color:var(--text-strong,var(--text))!important;
  }
  .dashboard-event-row:hover>span strong{color:inherit!important}
}

/* Unified business-page architecture */
.workspace-page{display:none}
.workspace-page.active-page{display:block}
.workspace-header{align-items:center;margin-bottom:14px;padding:2px 0}
.workspace-header>div:first-child{max-width:760px}
.workspace-overview{display:grid;grid-template-columns:minmax(260px,.72fr) minmax(0,1.28fr);gap:16px;align-items:stretch;margin-bottom:18px}
.workspace-intro{padding:20px 22px;border:1px solid var(--line,var(--border));border-radius:18px;background:linear-gradient(145deg,var(--card-bg,var(--surface)),var(--accent-panel,var(--accent-soft)));box-shadow:var(--shadow-sm)}
.workspace-intro h3{margin:5px 0 6px;font-size:20px;line-height:1.25}
.workspace-intro p{margin:0;color:var(--text-muted,var(--muted));font-size:13px;line-height:1.55}
.workspace-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.workspace-metrics article{min-width:0;padding:16px;border:1px solid var(--line,var(--border));border-radius:16px;background:var(--card-bg,var(--surface));box-shadow:var(--shadow-sm)}
.workspace-metrics span{display:block;color:var(--text-muted,var(--muted));font-size:11px;font-weight:700}
.workspace-metrics strong{display:block;margin-top:7px;font-size:21px;line-height:1.15;overflow-wrap:anywhere}
.workspace-page>.toolbar{padding:10px 12px;border:1px solid var(--line,var(--border));border-radius:14px;background:var(--card-bg,var(--surface));margin:0 0 14px}
.workspace-page>.data-list,.workspace-page>.calendar-grid,.workspace-page>.panel,.workspace-page>.calc-layout{margin-top:0}
#settings.workspace-page #settingsForm{max-width:none}
@media(max-width:1000px){.workspace-overview{grid-template-columns:1fr}.workspace-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){
 .workspace-header{margin-bottom:10px!important}.workspace-header h2{font-size:22px!important}.workspace-header p{font-size:12px!important}
 .workspace-overview{gap:10px;margin-bottom:12px}.workspace-intro{padding:15px;border-radius:16px}.workspace-intro h3{font-size:17px}.workspace-intro p{font-size:11px;line-height:1.45}
 .workspace-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.workspace-metrics article{padding:12px;min-height:78px}.workspace-metrics span{font-size:9px}.workspace-metrics strong{font-size:18px}
 .workspace-page>.toolbar{padding:8px;margin-bottom:10px}.workspace-page>.toolbar input,.workspace-page>.toolbar select{max-width:none;width:100%}
 #calendar .workspace-overview{margin-bottom:10px}#calendar .calendar-grid{border-radius:14px}
}

/* Topbar home shortcut */
.topbar-home{min-width:0;padding:0;border:0;background:transparent;color:inherit;text-align:right;border-radius:10px;cursor:pointer}
.topbar-home h1,.topbar-home p{pointer-events:none}
.topbar-home:focus-visible{outline:3px solid color-mix(in srgb,var(--accent) 24%,transparent);outline-offset:5px}
@media(hover:hover) and (pointer:fine){.topbar-home:hover h1{color:var(--accent-text,var(--accent))}}
@media(hover:none),(pointer:coarse){.topbar-home:hover{background:transparent!important}.topbar-home:active{opacity:.72}}

/* Mobile topbar action icons: keep search and notifications aligned */
@media(max-width:700px){
  .topbar .top-actions{
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    justify-content:flex-start!important;
    justify-self:start!important;
    align-self:center!important;
    width:max-content!important;
    min-width:max-content!important;
    gap:4px!important;
  }
  .topbar .global-search-trigger,
  .topbar .notification-trigger{
    position:relative!important;
    inset:auto!important;
    flex:0 0 38px!important;
    display:inline-grid!important;
    place-items:center!important;
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    min-height:38px!important;
    margin:0!important;
    padding:0!important;
    vertical-align:middle!important;
  }
  .topbar .global-search-trigger svg,
  .topbar .notification-trigger svg{
    display:block!important;
    width:21px!important;
    height:21px!important;
    margin:0!important;
  }
}

/* Unified card spacing system */
:root{
  --card-gap-mobile:12px;
  --section-gap-mobile:16px;
  --card-gap-desktop:16px;
  --section-gap-desktop:20px;
}

/* Dashboard: cards and sections must read as separate surfaces. */
#dashboard .dashboard-stats{gap:var(--card-gap-desktop)!important}
#dashboard .attention-grid{gap:var(--card-gap-desktop)!important}
#dashboard .dashboard-main-grid{gap:var(--card-gap-desktop)!important}
#dashboard .dashboard-side-column{gap:var(--card-gap-desktop)!important}
#dashboard .dashboard-action-grid{gap:12px!important}
#dashboard .dashboard-attention{margin-bottom:var(--section-gap-desktop)!important}
#dashboard .dashboard-stats{margin-bottom:var(--section-gap-desktop)!important}

/* Shared business pages. */
.workspace-page .workspace-overview{gap:var(--card-gap-desktop)!important;margin-bottom:var(--section-gap-desktop)!important}
.workspace-page .workspace-metrics{gap:12px!important}
.workspace-page>.toolbar{margin-bottom:var(--card-gap-desktop)!important}
.workspace-page>.inventory-grid,
.workspace-page>.data-grid{gap:var(--card-gap-desktop)!important}
#calculator .calc-layout{gap:var(--card-gap-desktop)!important}
#calculator .calculator-ai-wrap{margin-top:var(--section-gap-desktop)!important}
#calculator .field-grid{gap:14px!important}
#payments .inventory-summary{gap:12px!important;margin-block:var(--card-gap-desktop)!important}
#settings .form-card{margin-top:0}

@media(max-width:700px){
  :root{
    --card-gap-mobile:12px;
    --section-gap-mobile:16px;
  }

  /* Dashboard spacing after display:contents reordering. */
  #dashboard .dashboard-attention{margin-bottom:var(--section-gap-mobile)!important}
  #dashboard .attention-grid{gap:var(--card-gap-mobile)!important;padding-bottom:4px!important}
  #dashboard .dashboard-stats{gap:var(--card-gap-mobile)!important;margin-bottom:var(--section-gap-mobile)!important}
  #dashboard .dashboard-upcoming,
  #dashboard .dashboard-finance,
  #dashboard .dashboard-actions-panel{
    margin:0 0 var(--section-gap-mobile)!important;
  }
  #dashboard .dashboard-actions-panel{margin-bottom:0!important}
  #dashboard .dashboard-action-grid{gap:var(--card-gap-mobile)!important}

  /* All other pages use the same visual rhythm. */
  .workspace-page .workspace-overview{gap:var(--card-gap-mobile)!important;margin-bottom:var(--section-gap-mobile)!important}
  .workspace-page .workspace-metrics{gap:var(--card-gap-mobile)!important}
  .workspace-page>.toolbar{margin-bottom:var(--card-gap-mobile)!important}
  .workspace-page>.inventory-grid,
  .workspace-page>.data-grid{gap:var(--card-gap-mobile)!important}
  #calculator .calc-layout{gap:var(--section-gap-mobile)!important}
  #calculator .calculator-ai-wrap{margin-top:var(--section-gap-mobile)!important}
  #calculator .field-grid{gap:var(--card-gap-mobile)!important}
  #payments .inventory-summary{gap:var(--card-gap-mobile)!important;margin-block:var(--section-gap-mobile)!important}
  .reservation-columns{gap:var(--card-gap-mobile)!important}

  /* Keep grouped table/list rows connected by design. */
  .data-list,.table-surface{margin-bottom:var(--section-gap-mobile)}
  .data-list .data-card,.table-surface .data-card{margin:0!important}
}


/* Smart calculator v2 */
#calculator{max-width:1500px;margin-inline:auto;padding-bottom:96px}
.calculator-header{margin-bottom:14px!important}
.calculator-mode-switch{width:max-content;max-width:100%;display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;margin-bottom:16px;border:1px solid var(--line,var(--border));border-radius:14px;background:var(--card-muted,var(--surface-soft))}
.calculator-mode{min-height:40px;padding:0 16px;border:0;border-radius:10px;background:transparent;color:var(--text-muted,var(--muted));font-weight:800}
.calculator-mode.active{background:var(--card-bg,var(--surface));color:var(--accent);box-shadow:var(--shadow-sm)}
.calculator-ai-panel{margin-bottom:16px}
.calculator-workspace{grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr)!important;align-items:start}
.calculator-form{display:grid;gap:16px;min-width:0}
.calc-step{margin:0;padding:20px 22px!important}
.calc-step legend{width:100%;display:flex;align-items:center;gap:11px;padding:0 0 15px;margin-bottom:2px;border-bottom:1px solid var(--line,var(--border))}
.calc-step legend>span{width:32px;height:32px;display:grid;place-items:center;border-radius:10px;background:var(--accent-panel,var(--accent-soft));color:var(--accent);font-weight:900}
.calc-step legend div{display:flex;flex-direction:column}.calc-step legend strong{font-size:15px}.calc-step legend small{color:var(--text-muted,var(--muted));font-size:10px;margin-top:2px}
.calc-step .field-grid{margin:17px 0 0;grid-template-columns:repeat(2,minmax(0,1fr))}
.calc-step:first-child .field-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.input-with-unit{position:relative}.input-with-unit input{padding-left:58px}.input-with-unit span{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--text-muted,var(--muted));font-size:11px;pointer-events:none}
.field-help{display:block;margin-top:5px;color:var(--text-muted,var(--muted));font-size:9px;font-weight:500}
.conditional-hidden{display:none!important}
#calculator .addons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:18px 0 0}
#calculator .addons>span{grid-column:1/-1}
#calculator .addons label{position:relative;min-height:64px;display:grid;grid-template-columns:auto 1fr;align-items:center;column-gap:8px;padding:10px!important}
#calculator .addons label:has(input:checked){border-color:var(--accent-border,#d9d4ff);background:var(--accent-panel,var(--accent-soft))!important;color:var(--accent)}
#calculator .addons b{font-size:12px}#calculator .addons small{grid-column:2;color:var(--text-muted,var(--muted));font-size:9px}
.calculator-submit{min-height:48px}
.calculator-result{top:16px!important;padding:22px!important}
.result-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.result-heading h3{margin:4px 0 0}
.live-price-badge{padding:5px 8px;border-radius:999px;background:var(--green-panel,var(--success-soft));color:var(--green-text,var(--success));font-size:9px;font-weight:800;white-space:nowrap}
.recommended-result{margin-top:15px;padding:20px;border:1px solid var(--accent-border,#d9d4ff);border-radius:16px;background:linear-gradient(145deg,var(--accent-panel,var(--accent-soft)),var(--card-bg,var(--surface)));text-align:center}
.recommended-result span,.recommended-result small{display:block;color:var(--text-muted,var(--muted))}.recommended-result span{font-size:11px;font-weight:700}.recommended-result strong{display:block;margin:8px 0 5px;color:var(--accent);font-size:38px;line-height:1}.recommended-result small{font-size:9px}
.secondary-prices{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:10px}.secondary-prices>div{padding:12px;border:1px solid var(--line,var(--border));border-radius:12px;background:var(--card-muted,var(--surface-soft))}.secondary-prices span,.secondary-prices small{display:block;color:var(--text-muted,var(--muted));font-size:9px}.secondary-prices strong{display:block;margin:4px 0;font-size:17px}
.cost-breakdown-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;margin-top:14px;padding:11px 2px;border:0;border-bottom:1px solid var(--line,var(--border));background:transparent;color:var(--text-strong,var(--text));font-weight:800}.cost-breakdown-toggle b{font-size:18px}
.cost-breakdown{display:grid}.cost-breakdown.collapsed{display:none}.cost-breakdown>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 2px;border-bottom:1px solid var(--line,var(--border));font-size:11px}.cost-breakdown>div:last-child{border-bottom:0}.cost-breakdown span{color:var(--text-muted,var(--muted))}.cost-breakdown .profit{padding:13px 10px;margin-top:5px;border:0;border-radius:11px;background:var(--accent-panel,var(--accent-soft))}
.result-actions{display:grid;gap:8px;margin-top:13px}.save-as-quote{margin-top:0!important}
.mobile-calc-bar{display:none}
@media(max-width:1000px){.calculator-workspace{grid-template-columns:1fr!important}.calculator-result{position:static!important}.calc-step:first-child .field-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){
 #calculator{padding-bottom:92px}.calculator-header h2{font-size:22px!important}.calculator-header p{font-size:11px!important}
 .calculator-mode-switch{width:100%;margin-bottom:12px}.calculator-mode{padding:0 8px;font-size:11px}
 .calculator-ai-panel{padding:15px!important;margin-bottom:12px}.calculator-ai-panel .panel-head h3{font-size:16px}.calculator-ai-panel .panel-copy{font-size:11px}
 .calculator-form{gap:12px}.calc-step{padding:15px!important;border-radius:16px!important}.calc-step legend{padding-bottom:12px}.calc-step legend>span{width:29px;height:29px}.calc-step legend strong{font-size:14px}
 .calc-step .field-grid,.calc-step:first-child .field-grid{grid-template-columns:1fr;gap:10px;margin-top:13px}
 #calculator .addons{grid-template-columns:1fr 1fr;gap:8px;margin-top:14px}#calculator .addons label{min-height:56px}
 .calculator-submit{display:none}.calculator-result{padding:16px!important;border-radius:16px!important}.recommended-result strong{font-size:34px}.secondary-prices{gap:7px}.secondary-prices>div{padding:10px}.secondary-prices strong{font-size:15px}
 .live-price-badge{display:none}.result-heading h3{font-size:17px}
 .mobile-calc-bar{position:fixed;right:0;left:0;bottom:0;z-index:900;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--line,var(--border));background:color-mix(in srgb,var(--card-bg,var(--surface)) 94%,transparent);backdrop-filter:blur(18px);box-shadow:0 -10px 30px rgba(15,23,42,.1)}
 .mobile-calc-bar div{display:flex;flex-direction:column}.mobile-calc-bar span{color:var(--text-muted,var(--muted));font-size:9px}.mobile-calc-bar strong{font-size:18px}.mobile-calc-bar .primary{min-height:42px;padding-inline:16px}
}

/* Dashboard-aligned application pages */
@media(min-width:1001px){
  /* The fixed top bar is the single page heading, exactly like the dashboard. */
  .app-shell:not(.auth-locked) .topbar-breadcrumb{
    display:none!important;
  }

  .app-shell:not(.auth-locked) .main>.page.active-page:not(#dashboard){
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:18px clamp(18px,2vw,34px) 28px!important;
  }

  .app-shell:not(.auth-locked) .page.active-page:not(#dashboard)>.page-title,
  .app-shell:not(.auth-locked) .page.active-page:not(#dashboard)>.workspace-header{
    display:none!important;
  }

  /* Inventory actions remain available after its duplicate title is removed. */
  .app-shell:not(.auth-locked) .page#inventory.active-page>.page-title.inventory-title{
    min-height:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:10px!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  .app-shell:not(.auth-locked) #inventory .inventory-title>.inventory-heading{
    display:none!important;
  }
  .app-shell:not(.auth-locked) #inventory .inventory-title>.inventory-actions{
    width:100%!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    flex-wrap:wrap!important;
    gap:8px!important;
    margin:0!important;
  }
}

/* === 04/08 calculator mobile polish (QA round, CSS-only) === */
@media(max-width:700px){
 .app-shell>.main{padding-inline:12px!important}
 #calculator .calc-layout{display:flex!important;flex-direction:column!important}
 #calculator .calc-layout>*{width:100%!important;max-width:none!important}
 #calculator .calc-step{padding:12px!important}
 #calculator .calc-step legend{display:flex;align-items:flex-start;gap:10px;float:none;width:100%;padding:0 0 10px;margin:0;position:static}
 #calculator .calc-step legend>span{flex:0 0 26px;width:26px;height:26px}
 #calculator .calc-step legend strong{font-size:15px}
 #calculator .calc-step legend small{display:block;font-size:12px;line-height:1.45;color:var(--muted);white-space:normal}
 #calculator .calculator-header h2{font-size:24px!important}
 #calculator .calculator-header p{font-size:12px!important;line-height:1.5!important}
 #calculator *:has(>strong[id^="calcMetric"])>span{font-size:12px!important;letter-spacing:0!important}
 #calculator strong[id^="calcMetric"]{font-size:18px!important}
 #calculatorAddItem,#calculatorEmptyAddItem{display:flex;width:100%;min-height:44px;padding:10px 14px;justify-content:center;align-items:center;gap:8px;min-width:0}
 #calculatorAddItem span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 #calculator .calculator-item-price{display:flex;align-items:center;gap:8px;width:100%;min-width:0}
 #calculator .calculator-item-unit-price{flex:1 1 auto;min-width:0;width:auto}
 #calculator .calculator-quantity-control{display:flex;align-items:center;gap:6px}
 #calculator .calculator-quantity-control button{width:44px;min-height:44px}
 #calculator .calculator-item-quantity{height:44px;width:56px;text-align:center}
 #calculator .calculator-items-table-wrap td{padding-block:6px}
 #calculator .calculator-item-remove{width:38px;height:38px}
 .calculator-mode-switch{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px}
 .calculator-mode{min-height:44px;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #calculator .addons label{display:flex;align-items:center;gap:10px;padding:12px;min-height:52px}
 #calculator .addons .addon{width:20px;height:20px;flex:0 0 20px;margin:0}
 #calculator .addons b{font-size:14px;font-weight:600;min-width:0}
 #calculator .addons small{margin-inline-start:auto;font-size:12px;font-weight:600;white-space:nowrap}
 #calculator .field-help,#calculator .panel-copy{font-size:12px!important}
 #calculator{padding-bottom:132px}
 #calculator input,#calculator select{scroll-margin-bottom:150px}
 .mobile-calc-bar>div:first-child{flex-direction:row;align-items:baseline;gap:6px}
 .mobile-calc-bar span{font-size:11px}
 .mobile-calc-bar strong{font-size:16px}
 .mobile-calc-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;flex:1;margin-inline-start:12px}
 .mobile-calc-actions .primary,.mobile-calc-actions .secondary{min-height:44px;width:100%;padding-inline:10px}
 #calculator .calculator-result strong,#calculator .cost-breakdown strong{font-variant-numeric:tabular-nums}
}

/* 04/08 polish addendum: stepper width guard + result-card type floor */
@media(max-width:700px){
 #calculator .calculator-quantity-control button{flex:0 0 44px;width:44px!important;min-height:44px!important}
 #calculator .secondary-prices span,#calculator .secondary-prices small,#calculator #recommendedPriceBasis,#calculator #profitMargin small{font-size:11px!important;line-height:1.4!important}
 .mobile-calc-bar{align-items:center}
}

/* 04/08 polish addendum 2: last sub-11px stragglers */
@media(max-width:700px){
 #calculator #profitMargin,#calculator #calculatorSaveState small,.mobile-calc-bar span{font-size:11px!important;line-height:1.4!important}
}

/* 04/08 mobile compaction: page length (owner: too long) */
@media(max-width:700px){
 #calculator .calculator-form{gap:10px}
 #calculator .calc-step legend{padding-bottom:8px}
 #calculator .calc-step .field-grid{grid-template-columns:1fr 1fr!important;gap:8px!important;margin-top:8px!important}
 #calculator .calc-step .field-grid>label{grid-column:1/-1;min-width:0}
 #calculator .calc-step .field-grid>label:has(#calculatorEventDate),
 #calculator .calc-step .field-grid>label:has(#calculatorGuestCount),
 #calculator .calc-step .field-grid>label:has(#hours),
 #calculator .calc-step .field-grid>label:has(#workers),
 #calculator .calc-step .field-grid>label:has(#ceiling),
 #calculator .calc-step .field-grid>label:has(#distance),
 #calculator .calc-step .field-grid>label:has(#calculatorDiscountValue),
 #calculator .calc-step .field-grid>label:has(#calculatorDiscountReason),
 #calculator .calc-step .field-grid>label:has(#calculatorExtraCharge),
 #calculator .calc-step .field-grid>label:has(#calculatorVatPercent){grid-column:auto}
 #calculator *:has(>strong[id^="calcMetric"]){min-height:64px}
 #calculator .addons label{min-height:48px;padding:10px}
 #calculator .calculator-items-table-wrap table,#calculator .calculator-items-table-wrap tbody{display:block;width:100%}
 #calculator .calculator-items-table-wrap thead{display:none}
 #calculator .calculator-items-table-wrap tr{display:grid;grid-template-columns:1fr 1.2fr;gap:6px 8px;position:relative;padding:10px 0 12px;border-bottom:1px solid var(--border)}
 #calculator .calculator-items-table-wrap tr:last-child{border-bottom:0}
 #calculator .calculator-items-table-wrap td{display:block;width:100%!important;padding:0!important;border:0!important}
 #calculator .calculator-items-table-wrap td:nth-child(1),#calculator .calculator-items-table-wrap td:nth-child(4){grid-column:1/-1}
 #calculator .calculator-items-table-wrap td:nth-child(5){position:absolute;top:10px;inset-inline-end:0;width:auto!important}
 #calculator .calculator-item-remove{width:34px;height:34px}
}

/* 04/08 compaction addendum: pair date+guests (push location last), tighter labels */
@media(max-width:700px){
 #calculator .calculator-event-grid>label:has(#calculatorEventLocation){order:1}
 #calculator .calc-step .field-grid>label{font-size:12px;gap:5px}
}

/* 04/08 round2: mobile icon stroke fix, legend breathing room, flat price field */
@media(max-width:700px){
 #calculator .calculator-item-icon svg,#calculator .calculator-item-remove svg{fill:none!important;stroke:currentColor!important;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;width:18px;height:18px}
 #calculator .calc-step legend{padding-top:10px}
 #calculator .calculator-item-price{border:0!important;background:transparent!important;padding:0!important}
 #calculator .calculator-item-price>span{color:var(--muted);font-size:13px}
}

/* 04/08 round3: add-item svg sizing (was 244px tall box), reserve corner space for delete btn */
@media(max-width:700px){
 #calculatorAddItem svg,#calculatorEmptyAddItem svg{width:18px;height:18px;flex:0 0 18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
 #calculatorAddItem{min-height:44px;height:auto}
 #calculator .calculator-items-table-wrap td:nth-child(1){padding-inline-end:44px!important}
}

/* 04/08 collapsible steps 3-6 on mobile (council option A) */
@media(max-width:700px){
 #calculator .calc-step.calc-step-collapsed>*:not(legend){visibility:hidden;transition:visibility 0s .28s}
 #calculator .calc-step legend[role="button"]{cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;padding-inline-end:26px}
 #calculator .calc-step legend[role="button"]::after{content:"";position:absolute;inset-inline-end:6px;top:14px;width:9px;height:9px;border-inline-end:2px solid var(--muted);border-block-end:2px solid var(--muted);transform:rotate(45deg);transition:transform .18s ease}
 #calculator .calc-step.calc-step-collapsed legend[role="button"]::after{transform:rotate(-45deg);top:18px}
 #calculator .calc-step.calc-step-collapsed{padding-bottom:8px!important}
 #calculator .calc-step.calc-step-collapsed legend{padding-bottom:0}
}

/* 04/08 accordion motion: smooth height animation (interpolate-size), collapsed shows title bar only */
@media(max-width:700px){
 #calculator .calc-step{interpolate-size:allow-keywords;transition:height .28s cubic-bezier(.4,0,.2,1)}
 #calculator .calc-step.calc-step-collapsed{height:54px;overflow:hidden;padding-bottom:8px!important}
 #calculator .calc-step.calc-step-collapsed legend small{display:none}
}

/* 04/08 concept v1: context strip, single-row item controls, CTA hierarchy, slim bar */
@media(max-width:700px){
 #calculator .workspace-overview{display:none!important}
 #calcContextStrip{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:12px 0 0;background:#fff;border:1px solid var(--border,#e7e9f4);border-radius:14px;padding:10px 12px;font-size:12.5px;color:var(--muted,#7a7f96)}
 #calcContextStrip b{color:#1c1d2b;font-weight:700}
 #calcContextStrip .dot{color:#c9cde0}
 html[data-theme="dark"] #calcContextStrip{background:var(--card,#1e1f2e);color:var(--muted)}
 html[data-theme="dark"] #calcContextStrip b{color:var(--ink,#eef0fa)}
 #calculator .calculator-items-table-wrap tr{grid-template-columns:auto 1fr auto;align-items:center}
 #calculator .calculator-items-table-wrap td:nth-child(2),#calculator .calculator-items-table-wrap td:nth-child(3){grid-column:auto}
 #calculator .calculator-items-table-wrap td:nth-child(3){min-width:0}
 #calculator .calculator-items-table-wrap td:nth-child(4){grid-column:auto;display:flex;align-items:baseline;gap:6px;white-space:nowrap;justify-content:flex-end}
 #calculator .calculator-items-table-wrap td:nth-child(2)>*:not(.calculator-quantity-control){display:none}
 #calculator .calculator-items-table-wrap td:nth-child(3)>*:not(.calculator-item-price){display:none}
 #calculator .calculator-item-remove{background:transparent!important;border:none!important;box-shadow:none!important;color:#b8bdd2!important;width:34px;height:34px}
 #calculator .calc-step .step-live-sum{display:none;font-size:12px;color:var(--muted);margin-top:2px;line-height:1.4}
 #calculator .calc-step.calc-step-collapsed .step-live-sum{display:block}
 #calculator .calc-step legend>span.step-done{background:#e9f8f0!important;color:#1f9d61!important}
 #calculator .calculator-result-actions{display:flex;flex-direction:column;gap:10px}
 #calculatorSendQuoteBtn{order:-1;min-height:48px;border-radius:14px;background:linear-gradient(120deg,#7668ef,#5b8def)!important;border:none!important;color:#fff!important;font-weight:700;box-shadow:0 6px 18px rgba(118,104,239,.28)}
 #calculatorSaveQuoteBtn{min-height:44px}
 #calculatorSaveDraftBtn{background:transparent!important;border:none!important;box-shadow:none!important;color:var(--muted,#7a7f96)!important;text-decoration:underline;text-underline-offset:3px;min-height:38px;font-size:13.5px}
 #mobileCalcBar #mobileSaveQuoteBtn{display:none}
 .mobile-calc-actions{display:flex!important;flex:0 0 auto;margin-inline-start:auto;gap:0}
 #mobileCalculateBtn{min-height:44px;padding:0 22px;border-radius:12px;width:auto}
 .mobile-calc-bar strong{font-size:19px}
 .mobile-calc-bar span{font-size:10.5px}
}

/* 04/08 concept v1 fixpass: td pseudo-labels off in control row, price input flex guard */
@media(max-width:700px){
 #calculator .calculator-items-table-wrap td:nth-child(2)::before,#calculator .calculator-items-table-wrap td:nth-child(3)::before,#calculator .calculator-items-table-wrap td:nth-child(4)::before{content:none!important;display:none!important}
 #calculator .calculator-item-unit-price{width:auto!important;flex:1 1 70px!important;min-width:56px!important}
 #calculator .calculator-items-table-wrap tr{gap:8px 10px;padding-inline:2px}
}

/* concept v1: draft link last */
@media(max-width:700px){ #calculatorSaveDraftBtn{order:1} }

/* 04/08 device-truth fixpass: slim bar, fitted collapsed bars, unified stepper+price, profit green, banner dot, kill zero-noise */
@media(max-width:700px){
 .mobile-calc-bar{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;gap:12px;padding:10px 14px!important}
 .mobile-calc-bar>div:first-child{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:1px!important;flex:1;min-width:0}
 .mobile-calc-bar>div:first-child span{font-size:10.5px!important;white-space:nowrap}
 .mobile-calc-bar>div:first-child strong{font-size:19px!important;line-height:1.15}
 .mobile-calc-actions{flex:0 0 auto!important;margin-inline-start:auto!important}
 #calculator .calc-step.calc-step-collapsed legend{border-bottom:0!important;box-shadow:none!important;margin-bottom:0!important}
 #calculator .calc-step.calc-step-collapsed{padding-bottom:10px!important}
 #calculator .calculator-quantity-control{border:1px solid var(--border,#e7e9f4);border-radius:12px;overflow:hidden;background:#fff;gap:0!important}
 #calculator .calculator-quantity-control button{border:none!important;background:transparent!important;box-shadow:none!important;flex:0 0 40px!important;width:40px!important;min-height:42px!important}
 #calculator .calculator-item-quantity{border:none!important;background:transparent!important;width:38px!important;height:42px!important;text-align:center}
 #calculator .calculator-item-price{border:1px solid var(--border,#e7e9f4)!important;border-radius:12px!important;background:#fbfbfe!important;padding:0 10px!important;height:44px;gap:4px}
 #calculator .calculator-item-unit-price{border:none!important;background:transparent!important;box-shadow:none!important;height:42px!important;padding:0!important}
 #calculator .profit{background:#e9f8f0!important;border-radius:12px}
 #calculator .profit span,#calculator .profit strong,#calculator .profit small{color:#1f9d61!important}
 #calculatorSaveState{display:grid!important;grid-template-columns:auto 1fr;column-gap:8px;align-items:start}
 #calculatorSaveState>span{grid-row:1;margin-top:5px}
 #calculatorSaveState strong,#calculatorSaveState small{grid-column:2}
 #calculator .zero-row{display:none!important}
 html[data-theme="dark"] #calculator .calculator-quantity-control,html[data-theme="dark"] #calculator .calculator-item-price{background:var(--card,#1e1f2e)}
}

/* 04/08 device-truth fixpass 2: hint as plain text, in-flow recalc demoted, orphan dot off */
@media(max-width:700px){
 #calculatorEventLinkHint{border:none!important;background:transparent!important;box-shadow:none!important;padding:2px 2px 0!important;font-size:12px!important;color:var(--muted,#7a7f96)!important;min-height:0!important}
 #calcForm button.primary.wide[type="submit"]{background:transparent!important;background-image:none!important;color:var(--accent,#7668ef)!important;border:1.5px solid #dcd9f4!important;box-shadow:none!important;font-weight:600!important}
 #calculator .page-title h2::after,#calculator .page-title p::after,#calculator .calculator-header h2::after,#calculator .calculator-header::after,#calculator .page-title div::after{display:none!important;content:none!important}
}

/* slim bar: id-strength row override */
@media(max-width:700px){
 #mobileCalcBar{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;gap:12px!important;padding:10px 14px!important}
 #mobileCalcBar>div:first-child{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:1px!important;flex:1 1 auto!important;min-width:0!important}
 #mobileCalcBar .mobile-calc-actions{flex:0 0 auto!important;margin-inline-start:auto!important;display:flex!important}
 #mobileCalcBar #mobileCalculateBtn{width:auto!important;min-width:0!important}
}

/* slim bar: two-id hammer over styles.css structural grid */
@media(max-width:700px){
 #calculator #mobileCalcBar{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:flex-start!important;gap:12px!important;padding:10px 14px!important;grid-template-columns:none!important}
 #calculator #mobileCalcBar>div:first-child{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:1px!important;flex:1 1 auto!important;min-width:0!important}
 #calculator #mobileCalcBar .mobile-calc-actions{flex:0 0 auto!important;margin-inline-start:auto!important;display:flex!important;width:auto!important}
 #calculator #mobileCalcBar #mobileCalculateBtn{width:auto!important;min-width:0!important}
}

/* collapsed bars: tighter bottom */
@media(max-width:700px){
 #calculator .calc-step.calc-step-collapsed{padding-bottom:4px!important}
 #calculator .calc-step.calc-step-collapsed legend{padding-bottom:2px!important}
 #calculator .calc-step.calc-step-collapsed .step-live-sum{margin-top:1px;line-height:1.35}
}

/* 04/08 autonomous sprint A: units adjacency, date hint, icon symmetry, add-btn order, h2 size, focus rings, tap feedback, ladder tighten */
@media(max-width:700px){
 #calculator .input-with-unit{display:flex;align-items:center;gap:6px}
 #calculator .input-with-unit input{field-sizing:content;min-width:72px;flex:0 1 auto;width:auto!important}
 #calculator .input-with-unit>span{position:static!important;inset:auto!important;color:var(--muted,#7a7f96);font-size:12.5px;white-space:nowrap}
 #calculator label.date-empty{position:relative}
 #calculator label.date-empty::after{content:"\05D1\05D7\05E8 \05EA\05D0\05E8\05D9\05DA";position:absolute;inset-inline-start:14px;bottom:13px;font-size:13.5px;color:#aab0c5;pointer-events:none}
 #calculator .calculator-item-identity{position:relative;padding-inline-start:44px;min-height:36px}
 #calculator .calculator-item-identity .calculator-item-icon{position:absolute;inset-inline-start:0;top:0}
 #calculator .calc-step:has(#calculatorItemsTableWrap){display:flex;flex-direction:column}
 #calculator .calc-step:has(#calculatorItemsTableWrap)>legend{order:0}
 #calculator .calc-step:has(#calculatorItemsTableWrap)>.calculator-items-table-wrap{order:1}
 #calculator .calc-step:has(#calculatorItemsTableWrap)>#calculatorItemsEmpty{order:1}
 #calculator .calc-step:has(#calculatorItemsTableWrap)>.calculator-items-toolbar{order:2;margin-top:10px}
 #calculator .calc-step:has(#calculatorItemsTableWrap)>.calculator-items-footer{order:3}
 #calculator .page-title h2,#calculator .calculator-header h2{font-size:22px!important;line-height:1.25!important}
 #calculator input:focus-visible,#calculator select:focus-visible,#calculator textarea:focus-visible{border-color:#7668ef!important;box-shadow:0 0 0 3px rgba(118,104,239,.14)!important;outline:none!important}
 #calculator .calc-step legend[role="button"]:active{background:#f7f6ff;border-radius:12px}
 #calculator .calculator-result [id^="calculator"]{font-variant-numeric:tabular-nums}
 .field-invalid{border-color:#e11d48!important;box-shadow:0 0 0 3px rgba(225,29,72,.12)!important}
 #calculator #mobileCalcBar{box-shadow:0 -6px 20px rgba(28,29,43,.06)!important}
}

/* sprint A corrections: undo step-flex + identity padding, scope field-sizing to field-grid, force item text inputs full width */
@media(max-width:700px){
 #calculator .calc-step:has(#calculatorItemsTableWrap){display:block}
 #calculator .calculator-item-identity{padding-inline-start:0;position:static}
 #calculator .calculator-item-identity input{width:100%!important;field-sizing:fixed!important}
 #calculator .calculator-items-table-wrap input:not(.calculator-item-quantity):not(.calculator-item-unit-price){width:100%!important;field-sizing:fixed!important}
 #calculator .calc-step .field-grid .input-with-unit input{field-sizing:content;min-width:72px}
}

/* sprint A correction 2: icon back into identity grid flow */
@media(max-width:700px){
 #calculator .calculator-item-identity .calculator-item-icon{position:static!important;inset:auto!important}
}

/* h2 sizing hammer over typography-system */
@media(max-width:700px){
 html[dir] #calculator .page-title h2,html[dir] #calculator .workspace-header h2{font-size:22px!important;line-height:1.25!important}
}

/* item identity: flexible content column (was fixed 213px, wasted ~50px) */
@media(max-width:700px){
 #calculator .calculator-item-identity{grid-template-columns:38px minmax(0,1fr)!important;width:100%}
}

/* identity gtc hammer */
@media(max-width:700px){
 html[dir] #calculator .calculator-item-identity{grid-template-columns:38px minmax(0,1fr)!important}
}

/* QA round 2: maintain comfortable touch targets without changing visual hierarchy. */
@media(max-width:700px){
 #dashboard .link-btn{min-height:44px!important;padding-block:10px!important;display:inline-flex!important;align-items:center!important}
 #calculator .calculator-item-remove{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}
 #calculator .calculator-quantity-control button{flex-basis:44px!important;width:44px!important;min-width:44px!important;min-height:44px!important}
 #calculator #calculatorAddItem{min-height:44px!important}
 #inventory #inventoryExportBtn,#inventory #inventoryImportBtn{min-height:44px!important}
 #calendar .calendar-mini-nav-btn{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}
 #calendar .calendar-new-event{min-height:44px!important}
 #settings .settings-primary-btn,#settings .settings-outline-btn{min-height:44px!important}

}
