/* The top bar (informe de proves 2026-10-14): the same in Turonet and in its apps (apps/src/shared/commonBar.js and
   turonet-bar.css, «row 1»), across the whole width, with the menu under it. From left to right: the productora of
   the project (its logo and name, companies.js) or Turonet; where you are («El meu espai / Projecte»); the service
   notice, only as wide as its text (notice.js); «Cercar», «Xat», «ALPHA» (Novetats), «Enviar feedback» and the
   theme. Loaded last: it wins over the older rules of the bar (style.css, refinements.css). */
:root {
  --bar-h: 56px;
  scroll-padding-top: calc(var(--bar-h) + 12px);
  --feedback-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H9l-5 4z'/%3E%3Cpath d='M12 8v5M9.5 10.5h5'/%3E%3C/svg%3E");
}
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: var(--bar-h);
  padding: 0 18px 0 16px;
  gap: 14px;
  justify-content: flex-start;
}
aside#sidebar {
  top: var(--bar-h);
  padding-top: 26px;
}
#sidebar .workspace-label {
  margin-top: 0;
}
.main-shell {
  padding-top: var(--bar-h);
}
.task-bulk {
  top: calc(var(--bar-h) + 8px);
}

/* Turonet: its mark (as in the apps) and its name */
.topbar .brand {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  letter-spacing: 0;
}
.topbar .brand-mark {
  width: 32px;
  height: 32px;
  margin: 0;
  border-radius: 9px;
  background: #19232b;
  color: #6eea8e;
}
.topbar .brand-mark svg {
  width: 23px;
  height: 23px;
}
.topbar .brand-copy {
  flex-direction: row;
  align-items: center;
}
.topbar .brand-name {
  font-size: inherit;
  gap: 6px;
}
.topbar .brand-wordmark {
  height: 16px;
  color: var(--ink);
}
.topbar .alpha {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}
html.dark .topbar .brand-mark {
  background: #0f171d;
}

/* where you are */
.topbar .breadcrumb {
  flex-shrink: 0;
  min-width: 0;
  gap: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  line-height: 24px;
  white-space: nowrap;
}
.topbar .breadcrumb strong {
  min-width: 0;
  max-width: 26vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the service notice: only as wide as its text */
.topbar > .service-notice {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 34vw;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  position: relative;
  padding-left: 24px;
}
.topbar > .service-notice::before {
  position: absolute;
  left: 10px;
  top: 50%;
  margin-top: -4px;
}

/* the buttons */
.topbar .top-actions {
  margin-left: auto;
  gap: 8px;
  flex-shrink: 0;
}
.topbar .top-actions .button {
  padding: 8px 13px;
  border-radius: 7px;
}
.topbar .top-actions .demo-badge {
  height: 34px;
}
.topbar .theme-button {
  padding: 7px;
}

/* «Apps» (apps-menu.js, 2026-10-18): the apps of the project under the button, two by two; the same as in the apps'
   bar (apps/src/shared/turonet-bar.css: .tn-apps) */
.apps-menu-wrap {
  position: relative;
  display: flex;
}
.apps-menu-wrap[hidden] {
  display: none;
}
.topbar .top-actions .apps-button {
  gap: 7px;
  color: var(--ink);
}
.apps-button svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.apps-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 408px;
  max-width: calc(100vw - 20px);
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px #1b27312e;
  white-space: normal;
  text-align: left;
}
.apps-menu[hidden] {
  display: none;
}
.apps-menu-head {
  margin: 2px 6px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.apps-menu-empty {
  grid-column: 1/-1;
  max-width: 300px;
  margin: 0 6px 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.apps-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.apps-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
}
.apps-menu-item:hover,
.apps-menu-item:focus-visible {
  background: #f0f3f5;
}
.apps-menu-item:focus-visible {
  outline-offset: -2px;
}
.apps-menu-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  background: #eef2f0;
  color: #24303c;
}
.apps-menu-item b {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.25;
}
.apps-menu-item small {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--muted);
}
html.dark .apps-menu {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 16px 40px #0007;
}
html.dark .apps-menu-item:hover,
html.dark .apps-menu-item:focus-visible {
  background: #273449;
}
html.dark .apps-menu-icon {
  background: #273449;
  color: #e2e8f0;
}
/* «Pàgines» (apps-menu.js, 2026-10-29): the same menu, with the page where you are marked */
.apps-menu-item.is-here {
  box-shadow: inset 0 0 0 1px var(--line);
}
.apps-menu-item.is-here .apps-menu-icon {
  background: var(--ink);
  color: #fff;
}
html.dark .apps-menu-item.is-here .apps-menu-icon {
  background: #e2e8f0;
  color: #1e293b;
}

/* the chat opens under the bar (on the phone, over everything) */
@media (min-width: 701px) {
  .chat-panel {
    top: var(--bar-h);
  }
}

@media (max-width: 1180px) {
  .topbar {
    padding: 0 14px;
  }
}
/* phone: the mark or the productora's logo, the current page, and the buttons as icons (refinements.css) */
@media (max-width: 760px) {
  .topbar {
    padding: 0 10px;
    gap: 8px;
  }
  .topbar .brand-copy,
  .topbar .company-brand-name {
    display: none;
  }
  .topbar .company-brand.wide .company-brand-logo {
    max-width: 84px;
  }
  .topbar .company-brand.wide .company-brand-logo img {
    max-width: 70px;
  }
  .topbar .breadcrumb {
    padding-left: 8px;
    flex: 1 1 auto;
  }
  .topbar .breadcrumb strong {
    max-width: none;
  }
  .topbar .top-actions {
    gap: 5px;
  }
  .topbar .top-actions .button {
    padding: 8px;
  }
  .topbar .top-actions .demo-badge {
    height: 34px;
    padding: 5px 6px;
  }
  .apps-menu {
    position: fixed;
    top: calc(var(--bar-h) + 6px);
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
  }
  /* «Enviar feedback», an icon (a speech bubble with a plus); the words stay for screen readers */
  .topbar .top-actions #feedback-button {
    gap: 0;
  }
  .topbar .top-actions #feedback-button::before {
    content: "";
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--feedback-icon) center/contain no-repeat;
    mask: var(--feedback-icon) center/contain no-repeat;
  }
}
/* a narrow phone (390 px) with the logo of a productora: the six buttons fit, the theme too (proves amb agents, ronda 2:
   since «Apps», the theme button was cut at the edge) */
@media (max-width: 430px) {
  .topbar {
    padding: 0 8px;
    gap: 6px;
  }
  .topbar .company-brand.wide .company-brand-logo {
    max-width: 64px;
  }
  .topbar .company-brand.wide .company-brand-logo img {
    max-width: 56px;
  }
  .topbar .top-actions {
    gap: 3px;
  }
  .topbar .top-actions .button {
    padding: 7px 6px;
  }
  .topbar .top-actions .demo-badge {
    padding: 5px 4px;
  }
  .topbar .theme-button {
    padding: 6px;
  }
}
/* «⋯» on the phone (ronda 8 de proves: seven icons in a row, and the name of the page cut to a letter). Cercar, Apps,
   Pàgines and Xat stay; Novetats, «Enviar feedback» and the theme go under «⋯», with their words. The buttons are not
   moved in the page (other scripts look for them in .top-actions): open, they are placed one under the other. */
.topbar .top-actions #top-more {
  display: none;
}
@media (max-width: 760px) {
  .topbar .top-actions #top-more {
    display: inline-flex;
    font-size: 20px;
    line-height: 1;
    padding: 6px 8px;
  }
  .topbar .top-actions:not(.more-open) > .demo-badge,
  .topbar .top-actions:not(.more-open) > #feedback-button,
  .topbar .top-actions:not(.more-open) > #theme-button {
    display: none !important; /* (the badge of Novetats gets its display from refinements.js) */
  }
  .topbar .top-actions.more-open::after {
    content: "";
    position: fixed;
    top: calc(var(--bar-h) + 6px);
    right: 8px;
    z-index: 30;
    width: 214px;
    height: 154px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 16px 40px #1b27312e;
  }
  .topbar .top-actions.more-open > .demo-badge,
  .topbar .top-actions.more-open > #feedback-button,
  .topbar .top-actions.more-open > #theme-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    position: fixed;
    right: 16px;
    z-index: 31;
    width: 198px;
    height: 42px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
  }
  .topbar .top-actions.more-open > .demo-badge {
    top: calc(var(--bar-h) + 14px);
  }
  .topbar .top-actions.more-open > #feedback-button {
    top: calc(var(--bar-h) + 60px);
  }
  .topbar .top-actions.more-open > #theme-button {
    top: calc(var(--bar-h) + 106px);
  }
  /* (Novetats to read: the dot, on «⋯» too) */
  .topbar .top-actions:has(> .demo-badge .news-dot) #top-more {
    position: relative;
  }
  .topbar .top-actions:has(> .demo-badge .news-dot) #top-more::after {
    content: "";
    position: absolute;
    top: 5px;
    right: 3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22a55a;
  }
  .topbar .top-actions.more-open > #theme-button::after {
    content: attr(aria-label);
  }
}
html.dark .topbar .top-actions.more-open::after {
  background: #1e293b;
  border-color: #334155;
}
html.dark .topbar .top-actions.more-open > .demo-badge,
html.dark .topbar .top-actions.more-open > #feedback-button,
html.dark .topbar .top-actions.more-open > #theme-button {
  color: #e2e8f0;
}
/* printed, the bar is not repeated on every page */
@media print {
  .topbar {
    position: static;
  }
  .main-shell {
    padding-top: 0;
  }
}
/* on the phone the notice is a strip under the bar (notice.js) */
.main-shell > .service-notice {
  display: flex;
  border-radius: 0;
  padding: 8px 14px;
  font-size: 12.5px;
}

/* Turonet inside an app (embed.js): only the chat, or a dialog (Cercar, Novetats, Enviar feedback) over the app */
html.incrustat,
html.incrustat body {
  background: transparent !important;
}
html.incrustat .app-shell,
html.incrustat #toast,
html.incrustat .skip {
  display: none !important;
}
html.incrustat .chat-panel {
  top: 0;
  width: 100%;
  border-left: 0;
  box-shadow: none;
}
/* a laptop screen (1366×768…900): the whole menu, with the account and «Tancar sessió», without scrolling
   (informe de proves 2026-10-13) */
@media (max-height: 940px) and (min-width: 761px) {
  aside#sidebar {
    padding-top: 18px;
    padding-bottom: 14px;
  }
  aside#sidebar nav a {
    padding-top: 9px;
    padding-bottom: 9px;
  }
  aside#sidebar .nav-label {
    margin-top: 24px;
  }
  aside#sidebar .sidebar-bottom {
    padding-top: 16px;
  }
}
