/* ── Your account: the button in the top bar, its menu, the Sign in window (src/cloud.js) ── */
.account-btn {
  margin-left: 6px; height: 28px; min-width: 28px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid #3a3a3a; border-radius: 14px; background: #1e1e1e; color: #e0e0e0; font: inherit; font-size: 0.78rem; cursor: pointer; position: relative;
}
.account-btn[hidden] { display: none; }
.account-btn:hover, .account-btn[aria-expanded="true"] { background: #2a2a2a; border-color: #4a4a4a; color: #fff; }
.account-btn:focus-visible { outline: 2px solid #4a7fcb; outline-offset: 1px; }
/* signed in: a round initial, and a dot for the saving — green saved, blue saving, amber offline, red a problem */
.account-btn.signed-in { width: 28px; padding: 0; border-radius: 50%; background: #2d4a75; border-color: #4a7fcb; font-weight: 600; }
.account-initial:empty { display: none; }
.account-btn.signed-in::after {
  content: ''; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid #111; background: #5fb36b;
}
.account-btn[data-status="syncing"]::after { background: #6fa3ef; animation: account-pulse 1s ease-in-out infinite alternate; }
.account-btn[data-status="offline"]::after { background: #d6a23a; }
.account-btn[data-status="error"]::after { background: #e5605b; }
@keyframes account-pulse { from { opacity: 1; } to { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .account-btn[data-status="syncing"]::after { animation: none; } }

#account-menu { min-width: 260px; }
.am-head { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 6px; }
.am-email { font-size: 0.8rem; font-weight: 600; color: #e0e0e0; overflow-wrap: anywhere; }
.am-status { font-size: 0.72rem; line-height: 1.4; color: #6f8f6f; }
.am-status[data-status="syncing"] { color: #8fb4f0; }
.am-status[data-status="offline"] { color: #c9a24a; }
.am-status[data-status="error"] { color: #e5605b; }

/* the Sign in window, in the New canvas window's frame (templates.css) */
.si-panel { width: min(440px, 100%); gap: 14px; }
.si-step { display: flex; flex-direction: column; gap: 8px; }
.si-step[hidden], .si-providers[hidden], .si-or[hidden] { display: none; }
.si-providers { display: flex; flex-direction: column; gap: 8px; }
.si-provider { height: 40px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 0.86rem; font-weight: 600; }
.si-provider[data-provider="google"] { background: #fff; border-color: #dadce0; color: #1f1f1f; }
.si-provider[data-provider="google"]:hover { background: #f1f3f4; }
.si-or { display: flex; align-items: center; gap: 10px; color: #777; font-size: 0.74rem; margin: 2px 0; }
.si-or::before, .si-or::after { content: ''; flex: 1; height: 1px; background: #333; }
.si-row { display: flex; gap: 8px; }
.si-input {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid #3a3a3a; border-radius: 6px;
  background: #141414; color: #e0e0e0; font: inherit; font-size: 0.86rem;
}
.si-input:focus { outline: none; border-color: #4a7fcb; box-shadow: 0 0 0 1px #4a7fcb; }
.si-code { letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }
.si-row .btn { height: 34px; padding: 0 14px; white-space: nowrap; }
.si-note, .si-sent { margin: 0; font-size: 0.76rem; line-height: 1.5; color: #9a9a9a; }
.si-sent b { color: #e0e0e0; font-weight: 600; overflow-wrap: anywhere; }
.si-mail { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 8px; background: #222a37; border: 1px solid #34507a; color: #8fb4f0; }
.si-mail svg { flex-shrink: 0; }
.si-mail-h { display: block; margin-bottom: 4px; font-size: 0.92rem; font-weight: 600; color: #e0e0e0; }
.si-link { align-self: flex-start; padding: 0; border: none; background: none; color: #8fb4f0; font: inherit; font-size: 0.76rem; cursor: pointer; }
.si-link:hover { text-decoration: underline; }
.si-dev { margin: 0; padding: 8px 10px; border: 1px dashed #6a5a2a; border-radius: 6px; font-size: 0.74rem; line-height: 1.45; color: #c9a24a; }
.si-dev[hidden] { display: none; }
.si-error { margin: 0; font-size: 0.76rem; color: #e5605b; }
.si-error:empty { display: none; }
@media (max-width: 420px) { .si-row { flex-direction: column; } }

/* the Share a link window (src/share.js): the picture beside the link */
.sh-panel { width: min(560px, 100%); gap: 14px; }
.sh-body { display: flex; gap: 18px; align-items: flex-start; }
.sh-pic {
  flex-shrink: 0; width: 160px; height: 160px; display: flex; align-items: center; justify-content: center; border-radius: 6px;
  background: repeating-conic-gradient(#2c2c2c 0 25%, #262626 0 50%) 0 0 / 12px 12px; border: 1px solid #333;
}
.sh-pic canvas { display: block; max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.sh-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
/* who can open the link: Private (a lock) or Public (a globe) — above the link */
.sh-access { align-self: flex-start; min-width: 130px; height: 30px; }
.sh-access .sh-i-public, .sh-access.public .sh-i-private { display: none; }
.sh-access.public .sh-i-public { display: inline; color: #8fb4f0; }
.sh-access[aria-expanded="true"] svg:not(:last-child) { transform: none; } /* (only the arrow turns) */
#sh-access-menu { z-index: 2700; }
#sh-access-menu button[aria-checked="true"] b { color: #8fb4f0; font-weight: 600; }
/* the link: a click copies it (and makes it public); the copy icon at its end */
.sh-link {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; text-align: left; cursor: pointer;
  border: 1px solid #34507a; border-radius: 8px; background: #1b2230; color: #8fb4f0; font: inherit;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.sh-link:hover:not(:disabled) { border-color: #4a7fcb; background: #202a3b; }
.sh-link:focus-visible { outline: 2px solid #4a7fcb; outline-offset: 2px; }
.sh-link:disabled { cursor: default; }
.sh-url { flex: 1; min-width: 0; font-size: 0.86rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.sh-url:empty::before { content: 'Getting the link…'; display: inline-block; text-decoration: none; color: #8a8a8a; font-weight: 400; }
.sh-link svg { flex-shrink: 0; }
.sh-link:disabled svg { visibility: hidden; }
.sh-i-done { display: none; }
/* private: the link doesn't open yet — grey, no underline */
.sh-link.private { border-color: #3a3a3a; background: #1e1e1e; color: #a0a0a0; }
.sh-link.private .sh-url { text-decoration: none; }
.sh-link.private:hover:not(:disabled) { border-color: #555; background: #232323; color: #c8c8c8; }
/* copied: green, a check mark */
.sh-link.copied, .sh-link.copied:hover:not(:disabled) { border-color: #4f9a5c; background: #1b2a1f; color: #8fd49b; }
.sh-link.copied .sh-i-copy { display: none; }
.sh-link.copied .sh-i-done { display: inline; }
/* below the link: what a click does (or that it was copied) */
.sh-hint { margin: -2px 0 0; font-size: 0.74rem; line-height: 1.45; color: #8a8a8a; }
.sh-hint.copied { color: #8fd49b; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .sh-link { transition: none; } }
@media (max-width: 520px) { .sh-body { flex-direction: column; align-items: stretch; } .sh-pic { width: 100%; } }
