/* 알림 카드 스타일 (위젯 + 설정 미리보기 공용) */
.nw-root {
  --fs: 1;
  --card-w: 520px;
  --radius: 22px;
  --bg-a: 0.9;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", "Malgun Gothic", sans-serif;
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  contain: layout paint;
}
.nw-root[data-v="top"]    { justify-content: flex-start; }
.nw-root[data-v="bottom"] { justify-content: flex-end; }
.nw-root[data-h="left"]   { align-items: flex-start; }
.nw-root[data-h="center"] { align-items: center; }
.nw-root[data-h="right"]  { align-items: flex-end; }

/* 테마 */
.nw-root[data-theme="light"] {
  --bg-rgb: 246, 246, 248; --fg: #1c1c1e; --sub: rgba(60, 60, 67, .62); --bd: rgba(0, 0, 0, .07);
  --shadow: 0 10px 30px rgba(0, 0, 0, .16), 0 1px 3px rgba(0, 0, 0, .08);
}
.nw-root[data-theme="dark"] {
  --bg-rgb: 30, 30, 32; --fg: #f5f5f7; --sub: rgba(235, 235, 245, .56); --bd: rgba(255, 255, 255, .09);
  --shadow: 0 12px 32px rgba(0, 0, 0, .42), 0 1px 3px rgba(0, 0, 0, .25);
}
.nw-root[data-theme="glass"] {
  --bg-rgb: 255, 255, 255; --fg: #fff; --sub: rgba(255, 255, 255, .78); --bd: rgba(255, 255, 255, .38);
  --shadow: 0 10px 30px rgba(0, 0, 0, .22);
}
.nw-root[data-theme="tint"] {
  --bg-rgb: 10, 132, 255; --fg: #fff; --sub: rgba(255, 255, 255, .78); --bd: rgba(255, 255, 255, .16);
  --shadow: 0 12px 30px rgba(0, 0, 0, .3);
}
.nw-root[data-shadow="off"] { --shadow: none; }

/* 높이 접힘/펼침 래퍼 (뒤 알림이 부드럽게 밀려남) */
.nw {
  display: grid;
  grid-template-rows: 0fr;
  width: min(var(--card-w), 100%);
  margin: 0;
  transition: grid-template-rows .42s cubic-bezier(.25, .9, .3, 1), margin .42s cubic-bezier(.25, .9, .3, 1);
}
.nw.in { grid-template-rows: 1fr; margin: calc(5px * var(--fs)) 0; }
.nw-h { min-height: 0; }

.nw-card {
  display: flex;
  align-items: center;
  gap: calc(12px * var(--fs));
  padding: calc(12px * var(--fs)) calc(16px * var(--fs)) calc(13px * var(--fs)) calc(13px * var(--fs));
  border-radius: var(--radius);
  background: rgba(var(--bg-rgb), var(--bg-a));
  color: var(--fg);
  box-shadow: var(--shadow), inset 0 0 0 .5px var(--bd);
  opacity: 0;
  transform: translateY(-28px) scale(.96);
  transition: transform .55s cubic-bezier(.3, 1.25, .55, 1), opacity .3s ease;
  will-change: transform, opacity;
}
.nw-root[data-v="bottom"] .nw-card { transform: translateY(28px) scale(.96); }
.nw-root[data-anim="fade"] .nw-card { transform: scale(.98); }
.nw.in .nw-card { opacity: 1; transform: none; }
.nw.out .nw-card { opacity: 0; transform: scale(.94); transition: transform .35s ease, opacity .3s ease; }

.nw-root[data-anim="none"] .nw,
.nw-root[data-anim="none"] .nw-card,
.nw.now, .nw.now .nw-card { transition: none !important; }

.nw-root[data-blur="on"] .nw-card {
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  backdrop-filter: blur(22px) saturate(1.6);
}
.nw-root[data-theme="glass"] .nw-card { text-shadow: 0 1px 2px rgba(0, 0, 0, .28); }

/* 앱 아이콘 */
.nw-ic {
  flex: none;
  width: calc(38px * var(--fs));
  height: calc(38px * var(--fs));
  border-radius: calc(9.5px * var(--fs));
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, var(--c1), var(--c));
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .18);
}
.nw-ic svg { width: 58%; height: 58%; }
.nw-root[data-theme="tint"] .nw-ic { background: rgba(255, 255, 255, .2); }
.nw-root[data-icon="off"] .nw-ic { display: none; }

.nw-bd { flex: 1; min-width: 0; }
.nw-hd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: calc(13px * var(--fs));
  line-height: 1.3;
  color: var(--sub);
  margin-bottom: calc(1px * var(--fs));
}
.nw-app { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nw-tm { flex: none; font-variant-numeric: tabular-nums; }
.nw-root[data-time="off"] .nw-tm { display: none; }
.nw-tt { font-size: calc(16px * var(--fs)); font-weight: 650; line-height: 1.3; }
.nw-ms {
  font-size: calc(16px * var(--fs));
  line-height: 1.36;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.nw-ms.solo { font-weight: 500; }
