/* ================================================================
 * auth.css  –  Login modal, user badge, project browser modal
 * ================================================================ */

/* ── Shared: hide [hidden] on our modals ────────────────────────── */
#auth-modal[hidden],
#proj-browser-modal[hidden] { display: none !important; }

/* ── Auth Modal overlay ─────────────────────────────────────────── */
#auth-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(5px);
  z-index: 3000;
}

.auth-box {
  position: relative;
  z-index: 1;
  background: var(--surface, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 12px;
  padding: 30px 28px 26px;
  width: 360px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}

/* Logo / title row */
.auth-header {
  text-align: center;
  margin-bottom: 22px;
}
.auth-logo {
  width: 60px;
  height: 60px;
  margin-bottom: 10px;
  opacity: .9;
}

/* Centered white-silhouette watermark.  brightness(0) invert(1) flattens the
   logo's dark hex + blue accents into a single white shape that reads cleanly
   over the dark page background.  Drop shadow has been stripped from the SVG
   itself so this stays crisp at any scale. */
.auth-bg-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(70vw, 70vh);
  max-width: 560px;
  max-height: 560px;
  height: auto;
  object-fit: contain;
  opacity: 0.22;
  filter: brightness(0) invert(1);
  pointer-events: none;
  z-index: 0;
}
.auth-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #e6edf3);
}
.auth-subtitle {
  font-size: 11px;
  color: var(--text-muted, #7d8590);
  margin-top: 2px;
}

/* Tabs (Sign In / Register) */
.auth-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border, #30363d);
  margin-bottom: 18px;
  padding-bottom: 0;
}
.auth-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted, #7d8590);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  cursor: pointer;
  margin-bottom: -1px;
  border-radius: 0;
  transition: color .15s, border-color .15s;
}
.auth-tab.active {
  color: var(--accent, #58a6ff);
  border-bottom-color: var(--accent, #58a6ff);
  font-weight: 600;
}

/* Form fields */
.auth-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted, #7d8590);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 12px 0 4px;
}
.auth-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: var(--surface2, #0e1117);
  border: 1px solid var(--border, #30363d);
  border-radius: 6px;
  color: var(--text, #e6edf3);
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  transition: border-color .15s;
}
.auth-input:focus  { border-color: var(--accent, #58a6ff); }
.auth-input::placeholder { color: var(--text-muted, #7d8590); opacity: .6; }

.auth-submit {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
  background: var(--accent, #58a6ff);
  color: #000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity .15s;
}
.auth-submit:hover    { opacity: .88; }
.auth-submit:disabled { opacity: .45; cursor: not-allowed; }

.auth-error {
  font-size: 11px;
  color: #f78166;
  background: rgba(247,129,102,.1);
  border: 1px solid rgba(247,129,102,.3);
  border-radius: 5px;
  padding: 6px 10px;
  margin-top: 10px;
  line-height: 1.4;
}

/* ── User Badge ─────────────────────────────────────────────────── */
.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-bottom: 1px solid var(--border, #30363d);
  min-height: 30px;
}
.ub-name {
  flex: 1;
  font-size: 11px;
  color: var(--text-muted, #7d8590);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ub-logout {
  background: none;
  border: 1px solid var(--border, #30363d);
  color: var(--text-muted, #7d8590);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .12s, border-color .12s;
}
.ub-logout:hover { color: var(--text, #e6edf3); border-color: #7d8590; }

/* Shared shape for icon-only sidebar buttons (Upgrade / Manage / Sign out).
   Per-button color stays defined by each button's own class — this just
   normalizes size + centering. */
.ub-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 22px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
/* When .ub-icon-btn is also .ub-upgrade or .ub-logout the existing
   color/border rules above already apply — we don't need to repeat them. */

/* Plan pill — sits between name and the action buttons. JS sets its
   text + one of the modifier classes (.is-pro / .is-trial / .is-ended). */
.ub-plan {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--border, #30363d);
  color: var(--text-muted, #7d8590);
  white-space: nowrap;
}
/* The .ub-plan rule above uses display:inline-flex which beats the
   user-agent default for [hidden]. Force [hidden] to actually hide,
   so the empty bordered pill does not render when JS hides it. */
.ub-plan[hidden],
.ub-icon-btn[hidden] { display: none !important; }
.ub-plan.is-pro    { color: #7fdb7f; border-color: #2da32d; background: rgba(45,163,45,0.12); }
.ub-plan.is-trial  { color: #ffd866; border-color: #b48800; background: rgba(180,136,0,0.12); }
.ub-plan.is-ended  { color: #ff8b8b; border-color: #b33;    background: rgba(179,51,51,0.12); }

/* Upgrade CTA — green outline so it draws the eye without screaming. */
.ub-upgrade {
  background: transparent;
  border: 1px solid #2da32d;
  color: #7fdb7f;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.ub-upgrade:hover { background: rgba(45,163,45,0.12); color: #aef0ae; }

/* Manage subscription — neutral, only shown to active subscribers. */
.ub-manage {
  background: transparent;
  border: 1px solid var(--border, #30363d);
  color: var(--text-muted, #7d8590);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.ub-manage:hover { color: var(--text, #e6edf3); border-color: #7d8590; }

/* ── Upgrade / pricing modal ────────────────────────────────────── */
#upgrade-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  z-index: 9000;
}
#upgrade-modal[hidden] { display: none; }
.upgrade-modal-box {
  width: min(640px, 92vw);
  background: var(--surface, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}
.upg-hint {
  font-size: 12px;
  color: var(--text-muted, #7d8590);
  padding: 8px 16px 12px;
  text-align: center;
}
.upg-tiers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 16px;
}
@media (max-width: 540px) {
  .upg-tiers { grid-template-columns: 1fr; }
}
.upg-tier {
  position: relative;
  border: 1px solid var(--border, #30363d);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface2, #0d1117);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upg-tier-featured {
  border-color: #2da32d;
  box-shadow: 0 0 0 1px #2da32d inset;
}
.upg-tier-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: #2da32d;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.04em;
}
.upg-tier-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #e6edf3);
}
.upg-tier-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.upg-tier-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--text, #e6edf3);
  line-height: 1;
}
.upg-tier-unit {
  font-size: 12px;
  color: var(--text-muted, #7d8590);
}
.upg-tier-desc {
  font-size: 12px;
  color: var(--text-muted, #7d8590);
  min-height: 32px;
}
.upg-tier-cta {
  margin-top: auto;
  background: transparent;
  border: 1px solid var(--border, #30363d);
  color: var(--text, #e6edf3);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 5px;
  cursor: pointer;
}
.upg-tier-cta:hover { border-color: #7d8590; }
.upg-tier-cta-primary {
  background: #2da32d;
  border-color: #2da32d;
  color: #fff;
}
.upg-tier-cta-primary:hover { background: #34c134; border-color: #34c134; }
.upg-tier-cta[disabled] { opacity: 0.6; cursor: progress; }
.upg-trust {
  font-size: 11px;
  color: var(--text-muted, #7d8590);
  text-align: center;
  padding: 12px 16px 0;
}
.upg-legal {
  font-size: 11px;
  color: var(--text-muted, #7d8590);
  text-align: center;
  padding: 6px 16px 0;
  line-height: 1.5;
}
.upg-legal a {
  color: var(--text-muted, #7d8590);
  text-decoration: underline;
  text-decoration-color: rgba(125, 133, 144, 0.4);
}
.upg-legal a:hover {
  color: var(--accent, #58a6ff);
  text-decoration-color: var(--accent, #58a6ff);
}
.auth-legal {
  font-size: 11px;
  color: var(--text-muted, #7d8590);
  text-align: center;
  margin: 6px 0 10px;
  line-height: 1.5;
}
.auth-legal a {
  color: var(--text-muted, #7d8590);
  text-decoration: underline;
  text-decoration-color: rgba(125, 133, 144, 0.4);
}
.auth-legal a:hover {
  color: var(--accent, #58a6ff);
  text-decoration-color: var(--accent, #58a6ff);
}
.upg-msg {
  min-height: 18px;
  padding: 6px 16px 12px;
  text-align: center;
  font-size: 12px;
  color: #ff8b8b;
}

/* ── Trial-expired banner — pinned across the top of the canvas ─── */
#trial-expired-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8500;
  background: linear-gradient(90deg, #b33, #c44);
  color: #fff;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
#trial-expired-banner[hidden] { display: none; }
#trial-expired-banner .teb-text { font-weight: 600; }
#trial-expired-banner .teb-cta {
  background: #fff;
  color: #b33;
  border: 0;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
}
#trial-expired-banner .teb-cta:hover { background: #ffeaea; }

/* ── Project Browser Modal ──────────────────────────────────────── */
#proj-browser-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  z-index: 2500;
}

.pb-modal-box {
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--surface, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 10px;
  box-shadow: 0 20px 56px rgba(0,0,0,.65);
  overflow: hidden;
}

.pb-list {
  overflow-y: auto;
  flex: 1;
  padding: 6px 0;
  min-height: 80px;
  max-height: 360px;
}

.pb-loading,
.pb-empty {
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted, #7d8590);
  font-style: italic;
}

.pb-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "name actions"
    "meta actions";
  column-gap: 12px;
  row-gap: 2px;
  padding: 10px 14px;
  border-radius: 6px;
  margin: 2px 6px;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}
.pb-card:hover {
  background: var(--surface2, #0e1117);
  border-color: var(--border, #30363d);
}
.pb-card-name {
  grid-area: name;
  min-width: 0;          /* needed for ellipsis inside grid */
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text, #e6edf3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pb-card-meta {
  grid-area: meta;
  min-width: 0;
  font-size: 11px;
  color: var(--text-muted, #7d8590);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
/* Tiny neutral pill showing whether a project is in inches or mm. */
.pb-unit-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 5px;
  margin-left: 4px;
  border-radius: 8px;
  background: var(--surface3, #21262d);
  color: var(--text-muted, #7d8590);
  border: 1px solid var(--border, #30363d);
  text-transform: uppercase;
  letter-spacing: .02em;
  vertical-align: middle;
}
.pb-card-actions {
  grid-area: actions;
  align-self: center;
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.pb-open-btn {
  font-size: 11px;
  background: var(--accent, #58a6ff);
  color: #000;
  border: none;
  border-radius: 4px;
  padding: 3px 12px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity .12s;
}
.pb-open-btn:hover { opacity: .82; }

.pb-del-btn {
  font-size: 11px;
  background: none;
  border: 1px solid var(--border, #30363d);
  color: var(--text-muted, #7d8590);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.pb-del-btn:hover { color: #f78166; border-color: #f78166; }

/* "New project" input row at the bottom of the browser */
.pb-new-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border, #30363d);
}
.pb-new-row .auth-input { flex: 1; padding: 6px 10px; font-size: 12px; }
.pb-new-row .pb-create-btn {
  font-size: 12px;
  background: var(--accent, #58a6ff);
  color: #000;
  border: none;
  border-radius: 5px;
  padding: 6px 16px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity .12s;
}
.pb-new-row .pb-create-btn:hover    { opacity: .82; }
.pb-new-row .pb-create-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Tabs: My / Shared / All ───────────────────────────────────── */
.pb-tabs {
  display: flex;
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.pb-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .12s, border-color .12s;
}
.pb-tab:hover { color: var(--text); }
.pb-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.pb-tab-badge {
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pb-tab.is-active .pb-tab-badge {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ── Search bar + "share all" trigger ──────────────────────────── */
.pb-search-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pb-search-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
  outline: none;
}
.pb-search-input:focus { border-color: var(--accent); }
.pb-search-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.pb-share-all-btn {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
  white-space: nowrap;
}
.pb-share-all-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  border-style: solid;
}
/* When auto-share is ACTIVE, give the button a solid green look so it
   reads as "currently on" rather than a placeholder action. */
.pb-share-all-btn.is-on {
  border-style: solid;
  border-color: rgba(63, 185, 80, 0.55);
  background: rgba(63, 185, 80, 0.12);
  color: #3fb950;
}

/* Banner shown above the project list when auto-share is on. */
.pb-share-all-banner {
  margin: 0 14px 6px;
  padding: 7px 10px;
  background: rgba(63, 185, 80, 0.10);
  border: 1px solid rgba(63, 185, 80, 0.45);
  border-radius: 6px;
  color: #6cc777;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pb-share-all-banner[hidden] { display: none; }
.pb-share-all-banner .pb-banner-strong {
  color: #b3f0c0;
  font-weight: 600;
}
.pb-share-all-banner .pb-banner-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(63, 185, 80, 0.55);
  color: #3fb950;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.pb-share-all-banner .pb-banner-btn:hover {
  background: rgba(63, 185, 80, 0.20);
}

/* ── Status pills inside the meta row ─────────────────────────── */
.pb-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.pb-pill.is-mine {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
}
.pb-pill.is-shared-in {
  background: rgba(255, 168, 0, 0.12);
  border-color: rgba(255, 168, 0, 0.55);
  color: #ffaa00;
}
.pb-pill.is-shared-out {
  background: rgba(63, 185, 80, 0.12);
  border-color: rgba(63, 185, 80, 0.55);
  color: #3fb950;
}
.pb-author {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.pb-author em { color: var(--text); font-style: normal; }
.pb-dot {
  display: inline-block;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.5;
  flex-shrink: 0;
}

/* Share button on owner cards */
.pb-share-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.pb-share-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ── Share modal + Share-all modal — reuse text-input-modal style ──
   z-index > #proj-browser-modal (2500) so they layer ABOVE it when
   the user clicks "Share" from inside the open project browser.
   Wider than the default modal so long emails fit comfortably. */
#share-modal,
#share-all-modal {
  display: none;
  position: fixed;
  z-index: 3000;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 0 0 14px;
  min-width: 380px;
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 6px 32px rgba(0,0,0,0.70);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 12px;
  color: var(--text);
}

/* Bring the shared backdrop above the project browser too when a share
   modal is open. We add a marker class on <body> from JS so this only
   applies while a share modal is active. */
body.cs-share-modal-open #cs-modal-backdrop {
  z-index: 2999;
}

/* Header — centered + slightly larger than other modals. */
#share-modal .na-header,
#share-all-modal .na-header {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 12px 16px;
}

/* Body / labels / inputs / hint — mirror #text-input-modal so the
   shared .ti-* classes paint inside the share modals too. */
#share-modal .ti-body,
#share-all-modal .ti-body {
  padding: 14px 16px 6px;
}
#share-modal .ti-hint,
#share-all-modal .ti-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
#share-modal .ti-label,
#share-all-modal .ti-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 6px;
}
#share-modal .ti-input,
#share-all-modal .ti-input {
  width: 100%;
  padding: 8px 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color .12s, background .12s;
}
#share-modal .ti-input:focus,
#share-all-modal .ti-input:focus {
  border-color: var(--accent);
  background: var(--bg);
}
#share-modal .ti-input::placeholder,
#share-all-modal .ti-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
  opacity: .7;
}

/* Email input grows to use all available space inside the modal. */
.share-email-input {
  width: 100%;
}

/* Inline error message */
#share-modal .na-msg,
#share-all-modal .na-msg {
  min-height: 0;
  padding: 0;
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--error);
  line-height: 1.4;
}
#share-modal .na-msg:empty,
#share-all-modal .na-msg:empty {
  display: none;
}

/* Divider line between sections (Email → Access level → People). */
.share-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 14px 0 12px;
  opacity: 0.7;
}

/* Access-level radio group — same pattern as #cutout-place-modal .cp-source-row. */
.share-role-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.share-role-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  padding: 6px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  transition: border-color .12s, background .12s;
}
.share-role-opt:hover {
  border-color: var(--accent);
}
.share-role-opt input[type="radio"] {
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.share-role-opt:has(input[type="radio"]:checked) {
  border-color: var(--accent);
  background: var(--accent-dim, rgba(88, 166, 255, 0.10));
}

/* "Add a recipient" row — input + Add button side by side. */
.share-add-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.share-add-row .ti-input { flex: 1 1 auto; min-width: 0; }
.share-add-row .eip-apply {
  flex: 0 0 auto;
  padding: 0 16px;
  height: 34px;
  margin: 0;
}

/* Count badge next to a section label. */
.share-count {
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 4px;
}
.share-count:empty { display: none; }

/* People list. */
.share-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px;
  background: var(--surface2);
}
.share-list:empty::before {
  content: "No-one yet.";
  display: block;
  color: var(--text-muted);
  font-style: italic;
  padding: 6px 4px;
}

/* Person row — avatar | (name on top, email below) | role chip | remove. */
.share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.share-row-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-dim, rgba(88, 166, 255, 0.18));
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.share-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
}
.share-row-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-row-email {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-row-role {
  font-size: 10px;
  color: var(--text-muted);
  padding: 2px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.share-row-rm {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: color .12s, background .12s;
}
.share-row-rm:hover {
  color: var(--error);
  background: rgba(248, 81, 73, 0.08);
}

/* Footer — three buttons in sequence, evenly sized, using the standard
   .eip-apply / .eip-cancel chrome. Order is set by markup:
   Share | Stop sharing entirely | Done. */
#share-modal .share-foot,
#share-all-modal .share-foot {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  margin-top: 12px;
}
#share-modal .share-foot .eip-apply,
#share-modal .share-foot .eip-cancel,
#share-all-modal .share-foot .eip-apply,
#share-all-modal .share-foot .eip-cancel {
  flex: 1 1 0;
  padding: 7px 10px;
}

/* ── Auth link (small text button) ──────────────────────────────── */
.auth-link {
  background: none;
  border: none;
  color: var(--accent, #58a6ff);
  font-size: 11px;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline;
  transition: opacity .12s;
}
.auth-link:hover { opacity: .75; }

.auth-footer-links {
  text-align: right;
  margin-top: 8px;
}

/* ── Hint text inside a panel ────────────────────────────────────── */
.auth-panel-hint {
  font-size: 11px;
  color: var(--text-muted, #7d8590);
  margin: 0 0 10px;
  line-height: 1.5;
}

/* ── IP conflict warning box ─────────────────────────────────────── */
.auth-conflict {
  background: rgba(210, 153, 34, 0.1);
  border: 1px solid rgba(210, 153, 34, 0.35);
  border-radius: 7px;
  padding: 10px 12px 8px;
  margin-bottom: 10px;
}
.auth-conflict-msg {
  font-size: 11px;
  color: #d29922;
  margin: 0 0 8px;
  line-height: 1.4;
}
.auth-submit-danger {
  background: #f78166;
  color: #fff;
}
.auth-submit-danger:hover { opacity: .88; }
.auth-conflict .auth-submit {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 12px;
  padding: 7px 0;
}
.auth-conflict .auth-link { display: block; margin-top: 4px; }

/* ── Success variant of .auth-error ─────────────────────────────── */
.auth-error.auth-success {
  color: #3fb950;
  background: rgba(63, 185, 80, 0.08);
  border-color: rgba(63, 185, 80, 0.3);
}

/* Upgrade modal — seat picker (task #334).                          */
.upg-seats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
}
.upg-seats-label {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 12px; font-weight: 700;
  color: var(--text, #e6edf3);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.upg-seats-hint {
  font-size: 11px; font-weight: 500; color: var(--text-muted, #8b949e);
  text-transform: none; letter-spacing: 0;
}
.upg-seats-stepper {
  display: flex; align-items: center; gap: 0;
  background: var(--surface, #161b22);
  border: 1px solid var(--border, #2a3140);
  border-radius: 8px;
  overflow: hidden;
}
.upg-seats-btn {
  width: 36px; height: 36px;
  border: none; background: transparent;
  color: var(--text, #e6edf3);
  font-size: 18px; font-weight: 700;
  cursor: pointer; transition: background 0.12s;
}
.upg-seats-btn:hover { background: rgba(255,255,255,0.06); }
.upg-seats-stepper input {
  width: 56px; height: 36px;
  background: transparent;
  border: none; border-left: 1px solid var(--border, #2a3140);
  border-right: 1px solid var(--border, #2a3140);
  color: var(--text, #e6edf3);
  font: 600 14px/1 'Inter', system-ui, sans-serif;
  text-align: center;
}
.upg-seats-stepper input:focus { outline: none; background: rgba(255,255,255,0.05); }

/* Floor hint — shown when seats_used > 1 so the user understands why
   the − button is disabled at their current head-count. */
.upg-seats-floor {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted, #7d8590);
  font-style: italic;
}
.upg-seats-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Live total inside each tier card. */
.upg-tier-total {
  margin: 10px 0 14px;
  padding: 8px 10px;
  background: rgba(88,166,255,0.08);
  border: 1px solid rgba(88,166,255,0.25);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted, #8b949e);
}
.upg-tier-total strong {
  color: var(--text, #e6edf3);
  font-size: 14px; font-weight: 700; margin-left: 4px;
}
