/* ================================================================
   SHELL.CSS — Tətbiq qabığı və ümumi komponentlər
   İçindəkilər:
   - Maket (app-shell, sidebar, header)
   - Brend
   - Naviqasiya: yan panel, drawer, aşağı naviqasiya
   - Düymələr, çiplər, nişanlar, axtarış, seqment
   - Sheet / dialog / toast
   - Boş, yüklənmə və xəta halları
   ================================================================ */

/* ── Köməkçi görünürlük ───────────────────────────────────────── */
.only-desktop { display: none !important; }
@media (min-width: 1024px) {
  .only-desktop { display: initial !important; }
  .only-desktop.flex { display: flex !important; }
  .only-mobile { display: none !important; }
}

/* ── Maket ────────────────────────────────────────────────────── */
.app-shell { position: relative; min-height: 100vh; min-height: 100dvh; }
.app-col   { min-width: 0; }
.app-main  { display: block; outline: none; }

@media (min-width: 1024px) {
  .app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
}

/* ── Brend ────────────────────────────────────────────────────── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-primary);
  text-decoration: none;
  min-width: 0;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--accent);
  flex-shrink: 0;
}
.brand-mark .ic { width: 36px; height: 36px; stroke-width: 1.7; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-text b { font-size: 1.25rem; font-weight: 800; letter-spacing: 0.01em; }
.brand-text small { font-size: 0.8125rem; font-weight: 600; color: var(--color-text-primary); opacity: 0.92; }

/* ── Header ───────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) var(--page-gutter) 0;
  background: color-mix(in srgb, var(--color-background-alt) 88%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.header-spacer { flex: 1; min-width: 0; }
.header-tagline {
  flex: 1;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
}
.header-tagline i { font-style: normal; margin: 0 0.9em; color: var(--accent2); }
.header-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--color-text-primary);
  font-size: 1.35rem;
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
}
.icon-btn:hover { background: var(--color-primary-soft); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn--filled {
  background: var(--color-surface-elevated);
  border: 1px solid var(--border);
}
.icon-btn .dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-danger);
  border: 2px solid var(--color-background-alt);
}
.icon-btn .dot[hidden] { display: none; }

/* Hesab düyməsi (köhnə #authHeaderBtn — firebase.js təkrar yazır) */
.header-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--color-text-primary);
  font-weight: 700;
  font-size: var(--fs-sm);
  cursor: pointer;
  border-radius: var(--r-pill);
}
.header-auth-btn .auth-name { display: none; }
.header-auth-btn .auth-avatar,
.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--color-primary-hover), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.header-auth-btn.is-guest {
  width: 44px;
  border: 1px solid var(--border);
  background: var(--color-surface-elevated);
  border-radius: 50%;
}
.header-auth-btn.is-guest .auth-name { display: none; }

/* Dil seçimi (AZ / EN) */
.header-lang-pill {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--color-surface-elevated);
  border: 1px solid var(--border);
}
.lang-pill-btn {
  min-width: 40px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.lang-pill-btn.active { background: var(--accent); color: #fff; }

@media (min-width: 1024px) {
  .app-header {
    top: 14px;
    margin: 14px 28px 0;
    padding: 0 14px 0 24px;
    height: 64px;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: color-mix(in srgb, var(--color-background-alt) 80%, transparent);
  }
  .header-auth-btn .auth-name { display: inline; }
  .header-auth-btn.is-guest {
    width: auto;
    padding: 0 16px 0 12px;
    border-radius: var(--r-pill);
    gap: 8px;
  }
  .header-auth-btn.is-guest .auth-name { display: inline; }
}

/* ── Yan panel (desktop) ──────────────────────────────────────── */
.app-sidebar {
  display: none;
}
@media (min-width: 1024px) {
  .app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 14px 18px;
    overflow-y: auto;
    background: var(--color-background-alt);
    border-right: 1px solid var(--border);
    scrollbar-width: thin;
  }
  .app-sidebar .brand { padding: 0 8px 18px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
}

.nav-list { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--fs-base);
  font-weight: 600;
  text-decoration: none;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-link .ic { font-size: 1.3rem; color: var(--color-text-secondary); transition: color var(--t-fast); }
.nav-link:hover { background: var(--color-primary-soft); color: var(--color-text-primary); }
.nav-link[aria-current="page"],
.nav-link.is-active {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 88%, black), color-mix(in srgb, var(--accent) 62%, black));
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.nav-link[aria-current="page"] .ic,
.nav-link.is-active .ic { color: #fff; }
.nav-sub { display: flex; align-items: center; margin-left: auto; font-size: var(--fs-xs); color: inherit; opacity: 0.75; font-weight: 600; }

.nav-heading {
  margin: 18px 0 6px;
  padding: 14px 14px 0;
  border-top: 1px solid var(--border);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Yan paneldəki proqres kartı */
.progress-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 12%, var(--color-surface-elevated)), var(--color-surface-elevated));
}
.progress-card .ic { font-size: 1.6rem; color: var(--accent2); margin-bottom: 8px; }
.progress-card p { margin: 0 0 12px; font-size: var(--fs-base); font-weight: 600; line-height: 1.35; color: var(--color-text-primary); }
.progress-bar { height: 7px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--border) 80%, transparent); overflow: hidden; }
.progress-bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--color-accent)); transition: width 500ms var(--ease); }
.progress-card small { display: block; margin-top: 9px; font-size: var(--fs-sm); color: var(--color-text-secondary); font-weight: 600; letter-spacing: 0.02em; }
.progress-card a { color: inherit; }
.progress-card[hidden] { display: none; }

/* ── Scrim, Drawer ────────────────────────────────────────────── */
.scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(1, 6, 16, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base), visibility 0s linear 220ms;
}
.scrim.is-visible { opacity: 1; visibility: visible; transition-delay: 0s; }

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(86vw, 340px);
  padding: calc(var(--safe-top) + 16px) 14px calc(var(--safe-bottom) + 16px);
  background: var(--color-background-alt);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-float);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform var(--t-base), visibility 0s linear 220ms;
}
.drawer.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 12px; margin-bottom: 4px; }
@media (min-width: 1024px) { .drawer, .scrim--drawer { display: none; } }

/* ── Aşağı naviqasiya ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  width: 100% !important;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding: 8px 10px calc(var(--safe-bottom) + 6px);
  z-index: var(--z-nav);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  align-items: stretch;
  background: color-mix(in srgb, var(--color-background-alt) 92%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 -10px 30px rgba(0, 8, 24, 0.35);
}
.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 4px 2px;
  border-radius: var(--r-md);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.6875rem;
  font-weight: 600;
  transition: background var(--t-base), color var(--t-base);
}
.bn-item .ic { font-size: 1.55rem; transition: transform var(--t-base); }
.bn-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.bn-item:active .ic { transform: scale(0.9); }
.bn-item[aria-current="page"] {
  color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 92%, white 0%), color-mix(in srgb, var(--accent) 70%, black));
  box-shadow: var(--shadow-glow);
}
@media (min-width: 1024px) { .bottom-nav { display: none; } }

/* Aşağı naviqasiyanın üstündə qalan üzən elementlər (AI düyməsi və s.) */
#ai-button { bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px) !important; right: 16px !important; }
@media (min-width: 1024px) { #ai-button { bottom: 24px !important; right: 24px !important; } }

/* ── Düymələr ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
}
.btn .ic { font-size: 1.15rem; }
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: linear-gradient(180deg, var(--color-primary-hover), var(--accent)); color: #fff; box-shadow: var(--shadow-glow); }
.btn--primary:hover { background: var(--color-primary-hover); }
.btn--secondary { background: var(--color-surface-elevated); border-color: var(--border); color: var(--color-text-primary); }
.btn--secondary:hover { border-color: var(--color-border-strong); background: var(--color-surface-inner); }
.btn--ghost { background: transparent; color: var(--color-text-secondary); }
.btn--ghost:hover { background: var(--color-primary-soft); color: var(--color-text-primary); }
.btn--danger { background: color-mix(in srgb, var(--color-danger) 14%, transparent); border-color: color-mix(in srgb, var(--color-danger) 50%, transparent); color: var(--color-danger); }
.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Çiplər ───────────────────────────────────────────────────── */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px var(--page-gutter) 6px;
  margin: 0 calc(var(--page-gutter) * -1);
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--page-gutter);
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--color-surface-elevated);
  color: var(--color-text-secondary);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip:hover { border-color: var(--color-border-strong); color: var(--color-text-primary); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--shadow-glow); }
.chip .ic { font-size: 1rem; }
@media (min-width: 1024px) {
  .chips { padding-inline: 0; margin-inline: 0; flex-wrap: wrap; overflow: visible; }
}

/* ── Nişanlar ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--color-surface-inner);
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge--blue   { color: var(--accent2); border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.badge--green  { color: var(--color-success); border-color: color-mix(in srgb, var(--color-success) 50%, transparent); background: color-mix(in srgb, var(--color-success) 12%, transparent); }
.badge--red    { color: #ff7d8a; border-color: color-mix(in srgb, var(--color-danger) 55%, transparent); background: color-mix(in srgb, var(--color-danger) 14%, transparent); }
.badge--purple { color: #b59cff; border-color: color-mix(in srgb, var(--fc-requests) 55%, transparent); background: color-mix(in srgb, var(--fc-requests) 14%, transparent); }
.badge--orange { color: var(--color-warning); border-color: color-mix(in srgb, var(--color-warning) 50%, transparent); background: color-mix(in srgb, var(--color-warning) 12%, transparent); }

/* ── Axtarış sahəsi ───────────────────────────────────────────── */
.field-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 6px 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--color-surface-elevated) 92%, transparent);
  color: var(--color-text-muted);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent); }
.field-search .ic { font-size: 1.3rem; }
.field-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text-primary);
  font-size: var(--fs-md);
}
.field-search input::placeholder { color: var(--color-text-muted); }
.field-search input::-webkit-search-cancel-button { display: none; }
.field-search .clear-btn {
  display: none;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  place-items: center;
}
.field-search.has-value .clear-btn { display: inline-grid; }

/* Seqment idarəsi */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--color-surface-elevated);
}
.segmented button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: calc(var(--r-md) - 4px);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.segmented button[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: var(--shadow-glow); }

/* ── Səhifə başlığı ───────────────────────────────────────────── */
.page-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 56px;
  margin: 0 -8px;
  padding: 6px 0 0;
}
.page-head h1 { flex: 1; margin: 0; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.01em; }
.page-head .icon-btn { font-size: 1.4rem; }
.screen { padding-top: 6px; }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 12px;
}
.section-head h2 { margin: 0; font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.005em; }
.link-more {
  display: inline-flex; align-items: center; gap: 2px;
  min-height: 36px;
  color: var(--accent2);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  background: none; border: 0; cursor: pointer;
}
.link-more .ic { font-size: 1rem; }

/* ── Sheet (aşağıdan açılan panel) və Dialog ──────────────────── */
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-sheet);
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  padding: 10px 16px calc(var(--safe-bottom) + 20px);
  background: var(--color-background-alt);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-float);
  transform: translateY(104%);
  visibility: hidden;
  transition: transform var(--t-base), visibility 0s linear 220ms;
  overflow: hidden;
}
.sheet.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.sheet-grip { width: 40px; height: 4px; margin: 0 auto 10px; border-radius: 4px; background: var(--border); flex-shrink: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0 10px; flex-shrink: 0; }
.sheet-head h2 { margin: 0; font-size: 1.125rem; font-weight: 800; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 0 8px; margin: 0 -4px; padding-inline: 4px; }
.sheet-actions { display: flex; gap: 10px; padding-top: 12px; flex-shrink: 0; }
.sheet-actions .btn { flex: 1; }
@media (min-width: 768px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: min(520px, calc(100vw - 48px));
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding-bottom: 20px;
    transform: translate(-50%, -46%) scale(0.97);
    opacity: 0;
    transition: transform var(--t-base), opacity var(--t-base), visibility 0s linear 220ms;
  }
  .sheet.is-open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-grip { display: none; }
}

/* Sheet daxilində siyahı */
.opt-group { margin: 0 0 18px; }
.opt-group > h3 { margin: 0 0 10px; font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-muted); }
.opt-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Toast ────────────────────────────────────────────────────── */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 18px);
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--r-md);
  background: var(--color-surface-elevated);
  color: var(--color-text-primary);
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: var(--shadow-float);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--t-base), opacity var(--t-base);
}
.app-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.app-toast .ic { color: var(--color-success); font-size: 1.2rem; }
.app-toast[data-type="error"] .ic { color: var(--color-danger); }
@media (min-width: 1024px) { .app-toast { bottom: 28px; } }

/* ── Boş / yüklənmə / xəta halları ────────────────────────────── */
.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 20px;
  text-align: center;
  color: var(--color-text-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--color-surface-elevated) 60%, transparent);
}
.state-box .ic { font-size: 2.2rem; color: var(--accent2); }
.state-box h3 { margin: 0; font-size: 1.0625rem; color: var(--color-text-primary); }
.state-box p { margin: 0; font-size: var(--fs-sm); max-width: 34ch; }
.state-box--error .ic { color: var(--color-danger); }

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--color-surface-elevated);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.skeleton::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--accent) 10%, transparent) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-card { height: 96px; }

/* Ekran keçidi (köhnə .main-tab fade-i əvəz edir) */
.main-tab {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: none;
}
.main-tab[hidden], .main-tab.is-hidden { display: none !important; }
.main-tab.is-entering { animation: screenIn 260ms var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (min-width: 1024px) { .header-spacer { display: none; } }

/* Qonaq düyməsindəki ikon və dar ekran loqosu */
.header-auth-btn.is-guest .ic { width: 22px; height: 22px; }
@media (max-width: 359px) {
  .brand--header { gap: 8px; }
  .brand-mark .ic { width: 30px; height: 30px; }
  .brand-text b { font-size: 1.125rem; }
  .brand-text small { font-size: 0.6875rem; white-space: nowrap; }
}

/* Menyu / aşağı panel açıq olanda üzən AI düyməsi üstündən çıxmasın */
body.has-layer #ai-button { opacity: 0; visibility: hidden; pointer-events: none; }
