/* Eagle panel — small additions on top of AdminLTE 4. */

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('../vendor/fonts/cairo-arabic-400-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('../vendor/fonts/cairo-arabic-600-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('../vendor/fonts/cairo-arabic-700-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('../vendor/fonts/cairo-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('../vendor/fonts/cairo-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('../vendor/fonts/cairo-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bs-body-font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}

/* Amounts, ids and dates line up in tables. */
.table td,
.small-box h3,
.info-box-number {
  font-variant-numeric: tabular-nums;
}

/* Left-to-right fragments (amounts, emails, ids) inside RTL pages. */
.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.detail-table th {
  width: 35%;
  font-weight: 600;
  color: var(--bs-secondary-color);
}

/*
 * Long URLs and tokens break anywhere: "break-word" does not lower a table's minimum width, so an
 * unbroken webhook URL would widen the page on a phone. Set on the cell's children too: Bootstrap
 * gives <code> and .text-break (!important) their own "break-word".
 */
.detail-table td,
.detail-table td *,
.table-wrap td,
.table-wrap td * {
  overflow-wrap: anywhere !important;
}

.detail-table pre,
.cell-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
}

/*
 * Phones: a label beside its value in a 35% column wrapped the labels over three or four lines, so
 * each row of a .detail-table-stack becomes one line holding the label at the start and the value
 * at the end, like a receipt. A value too long for the room the label leaves (an address, a pasted
 * text) moves under its label, full width, and starts where the label starts: the inner paddings
 * are set with !important, like the .ps-3 / .pe-3 utilities that give the outer ones, and over
 * AdminLTE's 1.5rem on the cells of a table in a .card-body.p-0. Rows a page leaves out on phones
 * (.detail-row-empty) are hidden, and the lines between rows skip them.
 */
@media (max-width: 575.98px) {
  .detail-table-stack,
  .detail-table-stack > tbody {
    display: block;
    width: auto;
  }

  .detail-table-stack > tbody > tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.75rem;
    row-gap: 0.125rem;
    padding-block: 0.375rem;
    background-color: var(--bs-table-bg);
  }

  .detail-table-stack > tbody > tr:not(.detail-row-empty) ~ tr:not(.detail-row-empty) {
    border-top: var(--bs-border-width) solid var(--bs-table-border-color);
  }

  .detail-table-stack > tbody > tr.detail-row-empty {
    display: none;
  }

  .detail-table-stack > tbody > tr > th,
  .detail-table-stack > tbody > tr > td {
    width: auto;
    min-width: 0;
    max-width: 100%;
    padding-block: 0;
    border-bottom-width: 0;
  }

  .detail-table-stack > tbody > tr > th {
    flex: 1 1 auto;
    padding-inline-end: 0 !important;
    font-size: 0.8125rem;
  }

  .detail-table-stack > tbody > tr > td {
    flex: 0 1 auto;
    margin-inline-start: auto;
  }

  .detail-table-stack > tbody > tr > td.pe-3 {
    padding-inline-start: 1rem !important;
  }

  .detail-table-stack > tbody > tr > td.pe-0 {
    padding-inline-start: 0 !important;
  }
}

.grid-actions {
  white-space: nowrap;
}

/*
 * Phones: a list (panel/grid.html.twig) is a column of cards instead of a table three screens wide,
 * whose status and buttons were only reached by swiping sideways (from the right in Arabic). The
 * first column is the card's title; every other value is a line with its column's name (data-label)
 * at the start and the value at the end, like .detail-table-stack; the row's buttons close the card.
 * The column headers (sorting) are left out, the «تحديد الكل» box stays. A row's own colour
 * (.table-danger…) paints the whole card: the cells are transparent and the stripes dropped.
 *
 * The pages' own tables get the same cards (.table-stack, set by layout/_scripts.html.twig on a
 * phone when a table has four columns or more, or does not fit): the labels come from its header
 * row, and a cell under an empty header (buttons) or spanning columns has none.
 */
@media (max-width: 767.98px) {
  :is(.grid-table, .table-stack),
  :is(.grid-table, .table-stack) > thead,
  :is(.grid-table, .table-stack) > thead > tr,
  :is(.grid-table, .table-stack) > tbody,
  .table-stack > tfoot {
    display: block;
    width: 100%;
  }

  :is(.grid-table, .table-stack) > thead > tr > th:not(.grid-select) {
    display: none;
  }

  .grid-table > thead > tr > th.grid-select {
    display: block;
    width: auto !important;
    padding: 0.5rem 1rem;
  }

  :is(.grid-table, .table-stack) > tbody > tr,
  .table-stack > tfoot > tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--bs-table-color);
    background-color: var(--bs-table-bg);
    border-bottom: var(--bs-border-width) solid var(--bs-table-border-color);
  }

  :is(.grid-table, .table-stack) > tbody > tr:last-child,
  .table-stack > tfoot > tr:last-child {
    border-bottom: 0;
  }

  .table-stack > tbody + tfoot {
    border-top: var(--bs-border-width) solid var(--bs-table-border-color);
  }

  /* A value too long for the room its label leaves moves under the label (.detail-table-stack). */
  .grid-table > tbody > tr > td,
  .table-stack > :is(tbody, tfoot) > tr > :is(td, th) {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.75rem;
    min-width: 0;
    padding: 0.125rem 0 !important;
    text-align: start !important;
    white-space: normal;
    background-color: transparent;
    border: 0;
    box-shadow: none;
  }

  .grid-table > tbody > tr > td::before,
  .table-stack > :is(tbody, tfoot) > tr > :is(td, th)::before {
    content: attr(data-label);
    flex: 0 1 auto;
    /* Pushes the value to the end even when a page script replaced the cell's .grid-value. */
    margin-inline-end: auto;
    color: var(--bs-secondary-color);
    font-size: 0.8125rem;
    font-weight: normal;
  }

  .table-stack > :is(tbody, tfoot) > tr > :is(td, th)[data-label=""]::before {
    display: none;
  }

  .grid-table > tbody > tr > td > .grid-value,
  .table-stack > :is(tbody, tfoot) > tr > :is(td, th) > .grid-value {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    margin-inline-start: auto;
    overflow-wrap: anywhere;
  }

  /* Buttons and other cells without a column name start the line. */
  .table-stack > :is(tbody, tfoot) > tr > :is(td, th)[data-label=""] > .grid-value {
    margin-inline-start: 0;
  }

  .grid-table > tbody > tr > td.grid-select {
    flex: 0 0 auto;
  }

  .grid-table > tbody > tr > td.grid-title {
    flex: 1 1 0;
    padding-bottom: 0.25rem !important;
    font-size: 1.0625rem;
  }

  .grid-table > tbody > tr > td.grid-title > .grid-value {
    margin-inline-start: 0;
  }

  .grid-table > tbody > tr > td.grid-actions {
    gap: 0.375rem;
    padding-top: 0.5rem !important;
    white-space: normal;
  }

  .grid-table > tbody > tr > td.grid-select::before,
  .grid-table > tbody > tr > td.grid-title::before,
  .grid-table > tbody > tr > td.grid-actions::before {
    display: none;
  }

  .grid-table > tbody > tr > td.grid-actions:not(:has(a, button)) {
    display: none;
  }

  .grid-table > tbody > tr > td.grid-actions .btn {
    min-width: 2.5rem;
  }

  /* DataTables (js/grid-datatable.js) paints each cell (stripes, hover) and clears the row: on a
     card only the row is painted, so a row's own colour (.table-danger) still fills the card. */
  table.dataTable.grid-table > tbody > tr {
    background-color: var(--bs-table-bg) !important;
  }

  table.dataTable.grid-table > tbody > tr > td {
    background-color: transparent !important;
    box-shadow: none !important;
  }
}

/*
 * A client-side list is a DataTables table (js/grid-datatable.js). Its cells keep the panel's
 * alignment (DataTables pushes numbers and dates to the right, which is the wrong side in English
 * and puts the arrows first in Arabic); its info line, rows-per-page choice and pages sit in the
 * card footer, out of DataTables' own container, so they are styled here.
 */
table.dataTable.grid-table :is(th, td):is(.dt-type-numeric, .dt-type-date) {
  text-align: start;
}

table.dataTable.grid-table th:is(.dt-type-numeric, .dt-type-date) div.dt-column-header {
  flex-direction: row;
}

table.dataTable.grid-table > thead > tr > th div.dt-column-header {
  gap: 0.25rem;
  justify-content: flex-start;
}

table.dataTable.grid-table > thead > tr > th.grid-actions-col div.dt-column-header {
  justify-content: flex-end;
}

.grid-dt-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.grid-dt-footer .grid-dt-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.grid-dt-footer .dt-info {
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
}

.grid-dt-footer .dt-length {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.grid-dt-footer .dt-length label {
  margin: 0;
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
  white-space: nowrap;
}

.grid-dt-footer .dt-length select {
  width: auto;
}

.grid-dt-footer .dt-paging {
  margin-inline-start: auto;
}

.grid-dt-footer .dt-paging .pagination {
  --bs-pagination-padding-x: 0.5rem;
  --bs-pagination-padding-y: 0.25rem;
  --bs-pagination-font-size: 0.875rem;
  flex-wrap: wrap;
  margin: 0;
}

/*
 * Dark mode: Bootstrap's coloured rows (.table-danger for a deleted accountant, .table-warning…)
 * stay pastel with black text, so the panel's light links and grey text on them could not be read.
 * They take the theme's dark tint instead, with the page's own text colour.
 */
[data-bs-theme="dark"] :is(.table-primary, .table-secondary, .table-success, .table-info, .table-warning, .table-danger) {
  --bs-table-color: var(--bs-body-color);
  --bs-table-striped-color: var(--bs-body-color);
  --bs-table-active-color: var(--bs-body-color);
  --bs-table-hover-color: var(--bs-body-color);
  --bs-table-striped-bg: rgba(var(--bs-emphasis-color-rgb), 0.05);
  --bs-table-active-bg: rgba(var(--bs-emphasis-color-rgb), 0.1);
  --bs-table-hover-bg: rgba(var(--bs-emphasis-color-rgb), 0.075);
}

[data-bs-theme="dark"] .table-primary { --bs-table-bg: var(--bs-primary-bg-subtle); --bs-table-border-color: var(--bs-primary-border-subtle); }
[data-bs-theme="dark"] .table-secondary { --bs-table-bg: var(--bs-secondary-bg-subtle); --bs-table-border-color: var(--bs-secondary-border-subtle); }
[data-bs-theme="dark"] .table-success { --bs-table-bg: var(--bs-success-bg-subtle); --bs-table-border-color: var(--bs-success-border-subtle); }
[data-bs-theme="dark"] .table-info { --bs-table-bg: var(--bs-info-bg-subtle); --bs-table-border-color: var(--bs-info-border-subtle); }
[data-bs-theme="dark"] .table-warning { --bs-table-bg: var(--bs-warning-bg-subtle); --bs-table-border-color: var(--bs-warning-border-subtle); }
[data-bs-theme="dark"] .table-danger { --bs-table-bg: var(--bs-danger-bg-subtle); --bs-table-border-color: var(--bs-danger-border-subtle); }

/*
 * A <select>'s own list on a computer (Chrome, Edge and Firefox draw it from the options' colours)
 * came black on black for the admin (/admin/bot/…/modify): the list took a dark background while
 * the options kept the page's dark text, as when a browser or system dark mode is laid over the
 * page. Every option now carries both colours of the panel's theme, so the list is drawn the way
 * the page looks, light or dark, whatever the browser does to its background.
 */
select option,
select optgroup {
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
}

select option:disabled {
  color: var(--bs-secondary-color);
}

/*
 * Readable colours in both themes. Bootstrap keeps one shade per colour: on the dark theme's cards
 * grey, blue, green and red text and outline buttons came to about 3:1, and on white the yellow and
 * cyan outline buttons to under 2:1 («شحن موبايل», «مزامنة الحسابات»). Text and outline buttons take
 * the theme's *-text-emphasis shade instead (the same colour, dark on light and light on dark), as
 * the pages' own text already does with .text-warning-emphasis. Filled buttons and badges keep theirs.
 */
[data-bs-theme="dark"] .text-secondary { color: var(--bs-secondary-color) !important; }
[data-bs-theme="dark"] .text-primary { color: var(--bs-primary-text-emphasis) !important; }
[data-bs-theme="dark"] .text-success { color: var(--bs-success-text-emphasis) !important; }
[data-bs-theme="dark"] .text-danger { color: var(--bs-danger-text-emphasis) !important; }

/* …except inside a light badge (.text-bg-light), which stays light in the dark theme too. */
[data-bs-theme="dark"] .text-bg-light .text-secondary,
[data-bs-theme="dark"] .text-bg-light.text-secondary { color: #6c757d !important; }
[data-bs-theme="dark"] .text-bg-light .text-success { color: #146c43 !important; }
[data-bs-theme="dark"] .text-bg-light .text-danger { color: #b02a37 !important; }
[data-bs-theme="dark"] .text-bg-light .text-primary { color: #0a58ca !important; }

[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--bs-primary-text-emphasis); --bs-btn-disabled-color: var(--bs-primary-text-emphasis); }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: var(--bs-secondary-color); --bs-btn-disabled-color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .btn-outline-success { --bs-btn-color: var(--bs-success-text-emphasis); --bs-btn-disabled-color: var(--bs-success-text-emphasis); }
[data-bs-theme="dark"] .btn-outline-danger { --bs-btn-color: var(--bs-danger-text-emphasis); --bs-btn-disabled-color: var(--bs-danger-text-emphasis); }
.btn-outline-warning { --bs-btn-color: var(--bs-warning-text-emphasis); --bs-btn-disabled-color: var(--bs-warning-text-emphasis); }
.btn-outline-info { --bs-btn-color: var(--bs-info-text-emphasis); --bs-btn-disabled-color: var(--bs-info-text-emphasis); }

/* The «المزيد» line of a cyan or yellow dashboard box: dark like the box's own text, not white. */
.small-box:is(.text-bg-info, .text-bg-warning) > .small-box-footer {
  color: rgba(0, 0, 0, 0.75) !important;
}

/*
 * The dropdown list the page draws on phones (public/js/select-sheet.js): a sheet from the bottom of
 * the screen, a box in the middle of a wider one, in the panel's colours. Above Bootstrap's modals,
 * whose fields it can serve too.
 */
.select-sheet {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.select-sheet-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.select-sheet-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: min(75vh, 36rem);
  padding-bottom: env(safe-area-inset-bottom);
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  border-radius: 1rem 1rem 0 0;
  outline: 0;
  box-shadow: 0 -0.5rem 2rem rgba(0, 0, 0, 0.3);
}

@media (min-width: 576px) {
  .select-sheet {
    align-items: center;
    justify-content: center;
  }

  .select-sheet-panel {
    width: min(30rem, calc(100% - 2rem));
    border-radius: 1rem;
  }
}

.select-sheet-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem 0.625rem;
}

.select-sheet-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-sheet-search {
  padding: 0 1rem 0.625rem;
}

.select-sheet-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: var(--bs-border-width) solid var(--bs-border-color);
}

.select-sheet-list .list-group-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  text-align: start;
  overflow-wrap: anywhere;
}

.select-sheet-list .list-group-item > .bi {
  margin-inline-start: auto;
}

.select-sheet-list .select-sheet-group {
  min-height: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  background-color: var(--bs-tertiary-bg);
}

html.select-sheet-open,
html.select-sheet-open body {
  overflow: hidden;
}

/*
 * Wider than a phone, the list hangs under its field like the browser's own (select-sheet.js sets
 * its place and size): no dimmed backdrop and no title, a click outside closes it.
 */
.select-sheet.select-sheet-anchored {
  display: block;
}

.select-sheet-anchored .select-sheet-backdrop {
  background-color: transparent;
}

.select-sheet-anchored .select-sheet-panel {
  position: fixed;
  padding-bottom: 0;
  overflow: hidden;
  border: var(--bs-border-width) solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow);
}

.select-sheet-anchored .select-sheet-head {
  display: none;
}

.select-sheet-anchored .select-sheet-search {
  padding: 0.5rem;
}

.select-sheet-anchored .select-sheet-list {
  border-top: 0;
}

.select-sheet-anchored .select-sheet-list .list-group-item {
  min-height: 2.25rem;
  padding-block: 0.375rem;
}

/*
 * The scroller must hold the absolutely positioned bits of its table (.visually-hidden labels):
 * otherwise they belong to the card, escape the clipping and, in RTL, widen the whole page on a
 * phone, so the page scrolls sideways and the off-canvas sidebar shows as if fixed.
 */
.table-responsive {
  position: relative;
}

.table th a.sort-link {
  color: inherit;
  text-decoration: none;
}

/* Auth pages: the QR code needs a light background in dark mode too. */
.qr-box {
  display: flex;
  justify-content: center;
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.5rem;
}

.qr-box svg {
  width: 220px;
  height: 220px;
}

/* QR code of an account to pay to (withdrawal payout): scanned with the wallet app. */
.qr-box.qr-box-sm {
  display: inline-flex;
}

.qr-box.qr-box-sm svg {
  width: 160px;
  height: 160px;
}

/*
 * The account to pay to when it is a long address (ShamCash: 32 characters): as large as a short
 * one (.fs-5) from 576px up, smaller on a phone so that it keeps to one line there.
 */
.payout-account-long {
  font-size: clamp(0.75rem, 3.9vw, 1.25rem);
}

.code-input {
  font-size: 1.5rem;
  letter-spacing: 0.4rem;
  text-align: center;
  direction: ltr;
}

/* Profile picture (layout/_avatar.html.twig): always a circle, never stretched. */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--bs-secondary-bg);
}

/* Sidebar groups (PanelMenu): a group's counter only while it is folded; open, its links show their own. */
.sidebar-menu .nav-group.menu-open > .nav-link .nav-badge {
  display: none !important;
}

/* Indented, a long label inside a group takes two lines rather than losing its end. */
.sidebar-menu .nav-treeview .nav-link p {
  white-space: normal;
}

/*
 * The menu on a phone or tablet (below AdminLTE's lg) slides over the page. In Arabic it covered
 * the ☰ button that opened it, the page behind was barely dimmed and still scrolled: it now has
 * its own ✕ (.sidebar-close), a darker backdrop that closes it, and the page stays still under it.
 */
.sidebar-close {
  display: none;
}

@media (max-width: 991.98px) {
  .app-sidebar .sidebar-brand {
    position: relative;
  }

  .sidebar-close {
    position: absolute;
    top: 50%;
    inset-inline-end: 0.75rem;
    display: block;
    padding: 0.625rem;
    transform: translateY(-50%);
  }

  .sidebar-expand-lg.sidebar-open .sidebar-overlay {
    background-color: rgba(0, 0, 0, 0.5);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .app-sidebar .sidebar-wrapper {
    overscroll-behavior: contain;
  }

  .sidebar-menu .nav-link {
    padding-block: 0.625rem;
  }
}

/* Phones: the page title and its path take less of the screen. */
@media (max-width: 575.98px) {
  .app-content-header {
    padding-block: 0.75rem;
  }

  .app-content-header h1 {
    font-size: 1.375rem !important;
  }

  .app-content-header .breadcrumb {
    font-size: 0.8125rem;
  }
}

/* Admin "add bot" guide: readable step lists next to the form. */
.guide-list > li + li {
  margin-top: 0.4rem;
}

.bot-guide .accordion-button {
  font-weight: 600;
}

/* Technical support: inbox rows and chat bubbles (customer at the start, accountant at the end). */
.support-row-unread {
  background: var(--bs-primary-bg-subtle);
}

.support-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
  font-size: 1.25rem;
}

.min-w-0 {
  min-width: 0;
}

.support-thread {
  height: min(60vh, 36rem);
  overflow-y: auto;
  background: var(--bs-tertiary-bg);
}

.support-msg {
  display: flex;
  margin-bottom: 0.6rem;
}

.support-msg-in {
  justify-content: flex-start;
}

.support-msg-out {
  justify-content: flex-end;
}

.support-bubble {
  max-width: min(80%, 32rem);
  padding: 0.5rem 0.75rem;
  border-radius: 0.9rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color-translucent);
  box-shadow: 0 1px 1px rgb(0 0 0 / 5%);
}

.support-msg-out .support-bubble {
  background: var(--bs-primary-bg-subtle);
  border-color: var(--bs-primary-border-subtle);
}

.support-text {
  white-space: normal;
  word-break: break-word;
}

.support-meta {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
}

.support-photo {
  display: block;
  max-width: 100%;
  max-height: 18rem;
  border-radius: 0.5rem;
  margin-bottom: 0.25rem;
}

.support-audio {
  max-width: 100%;
}

.support-bell-menu {
  min-width: 18rem;
}

.support-bell-item {
  white-space: normal;
}

/* Notification bell and «Notifications» page (accountant/notification_center). */
.notification-bell-menu {
  width: 24rem;
  max-width: calc(100vw - 1rem);
}

.notification-bell-list {
  max-height: min(65vh, 30rem);
  overflow-y: auto;
}

.notification-bell-list .notification-item {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.notification-bell-list .notification-item + .notification-item {
  border-top: 1px solid var(--bs-border-color-translucent);
}

.notification-unread {
  background-color: var(--bs-primary-bg-subtle);
}

.notification-dot {
  flex: 0 0 0.5rem;
  height: 0.5rem;
  margin-top: 0.45rem;
  border-radius: 50%;
}

.notification-unread .notification-dot {
  background-color: var(--bs-primary);
}

.notification-text {
  min-width: 0;
}

.notification-body {
  white-space: pre-line;
}

.notification-bell-list .notification-body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.notification-bell-ring {
  animation: notification-bell-ring 0.9s ease-in-out;
  transform-origin: 50% 0;
}

@keyframes notification-bell-ring {
  0%, 100% { transform: rotate(0); }
  15%, 45%, 75% { transform: rotate(14deg); }
  30%, 60%, 90% { transform: rotate(-14deg); }
}

@media (prefers-reduced-motion: reduce) {
  .notification-bell-ring {
    animation: none;
  }
}

/* Phones: the list spans the screen under the navbar instead of hanging off the bell. */
@media (max-width: 575.98px) {
  #notification-bell {
    position: static;
  }

  .app-header .navbar-nav .notification-bell-menu[data-bs-popper] {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    max-width: none;
  }
}

/* Account statement: printable on its own (no panel chrome, every column visible). */
@media print {
  .app-sidebar,
  .app-header,
  .app-footer,
  .app-content-header,
  .no-print,
  .toast-container,
  .alert-dismissible {
    display: none !important;
  }

  .app-main,
  .app-wrapper {
    margin: 0 !important;
    padding: 0 !important;
  }

  .statement-table {
    font-size: 11px;
  }

  .statement-table .d-none {
    display: table-cell !important;
  }
}

/* Installed app (public/js/pwa.js): no link previews or "open in Safari" callouts on iPhone. */
.pwa-standalone a {
  -webkit-touch-callout: none;
}

/*
 * Dialogs: AdminLTE's reduced-motion rule (.fade { opacity: 1 !important }) would turn the dim
 * backdrop solid black on devices with "reduce motion" on.
 */
.modal-backdrop.show {
  opacity: var(--bs-backdrop-opacity) !important;
}

/* The same for sheets (offcanvas), e.g. a chat's details on a phone. */
.offcanvas-backdrop.show {
  opacity: 0.5 !important;
}

/* Corner button to install the app (layout/_pwa_install.html.twig), under dialogs and alerts. */
.pwa-install-fab {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  inset-inline-end: 1rem;
  z-index: 1035;
}

/*
 * Auth screens (layout/auth.html.twig): brand artwork behind the card. The template hands the file
 * over in --login-bg so the URL still goes through Twig's asset(). The scrim on top of it keeps the
 * card and the corner toggles readable whatever the artwork happens to show.
 */
.login-page-bg {
  background-color: #1a1a1a;
  background-image: linear-gradient(rgba(10, 10, 10, 0.55), rgba(10, 10, 10, 0.55)), var(--login-bg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.login-page-bg .login-box .card {
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.5);
}

/* The toggles sit straight on the artwork, where the body link colour has no contrast left. */
.login-page-bg .nav-link {
  color: rgba(255, 255, 255, 0.85);
}

.login-page-bg .nav-link:hover,
.login-page-bg .nav-link:focus {
  color: #fff;
}

/*
 * The bar at the top of the public home page (security/_login_bar.html.twig, DESIGN.md §9.31). Like
 * the corner toggles of the plain login page it sits on dark artwork, so it stays light on dark in
 * both themes. On phones the bot and channel names scroll sideways on one line.
 */
.login-bar {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: 0.9rem;
  background: rgba(10, 10, 10, 0.62);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
}

.login-bar-main {
  display: flex;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.35rem 0.75rem;
}

.login-bar-facts {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.25rem;
  min-width: 0;
}

.login-bar-fact {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.login-bar-fact > .bi {
  color: #ffc107;
}

.login-bar-fact-label,
.login-bar-group-label {
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}

.login-bar-value {
  color: #fff;
  overflow-wrap: anywhere;
}

.login-bar-doc {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.7rem;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(13, 110, 253, 0.9);
  border-radius: 50rem;
}

.login-bar-doc:hover,
.login-bar-doc:focus-visible {
  color: #fff;
  background: #0b5ed7;
}

.login-bar-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.75rem;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  white-space: nowrap;
  background: #ffc107;
  border-radius: 50rem;
}

.login-bar-cta:hover,
.login-bar-cta:focus-visible {
  color: #1a1a1a;
  background: #ffcd39;
}

.login-bar-contacts {
  gap: 0.15rem;
}

.login-bar-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  font-size: 1rem;
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.login-bar-contact:hover,
.login-bar-contact:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.28);
}

.login-bar-tools {
  flex: 0 0 auto;
  margin-inline-start: auto;
}

.login-bar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  padding: 0.4rem 0.75rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.login-bar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
}

.login-bar-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.login-bar-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.1rem 0.65rem;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50rem;
}

.login-bar-chip:hover,
.login-bar-chip:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.login-bar-chip-handle {
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.65);
}

@media (max-width: 575.98px) {
  .login-bar {
    font-size: 0.85rem;
  }

  .login-bar-main {
    align-items: flex-start;
  }

  .login-bar-links {
    flex-direction: column;
    gap: 0.4rem;
  }

  .login-bar-chips {
    flex-wrap: nowrap;
    padding-bottom: 0.2rem;
    overflow-x: auto;
    scrollbar-width: thin;
  }
}

/*
 * The public home page (security/_landing.html.twig, DESIGN.md §9.31): the hero on the login
 * artwork with the login card, then sections in the page's own colours (light or dark theme).
 */
.landing-page {
  min-height: 100vh;
  background: var(--bs-body-bg);
}

/* Above the hero the bar has no artwork behind it: solid dark, and its toggles light. */
.landing-page .login-bar {
  background: #121212;
  backdrop-filter: none;
}

.login-bar .nav-link {
  color: rgba(255, 255, 255, 0.85);
}

.login-bar .nav-link:hover,
.login-bar .nav-link:focus {
  color: #fff;
}

.landing-hero {
  padding-block: 2.5rem 3rem;
}

.landing-hero-text {
  color: #fff;
}

.landing-promo {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  background: #ffc107;
  border-radius: 1rem;
}

.landing-title {
  margin-bottom: 1rem;
  font-size: calc(1.45rem + 1.6vw);
  font-weight: 700;
  line-height: 1.3;
}

.landing-lead {
  margin-bottom: 1rem;
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.88);
}

.landing-tagline {
  display: flex;
  align-items: center;
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffc107;
}

.landing-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  color: rgba(255, 255, 255, 0.9);
}

.landing-checks .bi {
  margin-inline-end: 0.35rem;
  color: #75b798;
}

.landing .landing-login {
  width: 100%;
  max-width: 400px;
  margin-top: 0;
}

.landing .landing-login .card {
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.5);
}

.landing-section {
  padding-block: 3.5rem;
  scroll-margin-top: 1rem;
}

.landing-section-title {
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
}

.landing-section-lead {
  max-width: 46rem;
  margin: 0 auto 2rem;
  color: var(--bs-secondary-color);
  text-align: center;
}

.landing-card {
  display: block;
  padding: 1.5rem;
  color: var(--bs-body-color);
  text-decoration: none;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.04);
}

.landing-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  font-size: 1.4rem;
  color: #0d6efd;
  background: rgba(13, 110, 253, 0.1);
  border-radius: 0.85rem;
}

.landing-step {
  position: relative;
  height: 100%;
  padding: 1.5rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
}

.landing-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: #0d6efd;
  border-radius: 50%;
}

.landing-price-value {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--bs-success-text-emphasis);
}

.landing-bot {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.landing-bot:hover,
.landing-bot:focus-visible {
  border-color: #0d6efd;
}

.landing-faq {
  max-width: 52rem;
  margin: 1.5rem auto 0;
}

.landing-faq-item {
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
}

.landing-faq-item summary {
  font-weight: 600;
  cursor: pointer;
}

.landing-faq-item[open] summary {
  margin-bottom: 0.5rem;
}

.landing-contact {
  color: #fff;
}

.landing-contact-whatsapp,
.landing-contact-whatsapp:hover {
  color: #fff;
  background: #1f9d55;
}

.landing-contact-telegram,
.landing-contact-telegram:hover {
  color: #fff;
  background: #1c86c6;
}

.landing-contact-facebook,
.landing-contact-facebook:hover {
  color: #fff;
  background: #1877f2;
}

.landing-contact-whatsapp:hover,
.landing-contact-telegram:hover,
.landing-contact-facebook:hover {
  filter: brightness(1.1);
}

.landing-footer {
  padding-block: 1.5rem;
  background: var(--bs-tertiary-bg);
  border-top: 1px solid var(--bs-border-color);
}

@media (max-width: 575.98px) {
  .landing-hero {
    padding-block: 1.5rem 2rem;
  }

  .landing-section {
    padding-block: 2.5rem;
  }
}

/*
 * «الدليل» (templates/docs/index.html.twig, DESIGN.md §9.31): the public guide. Anchors land below
 * the sticky header, and the contents stay beside the text on wide screens.
 */
.docs-page .docs-chapter,
.docs-page .docs-section {
  scroll-margin-top: 4.5rem;
}

.docs-page .docs-price {
  padding: 1rem 1.25rem;
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
}

.docs-page .docs-toc summary {
  cursor: pointer;
}

.docs-page .docs-points li + li {
  margin-top: 0.35rem;
}

@media (min-width: 992px) {
  .docs-page .docs-toc {
    position: sticky;
    top: 4.5rem;
    max-height: calc(100vh - 5.5rem);
    overflow-y: auto;
  }
}

/*
 * «بوتات تيليغرام» (templates/bot_pages/, DESIGN.md §9.36): the list of bots on the login artwork and
 * the articles, set for long reading. Anchors land below the sticky header.
 */
.bot-hub-hero {
  padding-block: 1.25rem 3rem;
  color: #fff;
}

.bot-pages-crumbs-light .breadcrumb-item,
.bot-pages-crumbs-light .breadcrumb-item a,
.bot-pages-crumbs-light .breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255, 255, 255, 0.75);
}

.bot-pages-crumbs-light .breadcrumb-item.active {
  color: #fff;
}

.bot-pages .landing-section,
.bot-article-section {
  scroll-margin-top: 4.5rem;
}

.bot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
}

.bot-card-photo {
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.9rem;
  object-fit: cover;
  border-radius: 50%;
}

.bot-hub-text,
.bot-hub-empty {
  max-width: 52rem;
}

.bot-article,
.bot-hub-text {
  font-size: 1.05rem;
  line-height: 1.9;
}

.bot-article .lead {
  line-height: 1.7;
}

.bot-article-list li + li {
  margin-top: 0.4rem;
}

.bot-article-card:hover,
.bot-article-card:focus-visible {
  border-color: #0d6efd;
}

.bot-article-toc summary {
  cursor: pointer;
}

@media (min-width: 992px) {
  .bot-article-aside {
    position: sticky;
    top: 4.5rem;
  }
}

/*
 * Support chats on phones and in the Android app (public/js/chat.js, templates/chat): the customer
 * support of the accountant, the line with the administration (both sides) and the portal chat.
 * On a computer the chat stays a card; on a phone it fills the screen between the top bar (and
 * the portal's tab bar) and the keyboard, its details open as a sheet from the bottom.
 */
.chat-screen {
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
}

.chat-avatar {
  display: inline-flex;
  flex: 0 0 2.4rem;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  font-weight: 700;
  font-size: 1.05rem;
}

.chat-avatar-warning {
  background: var(--bs-warning-bg-subtle);
  color: var(--bs-warning-text-emphasis);
}

.chat-title {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.25;
}

.chat-title strong,
.chat-title small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-title small {
  color: var(--bs-secondary-color);
}

.chat-icon-btn {
  display: inline-flex;
  flex: 0 0 2.5rem;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
}

[dir="rtl"] .chat-flip,
[dir="rtl"] .chat-send .bi {
  transform: scaleX(-1);
}

.chat-body {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.chat-screen .support-thread {
  position: relative;
  flex: 1 1 auto;
  padding: 0.75rem;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.chat-divider {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0;
}

.chat-divider span {
  padding: 0.15rem 0.75rem;
  border-radius: 1rem;
  background: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
}

.chat-unread span {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  font-weight: 600;
}

.chat-jump {
  position: absolute;
  bottom: 0.75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.75rem;
  border: 0;
  border-radius: 2rem;
  background: var(--bs-body-bg);
  color: var(--bs-primary);
  box-shadow: 0 2px 10px rgb(0 0 0 / 25%);
  inset-inline-end: 0.75rem;
}

.chat-jump [data-chat-jump-count]:not(:empty) {
  padding: 0 0.4rem;
  border-radius: 1rem;
  background: var(--bs-danger);
  color: #fff;
  font-size: 0.75rem;
}

.chat-composer {
  padding: 0.5rem 0.75rem;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
}

.chat-input {
  min-height: 2.6rem;
  padding: 0.5rem 1rem;
  overflow-y: hidden;
  border-radius: 1.3rem;
  line-height: 1.4;
  resize: none;
}

.chat-send {
  display: inline-flex;
  flex: 0 0 2.6rem;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border-radius: 50%;
}

.chat-send:disabled {
  opacity: 0.45;
}

.support-meta {
  text-align: end;
}

.support-file {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  overflow-wrap: anywhere;
}

.chat-pending .support-bubble {
  opacity: 0.7;
}

.chat-failed .support-bubble {
  border-color: var(--bs-danger) !important;
  cursor: pointer;
}

.chat-failed .support-meta {
  color: var(--bs-danger);
}

.chat-viewer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 92%);
}

.chat-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.chat-viewer-close {
  position: absolute;
  top: calc(0.75rem + env(safe-area-inset-top));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  inset-inline-end: 0.75rem;
}

body.chat-viewer-open {
  overflow: hidden;
}

/* The details sheet (Bootstrap's offcanvas-lg: a column on a computer). */
@media (max-width: 991.98px) {
  .chat-side.offcanvas-bottom {
    --bs-offcanvas-height: auto;
    max-height: 85vh;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
  }

  .chat-side .offcanvas-body {
    min-height: 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}

/* Panel chats on a phone: a full screen under the top bar. */
@media (max-width: 991.98px) {
  body.chat-page:not(.portal) {
    overflow: hidden;
  }

  .chat-page .app-content-header,
  .chat-page .app-footer {
    display: none !important;
  }

  .chat-page .app-content {
    padding: 0 !important;
  }

  .chat-page:not(.portal) .chat-screen {
    position: fixed;
    top: var(--chat-top, 3.5rem);
    bottom: var(--chat-bottom, 0px);
    z-index: 1015;
    margin: 0 !important;
    border: 0;
    border-radius: 0;
    inset-inline: 0;
  }

  .chat-page:not(.portal) .chat-screen .support-thread {
    height: auto;
    min-height: 0;
  }

  /* New-message pop-ups of other conversations come from the top, not over the reply box. */
  .chat-page #support-toasts,
  .chat-page #staff-toasts {
    top: var(--chat-top, 3.5rem);
    bottom: auto !important;
  }

  .chat-screen .support-bubble {
    max-width: 85%;
  }
}

/* Portal chat on a phone: between the top bar and the tab bar, which steps aside while typing. */
@media (max-width: 767.98px) {
  body.portal.chat-page {
    overflow: hidden;
  }

  .portal.chat-page .portal-main > h1,
  .portal.chat-page .portal-main > p.text-center {
    display: none;
  }

  .portal.chat-page .chat-screen {
    position: fixed;
    top: var(--chat-top, 3.5rem);
    bottom: var(--chat-bottom, 3.6rem);
    z-index: 1015;
    margin: 0;
    border: 0;
    border-radius: 0;
    inset-inline: 0;
  }

  .portal.chat-page .chat-screen .support-thread {
    height: auto;
    min-height: 0;
  }

  body.portal.chat-typing .portal-tabbar {
    display: none;
  }
}

/* Inboxes of the chats: the filters scroll in one line, the search takes the width of a phone. */
.chat-filters {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-filters::-webkit-scrollbar {
  display: none;
}

.chat-search {
  width: 100%;
}

@media (min-width: 768px) {
  .chat-search {
    width: auto;
    max-width: 20rem;
  }
}

@media (max-width: 575.98px) {
  .chat-filters .nav-link {
    padding-right: 0.6rem !important;
    padding-left: 0.6rem !important;
  }
}

/*
 * Support problem types (DESIGN.md §9.58): the inbox's category chips scroll in one line on a
 * phone (.chat-filters) and wrap on a wider screen; in a chat, the «طلب جديد» chip sits inside the
 * message that started the request, on its own line above the bubble.
 */
.support-categories .btn {
  --bs-btn-padding-y: 0.2rem;
  --bs-btn-padding-x: 0.65rem;
}

.support-msg-request {
  flex-wrap: wrap;
}

.support-msg-request > .chat-request {
  flex: 0 0 100%;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.chat-request span {
  font-weight: 600;
  text-align: center;
}

/*
 * A photo for the customer (DESIGN.md §9.62): the support chat's «🖼» button, the picked photo shown
 * above the reply box (public/js/chat.js), the chat outlined while a picture is dragged over it,
 * and the preview under a form's photo field (public/js/photo-input.js). [hidden] must win over the
 * flex layout, hence :not([hidden]).
 */
.chat-attach {
  display: inline-flex;
  flex: 0 0 2.6rem;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border-radius: 50%;
}

.chat-photo-preview:not([hidden]),
.photo-input-preview:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  background: var(--bs-tertiary-bg);
}

.photo-input-preview:not([hidden]) {
  width: fit-content;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.chat-photo-preview img,
.photo-input-preview img {
  flex: 0 0 auto;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.5rem;
  object-fit: cover;
}

.chat-photo-name,
.photo-input-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
  text-overflow: ellipsis;
  white-space: nowrap;
  unicode-bidi: isolate;
}

.chat-drop {
  outline: 2px dashed var(--bs-primary);
  outline-offset: -4px;
}

/* «شرح هذه الصفحة» (DESIGN.md §9.104): the guide's section about the page, beside it. */
.page-help {
  --bs-offcanvas-width: min(32rem, 100vw);
}

.page-help .offcanvas-body {
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.page-help-block {
  margin-bottom: 1.25rem;
}

.page-help-tips,
.page-help-problems {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--bs-info-bg-subtle);
  border: 1px solid var(--bs-info-border-subtle);
}

.page-help-problems {
  background: var(--bs-warning-bg-subtle);
  border-color: var(--bs-warning-border-subtle);
}

.page-help-button {
  white-space: nowrap;
}
