/* ====== RESET & BASE ====== */
    *, *::before, *::after {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    html {
      -webkit-tap-highlight-color: transparent;
      overflow-x: hidden;
    }

    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      background-color: #fafafa;
      color: #262626;
      max-width: 480px;
      margin: 0 auto;
      min-height: 100vh;
      position: relative;
    }

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

    button {
      background: none;
      border: none;
      cursor: pointer;
      font-family: inherit;
      outline: none;
      -webkit-tap-highlight-color: transparent;
    }

    /* ====== HEADER ====== */
    .header {
      position: fixed;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 100%;
      max-width: 480px;
      height: 60px;
      background: #ffffff;
      border-bottom: 1px solid #dbdbdb;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 16px;
      z-index: 100;
    }

    .header-logo {
      font-family: 'Grand Hotel', cursive;
      font-size: 28px;
      color: #262626;
      letter-spacing: -0.5px;
    }

    .header-logo span {
      color: #E84855;
    }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 18px;
    }

    .header-actions svg {
      width: 24px;
      height: 24px;
      color: #262626;
    }

    /* ====== STORIES ====== */
    .stories-section {
      margin-top: 60px;
      background: #ffffff;
      border-bottom: 1px solid #dbdbdb;
      padding: 12px 0 12px 12px;
    }

    .stories-container {
      display: flex;
      gap: 16px;
      overflow-x: auto;
      scrollbar-width: none;
      -ms-overflow-style: none;
      padding-right: 12px;
    }

    .stories-container::-webkit-scrollbar {
      display: none;
    }

    .story-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
      cursor: pointer;
    }

    .story-ring {
      width: 66px;
      height: 66px;
      border-radius: 50%;
      padding: 3px;
      background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    }

    .story-ring.seen {
      background: #dbdbdb;
    }

    .story-ring.add-story {
      background: none;
      border: none;
      position: relative;
    }

    .story-avatar {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      border: 3px solid #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 18px;
      color: #ffffff;
    }

    .story-avatar.av-blue { background: linear-gradient(135deg, #667eea, #764ba2); }
    .story-avatar.av-green { background: linear-gradient(135deg, #11998e, #38ef7d); }
    .story-avatar.av-orange { background: linear-gradient(135deg, #f7971e, #ffd200); }
    .story-avatar.av-pink { background: linear-gradient(135deg, #ee9ca7, #ffdde1); color: #c44569; }
    .story-avatar.av-red { background: linear-gradient(135deg, #E84855, #f78ca2); }
    .story-avatar.av-teal { background: linear-gradient(135deg, #00b4db, #0083b0); }
    .story-avatar.av-purple { background: linear-gradient(135deg, #a18cd1, #fbc2eb); color: #6c5ce7; }
    .story-avatar.av-gray { background: #c7c7c7; }

    .story-add-btn {
      position: absolute;
      bottom: -2px;
      right: -2px;
      width: 22px;
      height: 22px;
      background: #0095f6;
      border: 2px solid #ffffff;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .story-add-btn svg {
      width: 12px;
      height: 12px;
      color: #ffffff;
    }

    .story-name {
      font-size: 11px;
      color: #8e8e8e;
      max-width: 66px;
      text-align: center;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .story-name.active {
      color: #262626;
    }

    /* ====== FEED ====== */
    .feed {
      padding-bottom: 70px;
    }

    /* ====== POST ====== */
    .post {
      background: #ffffff;
      border-bottom: 1px solid #dbdbdb;
      margin-bottom: 0;
    }

    .post:last-child {
      margin-bottom: 8px;
    }

    /* Post Header */
    .post-header {
      display: flex;
      align-items: center;
      padding: 12px 14px;
      gap: 10px;
    }

    .post-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 14px;
      color: #ffffff;
    }

    .post-user-info {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
    }

    .post-username {
      font-size: 14px;
      font-weight: 600;
      color: #262626;
      line-height: 1.2;
    }

    .post-location {
      font-size: 12px;
      color: #8e8e8e;
      line-height: 1.4;
    }

    .post-more-btn {
      padding: 8px;
    }

    .post-more-btn svg {
      width: 16px;
      height: 16px;
      color: #262626;
    }

    /* Post Image */
    .post-image-container {
      position: relative;
      width: 100%;
      aspect-ratio: 1 / 1;
      overflow: hidden;
      background: #efefef;
      user-select: none;
      -webkit-user-select: none;
    }

    .post-image-container img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    /* Double tap heart animation */
    .double-tap-heart {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(0);
      opacity: 0;
      pointer-events: none;
      z-index: 10;
    }

    .double-tap-heart svg {
      width: 80px;
      height: 80px;
      filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
    }

    .double-tap-heart.show {
      animation: doubleTapHeart 0.9s ease forwards;
    }

    @keyframes doubleTapHeart {
      0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
      15% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
      30% { transform: translate(-50%, -50%) scale(0.95); opacity: 1; }
      45%, 60% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
      100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
    }

    /* Adoption Badge */
    .adoption-badge {
      position: absolute;
      top: 12px;
      left: 12px;
      background: #E84855;
      color: #ffffff;
      font-size: 11px;
      font-weight: 600;
      padding: 4px 10px;
      border-radius: 4px;
      letter-spacing: 0.3px;
      text-transform: uppercase;
    }

    /* Post Actions */
    .post-actions {
      display: flex;
      align-items: center;
      padding: 8px 12px 0 12px;
      gap: 4px;
    }

    .action-btn {
      padding: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.15s ease;
    }

    .action-btn:active {
      transform: scale(0.85);
    }

    .action-btn svg {
      width: 24px;
      height: 24px;
    }

    .like-btn.liked .heart-icon {
      animation: likePopIn 0.35s ease;
    }

    @keyframes likePopIn {
      0% { transform: scale(1); }
      25% { transform: scale(1.3); }
      50% { transform: scale(0.9); }
      100% { transform: scale(1); }
    }

    .action-spacer {
      flex: 1;
    }

    .bookmark-btn svg {
      width: 22px;
      height: 22px;
    }

    /* Post Info */
    .post-likes {
      padding: 0 14px;
      margin-top: 4px;
    }

    .post-likes span {
      font-size: 14px;
      font-weight: 600;
      color: #262626;
    }

    .post-caption {
      padding: 4px 14px 0;
      line-height: 1.5;
    }

    .post-caption .caption-user {
      font-size: 14px;
      font-weight: 600;
      color: #262626;
      margin-right: 4px;
    }

    .post-caption .caption-text {
      font-size: 14px;
      color: #262626;
    }

    .post-caption .caption-tag {
      color: #00376b;
      font-weight: 500;
    }

    .post-comments-link {
      padding: 4px 14px 0;
    }

    .post-comments-link a {
      font-size: 14px;
      color: #8e8e8e;
      text-decoration: none;
    }

    .post-time {
      padding: 4px 14px 12px;
    }

    .post-time span {
      font-size: 11px;
      color: #8e8e8e;
      text-transform: uppercase;
      letter-spacing: 0.2px;
    }

    /* ====== BOTTOM NAV ====== */
    .bottom-nav {
      position: fixed;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 100%;
      max-width: 480px;
      height: 56px;
      background: #ffffff;
      border-top: 1px solid #dbdbdb;
      display: flex;
      align-items: center;
      justify-content: space-around;
      z-index: 100;
      padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      padding: 6px 12px;
      transition: opacity 0.15s ease;
      position: relative;
    }

    .nav-item:active {
      opacity: 0.5;
    }

    .nav-item svg {
      width: 26px;
      height: 26px;
      color: #262626;
    }

    .nav-item.active svg {
      color: #262626;
    }

    .nav-item .nav-label {
      font-size: 10px;
      color: #8e8e8e;
      font-weight: 500;
    }

    .nav-item.active .nav-label {
      color: #262626;
      font-weight: 600;
    }

    .nav-item.active::after {
      content: '';
      position: absolute;
      top: -1px;
      left: 50%;
      transform: translateX(-50%);
      width: 24px;
      height: 2px;
      background: #262626;
      border-radius: 1px;
    }

    .nav-create-btn {
      width: 28px;
      height: 28px;
      border: 2px solid #262626;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .nav-create-btn svg {
      width: 16px;
      height: 16px;
    }

    /* ====== SCROLLBAR ====== */
    @media (max-width: 480px) {
      ::-webkit-scrollbar {
        width: 0;
      }
    }

    /* ====== SEPARATOR LINE ====== */
    .feed-separator {
      height: 6px;
      background: #fafafa;
    }

    /* ====== LOADING ANIMATION (optional page load) ====== */
    .page-loader {
      position: fixed;
      inset: 0;
      background: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 9999;
      transition: opacity 0.3s ease;
    }

    .page-loader.hidden {
      opacity: 0;
      pointer-events: none;
    }

    .page-loader .loader-logo {
      font-family: 'Grand Hotel', cursive;
      font-size: 42px;
      color: #262626;
      animation: loaderPulse 1s ease infinite;
    }

    .page-loader .loader-logo span {
      color: #E84855;
    }

    @keyframes loaderPulse {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.6; transform: scale(0.97); }
    }

    /* ====== STORY VIEWER ====== */
    .story-viewer {
      position: fixed;
      inset: 0;
      background: #000000;
      z-index: 300;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease;
    }

    .story-viewer.active {
      opacity: 1;
      pointer-events: auto;
    }

    /* Progress bar */
    .story-progress {
      position: absolute;
      top: 8px;
      left: 12px;
      right: 12px;
      z-index: 10;
    }

    .story-progress-bar {
      width: 100%;
      height: 3px;
      background: rgba(255, 255, 255, 0.3);
      border-radius: 3px;
      overflow: hidden;
    }

    .story-progress-fill {
      width: 0%;
      height: 100%;
      background: #ffffff;
      border-radius: 3px;
      transition: width 0.1s linear;
    }

    /* Header */
    .story-viewer-header {
      position: absolute;
      top: 18px;
      left: 12px;
      right: 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      z-index: 10;
    }

    .story-viewer-user {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .story-viewer-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      border: 2px solid #ffffff;
    }

    .story-viewer-username {
      font-size: 14px;
      font-weight: 600;
      color: #ffffff;
      text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    }

    .story-viewer-close {
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      transition: background 0.15s ease;
    }

    .story-viewer-close:hover {
      background: rgba(255, 255, 255, 0.15);
    }

    .story-viewer-close svg {
      width: 24px;
      height: 24px;
      color: #ffffff;
      filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
    }

    /* Image */
    .story-viewer-img {
      width: 100%;
      max-width: 480px;
      max-height: 85vh;
      object-fit: cover;
      border-radius: 8px;
      user-select: none;
      -webkit-user-select: none;
    }

    /* Caption */
    .story-viewer-caption {
      position: absolute;
      bottom: 80px;
      left: 16px;
      right: 16px;
      color: #ffffff;
      font-size: 15px;
      font-weight: 500;
      text-align: center;
      text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
      line-height: 1.5;
    }

    /* Actions */
    .story-viewer-actions {
      position: absolute;
      bottom: 24px;
      left: 0;
      right: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10;
    }

    .story-viewer-like {
      width: 48px;
      height: 48px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.1);
      transition: transform 0.15s ease, background 0.15s ease;
    }

    .story-viewer-like:active {
      transform: scale(0.85);
    }

    .story-viewer-like:hover {
      background: rgba(255, 255, 255, 0.2);
    }

    .story-viewer-like.liked {
      animation: storyLikePop 0.35s ease;
    }

    @keyframes storyLikePop {
      0% { transform: scale(1); }
      25% { transform: scale(1.3); }
      50% { transform: scale(0.9); }
      100% { transform: scale(1); }
    }

    /* Tap zones for prev/next */
    .story-tap-left,
    .story-tap-right {
      position: absolute;
      top: 60px;
      bottom: 100px;
      width: 35%;
      z-index: 5;
      cursor: pointer;
    }

    .story-tap-left {
      left: 0;
    }

    .story-tap-right {
      right: 0;
    }

    /* ====== NOTIFICATION POPUP ====== */
    .notif-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.5);
      z-index: 200;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease;
    }

    .notif-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }

    .notif-popup {
      background: #ffffff;
      width: 90%;
      max-width: 380px;
      border-radius: 16px;
      overflow: hidden;
      transform: scale(0.9) translateY(20px);
      transition: transform 0.25s ease;
    }

    .notif-overlay.active .notif-popup {
      transform: scale(1) translateY(0);
    }

    .notif-header {
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      padding: 16px 20px;
      border-bottom: 1px solid #efefef;
    }

    .notif-title {
      font-size: 16px;
      font-weight: 700;
      color: #262626;
    }

    .notif-close {
      position: absolute;
      right: 14px;
      top: 50%;
      transform: translateY(-50%);
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      transition: background 0.15s ease;
    }

    .notif-close:hover {
      background: #f0f0f0;
    }

    .notif-close svg {
      width: 20px;
      height: 20px;
      color: #262626;
    }

    .notif-body {
      padding: 40px 20px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .notif-empty {
      font-size: 15px;
      color: #8e8e8e;
      text-align: center;
    }

    /* ====== RESPONSIVE ====== */

    /* Desktop wrapper effect */
    @media (min-width: 481px) {
      html {
        background: #e8e8e8;
      }

      body {
        border-left: 1px solid #dbdbdb;
        border-right: 1px solid #dbdbdb;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
        position: relative;
      }

      .header {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
      }

      .bottom-nav {
        box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.06);
      }
    }

    /* Larger desktop: show phone-like frame */
    @media (min-width: 769px) {
      html {
        background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
      }

      body {
        margin: 0 auto;
        border-left: 1px solid #d0d0d0;
        border-right: 1px solid #d0d0d0;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
      }

      .notif-popup {
        max-width: 400px;
      }
    }
