/* Integration: things that sit between features (sidebar Admin group, the order of what goes under a chat
   answer, the report page's top bar on a phone). */

/* Sidebar: admin-only pages under one "Admin" heading. */
.side nav details.navgroup { display: grid; gap: 4px; }
.side nav details.navgroup > summary { padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 13px;
  text-transform: uppercase; letter-spacing: .04em; list-style: none; }
.side nav details.navgroup > summary::-webkit-details-marker { display: none; }
.side nav details.navgroup > summary::before { content: '▸ '; }
.side nav details.navgroup[open] > summary::before { content: '▾ '; }
.side nav details.navgroup > summary:hover { background: var(--soft); }
.side nav details.navgroup > a { padding-left: 22px; }
.side footer .small { font-size: 12px; margin-top: 4px; }

/* Under a chat answer, in one order whatever loads first: how it was worked out, downloads and files,
   feedback, then the next questions. (Each feature draws its own part; this only orders them.) */
.answer-stack { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 14px; }
.answer-stack > .answer-extra:empty { display: none; }

/* Report page top bar: on a phone the less used buttons go into a "More" menu. */
.report-more { position: relative; display: inline-block; }
.report-more > summary { list-style: none; cursor: pointer; }
.report-more > summary::-webkit-details-marker { display: none; }
.report-more[open] > .report-more-menu { display: flex; }
.report-more-menu { display: none; position: absolute; left: 0; top: calc(100% + 4px); z-index: 20; flex-direction: column; gap: 4px;
  min-width: 210px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.report-more-menu > * { width: 100%; text-align: left; justify-content: flex-start; }

/* Chat box on a phone: the text gets the whole first line; attach / files / @ report and Send sit under it. */
@media (max-width: 600px) {
  .composer .box { flex-wrap: wrap; }
  .composer .box > textarea { flex: 1 1 100%; }
  .composer .box > .composer-actions { margin-right: auto; }
}

/* The menu: groups from menu_layout.js. It scrolls together with the chat list under it. */
.side .side-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.side .side-scroll .chatlist { flex: none; overflow: visible; }
.side nav { gap: 2px; }
.side nav details.navgroup { gap: 2px; margin-top: 4px; }
.side nav details.navgroup > a { padding-top: 7px; padding-bottom: 7px; }
.side nav .navhead { padding: 8px 10px 0 22px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); opacity: .8; }
/* Links from one page to the pages that belong with it (Marketing tabs, Competitors, Rankings...). */
.related { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 14px; font-size: 14px; }
.related .muted { margin-right: 2px; }
.related a { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--panel); }
.related a:hover { background: var(--soft); }
.subtabs { display: flex; gap: 6px; margin: 2px 0 14px; border-bottom: 1px solid var(--line); }
.subtabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }

/* Ohdeo: the top bar (page title on the left, the company on the right) */
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); min-height: 48px; }
.topbar .top-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .top-right { display: flex; align-items: center; gap: 12px; }
.company-box { display: flex; align-items: center; gap: 8px; }
.company-switch { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; max-width: 240px; }
.company-name { font-weight: 600; padding: 6px 10px; background: var(--soft); border-radius: 9px; }
@media (min-width: 801px) { .topbar { display: flex; } }

/* The menu can be hidden to give the page the whole width (the button at the left of the top bar; remembered). */
.menu-btn { display: inline-block; padding: 4px 10px; }
@media (min-width: 801px) {
  .shell.side-hidden { grid-template-columns: 1fr; }
  .shell.side-hidden > .side { display: none; }
}
.brand .logo { display: block; }
.login-brand { display: flex; align-items: center; gap: 10px; }
