 :root {
      
      --border-soft: #EDE8E2;
      --accent:      #1C4A3B;
      --accent-lt:   #E6F0EC;
      --text:        #1A1916;
      --muted:       #6E6860;
      --notice-radius:      16px;
    }

.modal {
    display: flex; /* keep it always flex */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;

    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;

    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 700px;
    min-width: unset;
    width: 100%;
    max-height: 95vh;   /* allow more vertical space */
    min-height: 65vh;
    overflow-y: auto;

    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.open .modal-content {
    transform: translateY(0);
}

/* header */
    .modal-head {
      padding: 1.2rem 1.4rem 1.1rem;
      border-bottom: 1px solid var(--border-soft);
      display: flex; align-items: center; justify-content: space-between;
      flex-shrink: 0;
    }
    .head-left { display: flex; align-items: center; gap: .65rem; }
    .bell-wrap {
      width: 36px; height: 36px; border-radius: 10px;
      background: var(--accent-lt);
      display: flex; align-items: center; justify-content: center;
    }
    .bell-wrap svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 1.8; }
    .modal-title {
      font-family: 'Playfair Display', serif;
      font-size: 1.15rem; color: var(--text);
    }
    .badge-count {
      font-size: .72rem; font-weight: 600;
      background: var(--accent); color: #fff;
      border-radius: 20px; padding: 2px 8px;
    }
    .btn-close {
      width: 30px; height: 30px; border-radius: 7px;
      border: 1px solid var(--border); background: transparent;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; color: var(--muted);
      transition: background .14s, color .14s;
    }
    .btn-close:hover { background: var(--border-soft); color: var(--text); }
    .btn-close svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }

    /* scrollable list */
    .modal-body {
      overflow-y: auto; 
      flex: 1;
      padding: 1.1rem 1.4rem;
      display: flex; 
      flex-direction: column; 
      gap: .85rem;
      scrollbar-width: thin;
      scrollbar-color: var(--border) transparent;
    }
    .modal-body::-webkit-scrollbar { width: 4px; }
    .modal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

    /* notice card */
    .notice {
      border-radius: 12px;
      border: 1px solid var(--border-soft);
      overflow: hidden;
      transition: border-color .15s, box-shadow .15s;
      position: relative;
    }
    .notice:hover {
      border-color: var(--border);
      box-shadow: 0 3px 14px rgba(0,0,0,.07);
    }
    .notice.unread { border-color: var(--border); }
    .notice.unread::before {
      content: '';
      position: absolute; left: 0; top: 0; bottom: 0;
      width: 3px; background: var(--accent);
      z-index: 1;
    }

    /* text notice */
    .notice-text-inner {
      padding: .95rem 1.1rem .95rem 1.25rem;
      display: flex; gap: .85rem; align-items: flex-start;
    }
    .notice.unread .notice-text-inner { padding-left: 1.5rem; }

    .notice-num {
      width: 28px; height: 28px; border-radius: 7px;
      background: var(--accent-lt);
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
      font-size: .72rem; font-weight: 600; color: var(--accent);
    }

    .notice-content { flex: 1; min-width: 0; }
    .notice-header {
      display: flex; align-items: baseline;
      justify-content: space-between; gap: .5rem;
      margin-bottom: .3rem;
    }
    .notice-heading {
      font-size: .93rem; font-weight: 600; color: var(--text); line-height: 1.4;
    }
    .notice-date { font-size: .73rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
    .notice-body-text {
      font-size: .86rem; color: var(--muted); line-height: 1.65;
    }

    /* image notice */
    .notice-img-wrap { position: relative; }
    .notice-img-wrap img {
      display: block; 
      width: 100%;
  height: auto;
  max-height: none;   /* remove restriction */
  object-fit: contain; /* keeps full image visible */
    }
    .notice-img-caption {
      padding: .75rem 1.1rem .8rem 1.25rem;
      display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    }
    .notice.unread .notice-img-caption { padding-left: 1.5rem; }

    .img-tag {
      position: absolute; top: 10px; right: 10px;
      background: rgba(0,0,0,.52); color: #fff;
      font-size: .69rem; font-weight: 500; letter-spacing: .3px;
      padding: 3px 9px; border-radius: 20px;
    }

    .unread-dot {
      width: 7px; height: 7px; border-radius: 50%;
      background: var(--accent); flex-shrink: 0;
    }

    /* footer */
    .modal-foot {
      padding: .85rem 1.4rem;
      border-top: 1px solid var(--border-soft);
      display: flex; align-items: center; justify-content: space-between;
      flex-shrink: 0;
    }
    .foot-note { font-size: .8rem; color: var(--muted); }
    .btn-mark {
      padding: .5rem 1.1rem;
      background: var(--accent); color: #fff;
      border: none; border-radius: 8px;
      font-family: 'DM Sans', sans-serif; font-size: .85rem; font-weight: 500;
      cursor: pointer; transition: opacity .15s;
    }
    .btn-mark:hover { opacity: .85; }

    /* empty */
    .empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
    .empty svg { width: 36px; height: 36px; stroke: var(--border); display: block; margin: 0 auto .75rem; fill: none; }