/* ==========================================================================
   3Pattii Store — mobile-first light app store theme.
   Change --theme-color to recolor the site's primary accent.
   ========================================================================== */

:root {
  --theme-color: #116c43;
  --bg: #f6f8f5;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f5f1;
  --surface-3: #e5eee7;
  --line: rgba(24, 58, 38, 0.12);
  --line-strong: rgba(24, 58, 38, 0.2);
  --text: #1b2d21;
  --text-2: #465e4e;
  --text-3: #617667;
  --accent: var(--theme-color);
  --accent-2: color-mix(in srgb, var(--theme-color) 82%, black);
  --accent-ink: #ffffff;
  --gold: #a8730b;
  --danger: #b8373c;
  --radius-s: 12px;
  --radius-m: 16px;
  --radius-l: 22px;
  --shadow: 0 10px 30px rgba(24, 58, 38, 0.1);
  --topbar-h: 60px;
  --tabbar-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--theme-color) 7%, transparent), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, color-mix(in srgb, var(--gold) 4%, transparent), transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

@media (min-width: 992px) {
  body { padding-bottom: 0; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

img { max-width: 100%; }
svg:not([fill]) { fill: currentColor; }

::selection { background: color-mix(in srgb, var(--theme-color) 25%, transparent); }

*::-webkit-scrollbar { height: 6px; width: 8px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }
*::-webkit-scrollbar-track { background: transparent; }

.container { max-width: 1120px; }

/* --------------------------------------------------------------------------
   Top app bar
   -------------------------------------------------------------------------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.appbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.brand img { height: 34px; width: auto; }

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex-shrink: 0;
}

.text-logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.appbar-search {
  flex: 1;
  min-width: 0;
  max-width: 560px;
  margin: 0 auto;
}

@media (max-width: 991px) {
  .brand img { height: 30px; }
}

.appbar-search form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.appbar-search form:focus-within {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-color) 15%, transparent);
}

.appbar-search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 0.95rem;
  min-width: 0;
}

.appbar-search input::placeholder { color: var(--text-3); }

.appbar-search .search-btn {
  background: transparent;
  border: 0;
  color: var(--text-3);
  padding: 2px 4px;
  display: inline-flex;
}

.appbar-search .search-btn:hover { color: var(--accent); }
.appbar-search .search-btn svg { width: 18px; height: 18px; }

.appbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  background: transparent;
  border: 0;
  color: var(--text-2);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 21px; height: 21px; }

/* Desktop nav links */
.appbar-nav { display: none; }
@media (min-width: 992px) {
  .appbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
  }
  .appbar-nav .nav-link {
    color: var(--text-2);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    white-space: nowrap;
  }
  .appbar-nav .nav-link:hover,
  .appbar-nav .nav-link:focus {
    background: var(--surface-2);
    color: var(--text);
  }
  #navbarSideCollapse { display: none; }
}

/* --------------------------------------------------------------------------
   Offcanvas drawer (mobile menu) — hooks kept for scripts.js
   -------------------------------------------------------------------------- */

.offcanvas-collapse {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(86vw, 340px);
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  z-index: 1040;
  padding: 18px 18px calc(var(--tabbar-h) + 24px);
  overflow-y: auto;
  transform: translateX(-102%);
  transition: transform 0.28s ease;
  visibility: hidden;
}

.offcanvas-collapse.open {
  transform: translateX(0);
  visibility: visible;
  box-shadow: var(--shadow);
}

.offcanvas-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-group-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-3);
  font-weight: 700;
  margin: 18px 4px 8px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: var(--radius-s);
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}

.drawer-link:hover { background: var(--surface-2); color: var(--text); }
.drawer-link svg { width: 19px; height: 19px; color: var(--accent); flex-shrink: 0; }
.drawer-link img { width: 24px; height: 24px; border-radius: 50%; }

#closeMenu {
  background: var(--surface-2);
  border: 0;
  border-radius: 10px;
  color: var(--text-2);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1035;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  border: 0;
  padding: 0;
}

.drawer-backdrop.show { opacity: 1; visibility: visible; }

/* --------------------------------------------------------------------------
   Chips (horizontal filter rail)
   -------------------------------------------------------------------------- */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.chip:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--line-strong);
}

.chip.chip-accent {
  background: color-mix(in srgb, var(--theme-color) 14%, transparent);
  border-color: color-mix(in srgb, var(--theme-color) 40%, transparent);
  color: var(--accent);
}

.chip svg { width: 15px; height: 15px; }
.chip img { width: 20px; height: 20px; border-radius: 50%; }

/* --------------------------------------------------------------------------
   Sections / cards
   -------------------------------------------------------------------------- */

.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 16px;
  margin-bottom: 16px;
}

.section-flush { padding: 0; overflow: hidden; }

.section-title,
.h2-title {
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--text);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.h1-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin: 4px 0 14px;
  letter-spacing: -0.02em;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
}

.section-head .section-title,
.section-head .h2-title { margin: 0; }

.more {
  flex-shrink: 0;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.more:hover { color: var(--accent-2); }

.byline {
  color: var(--text-3);
  font-size: 0.8rem;
  margin: -6px 0 16px;
}

/* --------------------------------------------------------------------------
   Hero (home)
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  border-radius: var(--radius-l);
  padding: 26px 18px 24px;
  margin-bottom: 6px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-color) 16%, transparent), transparent 45%),
    linear-gradient(315deg, color-mix(in srgb, var(--gold) 10%, transparent), transparent 40%),
    var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--theme-color) 18%, transparent), transparent 65%);
  pointer-events: none;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--theme-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-color) 30%, transparent);
  border-radius: 999px;
  padding: 4px 11px;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hero p {
  color: var(--text-2);
  font-size: 0.92rem;
  margin-bottom: 0;
  max-width: 640px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: var(--surface-2);
  transition: background 0.15s;
}

.pill-btn:hover { background: var(--surface-3); color: var(--text); }
.pill-btn svg { width: 16px; height: 16px; }

.pill-btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.pill-btn-accent:hover { background: var(--accent-2); color: var(--accent-ink); }

/* --------------------------------------------------------------------------
   Rails — horizontal snap carousels of app cards
   -------------------------------------------------------------------------- */

.rail-body {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 16px 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.rail-body::-webkit-scrollbar { display: none; }

.app-card {
  scroll-snap-align: start;
  flex-shrink: 0;
  width: 88px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.app-card.wide { width: 128px; }

.app-card img,
.app-card .icon-tile {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  object-fit: cover;
  background: var(--surface-3);
  border: 1px solid var(--line);
  transition: transform 0.15s, box-shadow 0.15s;
}

.app-card.wide img { width: 128px; height: 128px; border-radius: 28px; }

.app-card:hover img {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.app-card .title,
.app-list .title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-card .meta,
.app-card .developer,
.app-list .developer {
  font-size: 0.72rem;
  color: var(--text-3);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-card .rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-3);
}

.app-card .rating svg { width: 11px; height: 11px; color: var(--gold); }
.app-card .rating .votes { color: var(--text-3); font-size: 0.72rem; }

/* List rows (top charts / popular) */
.chart-list { padding: 6px 8px; }

.chart-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 10px;
  border-radius: var(--radius-m);
  transition: background 0.15s;
}

.chart-row:hover { background: var(--surface-2); }

.chart-row .rank {
  width: 22px;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-3);
  flex-shrink: 0;
}

.chart-row img {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-3);
}

.chart-row .info { min-width: 0; flex: 1; }
.chart-row .info .title { font-size: 0.9rem; font-weight: 650; color: var(--text); display: block; }
.chart-row .info .developer { font-size: 0.75rem; color: var(--text-3); display: block; }
.chart-row .info .rating { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--text-3); }
.chart-row .info .rating svg { width: 11px; height: 11px; color: var(--gold); }

/* --------------------------------------------------------------------------
   App grids (category / search / listing pages)
   -------------------------------------------------------------------------- */

.grid-apps,
.app-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 12px;
  padding: 4px 16px 16px;
}

.app-list.featured { padding: 16px; }

.grid-apps > *,
.app-list > * {
  width: 100% !important;
  max-width: 100% !important;
  flex: none;
}

.grid-apps a,
.app-list a {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: center;
  align-items: center;
}

.grid-apps img,
.app-list img {
  width: 100%;
  max-width: 96px;
  aspect-ratio: 1;
  border-radius: 22%;
  object-fit: cover;
  background: var(--surface-3);
  border: 1px solid var(--line);
  transition: transform 0.15s;
}

.grid-apps a:hover img,
.app-list a:hover img { transform: translateY(-2px); }

.grid-apps .title,
.app-list .title { width: 100%; }

@media (min-width: 576px) {
  .grid-apps, .app-list { grid-template-columns: repeat(4, 1fr); gap: 20px 14px; }
}

@media (min-width: 992px) {
  .grid-apps, .app-list { grid-template-columns: repeat(6, 1fr); }
  .app-list.featured { grid-template-columns: repeat(5, 1fr); }
}

/* --------------------------------------------------------------------------
   App detail page
   -------------------------------------------------------------------------- */

.detail-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.detail-head .app-image {
  width: 92px;
  height: 92px;
  border-radius: 22px;
  object-fit: cover;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}

@media (min-width: 576px) {
  .detail-head .app-image { width: 112px; height: 112px; border-radius: 26px; }
}

.detail-head h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
}

.detail-head .developer { color: var(--accent); font-size: 0.85rem; font-weight: 600; display: block; }
.detail-head .version {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-3);
  border-radius: 999px;
  padding: 2px 9px;
  margin-left: 6px;
  vertical-align: middle;
}

.detail-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-3);
}

.detail-rating svg { width: 13px; height: 13px; }

/* stats strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 16px 0;
}

.stats-strip .stat {
  padding: 12px 8px;
  text-align: center;
  border-right: 1px solid var(--line);
}

.stats-strip .stat:last-child { border-right: 0; }

.stats-strip .stat b {
  display: block;
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--text);
}

.stats-strip .stat span {
  font-size: 0.7rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

/* download buttons */
.dl-btn,
.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: 999px;
  padding: 14px 28px;
  width: 100%;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--theme-color) 25%, transparent);
  transition: transform 0.12s, box-shadow 0.12s;
}

.dl-btn:hover,
.download-btn:hover {
  color: var(--accent-ink);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--theme-color) 35%, transparent);
}

.dl-btn svg { width: 18px; height: 18px; }

.dl-row { display: flex; gap: 10px; align-items: stretch; }
.dl-row .dl-btn { flex: 1; }

.qr-btn {
  flex-shrink: 0;
  width: 52px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.qr-btn svg { width: 22px; height: 22px; }
.qr-btn:hover { color: var(--text); background: var(--surface-3); }

.qr-btn .qr-code {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  padding: 8px;
  border-radius: var(--radius-s);
  box-shadow: var(--shadow);
  z-index: 30;
}

.qr-btn:hover .qr-code,
.qr-btn:focus-within .qr-code { display: block; }

.buy-btn,
.download-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 10px 20px;
}

.buy-btn:hover { color: var(--gold); }
.buy-btn svg, .download-btn-sm svg { width: 15px; height: 15px; }

/* share row */
.smi { gap: 8px; margin-top: 14px; }

.smi .fav {
  border-radius: var(--radius-s);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 9px 0 !important;
  text-align: center;
}

.smi .fav:hover { background: var(--surface-3); }

.smi .fav a,
.smi .fav button {
  color: var(--text-2);
  background: transparent;
  border: 0;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
}

.smi .fav svg { width: 16px; height: 16px; }
.smi .fav:hover a, .smi .fav:hover button { color: var(--text); }

/* screenshots rail */
.screenshots { padding: 0 !important; }

#screenshot-main {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 16px;
  position: relative;
  scrollbar-width: none;
}

#screenshot-main::-webkit-scrollbar { display: none; }

#screenshot-main img {
  height: 320px;
  width: auto;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  scroll-snap-align: start;
  background: var(--surface-3);
  object-fit: cover;
}

#screenshot-main a { flex-shrink: 0; }

.shot-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line-strong);
  color: var(--text);
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 5;
  cursor: pointer;
}

.shot-nav svg { width: 18px; height: 18px; }

#left { left: 10px; }
#right { right: 10px; }

/* info grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 18px;
}

@media (min-width: 768px) {
  .info-grid { grid-template-columns: repeat(3, 1fr); }
}

.info-grid b {
  display: block;
  font-size: 0.72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 3px;
}

.info-grid span,
.info-grid a {
  font-size: 0.88rem;
  color: var(--text);
  word-break: break-word;
}

/* old versions */
.version-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.version-row:last-child { border-bottom: 0; }
.version-row h4 { font-size: 0.92rem; font-weight: 700; margin: 0; }

.version-row .file-size,
.version-row .last-update {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-left: 8px;
}

/* description */
.app-description { font-size: 0.92rem; color: var(--text-2); }
.app-description p { margin-bottom: 0.8rem; }
.app-description img { border-radius: var(--radius-m); }
.app-description a { word-break: break-word; }

.rm-link {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-block;
  margin-top: 6px;
}

/* votes */
.up-down { gap: 10px; }

.up-down .up,
.up-down .down {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m) !important;
  padding: 12px !important;
  display: flex;
  justify-content: center;
}

.up-down .up { border-color: color-mix(in srgb, var(--theme-color) 35%, transparent); }

.up-down button {
  background: transparent;
  border: 0;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
}

.up-down button:hover { opacity: 0.85; }
.up-down small { color: var(--text-2) !important; font-size: 0.85rem; }
.up-down svg { width: 20px; height: 20px; }
.up-down .up svg { color: var(--accent); }
.up-down .down svg { color: var(--danger); }

/* reviews */
.review {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 14px;
  margin-bottom: 10px;
}

.review .title { font-weight: 700; font-size: 0.92rem; }
.review .name { font-size: 0.8rem; color: var(--accent); margin: 0; }
.review .date { font-size: 0.75rem; color: var(--text-3); }
.review .comment { font-size: 0.88rem; color: var(--text-2); margin-bottom: 0; }
.review svg { width: 13px; height: 13px; }

.user-ratings .progress {
  height: 6px;
  background: var(--surface-3);
  border-radius: 6px;
  margin: 6px 0;
}

.user-ratings .progress-bar {
  background: var(--accent);
  border-radius: 6px;
  height: 100%;
  width: 0;
}

.rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--theme-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-color) 30%, transparent);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
}

/* Star icons returned by the shared stars() helper. */
.rating,
.stars { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; white-space: nowrap; }
.rating svg,
.stars svg { width: 13px; height: 13px; flex: none; color: var(--text-3); }
.stars svg.checked,
.stars .checked svg,
svg.checked { color: var(--gold); }
.votes { font-size: 0.78rem; color: var(--text-3); font-weight: 600; }

/* rating input stars (jquery rating plugin) */
.user_ratings .stars { gap: 4px; }
.user_ratings .star {
  display: inline-block;
  width: 26px;
  height: 26px;
  background: var(--surface-3);
  border-radius: 50%;
  position: relative;
  cursor: pointer;
}

.user_ratings .star::after {
  content: "★";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 15px;
}

.user_ratings .fullStar::after,
.user_ratings .tmp_fs::after { color: var(--gold); }
.user_ratings .tmp_es::after { color: var(--text-3); }

/* --------------------------------------------------------------------------
   Topics / news cards
   -------------------------------------------------------------------------- */

.topic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px;
}

@media (min-width: 768px) {
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
  .topic-grid { grid-template-columns: repeat(3, 1fr); }
}

.topic-card {
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}

.topic-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.topic-card img { width: 100%; aspect-ratio: 880 / 514; object-fit: cover; display: block; }

.topic-card .topic-box {
  padding: 12px 14px;
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--text);
  background: transparent;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  border-radius: 0 !important;
}

.news-meta { font-size: 0.75rem; color: var(--text-3); }

/* article body */
.article-body {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.7;
}

.article-body img { border-radius: var(--radius-m); max-width: 100%; height: auto; }
.article-body h2, .article-body h3 { color: var(--text); font-weight: 750; margin: 1.2em 0 0.5em; }
.article-body a { word-break: break-word; }

/* --------------------------------------------------------------------------
   SEO content blocks (FAQ / HowTo / table)
   -------------------------------------------------------------------------- */

.hero-answer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-m);
  padding: 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--text-2);
}

.hero-answer .hero-kicker { margin-bottom: 10px; }
.hero-answer p:last-child { margin-bottom: 0; }

.rank-wrap { border: 1px solid var(--line); border-radius: var(--radius-m); }

.rank-table {
  width: 100%;
  margin: 0;
  font-size: 0.85rem;
  border-collapse: collapse;
  min-width: 520px;
}

.rank-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  font-weight: 750;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.rank-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  vertical-align: top;
}

.rank-table tr:last-child td { border-bottom: 0; }
.rank-table .rank-num { color: var(--gold); font-weight: 800; }

.howto-steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}

.howto-steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 14px 44px;
  font-size: 0.9rem;
  color: var(--text-2);
}

.howto-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--theme-color) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-color) 40%, transparent);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-block details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.faq-block summary {
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.faq-block summary::-webkit-details-marker { display: none; }

.faq-block summary::after {
  content: "+";
  font-size: 1.15rem;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.faq-block details[open] summary::after { content: "–"; }
.faq-block details p { color: var(--text-2); font-size: 0.88rem; }

/* --------------------------------------------------------------------------
   Home slider (swiper restyle)
   -------------------------------------------------------------------------- */

.swiper-main {
  border-radius: var(--radius-l);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}

.swiper-main .swiper-slide { position: relative; display: block; }

.swiper-main .swiper-slide img { width: 100%; height: auto; display: block; opacity: 0.85; }

.swiper-main .coverbg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 13, 10, 0.1), rgba(7, 13, 10, 0.92));
}

.swiper-main h3 {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 34px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 750;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.swiper-main h3 .logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  margin: 0 10px 6px 0;
  float: none;
}

.swiper-main .swiper-pagination-main {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
}

.swiper-main .swiper-pagination-bullet {
  background: var(--text-3);
  opacity: 0.5;
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  margin: 0 3px !important;
  font-size: 0;
  line-height: 0;
}

.swiper-main .swiper-pagination-bullet-active { background: var(--accent); opacity: 1; }
.swiper-main .swiper-button-next,
.swiper-main .swiper-button-prev { color: var(--text); }

/* --------------------------------------------------------------------------
   Bottom tab bar (mobile app feel)
   -------------------------------------------------------------------------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1035;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}

.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  padding: 8px 2px 6px;
}

.tabbar a svg { width: 21px; height: 21px; }
.tabbar a.active { color: var(--accent); }
.tabbar a:hover { color: var(--accent); text-decoration: none; }

@media (min-width: 992px) {
  .tabbar { display: none; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer-container { margin-top: 28px; }

.page-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding: 28px 0 0;
  font-size: 0.85rem;
  color: var(--text-2);
}

.footer-logo { height: 30px; width: auto; opacity: 0.95; }

.page-footer .section-head { padding: 0 0 10px; color: var(--text); font-weight: 750; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }

.page-footer ul { padding-left: 0; list-style: none; }
.page-footer ul li { margin-bottom: 8px; }
.page-footer ul a { color: var(--text-2); }
.page-footer ul a:hover { color: var(--accent); }

.footer-social { display: flex; gap: 10px; margin-top: 12px; }
.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
}
.footer-social a:hover { color: var(--accent); }
.footer-social svg { width: 17px; height: 17px; }

.age-notice {
  background: color-mix(in srgb, var(--gold) 7%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--gold) 25%, transparent);
  color: #805a07;
  font-size: 0.75rem;
  margin-top: 22px;
}

.footer-copyright {
  color: var(--text-3);
  font-size: 0.78rem;
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   Cookie bar
   -------------------------------------------------------------------------- */

.cookiealert {
  position: fixed;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
  left: 12px;
  right: 12px;
  z-index: 1042;
  background: var(--surface-2) !important;
  border: 1px solid var(--line-strong);
  color: var(--text-2) !important;
  border-radius: var(--radius-m);
  padding: 12px 16px !important;
  font-size: 0.82rem;
  box-shadow: var(--shadow);
  display: none;
}

@media (min-width: 992px) {
  .cookiealert { bottom: 12px; left: auto; max-width: 460px; }
}

.cookiealert.show { display: block; }

.cookiealert .cookie-policy-link { color: var(--accent); font-weight: 700; margin: 0 4px; }

.accept-cookies {
  background: var(--accent) !important;
  color: var(--accent-ink) !important;
  border: 0;
  border-radius: 999px;
  font-weight: 750;
  font-size: 0.78rem;
  padding: 5px 16px;
  margin-left: 8px;
}

/* --------------------------------------------------------------------------
   Breadcrumbs / pagination / alerts / forms
   -------------------------------------------------------------------------- */

.breadcrumbs {
  font-size: 0.78rem;
  color: var(--text-3);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 12px;
}

.breadcrumbs a { color: var(--text-3); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .btn { padding: 0; font-size: 0.78rem; color: var(--text-3); }

.alert {
  border-radius: var(--radius-m);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.88rem;
}

.alert-warning {
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  border-color: color-mix(in srgb, var(--gold) 30%, transparent);
  color: #805a07;
}

.alert-danger {
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  color: var(--danger);
}

.alert-success {
  background: color-mix(in srgb, var(--theme-color) 8%, transparent);
  border-color: color-mix(in srgb, var(--theme-color) 30%, transparent);
  color: var(--accent);
}

.pagination .page-link {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text-2);
}

.pagination .page-item.active .page-link {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.pagination .page-link:hover { background: var(--surface-3); color: var(--text); }
.pagination .page-item.disabled .page-link { background: transparent; border-color: var(--line); color: var(--text-3); }

.page-load-status { color: var(--text-3); font-size: 0.82rem; padding: 14px; }
.pagination-next { display: none; }

.form-control,
.form-select {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  font-size: 0.92rem;
}

.form-control:focus,
.form-select:focus {
  background: var(--surface-2);
  border-color: var(--accent-2);
  color: var(--text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-color) 15%, transparent);
}

.form-control::placeholder { color: var(--text-3); }

.form-label { color: var(--text-2); font-size: 0.85rem; font-weight: 600; }
.form-text { color: var(--text-3) !important; }

.submit-button,
.comment-button,
.add-comment {
  background: var(--accent) !important;
  color: var(--accent-ink) !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-weight: 750 !important;
  padding: 10px 24px !important;
  font-size: 0.88rem;
}

.submit-button:hover,
.comment-button:hover,
.add-comment:hover { background: var(--accent-2) !important; color: var(--accent-ink) !important; }

/* Bootstrap light overrides */
.dropdown-menu {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow);
}

.dropdown-item { color: var(--text-2); font-size: 0.9rem; border-radius: 8px; }
.dropdown-item:hover { background: var(--surface-3); color: var(--text); }

.modal-content {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  color: var(--text);
}

.modal-header, .modal-footer { border-color: var(--line); }
.modal-title { font-weight: 750; }
.btn-close { opacity: 0.7; }

.tooltip .tooltip-inner { background: var(--surface-3); color: var(--text); }

.table-responsive { border-radius: var(--radius-m); }

/* jQuery UI autocomplete */
.ui-autocomplete {
  background: var(--surface-2) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  z-index: 2000 !important;
  padding: 6px;
}

.ui-menu-item { border: 0 !important; }
.ui-menu-item .ui-menu-item-wrapper {
  color: var(--text-2);
  padding: 9px 10px !important;
  border-radius: 9px;
  display: flex;
  align-items: center;
}

.ui-menu-item .ui-menu-item-wrapper.ui-state-active {
  background: var(--surface-3) !important;
  color: var(--text) !important;
  border: 0 !important;
  background-image: none !important;
}

.ui-menu-item img { width: 38px; height: 38px; border-radius: 10px; margin-right: 11px; }
.ui-menu-item div > div.my-auto { color: var(--text); font-size: 0.9rem; }

/* SimpleLightbox */
.slbOverlay, .slbImageWrap { border-radius: var(--radius-m); }

/* --------------------------------------------------------------------------
   Notifications (notificationManager.js)
   -------------------------------------------------------------------------- */

#notificationsContainer {
  position: fixed;
  z-index: 2000;
  top: calc(var(--topbar-h) + 10px);
  right: 10px;
  left: auto;
  width: 300px;
}

#notificationsContainer.topleft { top: calc(var(--topbar-h) + 10px); left: 10px; right: auto; }
#notificationsContainer.topright { top: calc(var(--topbar-h) + 10px); right: 10px; left: auto; }
#notificationsContainer.bottomleft { top: auto; bottom: calc(var(--tabbar-h) + 20px); left: 10px; right: auto; }
#notificationsContainer.bottomright { top: auto; bottom: calc(var(--tabbar-h) + 20px); right: 10px; left: auto; }

#notificationsContainer .notification {
  border-radius: var(--radius-m);
  padding: 0;
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.notification .pad {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  gap: 8px;
}

.notification .pad .message {
  flex: 1;
  color: #06281a;
  font-size: 0.85rem;
  font-weight: 650;
}

.notification .pad .close { width: 22px; height: 22px; position: relative; }
.notification .pad .close-btn::after {
  content: "×";
  color: #06281a;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  display: block;
}

.notification .progressContainer { height: 3px; background: rgba(0, 0, 0, 0.12); }
.notification .progressContainer .progress { height: 100%; width: 0; }

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */

.section-icon {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  border-radius: 50%;
}

.section-icon svg { width: 12px; height: 12px; color: var(--accent); }

.w-25px { width: 25px; }
.w-35px { width: 35px; }

.redirecting { font-size: 0.85rem; color: var(--text-2); display: inline-block; margin-top: 6px; }
#countdown { color: var(--accent); font-weight: 800; font-size: 1rem; display: inline-block; margin-top: 2px; }

.tags ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li a {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
}
.tags li a:hover { color: var(--text); border-color: var(--line-strong); }

.recommended-terms span { font-size: 0.8rem; color: var(--text-3); margin-right: 8px; }
.recommended-terms a {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  margin: 0 6px 6px 0;
}
.recommended-terms a:hover { color: var(--text); border-color: var(--line-strong); }

.main-content { padding-top: 14px; padding-bottom: 30px; }

.app-space { border-top: 1px solid var(--line); margin: 4px 0; }

.news-reading-time {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  border-radius: 999px;
  padding: 3px 11px;
}

/* jQuery Lazy swaps the source but keeps the lazy class after loading. */
.lazy { transition: opacity 0.3s; }

/* Light directory homepage. Branding and accent come from admin and --theme-color. */
.brand-site-name { color: var(--text); font-size: 1.08rem; font-weight: 750; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand img { width: 42px; height: 42px; object-fit: contain; flex: none; border-radius: 8px; }
.brand { min-width: 0; }
.appbar-nav .portal-only-nav { display: none; }
.portal-home .appbar-nav .portal-only-nav { display: block; }
.portal-home .appbar-nav .store-only-nav { display: none; }
.portal-home { background: #f6f7f9; }
.portal-home .main-content { padding-top: 4px; }
.portal-home .appbar { background: #fff; box-shadow: 0 1px 4px rgba(29, 41, 49, 0.08); }
.portal-home .appbar-search { display: none; }
.portal-home .container { max-width: 1360px; }
.portal-shell { padding-top: 16px; }
.portal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.portal-main, .portal-sidebar { min-width: 0; }

.portal-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 50px;
  background: #fff;
  border: 1px solid #e4e8eb;
  border-radius: 5px;
  padding: 6px 7px 6px 14px;
  box-shadow: 0 1px 2px rgba(29, 41, 49, 0.05);
  margin-bottom: 16px;
}
.portal-search:focus-within { border-color: var(--theme-color); }
.portal-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 1rem; }
.portal-search input::placeholder { color: var(--text-3); }
.portal-search button { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 0; border-radius: 4px; background: var(--theme-color); color: #fff; }
.portal-search button svg { width: 17px; height: 17px; }
.portal-heading { font-size: 1.12rem; font-weight: 750; color: var(--text); margin: 0 0 15px; line-height: 1.35; }

.portal-panel {
  background: #fff;
  border: 1px solid #e4e8eb;
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(29, 41, 49, 0.06);
  padding: 0 15px 15px;
  margin-bottom: 16px;
  min-width: 0;
}
.portal-panel-head { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #eef0f2; margin-bottom: 13px; }
.portal-panel-head h2 { margin: 0; color: var(--text); font-size: 1rem; font-weight: 750; }
.portal-panel-head a { color: var(--text-2); font-size: 0.86rem; white-space: nowrap; }
.portal-panel-head a:hover { color: var(--theme-color); }

.portal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 16px; }
.portal-item { display: flex; align-items: center; gap: 11px; min-width: 0; color: var(--text); }
.portal-item:hover strong, .portal-side-item:hover strong, .portal-featured-item:hover strong { color: var(--theme-color); }
.portal-item img { width: 72px; height: 72px; flex: none; object-fit: cover; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--line); }
.portal-item-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow: hidden; }
.portal-item-copy strong { display: block; color: var(--text); font-size: 1rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-item-copy > span:not(.rating) { display: block; color: var(--text-2); font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-item-copy small { color: var(--text-3); font-size: 0.82rem; white-space: nowrap; }
.portal-item-copy .rating { line-height: 1; }
.portal-item-copy .rating svg { width: 13px; height: 13px; }

.portal-featured-rail { display: flex; gap: 16px; overflow-x: auto; padding: 1px 0 3px; scrollbar-width: none; }
.portal-featured-rail::-webkit-scrollbar { display: none; }
.portal-featured-item { display: block; flex: 0 0 88px; min-width: 0; color: var(--text); }
.portal-featured-item img { display: block; width: 84px; height: 84px; object-fit: cover; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--line); margin-bottom: 6px; }
.portal-featured-item strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--text); font-size: 0.9rem; line-height: 1.25; font-weight: 650; }

.portal-links { display: grid; gap: 7px; }
.portal-links a { color: var(--text-2); font-size: 0.88rem; }
.portal-links a:hover { color: var(--theme-color); }

.portal-side-panel { padding: 0 13px 5px; }
.portal-side-panel .portal-panel-head { margin-bottom: 2px; }
.portal-side-list { display: grid; }
.portal-side-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #e6eaed; min-width: 0; color: var(--text); }
.portal-side-item:last-child { border-bottom: 0; }
.portal-side-item img { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--line); }
.portal-side-item > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow: hidden; }
.portal-side-item strong { display: block; color: var(--text); font-size: 0.94rem; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.portal-side-item .rating { gap: 2px; line-height: 1; }
.portal-side-item .rating svg { width: 12px; height: 12px; }
.portal-side-item .rating svg:not(.checked), .portal-item-copy .rating svg:not(.checked) { color: #b9c0c5; }
.portal-side-item small { color: var(--text-3); font-size: 0.78rem; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

@media (min-width: 992px) {
  .portal-home .appbar-inner { height: 68px; }
  .portal-home .brand { margin-right: auto; }
  .portal-home .brand img { width: 44px; height: 44px; }
  .portal-home .brand-site-name { max-width: 230px; }
  .portal-home .appbar-nav { gap: 0; margin-left: 0; }
  .portal-home .appbar-nav .nav-link { padding: 8px 8px; font-size: 0.92rem; }
}
@media (min-width: 992px) and (max-width: 1199px) {
  .portal-home #navbarSideCollapse { display: inline-flex !important; }
  .portal-home .appbar-nav { display: none !important; }
  .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
  .portal-layout { grid-template-columns: minmax(0, 1fr); }
  .portal-sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 700px) {
  .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .portal-sidebar { grid-template-columns: minmax(0, 1fr); }
  .portal-panel { padding-left: 12px; padding-right: 12px; }
  .portal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
  }
  .portal-item img { width: 76px; height: 76px; max-width: 100%; }
  .portal-item-copy { width: 100%; gap: 2px; align-items: center; text-align: center; }
  .portal-item-copy strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    line-height: 1.3;
    font-size: 1rem;
  }
  .portal-item-copy > span:not(.rating) { font-size: 0.82rem; }
  .portal-item-copy small { font-size: 0.76rem; }
  .portal-featured-rail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; overflow: visible; }
  .portal-featured-item { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 9px; text-align: center; }
  .portal-featured-item img { width: 76px; height: 76px; max-width: 100%; margin-left: auto; margin-right: auto; }
  .portal-featured-item strong { font-size: 0.81rem; text-align: center; }
  .portal-side-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .portal-side-item, .portal-side-item:last-child {
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 9px;
  }
  .portal-side-item > span { width: 100%; align-items: center; text-align: center; }
  .portal-side-item strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; font-size: 0.88rem; }
  .brand-site-name { max-width: min(58vw, 240px); }
}
