#ripScotNotices{
    padding: 1em 0;
}
#ripScotNotices.theme-dark{}
#ripScotNotices.theme-light{}
#ripScotNotices.theme-dark *{}
#ripScotNotices.light *{}
#ripScotNotices:before,
#ripScotNotices:after{}
#ripScotNotices:after{}
#ripScotNotices .notice{}
#ripScotNotices h3{}

/*** Added by Bubai ***/
/* ===== Base Theme Variables ===== */
    :root #ripScotNotices.theme-light {
      --bg: #f5f5f5;
      --card-bg: rgba(255, 255, 255, 0.85);
      --card-hover-bg: rgba(255, 255, 255, 0.95);
      --border-color: rgba(229, 231, 235, 0.7);
      --text-dark: #191975;
      --text-gray: #191975;
      --text-light: rgba(0, 0, 0, 0.5);
      --icon-bg: rgba(151, 94, 94, 0.1);
      --divider: rgba(0, 0, 0, 0.1);
      --shadow: rgba(0, 0, 0, 0.1);
      --toggle-bg: #e5e7eb;
      --toggle-color: #191975;
    }

    /* ===== Dark Theme Variables ===== */
    #ripScotNotices.grid.theme-dark {
      --bg: #191975;
      --card-bg: rgba(255, 255, 255, 0.1);
      --card-hover-bg: rgba(25, 25, 117, 0.9);
      --border-color: rgba(255, 255, 255, 0.2);
      --text-dark: #ffffff;
      --text-gray: #f1f1f8;
      --text-light: rgba(255, 255, 255, 0.5);
      --icon-bg: rgba(255, 255, 255, 0.1);
      --divider: rgba(255, 255, 255, 0.2);
      --shadow: rgba(0, 0, 0, 0.4);
      --toggle-bg: rgba(25, 25, 117, 0.9);
      --toggle-color: #ffffff;
    }

    /* ===== Global Styles ===== */

    #ripScotNotices * {
      box-sizing: border-box;
    }
    .rip-notice-fallback {
        color: #c40000;
        background: #f5dada;
        width: max-content;
        padding: 10px 15px;
        margin: 10px auto;
        max-width: 100%;
        line-height:1.3;
    }
    /* ===== Toggle Button ===== */
    #ripScotNotices .theme-toggle {
      position: fixed;
      top: 1rem;
      right: 1rem;
      background: var(--toggle-bg);
      color: var(--toggle-color);
      border: none;
      border-radius: 9999px;
      padding: 0.4rem 0.9rem;
      cursor: pointer;
      font-size: 0.8rem;
      font-weight: 600;
      transition: all 0.3s ease;
      box-shadow: 0 2px 6px var(--shadow);
      z-index: 10;
    }

    #ripScotNotices .theme-toggle:hover {
      transform: scale(1.05);
    }

    /* ===== Grid Layout ===== */
    #ripScotNotices.grid {
      display: flex;
      flex-wrap: wrap;
      padding:15px 0;
      margin-left: -8px;
      margin-right: -8px;
      color: var(--text-gray);
      transition: background-color 0.3s ease, color 0.3s ease;
      justify-content: center;
    }

    /* ===== Clickable Card ===== */
    #ripScotNotices .memorial-link {
      text-decoration: none;
      color: inherit;
      width: 100%;
      flex: 0 0 100%;
      padding: 8px;
    }

    #ripScotNotices .memorial-card {
      background-color: var(--bg);
      border: 1px solid var(--border-color);
      border-radius: 0.75rem;
      box-shadow: 0 6px 10px -2px var(--shadow);
      padding: 1rem;
      text-align: left;
      transition: all 0.3s ease;
      backdrop-filter: blur(10px);
      cursor: pointer;
      height: 100%;
      display: block;
    }

    #ripScotNotices .memorial-card:hover {
      transform: scale(1.02);
      background: var(--card-hover-bg);
    }

    #ripScotNotices .memorial-avatar {
      width: 6.5rem;
      height: 6.5rem;
      border-radius: 50%;
      overflow: hidden;
      box-shadow: 0 0 0 3px var(--border-color);
      margin-bottom: 0.9rem;
      margin-left: auto;
      margin-right: auto;
    }

    #ripScotNotices .memorial-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      filter: grayscale(100%);
      transition: filter 0.3s ease;
    }

    #ripScotNotices .memorial-card:hover .memorial-avatar img {
      filter: grayscale(0%);
    }

    #ripScotNotices .memorial-name {
      font-size: 1.1rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
      color: var(--text-dark);
      line-height: 1.4;
      text-align: center;
    }

    #ripScotNotices .divider {
      width: 100%;
      height: 1px;
      background: var(--divider);
      margin: 0.8rem 0 1rem;
    }

    #ripScotNotices .memorial-info {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      margin-bottom: 0.9rem;
    }

    #ripScotNotices .info-icon {
      background: var(--icon-bg);
      padding: 0.4rem;
      border-radius: 0.4rem;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    #ripScotNotices .info-icon svg {
      width: 17px;
      height: 17px;
      stroke: var(--text-gray);
    }

    #ripScotNotices .info-text p {
      margin: 0;
      font-size: 0.7rem;
      text-transform: uppercase;
      color: var(--text-light);
      letter-spacing: 0.05em;
      line-height: 1.2;
    }

    #ripScotNotices .info-text span {
      display: block;
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text-dark);
      line-height: 1.2;
    }

    @media (min-width: 768px) {
      #ripScotNotices .memorial-link {
        width: 50%;
        flex: 0 0 50%;
      }
    }

    @media (min-width: 992px) {
      #ripScotNotices .memorial-link {
        width: 33.33%;
        flex: 0 0 33.33%;
      }
    }

    @media (min-width: 1300px) {
      #ripScotNotices .memorial-link {
        width: 25%;
        flex: 0 0 25%;
      }
    }

    @media (max-width: 480px) {
      #ripScotNotices .memorial-card {
        padding: 0.9rem;
      }

      #ripScotNotices .memorial-avatar {
        width: 4.8rem;
        height: 4.8rem;
      }

      #ripScotNotices .memorial-name {
        font-size: 1rem;
      }
    }