/* note_views.css — รูปแบบการแสดงโน้ต 5 แบบ (ใช้ร่วมกันทุกหน้าโน้ต + เว็บโน้ต)
   1 = การ์ด (ค่าเริ่มต้น เดิม ไม่แตะ)   2 = List   3 = Detail   4 = Grid 2 คอลัมน์   5 = Grid 3 คอลัมน์
   หลักการ: ทุกโน้ตมีแถบสรุป .nv-sum (สร้างโดย note_views.js) ซ่อนไว้เสมอ
            เมื่อ container (.nv-list) มี data-nv = 2..5 โน้ตที่ยังไม่เปิดจะซ่อนเนื้อหาเดิมทั้งหมด เหลือแต่ .nv-sum
            กดแล้วใส่ .nv-open → กลับเป็นการ์ดเต็มแบบเดิม (ในแกรนด์ = กว้างเต็มแถว ยังอยู่ในกริดเดิม) */

/* ---------- แถบปุ่มเลือกรูปแบบ ---------- */
.nv-bar { display: none; gap: 6px; margin: 0 0 12px; --nv-fg: #a65200; --nv-accent: #ff7a00; --nv-on: #ffffff; }
.nv-bar.show { display: flex; }
.nv-btn { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px;
          border-radius: 10px; border: 1px solid var(--nv-fg); background: transparent; color: var(--nv-fg);
          font-size: 10.5px; line-height: 1.25; cursor: pointer; opacity: .8; -webkit-tap-highlight-color: transparent; }
.nv-btn .i { font-size: 15px; line-height: 1.2; }
.nv-btn.on { background: var(--nv-accent); border-color: var(--nv-accent); color: var(--nv-on); opacity: 1; font-weight: bold; }
body.profile-mode .nv-bar { --nv-fg: #9ff; --nv-accent: #00fff2; --nv-on: #06060f; }
body.main-profile-mode .nv-bar { --nv-fg: #8fa3c8; --nv-accent: #7b5cff; --nv-on: #ffffff; }
body.bt-on:not(.profile-mode):not(.main-profile-mode) .nv-bar { --nv-fg: var(--bt-text); --nv-accent: var(--bt-link); --nv-on: var(--bt-card); }

/* ---------- สีข้อความ/ป้ายในแถบสรุป ---------- */
.nv-sum { color: var(--nv-sum-fg, #333); }
body.profile-mode .nv-list, body.main-profile-mode .nv-list { --nv-sum-fg: #e8e8ff; }
body.bt-on:not(.profile-mode):not(.main-profile-mode) .nv-list { --nv-sum-fg: var(--bt-text); }
.nv-room { color: #d95e00; }
body.profile-mode .nv-room { color: #00fff2; }
body.main-profile-mode .nv-room { color: #9d86ff; }
body.bt-on:not(.profile-mode):not(.main-profile-mode) .nv-room { color: var(--bt-link); }

/* ---------- ส่วนประกอบของแถบสรุป (ซ่อนจนกว่าจะอยู่ในโหมด 2-5) ---------- */
.nv-sum { display: none; align-items: center; gap: 8px; padding: 9px 12px; text-align: left; min-width: 0; cursor: pointer;
          -webkit-tap-highlight-color: transparent; }
.nv-av { grid-area: av; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: rgba(128,128,128,.25);
         display: flex; align-items: center; justify-content: center; font-size: 13px; }
.nv-txt { grid-area: txt; flex: 1 1 auto; min-width: 0; font-size: 13.5px; line-height: 1.45; color: inherit; overflow: hidden;
          display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; word-break: break-word; overflow-wrap: anywhere; }
.nv-txt.empty { opacity: .6; font-style: italic; }
.nv-pin { margin-right: 3px; font-size: 12px; }
.nv-ic { grid-area: ic; flex: 0 0 auto; display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.nv-new { padding: 0 6px; border-radius: 999px; font-size: 10px; font-weight: 800; background: rgba(255,201,51,.25);
          color: #b27f00; border: 1px solid rgba(255,201,51,.8); }
body.profile-mode .nv-new, body.main-profile-mode .nv-new { color: #ffc933; }
.nv-room { grid-area: room; flex: 0 1 auto; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; }
.nv-seq { grid-area: seq; flex: 0 0 auto; margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 6px;
          background: var(--seq-bg, #ff7a00); color: var(--seq-fg, #ffffff); font-size: 11.5px; font-weight: 800;
          display: flex; align-items: center; justify-content: center; }
/* ตัวคั่นเดือน/ปี */
.nv-month { grid-column: 1 / -1; margin: 4px 2px 8px; padding-bottom: 3px; font-size: 12.5px; font-weight: 800; letter-spacing: .2px;
            border-bottom: 1px solid currentColor; color: #d95e00; }
body.profile-mode .nv-month { color: #00fff2; }
body.main-profile-mode .nv-month { color: #9d86ff; }
body.bt-on:not(.profile-mode):not(.main-profile-mode) .nv-month { color: var(--bt-link); }
.nv-list[data-nv]:not([data-nv="1"]) > .nv-month { margin: 2px 2px 0; }

/* ---------- container ตามโหมด ---------- */
.nv-list[data-nv="2"]:not([style*="none"]),
.nv-list[data-nv="3"]:not([style*="none"]) { display: flex !important; flex-direction: column; gap: 8px; }
.nv-list[data-nv="4"]:not([style*="none"]) { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.nv-list[data-nv="5"]:not([style*="none"]) { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }

/* ---------- โน้ตในโหมด 2-5 ---------- */
.nv-list[data-nv]:not([data-nv="1"]) > .nv-item { margin: 0 !important; min-width: 0; }
.nv-list[data-nv]:not([data-nv="1"]) > .nv-item.nv-open { grid-column: 1 / -1; }
.nv-list[data-nv]:not([data-nv="1"]) > .nv-item.nv-open { cursor: pointer; }
.nv-list[data-nv]:not([data-nv="1"]) > .nv-item:not(.nv-open) {
    padding: 0 !important; cursor: pointer; border-radius: 14px; overflow: hidden;
    -webkit-clip-path: none; clip-path: none;
}
.nv-list[data-nv]:not([data-nv="1"]) > .nv-item:not(.nv-open)::after { display: none !important; }
.nv-list[data-nv]:not([data-nv="1"]) > .nv-item:not(.nv-open) > :not(.nv-sum) { display: none !important; }

/* List / Detail: แถวเดียว  avatar | ข้อความ | ไอคอน | ห้อง | เลขโน้ต */
.nv-list[data-nv="2"] > .nv-item:not(.nv-open) > .nv-sum,
.nv-list[data-nv="3"] > .nv-item:not(.nv-open) > .nv-sum { display: flex; }
.nv-list[data-nv="3"] .nv-txt { -webkit-line-clamp: 3; }
.nv-list[data-nv="3"] > .nv-item:not(.nv-open) > .nv-sum { padding: 12px; }

/* Grid: กระเบื้อง  [avatar ห้อง เลข] / ข้อความ / ไอคอน */
.nv-list[data-nv="4"] > .nv-item:not(.nv-open) > .nv-sum,
.nv-list[data-nv="5"] > .nv-item:not(.nv-open) > .nv-sum {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto;
    grid-template-areas: "av room seq" "txt txt txt" "ic ic ic";
    gap: 6px; padding: 9px; height: 100%; min-height: 96px; box-sizing: border-box; align-items: center;
}
.nv-list[data-nv="4"] .nv-txt, .nv-list[data-nv="5"] .nv-txt { align-self: start; -webkit-line-clamp: 4; font-size: 13px; }
.nv-list[data-nv="5"] .nv-txt { font-size: 11.5px; line-height: 1.4; }
.nv-list[data-nv="4"] .nv-room, .nv-list[data-nv="5"] .nv-room { justify-self: start; }
.nv-list[data-nv="4"] .nv-ic, .nv-list[data-nv="5"] .nv-ic { align-self: end; }
.nv-list[data-nv="5"] > .nv-item:not(.nv-open) > .nv-sum { padding: 7px; gap: 5px; }
