/* Notes from Karl: the header lightbulb and mailbox (karl-notes.js) — Karl's hand-off item 15.
   From Karl's prototype style.css. The mailbox is appended to <body>, outside .karl-shell, so
   these rules carry their own colours rather than reading the shell's custom properties. */
.karl-shell .kn-bulb { position: relative; }
.karl-shell .kn-bulb svg { width: 26px; height: 26px; fill: none; stroke: none; }
.kn-count { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; font: 700 12px/20px 'Poppins', sans-serif; color: #fff; background: #e3262f; box-shadow: 0 0 0 2px #fff; }
.kn-count[hidden] { display: none; }
.karl-shell .kn-bulb.is-new svg { animation: kn-wiggle 2.4s ease-in-out infinite; transform-origin: 50% 85%; }
@keyframes kn-wiggle {
  0%, 60%, 100% { transform: rotate(0); }
  64% { transform: rotate(-14deg); }
  70% { transform: rotate(12deg); }
  76% { transform: rotate(-9deg); }
  82% { transform: rotate(6deg); }
  88% { transform: rotate(-3deg); }
}
@media (prefers-reduced-motion: reduce) { .karl-shell .kn-bulb.is-new svg { animation: none; } }

.kn-shade { position: fixed; inset: 0; z-index: 92; display: flex; align-items: flex-start; justify-content: center; padding: 70px 16px 16px; font-family: 'Poppins', system-ui, sans-serif; line-height: 1.55; color: #1b2436; background: rgba(9, 23, 54, 0.5); }
.kn-shade[hidden] { display: none; }
.kn-shade *, .kn-shade *::before, .kn-shade *::after { box-sizing: border-box; }
.kn-box { display: flex; flex-direction: column; width: 100%; max-width: 560px; max-height: calc(100vh - 90px); border-radius: 16px; background: #fff; box-shadow: 0 20px 50px rgba(9, 23, 54, 0.35); }
.kn-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 10px; border-bottom: 1px solid #e3e9f3; }
.kn-top h2 { margin: 0; font-family: 'Permanent Marker', 'Comic Sans MS', cursive; font-weight: 400; font-size: 26px; color: #14305c; }
.kn-x { border: 0; background: none; font-size: 30px; line-height: 1; color: #14305c; cursor: pointer; }
.kn-view { flex: 1 1 auto; overflow: auto; padding: 14px 20px; }
.kn-foot { margin: 0; padding: 10px 20px 14px; border-top: 1px solid #e3e9f3; font-size: 14px; font-weight: 600; }
.kn-foot a { color: #1f6fe0; }
.kn-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.kn-row { display: grid; gap: 2px; width: 100%; padding: 10px 12px; border: 1px solid #e3e9f3; border-radius: 10px; text-align: left; font: inherit; color: #14305c; background: #fff; cursor: pointer; }
.kn-row:hover { background: #f5f8fd; }
.kn-row.is-new { border-color: #ffc72c; background: #fffbea; }
.kn-row-title { font-weight: 700; }
.kn-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: #55607a; }
.kn-type { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: #1f6fe0; }
.kn-type.kn-tip { background: #2f8a4c; }
.kn-type.kn-news { background: #c0392b; }
.kn-new { padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #14305c; background: #ffc72c; }
.kn-back { margin: 0 0 8px; padding: 0; border: 0; background: none; font: 600 14px 'Poppins', sans-serif; color: #1f6fe0; cursor: pointer; }
.kn-title { margin: 6px 0 8px; font-size: 21px; line-height: 1.25; color: #14305c; }
.kn-photo { display: block; width: 100%; max-height: 260px; margin: 0 0 10px; border-radius: 10px; object-fit: cover; }
.kn-body { margin: 0 0 10px; line-height: 1.55; }
.kn-body p { margin: 0 0 10px; }
.kn-body a { color: #1f6fe0; }
.kn-video { display: block; width: 100%; aspect-ratio: 16 / 9; margin: 0 0 10px; border: 0; border-radius: 10px; }
.kn-sign { margin: 0 0 12px; font-family: 'Permanent Marker', 'Comic Sans MS', cursive; font-size: 18px; color: #14305c; }
.kn-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 6px 18px; border: 0; border-radius: 999px; font: 700 15px 'Poppins', sans-serif; text-decoration: none; cursor: pointer; }
.kn-btn-yellow { color: #14305c; background: #ffc72c; }
.kn-btn-navy { color: #fff; background: #14305c; }
.kn-btn:disabled { opacity: .6; cursor: default; }
.kn-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.kn-tool { padding: 7px 14px; border: 1px solid #c9d4e6; border-radius: 999px; font: 600 14px 'Poppins', sans-serif; color: #14305c; background: #fff; cursor: pointer; }
.kn-tool.is-on { border-color: #14305c; color: #fff; background: #14305c; }
.kn-del { margin-left: auto; color: #b3261e; }
.kn-reply { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #e3e9f3; }
.kn-field { display: grid; gap: 4px; font-weight: 600; font-size: 14px; color: #14305c; }
.kn-reply textarea { width: 100%; padding: 8px 10px; border: 1px solid #c9d4e6; border-radius: 10px; font: 400 15px 'Poppins', sans-serif; }
.kn-reply .kn-btn { justify-self: start; }
.kn-problem { margin: 0; font-weight: 600; color: #b3261e; }
.kn-problem[hidden] { display: none; }
.kn-sent, .kn-msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font-weight: 600; color: #1d5e33; background: #e8f5ec; }
.kn-msg { margin: 0 0 10px; }
.kn-empty { margin: 8px 0; }
@media (max-width: 640px) {
  .kn-shade { align-items: flex-end; padding: 0; }
  .kn-box { max-height: 88vh; border-radius: 18px 18px 0 0; }
}
