/* The phone in WhatsApp's shapes (task #258, ADR 0282), at a phone's width: linked before
   phone.css, which stays the last stylesheet. Quartio's own colours, type and icons. */

/* The header is one row, as WhatsApp's chat header: the controls at the left (the menu, back,
   Rozmowa's list), the title on one line with what Quartio does now under it (as "pisze…"),
   "Udostępnij" and "Przełącz miejsce" as icons at the right. Aktywność's trigger is the whole
   block of the title, its line the status: pressed anywhere there, as WhatsApp's header, its
   panel opens under the header across the screen. The title stands over it, so a press on the
   title itself is the title's (a conversation's is renamed so). */
@media (max-width: 760px) {
  .workspace .topbar { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr) auto auto; grid-template-rows: 30px 26px; align-items: center; height: auto; padding: 2px 4px; gap: 0; }
  .workspace .topbar .topbar-start { display: contents; }
  .workspace .topbar :is(.mobile-menu, .back-button, .history-slot, .share-slot, .switch-place) { grid-row: 1 / 3; }
  .workspace .topbar .mobile-menu { grid-column: 1; }
  .workspace .topbar .back-button { grid-column: 2; }
  /* (On Rozmowa the way back is its list's arrow: the app's back would be a second arrow.) */
  .workspace .topbar:has(.history-slot:not(:empty)) .back-button { display: none; }
  .workspace .topbar .history-slot { grid-column: 3; display: flex; }
  .workspace .topbar .history-slot:empty { display: none; }
  .workspace .topbar .breadcrumbs { grid-column: 4; grid-row: 1; align-self: end; position: relative; z-index: 1; width: fit-content; max-width: 100%; padding-left: 8px; font-size: 16px; }
  /* Only the page's own name: back leads to the page above it. */
  .workspace .topbar .breadcrumbs > :not(.current) { display: none; }
  /* (A conversation's title is renamed by a press: its box is a finger's 44 px, reaching into
     the rows above and under it, its words where they stand.) */
  .workspace .topbar .breadcrumbs .current { display: block; max-width: 100%; min-height: 0; font-weight: 550; line-height: 1.35; }
  .workspace .topbar #page-title[data-renamable] { padding: 12px 0; margin: -12px 0; }
  .workspace .topbar .topbar-end { grid-column: 4; grid-row: 1 / 3; align-self: stretch; position: static; min-width: 0; margin: 0; }
  .workspace .topbar .activity-trigger { width: 100%; height: 100%; max-width: none; min-height: 44px; align-items: flex-end; padding: 0 0 5px 8px; border: 0; border-radius: 0; background: none; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
  /* The status stands at the block's bottom, so the dot would too: lifted by half of what the
     line (the body's 1.55, named here as the lift counts on it) is taller than it, its middle is
     the words' middle (task #279). */
  .workspace .topbar .activity-trigger .now-dot { margin-bottom: calc((1.55em - 7px) / 2); }
  .workspace .topbar .activity-trigger.is-running { color: var(--olive-ink); }
  .workspace .topbar .activity-trigger:hover { background: none; }
  .workspace .topbar .activity-panel { position: fixed; top: calc(64px + env(safe-area-inset-top)); left: 10px; right: 10px; width: auto; }
  .workspace .topbar .share-slot { grid-column: 5; display: flex; }
  .workspace .topbar .share-slot:empty { display: none; }
  .workspace .topbar .switch-place { grid-column: 6; }
  /* Icons, as WhatsApp's: their words for screen readers (their names) and nothing beside them. */
  .workspace .topbar :is(.share-button, .switch-place, .share-owner-more) { width: 44px; height: 44px; padding: 0; justify-content: center; border: 0; background: none; }
  .workspace .topbar .share-button[data-shared=true] .icon { color: var(--olive-ink); }
  .workspace .topbar :is(.share-button-word, .share-state, .share-outside-words, .share-owner-name, .share-owner-access) { display: none; }
  .workspace .topbar .share-header { flex-wrap: nowrap; gap: 0; }
  .workspace .topbar .share-outside { width: 28px; justify-content: center; }
}

/* The bar of the person's pages at the bottom, as WhatsApp's tabs (`app/tab-bar.js`): each its
   icon over its name, the open one's icon on a pill; "Więcej" opens the menu, so ☰ is gone. Not
   in a conversation (the screen over Rozmowa's list) nor while the keyboard is open. */
.tab-bar { display: none; }
@media (max-width: 760px) {
  /* (A size under WhatsApp's own, task #277: each entry still a finger's 44 px and more.) */
  .tab-bar { display: flex; flex-shrink: 0; gap: 2px; padding: 3px 6px; border-top: 1px solid var(--line); background: var(--paper); }
  .tab-bar .nav-item { flex: 1 1 0; min-width: 0; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 3px 2px; border-radius: 12px; font-size: 12px; color: var(--muted); text-decoration: none; }
  .tab-bar .nav-item .icon { width: 20px; height: 20px; padding: 3px 14px; box-sizing: content-box; border-radius: 14px; transition: background-color 160ms ease; }
  /* (The keyboard's ring inside the entry: the bar lies on the screen's edges.) */
  .tab-bar .nav-item:focus-visible { outline-offset: -2px; }
  .tab-bar .nav-item.active { color: var(--ink); font-weight: 600; }
  .tab-bar .nav-item.active .icon { background: var(--sage); color: var(--olive-ink); }
  .tab-bar .nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab-bar .soon { display: none; }
  .workspace .topbar .mobile-menu { display: none; }
  .app-shell:has(.chat-layout > .history:not(.open)) .tab-bar, html.keyboard .tab-bar { display: none; }
}
