/* =========================================================================
   Shared stylesheet for the interlinked external web app pages.
   Change --brand to re-skin for a different app.
   ========================================================================= */
:root {
  --brand: #0e7a5f;
  --brand-dark: #0a5f4a;
  --brand-soft: #e8f6f1;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f7f9;
  --ok: #16a34a;
  --warn: #b45309;
  --err: #dc2626;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
img { display: block; }

.topbar { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; position: sticky; top: 0; z-index: 30; box-shadow: 0 1px 8px rgba(0,0,0,.18); }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 13px 18px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.18rem; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 1.15rem; }
.brand small { display: block; font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; opacity: .85; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav a { padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: .9rem; display: flex; align-items: center; gap: 6px; }
.nav a:hover { background: rgba(255,255,255,.16); }
.nav .cart-link { display: none; }
.badge { background: #fff; color: var(--brand); font-weight: 900; font-size: .72rem; border-radius: 99px; min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 5px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 22px 18px 90px; }
h1 { font-size: 1.7rem; margin: .2rem 0 .3rem; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
.sub { color: var(--muted); font-size: .95rem; margin: 0 0 18px; }
.hidden { display: none !important; }

.banner { border: 1px solid var(--line); border-radius: 14px; padding: 11px 15px; font-weight: 700; font-size: .92rem; margin-bottom: 16px; }
.banner.warn { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.banner.ok { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.banner.err { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

#toast { position: fixed; top: 66px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(94vw, 460px); }
#toast .t { border-radius: 12px; padding: 11px 14px; font-weight: 700; font-size: .92rem; color: #fff; box-shadow: 0 8px 20px -8px rgba(0,0,0,.4); }
#toast .t.ok { background: var(--ok); }
#toast .t.err { background: var(--err); }
#toast .t.info { background: #334155; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 14px; font-size: .82rem; font-weight: 700; cursor: pointer; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(0,0,0,.25); }
.thumb { height: 150px; background: #eef1f4 no-repeat center/cover; position: relative; }
.thumb .cat { position: absolute; top: 10px; left: 10px; background: rgba(17,24,39,.72); color: #fff; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 3px 9px; border-radius: 99px; }
.thumb .stock { position: absolute; bottom: 10px; right: 10px; font-size: .7rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; }
.stock.in { background: #dcfce7; color: #166534; }
.stock.out { background: #fee2e2; color: #991b1b; }
.card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { margin: 0; font-size: 1rem; }
.desc { color: var(--muted); font-size: .84rem; margin: 0; line-height: 1.4; flex: 1; }
.price { font-weight: 900; font-size: 1.08rem; color: var(--brand); }
.addrow { display: flex; gap: 8px; align-items: center; }
.qty { width: 64px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 10px; font-weight: 700; text-align: center; }
input[type=text], input[type=tel], select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: .95rem; font-family: inherit; background: #fff; }
label { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; color: #374151; display: block; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.req { color: var(--err); }

.btn { border: 0; cursor: pointer; font-weight: 800; border-radius: 11px; padding: 9px 14px; font-size: .9rem; font-family: inherit; }
.btn:hover { filter: brightness(.97); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn.block { width: 100%; display: block; text-align: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.payment-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .payment-cards { grid-template-columns: 1fr; } }
.pay-card { border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; background: #fff; display: block; }
.pay-card input { margin-right: 8px; }
.pay-card.sel { border-color: var(--brand); background: var(--brand-soft); }
.pay-card .p-title { font-weight: 800; font-size: .95rem; }
.pay-card .p-sub { color: var(--muted); font-size: .78rem; margin-top: 2px; }

.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.table th, .table td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); font-size: .92rem; }
.table th { background: #fafafa; font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: #374151; }
.table tr:last-child td { border-bottom: 0; }
.totals { margin-top: 14px; display: grid; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.totals .row { display: flex; justify-content: space-between; font-size: .95rem; }
.totals .grand { font-size: 1.15rem; font-weight: 900; border-top: 1px dashed var(--line); padding-top: 10px; color: var(--brand); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.cols { display: grid; grid-template-columns: 1fr 340px; gap: 22px; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 3rem; }

.float-checkout { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: none; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; font-weight: 900; font-size: .95rem;
  padding: 13px 18px; border-radius: 99px; box-shadow: 0 12px 26px -10px rgba(10,95,74,.7); cursor: pointer; }
.float-checkout .f-count { background: #fff; color: var(--brand); border-radius: 99px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 6px; font-size: .78rem; }
.float-checkout .f-total { font-weight: 800; font-size: .8rem; opacity: .95; }

.loading { text-align: center; padding: 40px 10px; color: var(--muted); }
.spinner { display: inline-block; width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.footer { color: var(--muted); font-size: .78rem; text-align: center; padding: 20px 0; }
.error-box { background:#fef2f2;border:1px solid #fecaca;color:#991b1b;border-radius:14px;padding:18px;margin:10px 0 }
.error-box code{background:#fff;padding:2px 6px;border-radius:6px}

/* ---------------------------------------------------------------------------
   Tables that scroll on small screens
   ------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap .table { min-width: 660px; }

/* ---------------------------------------------------------------------------
   Order status badges (tracking page)
   ------------------------------------------------------------------------- */
.st-badge { border-radius: 99px; padding: 3px 10px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.st-ok   { background: #dcfce7; color: #166534; }
.st-warn { background: #fef3c7; color: #92400e; }
.st-err  { background: #fee2e2; color: #991b1b; }

/* ---------------------------------------------------------------------------
   Large screens — a little more breathing room
   ------------------------------------------------------------------------- */
@media (min-width: 1500px) {
  .wrap { max-width: 1280px; }
  h1 { font-size: 2rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 22px; }
  .thumb { height: 180px; }
  .sub { font-size: 1rem; }
}

/* ---------------------------------------------------------------------------
   Phones / small devices — larger targets, stacked layouts
   ------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .wrap { padding: 16px 12px 110px; }
  h1 { font-size: 1.3rem; }
  .topbar-inner { padding: 11px 12px; gap: 8px; }
  .brand { font-size: 1rem; }
  .brand small { display: none; }
  .nav { gap: 2px; }
  .nav a { padding: 8px 9px; font-size: .8rem; border-radius: 8px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 12px; }
  .thumb { height: 118px; }
  .card-body { padding: 10px 11px 12px; gap: 7px; }
  .card-body h3 { font-size: .92rem; }
  .desc { font-size: .78rem; }
  .price { font-size: 1rem; }
  .addrow { flex-wrap: wrap; }
  .addrow .qty { flex: 1 1 70px; }
  .addrow .btn { flex: 1 1 100%; }
  .btn { padding: 11px 12px; }
  .payment-cards { grid-template-columns: 1fr; }
  .cols { gap: 14px; }
  .panel { padding: 15px; }
  .float-checkout { right: 12px; bottom: 12px; padding: 12px 16px; font-size: .86rem; }
  .float-checkout .f-total { display: none; }
  input[type=text], input[type=tel], select, textarea { padding: 12px 12px; }
  .qty { padding: 10px 6px; }
}
@media (max-width: 720px) {
  /* On small screens the bottom nav already has Menu & Orders, so hide the
     duplicate top-bar Menu / My Orders links (keep the Cart link). */
  .topbar .nav a[href="index.html"],
  .topbar .nav a[href="orders.html"] { display: none; }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .thumb { height: 100px; }
}

/* ---------------------------------------------------------------------------
   Inline SVG icons (stroke = currentColor)
   ------------------------------------------------------------------------- */
i.i { display: inline-block; font-style: normal; line-height: 0; }
.ico {
  width: 1em; height: 1em; display: inline-block;
  vertical-align: -0.125em; flex: none; line-height: 0;
}
.ico.xi { width: .9em; height: .9em; }
h1 .ico { margin-right: 8px; vertical-align: middle; }
h2 .ico { margin-right: 6px; vertical-align: middle; }
.btn .ico { margin-right: 6px; vertical-align: -0.15em; }
.banner .ico { margin-right: 6px; vertical-align: -0.15em; }
.totals .row .ico { margin-right: 6px; vertical-align: -0.18em; opacity: .75; color: var(--brand); }
.p-title .ico { margin-right: 6px; vertical-align: -0.15em; color: var(--brand); }
.ci-note .ico { margin-right: 4px; vertical-align: -0.12em; opacity: .7; }
.ci-thumb-none .ico { width: 2rem; height: 2rem; color: var(--brand); }
.empty .big .ico { width: 3rem; height: 3rem; opacity: .55; }
.error-box h2 .ico { margin-right: 8px; vertical-align: middle; color: var(--err); }
.topbar .ico, .topbar i.i { color: inherit; }
.brand .logo .ico { width: 1.1rem; height: 1.1rem; }
.nav .ico { margin-right: 4px; vertical-align: -0.18em; }
.float-checkout .ico { margin-right: 6px; }

/* ---------------------------------------------------------------------------
   Bottom navigation
   ------------------------------------------------------------------------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: flex; background: rgba(255,255,255,.95); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -10px 26px -20px rgba(0,0,0,.45);
}
.bn-item {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 9px 2px 8px;
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font-family: inherit; font-size: .62rem; font-weight: 800; text-decoration: none;
}
.bn-item .ico { width: 1.25rem; height: 1.25rem; }
.bn-item.active, .bn-item:hover { color: var(--brand); }
.bn-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 8px; }
/* Clear the fixed bottom nav + floating checkout button */
.wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.float-checkout { bottom: calc(72px + env(safe-area-inset-bottom)); }
@media (max-width: 720px) { .bn-item { padding-top: 8px; } }

/* ---------------------------------------------------------------------------
   Modals (Share / Contact / Install)
   ------------------------------------------------------------------------- */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(15,23,42,.55); padding: 20px; animation: mfade .16s ease;
}
@keyframes mfade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(92vw, 460px); max-height: 84vh; overflow: auto;
  background: #fff; border-radius: 20px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.5);
  animation: mup .18s ease;
}
@keyframes mup { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 900; font-size: 1.02rem; }
.modal-head .ico { color: var(--brand); }
.modal-close { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 8px; }
.modal-close:hover { color: var(--err); background: var(--line); }
.modal-body { padding: 18px; }
.modal-text { margin: 0 0 12px; color: #374151; line-height: 1.55; font-size: .95rem; }
.qr-box { display: flex; justify-content: center; margin: 6px 0 16px; }
.qr-box img { border-radius: 14px; border: 1px solid var(--line); width: 240px; height: 240px; max-width: 100%; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; min-width: 0; font-size: .8rem; }
.contact-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; background: #fff; }
.contact-row:hover { border-color: var(--brand); }
.contact-row .ico { color: var(--brand); width: 1.35rem; height: 1.35rem; }
.contact-row span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.contact-row strong { font-size: .95rem; }
.contact-row em { font-style: normal; color: var(--muted); font-size: .8rem; }

/* ---------------------------------------------------------------------------
   Tickets
   ------------------------------------------------------------------------- */
.ticket-list { margin-top: 18px; display: grid; gap: 12px; max-width: 620px; }
.ticket-row {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; box-shadow: 0 8px 20px -22px rgba(0,0,0,.5);
}
.ticket-row .tr-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ticket-row .tr-subject { font-weight: 800; margin-top: 6px; font-size: .98rem; }
.ticket-row .tr-meta { font-size: .78rem; margin-top: 3px; }
.ticket-row .tr-msg { color: #374151; font-size: .88rem; margin: 8px 0 10px; line-height: 1.45; }
.ticket-detail .td-subject { font-weight: 800; font-size: 1.1rem; margin-top: 10px; }
.ticket-detail .td-meta { font-size: .8rem; margin: 4px 0 10px; }
.ticket-detail .td-msg {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; font-size: .95rem; line-height: 1.5; margin-bottom: 8px;
}
.ticket-detail .td-note {
  border-left: 3px solid var(--brand); background: var(--brand-soft);
  border-radius: 8px; padding: 8px 12px; margin: 8px 0; font-size: .88rem;
}
.ticket-detail textarea { margin-top: 4px; }
.empty .big .ico { color: var(--brand); }

/* ---------------------------------------------------------------------------
   Short "Add" label on small screens (menu buttons)
   ------------------------------------------------------------------------- */
.lbl-short { display: none; }
.lbl-full { display: inline; }

/* ---------------------------------------------------------------------------
   Overflow safety: never let columns push past the viewport
   ------------------------------------------------------------------------- */
.cols > *, .cart-layout > * { min-width: 0; }
.table-wrap, .gateway-frame, iframe { max-width: 100%; }

/* ---------------------------------------------------------------------------
   Modern totals card (cart + checkout summary)
   ------------------------------------------------------------------------- */
.totals {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 14px 30px -22px rgba(0, 0, 0, .35);
}
.totals .tc-title {
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); margin-bottom: 10px;
}
.totals .row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; font-size: .92rem; color: #374151;
  border-bottom: 1px dashed var(--line);
}
.totals .row .plus { color: var(--warn); font-weight: 700; }
.totals .grand {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-soft), #ffffff);
  border: 1px solid rgba(14,122,95,.15);
}
.totals .grand span { font-size: .95rem; font-weight: 800; color: var(--ink); }
.totals .grand strong { font-size: 1.25rem; color: var(--brand); }

/* ---------------------------------------------------------------------------
   Cart page — layered item cards (no wide table / no overflow)
   ------------------------------------------------------------------------- */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}
.cart-list { display: grid; gap: 14px; min-width: 0; }
.cart-item {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  overflow: hidden;
  box-shadow: 0 8px 20px -20px rgba(0,0,0,.4);
}
.ci-thumb { min-height: 100%; height: 100%; background: #eef1f4 no-repeat center/cover; }
.ci-thumb-none { display: grid; place-items: center; font-size: 2rem; color: var(--muted); background: var(--brand-soft); }
.ci-body { padding: 14px 16px; min-width: 0; }
.ci-top { display: flex; justify-content: space-between; gap: 10px; }
.ci-name h3 { margin: 0; font-size: 1.02rem; }
.ci-actions { display: flex; align-items: flex-start; gap: 10px; }
.ci-line { font-size: 1.05rem; white-space: nowrap; }
.ci-remove { padding: 6px 10px; border-radius: 10px; line-height: 1; }
.ci-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
  margin-top: 12px;
}
.ci-controls label { margin-bottom: 5px; }
.ci-controls .qty { width: 100%; }
.ci-note { margin-top: 8px; font-size: .78rem; color: var(--muted); }
.cart-summary { position: sticky; top: 76px; min-width: 0; }

/* Payment gateway shown in an iframe */
.gateway-frame { margin-top: 12px; }
.gateway-frame iframe {
  width: 100%; height: 640px; border: 1px solid var(--line);
  border-radius: 14px; background: #fff;
}

@media (min-width: 1500px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr) 400px; }
}

@media (max-width: 900px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr); }
  .cart-summary { position: static; }
}

@media (max-width: 720px) {
  .lbl-full { display: none; }
  .lbl-short { display: inline; }
  .cart-item { grid-template-columns: 64px minmax(0, 1fr); }
  .ci-thumb { min-height: 78px; }
  .ci-body { padding: 12px 12px; }
  .ci-controls { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .gateway-frame iframe { height: 480px; }
}

@media (max-width: 380px) {
  .cart-item { grid-template-columns: 1fr; }
  .ci-thumb { display: none; }
}

/* ===========================================================================
   Loading animations
   ---------------------------------------------------------------------------
   .loading.brand  -> branded loader inside a content area (endpoint fetch)
   .page-loading   -> full-screen overlay while a page fetches its content
   =========================================================================== */
.loading.brand {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 56px 16px;
}
.loader-stack { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.loader-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--brand-soft); border-top-color: var(--brand);
  animation: spin .9s linear infinite;
}
.loader-pulse {
  position: relative; width: 50px; height: 50px; border-radius: 15px; color: #fff;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 12px 26px -12px rgba(10,95,74,.65);
}
.loader-pulse .ico { width: 24px; height: 24px; }
.loader-pulse::after {
  content: ''; position: absolute; inset: -4px; border-radius: 19px;
  border: 2px solid var(--brand); opacity: 0; animation: pr 1.6s ease-out infinite;
}
@keyframes pr {
  0%   { transform: scale(.92); opacity: .8; }
  100% { transform: scale(1.45); opacity: 0; }
}
.loader-msg { font-size: .95rem; font-weight: 800; color: var(--ink); margin: 0; }

/* Full-page loader */
.page-loading {
  position: fixed; inset: 0; z-index: 95; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .34s ease; opacity: 1;
}
.page-loading.gone { opacity: 0; pointer-events: none; }
.page-loading .inner { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 22px; text-align: center; }
.page-loading .logo-mark {
  width: 68px; height: 68px; border-radius: 20px; color: #fff;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 18px 40px -16px rgba(10,95,74,.6);
  animation: bounce 1.4s ease-in-out infinite;
}
.page-loading .logo-mark .ico { width: 32px; height: 32px; }
@keyframes bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-6px) scale(1.04); }
}
.page-loading .label { font-weight: 800; color: var(--ink); font-size: 1rem; }
.page-loading .bar {
  width: min(220px, 68vw); height: 8px; border-radius: 99px;
  background: #e7ecef; overflow: hidden;
}
.page-loading .bar i {
  display: block; height: 100%; width: 38%; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(380%); }
}
/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  .loader-ring, .loader-pulse::after, .page-loading .logo-mark,
  .page-loading .bar i, .spinner { animation-duration: 2.4s; }
}

/* ===========================================================================
   Content entrance — gently fade content in once a page has rendered
   =========================================================================== */
#content { animation: contentin .3s ease both; }
@keyframes contentin {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ===========================================================================
   Connection / offline banner + error actions
   =========================================================================== */
.conn-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 85;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: linear-gradient(135deg, #b91c1c, #dc2626); color: #fff;
  font-weight: 800; font-size: .84rem; text-align: center;
  padding: 9px 14px;
  box-shadow: 0 6px 18px -8px rgba(0,0,0,.45);
  transform: translateY(-110%); transition: transform .28s ease;
}
.conn-banner.show { transform: none; }
.conn-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #fff;
  flex: none; animation: connblink 1.1s ease-in-out infinite;
}
@keyframes connblink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.error-box h2 { display: flex; align-items: center; gap: 8px; }
.error-box h2 .ico { color: var(--err); }
.error-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.error-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.retry-mini { padding: 6px 12px; font-size: .8rem; margin-left: 8px; }
.banner.err .retry-mini { border-color: #fecaca; background: #fff; }


