/* Install QR — 共用樣式 */
.install-qr-btn {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #4b5563;
  padding: 7px 11px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 120ms cubic-bezier(.22,.61,.36,1), border-color 120ms cubic-bezier(.22,.61,.36,1), color 120ms cubic-bezier(.22,.61,.36,1);
  white-space: nowrap;
  flex-shrink: 0;
}
.install-qr-btn:hover {
  background: #f0f2f6;
  border-color: #d1d5db;
  color: #1a1d24;
}
.install-qr-modal {
  position: fixed; inset: 0;
  background: rgba(15,25,50,.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 500;
  padding: 24px;
}
.install-qr-modal[hidden] { display: none !important; }
.install-qr-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 24px 56px rgba(15,25,50,.18), 0 4px 12px rgba(15,25,50,.08);
  text-align: center;
  position: relative;
}
.install-qr-close {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px;
  background: transparent; border: 0;
  font-size: 20px; line-height: 1;
  color: #6b7280;
  cursor: pointer;
  border-radius: 6px;
}
.install-qr-close:hover { background: #f0f2f6; color: #1a1d24; }
.install-qr-card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; color: #1a1d24; }
.install-qr-card p { margin: 0 0 16px; color: #6b7280; font-size: 13px; }
.install-qr-canvas-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  display: inline-block;
  margin-bottom: 12px;
}
[data-install-qr-canvas] { display: block; max-width: 100%; }
[data-install-qr-canvas][hidden] { display: none; }
[data-install-qr-url] {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 10px;
  word-break: break-all;
}
[data-install-qr-copy] {
  margin-bottom: 14px;
  padding: 6px 14px;
  background: #f0f2f6;
  border: 1px solid #e5e7eb;
  color: #1a1d24;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 120ms;
}
[data-install-qr-copy]:hover { background: #e5e7eb; }
.install-qr-instructions {
  text-align: left;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.7;
  background: #f0f2f6;
  padding: 10px 14px;
  border-radius: 8px;
}
.install-qr-instructions strong { color: #1a1d24; font-weight: 600; }
@media (max-width: 768px) {
  [data-install-qr-btn] { display: none !important; }
}

/* Test notification button (前後台共用) */
.test-notif-btn {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #4b5563;
  padding: 6px 11px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 120ms cubic-bezier(.22,.61,.36,1), border-color 120ms cubic-bezier(.22,.61,.36,1), color 120ms cubic-bezier(.22,.61,.36,1);
}
.test-notif-btn:hover { background: #f0f2f6; border-color: #d1d5db; color: #1a1d24; }
/* 手機上仍可見 — 避免被 admin header-btn 隱藏規則蓋過 */
@media (max-width: 768px) {
  .admin-header-right .test-notif-btn { display: inline-flex !important; padding: 5px 8px; font-size: 12px; }
  .topbar-nav .test-notif-btn { padding: 5px 8px; font-size: 12px; }
}

/* ---- Notification Status Modal ---- */
.notif-status-modal {
  position: fixed; inset: 0;
  background: rgba(15,25,50,.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 510;
  padding: 24px;
}
.notif-status-modal[hidden] { display: none !important; }
.notif-status-card {
  background: #fff;
  border-radius: 16px;
  padding: 22px 22px 18px;
  max-width: 380px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 24px 56px rgba(15,25,50,.18), 0 4px 12px rgba(15,25,50,.08);
  position: relative;
  text-align: left;
  font-size: 14px;
  line-height: 1.55;
}
.notif-status-close {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px;
  background: transparent; border: 0;
  font-size: 20px; line-height: 1;
  color: #6b7280;
  cursor: pointer;
  border-radius: 6px;
}
.notif-status-close:hover { background: #f0f2f6; color: #1a1d24; }
.notif-status-card h3 {
  margin: 0 0 4px;
  font-size: 17px; font-weight: 600;
  color: #1a1d24;
  text-align: center;
}
.notif-status-sub {
  margin: 0 0 14px;
  color: #6b7280;
  font-size: 13px;
  text-align: center;
}

/* status list */
.notif-status-list {
  list-style: none; margin: 0 0 12px; padding: 0;
  display: grid; gap: 6px;
}
.notif-status-list .notif-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f0f2f6;
  font-size: 13px;
  color: #4b5563;
}
.notif-row-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  color: #fff;
  line-height: 1;
}
.notif-row.ok    { background: #e8f7ef; color: #1f5d3a; }
.notif-row.ok    .notif-row-icon { background: #16a34a; }
.notif-row.warn  { background: #fff5dc; color: #8a5a08; }
.notif-row.warn  .notif-row-icon { background: #d97706; }
.notif-row.bad   { background: #fde6e6; color: #9a1f1f; }
.notif-row.bad   .notif-row-icon { background: #dc2626; }
.notif-row-text b {
  display: block;
  font-weight: 600;
  color: inherit;
}
.notif-row-text small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: inherit;
  opacity: .85;
  line-height: 1.5;
}

/* iOS large tip box */
.notif-status-tip {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: #fff5dc;
  border: 1px solid #f5d68d;
  border-radius: 10px;
  color: #8a5a08;
  font-size: 13px;
}
.notif-status-tip strong { display: block; margin-bottom: 4px; color: #6b3f04; }
.notif-status-tip p { margin: 0 0 6px; }
.notif-status-tip ol { margin: 0; padding-left: 18px; }
.notif-status-tip li { margin: 2px 0; }

/* always-visible rules */
.notif-status-rules {
  background: #f0f2f6;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.notif-status-rules strong {
  display: block;
  color: #1a1d24;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
}
.notif-status-rules ul {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid; gap: 6px;
}
.notif-status-rules li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.55;
}
.notif-status-rules .rule-ic {
  font-size: 14px; line-height: 1.4;
}
.notif-status-rules b { font-weight: 600; color: #1a1d24; }
.notif-status-note {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px dashed #d1d5db;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.6;
}
.notif-status-note b { color: #1a1d24; font-weight: 600; }

/* test button */
.notif-status-test {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: #1a1d24;
  color: #fff;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms cubic-bezier(.22,.61,.36,1), transform 120ms;
}
.notif-status-test:hover:not(:disabled) { background: #2d3340; }
.notif-status-test:active:not(:disabled) { transform: scale(.98); }
.notif-status-test:disabled { opacity: .55; cursor: not-allowed; }

.notif-status-result {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.notif-status-result.ok   { background: #e8f7ef; color: #1f5d3a; }
.notif-status-result.warn { background: #fff5dc; color: #8a5a08; }
.notif-status-result.bad  { background: #fde6e6; color: #9a1f1f; }

@media (max-width: 480px) {
  .notif-status-card { padding: 18px 16px 14px; }
  .notif-status-card h3 { font-size: 16px; }
  .notif-status-sub { font-size: 12px; }
  .notif-status-list .notif-row { font-size: 12.5px; padding: 7px 9px; }
  .notif-status-rules { padding: 10px 12px; }
}

/* admin 進階測試區（只有 admin 看到） */
.notif-status-admin {
  margin-top: 14px;
  padding: 12px 14px;
  background: #eef4ff;
  border: 1px solid #cfe0ff;
  border-radius: 10px;
  font-size: 13px;
  color: #1e3a8a;
  line-height: 1.55;
}
.notif-status-admin[hidden] { display: none !important; }
.notif-status-admin strong { display: block; margin-bottom: 4px; color: #1e3a8a; font-weight: 600; }
.notif-status-admin p { margin: 0 0 10px; color: #3454a3; font-size: 12.5px; }
.notif-status-admin b { font-weight: 600; }
.notif-status-push-test {
  display: block; width: 100%;
  padding: 9px 12px;
  background: #2563eb;
  color: #fff;
  border: 0; border-radius: 8px;
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background 120ms cubic-bezier(.22,.61,.36,1), transform 120ms;
}
.notif-status-push-test:hover:not(:disabled) { background: #1d4ed8; }
.notif-status-push-test:active:not(:disabled) { transform: scale(.98); }
.notif-status-push-test:disabled { opacity: .55; cursor: not-allowed; }
.notif-status-push-result {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.notif-status-push-result.ok   { background: #e8f7ef; color: #1f5d3a; }
.notif-status-push-result.warn { background: #fff5dc; color: #8a5a08; }
.notif-status-push-result.bad  { background: #fde6e6; color: #9a1f1f; }


