* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Arial, sans-serif; background: #0e1323; color: #e7ecf6; }
a { color: inherit; text-decoration: none; }
.topbar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: rgba(16,22,38,0.9); backdrop-filter: blur(10px); z-index: 50; border-bottom: 1px solid rgba(255,255,255,0.05); }
.logo { font-weight: 700; letter-spacing: 0.5px; }
.top-link { padding: 8px 12px; border-radius: 8px; background: rgba(255,255,255,0.06); }
.page { padding: 12px 12px calc(120px + env(safe-area-inset-bottom)); max-width: 1200px; margin: 0 auto; width: 100%; }
.section { margin-bottom: 16px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.05); border-radius: 14px; padding: 14px; }
.section h2 { margin: 0 0 10px; font-size: 18px; }

.pet-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 80px; background: #0c111e; border-top: 1px solid rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: space-between; padding: 0 14px; z-index: 150; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.pet-bottom-nav .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; color: #94a2c3; font-size: 12px; height: 100%; flex: 1; text-align: center; gap: 4px; }
.pet-bottom-nav .tab .icon { font-size: 18px; }
.pet-bottom-nav .tab.active { color: #58a6ff; font-weight: 600; }
.main-action { position: absolute; left: 50%; transform: translate(-50%, -24px); width: 68px; height: 68px; border-radius: 50%; border: none; background: linear-gradient(135deg, #2f8bff, #68c6ff); color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 28px rgba(47,139,255,0.45); cursor: pointer; z-index: 200; }

.main-action-menu { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.45); z-index: 200; }
.main-action-menu.active { display: flex; }
.menu-card { background: #10182b; padding: 18px; border-radius: 14px; width: 320px; border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 16px 32px rgba(0,0,0,0.5); }
.menu-title { margin: 0 0 10px; font-weight: 700; }
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.menu-item { padding: 12px; text-align: center; background: rgba(255,255,255,0.05); border-radius: 10px; }
.menu-item:hover { background: rgba(255,255,255,0.1); }
#closeMenu { width: 100%; padding: 10px; border: none; border-radius: 10px; background: #1f2b4d; color: #fff; }

.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; padding: 12px; }

.ai-hero { background: linear-gradient(135deg, #1a2f6f, #1e7ce2); color: #fff; border-radius: 16px; padding: 16px; display: grid; gap: 12px; }
.ai-hero__headings { display: grid; gap: 6px; }
.ai-hero__eyebrow { font-size: 13px; opacity: 0.9; }
.ai-hero__brandline { display: flex; gap: 10px; align-items: center; }
.ai-hero__logo { width: 64px; height: 64px; border-radius: 12px; background: #0d1224; display: flex; align-items: center; justify-content: center; font-weight: 800; letter-spacing: 0.5px; }
.ai-hero__titles { display: grid; gap: 4px; }
.ai-hero__sub { font-size: 14px; opacity: 0.92; }
.ai-hero__headline { font-size: 22px; font-weight: 800; }
.ai-hero .cta { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-hero input { flex: 1; padding: 12px; border: none; border-radius: 10px; min-width: 220px; }
.ai-hero button { padding: 12px 16px; border: none; border-radius: 10px; background: #0d1224; color: #fff; font-weight: 700; cursor: pointer; }

.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 10px; }
.ai-grid .item { cursor: pointer; border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08), rgba(255,255,255,0.03)); box-shadow: 0 8px 20px rgba(0,0,0,0.25); transition: transform 0.12s ease, box-shadow 0.12s ease; }
.ai-grid .item:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.3); }
.ai-grid .item:active { transform: translateY(0); }
.ai-grid .icon { display: flex; justify-content: center; }
.ico { width: 26px; height: 26px; color: #e7ecf6; }
.ico.sm { width: 18px; height: 18px; vertical-align: middle; }
.ai-grid .title { font-weight: 700; font-size: 15px; }
.ai-grid .desc { font-size: 13px; color: #b8c6df; }
.ai-grid .title { font-weight: 700; }
.ai-grid .desc { font-size: 13px; color: #b8c6df; }

.ai-subgrid { margin-top: 12px; display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.ai-subgrid .sub-item { flex: 0 0 auto; padding: 10px 14px; border-radius: 10px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

.tags-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.tag { padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,0.08); white-space: nowrap; }
.tag.active { background: #2f8bff; color: #fff; }

.masonry { column-count: 2; column-gap: 10px; }
.masonry .post { break-inside: avoid; margin-bottom: 10px; background: rgba(255,255,255,0.04); border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.05); position: relative; }
.post img { width: 100%; display: block; height: 200px; object-fit: cover; }
.post .badge { position: absolute; top: 10px; left: 10px; padding: 6px 10px; background: rgba(0,0,0,0.55); color: #fff; border-radius: 999px; font-size: 12px; }
.post .meta { padding: 10px; display: grid; gap: 6px; }
.post .meta .title { font-weight: 600; line-height: 1.35; }
.post .meta .stats { display: flex; align-items: center; justify-content: space-between; color: #9db1d3; font-size: 12px; }
.post .meta .stats .left { display: flex; align-items: center; gap: 8px; }
.post .meta .stats .dot { width: 4px; height: 4px; border-radius: 50%; background: #56617a; }
.post .meta .stats .right { display: flex; align-items: center; gap: 6px; }
.post .meta .stats .icon { font-size: 14px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.product { background: rgba(255,255,255,0.04); border-radius: 12px; padding: 10px; border: 1px solid rgba(255,255,255,0.05); }
.product img { width: 100%; height: 140px; object-fit: cover; border-radius: 10px; }
.price { color: #ffb347; font-weight: 700; }

.profile-card { display: grid; gap: 12px; }
.profile-top { display: flex; justify-content: space-between; align-items: center; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

@media (min-width: 768px) {
    .page { padding: 20px 24px calc(140px + env(safe-area-inset-bottom)); }
    .section { padding: 18px; margin-bottom: 18px; }
    .ai-hero { grid-template-columns: 1fr; }
    .ai-hero__brandline { gap: 14px; }
    .ai-hero__headline { font-size: 26px; }
    .masonry { column-count: 3; }
    .product-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .ai-grid { grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 14px; }
    .ai-grid .item { padding: 16px; }
    .ico { width: 30px; height: 30px; }
    .ico.sm { width: 20px; height: 20px; }
}

@media (min-width: 1200px) {
    .page { padding-left: 32px; padding-right: 32px; }
    .masonry { column-count: 4; }
    .ai-grid { grid-template-columns: repeat(4, 1fr); }
}
