/* KVZ brand: topbar (shield + banner text) on all pages + status card */

:root {
  --kvz-bg: #020b18;
  --kvz-cyan: #35d7ff;
  --kvz-green: #2bdd9b;
  --kvz-line: rgba(92, 211, 255, 0.18);
  --kvz-muted: #8da8c4;
  --bg: #020b18;
  --accent: #35d7ff;
  --success: #2bdd9b;
  --border: rgba(92, 211, 255, 0.18);
}

body {
  background:
    radial-gradient(circle at 15% 0%, rgba(35, 150, 255, 0.14), transparent 34%),
    radial-gradient(circle at 90% 18%, rgba(30, 221, 201, 0.08), transparent 30%),
    linear-gradient(180deg, #061426 0%, #020b18 54%, #010713 100%);
}

.app {
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(49, 140, 255, 0.12), transparent 58%),
    linear-gradient(180deg, #061426 0%, #04101f 45%, #020b18 100%);
}

.logo-shield { display: none !important; }

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(108, 222, 255, 0.28),
    0 10px 28px rgba(0, 178, 255, 0.28);
}

.logo {
  gap: 10px;
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
}

.logo-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

/* Banner-style title next to shield */
.logo-text {
  font-size: clamp(18px, 4.2vw, 26px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  color: #f5f9ff;
  background: linear-gradient(180deg, #ffffff 10%, #d9e9ff 52%, #9ec0e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(80, 180, 255, 0.25));
}

.logo-tag {
  display: block !important;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #5ed6ff !important;
  text-shadow: 0 0 14px rgba(70, 200, 255, 0.28);
  white-space: nowrap;
  line-height: 1.2;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border-bottom: 1px solid rgba(70, 160, 220, 0.22);
  padding-top: 4px;
  padding-bottom: 6px;
  min-height: 52px;
  background:
    linear-gradient(180deg, rgba(8, 28, 52, 0.55), rgba(4, 14, 28, 0.15));
}

.topbar-actions {
  flex: 0 0 auto;
  margin-left: 0;
}

/* Features live IN the topbar gap (between slogan and TG button) */
.top-features {
  list-style: none;
  margin: 0;
  padding: 0 4px;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  z-index: 1;
  background: none;
  border: 0;
}

.top-features::before { display: none; }

.top-features li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  flex: 1 1 0;
  max-width: 92px;
  padding: 2px 6px;
  text-align: center;
}

.top-features li + li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12%;
  bottom: 12%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(120, 200, 255, 0.35), transparent);
}

.top-features .feat-ico {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: #6edfff;
  filter: drop-shadow(0 0 8px rgba(80, 210, 255, 0.35));
}

.top-features .feat-ico svg {
  width: 16px;
  height: 16px;
  display: block;
}

.top-features .feat-label {
  font-size: 8px;
  font-weight: 700;
  line-height: 1.12;
  color: #eaf6ff;
  letter-spacing: 0.01em;
}

/* Status card */
.status-card.sub-card {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
  padding: 14px 14px 13px;
  text-align: left !important;
  border-radius: 22px;
  border: 1px solid rgba(92, 211, 255, 0.22);
  background:
    linear-gradient(160deg, rgba(10, 36, 64, 0.94), rgba(4, 16, 34, 0.96)) !important;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 40px rgba(43, 221, 155, 0.05);
  overflow: visible;
}

.status-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 2px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2bdd9b;
  box-shadow: 0 0 0 3px rgba(43, 221, 155, 0.18), 0 0 12px rgba(43, 221, 155, 0.55);
}

.status-card.expired .status-dot {
  background: #ff7b8d;
  box-shadow: 0 0 0 3px rgba(255, 123, 141, 0.16), 0 0 12px rgba(255, 123, 141, 0.4);
}

.status-card .sub-label {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.92;
  color: #d7e8f8;
}

.status-card .sub-days {
  margin: 0;
  font-size: clamp(28px, 7.5vw, 36px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: #fff;
  min-width: 0;
}

.status-days-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 0;
  min-width: 0;
}

.status-days-row .btn-tg-cabinet {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  color: #00121d;
  background: linear-gradient(100deg, #2bdd9b, #35d7ff);
  box-shadow: 0 8px 22px rgba(48, 210, 214, 0.22);
}

.status-days-row .btn-tg-cabinet[hidden] {
  display: none !important;
}

.status-card .sub-meta {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.status-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(160, 210, 240, 0.28);
  background: rgba(6, 20, 40, 0.72);
  color: #eef6ff;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.btn-sub-extend {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  color: #041018;
  background: linear-gradient(100deg, #2bdd9b 0%, #35d7ff 100%);
  box-shadow: 0 10px 28px rgba(48, 210, 214, 0.28);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.btn-sub-extend:hover { filter: brightness(1.05); }
.btn-sub-extend:active { transform: scale(0.98); }

.share-card {
  display: flex;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.share-card-copy { display: none; }

.btn-share-sub {
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(125, 220, 255, 0.28);
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: #cfefff;
  background: rgba(12, 42, 72, 0.72);
}
.btn-share-sub:hover { filter: brightness(1.08); }
.flow-banner .btn-share-sub { width: 100%; }

.status-card.expired {
  background: linear-gradient(145deg, rgba(90, 32, 48, 0.92), rgba(40, 14, 24, 0.96)) !important;
}

.status-card.loading .sub-days,
.status-card.loading .status-pill {
  color: transparent !important;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.home-tile {
  border-color: rgba(92, 211, 255, 0.16);
  background:
    linear-gradient(165deg, rgba(12, 40, 72, 0.92), rgba(4, 18, 36, 0.96)) !important;
  border-radius: 22px;
}

.tile-ico {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(53, 215, 255, 0.1);
  border: 1px solid rgba(92, 211, 255, 0.22);
  color: #35d7ff;
  overflow: visible;
  flex: 0 0 auto;
}

.tile-ico svg { width: 22px; height: 22px; overflow: visible; }

/* Apple glyph: keep leaf inside the circle */
.tile-ios .tile-ico svg,
.home-tile[aria-label="macOS"] .tile-ico svg {
  width: 20px;
  height: 20px;
  transform: translateY(1px);
}

.tabbar {
  border-color: rgba(92, 211, 255, 0.16);
  background: rgba(4, 18, 36, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.tab.active {
  color: #35d7ff;
  background: rgba(53, 215, 255, 0.12);
}

.btn-tg-desktop {
  border-color: rgba(118, 205, 255, 0.34);
  background: rgba(5, 24, 47, 0.78);
  color: #e8f5ff;
  border-radius: 14px;
}

.btn-tg-login {
  background: linear-gradient(100deg, #2bdd9b, #35d7ff);
  color: #00121d;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(48, 210, 214, 0.22);
}

/* Cabinet TG lives in the status card now — keep topbar clean for feature icons */
.topbar .btn-tg-login { display: none !important; }

@media (hover: hover) and (pointer: fine) {
  .home-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(92, 211, 255, 0.34);
  }
  .tile-split:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .home-tile:hover { transform: none; }
  .btn-sub-extend:active { transform: none; }
}

@media (max-width: 899px) {
  html, body {
    height: 100%;
    max-height: none;
  }

  .btn-tg-desktop,
  .btn-tg-login {
    min-height: 30px;
    padding: 0 8px;
    font-size: 10px;
  }

  .status-days-row .btn-tg-cabinet {
    min-height: 34px;
    padding: 0 10px;
    font-size: 11px;
    border-radius: 11px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .logo {
    gap: 6px;
    flex: 0 1 34%;
    max-width: 150px;
  }

  .logo-text { font-size: 15px; }

  .logo-tag {
    font-size: 8px;
    max-width: none;
    white-space: normal;
    line-height: 1.1;
  }

  .topbar {
    gap: 4px;
    padding-top: 2px;
    padding-bottom: 4px;
    min-height: 48px;
  }

  .topbar-actions {
    flex: 0 0 auto;
    gap: 4px;
  }

  .top-features {
    flex: 1 1 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
  }

  .top-features li {
    padding: 0 2px;
    max-width: none;
    gap: 1px;
  }

  .top-features .feat-ico {
    width: 16px;
    height: 16px;
  }

  .top-features .feat-ico svg {
    width: 13px;
    height: 13px;
  }

  .top-features .feat-label {
    font-size: 7px;
  }

  /* Real Mini App: more room — slightly larger feature captions */
  html.kvz-tg-auth .logo { max-width: 140px; flex-basis: 32%; }
  html.kvz-tg-auth .top-features .feat-label { font-size: 7.5px; }
  html.kvz-tg-auth .top-features .feat-ico {
    width: 18px;
    height: 18px;
  }
  html.kvz-tg-auth .top-features .feat-ico svg {
    width: 14px;
    height: 14px;
  }

  .app {
    height: 100%;
    min-height: 100%;
    min-height: 100dvh;
    max-height: none;
    overflow: hidden;
  }

  .content,
  .screen[data-screen="home"].active,
  .home-stage {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .home-stage {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    gap: 8px;
  }

  #home-tiles,
  .home-tiles,
  .home-all-tiles {
    display: grid !important;
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
    align-content: start;
  }

  .home-tile {
    min-height: 108px !important;
    height: auto !important;
    overflow: visible !important;
    justify-content: flex-start !important;
    padding-top: 12px !important;
  }

  .home-tile.tile-split {
    min-height: 148px !important;
  }

  .home-tile.tile-desk {
    display: none !important;
  }

  .tile-ico {
    overflow: visible;
  }
}

@media (max-width: 389px) {
  .logo-tag { font-size: 7.5px; }

  .top-features .feat-label { font-size: 6px; }

  .status-pill { font-size: 10px; padding: 4px 8px; }
}

@media (min-width: 900px) {
  .brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .logo-text { font-size: 20px; }
  .logo-tag { font-size: 12px; }

  .topbar {
    gap: 12px;
    padding-top: 4px;
    padding-bottom: 6px;
    min-height: 52px;
    align-items: center;
  }

  .top-features li {
    max-width: 110px;
    padding: 2px 8px;
    gap: 3px;
  }

  .top-features .feat-ico {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
  }

  .top-features .feat-ico svg {
    width: 18px;
    height: 18px;
  }

  .top-features .feat-label { font-size: 10px; }

  .status-card.sub-card {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: end;
    gap: 14px;
    padding: 12px 16px 11px;
    border-radius: 24px;
  }

  .status-card .sub-days { font-size: 32px; }
  .btn-sub-extend { min-height: 42px; font-size: 15px; }
  .status-days-row .btn-tg-cabinet,
  .status-card .btn-tg-cabinet {
    min-height: 42px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 14px;
  }

  .tile-ico {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    overflow: visible;
  }

  .tile-ico svg {
    width: 22px;
    height: 22px;
  }

  .home-tile {
    overflow: visible !important;
  }

  .home-tile.tile-split {
    justify-content: flex-start;
    padding-top: 14px;
    min-height: min-content;
  }

  .home-tile .tile-ico {
    margin-top: 2px;
    margin-bottom: 2px;
  }

  .tile-glow {
    top: 0;
    height: 40%;
  }
}
