/* shell_centered.css — the centered layout trialled alongside the classic sidebar.
   Opt in/out via CenteredLayoutsController (body.layout-centered). Desktop only:
   at <=760px the classic mobile top bar and bottom tab bar take over unchanged. */

/* The opt-in/out control: a quiet text button in the sidebar and the top bar.
   button_to wraps a <form>; display:contents lets the button sit in the flex row. */
.layout-switch {
  padding: 7px 12px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: .14s;
}

.layout-switch:hover {
  color: var(--clay);
  border-color: var(--clay);
}

aside form:has(> .layout-switch) {
  margin: 12px 12px 0;
}

@media (max-width: 760px) {
  aside form:has(> .layout-switch), .topnav {
    display: none;
  }
}

@media (min-width: 761px) {
  .layout-centered {
    .app {
      display: block;
    }

    aside {
      display: none;
    }

    main {
      max-width: 1000px;
      margin-inline: auto;
      padding: 40px 32px 64px;
    }
  }

  .topnav {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background: rgba(244, 243, 238, .9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }

  .topnav__brand {
    display: flex;
    align-items: center;
  }

  .topnav__mark {
    width: 26px;
    height: 26px;
    background: url("/assets/ts-mark-8e2cb690.svg") center/contain no-repeat;
  }

  .topnav__nav {
    display: flex;
    align-items: center;
    gap: 2px;
  }

  .topnav__nav a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
    transition: .14s;
  }

  .topnav__nav a svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
  }

  .topnav__nav a:hover {
    color: var(--ink);
    background: #e9e7dd;
  }

  .topnav__nav a.on {
    color: var(--ink);
    background: var(--card);
    box-shadow: var(--shadow);
  }

  .topnav__nav a.on svg {
    stroke: var(--clay);
  }

  .topnav__account {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .topnav__account form {
    display: contents;
  }

  .topnav__account .layout-switch {
    margin-right: 6px;
  }

  .topnav__account .av {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 12px;
    color: var(--paper);
    background: linear-gradient(135deg, #2c2d22, #494a39);
  }
}

/* Narrow desktops: drop the nav icons so 8 labels (CEO) still fit in one row,
   and let the nav scroll sideways rather than widen the page when they don't. */
@media (min-width: 761px) and (max-width: 1240px) {
  .topnav {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding-inline: 16px;
  }

  .topnav__nav {
    justify-self: center;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topnav__nav a {
    padding: 7px 9px;
    font-size: 13.5px;
  }

  .topnav__nav a svg {
    display: none;
  }
}
