/* Member tier styles. Reuses the design tokens from styles.css (:root custom
   properties) and its glass-card language. Blue and ghost only: orange stays
   unique to the free mirror's single CTA. */

#member-area {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin: -8px 0 18px;
  position: relative; /* anchor for the floating login panel */
}
#member-area:empty { display: none; }

/* small ghost variant for member controls */
.mini {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 12px;
}

.member-msg {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.linklike {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

/* --- login panel: floats as an overlay so it never pushes the scorecard
   down. Anchored under the "Member login" button, top-right. --- */
.login-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 440px;
  max-width: min(440px, 92vw);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
/* The hidden attribute must beat this rule's display:flex. The UA sheet's
   [hidden]{display:none} loses to an author class, so make it an author rule
   with higher specificity (class + attribute), or the panel never hides. */
.login-panel[hidden] { display: none; }
.login-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.login-panel .member-msg { width: 100%; }
.login-panel h3 { width: 100%; padding-right: 20px; } /* room for the close X */

.login-close {
  position: absolute;
  top: 8px;
  right: 12px;
  appearance: none;
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
}
.login-close:hover { color: var(--ink); }

/* On narrow screens the overlay would run off-screen: stack it in normal flow. */
@media (max-width: 600px) {
  .login-panel {
    position: static;
    width: 100%;
    max-width: 440px;
    box-shadow: none;
  }
}

.login-panel input,
.save-panel input,
.compare-bar select {
  flex: 1;
  min-width: 170px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(4, 15, 40, 0.5);
}
.login-panel input::placeholder,
.save-panel input::placeholder { color: rgba(186, 207, 236, 0.55); }
.login-panel input:focus,
.save-panel input:focus,
.compare-bar select:focus {
  outline: 2px solid rgba(180, 223, 255, 0.7);
  outline-offset: 2px;
}

/* --- member bar (logged in) --- */
.member-bar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 16px;
}
.member-email {
  flex: 0 0 100%;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- save panel on the mirror screen --- */
.save-panel {
  padding: 22px 30px;
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.save-panel h3 {
  width: 100%;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.save-panel .member-msg { width: 100%; }

/* --- history --- */
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 30px;
  margin-bottom: 18px;
}
.history-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.group-head h2 { margin: 0; }
.entry-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid rgba(186, 207, 236, 0.16);
}
.entry-meta {
  flex: 1;
  font-size: 14px;
  color: var(--ink-soft);
}
/* Inline entry panel: indented under its row so it reads as nested. */
.entry-row + .entry-detail {
  margin: 0 0 6px 6px;
  padding-left: 12px;
  border-left: 2px solid var(--card-border);
}
.compare-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.compare-bar select { flex: none; min-width: 150px; }

/* snapshot and compare rows; tone-* colors come from styles.css .ma rules */
.snap-row,
.cmp-row {
  display: grid;
  gap: 4px 18px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid rgba(186, 207, 236, 0.16);
  margin-top: 10px;
}
.snap-row { grid-template-columns: 1fr auto auto; }
.cmp-row { grid-template-columns: 1.3fr 1fr 1fr 100px; }
#member-history .mq {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}
#member-history .ma {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  white-space: normal;
}
.snap-pts {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.row-changed {
  background: rgba(15, 92, 184, 0.18);
  border-radius: 10px;
  /* Bleed the highlight outward with matching negative margin so the grid's
     content box (and thus the answer columns) stays aligned with unchanged
     rows; plain padding would narrow the tracks and shift the columns. */
  margin-left: -10px;
  margin-right: -10px;
  padding-left: 10px;
  padding-right: 10px;
}
.chip,
.chip-slot {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}
.chip { border: 1px solid var(--card-border); color: var(--ink-soft); }
.chip-changed { color: var(--ink); border-color: var(--accent); }
.chip-added { color: var(--positive); }
.chip-removed { color: var(--negative); }
.cmp-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  font-style: italic;
  color: var(--ink-soft);
}
.not-asked {
  font-weight: 400;
  font-style: italic;
  color: var(--ink-soft);
}
.snap-score {
  margin: 14px 0 0;
  font-weight: 700;
  color: var(--ink);
}
.snap-bear {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ink-body);
  white-space: pre-wrap;
}

/* --- copy-pass hooks (headings, hints, sub-lines added with the v1 copy) --- */
.login-panel h3,
#member-area .member-bar h3 {
  width: 100%;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.login-hint,
.save-help,
.history-sub,
.one-entry {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.save-help, .history-sub { width: 100%; }
.cmp-head { font-size: 13px; font-weight: 600; color: var(--ink); }
.cmp-col { font-size: 12px; color: var(--ink-soft); }
.footer-note {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
}
.footer-note .linklike { font-size: 12px; margin-left: 8px; }

/* --- privacy page --- */
.privacy-page { padding: 26px 30px; }
.privacy-page p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-body);
}
.privacy-page p:last-child { margin-bottom: 0; }

@media (max-width: 560px) {
  .snap-row, .cmp-row { grid-template-columns: 1fr; }
  /* Member bar: put the email on its own top line (ellipsis if long) so it no
     longer sits in the flex flow and scrambles the button order; the buttons
     then fill even rows below in DOM order. Desktop keeps email-left/buttons-right. */
  .member-bar .member-email {
    flex: 0 0 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .member-bar .ghost.mini { flex: 1 1 auto; }
}

/* --- question editor (PRD v1.1) ---------------------------------------- */
.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 30px;
  margin-bottom: 14px;
}
.editor-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.editor-intro { margin: 0 4px 16px; }
.editor-list { display: flex; flex-direction: column; gap: 14px; }

.editor-card { padding: 18px 22px; }
.editor-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.editor-card-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.editor-ctrls {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: center;
}
.icon-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
}
.icon-btn svg { display: block; }
.icon-btn:not(:disabled):hover { border-color: var(--accent); color: var(--ink); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }
.ghost.danger { color: var(--negative); border-color: rgba(220, 120, 120, 0.4); }
.ghost.danger:disabled { opacity: 0.4; }

.editor-fields { display: flex; flex-direction: column; gap: 8px; }
.editor-field-label {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.editor-readonly {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.editor-fields input,
.editor-fields textarea,
.editor-bucket input,
.editor-choice input,
.editor-choice select {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(4, 15, 40, 0.5);
}
.editor-fields textarea { min-height: 58px; resize: vertical; }
.editor-fields input:focus,
.editor-fields textarea:focus,
.editor-choice input:focus,
.editor-choice select:focus,
.editor-bucket input:focus {
  outline: 2px solid rgba(180, 223, 255, 0.7);
  outline-offset: 2px;
}

.editor-choices { display: flex; flex-direction: column; gap: 8px; }
.editor-choice {
  display: grid;
  grid-template-columns: 1fr 130px 116px auto;
  gap: 8px;
  align-items: center;
}
.editor-choice .choice-label { width: 100%; }
/* Editor points stepper reuses the free-tier .pts look; re-assert the compact
   input sizing (the generic .editor-choice input rule would otherwise widen it). */
.editor-choice .pts { margin-top: 0; }
.editor-choice .pts input { width: 44px; text-align: center; padding: 6px 4px; }

.editor-buckets {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.editor-bucket { display: flex; flex-direction: column; gap: 4px; }
.editor-bucket input { width: 90px; }
.bucket-label { font-size: 12px; color: var(--ink-soft); }

.editor-add {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}
.editor-bear { padding: 18px 22px; }

.editor-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  margin-top: 16px;
}
.editor-error { width: 100%; color: var(--negative); }
.set-changed { font-style: italic; }
.na-badge {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  padding: 8px 12px;
  text-align: center;
}

@media (max-width: 560px) {
  .editor-choice { grid-template-columns: 1fr; }
}
