/* ==========================================================================
   Account area (/me, /account), the plugin download card, and the reward list
   on the vote page.

   Kept in its own file rather than appended to style.css: these are new
   surfaces, and a separate sheet is far easier to reason about than another
   400 lines in the middle of the site's main stylesheet. Everything below
   inherits .card, .btn, .form-row and the colour tokens from style.css.
   ========================================================================== */

/* ---------------------------------------------------------------- shared */
/* The hero: avatar beside the copy, actions in the flow underneath it.
   The actions used to be a third flex child pinned right with margin-left:auto,
   which floated them level with the subtitle and lined them up with nothing.
   `align-items: flex-start` keeps the avatar with the heading rather than
   centred against a block that grows. Spacing uses --gap, the site's scale. */
.acct-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--gap);
  margin-bottom: var(--gap);
  padding: calc(var(--gap) * 1.5) var(--gap);
}

.acct-hero > div:first-of-type { flex: 1 1 320px; }
.acct-hero h1 { margin-top: 0; }

.acct-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: var(--gap);
}

.acct-avatar {
  image-rendering: pixelated;          /* a 64px skin face upscaled must stay crisp */
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  flex: 0 0 auto;
}

.acct-ign-line { margin: 6px 0 0; }

/* "self-declared", stated as a label rather than buried in a paragraph. */
.acct-unverified {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  font-size: .74rem;
  letter-spacing: .02em;
  color: var(--muted);
  vertical-align: middle;
  cursor: help;
}

.acct-mini { margin-left: 8px; font-size: .82rem; }

.acct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--gap);
  /* `stretch` (the default) is what makes a row of sibling cards line up at the
     same height. It was `start`, so each card stopped at its own content and
     the row looked ragged. Content stays top-aligned via the column flex on
     .acct-card below · equal boxes, text at the top, not centred in the space. */
  align-items: stretch;
}

/* Settings forms read better in a narrower measure than the /me cards do. */
.acct-grid-settings { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.acct-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Pushes the trailing "see all" line to the bottom so those links line up
   across cards of different content length. */
.acct-card > .form-help:last-child { margin-top: auto; padding-top: 10px; }

.acct-owner { margin-bottom: var(--gap); }
.acct-owner-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.acct-owner .form-help { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Actions in a list row: real buttons, never text links. */
.acct-row-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-sm { padding: 4px 10px; font-size: .82rem; }

/* ------------------------------------------------------------- item lists */
.acct-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.acct-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--border-soft);
}

.acct-row:first-child { border-top: 0; }

.acct-row .srv-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  font-size: .7rem;
}

.acct-row-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.acct-row-main > a,
.acct-row-main > span:first-child {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-row-main .muted {
  font-size: .82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-row-plain { align-items: flex-start; }

/* A server whose cooldown is up is the only actionable row · say so quietly. */
.acct-row.is-ready .acct-row-main > a { color: var(--accent); }

.acct-cooldown {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
}

.acct-votes .btn-vote { padding: 4px 12px; font-size: .85rem; }

.acct-notif .badge { flex: 0 0 auto; margin-top: 2px; }

/* ------------------------------------------------------------ settings UI */
.acct-form { margin-top: 12px; }
.acct-form .form-row { margin-bottom: 12px; }
.acct-form input[type="email"],
.acct-form input[type="password"],
.acct-form input[name="ign"],
.acct-form input[name="confirm"],
.acct-form select { max-width: 22rem; width: 100%; }

.acct-ign-head { display: flex; gap: 12px; align-items: flex-start; }
.acct-ign-head p { margin: 0; }

/* The honesty note about the unverified name. Visible, not hidden in help text. */
.acct-honesty {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  font-size: .86rem;
  line-height: 1.5;
  color: var(--muted);
}

.acct-honesty strong { color: var(--text); }

/* ------------------------------------------------------------------ danger */
.acct-danger {
  margin-top: var(--gap);
  border-left: 3px solid var(--danger);
}

.acct-delete { margin-top: 12px; }
.acct-delete > summary { cursor: pointer; color: var(--danger); font-weight: 600; }
.acct-delete[open] > summary { margin-bottom: 12px; }

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-danger:hover { filter: brightness(1.1); }

/* ==========================================================================
   Plugin download card (dashboard + API docs)
   ========================================================================== */
.plugin-dl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--panel-2);
}

.plugin-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 0;
}

.plugin-facts > div { display: flex; flex-direction: column; gap: 1px; }
.plugin-facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.plugin-facts dd { margin: 0; font-weight: 600; }

.plugin-sum { margin: 12px 0; }
.plugin-sum > summary { cursor: pointer; color: var(--muted); }
.plugin-sum[open] > summary { margin-bottom: 10px; color: var(--text); }
.plugin-sum pre { overflow-x: auto; }

.plugin-sha { width: 100%; max-width: 46rem; font-size: .8rem; }

.plugin-steps {
  margin: 14px 0;
  padding-left: 20px;
  line-height: 1.65;
  color: var(--muted);
}

.plugin-steps li { margin-bottom: 6px; }
.plugin-steps code { color: var(--text); }

/* ==========================================================================
   "What you get for voting" on the vote page.

   rewards_text has been collected on the owner form for a long time and was
   never rendered anywhere · the single most persuasive thing on a vote page
   was being typed in and thrown away.
   ========================================================================== */
.vote-rewards {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--accent-dim);
  border-left-width: 3px;
  border-radius: var(--r);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.vote-rewards h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
}

.vote-rewards-body {
  margin: 0;
  white-space: pre-line;               /* owners write these as short lines/lists */
  line-height: 1.6;
  color: var(--text);
}

.vote-rewards-foot { margin: 10px 0 0; font-size: .82rem; }

/* The gift icon is an inline SVG, not an emoji: the display font renders most
   emoji as a blank or a sliver (see the reminder card's bell). */
.vote-rewards h2 svg,
.reminder-card .card-title svg { flex: 0 0 auto; }

/* ==========================================================================
   Delivery funnel panel (dashboard)
   ========================================================================== */
.fn-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.fn-switch a {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .85rem;
  color: var(--muted);
  text-decoration: none;
}

.fn-switch a.active { border-color: var(--accent); color: var(--accent); }

.fn-stages { list-style: none; margin: 16px 0; padding: 0; }

.fn-stage { padding: 10px 0; border-top: 1px solid var(--border-soft); }
.fn-stage:first-child { border-top: 0; }

.fn-stage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.fn-stage-label { font-weight: 600; }
.fn-stage-value strong { font-size: 1.15rem; }

/* A stage nobody measured, and a stage the plugin gates, are visually distinct
   from a real zero · that distinction is the whole point of the panel. */
.fn-unmeasured, .fn-locked { font-size: .84rem; color: var(--muted); font-style: italic; }
.fn-locked { color: var(--gold); font-style: normal; }
.fn-stage.is-unmeasured, .fn-stage.is-locked { opacity: .75; }

.fn-bar {
  height: 6px;
  margin: 7px 0 5px;
  border-radius: 3px;
  background: var(--panel-2);
  overflow: hidden;
}

.fn-bar > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.fn-stage.is-locked .fn-bar { background: repeating-linear-gradient(
  45deg, var(--panel-2), var(--panel-2) 4px, transparent 4px, transparent 8px); }

.fn-stage-note { margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.45; }

.fn-rates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--panel-2);
}

.fn-rates > div { display: flex; flex-direction: column; gap: 1px; }
.fn-rates span { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fn-rates strong { font-size: 1.05rem; }

.fn-locked-note {
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: color-mix(in srgb, var(--gold) 8%, transparent);
}

.fn-locked-note p { margin: 0 0 10px; font-size: .88rem; line-height: 1.55; }
.fn-locked-note p:last-child { margin-bottom: 0; }

@media (max-width: 560px) {
  .plugin-dl { flex-direction: column; align-items: stretch; }
  .acct-row-actions { flex-wrap: wrap; }
}
