/* ════════════════════════════════════════════════════════════════════
   Inline input controls — used in page headers and toolbars
   • field-inline   — labelled boxed input (date pickers, MtM days)
   • switch         — toggle pill (Live prices)
   • save-status    — legacy save pill (kept for compat)
   • input-pct/$    — ghost suffix/prefix on numeric inputs
   ════════════════════════════════════════════════════════════════════ */

.field-inline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-tinted);
}
.field-inline label {
  font-size: 10px; color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: .1em;
}
.field-inline input {
  background: transparent; color: var(--foreground);
  border: none; outline: none; font-size: 12px;
  font-family: var(--font-mono); width: 110px;
}
.field-inline input[type="number"] { width: 56px; text-align: right; }
.field-inline input[type="date"] { color-scheme: dark; }
:root[data-theme="light"] .field-inline input[type="date"] { color-scheme: light; }

/* ── Inline ‹ / › month-end stepper buttons (Valuation Date) ─────────
   Borderless chevrons that sit inside the same .field-inline pill as
   the date input, so they read as part of the same control rather
   than two extra buttons in the row. Click handlers in app.js snap
   the date to the prev/next month-end. */
.field-inline .val-date-step {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
  transition: color .12s;
  user-select: none;
}
.field-inline .val-date-step:hover { color: var(--foreground); }
.field-inline .val-date-step:focus-visible {
  outline: none;
  color: var(--foreground);
  text-shadow: 0 0 0 currentColor;
}

/* ── Switch (live prices toggle) ──────────────────────────────────── */
.switch {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: .08em;
  cursor: pointer; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-tinted);
}
.switch input { accent-color: var(--foreground); margin: 0; }

/* ── Save status pill (legacy — sidebar footer carries this now) ───── */
.save-status {
  font-size: 10px; color: var(--muted-foreground);
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-tinted);
  text-transform: uppercase; letter-spacing: .1em;
}
.save-status.saving { color: var(--status-dev); border-color: rgba(248,168,0,.3); }
.save-status.saved  { color: var(--profit); border-color: rgba(81,193,72,.3); }
.save-status.error  { color: var(--loss); border-color: rgba(228,0,20,.3); }

/* ── Ghost "%" suffix ──────────────────────────────────────────────── */
.input-pct { position: relative; display: block; }
.input-pct input { width: 100%; padding-right: 24px; }
.input-pct .pct-suffix {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted-foreground); font-size: 12px; font-family: var(--font-mono);
  pointer-events: none; user-select: none;
}

/* ── Ghost "$" prefix — mirror of .input-pct, on the left side. ────── */
.input-dollar { position: relative; display: block; }
.input-dollar input { width: 100%; padding-left: 22px; }
.input-dollar .dollar-prefix {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted-foreground); font-size: 12px; font-family: var(--font-mono);
  pointer-events: none; user-select: none;
}

/* Hide native number spinners on decorated inputs — they collide with the
   ghost % / $ markers visually. */
.input-pct input[type="number"]::-webkit-inner-spin-button,
.input-pct input[type="number"]::-webkit-outer-spin-button,
.input-dollar input[type="number"]::-webkit-inner-spin-button,
.input-dollar input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.input-pct input[type="number"],
.input-dollar input[type="number"] { -moz-appearance: textfield; }

/* ── Share-URL row ──────────────────────────────────────────────────
   Reusable "copy this link to share these settings" row — used by the
   Funding Scanner, Backtest, and Token DD search cards. Sits as the
   last row inside its host card, separated by a top border so it reads
   as a discrete affordance rather than another form input. The Copy
   button flashes a "Copied!" success state for 1.5s after a successful
   clipboard write (the JS toggles .is-copied + swaps the button label). */
.share-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.06));
}
.share-url-label {
  flex: 0 0 auto;
  white-space: nowrap;
}
.share-url-input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono, 'Geist Mono', monospace);
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 6px;
  background: var(--surface-tinted, rgba(255, 255, 255, 0.03));
  color: var(--foreground, inherit);
  text-overflow: ellipsis;
}
.share-url-input:focus { outline: 1px solid var(--accent, #7aa2f7); outline-offset: 0; }
.share-url-copy {
  flex: 0 0 auto;
  font-size: 12px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.share-url-copy.is-copied {
  background: var(--success-bg, rgba(122, 200, 122, 0.18));
  color: var(--success-fg, #7ac87a);
  border-color: var(--success-fg, #7ac87a);
}

@media (max-width: 720px) {
  .share-url-row { flex-wrap: wrap; }
  .share-url-input { flex: 1 1 100%; order: 2; }
  .share-url-label { order: 1; }
  .share-url-copy { order: 3; margin-left: auto; }
}
