/* Studio section styles: topbar bell, notifications (dropdown and page) and the settings page.
   Owned by the notifications and settings views; tokens come from styles.css :root. */

/* ---------------------------------------------------------------- topbar bell */
.bell { position: relative; }
.bell[hidden] { display: none; }
.bell-btn { position: relative; }
.bell-badge {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.bell-badge[hidden] { display: none; }

.bell-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.bell-panel[hidden] { display: none; }
.bell-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.bell-title { font-size: var(--fs-md); font-weight: 700; text-wrap: balance; }
.bell-title:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-xs); }
.bell-title:focus:not(:focus-visible) { outline: none; }
.bell-status { margin: 0; padding: 12px 16px 0; color: var(--muted); font-size: var(--fs-sm); }
.bell-status:empty { display: none; }
.bell-list { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.bell-foot { padding: 10px 16px; border-top: 1px solid var(--line); text-align: center; }

/* ---------------------------------------------------------------- notification rows */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 16px 12px 22px;
  border-bottom: 1px solid var(--line);
}
.notif:last-child { border-bottom: 0; }
/* A row takes focus when its item is gone (no link to focus): it needs a visible ring too. */
.notif:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.notif.is-unread::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--primary);
}
.notif-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
}
.notif-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.notif-icon.kind-approved { background: var(--ok-bg); color: var(--ok-fg); }
.notif-icon.kind-rejected, .notif-icon.kind-channel_rejected, .notif-icon.kind-playlist_rejected { background: var(--rej-bg); color: var(--rej-fg); }
.notif-icon.kind-published { background: var(--primary-tint); color: var(--primary); }
.notif-icon.kind-scheduled { background: var(--pending-bg); color: var(--pending-fg); }
.notif-body { display: grid; gap: 2px; min-width: 0; }
.notif-kind { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.notif-link {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
  text-decoration: none;
  border-radius: var(--radius-xs);
}
.notif-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.notif-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.notif.is-unread .notif-link { font-weight: 700; }
.notif-link.is-gone { color: var(--muted); font-weight: 400; }
.notif-time { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }

.notif-card { padding: 0; overflow: hidden; }
.notif-card .notif-status { margin: 0; padding: 16px 24px 0; color: var(--muted); }
.notif-card .notif-status:empty { display: none; }
.notif-card .notif { padding-left: 30px; padding-right: 24px; }
.notif-card .notif.is-unread::before { left: 16px; }
.notif-more { padding: 12px 24px 16px; text-align: center; }
.notif-more[hidden] { display: none; }
#notif-empty { padding: 16px 24px 24px; }
#notif-empty[hidden] { display: none; }

/* ---------------------------------------------------------------- settings page */
.settings { display: grid; gap: 16px; max-width: 720px; }
.settings-card { padding: var(--card-pad); }
.settings-card .form { margin-top: 12px; }
.settings-title { font-size: var(--fs-lg); font-weight: 700; margin: 0; text-wrap: balance; }
.settings-hint { margin-top: 6px; max-width: 64ch; text-wrap: pretty; }
.settings-value { margin: 12px 0 0; color: var(--text); overflow-wrap: anywhere; }
.settings-actions { margin-top: 12px; }
.settings-danger { border-color: var(--danger-tint); }
.settings-danger .settings-title { color: var(--danger); }
.settings-card fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.settings-card fieldset legend { font-size: var(--fs-lg); font-weight: 700; padding: 0; margin-bottom: 0; }

/* Phones: the panel is pinned under the topbar so it cannot leave the viewport on the left. */
@media (max-width: 600px) {
  .bell-panel { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; max-height: calc(100vh - 76px); }
  .notif-card .notif { padding-right: 20px; }
}
