/* Oshi notification center: header bell and panel. */
.oshi-bell { position: relative; display: none; }
.js .oshi-bell { display: block; }

.oshi-bell__button { position: relative; }
.oshi-bell__icon { display: block; }
.oshi-bell.has-unread .oshi-bell__icon { animation: oshi-bell-nod 2.4s ease-in-out 1; transform-origin: 50% 10%; }
.oshi-bell__badge {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid var(--color-dark);
  border-radius: var(--radius-pill);
  background: var(--color-lime);
  color: var(--color-dark);
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 15px;
  text-align: center;
}
.oshi-bell__badge[hidden] { display: none; }

.oshi-panel {
  position: absolute;
  z-index: 120;
  top: calc(100% + 10px);
  right: -56px;
  display: flex;
  width: min(380px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 110px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow);
  color: var(--color-ink);
  text-align: left;
}
.oshi-panel[hidden] { display: none; }
.oshi-panel:focus { outline: none; }

.oshi-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 10px;
}
.oshi-panel__eyebrow {
  margin: 0 0 2px;
  color: #3f6a00;
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}
.oshi-panel__title { margin: 0; font-size: 1.05rem; font-weight: 900; letter-spacing: -0.01em; line-height: 1.4; }
.oshi-panel__close {
  display: grid;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-ink);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.oshi-panel__tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 12px; border-bottom: 1px solid var(--color-line); }
.oshi-panel__tools button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}
.oshi-panel__tools button:hover,
.oshi-panel__tools button[aria-expanded="true"] { border-color: var(--color-ink); }

.oshi-panel__settings { margin: 0; padding: 12px 18px; border: 0; border-bottom: 1px solid var(--color-line); background: var(--color-bg); }
.oshi-panel__settings[hidden] { display: none; }
.oshi-panel__settings legend { float: left; width: 100%; margin-bottom: 6px; padding: 0; color: var(--color-muted); font-size: 0.74rem; font-weight: 800; }
.oshi-panel__settings label { display: flex; clear: left; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; font-size: 0.88rem; font-weight: 700; }
.oshi-panel__settings input { width: 18px; height: 18px; margin: 0; accent-color: #3f6a00; }

.oshi-panel__list { flex: 1 1 auto; min-height: 0; margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; list-style: none; }
.oshi-panel__list[hidden] { display: none; }

.oshi-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 12px 30px 12px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-ink);
}
a.oshi-item:hover,
a.oshi-item:focus-visible { background: var(--color-bg); }
.oshi-item.is-unread { background: #f3fde3; }
a.oshi-item.is-unread:hover { background: #eafbcf; }
.oshi-item.is-unread::after {
  position: absolute;
  top: 18px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5fa000;
  content: "";
}
.oshi-item__icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 50%;
  background: #e6f6ff;
  font-size: 1.05rem;
  line-height: 1;
}
.oshi-item__icon--match_start { background: #fff0ea; }
.oshi-item__icon--match_result { background: #f1eaff; }
.oshi-item__body { display: grid; min-width: 0; gap: 2px; }
.oshi-item__name { font-size: 0.9rem; font-weight: 900; line-height: 1.45; }
.oshi-item__message { color: #2c302b; font-size: 0.84rem; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.oshi-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; color: var(--color-muted); font-size: 0.72rem; font-weight: 700; }
.oshi-item__state { padding: 0 7px; border-radius: var(--radius-pill); background: var(--color-bg); }
.oshi-item.is-unread .oshi-item__state { background: var(--color-lime); color: var(--color-dark); }

.oshi-panel__empty { padding: 28px 22px 22px; text-align: center; }
.oshi-panel__empty[hidden] { display: none; }
.oshi-panel__empty p { margin: 12px 0 0; color: var(--color-muted); font-size: 0.86rem; font-weight: 700; line-height: 1.75; }
.oshi-panel__empty a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  margin-top: 14px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--color-dark);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}
.oshi-panel__empty a[hidden] { display: none; }
.oshi-panel__stones { display: inline-flex; gap: 6px; }
.oshi-panel__stones i { display: block; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4a4f49, #111311 70%); }
.oshi-panel__stones i + i { border: 1px solid var(--color-line); background: radial-gradient(circle at 35% 30%, #fff, #e7e9e4 75%); }

.oshi-panel__note { margin: 0; padding: 10px 18px 14px; border-top: 1px solid var(--color-line); color: var(--color-muted); font-size: 0.7rem; font-weight: 600; line-height: 1.6; }

@keyframes oshi-bell-nod {
  0%, 60%, 100% { transform: rotate(0); }
  10% { transform: rotate(14deg); }
  25% { transform: rotate(-11deg); }
  40% { transform: rotate(6deg); }
}

@media (prefers-reduced-motion: reduce) {
  .oshi-bell.has-unread .oshi-bell__icon { animation: none; }
}

@media (max-width: 600px) {
  .oshi-panel {
    position: fixed;
    top: 84px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
  }
}

/* Very narrow phones: keep logo, bell, search and MENU on one row. */
@media (max-width: 374px) {
  .site-header .header-actions { gap: 6px; }
  .site-header .header-actions .icon-button { width: 38px; height: 38px; }
  .site-header .menu-toggle { gap: 6px; padding: 0 10px; }
}
