/* ==========================================================================
   ZOOMART IT — Mini App
   iOS 18–inspired liquid-glass design system
   ========================================================================== */

:root {
  --bg-0: #0a0e1a;
  --bg-1: #0b1220;
  --bg-2: #0e1626;

  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.11);
  --glass-border-strong: rgba(255, 255, 255, 0.18);
  --glass-highlight: rgba(255, 255, 255, 0.35);

  --text-1: #f4f6fc;
  --text-2: #aab2c8;
  --text-3: #757e96;

  --blue: #3b82f6;
  --blue-2: #6366f1;
  --cyan: #22d3ee;
  --indigo: #6366f1;

  --accent: #4f8cff;
  --accent-2: #7c6bf5;
  --accent-grad: linear-gradient(135deg, var(--blue) 0%, var(--indigo) 100%);

  --amber: #f5a524;
  --amber-bg: rgba(245, 165, 36, 0.12);
  --amber-border: rgba(245, 165, 36, 0.28);
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.12);
  --green-border: rgba(52, 211, 153, 0.3);

  --shadow-soft: 0 8px 30px rgba(3, 8, 20, 0.35);
  --shadow-lift: 0 16px 44px rgba(3, 8, 20, 0.45);

  --radius-lg: 26px;
  --radius-md: 20px;
  --radius-sm: 14px;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  --tabbar-h: 78px;

  color-scheme: dark;
}

/* Light theme (prefers-color-scheme fallback + explicit Telegram override) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-0: #eef2fb;
    --bg-1: #e7ecf9;
    --bg-2: #dfe6f7;

    --glass: rgba(255, 255, 255, 0.55);
    --glass-strong: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-border-strong: rgba(120, 140, 190, 0.35);
    --glass-highlight: rgba(255, 255, 255, 0.9);

    --text-1: #0f1a2e;
    --text-2: #4c5877;
    --text-3: #7c869e;

    --shadow-soft: 0 8px 30px rgba(60, 90, 160, 0.12);
    --shadow-lift: 0 16px 40px rgba(60, 90, 160, 0.18);

    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg-0: #eef2fb;
  --bg-1: #e7ecf9;
  --bg-2: #dfe6f7;

  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-border-strong: rgba(120, 140, 190, 0.35);
  --glass-highlight: rgba(255, 255, 255, 0.9);

  --text-1: #0f1a2e;
  --text-2: #4c5877;
  --text-3: #7c869e;

  --shadow-soft: 0 8px 30px rgba(60, 90, 160, 0.12);
  --shadow-lift: 0 16px 40px rgba(60, 90, 160, 0.18);

  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-1);
  color: var(--text-1);
}

body {
  font-family: "Noto Sans Georgian", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.1px;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

button, input {
  font-family: inherit;
  color: inherit;
}

/* -------------------------------- background -------------------------------- */

#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(120% 90% at 15% -10%, var(--bg-2) 0%, var(--bg-1) 45%, var(--bg-0) 100%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform;
}

.glow-a {
  width: 340px; height: 340px;
  top: -120px; left: -80px;
  background: radial-gradient(circle, var(--blue) 0%, transparent 70%);
  animation: drift-a 22s ease-in-out infinite;
}
.glow-b {
  width: 300px; height: 300px;
  top: 260px; right: -110px;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
  animation: drift-b 26s ease-in-out infinite;
}
.glow-c {
  width: 380px; height: 380px;
  bottom: -160px; left: 10%;
  background: radial-gradient(circle, var(--cyan) 0%, transparent 72%);
  opacity: 0.35;
  animation: drift-c 30s ease-in-out infinite;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .glow { opacity: 0.28; }
}
:root[data-theme="light"] .glow { opacity: 0.28; }

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 40px) scale(1.12); }
}
@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-25px, 30px) scale(1.08); }
}
@keyframes drift-c {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -25px) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .glow { animation: none !important; }
}

/* --------------------------------- shell --------------------------------- */

#app {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
}

.hidden { display: none !important; }

.screen {
  padding: 0 18px calc(var(--tabbar-h) + var(--safe-b) + 22px);
  animation: screen-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

#screen-detail.screen {
  padding-bottom: 18px;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.safe-top { padding-top: calc(var(--safe-t) + 18px); }
.safe-bottom { padding-bottom: var(--safe-b); }

/* ------------------------------- glass base ------------------------------- */

.glass-surface {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight);
}

/* ---------------------------------- icons ---------------------------------- */

.icon { width: 20px; height: 20px; display: block; }
.ico { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.ico svg { width: 100%; height: 100%; }
.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 40px; height: 40px; }
.ico-xl { width: 34px; height: 34px; }

.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 1.6s; }
}

/* --------------------------------- topbar --------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.topbar-id { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: var(--accent-grad);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255,255,255,0.35);
}
.brand-mark img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.greeting { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.app-name { font-size: 17px; font-weight: 800; letter-spacing: 0.1px; }

.status-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  animation: pulse-dot 2.2s ease-out infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* -------------------------------- search bar -------------------------------- */

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight);
  color: var(--text-2);
  transition: border-color 0.2s ease;
}
.search-bar:focus-within {
  border-color: var(--glass-border-strong);
}
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--text-1);
  min-width: 0;
}
.search-bar input::placeholder { color: var(--text-3); }

.sticky-search { position: sticky; top: calc(var(--safe-t) + 8px); z-index: 5; }

/* --------------------------------- AI card --------------------------------- */

.ai-card {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 18px;
  margin-bottom: 22px;
  border: 1px solid rgba(120, 150, 255, 0.35);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(59,130,246,0.28), rgba(124,107,245,0.22) 55%, rgba(34,211,238,0.18));
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 14px 34px rgba(59, 91, 219, 0.28), inset 0 1px 0 rgba(255,255,255,0.28);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.ai-card:active { transform: scale(0.98); }

.ai-card-glow {
  position: absolute;
  width: 180px; height: 180px;
  right: -60px; top: -70px;
  background: radial-gradient(circle, rgba(255,255,255,0.35), transparent 70%);
  border-radius: 50%;
  animation: ai-glow 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ai-glow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.15); }
}

.ai-card-icon {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
}
.ai-card-icon .ico { width: 24px; height: 24px; }

.ai-card-body { flex: 1; min-width: 0; }
.ai-card-title { display: block; font-size: 15.5px; font-weight: 800; color: #fff; margin-bottom: 3px; }
.ai-card-desc { display: block; font-size: 12.5px; color: rgba(255,255,255,0.85); line-height: 1.4; }

.ai-card-arrow {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.16);
  color: #fff;
}
.ai-card-arrow .ico { width: 16px; height: 16px; }

/* -------------------------------- sections -------------------------------- */

.section-label {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-3);
  margin: 0 2px 10px;
}
.section-label-top { margin-top: 22px; }

/* ------------------------------- quick actions ------------------------------- */

.quick-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  margin-bottom: 4px;
  scrollbar-width: none;
}
.quick-row::-webkit-scrollbar { display: none; }

.quick-pill {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--text-1);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.quick-pill:active { transform: scale(0.95); background: var(--glass-strong); }

.quick-pill-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.quick-pill-icon .ico { width: 15px; height: 15px; }

/* ---------------------------------- grid ---------------------------------- */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.card {
  position: relative;
  padding: 18px 14px;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:active {
  transform: scale(0.96);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120px 80px at 20% 0%, var(--card-glow, rgba(59,130,246,0.18)), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.card:active::after { opacity: 1; }

.card-icon {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  background: var(--card-bg, rgba(59,130,246,0.16));
  color: var(--card-color, var(--blue));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.card-icon .ico { width: 22px; height: 22px; }

.card-title { font-size: 14.5px; font-weight: 700; color: var(--text-1); margin-bottom: 3px; line-height: 1.3; }
.card-blurb { font-size: 11.5px; color: var(--text-3); line-height: 1.35; }

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-3);
}
.empty-state .ico-lg { margin: 0 auto 12px; color: var(--text-3); }
.empty-state p { margin: 0; font-size: 14px; }

/* ------------------------------- page header ------------------------------- */

.page-header { margin-bottom: 18px; }
.page-header-title { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.page-header-sub { font-size: 13.5px; color: var(--text-2); }

/* -------------------------------- feature card -------------------------------- */

.feature-card {
  padding: 28px 22px;
  border-radius: var(--radius-lg);
  text-align: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight);
}

.feature-icon {
  width: 76px; height: 76px;
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}
.feature-icon-ai {
  background: linear-gradient(135deg, rgba(59,130,246,0.35), rgba(124,107,245,0.3));
  color: #a9c3ff;
}
.feature-icon-requests {
  background: linear-gradient(135deg, rgba(34,211,238,0.3), rgba(59,130,246,0.28));
  color: #8fe3f3;
}

.feature-title { font-size: 18.5px; font-weight: 800; margin: 0 0 10px; }
.feature-text { font-size: 14px; color: var(--text-2); line-height: 1.6; margin: 0 0 18px; }
.feature-text b { color: var(--text-1); }

.chip-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
}

/* ----------------------------------- buttons ----------------------------------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 16px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-block { width: 100%; }

.btn-primary {
  color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 10px 26px rgba(59, 130, 246, 0.38), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-primary:active { filter: brightness(1.08); }

.btn-secondary {
  color: var(--text-1);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* -------------------------------- detail header -------------------------------- */

.detail-header {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin: 0 -18px 14px;
  padding-left: 18px;
  padding-right: 18px;
  background: linear-gradient(var(--bg-1) 60%, transparent);
}

.icon-btn {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--text-1);
  cursor: pointer;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn-spacer { width: 44px; flex-shrink: 0; }

.detail-header-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-header-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-bg, rgba(59,130,246,0.16));
  color: var(--card-color, var(--blue));
}
.detail-header-icon .ico { width: 20px; height: 20px; }
.detail-header-text { min-width: 0; }
.detail-header-title {
  font-size: 16.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-header-sub { font-size: 11.5px; color: var(--text-3); }

.detail-scroll { padding-top: 2px; }

/* ---------------------------------- video ---------------------------------- */

.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 22px;
  background: linear-gradient(145deg, rgba(59,130,246,0.14), rgba(124,107,245,0.1));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 0 20px;
}
.video-placeholder-icon {
  width: 58px; height: 58px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--glass-border);
  color: var(--text-1);
  backdrop-filter: blur(10px);
}
.video-placeholder-icon .ico { width: 28px; height: 28px; }
.video-placeholder span { font-size: 13.5px; font-weight: 600; color: var(--text-2); }

/* ---------------------------------- steps ---------------------------------- */

.steps-title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-3);
  margin: 0 2px 10px;
}

.steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.step-num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px;
  font-weight: 800;
  color: #fff;
  background: var(--accent-grad);
  margin-top: 1px;
}

.step-text {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-1);
  padding-top: 2px;
}

/* ---------------------------------- alerts ---------------------------------- */

.alert-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.alert-card .ico { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.alert-title { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.alert-text { font-size: 12.5px; line-height: 1.5; }

.alert-warning {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--amber);
}
.alert-warning .alert-text { color: var(--text-2); }

.alert-success {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green);
  animation: alert-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.alert-success .alert-text { color: var(--text-2); }

@keyframes alert-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.detail-spacer { height: 4px; }

/* --------------------------------- action bar --------------------------------- */

.action-bar {
  position: sticky;
  bottom: calc(var(--safe-b) + 14px);
  z-index: 5;
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--shadow-lift);
}
.action-bar .btn { flex: 1; min-width: 0; font-size: 13.5px; padding: 0 10px; }
.action-bar .btn .ico { width: 17px; height: 17px; flex-shrink: 0; }

/* ---------------------------------- tab bar ---------------------------------- */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  padding: 10px 10px calc(10px + var(--safe-b));
  gap: 4px;
}

.tabbar::before {
  content: "";
  position: absolute;
  inset: 8px 12px calc(var(--safe-b) + 8px);
  border-radius: 24px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  box-shadow: var(--shadow-lift);
  z-index: -1;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: var(--text-3);
  border-radius: 18px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.15s ease;
}
.tab-btn:active { transform: scale(0.93); }

.tab-icon { width: 22px; height: 22px; }
.tab-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1px; }

.tab-btn.is-active {
  color: var(--accent);
}
.tab-btn.is-active .tab-icon svg {
  filter: drop-shadow(0 0 8px rgba(79, 140, 255, 0.55));
}

/* ------------------------------ scroll & misc ------------------------------ */

html, body, #app { overflow-x: hidden; }

::selection { background: rgba(79, 140, 255, 0.35); }

button:focus-visible,
input:focus-visible,
.card:focus-visible,
.quick-pill:focus-visible,
.tab-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 431px) {
  .card-blurb { font-size: 12px; }
}

/* ==========================================================================
   AI chat composer
   ========================================================================== */

.chat-scroll {
  min-height: 40vh;
  padding-bottom: 4px;
}

.chat-empty {
  text-align: center;
  padding: 18px 8px 10px;
}
.chat-empty .feature-icon { margin-bottom: 16px; }
.chat-empty .feature-title { font-size: 17px; }
.chat-empty .feature-text { font-size: 13.5px; margin-bottom: 0; }

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-msg { display: flex; flex-direction: column; }
.chat-msg-user { align-items: flex-end; }
.chat-msg-ai { align-items: stretch; }

.chat-bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble-user {
  align-self: flex-end;
  background: var(--accent-grad);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.chat-bubble-ai {
  align-self: stretch;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  color: var(--text-1);
  border-bottom-left-radius: 6px;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.chat-msg-photo {
  margin-top: 8px;
  max-width: 60%;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  align-self: flex-end;
}

.chat-sources { margin-top: 10px; }

.chat-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.btn-sm { min-height: 42px; font-size: 13px; padding: 0 14px; flex: 1; }

.chat-status-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 13px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 600;
}
.chat-status-note.is-success { background: var(--green-bg); border: 1px solid var(--green-border); color: var(--green); }
.chat-status-note.is-pending { background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-2); }
.chat-status-note .ico { flex-shrink: 0; width: 17px; height: 17px; }

.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.typing-bubble .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.typing-bubble .dot:nth-child(2) { animation-delay: 0.15s; }
.typing-bubble .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-spacer { height: 8px; }

.alert-error {
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: #f87171;
}
.alert-error .alert-text { color: var(--text-2); }

.composer-photo-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}
.composer-photo-preview img {
  width: 38px; height: 38px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}
.composer-photo-name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.composer-photo-remove {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--glass-strong);
  color: var(--text-1);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

.composer {
  position: sticky;
  bottom: calc(var(--tabbar-h) + 14px);
  z-index: 5;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--shadow-lift);
}

.composer-btn {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 14px;
  border: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass);
  color: var(--text-1);
  cursor: pointer;
}
.composer-btn:active { transform: scale(0.92); }
.composer-btn-send {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}
.composer-btn-send:disabled { opacity: 0.5; }

.composer-input {
  flex: 1;
  min-width: 0;
  max-height: 120px;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: var(--text-1);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.4;
  resize: none;
  outline: none;
}
.composer-input::placeholder { color: var(--text-3); }
.composer-input:focus { border-color: var(--glass-border-strong); }

/* ==========================================================================
   Requests — skeleton / empty / list / status badges
   ========================================================================== */

.skeleton-list { display: flex; flex-direction: column; gap: 10px; }
.skeleton-row {
  height: 78px;
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, var(--glass) 30%, var(--glass-strong) 50%, var(--glass) 70%);
  background-size: 200% 100%;
  border: 1px solid var(--glass-border);
  animation: skeleton-shine 1.6s ease-in-out infinite;
}
@keyframes skeleton-shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-row { animation: none; }
}

.empty-state .btn { margin-top: 16px; }

.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ticket-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  cursor: pointer;
  text-align: left;
}
.ticket-row:active { transform: scale(0.98); }

.ticket-row-icon {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(79, 140, 255, 0.16);
  color: var(--accent);
}
.ticket-row-icon .ico { width: 21px; height: 21px; }

.ticket-row-body { flex: 1; min-width: 0; }
.ticket-row-title {
  display: block;
  font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.ticket-row-sub {
  display: block;
  font-size: 12px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ticket-row-chevron { flex-shrink: 0; color: var(--text-3); width: 18px; height: 18px; }

.status-badge {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.status-open { background: rgba(245, 165, 36, 0.16); color: var(--amber); }
.status-progress { background: rgba(79, 140, 255, 0.16); color: var(--accent); }
.status-solved { background: var(--green-bg); color: var(--green); }
.status-unknown { background: var(--glass-strong); color: var(--text-2); }

.status-badge-lg {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ==========================================================================
   Ticket detail
   ========================================================================== */

.info-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-1);
}
.info-row .ico { color: var(--text-3); flex-shrink: 0; }

.description-card {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 16px;
}

.ticket-photo-wrap { margin-bottom: 16px; }
.ticket-photo-frame {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  min-height: 120px;
  max-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ticket-photo { width: 100%; max-height: 55vh; display: block; object-fit: contain; }
