/* panel — the Panel's space (release 10, contract §6.1): a full-screen SOLID cover over the tab (no glass inside the
   Panel), the large title with a trailing «Закрыть», the scope, the segments, then their sections. Tokens only (the
   shell's app.css / shell.css): it follows the Telegram theme, dark and light, and prefers-contrast. */

.screen.panel-screen { background: var(--bg); }

.panel-head { display: flex; align-items: flex-start; gap: 12px; }
.panel-close {
  flex: none; min-height: 44px; min-width: 44px; padding: 0 2px; margin-top: 4px;
  font-size: 17px; font-weight: 600; color: var(--accent);
}
.panel-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.panel-scope { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 4px 2px; }
.panel-scope .chip { max-width: 100%; }
.panel-scope .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The segments are sized to their labels (Study's pattern, glass_now/static/study.css): «Расписания · Объявления» and
   «Announcements» never truncate from 320 px on (checked at 320, 360 and 375 px in uz / ru / en). The equal-width
   thumb goes; the selected segment is drawn. A label that still doesn't fit (a larger system font) ends in «…». */
.panel-seg { margin: 12px 0 4px; grid-auto-columns: auto; }
.panel-seg::before { display: none; }
.panel-seg .seg-item {
  min-width: 0; min-height: 34px; padding-inline: 6px;
  transition: background-color .2s ease, box-shadow .2s ease;
}
.panel-seg .seg-item[aria-selected="true"] { background: var(--bg); box-shadow: 0 1px 4px rgb(0 0 0 / .12); }
:root[data-scheme="dark"] .panel-seg .seg-item[aria-selected="true"] { background: var(--thumb-dark); }
@media (max-width: 374px) { .panel-seg .seg-item { font-size: 13px; padding-inline: 4px; } }
@media (max-width: 339px) { .panel-seg .seg-item { font-size: 12px; padding-inline: 3px; } }
@media (prefers-reduced-motion: reduce) { .panel-seg .seg-item { transition: none; } }
.panel-body { margin-top: 8px; }
.panel-segment[hidden] { display: none; }
.panel-tools { margin-top: 24px; }

.panel-none .empty { margin-top: 32px; }

.panel-more { display: flex; justify-content: center; margin: 4px 0 16px; }

/* It rises as «You» does (the shell's enter-up / leave-down, main.js 'up' / 'down'); reduced motion: no slide. */

/* ---------- Release 11 «Большой экран» (docs/telegram-bot/release-11-contract.md §7.6) ----------
   Compact: everything above, unchanged. Medium: the cover as today, its content ≤ 900 centred (the shell). Wide: a
   destination in the content area; with room (screen.js segmentsSide: a content area ≥ 1000, the root not the list pane
   of a split) the segments are a vertical list in a 200 px column beside the segment, sticky; Обзор's numbers in one
   row (overview.css). Every rule is under :root[data-layout="wide"] or :root:not([data-layout="compact"]). */

:root[data-layout="wide"] .panel-root.panel-cols {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 28px; align-items: start;
}
:root[data-layout="wide"] .panel-cols > .panel-head,
:root[data-layout="wide"] .panel-cols > .panel-scope { grid-column: 1 / -1; }
:root[data-layout="wide"] .panel-cols > .panel-seg {
  grid-column: 1; display: flex; flex-direction: column; gap: 2px; margin: 12px 0 0; padding: 6px;
  border-radius: 18px; position: sticky; inset-block-start: calc(var(--sat) + 16px);
}
:root[data-layout="wide"]:not([data-sidebar]) .panel-cols > .panel-seg {
  inset-block-start: calc(var(--sat) + var(--topbar-h) + 22px);
}
:root[data-layout="wide"] .panel-cols > .panel-seg .seg-item {
  display: flex; align-items: center; justify-content: flex-start; min-height: 44px; padding-inline: 12px;
  border-radius: 12px; text-align: start; font-size: 15px;
}
:root[data-layout="wide"] .panel-cols > .panel-seg .seg-item::after { inset: 0; }
:root[data-layout="wide"] .panel-cols > .panel-seg .seg-label { white-space: normal; overflow-wrap: anywhere; }
:root[data-layout="wide"] .panel-cols > .panel-body { grid-column: 2; margin-top: 4px; min-width: 0; }
:root[data-layout="wide"] .panel-cols > .panel-tools { grid-column: 2; }
:root[data-layout="wide"] .panel-cols > .panel-body > .panel-segment > .feature-section:first-child > .group-title,
:root[data-layout="wide"] .panel-cols > .panel-body > .panel-segment > .feature-section:first-child .group:first-child { margin-top: 12px; }

@media (hover: hover) and (pointer: fine) {
  :root:not([data-layout="compact"]) .panel-seg .seg-item:not([aria-selected="true"]):hover {
    background-color: rgb(var(--text-rgb) / 0.05);
  }
}
