:root {
  --header-height: 112px;
  --shell-width: 480px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overscroll-behavior: none;
  touch-action: pan-y;
}

body {
  background: #e9eaec;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
  touch-action: pan-y;
}

button,
a,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: var(--shell-width);
  min-height: 100svh;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--page-bg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.mobile-header {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 30;
  width: 100%;
  max-width: var(--shell-width);
  height: var(--header-height);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 74px 1fr 74px;
  align-items: center;
  padding: env(safe-area-inset-top) 18px 18px;
  background: var(--header-bg);
  color: var(--header-icon);
  border-bottom-right-radius: var(--header-radius);
  border-bottom-left-radius: var(--header-radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

.header-action {
  position: relative;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 16px;
  color: var(--header-icon);
  background: transparent;
  cursor: pointer;
}

.header-action:active {
  transform: scale(0.96);
}

.menu-art {
  position: relative;
  width: 48px;
  height: 42px;
  border-radius: 5px;
  background: #fff;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 7px 9px;
  color: var(--header-bg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.menu-art span {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.menu-art i {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 10px solid currentColor;
}

.bell-icon {
  width: 42px;
  height: 42px;
}

.notification-dot {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--notification);
  border: 2px solid var(--header-bg);
  box-shadow: 0 0 0 6px rgba(255, 230, 0, 0.12);
}

.is-hidden {
  display: none !important;
}

.brand-link {
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-image {
  max-width: 170px;
  max-height: 86px;
  object-fit: contain;
  display: block;
}

.brand-fallback {
  display: grid;
  justify-items: center;
  line-height: 0.82;
  color: #087bd8;
  text-transform: lowercase;
}

.brand-top {
  color: #ffe600;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -1px;
  text-transform: uppercase;
  border-bottom: 5px solid #00ad62;
  padding-bottom: 4px;
}

.brand-bottom {
  margin-top: 7px;
  font-size: 42px;
  font-weight: 500;
}

.main-content {
  padding: calc(var(--header-height) + 42px) 28px 40px;
}

.home-content {
  display: grid;
  gap: 26px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.home-card {
  min-width: 0;
  min-height: 146px;
  padding: 18px 16px 16px;
  border-radius: var(--card-radius);
  background: var(--card-bg);
  color: var(--local-card-text, var(--card-text));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.22), 0 12px 24px rgba(0, 0, 0, 0.08);
  transition: transform 180ms ease, filter 180ms ease;
}

.home-card:active {
  transform: translateY(2px) scale(0.985);
  filter: brightness(0.98);
}

.home-card strong {
  display: block;
  font-size: clamp(16px, var(--card-font-size), 48px);
  line-height: 0.98;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.card-icon {
  align-self: flex-end;
  width: 40px;
  height: 40px;
  opacity: 0.72;
}

.card-icon svg {
  width: 100%;
  height: 100%;
}

.more-button {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  color: var(--options-text);
  background: var(--options-bg);
  font-size: clamp(18px, var(--options-font-size), 52px);
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.more-button:active {
  transform: translateY(2px);
}

.banner-carousel {
  position: relative;
  min-height: 168px;
  border-radius: var(--banner-radius);
  overflow: hidden;
  background: #c9cacc;
}

.banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
}

.banner-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.banner-slide img,
.banner-slide a {
  display: block;
  width: 100%;
  height: 100%;
}

.banner-slide img {
  object-fit: cover;
}

.banner-placeholder {
  min-height: 168px;
  display: grid;
  place-items: center;
  color: #383437;
  font-size: clamp(28px, 8vw, 40px);
  line-height: 1.12;
  font-weight: 900;
  text-align: center;
}

.banner-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 7px;
  z-index: 2;
}

.banner-dots button {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.58);
}

.banner-dots button.is-active {
  width: 22px;
  background: #fff;
}

.drawer-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.drawer-backdrop.is-open,
.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.side-drawer,
.options-sheet,
.notification-panel {
  position: fixed;
  z-index: 50;
  width: 100%;
  max-width: var(--shell-width);
  left: 50%;
  color: var(--menu-text);
  background: var(--menu-bg);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  transition: transform 260ms ease;
}

.side-drawer {
  top: 0;
  bottom: 0;
  left: 0;
  width: min(86vw, 360px);
  transform: translateX(-110%);
  border-top-right-radius: 28px;
  border-bottom-right-radius: 28px;
  padding: 28px 18px;
}

.side-drawer.is-open {
  transform: translateX(0);
}

.drawer-grip,
.panel-handle {
  width: 58px;
  height: 5px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
}

.drawer-brand {
  display: grid;
  justify-content: center;
  margin: 8px 0 22px;
}

.drawer-brand .brand-image {
  max-width: 180px;
}

.drawer-nav,
.options-grid,
.notification-list {
  display: grid;
  gap: 12px;
}

.drawer-link,
.option-link,
.notification-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.03);
}

.drawer-link svg,
.option-link svg {
  width: 30px;
  height: 30px;
  color: var(--menu-accent);
}

.drawer-link span,
.option-link strong {
  font-size: 17px;
  font-weight: 800;
}

.options-sheet,
.notification-panel {
  bottom: 0;
  max-height: 76svh;
  overflow-y: auto;
  padding: 18px 22px calc(24px + env(safe-area-inset-bottom));
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  transform: translate(-50%, 110%);
}

.options-sheet.is-open,
.notification-panel.is-open {
  transform: translate(-50%, 0);
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-title-row h2 {
  margin: 0;
  font-size: 24px;
}

.panel-close {
  border: 0;
  color: var(--menu-accent);
  background: transparent;
  font-weight: 800;
}

.notification-item {
  width: 100%;
  grid-template-columns: 52px 1fr;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.notification-thumb {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  object-fit: cover;
  background: var(--menu-accent);
}

.notification-thumb.fallback {
  display: grid;
  place-items: center;
  color: #fff;
}

.notification-item strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.notification-item span {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(52, 48, 48, 0.7);
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.content-modal {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: 50%;
  width: min(calc(100% - 34px), 430px);
  max-height: 78svh;
  overflow-y: auto;
  transform: translate(-50%, -46%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  border-radius: 24px;
  background: #fff;
  color: #343030;
  box-shadow: var(--shadow);
  transition: opacity 220ms ease, transform 220ms ease;
}

.content-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modal-close {
  position: sticky;
  top: 12px;
  float: right;
  z-index: 1;
  width: 38px;
  height: 38px;
  margin: 12px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.modal-content {
  padding: 24px;
}

.modal-content img {
  width: 100%;
  max-height: 330px;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 18px;
}

.modal-content h2 {
  margin: 0 0 10px;
  font-size: 25px;
}

.modal-content p {
  margin: 0;
  color: rgba(52, 48, 48, 0.78);
  font-size: 16px;
  line-height: 1.55;
}

.modal-html {
  padding: 24px;
}

.page-loader {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  color: #fff;
  background: rgba(52, 48, 48, 0.84);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.page-loader.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.page-loader span {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 5px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--accent);
  animation: spin 850ms linear infinite;
}

.page-loader strong {
  font-size: 18px;
}

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

.content-article {
  min-height: calc(100svh - var(--header-height) - 46px);
}

.content-article h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 9vw, 42px);
  line-height: 1.02;
  font-weight: 900;
}

.article-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 22px;
  margin-bottom: 20px;
}

.rich-text,
.raw-html {
  font-size: 17px;
  line-height: 1.62;
}

.rich-text img,
.raw-html img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}

.rich-text a,
.raw-html a {
  color: var(--accent);
  font-weight: 800;
}

.iframe-wrap {
  height: 100svh;
  padding-top: var(--header-height);
  background: #fff;
}

.iframe-wrap iframe {
  display: block;
  width: 100%;
  height: calc(100svh - var(--header-height));
  border: 0;
  background: #fff;
}

.empty-state,
.muted {
  color: rgba(52, 48, 48, 0.62);
  font-size: 16px;
  line-height: 1.5;
}

@media (max-width: 360px) {
  :root {
    --header-height: 104px;
  }

  .mobile-header {
    grid-template-columns: 60px 1fr 60px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .header-action {
    width: 48px;
    height: 48px;
  }

  .menu-art {
    width: 40px;
    height: 36px;
    gap: 5px;
    padding: 7px;
  }

  .menu-art span {
    height: 5px;
  }

  .brand-top {
    font-size: 32px;
  }

  .brand-bottom {
    font-size: 34px;
  }

  .main-content {
    padding-left: 20px;
    padding-right: 20px;
  }

  .home-card {
    min-height: 128px;
    padding: 14px;
  }
}

@media (min-width: 720px) {
  .app-shell,
  .mobile-header,
  .options-sheet,
  .notification-panel {
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.16);
  }
}

@media (min-width: 481px) {
  .side-drawer {
    left: calc(50% - (var(--shell-width) / 2));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
