/*
 * Sign-in, the welcome, and link management.
 *
 * Loaded on every page of both sites after theme.js, because the header has to know
 * who is signed in before it can decide what to show. Everything degrades: if
 * /api/session is unreachable the header stays as the server rendered it and no
 * panel appears, because a reader coming back to a broken site is worse than one
 * who never notices the extra feature.
 *
 * No emoji and no icon font. The one mark is a drawn glyph at the same 16-unit
 * grid as the icons already in theme.js, because an emoji here would render in
 * whatever colour the platform chose and match nothing else on the page.
 */

.a-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
}

.a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--ink2);
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  white-space: nowrap;
}

.a:hover {
  color: var(--ink);
  border-color: var(--line2);
}

.a svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.a-primary {
  color: var(--ink);
  border-color: var(--line2);
}

.a-quiet {
  border-color: transparent;
  color: var(--ink3);
}

.a-quiet:hover {
  border-color: var(--line);
}

/* The account button shows the reader's own avatar when Discord gave us one, and
   the same drawn glyph when it did not. 22px keeps it on the text baseline. */
.a-face {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
  flex: 0 0 auto;
}

.a-name {
  max-width: 13ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.a-count {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ink3);
  font-variant-numeric: tabular-nums;
  padding-left: 1px;
}

/* --------------------------------------------------------- the welcome steps */

.wl dl {
  margin: 0;
  display: grid;
  gap: 11px;
}

.wl dt {
  font-size: 13.5px;
  font-weight: 620;
  color: var(--ink);
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.wl dt i {
  font-style: normal;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ink3);
  flex: 0 0 auto;
}

.wl dd {
  margin: 2px 0 0 22px;
  font-size: 13px;
  color: var(--ink3);
  line-height: 1.55;
}

.wl .sep {
  height: 1px;
  background: var(--line);
  margin: 15px 0;
}

/* the button row at the foot of each panel. A class rather than a style
   assignment, because the only place these two panels put a row is here and an
   inline margin-top would be a rule wearing a disguise. */
.wl .acts {
  margin-top: 16px;
}

.wl p {
  font-size: 13.5px;
  color: var(--ink2);
  line-height: 1.6;
}

/* A plain warning, once. Border on the left, no fill, no icon, no badge — the
   second competing version of this was tried and reverted as exactly the kind of
   thing that makes a page look generated. */
.wl .warn {
  border-left: 2px solid var(--warn);
  padding-left: 11px;
  font-size: 13px;
  color: var(--ink3);
  line-height: 1.55;
}

/* ------------------------------------------------------- managing a link row */

.mg {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 0 0 auto;
}

.mg select {
  padding: 5px 6px;
  font: inherit;
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--ink);
  min-height: 30px;
}

.mg button {
  padding: 5px 8px;
  font: inherit;
  font-size: 12.5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--ink2);
  cursor: pointer;
  min-height: 30px;
  min-width: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mg button:hover {
  color: var(--ink);
  border-color: var(--line2);
}

.mg button.gone:hover {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 45%, transparent);
}

.mg .rm {
  display: flex;
  align-items: center;
  gap: 7px;
}

.own {
  font-size: 12px;
  color: var(--ink3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 640px) {
  .a-name {
    max-width: 8ch;
  }

  .a-count {
    display: none;
  }
}
