/* User page and rail overrides added after the legacy shell styles. */

nav{
  justify-content:space-between !important;
  align-items:center !important;
}

.nav-stack{
  width:100%;
  min-height:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
  flex:1 1 auto;
}

.mini-tabs{
  flex:1 1 auto;
}

body.workspace-open .mini-tabs{
  opacity:1 !important;
  pointer-events:auto !important;
  transform:none !important;
}

.mini-account-tab{
  margin-top:auto;
  flex-shrink:0;
}

.mini-account-badge,
.rail-account-badge{
  width:20px;
  height:20px;
  border-radius:999px;
  display:grid;
  place-items:center;
  font-family:'IBM Plex Mono',monospace;
  font-size:11px;
  font-weight:600;
}

.rail-account-badge{
  width:36px;
  height:36px;
  border-radius:14px;
}

.user-badge{
  position:relative;
  background:#eef2f7;
  color:#0f172a;
}

.user-badge.signed-in{
  background:#0f172a;
  color:#ffffff;
}

.user-badge.guest{
  font-size:0;
  color:transparent;
}

.user-badge.guest::before{
  content:'';
  position:absolute;
  top:4px;
  left:50%;
  width:7px;
  height:7px;
  margin-left:-3.5px;
  border-radius:50%;
  background:#64748b;
}

.user-badge.guest::after{
  content:'';
  position:absolute;
  left:50%;
  bottom:4px;
  width:12px;
  height:7px;
  margin-left:-6px;
  border-radius:7px 7px 4px 4px;
  border:1.5px solid #64748b;
  border-top:none;
}

.shell-rail{
  padding:14px 12px 18px !important;
}

.rail-spacer{
  height:60px;
  flex-shrink:0;
}

.rail-head,
.rail-auth{
  display:none !important;
}

.rail-group{
  padding:0 8px !important;
}

.rail-group-account{
  margin-top:auto;
  padding-top:14px !important;
  border-top:1px solid rgba(15,23,42,.08);
}

.rail-tab{
  align-items:center !important;
}

.rail-tab-copy{
  gap:4px;
}

.rail-tab-account{
  background:#ffffff;
  box-shadow:0 10px 30px rgba(15,23,42,.05);
}

.profile-shell{
  display:flex;
  flex-direction:column;
  gap:14px;
  min-height:100%;
}

.profile-grid{
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  gap:14px;
  align-content:start;
}

.section-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.settings-error{
  margin:8px 0 2px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(184,84,56,.25);
  background:rgba(184,84,56,.08);
  color:#7a3b27;
  font-size:12px;
}

.profile-grid > .section-card{
  min-width:0;
}

.span-12{
  grid-column:1 / -1;
}

.profile-hero{
  padding:24px;
  background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(249,246,240,.84));
}

.profile-hero-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}

.profile-hero-main{
  display:flex;
  align-items:center;
  gap:18px;
}

.profile-avatar{
  width:72px;
  height:72px;
  border-radius:24px;
  display:grid;
  place-items:center;
  background:linear-gradient(145deg,#ffffff,#ece6da);
  color:#0f172a;
  font-family:'Cormorant Garamond',serif;
  font-size:34px;
  font-weight:700;
  box-shadow:0 18px 38px rgba(15,23,42,.08);
}

.profile-hero-copy{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.profile-hero-name{
  font-family:'Cormorant Garamond',serif;
  font-size:38px;
  line-height:.96;
  letter-spacing:-.02em;
}

.profile-hero-email{
  font-size:14px;
  color:#526071;
}

.profile-hero-summary{
  margin-top:14px;
  max-width:760px;
  font-size:14px;
  line-height:1.8;
  color:#5a6677;
}

.profile-chip-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:18px;
}

.profile-account-card{
  display:grid;
  gap:10px;
}

.profile-account-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:12px 14px;
  border-radius:16px;
  background:rgba(248,250,252,.8);
  border:1px solid rgba(15,23,42,.06);
}

.profile-account-row span{
  font-size:12px;
  color:#64748b;
}

.profile-account-row strong{
  font-size:13px;
  color:#0f172a;
  text-align:right;
}

.account-integration-grid{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.account-capability-card{
  padding:20px;
  background:linear-gradient(180deg,rgba(255,255,255,.94),rgba(248,250,252,.82));
  min-width:0;
}

.account-capability-head{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
}

.account-capability-mark{
  width:44px;
  height:44px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background:#f3f4f6;
  color:#0f172a;
  font-size:18px;
}

.account-capability-copy{
  min-width:0;
}

.account-provider-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}

.app-provider-card{
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(15,23,42,.08);
  background:#ffffff;
  min-width:0;
}

.app-provider-card.active{
  border-color:rgba(15,23,42,.14);
  box-shadow:0 14px 34px rgba(15,23,42,.06);
}

.app-provider-top{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  margin-bottom:10px;
}

.app-provider-meta{
  min-width:0;
}

.app-provider-icon{
  width:38px;
  height:38px;
  border-radius:14px;
  display:grid;
  place-items:center;
  font-family:'IBM Plex Mono',monospace;
  font-size:13px;
  font-weight:600;
}

.tone-google{
  background:#e8f0fe;
  color:#185abc;
}

.tone-microsoft{
  background:#eef7ff;
  color:#2563eb;
}

.tone-slack{
  background:#f7eef9;
  color:#7c3aed;
}

.tone-notion{
  background:#f4f4f5;
  color:#111827;
}

.tone-default{
  background:#f1f5f9;
  color:#0f172a;
}

.provider-unavailable{
  cursor:default;
  opacity:.68;
}

.profile-search-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  margin-top:12px;
}

.profile-memory-search{
  margin-bottom:12px;
}

.intelligence-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.intelligence-card{
  padding:18px;
  border-radius:20px;
  border:1px solid rgba(15,23,42,.08);
  background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(248,250,252,.86));
  min-width:0;
}

.intelligence-card--wide{
  grid-column:1 / -1;
}

.intelligence-card-copy{
  margin-top:10px;
  font-size:14px;
  line-height:1.7;
  color:#556274;
}

.intelligence-source-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:14px;
}

.intelligence-source{
  padding:12px 13px;
  border-radius:16px;
  background:#ffffff;
  border:1px solid rgba(15,23,42,.07);
}

.intelligence-source-label{
  font-size:12px;
  color:#64748b;
  margin-bottom:4px;
}

.intelligence-source-value{
  font-size:13px;
  color:#0f172a;
  line-height:1.5;
}

@media (max-width:1100px){
  .intelligence-grid,
  .account-integration-grid,
  .account-provider-grid{
    grid-template-columns:1fr;
  }

  .intelligence-source-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width:980px){
  .profile-hero-top,
  .profile-hero-main{
    flex-direction:column;
    align-items:flex-start;
  }

  .profile-grid{
    grid-template-columns:1fr;
  }

  .span-5,
  .span-7,
  .span-12{
    grid-column:auto;
  }
}

@media (max-width:640px){
  .profile-avatar{
    width:60px;
    height:60px;
    border-radius:20px;
    font-size:30px;
  }

  .profile-hero-name{
    font-size:30px;
  }

  .profile-search-row{
    grid-template-columns:1fr;
  }
}
