/* ─────────────────────────────────────────────────────────────────────
   ListEZ Studio — Light Studio design system
   Ported from Claude Design "Light Studio" handoff (April 2026).
   Editorial, warm-cream, Fraunces-serif aesthetic.

   Usage: <link rel="stylesheet" href="/static/listez-studio.css">
   This file is fully additive — it does not override listez.css.
   Scope new screens with class="ls-app" on a container so existing
   pages remain untouched.
   ───────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Inter:wght@400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ── Design Tokens ────────────────────────────────────────────────── */
.ls-app, .ls-app * {
  box-sizing: border-box;
}

/* Anywhere we use the mono font (prices, IDs, timestamps, counts),
   force tabular figures (so digits line up in columns) and slashed
   zeros (so 0 is unambiguous against 8). Fixes the long-standing
   "is that a zero or an 8?" confusion users hit on the credits page. */
.ls-app [style*="--ls-mono"],
.ls-app .mono,
.ls-app *[class*="-mono"],
.ls-app *[class*="-per"],
.ls-app *[class*="-meta"] {
  font-feature-settings: "tnum" 1, "zero" 1;
}

/* ── Restore natural page scrolling on Studio-shell pages ──────────
   The legacy listez.css (loaded by autopilot, scheduler, settings,
   and index.html) sets `html, body { height: 100%; overflow: hidden; }`
   so the SPA's index.html can do internal panel scrolling. That rule
   suppresses ALL body scroll, which silently breaks long Studio pages
   (settings shop blocks, autopilot config sections, etc.) — content
   beyond the viewport bottom is invisible with no scrollbar.
   Scoping this override to `body.ls-app` (specificity 0,1,1) beats
   the bare `html, body` rule (specificity 0,0,1) regardless of CSS
   load order, AND leaves the legacy index.html untouched (it doesn't
   use body.ls-app, so its inner-scroll behavior is preserved). */
body.ls-app {
  height: auto !important;
  overflow: auto !important;
}
html:has(body.ls-app) {
  height: auto !important;
  overflow: auto !important;
}

.ls-app {
  /* Backgrounds — warm cream palette */
  --ls-bg:     #F7F2E8;
  --ls-bg2:    #FDFAF3;
  --ls-bg3:    #EFE8D8;
  --ls-bg4:    #E4DAC2;

  /* Borders */
  --ls-border:  rgba(92, 72, 42, 0.14);
  --ls-border2: rgba(92, 72, 42, 0.28);

  /* Text */
  --ls-text:  #2A2218;
  --ls-text2: #6B5E48;
  --ls-text3: #9A8D70;
  --ls-ink:   #1A1408;

  /* Accents — sparingly */
  --ls-accent: #8A3A1A;  /* terracotta — primary CTA, italic emphasis */
  --ls-gold:   #A88428;  /* warnings, scores 50-79 */
  --ls-green:  #3A7A52;  /* success, scores 80+ */
  --ls-blue:   #2A5A7A;  /* info */
  --ls-red:    #8A2A2A;  /* errors */

  /* Type stacks */
  --ls-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ls-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* DM Mono replaces JetBrains Mono — warmer, less '80s computer'
     feel, pairs better with Fraunces + Inter. Digit ambiguity (0/8)
     is also reduced thanks to its clearer rounded glyphs. */
  --ls-mono:  'DM Mono', 'SF Mono', Menlo, monospace;

  background: var(--ls-bg);
  color: var(--ls-text);
  font-family: var(--ls-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Layout primitives ────────────────────────────────────────────── */
.ls-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  background: var(--ls-bg);
}

.ls-main {
  display: flex;
  flex-direction: column;
  /* overflow: hidden was suppressing page scroll on long pages
     (Settings, Autopilot, POD Setup), forcing users to zoom out
     to see all items. Letting it grow naturally + relying on the
     body's default scroll keeps the sticky sidebar pinned at top
     while the page content scrolls underneath it. */
  min-height: 100vh;
  /* min-width: 0 prevents grid items from stubbornly growing wider
     than their column when their content is wide -- guards against
     horizontal overflow on Setting pages with wide tables. */
  min-width: 0;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.ls-sidebar {
  background: var(--ls-bg2);
  border-right: 1px solid var(--ls-border);
  display: flex;
  flex-direction: column;
  /* Reserve 40px at the top for the global persistent topbar
     (#ls-globalbar mounted by static/listez-topbar.js). The topbar is
     position: sticky; top: 0 with z-index: 900, so it overlays whatever
     sits at viewport top. If the sidebar were also top: 0 with height:
     100dvh, the topbar would cover its top 40px AND the sidebar's
     bottom 40px (the .ls-sidebar-user footer with avatar + shop name +
     settings cog) would extend below the visible viewport with no way
     to scroll to it.
     The topbar's CSS sets min-height: 30px but rendered height runs
     32-36px depending on font-rendering + sub-pixel layout + OS zoom
     + the border-bottom. 30px exactly was too tight and clipped the
     bottom of bottom-pinned content; 40px gives comfortable breathing
     room without wasting visible space.
     Anchoring at top: 40px and shrinking height by the same 40px puts
     the sidebar entirely BELOW the topbar -- top edge meets bottom of
     topbar, bottom edge meets bottom of viewport with a small buffer.
     100dvh (dynamic viewport height) excludes mobile browser chrome.
     Fall back to 100vh on older browsers. max-height clamps so the
     sidebar never exceeds the visible space even if a future change
     miscomputes height. */
  height: calc(100vh - 40px);
  height: calc(100dvh - 40px);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  position: sticky;
  top: 40px;
}

.ls-sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--ls-border);
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.ls-wordmark {
  font-family: var(--ls-serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--ls-ink);
  letter-spacing: -0.02em;
  line-height: 0.95;
}

.ls-wordmark em {
  font-style: italic;
  color: var(--ls-accent);
  font-weight: 400;
}

.ls-tagline {
  font-family: var(--ls-serif);
  font-style: italic;
  font-size: 11px;
  color: var(--ls-text3);
  margin-top: 4px;
}

.ls-nav {
  flex: 1;
  /* min-height:0 is the canonical fix for "flex child won't shrink
     enough to scroll" -- without it, .ls-nav refuses to shrink below
     its content size, which can push the user footer off-screen on
     short viewports. */
  min-height: 0;
  overflow-y: auto;
  padding: 12px 0;
}

.ls-nav-group { margin-bottom: 4px; }

.ls-nav-group-label {
  cursor: pointer;
  font-family: var(--ls-serif);
  font-style: italic;
  font-size: 11px;
  color: var(--ls-text3);
  padding: 8px 20px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.ls-nav-group-caret { font-size: 9px; opacity: 0.6; }

.ls-nav-item {
  cursor: pointer;
  padding: 7px 20px;
  font-size: 13px;
  color: var(--ls-text2);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.ls-nav-item:hover { background: var(--ls-bg3); color: var(--ls-ink); }
/* Active state: don't change font-weight — making glyphs bolder reflows
   the text inside the fixed 220px sidebar column and makes every click
   feel like a tiny sideways twitch. The background, ink color, accent
   border, and icon tint together give a clear "this is selected" read. */
.ls-nav-item.is-active {
  background: var(--ls-bg3);
  color: var(--ls-ink);
  border-left-color: var(--ls-accent);
}
.ls-nav-icon {
  color: var(--ls-text3);
  font-size: 12px;
  width: 14px;
  display: inline-block;
  text-align: center;
}
.ls-nav-item.is-active .ls-nav-icon { color: var(--ls-accent); }

.ls-nav-badge {
  margin-left: auto;
  font-size: 10px;
  color: var(--ls-text3);
  font-style: italic;
  font-family: var(--ls-serif);
}

.ls-sidebar-user {
  padding: 12px 20px;
  border-top: 1px solid var(--ls-border);
  display: flex;
  align-items: center;
  gap: 10px;
  /* Pin the user footer to the bottom of the sidebar always.
     flex-shrink:0 stops flex from collapsing it when the nav above
     is tall; .ls-sidebar background fills behind it so the bottom
     edge looks intentional even when the body has scrolled. */
  flex-shrink: 0;
  background: var(--ls-bg2);
}

.ls-avatar {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ls-gold), var(--ls-accent));
  color: var(--ls-bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ls-serif);
  font-style: italic;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.ls-user-info { flex: 1; min-width: 0; }
.ls-user-name {
  font-size: 12px;
  color: var(--ls-text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ls-user-meta {
  font-size: 10px;
  color: var(--ls-text3);
  font-style: italic;
  font-family: var(--ls-serif);
}

.ls-sidebar-cog {
  font-size: 14px;
  color: var(--ls-text3);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.12s;
}
.ls-sidebar-cog:hover { color: var(--ls-ink); }
.ls-sidebar-cog.is-active { color: var(--ls-accent); }

/* ── Page Header ──────────────────────────────────────────────────── */
.ls-header {
  padding: 22px 32px 16px;
  border-bottom: 1px solid var(--ls-border);
  background: var(--ls-bg2);
  flex-shrink: 0;
}

.ls-header-eyebrow {
  font-family: var(--ls-serif);
  font-size: 10px;
  color: var(--ls-text3);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.ls-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 4px;
  gap: 20px;
}

.ls-header-title {
  font-family: var(--ls-serif);
  font-size: 32px;
  font-weight: 400;
  color: var(--ls-ink);
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
}
.ls-header-title em {
  font-style: italic;
  color: var(--ls-accent);
}

.ls-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.ls-btn-primary {
  padding: 9px 20px;
  background: var(--ls-ink);
  color: #FDFAF3;
  border: none;
  border-radius: 2px;
  font-family: var(--ls-serif);
  font-size: 14px;
  font-style: italic;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.12s;
}
.ls-btn-primary:hover { opacity: 0.9; }
.ls-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.ls-btn-ghost {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--ls-border2);
  color: var(--ls-text2);
  border-radius: 2px;
  font-family: var(--ls-sans);
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.12s, color 0.12s;
}
.ls-btn-ghost:hover {
  background: var(--ls-bg3);
  color: var(--ls-ink);
}

/* ── Score Pills ──────────────────────────────────────────────────── */
.ls-score {
  display: inline-block;
  font-family: var(--ls-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 2px;
  border: 1px solid currentColor;
  font-weight: 500;
}
.ls-score.is-sm { font-size: 10px; padding: 1px 6px; }
.ls-score.is-good { color: var(--ls-green); }
.ls-score.is-warn { color: var(--ls-gold); }
.ls-score.is-bad  { color: var(--ls-accent); }
.ls-score.is-na   { color: var(--ls-text3); border-color: transparent; }

/* ── Cards ────────────────────────────────────────────────────────── */
.ls-card {
  background: var(--ls-bg2);
  border: 1px solid var(--ls-border);
  padding: 20px;
  transition: border-color 0.15s;
  border-radius: 0;
}
.ls-card.is-clickable { cursor: pointer; }
.ls-card.is-clickable:hover { border-color: var(--ls-border2); }

.ls-card-glyph {
  font-family: var(--ls-serif);
  font-style: italic;
  font-size: 28px;
  margin-bottom: 6px;
  color: var(--ls-text3);
}
.ls-card-glyph.is-accent { color: var(--ls-accent); }

.ls-card-title {
  font-family: var(--ls-serif);
  font-size: 18px;
  color: var(--ls-ink);
  margin: 0 0 4px 0;
  font-weight: 400;
}

.ls-card-body {
  font-size: 12px;
  color: var(--ls-text2);
  margin: 0 0 14px 0;
  line-height: 1.5;
}

/* ── Inputs ───────────────────────────────────────────────────────── */
.ls-input, .ls-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--ls-bg2);
  border: 1px solid var(--ls-border2);
  border-radius: 2px;
  font-family: var(--ls-sans);
  font-size: 13px;
  color: var(--ls-text);
  outline: none;
  transition: border-color 0.12s;
}
.ls-input:focus, .ls-textarea:focus { border-color: var(--ls-ink); }
.ls-textarea { resize: vertical; min-height: 80px; }

/* ── Misc helpers ─────────────────────────────────────────────────── */
.ls-eyebrow {
  font-family: var(--ls-serif);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ls-text3);
}

.ls-meta {
  font-size: 11px;
  color: var(--ls-text3);
  font-style: italic;
  font-family: var(--ls-serif);
}

.ls-divider {
  height: 1px;
  background: var(--ls-border);
  border: none;
  margin: 24px 0;
}

/* Operation status strip — shows live job state */
.ls-status-strip {
  padding: 6px 32px;
  background: var(--ls-bg2);
  border-bottom: 1px solid var(--ls-border);
  font-family: var(--ls-mono);
  font-size: 11px;
  color: var(--ls-text2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ls-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ls-text3);
  display: inline-block;
}
.ls-status-strip.is-ready  .ls-status-dot { background: var(--ls-green); }
.ls-status-strip.is-working .ls-status-dot { background: var(--ls-gold); animation: ls-pulse 1.4s ease-in-out infinite; }
.ls-status-strip.is-error  .ls-status-dot { background: var(--ls-red); }

@keyframes ls-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ── Auth / Flow Cards ────────────────────────────────────────────────
   Shared card styles for login, connect-etsy, password reset, and
   any other single-task flow page rendered inside .ls-auth-stage
   (from partials/studio_auth.html).

   Default card is 380px. Add .is-wide for 440px (e.g., connect-etsy
   which lists OAuth permissions).
   ───────────────────────────────────────────────────────────────── */
.ls-auth-card {
  width: 380px;
  padding: 40px 36px;
  background: var(--ls-bg2);
  border: 1px solid var(--ls-border);
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(92, 72, 42, 0.08);
}
.ls-auth-card.is-wide { width: 440px; }

.ls-auth-logo {
  font-family: var(--ls-serif);
  font-size: 32px;
  font-weight: 400;
  text-align: center;
  margin-bottom: 6px;
  color: var(--ls-ink);
  text-decoration: none;
  display: block;
  letter-spacing: -0.01em;
}
.ls-auth-logo em {
  font-style: italic;
  color: var(--ls-accent);
}

.ls-auth-sub {
  text-align: center;
  font-size: 11px;
  color: var(--ls-text3);
  font-family: var(--ls-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.ls-auth-heading {
  font-family: var(--ls-serif);
  font-size: 22px;
  font-weight: 400;
  font-style: italic;
  text-align: center;
  margin: 0 0 16px 0;
  color: var(--ls-ink);
  letter-spacing: -0.01em;
}
.ls-auth-heading em { color: var(--ls-accent); }

.ls-auth-desc {
  font-family: var(--ls-sans);
  font-size: 13px;
  color: var(--ls-text2);
  line-height: 1.6;
  text-align: center;
  margin-bottom: 24px;
}

.ls-auth-label {
  font-size: 10px;
  color: var(--ls-text3);
  font-family: var(--ls-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}

.ls-auth-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border: none;
  border-radius: 2px;
  font-family: var(--ls-serif);
  font-size: 15px;
  font-style: italic;
  font-weight: 400;
  cursor: pointer;
  color: #FDFAF3;
  background: var(--ls-ink);
  text-align: center;
  text-decoration: none;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}
.ls-auth-btn:hover:not(:disabled) { opacity: 0.9; }
.ls-auth-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.ls-auth-btn.is-danger {
  color: var(--ls-red);
  background: transparent;
  border: 1px solid rgba(138, 42, 42, 0.28);
  font-size: 13px;
  padding: 11px;
  font-family: var(--ls-sans);
  font-style: normal;
}
.ls-auth-btn.is-danger:hover:not(:disabled) {
  background: rgba(138, 42, 42, 0.06);
  border-color: rgba(138, 42, 42, 0.45);
  opacity: 1;
}

.ls-auth-error {
  background: rgba(138, 42, 42, 0.08);
  border: 1px solid rgba(138, 42, 42, 0.28);
  border-radius: 3px;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--ls-red);
  margin-bottom: 14px;
  display: none;
  font-family: var(--ls-sans);
}
.ls-auth-error.is-visible { display: block; }
.ls-auth-error.is-ok {
  background: rgba(58, 122, 82, 0.08);
  border-color: rgba(58, 122, 82, 0.28);
  color: var(--ls-green);
}

.ls-auth-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 11px;
  color: var(--ls-text3);
  font-family: var(--ls-sans);
}
.ls-auth-footer a {
  color: var(--ls-accent);
  text-decoration: none;
  font-style: italic;
  font-family: var(--ls-serif);
}
.ls-auth-footer a:hover { text-decoration: underline; }

/* ── Banners ──────────────────────────────────────────────────────
   General-purpose notification banner. Works anywhere on the page,
   not just inside auth cards. Hidden by default — add .is-visible
   to show.
   ────────────────────────────────────────────────────────────── */
.ls-banner {
  border-radius: 3px;
  padding: 10px 14px;
  font-family: var(--ls-sans);
  font-size: 12px;
  margin-bottom: 16px;
  display: none;
}
.ls-banner.is-visible { display: block; }
.ls-banner.is-error {
  background: rgba(138, 42, 42, 0.08);
  border: 1px solid rgba(138, 42, 42, 0.28);
  color: var(--ls-red);
}
.ls-banner.is-success {
  background: rgba(58, 122, 82, 0.08);
  border: 1px solid rgba(58, 122, 82, 0.28);
  color: var(--ls-green);
}
.ls-banner.is-info {
  background: rgba(42, 90, 122, 0.08);
  border: 1px solid rgba(42, 90, 122, 0.28);
  color: var(--ls-blue);
}

/* ── Spinner ──────────────────────────────────────────────────────
   Tiny inline spinner — drop into buttons or loading states.
   ────────────────────────────────────────────────────────────── */
.ls-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(92, 72, 42, 0.15);
  border-top-color: var(--ls-accent);
  border-radius: 50%;
  animation: ls-spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes ls-spin { to { transform: rotate(360deg); } }

.ls-loading {
  text-align: center;
  padding: 20px 0;
  color: var(--ls-text3);
  font-family: var(--ls-sans);
  font-size: 13px;
}

/* ── Permissions list (OAuth consent-style display) ────────────── */
.ls-perm-list {
  background: var(--ls-bg3);
  border: 1px solid var(--ls-border);
  border-radius: 3px;
  padding: 18px 20px;
  margin-bottom: 24px;
}
.ls-perm-list-title {
  font-size: 10px;
  color: var(--ls-text3);
  font-family: var(--ls-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.ls-perm-item {
  font-family: var(--ls-sans);
  font-size: 13px;
  color: var(--ls-text2);
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ls-perm-item .ls-perm-check {
  color: var(--ls-green);
  font-size: 14px;
  flex-shrink: 0;
}
.ls-perm-item strong { color: var(--ls-ink); }
.ls-perm-note {
  font-family: var(--ls-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ls-text3);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ls-border);
}

/* ── Connected state badge (OAuth success display) ─────────────── */
.ls-connected-badge {
  background: rgba(58, 122, 82, 0.08);
  border: 1px solid rgba(58, 122, 82, 0.28);
  border-radius: 3px;
  padding: 18px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.ls-connected-badge-icon {
  font-size: 28px;
  margin-bottom: 6px;
  color: var(--ls-green);
}
.ls-connected-badge-title {
  font-family: var(--ls-serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--ls-ink);
  margin-bottom: 4px;
}
.ls-connected-badge-label {
  font-size: 10px;
  color: var(--ls-green);
  font-family: var(--ls-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Credit balance chip in sidebar ─────────────────────────────────── */
/* Sits between the nav and the user footer. Quiet by default;
   fills with terracotta on hover to invite top-up clicks. The
   dimmed/zero states warn the user as they run low without
   shouting. */
.ls-sidebar-credits {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  margin: 4px 12px 8px;
  background: var(--ls-bg);
  border: 1px solid var(--ls-border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ls-text);
  font-family: var(--ls-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.ls-sidebar-credits:hover {
  background: var(--ls-accent);
  color: #FDFAF3;
  border-color: var(--ls-accent);
}
.ls-sidebar-credits .ls-credit-icon {
  color: var(--ls-accent);
  font-size: 13px;
  line-height: 1;
  transition: color 140ms ease;
}
.ls-sidebar-credits:hover .ls-credit-icon {
  color: #FDFAF3;
}
.ls-sidebar-credits .ls-credit-amount {
  flex: 1;
  white-space: nowrap;
  font-feature-settings: "tnum";
}
.ls-sidebar-credits .ls-credit-cta {
  font-family: var(--ls-serif);
  font-style: italic;
  font-size: 11px;
  color: var(--ls-text3);
  letter-spacing: 0.02em;
  transition: color 140ms ease;
}
.ls-sidebar-credits:hover .ls-credit-cta {
  color: rgba(253, 250, 243, 0.85);
}
/* Low-balance state: still readable, slight gold tint to nudge top-up */
.ls-sidebar-credits.is-low {
  border-color: var(--ls-gold);
}
.ls-sidebar-credits.is-low .ls-credit-icon {
  color: var(--ls-gold);
}
/* Zero-balance state: red border, urgent feel without being scary */
.ls-sidebar-credits.is-zero {
  border-color: var(--ls-red);
  background: rgba(138, 42, 42, 0.04);
}
.ls-sidebar-credits.is-zero .ls-credit-icon {
  color: var(--ls-red);
}

/* ── Cost chip on AI buttons (added inline by lsCredits.decorate) ───── */
/* Tiny terracotta number that follows a button label like:
       Run Mockups ✦ 0.4
   The space before the chip and the smaller font keep it from
   visually competing with the button's primary label. */
.ls-credit-chip {
  margin-left: 6px;
  font-family: var(--ls-mono);
  font-size: 0.85em;
  font-weight: 500;
  color: var(--ls-accent);
  letter-spacing: 0.02em;
  white-space: nowrap;
  font-feature-settings: "tnum";
}
.ls-btn-primary .ls-credit-chip {
  /* Primary buttons have cream text on dark ink background.
     Use cream-with-accent for the chip so it reads warm but
     stays legible on the dark fill. */
  color: rgba(253, 250, 243, 0.85);
}

/* ── Out-of-credits modal (rendered by listez-credits.js on 402) ────── */
.ls-credit-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(26, 20, 8, 0.55);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ls-credit-modal-fade 160ms ease-out;
}
@keyframes ls-credit-modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.ls-credit-modal-card {
  background: var(--ls-bg2);
  border: 1px solid var(--ls-border);
  border-radius: 8px;
  padding: 28px 32px 24px;
  max-width: 440px;
  width: calc(100% - 40px);
  box-shadow: 0 20px 60px rgba(26, 20, 8, 0.25);
}
.ls-credit-modal-eyebrow {
  font-family: var(--ls-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ls-red);
  margin-bottom: 8px;
}
.ls-credit-modal-title {
  font-family: var(--ls-serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ls-ink);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.ls-credit-modal-body {
  font-size: 13px;
  color: var(--ls-text);
  line-height: 1.55;
  margin-bottom: 20px;
}
.ls-credit-modal-body p {
  margin: 0 0 10px;
}
.ls-credit-modal-body strong {
  font-family: var(--ls-mono);
  color: var(--ls-ink);
}
.ls-credit-modal-shortfall {
  color: var(--ls-text2);
  font-style: italic;
  font-family: var(--ls-serif);
}
.ls-credit-modal-shortfall em {
  color: var(--ls-accent);
  font-style: italic;
  font-family: var(--ls-mono);
  font-size: 13px;
}
.ls-credit-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
