/* =========================================================================
   Top bar of the older Talent pages (partials/talent-topbar): the full
   Gridma logo, and on a phone a burger button that opens the links and the
   account actions as a bottom sheet over a dimmed page (a floating card,
   8px from the screen edges, 24px corners). The desktop layout
   is the one in dashboard.css: there the sheet wrapper steps aside
   (display: contents) and its links sit in the bar as before.
   ========================================================================= */

.app-topbar[data-topbar] .app-brand { gap: 0; }
.app-topbar[data-topbar] .app-brand img.app-logo { width: auto; height: 22px; display: block; }
/* The small tilt in styles.css suits the mark alone, not the whole word. */
.app-topbar[data-topbar] .app-brand:hover img.app-logo { rotate: 0deg; scale: 1; }

.app-burger,
.app-scrim,
.app-sheet-head { display: none; }

.app-sheet { display: contents; }

@media (max-width: 760px) {
  .app-topbar[data-topbar] {
    position: relative;
    z-index: 30;
    flex-wrap: nowrap;
    padding: 10px 16px;
    /* A blurred bar would become the frame of the fixed sheet; keep it solid. */
    background: var(--shell, #f1f1f2);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .app-topbar[data-topbar] .app-brand img.app-logo { height: 20px; }

  .app-burger {
    display: grid;
    place-content: center;
    gap: 5px;
    margin-left: auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--ink, #111);
    cursor: pointer;
  }
  .app-burger:hover { background: rgba(17, 17, 17, 0.06); }
  .app-burger span { display: block; width: 18px; height: 2px; border-radius: 4px; background: currentColor; }

  /* The dimmed layer behind the sheet. */
  .app-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  }

  /* The sheet: a card that rises from the bottom and floats 8px off the
     screen edges, all corners at 24px (the founder's choice for this sheet). */
  .app-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 1001;
    max-height: calc(85vh - 16px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px 16px 16px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(calc(100% + 16px));
    visibility: hidden;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.32s;
  }

  .app-topbar[data-topbar].is-open .app-scrim {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0s;
  }
  .app-topbar[data-topbar].is-open .app-sheet {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s;
  }

  .app-sheet-head {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    position: relative;
    padding: 12px 0 6px;
  }
  .app-sheet-grip {
    position: absolute;
    top: 0;
    left: 50%;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 4px;
    background: rgba(17, 17, 17, 0.18);
  }
  .app-sheet-title { grid-column: 2; text-align: center; font-size: 15px; font-weight: 600; }
  .app-sheet-close {
    grid-column: 3;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(17, 17, 17, 0.06);
    color: var(--ink, #111);
    cursor: pointer;
  }

  /* dashboard.css reorders the bar's children on a phone; in the sheet the
     links come first, then the account actions. */
  .app-topbar[data-topbar] .app-sheet .app-sheet-head { order: 0; }
  .app-topbar[data-topbar] .app-sheet .app-nav { order: 1; }
  .app-topbar[data-topbar] .app-sheet .app-tools { order: 2; }

  /* Links: one per row, the current page solid as on desktop. */
  .app-topbar[data-topbar] .app-sheet .app-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 2px;
    margin: 6px 0 0;
    overflow: visible;
    font-size: 16px;
  }
  .app-topbar[data-topbar] .app-sheet .app-nav a { padding: 13px 12px; border-radius: 8px; }

  /* Account actions under the links, the main one full width. */
  .app-topbar[data-topbar] .app-sheet .app-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin: 10px 0 0;
    padding-top: 12px;
    border-top: 1px solid rgba(17, 17, 17, 0.08);
  }
  .app-topbar[data-topbar] .app-sheet .app-tools .app-signin { font-size: 16px; padding: 8px 12px; }
  .app-topbar[data-topbar] .app-sheet .app-tools .chat-demo-tag { margin-left: 12px; }
  .app-topbar[data-topbar] .app-sheet .hub-signout { display: flex; }
  /* The theme button ends the account row, under the close button, so the
     row still starts in line with the links. The main action stays last. */
  .app-topbar[data-topbar] .app-sheet .app-tools .theme-btn { order: 1; margin-left: auto; }
  .app-topbar[data-topbar] .app-sheet .app-tools .app-cta { order: 2; }
  .app-topbar[data-topbar] .app-sheet .app-tools .app-cta {
    flex: 1 0 100%;
    margin-top: 6px;
    padding: 14px 18px;
    font-size: 16px;
    text-align: center;
  }

  /* While the sheet is open the page behind it does not scroll. */
  html.app-sheet-open,
  html.app-sheet-open body { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .app-scrim,
  .app-sheet,
  .app-topbar[data-topbar].is-open .app-scrim,
  .app-topbar[data-topbar].is-open .app-sheet { transition: none; }
}

/* ---------- Dark theme (palette in gridma-theme.css) ----------
   The phone bar already follows --shell; the sheet, its scrim, grip and
   close button are painted here. Only on a phone screen, where they show
   (a printout keeps the light colors). */
@media screen and (max-width: 760px) {
  :root[data-theme="dark"] .app-burger:hover { background: var(--dk-tint-2); }
  :root[data-theme="dark"] .app-scrim { background: var(--dk-scrim); }
  /* A hairline edge, since a dark shadow does not show on the dimmed page. */
  :root[data-theme="dark"] .app-sheet {
    background: var(--dk-surface);
    box-shadow: 0 0 0 1px var(--dk-line), 0 12px 40px var(--dk-shadow);
  }
  :root[data-theme="dark"] .app-sheet-grip { background: var(--dk-line-2); }
  :root[data-theme="dark"] .app-sheet-close { background: var(--dk-tint-2); }
  :root[data-theme="dark"] .app-topbar[data-topbar] .app-sheet .app-tools { border-top-color: var(--dk-line); }
}
