/* ── 機關追蹤通知：浮動按鈕 + 面板 ─────────────────── */

.nw-fab {
    position: fixed;
    bottom: 84px;      /* 疊在「嗨！」(bottom:24 高48) 上方，留 12 間距 */
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
    z-index: 9000;
    transition: transform .15s, background .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nw-fab:hover { background: #1d4ed8; transform: scale(1.08); }

/* 紅點：含「!」，僅有新通知時顯示 */
.nw-fab-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    width: 18px;
    height: 18px;
    border-radius: 9px;
    display: none;            /* 預設不顯示 */
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.nw-fab-dot.show { display: flex; }

.nw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.3);
    z-index: 9001;
}
.nw-panel {
    position: fixed;
    bottom: 140px;
    right: 24px;
    width: 420px;
    max-height: 70vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    z-index: 9002;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.nw-panel.open { display: flex; }

.nw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}
.nw-header h3 { margin: 0; font-size: 15px; }
.nw-close { background: none; border: none; font-size: 22px; cursor: pointer; color: #666; line-height: 1; }

.nw-list { overflow-y: auto; padding: 8px 0; flex: 1; }
.nw-item {
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
}
.nw-item:hover { background: #f9fafb; }
.nw-item-title { font-size: 14px; color: #111; margin-bottom: 4px; }
.nw-item-meta { font-size: 12px; color: #888; }
.nw-empty { padding: 24px 16px; text-align: center; color: #999; font-size: 13px; }

/* 加入追蹤輸入區 */
.nw-add { border-top: 1px solid #e5e7eb; padding: 12px 16px; }
.nw-add-row { display: flex; gap: 6px; margin-bottom: 6px; }
.nw-add input {
    padding: 7px 9px; border: 1px solid #d1d5db;
    border-radius: 6px; font-size: 13px; box-sizing: border-box;
}
/* 機關框（較寬，含自動完成下拉）與單位框（較窄）同一行 */
.nw-org-wrap { position: relative; flex: 1.4; }
.nw-org-wrap input { width: 100%; }
#nwUnit { flex: 1; min-width: 0; }
.nw-add-btn {
    width: 100%; padding: 8px; background: #2563eb; color: #fff;
    border: none; border-radius: 6px; font-size: 13px; cursor: pointer;
}
.nw-add-btn:hover { background: #1d4ed8; }

/* 自動完成下拉 */
.nw-suggest {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border: 1px solid #d1d5db; border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.12); z-index: 9003;
    max-height: 180px; overflow-y: auto; display: none;
}
.nw-suggest.show { display: block; }
.nw-suggest-item { padding: 7px 10px; font-size: 13px; cursor: pointer; }
.nw-suggest-item:hover { background: #eff6ff; }

/* 目前追蹤清單（可展開） */
.nw-watches-toggle {
    width: 100%; padding: 10px 16px; background: #f9fafb;
    border: none; border-top: 1px solid #e5e7eb;
    font-size: 13px; cursor: pointer; color: #374151;
    display: flex; align-items: center; justify-content: space-between;
}
.nw-arrow { font-size: 10px; color: #9ca3af; }
.nw-watches { display: none; border-top: 1px solid #f3f4f6; }
.nw-watches.show { display: block; }
.nw-watch-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px; font-size: 13px; border-bottom: 1px solid #f3f4f6;
}
.nw-watch-del { background: none; border: none; color: #999; font-size: 18px; cursor: pointer; line-height: 1; }
.nw-watch-del:hover { color: #ef4444; }
