/*
 * The server layer's own styling — the account panel behind the 👤 button, our dialogs and
 * the fallback toast. Deliberately a SEPARATE file from Eyal's css/styles.css: he keeps
 * shipping new versions of that one, and anything we wrote inside it would be overwritten by
 * the next drop. Everything here is scoped under #planAccountPanel / .plan-* so it cannot reach
 * his rules. The shells (.settings-popover, .btn, .menu-item, .guest-disclaimer) are his — only
 * the inside is ours.
 */

/* Eyal's shell hides every popover with `.settings-popover { display: none }` and shows it
   again with `.settings-popover.open`. An ID selector outranks both, so declaring `display`
   here unconditionally left the panel open on every page load — the layout properties are
   safe to state always, the display switch belongs on `.open` alone. */
#planAccountPanel {
  flex-direction: column;
  gap: 0.75rem;
  min-width: 18rem;
  max-width: 26rem;
  max-height: min(80vh, 44rem);
  overflow-y: auto;
}

#planAccountPanel.open {
  display: flex;
}

.plan-account-block,
.plan-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.plan-section {
  padding-block-start: 0.6rem;
  border-block-start: 1px solid rgba(0, 0, 0, 0.08);
}

.plan-section h3 {
  margin: 0;
  font-size: 0.95rem;
}

.plan-account-note {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0.75;
}

.plan-account-error {
  margin: 0;
  font-size: 0.85rem;
  color: #b91c1c;
}

#planAccountPanel input,
#planAccountPanel select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.4rem;
  font: inherit;
  background: #fff;
}

#planAccountPanel input[type="checkbox"] {
  width: auto;
}

.plan-account-link {
  font-size: 0.85rem;
  text-align: center;
}

.plan-account-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding-block-start: 0.4rem;
  border-block-start: 1px solid rgba(0, 0, 0, 0.08);
}

.plan-board-list,
.plan-share-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: 15rem;
  overflow-y: auto;
}

.plan-board-row,
.plan-share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-decoration: none;
}

.plan-share-row select {
  width: auto;
  flex: none;
  padding: 0.25rem 0.4rem;
  font-size: 0.8rem;
}

.plan-share-add {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.plan-share-add select,
.plan-share-add button {
  flex: none;
}

.plan-share-add select {
  width: auto;
  padding: 0.4rem;
}

.plan-board-row.current .plan-board-title {
  font-weight: 700;
}

.plan-board-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-board-role {
  flex: none;
  font-size: 0.75rem;
  opacity: 0.7;
}

#planAccountPanel .plan-danger {
  color: #b91c1c;
}

.plan-text-danger {
  border: 0;
  background: transparent;
  color: #b91c1c;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.plan-consent-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-block-start: 0.6rem;
  font-size: 0.9rem;
}

/* The shared-board bulb on the account button (Eyal: "נורה צהובה לבעלים") */
#loginBtn {
  position: relative;
}

.plan-shared-badge {
  position: absolute;
  inset-block-start: -0.35rem;
  inset-inline-end: -0.35rem;
  font-size: 0.75rem;
  line-height: 1;
  filter: drop-shadow(0 0 2px rgba(250, 204, 21, 0.9));
}

/* Our dialogs reuse Eyal's .guest-disclaimer look; only the stacking of several is ours */
.plan-dialog {
  z-index: 3100;
}

.plan-dialog + .plan-dialog {
  z-index: 3101;
}

/* Only ever seen before the board's own showToast exists (an error during boot). */
.plan-toast {
  position: fixed;
  inset-block-end: 1.5rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 0.6rem 1.1rem;
  border-radius: 0.6rem;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-size: 0.9rem;
}
