/*
 * AeroBook design system (docs/20 §1) — component rules built on the
 * tokens in aerobook-tokens.css. RTL-first: every spacing/direction rule
 * here uses logical properties (margin-inline-start, not margin-left),
 * per docs/20 §1 principle 5 — this plugin has no LTR mode to support, but
 * logical properties cost nothing extra and are simply correct for RTL.
 *
 * Glassmorphism is scoped to .aero-glass-surface only (accent, not
 * everything — principle 3): never applied to .aero-card, tables, or forms.
 */

.aero-panel {
  background: var(--aero-bg);
  font-family: var(--aero-font);
}

/* --- Accessibility floor (docs/20 §1 principle 6) --- */
.aero-panel :focus-visible {
  outline: 2px solid var(--aero-brand);
  outline-offset: 2px;
  border-radius: var(--aero-radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  .aero-panel * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* --- Base card surface --- */
.aero-card {
  background: var(--aero-surface);
  border: 1px solid var(--aero-brand-100);
  border-radius: var(--aero-radius);
  box-shadow: var(--aero-shadow-sm);
  transition: box-shadow var(--aero-transition), border-color var(--aero-transition);
}

/* --- Glass accent surface — sidebar/stat-cards/modals only, never data tables or forms (principle 3) --- */
.aero-glass-surface {
  background: var(--aero-glass-bg);
  border: 1px solid var(--aero-glass-border);
  border-radius: var(--aero-radius-lg);
  backdrop-filter: blur(var(--aero-glass-blur));
  -webkit-backdrop-filter: blur(var(--aero-glass-blur));
}

/* --- Semantic tone utilities — always icon + text + color, never color alone (principle 6) --- */
.aero-tone-success { color: var(--aero-success); }
.aero-tone-warning { color: var(--aero-warning); }
.aero-tone-danger  { color: var(--aero-danger); }
.aero-tone-info    { color: var(--aero-info); }
.aero-tone-muted   { color: var(--aero-brand-400); }

.aero-bg-tone-success { background: color-mix(in srgb, var(--aero-success) 12%, var(--aero-surface)); }
.aero-bg-tone-warning { background: color-mix(in srgb, var(--aero-warning) 12%, var(--aero-surface)); }
.aero-bg-tone-danger  { background: color-mix(in srgb, var(--aero-danger) 12%, var(--aero-surface)); }
.aero-bg-tone-muted   { background: color-mix(in srgb, var(--aero-brand) 6%, var(--aero-surface)); }

/*
 * --- Decorative emoji icon (2026-09-06, /panel/profile/ feedback: "icons
 * are too large") --- a bare emoji glyph inline in a heading/card-header
 * inherits that element's full font-size, and most emoji fonts render
 * noticeably taller/wider than Persian or Latin text at the same declared
 * size — CSS has no selector for "just the emoji character" inside a text
 * node, so this only takes effect where a template wraps the glyph itself,
 * e.g. <span class="aero-icon">🪪</span> — not a global font-size cut on
 * the whole heading. 0.85em keeps it proportional to whatever heading/
 * badge/button it sits in rather than one fixed px size everywhere.
 */
.aero-icon {
  font-size: 0.85em;
  line-height: 1;
  vertical-align: -0.05em;
}

/*
 * --- Requirement card (docs/20 §4; redesigned 0.6.63 from Dara's mockup) ---
 * One card per gate requirement. The tone says what is asked of the student
 * (see aero_requirement_card_tone() in templates/components/requirement-card.php):
 *   danger  (red)    something to upload or redo — there is a button
 *   warning (amber)  submitted, waiting on the school
 *   success (green)  done — kept, never removed (a vanished item reads as
 *                    "did this disappear?")
 *   locked  (grey)   not the student's to act on
 * A coloured bar on the leading edge, an icon badge, a progress bar and one
 * tag per document. --compact is the dashboard widget's tighter version.
 */
.aero-requirement-card {
  --rc-tone: var(--aero-danger);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: 1rem;
  padding: 1.5rem;
  border: 1px solid color-mix(in srgb, var(--rc-tone) 22%, var(--aero-line));
  border-radius: 1.25rem;
  background: var(--aero-surface);
  transition: box-shadow var(--aero-transition), transform var(--aero-transition);
}

.aero-requirement-card:hover {
  box-shadow: var(--aero-shadow);
  transform: translateY(-2px);
}

.aero-requirement-card::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--rc-tone);
}

.aero-requirement-card--danger  { --rc-tone: var(--aero-danger); }
.aero-requirement-card--warning { --rc-tone: var(--aero-warning); }

.aero-requirement-card--success {
  --rc-tone: var(--aero-success);
  background: color-mix(in srgb, var(--aero-success) 5%, var(--aero-surface));
}

.aero-requirement-card--locked {
  --rc-tone: var(--aero-ink-muted);
  border-color: var(--aero-line);
  background: color-mix(in srgb, var(--aero-ink-muted) 6%, var(--aero-surface));
}

.aero-requirement-card__main {
  flex: 1 1 18rem;
  min-width: 0;
}

.aero-requirement-card__header {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.aero-requirement-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--rc-tone) 14%, var(--aero-surface));
  color: var(--rc-tone);
}

.aero-requirement-card__title {
  margin: 0;
  color: var(--aero-ink);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
}

.aero-requirement-card__status {
  margin: .1rem 0 0;
  color: var(--aero-ink-muted);
  font-size: .85rem;
}

.aero-requirement-card__status strong {
  color: var(--rc-tone);
  font-weight: 600;
}

/* Progress and tags line up under the title, not under the icon badge (2rem + .75rem). */
.aero-requirement-card__progress {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: .9rem 0 0;
  padding-inline-start: 2.75rem;
  color: var(--aero-ink-muted);
  font-size: .75rem;
}

.aero-requirement-card__progress-track {
  width: 6.25rem;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--aero-line);
}

.aero-requirement-card__progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--rc-tone);
  transition: width var(--aero-transition);
}

.aero-requirement-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.1rem 0 0;
  padding: 0;
  padding-inline-start: 2.75rem;
  list-style: none;
}

.aero-doc-tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .8rem;
  border: 1px solid var(--aero-line);
  border-radius: .5rem;
  background: var(--aero-wash);
  color: var(--aero-ink-muted);
  font-size: .8rem;
  font-weight: 500;
}

.aero-doc-tag small {
  font-size: .95em;
  font-weight: 400;
  opacity: .85;
}

.aero-doc-tag.is-bad {
  border-color: color-mix(in srgb, var(--aero-danger) 28%, var(--aero-surface));
  background: color-mix(in srgb, var(--aero-danger) 8%, var(--aero-surface));
  color: color-mix(in srgb, var(--aero-danger) 82%, #000);
}

.aero-doc-tag.is-wait {
  border-color: color-mix(in srgb, var(--aero-warning) 32%, var(--aero-surface));
  background: color-mix(in srgb, var(--aero-warning) 10%, var(--aero-surface));
  color: color-mix(in srgb, var(--aero-warning) 70%, #000);
}

.aero-doc-tag.is-ok {
  border-color: color-mix(in srgb, var(--aero-success) 28%, var(--aero-surface));
  background: color-mix(in srgb, var(--aero-success) 8%, var(--aero-surface));
  color: color-mix(in srgb, var(--aero-success) 70%, #000);
}

.aero-requirement-card__action {
  flex-shrink: 0;
}

.aero-btn-action {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.2rem;
  border: 0;
  border-radius: .75rem;
  background: var(--aero-brand);
  color: var(--aero-brand-contrast);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  transition: filter var(--aero-transition), box-shadow var(--aero-transition);
}

.aero-btn-action:hover {
  color: var(--aero-brand-contrast);
  filter: brightness(1.08);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--aero-brand) 30%, transparent);
}

.aero-requirement-card--compact {
  gap: .6rem;
  margin-block-end: .75rem;
  padding: .9rem 1.1rem;
  border-radius: var(--aero-radius);
}

.aero-requirement-card--compact:hover {
  box-shadow: none;
  transform: none;
}

.aero-requirement-card--compact .aero-requirement-card__progress,
.aero-requirement-card--compact .aero-requirement-card__tags {
  margin-block-start: .6rem;
}

@media (max-width: 575.98px) {
  .aero-requirement-card { padding: 1.15rem; }
  .aero-requirement-card__action,
  .aero-requirement-card__action .aero-btn-action { width: 100%; justify-content: center; }
}

/* --- Status chip (docs/20 §3 status-chip.php) --- */
.aero-status-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.6;
}

/*
 * --- Sidebar (docs/20 §5, 20-D; re-skinned 0.6.61 from Dara's mockup) ---
 * Fixed 280px, collapsible to a 72px icon-rail. State lives as
 * data-aero-collapsed="0|1" on <html> (not on #aero-sidebar itself) —
 * assets/js/aerobook-sidebar.js sets it synchronously from an inline
 * <head> script, before the sidebar (part of <body>) exists at all, so
 * the correct width applies on first paint with no flash-of-wrong-state.
 * Every rule below is a [data-aero-collapsed="1"] descendant selector
 * for exactly this reason. Off-canvas on mobile (<768px), same JS, via
 * .aero-sidebar--mobile-open.
 *
 * Everything is a token: the background is the school's own sidebar colour
 * (--aero-sidebar-bg), the text colour follows its contrast, and the glow /
 * hover / active tints are mixed from --aero-sidebar-accent (tokens.css), so
 * a school that changes the sidebar colour in Settings still gets a
 * readable sidebar. Translucent white overlays (rgba(255,255,255,x)) rather
 * than a computed "lighter" shade of the background read correctly on
 * whatever colour that is.
 *
 * No letter-spacing on anything Persian: it pulls Arabic-script letters
 * apart. Only the small Latin captions (the "Flight Management" tagline, the
 * role) are tracked.
 */
.aero-panel-sidebar {
  --aero-sidebar-item-fg: color-mix(in srgb, var(--aero-sidebar-contrast) 62%, transparent);
  --aero-sidebar-muted: color-mix(in srgb, var(--aero-sidebar-contrast) 42%, transparent);
  --aero-sidebar-hover: color-mix(in srgb, var(--aero-sidebar-accent) 10%, transparent);
  --aero-sidebar-active: color-mix(in srgb, var(--aero-sidebar-accent) 18%, transparent);
  width: 260px;
  min-width: 260px;
  /* Stays put while the page scrolls; the menu scrolls inside it (the mockup's
     fixed-height sidebar). align-self because the shell stretches its children. */
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  height: 100dvh;
  background: var(--aero-sidebar-bg);
  color: var(--aero-sidebar-contrast);
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid rgba(255, 255, 255, .05);
  transition: width var(--aero-transition);
  overflow: hidden;
}

.aero-panel-sidebar[data-aero-sidebar-style="gradient"] {
  background: linear-gradient(180deg, var(--aero-sidebar-bg) 0%, color-mix(in srgb, var(--aero-sidebar-bg) 60%, var(--aero-brand-900)) 100%);
}

.aero-panel-sidebar[data-aero-sidebar-style="glass"] {
  background: color-mix(in srgb, var(--aero-sidebar-bg) 85%, transparent);
  backdrop-filter: blur(var(--aero-glass-blur));
  -webkit-backdrop-filter: blur(var(--aero-glass-blur));
  border-inline-end: 1px solid var(--aero-glass-border);
}

html[data-aero-collapsed="1"] .aero-panel-sidebar {
  width: 74px;
  min-width: 74px;
}

/* --- Brand ------------------------------------------------------------- */

.aero-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 4rem;
  padding: 1rem .875rem;
  border-block-end: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.aero-sidebar__brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--aero-sidebar-contrast);
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

.aero-sidebar__brand:hover {
  color: var(--aero-sidebar-contrast);
}

.aero-sidebar__logo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: .6rem;
  border: 1px solid color-mix(in srgb, var(--aero-sidebar-accent) 30%, transparent);
  background: color-mix(in srgb, var(--aero-sidebar-accent) 20%, transparent);
  color: var(--aero-sidebar-accent);
  box-shadow: 0 0 15px color-mix(in srgb, var(--aero-sidebar-accent) 20%, transparent);
}

/* The school's own logo sits on a white plate (it was designed for a light
   page); the plane icon shows instead when there is no logo or it can't load. */
.aero-sidebar__logo-tile.has-logo {
  padding: 3px;
  border-color: transparent;
  background: #fff;
  box-shadow: none;
}

.aero-sidebar__logo-tile.has-logo svg {
  display: none;
}

.aero-sidebar__logo {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.aero-sidebar__brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.aero-sidebar__brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .92rem;
  font-weight: 500;
}

.aero-sidebar__brand-sub {
  font-size: .625rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--aero-sidebar-accent) 80%, transparent);
}

/*
 * .aero-sidebar__label is a plain descendant selector on purpose — it
 * hides the label span wherever it appears under a collapsed sidebar
 * with no need to also list its specific parent here.
 */
[data-aero-collapsed="1"] .aero-sidebar__brand-text,
[data-aero-collapsed="1"] .aero-sidebar__label,
[data-aero-collapsed="1"] .aero-sidebar__group-label,
[data-aero-collapsed="1"] .aero-sidebar__group-toggle,
[data-aero-collapsed="1"] .aero-sidebar__nav-tools,
[data-aero-collapsed="1"] .aero-sidebar__user-info {
  display: none;
}

html[data-aero-collapsed="1"] .aero-sidebar__group .aero-sidebar__nav {
  display: flex;
}

html[data-aero-collapsed="1"] .aero-sidebar__header {
  flex-direction: column;
  justify-content: center;
  height: auto;
  padding: .75rem 0;
}

html[data-aero-collapsed="1"] .aero-sidebar__brand {
  flex: none;
}

.aero-sidebar__collapse-btn,
.aero-sidebar__mobile-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  border-radius: .4375rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  flex-shrink: 0;
}

.aero-sidebar__collapse-btn:hover,
.aero-sidebar__mobile-close-btn:hover {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.aero-sidebar__mobile-close-btn {
  display: none;
}

/* --- Navigation --------------------------------------------------------- */

.aero-sidebar__nav-scroll {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .5rem .625rem .625rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.aero-sidebar__nav-scroll::after {
  content: '';
  position: sticky;
  display: block;
  height: .5rem;
  margin-inline: -.625rem;
  width: calc(100% + 1.25rem);
  bottom: 0;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(to top, color-mix(in srgb, var(--aero-sidebar-bg) 88%, transparent), transparent);
}

.aero-sidebar__nav-scroll::-webkit-scrollbar { width: 4px; }
.aero-sidebar__nav-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 10px; }

.aero-sidebar__nav-tools {
  flex-shrink: 0;
  padding: .4rem .625rem .5rem;
  border-block-end: 1px solid rgba(255, 255, 255, .08);
  background: inherit;
}

.aero-sidebar__nav-tools-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  width: 100%;
  padding: .45rem .55rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: .4rem;
  background: rgba(255, 255, 255, .04);
  color: #94a3b8;
  font: inherit;
  font-size: .68rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.aero-sidebar__nav-tools-btn:hover {
  background: rgba(255, 255, 255, .1);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, .16);
}

.aero-sidebar__nav-tools-icon { display: inline-flex; transition: transform .15s ease; }
.aero-sidebar__nav-tools-btn[aria-expanded="true"] .aero-sidebar__nav-tools-icon { transform: rotate(90deg); }
.aero-sidebar__nav-tools-btn[aria-expanded="false"] .aero-sidebar__nav-tools-icon { transform: rotate(-90deg); }

.aero-sidebar__group {
  margin-block-end: .15rem;
}

.aero-sidebar__group-toggle {
  display: flex;
  align-items: center;
  gap: .35rem;
  width: calc(100% - .5rem);
  margin: .55rem .25rem .2rem;
  padding: .4rem .45rem;
  border: 0;
  border-radius: .45rem;
  background: transparent;
  color: #64748b;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.aero-sidebar__group-toggle:hover {
  background: rgba(255, 255, 255, .06);
  color: #cbd5e1;
}

.aero-sidebar__group-toggle[aria-expanded="true"] {
  color: #e2e8f0;
}

.aero-sidebar__group-label {
  flex: 1;
  min-width: 0;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.aero-sidebar__group-badge {
  flex-shrink: 0;
  min-width: 1.1rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--aero-danger) 88%, #000);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  line-height: 1.35;
  direction: ltr;
  unicode-bidi: isolate;
}

.aero-sidebar__group-chevron {
  display: inline-flex;
  flex-shrink: 0;
  opacity: .75;
  transition: transform .15s ease;
  transform: rotate(90deg);
}

.aero-sidebar__group-toggle[aria-expanded="true"] .aero-sidebar__group-chevron {
  transform: rotate(-90deg);
}

.aero-sidebar__group.is-collapsed .aero-sidebar__nav {
  display: none;
}

.aero-sidebar__group-toggle[aria-expanded="false"] + .aero-sidebar__nav {
  display: none;
}

.aero-sidebar__group.is-expanded .aero-sidebar__nav,
.aero-sidebar__group-toggle[aria-expanded="true"] + .aero-sidebar__nav {
  display: flex;
}

.aero-sidebar__nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.aero-sidebar__nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem .625rem;
  border-radius: .5rem;
  color: #94a3b8;
  font-size: .78rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  transition: background .15s ease, color .15s ease;
}

.aero-sidebar__nav-link:hover {
  background: rgba(255, 255, 255, .06);
  color: #f1f5f9;
}

.aero-sidebar__nav-link:hover .aero-sidebar__icon svg {
  transform: scale(1.1);
  color: var(--aero-sidebar-accent);
}

/* Active: accent text on a soft accent wash, and a glowing 3px bar on the
   edge the menu starts from (the right, in this RTL panel). */
.aero-sidebar__nav-link.active {
  background: linear-gradient(90deg, rgba(28, 2, 228, .45) 0%, rgba(15, 1, 121, .25) 100%);
  color: #fff;
  font-weight: 700;
  border-inline-end: 3px solid var(--aero-brand-400, #6753fe);
}

.aero-sidebar__nav-link.active::before {
  content: none;
}

.aero-sidebar__nav-link:focus-visible {
  outline: 2px solid var(--aero-sidebar-accent);
  outline-offset: -2px;
}

.aero-sidebar__icon {
  display: inline-flex;
  flex-shrink: 0;
  opacity: .8;
}

.aero-sidebar__icon svg {
  display: block;
  transition: transform .3s ease, color .3s ease;
}

.aero-sidebar__label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Count pills: red by default, blue for "waiting for you", amber for "needs attention". */
.aero-sidebar__badge {
  flex-shrink: 0;
  min-width: 1.5em;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: var(--aero-danger);
  color: #FFFFFF;
  font-size: .65rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  /* "99+" must read as typed inside an RTL page, not "+99". */
  direction: ltr;
  unicode-bidi: isolate;
  box-shadow: 0 0 10px color-mix(in srgb, var(--aero-danger) 40%, transparent);
}

.aero-sidebar__badge--info {
  background: var(--aero-info);
  box-shadow: 0 0 10px color-mix(in srgb, var(--aero-info) 40%, transparent);
}

.aero-sidebar__badge--warning {
  background: var(--aero-warning);
  box-shadow: 0 0 10px color-mix(in srgb, var(--aero-warning) 40%, transparent);
}

[data-aero-collapsed="1"] .aero-sidebar__badge {
  position: absolute;
  inset-inline-start: 34px;
  inset-block-start: 4px;
}

[data-aero-collapsed="1"] .aero-sidebar__nav-link {
  justify-content: center;
  padding-inline: 0;
}

/* --- Footer: who is signed in ------------------------------------------- */

.aero-sidebar__footer {
  flex-shrink: 0;
  padding: .75rem;
  border-block-start: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .25);
}

.aero-sidebar__user {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.aero-sidebar__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: 2px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  background: color-mix(in srgb, var(--aero-sidebar-accent) 28%, var(--aero-sidebar-bg));
  color: #FFFFFF;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1;
}

.aero-sidebar__user-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* Names and roles are mostly Latin ("Mr.Zarei", "UL PPL") in an RTL page. They
   hug the avatar on the right, as in the mockup; plaintext bidi lets each one
   take its own direction, so a long name is cut off at its END with an
   ellipsis (not its beginning), Latin or Persian. */
.aero-sidebar__user-name {
  unicode-bidi: plaintext;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .85rem;
  font-weight: 500;
}

.aero-sidebar__role-chip {
  unicode-bidi: plaintext;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-block-start: .1rem;
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--aero-sidebar-accent);
}

.aero-sidebar__footer-actions {
  display: flex;
  flex-shrink: 0;
  gap: .15rem;
}

.aero-sidebar__footer-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--aero-radius-sm);
  color: var(--aero-sidebar-item-fg);
  text-decoration: none;
  transition: background var(--aero-transition), color var(--aero-transition);
}

.aero-sidebar__footer-icon:hover {
  background: rgba(255, 255, 255, .1);
  color: var(--aero-sidebar-contrast);
}

html[data-aero-collapsed="1"] .aero-sidebar__user {
  flex-direction: column;
}

html[data-aero-collapsed="1"] .aero-sidebar__footer-actions {
  flex-direction: column;
}

.aero-sidebar__overlay {
  display: none;
}

/* --- Mobile: off-canvas drawer (docs/20 §5 — "the current 240px flex column is not usable on a phone today") --- */
@media (max-width: 767.98px) {
  .aero-panel-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 1040;
    height: auto;
    /* The drawer must be exactly as tall as the screen, so its menu list (the flex:1, overflow:auto part) is the thing that scrolls and the footer stays pinned.
       The desktop rule's `align-self: flex-start` used to leak in here: on a fixed box with both insets set, a non-default align-self makes `height: auto` mean
       «as tall as the content» instead of «stretch between the insets» — an instructor's 12 entries made a 849 px drawer on an 812 px phone (667 px on a small one),
       the list never scrolled, and the tail of the menu (the instructor's own profile page, then the logout button) sat below the screen, unreachable (0.6.150). */
    align-self: auto;
    max-height: 100vh;
    max-height: 100dvh;
    transform: translateX(100%);
    width: min(280px, 86vw);
    min-width: 0;
  }

  /* The shadow only while open — closed, the drawer sits just off-screen and its shadow would bleed into the page edge. */
  .aero-panel-sidebar.aero-sidebar--mobile-open {
    transform: translateX(0);
    box-shadow: -20px 0 40px rgba(0, 0, 0, .25);
  }

  /* Icon-rail collapse is a desktop concept only — mobile is fully open or fully off-canvas. */
  html[data-aero-collapsed="1"] .aero-panel-sidebar {
    width: min(280px, 86vw);
    min-width: 0;
  }
  /*
   * Explicit per-element display values, not `initial` — the CSS-wide
   * initial value of `display` is always `inline` regardless of an
   * element's own tag default, which would wrongly flatten
   * .aero-sidebar__group-label (a <div>, needs `block`) and
   * .aero-sidebar__user-info / __brand-text (need `flex`) into inline flow.
   */
  [data-aero-collapsed="1"] .aero-sidebar__label {
    display: inline;
  }
  [data-aero-collapsed="1"] .aero-sidebar__group-label {
    display: block;
  }
  [data-aero-collapsed="1"] .aero-sidebar__user-info,
  [data-aero-collapsed="1"] .aero-sidebar__brand-text {
    display: flex;
  }
  html[data-aero-collapsed="1"] .aero-sidebar__header {
    flex-direction: row;
    height: 5rem;
    padding: 0 1rem;
  }
  html[data-aero-collapsed="1"] .aero-sidebar__brand {
    flex: 1;
  }
  html[data-aero-collapsed="1"] .aero-sidebar__user,
  html[data-aero-collapsed="1"] .aero-sidebar__footer-actions {
    flex-direction: row;
  }
  [data-aero-collapsed="1"] .aero-sidebar__nav-link {
    justify-content: flex-start;
    padding-inline: 1.5rem;
  }
  [data-aero-collapsed="1"] .aero-sidebar__badge {
    position: static;
  }

  .aero-sidebar__collapse-btn {
    display: none;
  }

  .aero-sidebar__mobile-close-btn {
    display: flex;
  }

  .aero-sidebar__overlay.aero-sidebar__overlay--visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 1039;
  }

  .aero-panel-mobile-topbar {
    display: flex !important;
    position: sticky;
    top: calc(10px + env(safe-area-inset-top, 0px));
    z-index: 25;
    align-items: center;
    gap: .65rem;
    margin: 0 0 1rem;
    padding: .45rem .55rem .45rem .65rem;
    border: 1px solid var(--aero-glass-border);
    border-radius: 999px;
    background: var(--aero-surface);
    box-shadow:
      0 10px 28px -12px rgba(15, 23, 42, .28),
      0 0 0 1px color-mix(in srgb, var(--aero-brand) 8%, transparent);
  }

  @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .aero-panel-mobile-topbar {
      background: var(--aero-glass-bg);
      -webkit-backdrop-filter: blur(calc(var(--aero-glass-blur) + 4px)) saturate(1.35);
      backdrop-filter: blur(calc(var(--aero-glass-blur) + 4px)) saturate(1.35);
    }
  }

  body[data-aero-glass="1"] .aero-panel-mobile-topbar {
    box-shadow:
      0 14px 34px -14px rgba(15, 23, 42, .32),
      inset 0 1px 0 rgba(255, 255, 255, .55);
  }

  .aero-panel-mobile-topbar > .fw-bold {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .92rem;
    font-weight: 700 !important;
    color: var(--aero-ink);
  }

  .aero-panel-mobile-topbar__toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--aero-brand) 18%, var(--aero-line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--aero-brand) 8%, var(--aero-surface));
    color: var(--aero-ink);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--aero-transition), border-color var(--aero-transition), transform var(--aero-transition);
  }

  .aero-panel-mobile-topbar__toggle:active {
    transform: scale(.96);
  }
}

.aero-panel-mobile-topbar {
  display: none;
  align-items: center;
  gap: .5rem;
}

.aero-panel-mobile-topbar__toggle {
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* Developer credit at the foot of every panel page (from the mockup). */
.aero-panel-footer {
  margin: 2.5rem auto 1rem;
  padding-top: 1.25rem;
  border-block-start: 1px solid var(--aero-brand-100);
  color: var(--aero-ink-muted);
  font-size: .72rem;
  text-align: center;
}

.aero-panel-footer strong {
  font-weight: 600;
}

.aero-panel-footer a[href*="trustseal.enamad.ir"],
.aero-auth__footer a[href*="trustseal.enamad.ir"] {
  display: inline-block;
  margin-inline-start: .6rem;
  vertical-align: middle;
}

.aero-panel-footer img[code],
.aero-auth__footer img[code] {
  display: inline-block;
  width: 3.75rem;
  height: auto;
  min-height: 2.5rem;
  cursor: pointer;
}

/*
 * Inline help "?" (Dara's request, 2026-09-19: settings pages should stay
 * uncluttered — a small question mark that shows the explanation on hover /
 * keyboard focus / tap instead of permanent paragraphs of notes). CSS-only:
 * the popover is a sibling span inside .aero-help, shown on :hover and
 * :focus-within, so it works with a keyboard and on touch (tap focuses the
 * tabindex'd wrapper) with no JavaScript.
 */
.aero-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  margin-inline-start: .35rem;
  border-radius: 50%;
  background: var(--aero-brand-100);
  color: var(--aero-brand-700);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
  user-select: none;
}

.aero-help:hover,
.aero-help:focus,
.aero-help:focus-within {
  background: var(--aero-brand);
  color: var(--aero-brand-contrast);
}

.aero-help__pop {
  display: none;
  position: absolute;
  z-index: 40;
  inset-block-start: calc(100% + .5rem);
  inset-inline-start: 0;
  width: max-content;
  max-width: min(380px, calc(100vw - 2rem));
  padding: .75rem .9rem;
  border: 1px solid var(--aero-brand-200);
  border-radius: var(--aero-radius-sm);
  background: var(--aero-surface);
  color: #212529;
  box-shadow: var(--aero-shadow);
  font-size: .82rem;
  font-weight: 400;
  line-height: 1.7;
  text-align: start;
  cursor: auto;
}

.aero-help:hover .aero-help__pop,
.aero-help:focus .aero-help__pop,
.aero-help:focus-within .aero-help__pop {
  display: block;
}

.aero-help__pop code,
.aero-help__pop .aero-help__sample {
  direction: rtl;
  unicode-bidi: plaintext;
  white-space: pre-wrap;
}

.aero-help__sample {
  display: block;
  margin: .4rem 0;
  padding: .5rem .6rem;
  border: 1px dashed var(--aero-brand-300);
  border-radius: var(--aero-radius-sm);
  background: var(--aero-brand-50);
  font-family: inherit;
}

/*
 * Public flight-schedule page header (Dara's request, 2026-09-19) — mirrors
 * the header of the Telegram schedule image (includes/services/
 * class-schedule-image.php): navy bar, the school's logo centered on a white
 * plate, or the header title in gold when there's no usable logo. The navy /
 * gold pair is fixed (it has to match the GD-drawn image exactly), so it's
 * local to this component rather than a school-configurable brand token.
 */
.aero-schedule-brand {
  --aero-schedule-navy: #152942;
  --aero-schedule-gold: #D4AF37;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  margin-bottom: 1rem;
  padding: .6rem 1rem;
  border-radius: var(--aero-radius);
  background: var(--aero-schedule-navy);
}

.aero-schedule-brand__plate {
  display: inline-flex;
  padding: .35rem .7rem;
  border-radius: 10px;
  background: #fff;
}

.aero-schedule-brand__logo {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 44px;
}

.aero-schedule-brand__name {
  display: none;
  color: var(--aero-schedule-gold);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-align: center;
}

.aero-schedule-brand--no-logo .aero-schedule-brand__plate { display: none; }
.aero-schedule-brand--no-logo .aero-schedule-brand__name { display: inline; }

/*
 * Page head (title + breadcrumb) — templates/components/page-header.php,
 * aero_render_page_head(). Used by every panel page that has one (booking,
 * the flight-schedule pages, the reservations board …), so it lives here with
 * the other shared components. It used to sit in aerobook-booking.css, which
 * only the booking page loads: the signed-in flight-schedule page (0.6.66)
 * drew the same markup with no styling at all.
 */
.aero-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: 1.75rem;
  padding-block-end: 1.25rem;
  border-block-end: 1px solid var(--aero-line);
}

.aero-page-head__title {
  margin: 0;
  color: var(--aero-ink);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
}

.aero-crumbs {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-block-start: .3rem;
  color: var(--aero-ink-muted);
  font-size: .75rem;
}

.aero-crumbs a {
  color: inherit;
  text-decoration: none;
}

.aero-crumbs a:hover { color: var(--aero-brand); }
.aero-crumbs svg { transform: scaleX(-1); }
.aero-crumbs [aria-current] { color: var(--aero-brand); font-weight: 500; }

/*
 * Busy control (0.6.73) — a button or link that was pressed and is waiting for
 * the next page. assets/js/aerobook-submit-guard.js puts .is-busy on it,
 * disables it and puts the spinner first, so a second click cannot start the
 * same job again (a slow page made instructors click three times and publish
 * three schedules). The spinner takes the control's own text colour.
 */
.aero-spinner {
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  margin-inline-end: .5em;
  vertical-align: -.15em;
  border: .16em solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: aero-spin .7s linear infinite;
}

@keyframes aero-spin { to { transform: rotate(360deg); } }

.is-busy,
.is-busy:disabled,
.is-busy[aria-disabled="true"] { cursor: progress !important; }

/* A pressed button is working, not switched off: keep it nearly full strength. */
button.is-busy:disabled,
.btn.is-busy:disabled,
a.is-busy[aria-disabled="true"] { opacity: .85; }

@media (prefers-reduced-motion: reduce) {
  .aero-spinner { animation-duration: 1.8s; }
}

/* --- The 24-hour time field (0.6.77; moved here in 0.6.89 so every panel page can use it —
   the reservation screens and the flight-log forms) ---------------------------------------- */
/* The clock sits on the right and the digits start on the left: the value is
   left-to-right text in a right-to-left page (physical properties on purpose). */
.aero-time { position: relative; display: block; cursor: pointer; }
.aero-time__input { padding-right: 2.75rem; text-align: left; font-variant-numeric: tabular-nums; letter-spacing: .04em; cursor: pointer; }
/* The whole box opens the time picker (0.6.185; the clock button since 0.6.85): the box says so
   under the pointer, and the clock is the picture of it, not a small target to find. */
.aero-time:hover .aero-time__input { border-color: var(--aero-brand); }
.aero-time__pick { position: absolute; top: 50%; right: .35rem; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; padding: 0; border: 0; border-radius: var(--aero-radius-sm); background: transparent; color: var(--aero-brand); cursor: pointer; transition: background-color var(--aero-transition), color var(--aero-transition); }
.aero-time__pick:hover { background: var(--aero-wash); color: var(--aero-brand-600); }
.aero-time__pick svg { display: block; pointer-events: none; }

/* The time picker (assets/js/aerobook-time-field.js builds the <dialog>): the page's own, because the browser's never showed up where it is
   used (0.6.195), in the shape Dara designed for her phone (0.6.196): a bottom sheet with a handle, «لغو» and «تایید» in its header, a row of quick
   choices and two wheels — hours and minutes — that snap under a highlighted bar, the chosen number big and in the brand colour. From 576px up it is
   a card in the middle. The wheels read left to right like the number in the field. Tokens only, so it follows the school's colours and the dark theme. */
.aero-timepick {
  width: 100%;
  max-width: 26rem;
  max-height: 100%;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--aero-ink);
  overflow: visible;
}
.aero-timepick::backdrop { background: rgba(16, 24, 40, .55); }
.aero-timepick[open] { animation: aero-timepick-rise .24s cubic-bezier(.16, 1, .3, 1); }
@keyframes aero-timepick-rise { from { opacity: 0; transform: translateY(2rem); } to { opacity: 1; transform: none; } }

.aero-timepick__sheet {
  display: grid;
  gap: .9rem;
  max-height: calc(100vh - 1rem);
  max-height: calc(100dvh - 1rem);
  padding: .6rem 1.1rem calc(.9rem + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 1.5rem 1.5rem 0 0;
  background: var(--aero-surface);
  box-shadow: var(--aero-shadow-lg);
  outline: none;
}
.aero-timepick__grip { justify-self: center; width: 2.5rem; height: .3rem; border-radius: 999px; background: var(--aero-line); }

/* «لغو» · the title · «تایید» */
.aero-timepick__bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-block-end: .8rem; border-block-end: 1px solid var(--aero-wash); }
.aero-timepick__title { margin: 0; color: var(--aero-ink); font-size: 1rem; font-weight: 700; }
.aero-timepick__cancel { min-height: 2.5rem; padding: 0 .5rem; border: 0; border-radius: .5rem; background: transparent; color: var(--aero-ink-muted); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; }
.aero-timepick__cancel:hover { color: var(--aero-ink); }
.aero-timepick__ok {
  min-height: 2.5rem;
  padding: 0 1.6rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--aero-brand-600) 0%, var(--aero-brand) 100%);
  color: var(--aero-brand-contrast);
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--aero-brand) 45%, transparent);
}
.aero-timepick__cancel:focus-visible,
.aero-timepick__ok:focus-visible,
.aero-timepick__chip:focus-visible,
.aero-timepick__link:focus-visible { outline: 3px solid color-mix(in srgb, var(--aero-brand) 35%, transparent); outline-offset: 2px; }

/* The quick choices: a row that scrolls sideways when it does not fit. */
.aero-timepick__chips { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; }
.aero-timepick__chips::-webkit-scrollbar { display: none; }
.aero-timepick__chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.25rem;
  padding: .3rem .95rem;
  border: 1px solid var(--aero-line);
  border-radius: 999px;
  background: var(--aero-wash);
  color: var(--aero-ink-muted);
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--aero-transition), border-color var(--aero-transition), color var(--aero-transition);
}
.aero-timepick__chip[hidden] { display: none; }
.aero-timepick__chip:hover { border-color: var(--aero-brand); background: color-mix(in srgb, var(--aero-brand) 8%, var(--aero-surface)); color: var(--aero-brand-700); }

/* The wheels: five rows high, the chosen one under the bar in the middle; the rows above and below fade away. */
.aero-timepick__wheel { --aero-wheel-row: 2.75rem; position: relative; display: flex; height: calc(var(--aero-wheel-row) * 5); direction: ltr; user-select: none; -webkit-user-select: none; }
.aero-timepick__wheel::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: var(--aero-wheel-row);
  transform: translateY(-50%);
  border: 1px solid color-mix(in srgb, var(--aero-brand) 26%, var(--aero-surface));
  border-radius: .85rem;
  background: color-mix(in srgb, var(--aero-brand) 8%, var(--aero-surface));
  pointer-events: none;
}
.aero-timepick__colon { position: absolute; top: 50%; left: 50%; z-index: 2; transform: translate(-50%, -52%); color: var(--aero-brand); font-size: 1.5rem; font-weight: 700; pointer-events: none; }
.aero-timepick__col {
  position: relative;
  z-index: 1;
  flex: 1;
  height: 100%;
  padding-block: calc(var(--aero-wheel-row) * 2);
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  overscroll-behavior: contain;
  touch-action: pan-y;
  cursor: grab;
  outline: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 26%, #000 74%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 26%, #000 74%, transparent 100%);
}
.aero-timepick__col::-webkit-scrollbar { display: none; }
.aero-timepick__col.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.aero-timepick__opt {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--aero-wheel-row);
  scroll-snap-align: center;
  color: var(--aero-ink-muted);
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  user-select: none;
  -webkit-user-select: none;
  transition: color var(--aero-transition), transform var(--aero-transition);
}
.aero-timepick__opt.is-active { color: var(--aero-brand-700); font-weight: 700; transform: scale(1.2); }
.aero-timepick__col:focus-visible .aero-timepick__opt.is-active { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .3em; text-decoration-color: color-mix(in srgb, var(--aero-brand) 45%, transparent); }

.aero-timepick__links { display: flex; justify-content: space-between; gap: 1rem; }
.aero-timepick__link { min-height: 2.5rem; padding: 0 .35rem; border: 0; border-radius: .5rem; background: transparent; color: var(--aero-brand); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.aero-timepick__link[hidden] { display: none; }

@media (min-width: 576px) {
  .aero-timepick { margin: auto; }
  .aero-timepick__sheet { padding: 1.25rem 1.4rem; border-radius: 1.5rem; }
  .aero-timepick__grip { display: none; }
}

/* A short glow on the field when a time was picked for it («تایید»). */
.aero-time__input.is-just-set { animation: aero-time-set 1s ease-out 1; }
@keyframes aero-time-set { from { box-shadow: 0 0 0 4px color-mix(in srgb, var(--aero-success) 38%, transparent); } to { box-shadow: 0 0 0 4px transparent; } }

@media (prefers-reduced-motion: reduce) {
  .aero-timepick[open] { animation: none; }
  .aero-timepick__chip, .aero-timepick__opt { transition: none; }
  .aero-time__input.is-just-set { animation: none; }
}

/* ==== 0.6.104 — display pictures (includes/helpers/media.php, templates/components/avatar-card.php) ==== */
.aero-avatar {
  display: inline-block; flex: none; vertical-align: middle;
  width: var(--aero-avatar-size, 40px); height: var(--aero-avatar-size, 40px);
  border-radius: 50%; object-fit: cover;
  background: var(--aero-wash); border: 2px solid var(--aero-surface); box-shadow: 0 0 0 1px var(--aero-line);
}
.aero-avatar--initials {
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--aero-brand) 16%, var(--aero-surface)); color: color-mix(in srgb, var(--aero-brand) 80%, #000);
  font-size: calc(var(--aero-avatar-size, 40px) * .36); font-weight: 800; line-height: 1;
}
.aero-sidebar__avatar.has-photo { padding: 0; overflow: hidden; }
.aero-sidebar__avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }

.aero-avatar-card {
  display: flex; align-items: center; gap: 1.25rem; margin-block-end: 1.25rem; padding: 1rem 1.25rem;
  border: 1px solid var(--aero-line); border-radius: var(--aero-radius-lg); background: var(--aero-surface); box-shadow: var(--aero-shadow-sm);
}
.aero-avatar-card__preview { flex: none; }
.aero-avatar-card__body { flex: 1 1 auto; min-width: 0; }
.aero-avatar-card__title { margin: 0 0 .25rem; color: var(--aero-ink); font-size: 1rem; font-weight: 800; }
.aero-avatar-card__hint { margin: 0 0 .75rem; color: var(--aero-ink-muted); font-size: .8rem; line-height: 1.8; }
.aero-avatar-card__forms { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.aero-avatar-card__upload, .aero-avatar-card__remove { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.aero-avatar-card__upload input[type="file"] { max-width: 17rem; font-size: .8rem; }
.aero-avatar-card__btn {
  padding: .45rem 1rem; border: 1px solid var(--aero-line); border-radius: 10px; background: var(--aero-surface); color: var(--aero-ink);
  font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer;
}
.aero-avatar-card__btn:hover { background: var(--aero-wash); }
.aero-avatar-card__btn--primary { border-color: var(--aero-brand); background: var(--aero-brand); color: var(--aero-brand-contrast, #fff); }
.aero-avatar-card__btn--primary:hover { background: color-mix(in srgb, var(--aero-brand) 85%, #000); }
@media (max-width: 560px) { .aero-avatar-card { flex-direction: column; align-items: flex-start; } }

/* the upload as choose → preview → confirm (0.6.148, assets/js/aerobook-avatar.js); without script the native input and the plain button after it are what shows */
.aero-avatar-card:not(.is-enhanced) .aero-avatar-card__pick { display: none; }
.aero-avatar-card.is-enhanced .aero-avatar-card__fallback { display: none; }
.aero-avatar-card.is-enhanced .aero-avatar-card__file {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.aero-avatar-card__pick {
  display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.4rem; border: 1px solid var(--aero-brand); border-radius: 12px;
  background: var(--aero-brand); color: var(--aero-brand-contrast, #fff); font-size: .9rem; font-weight: 800; cursor: pointer; box-shadow: var(--aero-shadow-sm);
}
.aero-avatar-card__pick:hover { background: color-mix(in srgb, var(--aero-brand) 85%, #000); }
.aero-avatar-card__file:focus-visible + .aero-avatar-card__pick { outline: 3px solid color-mix(in srgb, var(--aero-brand) 45%, transparent); outline-offset: 2px; }
.aero-avatar-card__pick[hidden], .aero-avatar-card__chosen[hidden], .aero-avatar-card__error[hidden] { display: none; }
.aero-avatar-card__chosen { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.aero-avatar-card__file-name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; color: var(--aero-ink); font-size: .8rem; font-weight: 700; }
.aero-avatar-card__file-size { color: var(--aero-ink-muted); font-size: .75rem; }
.aero-avatar-card__error {
  flex-basis: 100%; margin: .5rem 0 0; padding: .5rem .8rem; border: 1px solid color-mix(in srgb, var(--aero-danger) 40%, var(--aero-surface)); border-radius: 10px;
  background: color-mix(in srgb, var(--aero-danger) 8%, var(--aero-surface)); color: color-mix(in srgb, var(--aero-danger) 80%, #000); font-size: .8rem; font-weight: 600;
}
.aero-avatar-card__preview-img { display: block; width: 88px; height: 88px; border: 3px solid var(--aero-brand); border-radius: 50%; object-fit: cover; box-shadow: var(--aero-shadow-sm); }
.aero-avatar-card.is-busy .aero-avatar-card__btn { opacity: .6; pointer-events: none; }
.aero-avatar-card.is-busy [data-aero-avatar-confirm] span::after { content: '…'; }

/*
 * The phone's bottom «island» menu (0.6.157, docs/43 E2): a floating, translucent bar with the three pages a flight role uses most and «منو» (the full drawer). Phones only (< 768px);
 * templates/panel-shell.php draws it for the flight roles and adds body.aero-has-island so the page leaves room underneath it.
 */
.aero-island { display: none; }

@media (max-width: 767.98px) {
  .aero-island {
    display: flex;
    position: fixed;
    inset-inline: 16px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    max-width: min(440px, calc(100vw - 32px));
    margin-inline: auto;
    gap: 4px;
    padding: 7px;
    isolation: isolate;
    /* above the page, below the drawer (1040), its overlay (1039) and Bootstrap's modals (1055) */
    z-index: 1030;
    border: 1px solid var(--aero-glass-border);
    border-radius: 999px;
    /* A solid bar first: an old Android WebView that knows neither color-mix() nor backdrop-filter still gets a readable one. */
    background: var(--aero-surface);
    box-shadow:
      0 18px 40px -14px rgba(15, 23, 42, .34),
      0 0 0 1px color-mix(in srgb, var(--aero-brand) 6%, transparent);
    transition: transform .22s cubic-bezier(.4, 0, .2, 1), opacity .22s ease;
  }

  .aero-island::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .52);
  }

  /* The translucency only together with the blur that makes it legible. */
  @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .aero-island {
      background: var(--aero-glass-bg);
      -webkit-backdrop-filter: blur(calc(var(--aero-glass-blur) + 6px)) saturate(1.4);
      backdrop-filter: blur(calc(var(--aero-glass-blur) + 6px)) saturate(1.4);
    }
  }

  body[data-aero-glass="1"] .aero-island {
    box-shadow:
      0 22px 48px -16px rgba(15, 23, 42, .38),
      inset 0 1px 0 rgba(255, 255, 255, .58);
  }
  /* Out of the way while a text field is being typed in (the on-screen keyboard would push it over the field). */
  .aero-island--away {
    transform: translateY(calc(100% + 32px));
    opacity: 0;
    pointer-events: none;
  }
  /* Room under the page content so nothing is hidden behind the bar (the shell's p-3 is !important, hence this is too). */
  body.aero-has-island .aero-panel-main {
    padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

.aero-island__item {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  padding: 7px 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--aero-ink-muted);
  font: inherit;
  font-size: .68rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.01em;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: background var(--aero-transition), color var(--aero-transition), transform var(--aero-transition);
}
.aero-island__item:hover,
.aero-island__item:focus { color: var(--aero-ink); text-decoration: none; }
.aero-island__item:focus-visible { outline: 2px solid var(--aero-brand); outline-offset: 2px; }
.aero-island__item:active { transform: scale(.96); }
.aero-island__item.is-active {
  color: var(--aero-brand);
  background: color-mix(in srgb, var(--aero-brand) 14%, var(--aero-glass-bg, var(--aero-surface)));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .45),
    0 4px 12px -6px color-mix(in srgb, var(--aero-brand) 35%, transparent);
  font-weight: 700;
}
.aero-island__item--menu.is-active,
.aero-island__item--menu:focus-visible {
  color: var(--aero-ink);
  background: color-mix(in srgb, var(--aero-ink) 6%, var(--aero-glass-bg, var(--aero-surface)));
}
.aero-island__icon { display: inline-flex; opacity: .92; }
.aero-island__item.is-active .aero-island__icon { opacity: 1; }
.aero-island__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aero-island__badge {
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: calc(50% + 6px);
  min-width: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--aero-danger);
  color: #FFFFFF;
  font-size: .62rem;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  /* "99+" must read as typed inside an RTL page, not "+99". */
  direction: ltr;
  unicode-bidi: isolate;
}
.aero-island__badge--info { background: var(--aero-info); }
.aero-island__badge--warning { background: var(--aero-warning); }
@media (prefers-reduced-motion: reduce) { .aero-island { transition: none; } }
@media print { .aero-island { display: none !important; } }

/*
 * The signature card (0.6.158, docs/43 F): the picture on file, and a pad to draw a new one with a finger or the mouse (assets/js/aerobook-signature.js).
 * The baseline is a CSS background of the pad's frame, never part of the canvas, so it does not end up in the exported picture.
 */
.aero-signature-card__current { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; margin-bottom: 1.25rem; }
.aero-signature-card__img {
  max-width: 100%; height: auto; padding: .5rem 1rem;
  background: var(--aero-surface); border: 1px dashed var(--aero-brand-200); border-radius: var(--aero-radius-sm);
}
.aero-signature-card__meta { margin: 0; color: var(--aero-ink-muted); font-size: .8rem; }
.aero-signature-card__label { margin: 0 0 .4rem; font-size: .9rem; font-weight: 600; }
.aero-signature-card__pad-wrap {
  max-width: 520px; aspect-ratio: 1000 / 320;
  border: 1px solid var(--aero-brand-200); border-radius: var(--aero-radius);
  background-color: var(--aero-surface);
  background-image: linear-gradient(var(--aero-brand-200), var(--aero-brand-200));
  background-repeat: no-repeat; background-size: calc(100% - 32px) 1px; background-position: center calc(100% - 44px);
}
.aero-signature-card__pad {
  display: block; width: 100%; height: 100%; border-radius: inherit; cursor: crosshair;
  /* the page must not scroll or zoom while a finger is drawing */
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.aero-signature-card__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.aero-signature-card__error { margin: .5rem 0 0; color: color-mix(in srgb, var(--aero-danger) 80%, #000); font-size: .8rem; font-weight: 600; }
.aero-signature-card__error[hidden] { display: none; }
.aero-signature-card__remove { margin-top: 1rem; border-block-start: 1px solid var(--aero-brand-100); padding-top: .5rem; }

/*
 * The access-profile editor (0.6.159, docs/43 J): permissions in grouped, searchable boxes beside a sticky «pages this person will see» preview (assets/js/aerobook-access.js).
 */
.aero-access__group { margin: 0 0 1rem; padding: .5rem .9rem .75rem; border: 1px solid var(--aero-brand-100); border-radius: var(--aero-radius); }
.aero-access__group[hidden] { display: none; }
/* Bootstrap floats a legend to full width; here it is a plain label on the frame */
.aero-access__legend { float: none; width: auto; margin: 0; padding: 0 .4rem; font-size: .95rem; font-weight: 700; }
.aero-access__rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .25rem 1.25rem; }
.aero-access__perm { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; padding: .25rem 0; }
.aero-access__perm[hidden] { display: none; }
.aero-access__preview { position: sticky; top: 1rem; }
@media (max-width: 991.98px) { .aero-access__preview { position: static; } }

/* ==== 0.6.189 — the error window (includes/helpers/flash-modal.php, assets/js/aerobook-flash-modal.js) ====
   A failed request used to leave its message as a strip at the top of the page, above the fold after a redirect to a card or a long form.
   Now it is a dialog in the middle of the screen; the strip that said the same words is hidden once the window is open. */
.aero-flash-modal {
  width: min(30rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--aero-danger) 30%, var(--aero-line));
  border-radius: 20px;
  background: var(--aero-surface);
  color: var(--aero-ink);
  box-shadow: var(--aero-shadow-lg);
}
.aero-flash-modal::backdrop { background: rgba(16, 24, 40, .55); }
.aero-flash-modal[open] { animation: aero-flash-pop .18s ease-out; }
.aero-flash-modal__box { padding: 1.75rem 1.5rem 1.4rem; text-align: center; }
.aero-flash-modal__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.4rem; height: 3.4rem; margin-block-end: .7rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--aero-danger) 12%, var(--aero-surface));
  color: var(--aero-danger);
}
.aero-flash-modal__icon svg { display: block; }
.aero-flash-modal__title { margin: 0 0 .6rem; font-size: 1.1rem; font-weight: 700; color: var(--aero-ink); }
.aero-flash-modal__body p { margin: 0 0 .55rem; font-size: .92rem; line-height: 1.95; }
.aero-flash-modal__body p:last-child { margin-block-end: 0; }
.aero-flash-modal__ok {
  min-width: 9rem; margin-block-start: 1.1rem; padding: .6rem 1.5rem;
  border: 0; border-radius: 12px;
  background: var(--aero-danger); color: #fff;
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: background-color var(--aero-transition), transform var(--aero-transition);
}
.aero-flash-modal__ok:hover { background: color-mix(in srgb, var(--aero-danger) 85%, #000); }
.aero-flash-modal__ok:focus-visible { outline: 2px solid var(--aero-danger); outline-offset: 3px; }
/* the strip with the same words, once the window is open */
.aero-flash-repeat { display: none !important; }
@keyframes aero-flash-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .aero-flash-modal[open] { animation: none; } }

/* A progress bar — «done of total» in words and a bar (aero_progress_bar_html, docs/49 §2). The colour is never the only signal: the numbers are always printed. */
.aero-progress { --aero-progress-tone: var(--aero-primary); display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.aero-progress--success { --aero-progress-tone: var(--aero-success); }
.aero-progress--warning { --aero-progress-tone: var(--aero-warning); }
.aero-progress--danger { --aero-progress-tone: var(--aero-danger); }
.aero-progress__head { display: flex; flex-wrap: wrap; gap: .25rem .75rem; justify-content: space-between; align-items: baseline; font-size: .82rem; }
.aero-progress__label { font-weight: 600; color: var(--aero-ink); }
.aero-progress__count { color: var(--aero-ink-muted); font-variant-numeric: tabular-nums; }
.aero-progress__track { height: .5rem; overflow: hidden; border-radius: 999px; background: var(--aero-line); }
.aero-progress__fill { height: 100%; border-radius: 999px; background: var(--aero-progress-tone); transition: width var(--aero-transition); }

/* The bar that asks a student who is in a class to sign the contract (0.6.287; aero_contract_banner_html, templates/panel-shell.php) — top of every panel page until they have. */
.aero-contract-bar {
  display: flex; align-items: center; gap: .85rem; margin: 0 0 1rem; padding: .75rem 1rem;
  border: 1px solid color-mix(in srgb, var(--aero-warning) 45%, var(--aero-line)); border-radius: var(--aero-radius);
  background: color-mix(in srgb, var(--aero-warning) 10%, var(--aero-surface)); color: var(--aero-ink);
}
.aero-contract-bar__icon { flex: none; display: inline-flex; color: color-mix(in srgb, var(--aero-warning) 80%, #000); }
.aero-contract-bar__text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: baseline; font-size: .86rem; line-height: 1.9; }
.aero-contract-bar__text span { color: var(--aero-ink-muted); }
.aero-contract-bar__text a { color: var(--aero-brand); font-weight: 700; }
.aero-contract-bar__cta {
  flex: none; padding: .45rem 1.1rem; border-radius: var(--aero-radius-sm); background: var(--aero-brand); color: var(--aero-brand-contrast, #fff);
  font-size: .84rem; font-weight: 800; text-decoration: none; white-space: nowrap;
}
.aero-contract-bar__cta:hover { background: var(--aero-brand-600, var(--aero-brand)); color: var(--aero-brand-contrast, #fff); }
@media (max-width: 575.98px) { .aero-contract-bar { flex-wrap: wrap; } .aero-contract-bar__cta { flex: 1 0 100%; text-align: center; } }

/* Student booking temporarily closed (settings → booking.closed). */
.aero-booking-closed-bar {
  display: flex; align-items: flex-start; gap: .75rem; margin: 0 0 1rem; padding: .7rem 1rem;
  border: 1px solid color-mix(in srgb, var(--aero-danger, #dc3545) 35%, var(--aero-line));
  border-radius: var(--aero-radius);
  background: color-mix(in srgb, var(--aero-danger, #dc3545) 8%, var(--aero-surface));
  color: var(--aero-ink);
}
.aero-booking-closed-bar__badge {
  flex: none; font-size: .72rem; font-weight: 800; letter-spacing: .02em; padding: .2rem .55rem; border-radius: 999px;
  background: color-mix(in srgb, var(--aero-danger, #dc3545) 18%, var(--aero-surface));
  color: color-mix(in srgb, var(--aero-danger, #dc3545) 85%, #000);
}
.aero-booking-closed-bar__text { flex: 1; min-width: 0; font-size: .86rem; line-height: 1.85; }
