/* share.css - Share this run, Rename, the shared lines on Ready, and What's new.
   Every color is a token (tokens.css). The dialogs mount inside #modal-root
   through shell.openModal, so these rules always apply. */

/* ---------- Share dialog ---------- */
.share { display: flex; flex-direction: column; gap: 14px; }
.share-lead { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.share-status { font-size: 13px; color: var(--muted); }
.share-status:empty { display: none; }
.share-status.is-error { color: var(--danger-text); background: var(--danger-bg); padding: 10px 12px; border-radius: var(--r-sm); }

.share-all {
  display: flex; align-items: flex-start; gap: 11px; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface-2);
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.share-all:hover { border-color: var(--primary); }
.share-all:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.share-all input, .share-person input { width: 17px; height: 17px; margin: 2px 0 0; flex: none; accent-color: var(--primary); cursor: pointer; }
.share-all-t { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: var(--ink); }
.share-all-t strong { font-weight: 700; }
.share-all-t span { font-size: 12.5px; color: var(--muted); }

.share-filter input { font-size: 13.5px; padding: 9px 12px; background: var(--surface-2); }
.share-filter input:focus { background: var(--surface); }

.share-list {
  max-height: min(320px, 42vh); overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
}
.share-list.is-tall { height: min(320px, 42vh); }
.share-person {
  display: flex; align-items: flex-start; gap: 11px; padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--line); transition: background var(--dur-1) var(--ease);
}
.share-person:last-child { border-bottom: none; }
.share-person:hover { background: var(--surface-2); }
.share-person.is-locked { cursor: default; }
.share-person.is-locked .share-name, .share-person.is-locked .share-email { color: var(--muted); }
.share-person input:disabled { cursor: default; }
.share-who { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.share-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.share-email { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.share-note { font-size: 12px; color: var(--warn-text); margin-top: 3px; line-height: 1.4; }
.share-empty { padding: 18px 14px; text-align: center; font-size: 13px; color: var(--muted); }

.share-add .label { margin-bottom: 6px; }
.share-add-row { display: flex; gap: 8px; }
.share-add-row input { flex: 1; min-width: 0; font-size: 13.5px; padding: 9px 12px; }
.share-add-row .btn { flex: none; }
.share-add-msg { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.share-add-msg.is-error { color: var(--danger-text); }

/* The modal footer holds a quiet note on the left and the buttons on the right. */
.modal-foot:has(.share-foot) { display: block; }
.share-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.share-foot-end { justify-content: flex-end; }
.share-foot-note { display: inline-flex; align-items: flex-start; gap: 7px; font-size: 12.5px; color: var(--muted); line-height: 1.4; flex: 1 1 220px; }
.share-foot-note .ic { width: 15px; height: 15px; margin-top: 1px; }
.share-foot-btns { display: inline-flex; gap: 10px; margin-left: auto; }
.share-go { min-width: 128px; }
.share-go .spinner { width: 14px; height: 14px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: share-spin .8s linear infinite; }
@keyframes share-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .share-go .spinner { animation-duration: 2.4s; } }

.rename { display: flex; flex-direction: column; }
.rename .share-status { margin-top: 10px; }

/* ---------- Ready: title with rename, shared lines ---------- */
.ready-head .vh-main { flex: 1 1 420px; }
.title-row { display: flex; align-items: flex-start; gap: 8px; }
.title-row.is-editing { align-items: center; flex-wrap: wrap; }
.title-row .view-title { min-width: 0; overflow-wrap: anywhere; }
.title-row .title-edit { margin-top: 2px; }
.title-edit {
  flex: none; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.title-edit:hover { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.title-edit:focus-visible { outline: none; box-shadow: var(--ring); }
.title-edit .ic { width: 17px; height: 17px; }
.title-input { flex: 1 1 280px; max-width: 560px; font-size: 18px !important; font-weight: 700; padding: 8px 12px !important; }
.title-msg { flex-basis: 100%; margin: 2px 0 0; font-size: 12.5px; color: var(--danger-text); }

.shared-line {
  display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0;
  font-size: 13px; color: var(--info-text); line-height: 1.5;
}
.shared-line .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.shared-line strong { font-weight: 700; }
.shared-line.is-owner { color: var(--ink-2); }
.shared-line.is-owner .ic { color: var(--primary-text); }

/* ---------- What's new (top bar button and panel) ---------- */
.whatsnew-btn { position: relative; }
.whatsnew-btn .new-dot {
  position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--prism-sky); box-shadow: 0 0 0 2px var(--topbar-a);
  transform: scale(0); transition: transform var(--dur-2) var(--pop);
}
.whatsnew-btn.has-new .new-dot { transform: scale(1); }

.whatsnew { display: flex; flex-direction: column; gap: 18px; }
.wn-lead { margin: 0; font-size: 13.5px; color: var(--muted); }
.wn-release { border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; background: var(--surface); }
.wn-release.is-fresh { border-color: var(--primary); box-shadow: var(--sh-2); }
.wn-head { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.wn-date { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wn-version { padding: 2px 8px; border-radius: var(--r-pill); background: var(--bg-tint); font-weight: 600; }
.wn-release.is-fresh .wn-version { background: var(--primary-soft); color: var(--primary-text); }
.wn-title { margin: 8px 0 4px; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); }
.wn-summary { margin: 0 0 6px; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.wn-group { margin-top: 14px; }
.wn-label {
  display: inline-flex; align-items: center; gap: 7px; margin: 0 0 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.wn-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.wn-label.tone-ok::before { background: var(--ok); }
.wn-label.tone-warn::before { background: var(--warn); }
.wn-label.tone-info::before { background: var(--prism-mid); }
.wn-label.tone-violet::before { background: var(--prism-sky); }
.wn-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wn-group li { display: flex; flex-direction: column; gap: 2px; padding-left: 15px; }
.wn-group li strong { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.wn-group li span { font-size: 13px; color: var(--ink-2); line-height: 1.55; }

@media (max-width: 560px) {
  .modal-overlay:has(.share) { padding-top: 16px; }
  .share-list.is-tall { height: min(240px, 30vh); }
  .share-add-row { flex-direction: column; }
  .share-foot-btns { width: 100%; }
  .share-foot-btns .btn { flex: 1; }
  .wn-release { padding: 16px; }
  .title-input { flex-basis: 100%; max-width: none; }
}
