/* Wartadata Interactive UI — community-inspired news */

:root {
  --bg: #D8E8F8;
  --bg-soft: #EAF2FB;
  --ink: #152536;
  --ink-muted: #5A6E82;
  --ink-soft: #8A9BB0;
  --white: #FFFFFF;
  --glass: rgba(47, 125, 225, 0.88);
  --glass-soft: rgba(255, 255, 255, 0.55);
  --pink: #2F7DE1;
  --pink-soft: #5B9AED;
  --accent: #2F7DE1;
  --nav-bg: #2F7DE1;
  --nav-gradient: linear-gradient(135deg, #1B5FB8 0%, #2F7DE1 50%, #7EB6F5 100%);
  --nav-fg: #FFFFFF;
  --nav-muted: rgba(255, 255, 255, 0.65);
  --shadow: 0 12px 32px rgba(20, 40, 80, 0.1);
  --shadow-sm: 0 4px 16px rgba(20, 40, 80, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --nav-h: 72px;
  --desktop-max: 1180px;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Sora", "Outfit", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(120, 180, 255, 0.45), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(90, 160, 240, 0.32), transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(160, 210, 255, 0.28), transparent 50%),
    var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
  border: none;
  background: none;
  color: inherit;
}

button {
  cursor: pointer;
}

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

img {
  display: block;
  max-width: 100%;
}

ul {
  list-style: none;
}

.app {
  min-height: 100dvh;
}

/* ——— Shell ——— */
.shell {
  width: min(100%, var(--desktop-max));
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
}

.shell.has-sidebar {
  /* mobile default: single column */
}

.main-stage {
  min-width: 0;
  padding-bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom));
  padding-top: 0;
  margin-top: 0;
}

/* ——— Desktop sidebar ——— */
.desk-sidebar {
  display: none;
}

.desk-aside {
  display: none;
}

/* ——— Discovery header ——— */
.page-pad {
  padding: 20px 18px 0;
}

.disc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  animation: rise 0.55s var(--ease) both;
}

.disc-header h1 {
  font-family: var(--display);
  font-size: clamp(1.85rem, 6vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.disc-header p {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 0.95rem;
  max-width: 28ch;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* ——— Search overlay ——— */
.search-panel {
  display: none;
  margin-bottom: 16px;
  animation: rise 0.35s var(--ease) both;
}

.search-panel.open {
  display: block;
}

.search-panel input {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-pill);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  outline: none;
}

.search-panel input:focus {
  box-shadow: 0 0 0 3px rgba(255, 45, 120, 0.2), var(--shadow-sm);
}

/* ——— Category cards ——— */
.cat-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cat-card {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 18px 130px 16px 18px;
  min-height: 168px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
  animation: rise 0.55s var(--ease) both;
  text-align: left;
  width: 100%;
}

.cat-card:nth-child(1) { animation-delay: 0.05s; }
.cat-card:nth-child(2) { animation-delay: 0.1s; }
.cat-card:nth-child(3) { animation-delay: 0.15s; }
.cat-card:nth-child(4) { animation-delay: 0.2s; }
.cat-card:nth-child(5) { animation-delay: 0.25s; }
.cat-card:nth-child(6) { animation-delay: 0.3s; }
.cat-card:nth-child(7) { animation-delay: 0.35s; }
.cat-card:nth-child(8) { animation-delay: 0.4s; }

.cat-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow);
}

.cat-card:active {
  transform: scale(0.985);
}

.cat-card__tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.cat-card__title {
  font-family: var(--display);
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 100%;
  line-height: 1.15;
  margin-bottom: 6px;
}

.cat-card__desc {
  font-size: 0.82rem;
  color: rgba(26, 21, 35, 0.72);
  max-width: 100%;
  line-height: 1.4;
  margin-bottom: 14px;
}

.cat-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  object-fit: cover;
  margin-left: -8px;
}

.avatar-stack img:first-child {
  margin-left: 0;
}

.cat-card__members {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(26, 21, 35, 0.75);
}

.cat-card__more {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.35);
  z-index: 3;
  transition: background 0.2s;
}

.cat-card__more:hover {
  background: rgba(255, 255, 255, 0.65);
}

.blob {
  position: absolute;
  right: 10px;
  bottom: 14px;
  width: 112px;
  height: 112px;
  z-index: 1;
  pointer-events: none;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.2);
}

.blob img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  animation: blobFloat 6s ease-in-out infinite;
}

.cat-card:nth-child(even) .blob img {
  animation-delay: -2s;
}

/* ——— Topic detail ——— */
.topic-view {
  animation: fadeSlide 0.4s var(--ease) both;
}

.topic-hero {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: linear-gradient(135deg, #c46b9a 0%, #e8897a 50%, #f0c070 100%);
}

.topic-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topic-hero__wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(80, 30, 90, 0.15) 0%, rgba(180, 60, 140, 0.45) 55%, rgba(246, 228, 216, 0.95) 100%);
}

.topic-hero__actions {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  z-index: 2;
}

.topic-hero__actions .right {
  display: flex;
  gap: 8px;
}

.glass-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, background 0.2s;
}

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.55);
  transform: scale(1.05);
}

.topic-panel {
  position: relative;
  margin: -48px 16px 0;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow);
  z-index: 3;
}

.topic-panel__top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.topic-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.topic-panel h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.topic-stats {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.topic-bio {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.topic-panel__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.join-btn {
  background: var(--ink);
  color: var(--white);
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 16px rgba(26, 21, 35, 0.25);
}

.join-btn:hover {
  transform: translateY(-2px);
}

.join-btn.joined {
  background: var(--pink);
  box-shadow: 0 6px 16px rgba(255, 45, 120, 0.35);
}

.join-btn:active {
  transform: scale(0.96);
}

/* ——— Tabs ——— */
.tabs {
  display: flex;
  gap: 4px;
  margin: 18px 16px 0;
  border-bottom: 1px solid rgba(26, 21, 35, 0.08);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
  position: relative;
  white-space: nowrap;
  transition: color 0.2s;
}

.tab.active {
  color: var(--ink);
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--pink);
}

/* ——— Composer ——— */
.composer {
  margin: 16px 16px 0;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

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

.composer__row img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.composer__row input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  outline: none;
}

.composer__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-left: 52px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
  transition: background 0.2s, transform 0.2s;
}

.chip-btn:hover {
  background: #F0D8CC;
  transform: translateY(-1px);
}

.chip-btn svg {
  width: 14px;
  height: 14px;
}

/* ——— Feed posts ——— */
.feed {
  margin: 14px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  animation: rise 0.4s var(--ease) both;
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
}

.post:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.post:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

.post__pin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 10px;
}

.post__head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.post__head img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.post__author {
  font-weight: 700;
  font-size: 0.92rem;
}

.post__meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.post__title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-bottom: 6px;
}

.post__excerpt {
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.post__media {
  margin-top: 12px;
  border-radius: 0;
  overflow: hidden;
  max-height: 220px;
  aspect-ratio: 16 / 10;
  width: 100%;
  background: var(--bg-soft);
}

.post__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.post__actions {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(26, 21, 35, 0.06);
}

.react-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  transition: color 0.2s, transform 0.2s;
}

.react-btn svg {
  width: 18px;
  height: 18px;
}

.react-btn:hover {
  color: var(--ink);
}

.react-btn.liked {
  color: var(--pink);
}

.react-btn.liked svg {
  animation: heartPop 0.4s var(--ease);
}

.post__source {
  display: inline-flex;
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  color: var(--ink-muted);
}

/* ——— Events / Members / About panels ——— */
.panel-block {
  margin: 14px 16px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.panel-block h3 {
  font-family: var(--display);
  font-size: 1rem;
  margin-bottom: 12px;
}

.event-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(26, 21, 35, 0.06);
}

.event-row:last-child {
  border-bottom: none;
}

.event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  background: var(--pink);
}

.event-row strong {
  display: block;
  font-size: 0.92rem;
}

.event-row span {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.member-grid figure {
  text-align: center;
}

.member-grid img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 6px;
  object-fit: cover;
}

.member-grid figcaption {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

/* ——— Home feed ——— */
.home-page {
  min-width: 0;
  overflow-x: clip;
}

.home-hero {
  /* Full-bleed mobile: stick to top + left + right, sharp corners */
  width: 100vw;
  max-width: 100vw;
  margin: 0 0 16px;
  margin-left: calc(50% - 50vw);
  border-radius: 0;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 18px 18px;
  min-height: 0;
  background: linear-gradient(
    135deg,
    var(--pink-soft) 0%,
    var(--accent) 52%,
    color-mix(in srgb, var(--accent) 70%, #7EB6F5) 100%
  );
  color: white;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 22%, transparent);
  position: relative;
  left: 0;
  right: 0;
  top: 0;
  overflow: hidden;
  box-sizing: border-box;
  animation: none;
}

.home-hero::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -28px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.home-hero h1 {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
  line-height: 1.15;
}

.home-hero p {
  margin-top: 6px;
  opacity: 0.92;
  max-width: 34ch;
  position: relative;
  z-index: 1;
  font-size: 0.88rem;
  line-height: 1.4;
}

.home-page__body.page-pad {
  padding-top: 4px;
}

.page-pad .section-label {
  padding: 0;
}

.page-pad .feed {
  margin-left: 0;
  margin-right: 0;
}

.section-label {
  padding: 0 18px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section-label h2 {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 800;
}

.section-label button {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pink);
}

/* ——— Bottom nav (theme-aware) ——— */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 0 4px env(safe-area-inset-bottom);
  background: var(--nav-gradient, var(--nav-bg));
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  border-radius: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  z-index: 100;
  box-shadow: 0 -10px 32px rgba(70, 40, 120, 0.28);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--nav-fg);
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--nav-muted);
  transition: color 0.2s, transform 0.2s;
  position: relative;
  height: var(--nav-h);
}

.nav-badge {
  position: absolute;
  top: 6px;
  left: calc(50% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3b5c;
  color: #fff;
  font-size: 0.64rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  z-index: 2;
}

.desk-nav-btn__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.desk-nav-btn__icon .nav-badge {
  top: -6px;
  left: auto;
  right: -10px;
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-item span {
  font-size: 0.62rem;
  font-weight: 600;
}

.nav-item.active {
  color: var(--nav-fg);
}

.nav-item.active::after {
  content: "";
  position: absolute;
  bottom: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.nav-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--pink-soft), var(--accent));
  color: white;
  display: grid;
  place-items: center;
  margin: 0 auto;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-10px);
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background 0.3s;
}

.nav-fab:hover {
  transform: translateY(-12px) scale(1.06);
}

.nav-fab:active {
  transform: translateY(-8px) scale(0.96);
}

.nav-fab.spinning svg {
  animation: spinRefresh 0.8s linear infinite;
}

.nav-fab svg {
  width: 24px;
  height: 24px;
}

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

/* ——— Modal / toast ——— */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 30, 0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: grid;
  place-items: end center;
  padding: 16px;
  animation: fadeIn 0.25s ease both;
}

.modal-sheet {
  width: min(420px, 100%);
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 24px 24px;
  padding: 22px;
  box-shadow: var(--shadow);
  animation: sheetUp 0.35s var(--ease) both;
}

.modal-sheet h3 {
  font-family: var(--display);
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.modal-sheet p {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-actions button {
  padding: 14px;
  border-radius: var(--radius-md);
  font-weight: 700;
  background: var(--bg-soft);
  transition: background 0.2s;
}

.modal-actions button.primary {
  background: var(--pink);
  color: white;
}

.modal-actions button:hover {
  filter: brightness(0.97);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
  white-space: nowrap;
  max-width: calc(100% - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ——— Article reader (fullscreen rounded-square popup) ——— */
.article-backdrop {
  place-items: stretch center;
  padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 77, 141, 0.22), transparent 55%),
    rgba(22, 14, 32, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.28s ease both;
  z-index: 220;
  overflow: hidden;
}

body.article-open .bottom-nav {
  display: none !important;
}

.article-reader {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #fff 0%, #FFF8F3 100%);
  display: flex;
  flex-direction: column;
  animation: readerPop 0.42s var(--ease) both;
  border-radius: 32px;
  overflow: hidden;
  box-shadow:
    0 28px 64px rgba(20, 10, 30, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
  position: relative;
  z-index: 1;
}

.article-reader__handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 0;
  flex-shrink: 0;
}

.article-reader__handle span {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(26, 21, 35, 0.12);
}

.article-reader__bar {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px 12px;
  background: transparent;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.article-reader__icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(26, 21, 35, 0.06);
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: transform 0.2s, background 0.2s;
  flex-shrink: 0;
}

.article-reader__icon:hover {
  transform: scale(1.04);
  background: rgba(26, 21, 35, 0.1);
}

.article-reader__icon-spacer {
  width: 36px;
  height: 36px;
}

.article-reader__icon svg {
  width: 16px;
  height: 16px;
}

.article-reader__source-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  background: rgba(255, 45, 120, 0.1);
  color: var(--pink);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}

.article-reader__source-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.article-reader__source-btn:hover {
  background: rgba(255, 45, 120, 0.16);
  transform: translateY(-1px);
}

.article-reader__meta {
  min-width: 0;
  overflow: hidden;
  text-align: left;
  padding: 0 2px;
}

.article-reader__meta strong {
  display: block;
  font-size: 0.7rem;
  color: var(--pink);
  font-weight: 700;
  margin-bottom: 1px;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-reader__meta span {
  display: block;
  font-family: var(--display);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.article-reader__frame-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  margin: 0 10px 10px;
  border-radius: 22px;
  overflow: hidden;
  background: #F3E8DF;
  box-shadow: inset 0 0 0 1px rgba(26, 21, 35, 0.05);
  z-index: 1;
  isolation: isolate;
}

.article-reader__frame {
  width: 100%;
  max-width: 100%;
  height: 100%;
  border: 0;
  background: white;
  opacity: 1;
  border-radius: 22px;
  position: relative;
  z-index: 0;
  display: block;
}

.article-reader__native {
  padding: 20px 16px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  height: 100%;
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.article-reader__native img {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 0;
  margin-bottom: 14px;
  display: block;
}

.article-reader__native h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.article-reader__native p {
  color: var(--ink-muted);
  line-height: 1.55;
}

@keyframes readerPop {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 420px) {
  .article-reader__source-btn span {
    display: none;
  }

  .article-reader__source-btn {
    width: 36px;
    padding: 0;
  }

  .article-reader {
    border-radius: 24px;
  }

  .article-reader__frame-wrap {
    margin: 0 8px 8px;
    border-radius: 18px;
  }
}

@media (min-width: 900px) {
  .article-backdrop {
    place-items: center;
    padding: 28px;
  }

  .article-reader {
    width: min(880px, 100%);
    height: min(920px, calc(100dvh - 56px));
    max-height: calc(100dvh - 56px);
    border-radius: 36px;
  }

  .article-reader__bar {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    padding: 12px 18px 14px;
  }

  .article-reader__icon {
    width: 40px;
    height: 40px;
  }

  .article-reader__source-btn {
    height: 40px;
    padding: 0 14px 0 12px;
    font-size: 0.8rem;
  }

  .article-reader__frame-wrap {
    margin: 0 14px 14px;
    border-radius: 26px;
  }
}


/* ——— Profile / settings ——— */
.profile-page {
  padding: 0 16px 32px;
  max-width: 560px;
  margin: 0 auto;
}

.profile-banner {
  position: relative;
  margin: 12px 0 18px;
  padding: 22px 18px 20px;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 18%, var(--bg-soft)), var(--bg-soft));
  box-shadow: var(--shadow-sm);
}

.profile-banner__glow {
  position: absolute;
  right: -40px;
  top: -50px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  filter: blur(8px);
  pointer-events: none;
}

.profile-hero {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 24px;
  background: linear-gradient(145deg, var(--pink-soft), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 35%, transparent);
}

.profile-hero__text {
  min-width: 0;
}

.profile-hero h1 {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-hero p {
  color: var(--ink-muted);
  font-size: 0.86rem;
  margin-top: 4px;
  line-height: 1.4;
}

.pref-card {
  background: color-mix(in srgb, var(--white) 86%, var(--bg-soft));
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.auth-card {
  padding: 18px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 10%, var(--bg-soft)), color-mix(in srgb, var(--white) 92%, var(--bg-soft)));
}

.auth-card__grid {
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-areas:
    "mark copy"
    "btn btn";
  gap: 12px 14px;
  align-items: center;
}

.auth-card--in .auth-card__grid {
  grid-template-areas:
    "mark copy"
    "btn btn";
}

.auth-card__mark {
  grid-area: mark;
  width: 56px;
  height: 56px;
  border-radius: 0;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    0 8px 20px rgba(40, 20, 40, 0.1);
  overflow: hidden;
  flex-shrink: 0;
}

.auth-card__mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-card__mark svg {
  width: 28px;
  height: 28px;
  display: block;
}

.auth-card__mark--google {
  background: #fff;
}

.auth-card__copy {
  grid-area: copy;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.auth-card__eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.auth-card__title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-card__sub {
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.auth-card .google-login-btn,
.auth-card .auth-logout {
  grid-area: btn;
}

.google-login-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 0;
  background: #fff;
  color: #1f1f1f;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.12),
    0 8px 20px rgba(40, 20, 40, 0.08);
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s;
}

.google-login-btn:hover {
  background: #fafafa;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.16),
    0 10px 24px rgba(40, 20, 40, 0.12);
}

.google-login-btn:active {
  transform: scale(0.985);
}

.google-login-btn__icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.google-login-btn__icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.auth-logout {
  width: 100%;
  padding: 13px 16px;
  border-radius: 0;
  font-weight: 700;
  font-size: 0.88rem;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
  transition: background 0.2s, transform 0.2s;
}

.auth-logout:active {
  transform: scale(0.985);
}

html[data-theme="charcoal"] .auth-card {
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 16%, #221c2c), #2a2434);
}

html[data-theme="charcoal"] .auth-card__mark,
html[data-theme="charcoal"] .google-login-btn {
  background: #2a2434;
  color: #f4eef8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

@media (min-width: 520px) {
  .auth-card__grid {
    grid-template-columns: 56px 1fr auto;
    grid-template-areas: "mark copy btn";
    gap: 14px 16px;
  }

  .auth-card .google-login-btn,
  .auth-card .auth-logout {
    width: auto;
    min-width: 168px;
    justify-self: end;
  }
}

.auth-card .pref-hint {
  margin-top: 0;
}

.google-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 14, 28, 0.45);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}

.google-auth-sheet {
  position: relative;
  width: min(360px, 100%);
  background: #fff;
  color: #1a1523;
  border-radius: 24px;
  padding: 28px 22px 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(20, 14, 28, 0.28);
}

.google-auth-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  color: #6b6175;
  background: transparent;
}

.google-auth-brand {
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}

.google-auth-sheet h2 {
  font-family: var(--display);
  font-size: 1.2rem;
  margin: 0 0 6px;
}

.google-auth-sheet p {
  color: #6b6175;
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0 0 18px;
}

.google-auth-btn-host {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.pref-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.pref-card h3 {
  font-family: var(--display);
  font-size: 0.95rem;
  margin: 0;
}

.pref-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 4px 10px;
  border-radius: 999px;
}

.pref-input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  outline: none;
  color: var(--ink);
}

.pref-input:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* Color-only theme icons */
.theme-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  padding: 4px 2px 2px;
}

.theme-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  border: 2px solid transparent;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.22s var(--ease), border-color 0.22s, box-shadow 0.22s;
}

.theme-dot__fill {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.35),
    0 4px 12px rgba(40, 20, 40, 0.16);
}

.theme-dot:hover {
  transform: scale(1.08);
}

.theme-dot.is-active {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

.theme-dot.is-active .theme-dot__fill {
  width: 30px;
  height: 30px;
}

.lang-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 16px;
  background: var(--bg-soft);
  font-weight: 700;
  color: var(--ink-muted);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.lang-btn__flag {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 800;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
}

.lang-btn.is-active {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.lang-btn.is-active .lang-btn__flag {
  background: color-mix(in srgb, var(--bg) 22%, transparent);
  color: var(--bg);
}

.topic-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.topic-chip__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.topic-chip.is-active {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-soft));
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
}

.pref-hint {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin: -4px 0 12px;
  line-height: 1.4;
}

.pref-save {
  width: 100%;
  margin-top: 8px;
  padding: 15px;
  border-radius: var(--radius-pill);
  background: linear-gradient(145deg, var(--pink-soft), var(--accent));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 35%, transparent);
}

.pref-save:active {
  transform: scale(0.98);
}

html[data-theme="charcoal"] .pref-card {
  background: color-mix(in srgb, var(--bg-soft) 90%, #000);
}

html[data-theme="charcoal"] .lang-btn.is-active {
  color: #1C1824;
}

html[data-theme="charcoal"] .lang-btn.is-active .lang-btn__flag {
  color: #1C1824;
}

@media (min-width: 900px) {
  .profile-page {
    padding-top: 12px;
  }
}

/* ——— Empty / loading ——— */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-muted);
}

.skeleton {
  background: linear-gradient(90deg, #f0e0d4 25%, #f8ebe2 50%, #f0e0d4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-lg);
  height: 140px;
}

/* ——— Animations ——— */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheetUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blobFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

@keyframes heartPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ——— Desktop ——— */
@media (min-width: 900px) {
  body {
    background:
      radial-gradient(ellipse 50% 40% at 0% 0%, rgba(255, 180, 200, 0.4), transparent 50%),
      radial-gradient(ellipse 40% 35% at 100% 10%, rgba(255, 210, 140, 0.3), transparent 50%),
      var(--bg);
  }

  .shell.has-sidebar {
    grid-template-columns: 220px minmax(0, 1fr) 280px;
    gap: 20px;
    padding: 24px 28px 40px;
    align-items: start;
  }

  .main-stage {
    padding-bottom: 40px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 32px;
    padding: 8px 8px 28px;
    min-height: calc(100dvh - 48px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  }

  .desk-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 24px;
    padding: 20px 14px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px);
    border-radius: 28px;
    box-shadow: var(--shadow-sm);
  }

  .desk-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 18px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(26, 21, 35, 0.08);
  }

  .desk-brand__mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1B5FB8, #7EB6F5);
    display: grid;
    place-items: center;
    color: white;
    font-weight: 800;
    font-family: var(--display);
  }

  .desk-brand strong {
    font-family: var(--display);
    font-size: 1.05rem;
    display: block;
  }

  .desk-brand small {
    color: var(--ink-muted);
    font-size: 0.72rem;
  }

  .desk-nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    font-weight: 600;
    color: var(--ink-muted);
    transition: background 0.2s, color 0.2s;
    text-align: left;
    width: 100%;
  }

  .desk-nav-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    color: var(--ink);
  }

  .desk-nav-btn.active {
    background: var(--ink);
    color: white;
  }

  .desk-nav-btn svg {
    width: 20px;
    height: 20px;
  }

  .desk-aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 24px;
  }

  .aside-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 18px;
    box-shadow: var(--shadow-sm);
  }

  .aside-card h3 {
    font-family: var(--display);
    font-size: 0.95rem;
    margin-bottom: 12px;
  }

  .trend-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(26, 21, 35, 0.05);
  }

  .trend-row:last-child {
    border-bottom: none;
  }

  .trend-row span {
    color: var(--ink-muted);
    font-size: 0.78rem;
  }

  .bottom-nav {
    display: none;
  }

  .cat-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 10px 10px;
  }

  .page-pad {
    padding: 24px 20px 0;
  }

  .home-hero {
    width: auto;
    max-width: none;
    margin: 8px 8px 16px;
    margin-left: 8px;
    border-radius: var(--radius-xl);
    padding: 18px 20px;
    left: auto;
    right: auto;
    animation: rise 0.5s var(--ease) both;
  }

  .home-page__body.page-pad {
    padding-top: 8px;
  }

  .disc-header h1 {
    font-size: 2.4rem;
  }

  .topic-hero {
    height: 280px;
    border-radius: 24px 24px 0 0;
    margin: 8px 8px 0;
    overflow: hidden;
  }

  .topic-panel {
    margin: -56px 24px 0;
  }

  .tabs,
  .composer,
  .feed,
  .panel-block {
    margin-left: 24px;
    margin-right: 24px;
  }

  .modal-backdrop {
    place-items: center;
  }

  .modal-sheet {
    border-radius: var(--radius-xl);
  }

  .toast {
    bottom: 40px;
  }
}

@media (min-width: 1100px) {
  .cat-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

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