@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&family=Manrope:wght@400;500;600;650;700;750;800&display=swap');

/* Shared ApplyGrove design tokens and navigation, used by every screen. */
:root {
  color-scheme: light;
  --ag-bg: #f7f8fb;
  --ag-panel: #fff;
  --ag-subtle: #f5f7fb;
  --ag-border: #e4e8f0;
  --ag-text: #202a40;
  --ag-muted: #667085;
  --ag-primary: #465ee6;
  --ag-primary-hover: #3449bd;
  --ag-brand: #477864;
  --ag-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ag-heading: 'Manrope', var(--ag-font);
  --ag-radius: 14px;
  --ag-shadow: 0 4px 22px rgb(32 42 64 / 5%);
}
header.ag-header.shared-header {
  height: 86px;
  padding: 0 max(32px, calc((100vw - 1400px) / 2));
  display: flex;
  align-items: center;
  gap: 44px;
  background: var(--ag-panel);
  border: 0;
  border-bottom: 1px solid var(--ag-border);
  border-radius: 0;
  box-shadow: none;
  color: var(--ag-text);
}
.ag-brand, .shared-header .ag-brand, .auth-brand.ag-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 9px;
  font-family: var(--ag-heading);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -1px;
  text-decoration: none;
  color: var(--ag-text);
  white-space: nowrap;
}
.ag-brand > span { color: var(--ag-text); }
.ag-brand .ag-brand-accent { color: var(--ag-brand); }
.ag-brand .ag-brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  border: 1px solid #d9e7de;
  background: #edf4ef;
  color: #3e705b;
}
.ag-brand-mark svg { width: 22px; height: 22px; }
.shared-header .ag-nav {
  align-self: stretch;
  display: flex;
  align-items: stretch;
  gap: 26px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  width: auto;
  min-width: 0;
}
.shared-header .ag-nav .ag-nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: auto;
  min-width: auto;
  min-height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: var(--ag-font);
  font-size: 14px;
  font-weight: 600;
  color: var(--ag-muted);
  text-decoration: none;
  white-space: nowrap;
}
.shared-header .ag-nav .ag-nav-link:hover,
.shared-header .ag-nav .ag-nav-link.active { color: var(--ag-primary); background: transparent; }
.shared-header .ag-nav .ag-nav-link.active::after {
  content: ''; position: absolute; height: 3px; bottom: -1px; left: 0; right: 0;
  border-radius: 3px 3px 0 0; background: var(--ag-primary);
}
.shared-header .ag-account { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; }
.shared-header .ag-account-name { font: 600 13px var(--ag-font); color: var(--ag-muted); max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shared-header .ag-avatar {
  display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0;
  border: 1px solid #dce1ee; border-radius: 50%; background: #f0f2fc;
  color: #5662a2; font: 700 13px var(--ag-font); padding: 0; text-decoration: none;
}
.shared-header .ag-avatar:hover { background: #e7ebff; border-color: #bcc5ee; }
.ag-signin { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 15px; border: 1px solid var(--ag-border); border-radius: 9px; background: #fff; color: var(--ag-text); font: 600 14px var(--ag-font); text-decoration: none; white-space: nowrap; }
.ag-signin:hover { background: var(--ag-subtle); }
.ag-auth-header.shared-header { position: absolute; top: 0; left: 0; right: 0; }
.auth-shell, .setup-shell { position: relative; }
.ag-auth-header + .auth-card, .ag-auth-header + .setup-card { margin-top: 86px; }
.ag-auth-header .ag-auth-link { margin-left: auto; color: var(--ag-primary); font: 600 14px var(--ag-font); text-decoration: none; }
.ag-header :is(a,button):focus-visible { outline: 3px solid #9eabff; outline-offset: 4px; }
#app > .container { padding-top: 0; }
#app > .container > .shared-header {
  width: 100vw;
  margin: 0 calc(50% - 50vw) 30px;
}
#app > .builder-container > .shared-header { margin-bottom: 24px; }
@media (max-width: 1150px) {
  header.ag-header.shared-header { gap: 28px; }
  .shared-header .ag-nav { gap: 20px; }
  .shared-header .ag-account-name { display: none; }
}
@media (max-width: 800px) {
  header.ag-header.shared-header { height: auto; min-height: 120px; padding: 16px 20px 0; gap: 12px 20px; flex-wrap: wrap; }
  .shared-header .ag-brand { font-size: 21px; }
  .shared-header .ag-nav { width: 100%; order: 3; flex-basis: 100%; overflow-x: auto; gap: 26px; scrollbar-width: none; }
  .shared-header .ag-nav::-webkit-scrollbar { display: none; }
  .shared-header .ag-nav .ag-nav-link { min-height: 48px; flex-shrink: 0; }
  .shared-header .ag-nav .ag-nav-link.active::after { bottom: 0; }
  header.ag-auth-header.shared-header { min-height: 78px; padding-bottom: 16px; }
  .ag-auth-header + .auth-card, .ag-auth-header + .setup-card { margin-top: 78px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
