/* FB Stats — styles of the account page (track C): header, tabs body, campaign tree, ads list,
 * object card, history, billing, statistics. Loaded after screens.css. */

.tree-level-1 { padding-left: 24px; }
.tree-level-2 { padding-left: 48px; }
.table-tree tr.tree-row-1 > td { background: color-mix(in srgb, var(--text) 2.5%, var(--surface)); }
.table-tree tr.tree-row-2 > td { background: color-mix(in srgb, var(--text) 5%, var(--surface)); }
.table-ads .col-problems { max-width: 460px; white-space: normal; }
.table-ads .col-ad { min-width: 280px; }
.ad-problem { margin-bottom: 4px; font-size: 12px; color: var(--text); padding-left: 8px; border-left: 3px solid var(--tone); overflow-wrap: anywhere; }

/* --------------------------------------------------------------- account */

.back-link { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: 13px; }
.account-host { display: flex; flex-direction: column; gap: 16px; }
.account-head { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.account-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.account-name { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.account-links { display: flex; flex-wrap: wrap; gap: 8px; }
.tab-body { display: flex; flex-direction: column; gap: 14px; }

/* ------------------------------------ ads structure (web/adtree.js) */

.adtree { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.adtree-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.thumb-sm { width: 32px; height: 32px; border-radius: 5px; }
.tree-text { flex: 1; min-width: 0; }
.tree-text .chips { margin-top: 3px; }
.tree-text .chip { white-space: normal; }
.tree-info { margin-left: auto; opacity: 0.55; }
.tree-info.is-active { opacity: 1; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-strong); }
.tree-info:focus-visible { opacity: 1; }
@media (hover: hover) { tr:hover .tree-info { opacity: 1; } }
/* Touch: no hover reveals it, so it is fully visible (plan 2.7; review F-09). */
@media (hover: none) { .tree-info { opacity: 1; } }

/* The name column stays in place while the statistics scroll sideways. */
.table-tree .col-tree { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.table-tree th.col-tree, .table-tree tfoot td.col-tree { z-index: 3; background: var(--surface-2); }
.table-tree tr.is-expanded > td.col-tree { background: color-mix(in srgb, var(--text) 6%, var(--surface)); }
@media (hover: hover) {
  .table-tree tbody tr:hover > td.col-tree { background: color-mix(in srgb, var(--text) 6%, var(--surface)); }
}
.table-tree tr.is-target > td.col-tree, .table-tree tr.is-target > td { background: color-mix(in srgb, var(--accent) 11%, var(--surface)); }
.table .col-status { min-width: 104px; max-width: 230px; white-space: normal; }
.table-tree th, .table-tree td { padding-left: 8px; padding-right: 8px; }
.table-tree .col-budget { max-width: 150px; }
.table-tree td.col-budget .cell-sub, .table-tree td.col-budget .muted { white-space: normal; }
.table-adlist .col-account-name { min-width: 150px; max-width: 260px; }
.table-adlist .col-ad { min-width: 220px; }
.table-ads .with-avatar .tree-info { align-self: flex-start; }
.table-ads th, .table-ads td { padding-left: 8px; padding-right: 8px; }
.table-ads .col-problems { min-width: 230px; }
.table-ads .col-problems .badge + .ad-problems { margin-top: 6px; }

/* Object card: label / value rows instead of a grid of tiles. */
.adtree-detail { align-items: start; }
.detail-section { min-width: 0; }
.detail-state { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.detail-state .badge { flex: none; }
.detail-note { margin-top: 8px; }
.detail-section > .btn, .detail-section > .facts { margin-top: 8px; }
.detail-section > .detail-title + .facts { margin-top: 0; }
.adtree-detail .account-links { align-items: center; }
.creative { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.creative-pic { flex: none; width: 120px; height: 120px; border-radius: 8px; object-fit: cover; background: var(--hover); }
.creative-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.creative-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.creative-card { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.creative-card > div { min-width: 0; overflow-wrap: anywhere; }
/* «История изменений» of the object card: when · what · who. */
.history-list li { display: grid; grid-template-columns: 116px minmax(0, 1fr) minmax(0, 200px); gap: 2px 14px; padding: 5px 0; border-top: 1px solid var(--border); font-size: 13px; overflow-wrap: anywhere; }
.history-list li:first-child { border-top: 0; }
.history-time, .history-who { color: var(--text-muted); }
.history-list + .cell-sub { margin-top: 8px; }
@media (max-width: 760px) {
  .history-list li { grid-template-columns: 116px minmax(0, 1fr); }
  .history-who { grid-column: 2; }
}

/* CPC and CPM give way first, so that the tree and the ads list fit a 1280 px window. */
@media (max-width: 1500px) {
  .table-tree .col-wide-only, .table-ads .col-wide-only { display: none; }
}
@media (max-width: 980px) {
  .table-ads .col-ad { min-width: 220px; }
  .table-ads .col-problems { min-width: 200px; }
  .table-adlist .col-updated, .table-tree .col-updated { display: none; }
  .table-adlist .col-account-name { min-width: 130px; }
  .creative { flex-direction: column; }
}

.status-hint { margin: 0; color: var(--text-secondary); font-size: 13px; }
.idle-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; color: var(--text-secondary); }
.idle-note .btn { margin-left: auto; }
.state-line { margin: 0; color: var(--text-secondary); }
.card-body > .state-line { margin-bottom: 10px; }
.status-ribbon { display: flex; gap: 2px; height: 18px; border-radius: 5px; overflow: hidden; background: var(--hover); }
.ribbon-seg { flex: 1 1 0; min-width: 3px; height: 100%; }
.ribbon-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 6px; color: var(--text-muted); font-size: 12px; }
.ribbon-legend > :last-child { margin-left: auto; }
.ribbon-key { display: inline-flex; align-items: center; gap: 5px; color: var(--text-secondary); }
.card-body > .ribbon-legend + .table-wrap { margin-top: 12px; }
.chart-host + .facts-flat { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.table .col-time { white-space: nowrap; }
.tab-body > .kpis + .chart-note { margin-top: -6px; }

.card-hint { font-size: 12px; }
.table-actions .act-name { white-space: normal; }
.table-actions .act-indent-1 { padding-left: 26px; }
.table-actions .act-indent-2 { padding-left: 44px; }
.table-actions .act-indent-3 { padding-left: 62px; }
.act-part { margin-right: 6px; color: var(--text-muted); }
.act-prev { margin-right: 8px; font-size: 12px; }
.table-actions td .delta { min-width: 46px; justify-content: flex-end; }

.idle-card .card-body > .chart-note { margin: 0; font-size: 13px; }
.idle-card .card-body > .chart-note + .table-wrap { margin-top: 12px; }
.idle-card .card-head { flex-wrap: wrap; }
.idle-card .card-title { font-weight: 600; }

/* «По дням» inside the card of a campaign / ad set / ad: the chart card loses its own frame. */
.series { display: grid; gap: 12px; min-width: 0; }
.series-caption { font-size: 12px; }
.series-idle { margin: 0; font-size: 13px; }
.series-title { margin: 4px 0 -4px; }
.series .card { border: 0; background: none; }
.series .card-head { padding: 0; }
.series .card-body { padding: 8px 0 0; }
.series .kpi-value { font-size: 18px; }
.series .kpis { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

/* The tree and the ads list of a busy account fit a 1280 px window to the pixel: tighter cells. */
@media (max-width: 1500px) {
  .table-tree th, .table-tree td, .table-ads th, .table-ads td { padding-left: 6px; padding-right: 6px; }
}

/* ------------------------------------------------------- integration fixes */

/* The campaign tree of an account with long unbreakable cells was 3 px wider than its frame
 * at 1280 px: the name column gives up a few pixels (names wrap anyway). */
@media (max-width: 1500px) {
  .table-tree .tree-name { min-width: 248px; }
}

/* ------------------------------------------- round 4: account page, phone (track C) */

/* Compact header: four key facts, «Подробнее», one «Открыть в Facebook» menu, ‹ N из M ›. */
.account-head .facts-key { gap: 10px 20px; }
.facts-key .fact { min-width: 0; }
.facts-key .fact dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.facts-key .fact dd .cell-sub, .facts-key .fact dd .meter { font-weight: 400; }
.acct-more > summary {
  display: inline-flex; align-items: center; gap: 4px; min-height: var(--control-h-sm); list-style: none;
  color: var(--link); font-size: var(--fs-md); cursor: pointer;
}
.acct-more > summary::-webkit-details-marker { display: none; }
.acct-more > summary .icon { width: 14px; height: 14px; transition: transform 0.15s; }
.acct-more[open] > summary .icon { transform: rotate(180deg); }
.acct-more[open] > .facts { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.account-links { align-items: center; }
.fb-menu > summary { display: inline-flex; align-items: center; gap: 4px; }
.fb-menu > summary .icon { width: 14px; height: 14px; }
.fb-menu .menu-pop { left: 0; right: auto; }
.fb-menu .menu-item { display: flex; align-items: center; gap: 6px; color: var(--text); }
.fb-menu .menu-item .icon { width: 13px; height: 13px; margin-left: auto; color: var(--text-muted); }
.acct-pager { display: inline-flex; align-items: center; gap: 4px; }
.acct-pager-pos { min-width: 4.5em; color: var(--text-secondary); font-size: var(--fs-sm); text-align: center; font-variant-numeric: tabular-nums; }
.acct-step { padding: 0; width: var(--control-h-sm); justify-content: center; }
.acct-step .icon { width: 15px; height: 15px; }
.acct-step.is-disabled { opacity: 0.35; pointer-events: none; }
.account-head .chip { max-width: 100%; min-width: 0; }
.account-head .fact-phone { display: none; }
/* A fifth key fact (the Extras «Оценка аккаунта», .fact-wide) never sits alone on a second row
 * (round-5 review R1): five columns on a wide screen, three (3 + 2) on a narrow one. */
@media (min-width: 1024px) {
  .account-head .facts-key:has(> .fact-wide) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 641px) and (max-width: 1023px) {
  .account-head .facts-key:has(> .fact-wide) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Round 5 (plan5 V3): the one-row header of the phone (web/acct_page.js miniRow); wider screens
 * always show the full header. */
.acct-mini { display: none; }
.acct-mini-fact { display: inline-flex; flex: none; align-items: baseline; gap: 4px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-mini-label { color: var(--text-muted); font-size: var(--fs-xs); font-weight: 500; }
.acct-mini-bill { align-items: center; gap: 6px; color: var(--text-secondary); font-size: var(--fs-sm); }
.acct-mini-bill .meter { width: 40px; min-width: 0; margin: 0; }
.acct-mini-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--tap); height: var(--tap);
  margin: 0 -10px 0 auto; padding: 0; border: 0; background: none; color: var(--link); cursor: pointer;
}
.acct-mini-toggle .icon { width: 18px; height: 18px; transition: transform 0.15s; }
.acct-mini-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }

/* The tab row right under the header. */
.account-tabs { min-width: 0; }
.account-tabs .tabs { margin: 0; }

/* «Статистика»: two tile groups, the breakdowns, the pixel line. */
/* Scoped to the account page: the overview has its own rules (screens.css). */
.account-view .kpi-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
/* Each group is one row from 700 px of content up (5 tiles at most), so no tile is left alone. */
.account-view .kpi-groups .kpi-group > .kpis { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
.account-view .kpi-group .kpi-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-view .kpi-group-title { margin: 0; }
/* Six tiles in a group (Extras «Исходящие клики» in «Показы и клики») where six do not fit one row:
 * 3 + 3, never 5 + 1 (round-5 review R2). */
@media (min-width: 641px) and (max-width: 1279px) {
  .account-view .kpi-groups .kpi-group > .kpis:has(> .kpi:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.breakdowns { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.section-head { margin: 6px 0 0; font-size: var(--fs-lg); font-weight: 700; }
.breakdowns > .toolbar-text { margin: -4px 0 0; }
.breakdown-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pixel-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 12px 16px; }
.pixel-line-name { font-weight: 600; }
.pixel-line-value { flex: 1 1 auto; min-width: 0; }
.pixel-line-value .cell-sub { display: inline; margin-left: 8px; }
/* V-20: names of the actions wrap between words, never inside one. */
.table-actions .act-name { min-width: 180px; overflow-wrap: break-word; word-break: normal; hyphens: manual; }

/* «История»: one timeline by day. */
.timeline .tl-day {
  display: block; padding: 10px 0 4px; border-top: 0; color: var(--text-secondary); font-size: var(--fs-sm); font-weight: 600;
}
.timeline .tl-day:first-child { padding-top: 0; }
.tl-source { color: var(--text-muted); }
.tl-journal.is-bad .tl-source { color: var(--bad); }
.tl-note { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 10px; font-size: var(--fs-md); }
.tl-note .icon { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.kpis-billing { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* Phone-only columns of card tables (the card rule shows them again at ≤ 640 px). */
.table .col-m-only { display: none; }

/* The object card as a full-screen sheet: sections stack and fold, label | value rows. */
.object-sheet .adtree-detail { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 0; background: none; }
.object-sheet .adtree-detail > * { width: auto; min-width: 0; }
.dialog.object-sheet .facts { grid-template-columns: minmax(0, 1fr); }
.object-sheet .detail-section { padding: 0; border-top: 1px solid var(--border); }
.object-sheet .detail-section:first-child { border-top: 0; }
.detail-fold > summary {
  display: flex; align-items: center; justify-content: space-between; min-height: var(--tap); list-style: none;
  font-size: var(--fs-base); font-weight: 700; cursor: pointer;
}
.detail-fold > summary::-webkit-details-marker { display: none; }
.detail-fold > summary::after { content: "▾"; color: var(--text-muted); transition: transform 0.15s; }
.detail-fold[open] > summary::after { transform: rotate(180deg); }
.detail-fold[open] { padding-bottom: 12px; }
.object-sheet .creative { flex-direction: column; }
.object-sheet .creative-pic { width: 100%; height: auto; max-height: 60vh; aspect-ratio: 1 / 1; }
.object-sheet .history-list li { grid-template-columns: minmax(0, 1fr); }
.object-sheet .history-who { grid-column: auto; }
.object-sheet .account-links .btn { min-height: var(--tap); }

@media (max-width: 640px) {
  .account-view > .back-link { display: none; }             /* the app bar has the back arrow */
  .account-head { padding: 12px; gap: 10px; }
  .account-title { gap: 6px; }
  /* Name and status on one line when they fit; the ID is the first fact of «Подробнее»
   * (review F-05: the tabs must be on the first screen at 360 × 780). */
  .account-name { flex: 0 1 auto; min-width: 0; font-size: var(--fs-lg); overflow-wrap: anywhere; }
  .account-title > .copy-id { display: none; }
  .account-links .csv-what { display: none; }            /* «CSV» fits next to «Открыть в Facebook» */
  .account-head .fact-phone { display: block; }
  .account-head .fact-wide { display: none; }            /* minor Extras facts move under «Подробнее» */
  /* Key facts keep one line each (the whole value is in «Подробнее» or on its tab). */
  .account-head .facts-key .fact dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-title > .toolbar-spacer { display: none; }
  .account-links { gap: 8px; }
  .account-links > .btn, .fb-menu > summary { min-height: var(--tap); }
  .acct-step { width: var(--tap); min-height: var(--tap); }
  .acct-more > summary { min-height: var(--tap); }
  .account-head .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
  /* Round 5 (plan5 V3): on every tab but «Статистика» the header is one row; «Подробнее» unfolds it. */
  .account-head.is-foldable .acct-mini { display: flex; align-items: center; gap: 4px 12px; min-width: 0; }
  .account-head.is-foldable:not(.is-folded) .acct-mini { padding-bottom: 10px; border-bottom: 1px solid var(--border); }
  .account-head.is-folded { padding-top: 0; padding-bottom: 0; }
  .account-host { gap: 10px; }
  .account-head.is-folded > :not(.acct-mini) { display: none; }
  /* The tabs stay under the app bar while the tab scrolls. */
  .account-tabs {
    position: sticky; top: calc(var(--appbar-h) + var(--safe-top)); z-index: 20;
    margin: 0 calc(-1 * var(--view-pad, 12px)); padding: 0 var(--view-pad, 12px); background: var(--bg);
  }
  .account-tabs .tab { min-height: var(--tap); align-items: center; }
  .account-view .kpi-groups .kpi-group > .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .account-view .kpi-groups .kpi-group > .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .breakdown-chips .fchips, .adtree .toolbar-chips .fchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .breakdown-chips .fchips::-webkit-scrollbar, .adtree .toolbar-chips .fchips::-webkit-scrollbar { display: none; }
  .breakdown-chips, .adtree .toolbar-chips { min-width: 0; max-width: 100%; }
  .adtree .toolbar-chips { flex: 1 1 100%; }

  /* Tree and ads as cards (plan 2.10): 12 px indent per level, the delivery state as the badge,
   * its reason under the name, the budget as a sub-line, Расход / Результаты / Цена as metrics. */
  .table-tree.is-cards .tree-name { min-width: 0; padding-left: 0; }
  .table.is-cards .tree-text, .table.is-cards .tree-text a, .table-adlist.is-cards .acc-name { overflow-wrap: anywhere; }
  .table-tree.is-cards tr.tree-row-1 { margin-left: 12px; }
  .table-tree.is-cards tr.tree-row-2 { margin-left: 24px; }
  .table-tree.is-cards tr.tree-row-1, .table-tree.is-cards tr.tree-row-2 { background: var(--surface); }
  .table-tree.is-cards tr.tree-row-1 > td, .table-tree.is-cards tr.tree-row-2 > td { background: none; }
  .pixel-line .card-link { display: inline-flex; align-items: center; min-height: var(--tap); }
  .table-tree.is-cards td.col-tree { position: static; background: none; }
  .table-tree.is-cards td.m-badge .tree-why, .table-ads.is-cards td.m-badge .ad-problems { display: none; }
  .table-tree.is-cards td.col-budget, .table-tree.is-cards td.col-budget .cell-sub { max-width: none; text-align: left; color: var(--text-secondary); }
  .table-tree.is-cards td.m-sub:empty, .table-ads.is-cards td.m-sub:empty { display: none; }
  .table-tree.is-cards .tree-toggle, .table-tree.is-cards .tree-info, .table-ads.is-cards .tree-info { width: var(--tap); height: var(--tap); margin: -10px -8px -10px 0; }
  .table-tree.is-cards .tree-toggle { margin: -10px 0 -10px -10px; }
  .table-tree.is-cards .tree-spacer { display: none; }
  .table-ads.is-cards .col-problems, .table-ads.is-cards .col-ad, .table-adlist.is-cards .col-account-name { min-width: 0; max-width: none; }
  .table-adlist.is-cards td.col-updated { display: block; }
  .table-adlist.is-cards .ad-problems > .ad-problem:nth-child(n+2) { display: none; }
  .ad-problems-first .cell-sub { margin-top: 2px; }
  .adlist-controls .seg, .adlist-controls .adlist-chips { display: none; }
  /* Round 5 (plan5 V5): no note above the list on a phone; search on its own row, then «Что
   * показать» and a compact CSV side by side. */
  .adlist-intro { display: none; }
  .adlist-controls > .toolbar > .search { flex: 1 1 100%; }
  .adlist-controls > .toolbar > .toolbar-sheet-btn { flex: 1 1 0; min-width: 0; justify-content: flex-start; overflow: hidden; white-space: nowrap; }
  .adlist-controls > .toolbar > .adlist-csv { flex: none; }
  .adlist-controls .toolbar-sheet-btn .btn-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .adtree > .toolbar > .toolbar-text, .adtree > .toolbar > .toolbar-spacer { display: none; }
  .toolbar-sheet-btn .icon { width: 15px; height: 15px; }
  .seg-wrap { flex-wrap: wrap; }

  /* Billing and history. */
  .kpis-billing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline .event { gap: 8px; }
  .ribbon-legend > :last-child { margin-left: 0; }

  /* Actions of the period as cards: name over the numbers; parts indented under their row. */
  .table-actions.is-cards tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-actions.is-cards tr.act-part-row { margin-left: 12px; }
  .table-actions.is-cards tr.act-part-2, .table-actions.is-cards tr.act-part-3 { margin-left: 24px; }
  .table-actions.is-cards .act-name { min-width: 0; padding-left: 0; font-weight: 600; }
  .table-actions.is-cards .act-part { display: none; }
  .table-actions.is-cards tr.group-row > th { display: block; padding: 8px 0 0; border: 0; background: none; text-align: left; }
  .table-actions.is-cards td .delta { min-width: 0; justify-content: flex-start; }
}

/* Touch: the hints and the copy buttons of the account page are 44 px targets (glyphs unchanged). */
@media (pointer: coarse) {
  /* The 44 px comes from the shared transparent-border rule of styles.css; a padding here as well made
   * a hinted fact label 14 px lower than its neighbours (round 5 fix). */
  .account-view .hint, .object-sheet .hint { display: inline-block; }
  .account-view .copy-id, .object-sheet .copy-id { min-height: var(--tap); }
  /* A badge keeps its look: the transparent border is the rest of the target. */
  .account-view .badge.hint { padding: 2px 8px; border: 12px solid transparent; border-left-width: 0; border-right-width: 0; margin: -12px 0; border-radius: 22px; background-clip: padding-box; }
}
@media (pointer: coarse) {
  .account-view a.chip { border: 13px solid transparent; border-left-width: 0; border-right-width: 0; margin: -13px 0; border-radius: 23px; background-clip: padding-box; }
  .account-view .chips:has(> a.chip) { row-gap: 0; }
}

/* A phone held sideways (844 × 390, the tablet tier with little height; review F-06): #/ads folds
 * its level and buckets into «Что показать» as on the phone and its note into one line, so the
 * first row is on the first screen. Same query as COMPACT_QUERY in web/present.js. */
@media (max-width: 1023px) and (max-height: 500px) {
  .adlist-controls .toolbar-sheet-btn { display: inline-flex; }
  .adlist-controls .seg, .adlist-controls .adlist-chips { display: none; }
  .adlist-intro { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* A touch tablet held upright (round 5, plan5 V6): #/ads folds its level and buckets into «Что
 * показать» as on the phone. Same query as COMPACT_QUERY in web/present.js (its third part). */
@media (max-width: 1023px) and (hover: none) and (pointer: coarse) {
  .adlist-controls .toolbar-sheet-btn { display: inline-flex; }
  .adlist-controls .seg, .adlist-controls .adlist-chips { display: none; }
  .adlist-intro { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .acct-mini-toggle .icon { transition: none; }
}
