/* ==========================================================================
   lecvia — Full-Stack Platform UI Stylesheet
   Visual Lock:  Luma AI monochrome craft (faa66add-ae07-4852-bc66-477847157b5d)
   Screen Locks: Savee Split Login (3eac484b) · OpenAI Playground (496a097a)
                 Cofounder Usage (399ce73a) · Fal.ai Keys (774190b9)
                 Lovable Plans & Credits (4742c1eb / Flow 12301)
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body.lecvia-app {
  --canvas: #ffffff;
  --rail: #f8f8f9;
  --elevated: #ededed;
  --soft: #f4f4f5;
  --ink: #000000;
  --text: #171717;
  --secondary: #737373;
  --muted: #8c8c94;
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.18);
  --success: #15803d;
  --success-bg: #f0fdf4;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;

  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ==================== SHARED CONTROLS & MOTION ==================== */
.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.04em;
}
.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #000000;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-mark.inverse { background: #ffffff; color: #000000; }

.btn-black {
  height: 40px;
  padding: 0 20px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: #000000;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.015em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.14s var(--ease-spring);
}
.btn-black:hover { background: #262626; }
.btn-black:active { transform: scale(0.97); }
.btn-black:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-outline {
  height: 36px;
  padding: 0 15px;
  border-radius: 9999px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: #000000;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.015em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.14s var(--ease-spring);
}
.btn-outline:hover { background: #f4f4f5; border-color: #000000; }
.btn-outline:active { transform: scale(0.97); }

.btn-white {
  height: 40px;
  padding: 0 20px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: #ffffff;
  color: #000000;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, transform 0.14s var(--ease-spring);
}
.btn-white:hover { background: #e2e2e2; }
.btn-white:active { transform: scale(0.97); }

.btn-danger-ghost {
  height: 30px;
  padding: 0 11px;
  border-radius: 9999px;
  border: 1px solid rgba(185, 28, 28, 0.22);
  background: #ffffff;
  color: var(--danger);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-danger-ghost:hover { background: var(--danger-bg); border-color: var(--danger); }

.field-input, .field-select {
  width: 100%;
  height: 40px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #ffffff;
  color: #000000;
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.field-input:focus, .field-select:focus {
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #262626;
  margin-bottom: 6px;
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 2px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #f4f4f5;
  gap: 2px;
}
.lang-pill button {
  border: none;
  background: transparent;
  color: #525252;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  height: 24px;
  padding: 0 9px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.lang-pill button.is-active { background: #000000; color: #ffffff; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.inline-code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: #f0f0f2;
  padding: 1px 5px;
  border-radius: 4px;
  color: #000000;
}

.view-root { display: none; min-height: 100vh; }
.view-root.is-active { display: block; animation: viewFade 0.24s var(--ease-expo); }
@keyframes viewFade { from { opacity: 0; } to { opacity: 1; } }

/* ==================== VIEW 1: CINEMA SPLIT AUTH (/login & /register) ==================== */
.auth-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}
.auth-cinema {
  position: relative;
  background: #050507;
  color: #ffffff;
  overflow: hidden;
  padding: 36px 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-cinema-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
}
.auth-cinema-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.48) 0%, rgba(0,0,0,0.18) 45%, rgba(0,0,0,0.78) 100%);
}
.auth-cinema > *:not(img):not(.auth-cinema-scrim) { position: relative; z-index: 2; }

.auth-quote-box { max-width: 480px; }
.auth-quote {
  margin: 0 0 14px;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: -0.03em;
  color: #ffffff;
  white-space: pre-line;
  text-wrap: balance;
}
html[lang="zh-CN"] .auth-quote { font-size: 28px; line-height: 1.36; letter-spacing: -0.015em; }
.auth-meta-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-meta-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  color: #ffffff;
}

.auth-panel {
  background: #ffffff;
  padding: 28px 40px;
  display: flex;
  flex-direction: column;
}
.auth-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.auth-back-link {
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  color: #525252;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.auth-back-link:hover { color: #000000; }

.auth-form-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0;
}
.auth-box {
  width: 100%;
  max-width: 390px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.auth-heading {
  margin: 0;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.18;
}
.auth-sub { margin: 6px 0 0; font-size: 14.5px; color: #737373; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: 9999px;
  background: #f2f2f3;
  border: 1px solid var(--border);
}
.auth-tab {
  height: 34px;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #525252;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s var(--ease-spring);
}
.auth-tab.is-active { background: #000000; color: #ffffff; }

.auth-error {
  display: none;
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--danger-bg);
  border: 1px solid rgba(185, 28, 28, 0.2);
  color: var(--danger);
  font-size: 13.5px;
}
.auth-error.is-visible { display: block; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #8c8c94;
  font-size: 12.5px;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.demo-card-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: #fafafa;
  color: #000000;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.14s var(--ease-spring);
}
.demo-card-btn:hover { border-color: #000000; background: #f2f2f4; transform: translateY(-1px); }

/* ==================== VIEW 2: MULTI-MODEL STUDIO WORKBENCH (/app) ==================== */
.studio-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  background: #ffffff;
  overflow: hidden;
}

.studio-rail {
  background: var(--rail);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.rail-top {
  height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rail-new-wrap { padding: 14px 14px 10px; }
.rail-threads {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rail-group-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8c8c94;
  padding: 8px 10px 4px;
}
.thread-item {
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 9px 10px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #262626;
  transition: background 0.14s ease;
}
.thread-item:hover { background: rgba(0, 0, 0, 0.045); }
.thread-item.is-active { background: #e9e9ec; color: #000000; font-weight: 500; }
.thread-title {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}
.thread-del {
  border: none;
  background: transparent;
  color: #8c8c94;
  font-size: 15px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0;
  transition: opacity 0.14s ease, color 0.14s ease;
}
.thread-item:hover .thread-del { opacity: 1; }
.thread-del:hover { color: var(--danger); }

.rail-footer {
  border-top: 1px solid var(--border);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f4f4f5;
}
.credit-mini-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 13px;
  cursor: pointer;
  transition: border-color 0.16s ease;
}
.credit-mini-card:hover { border-color: #000000; }
.credit-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 7px;
}
.credit-bar-bg {
  height: 6px;
  border-radius: 9999px;
  background: #e9e9ec;
  overflow: hidden;
}
.credit-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: #000000;
  transition: width 0.4s var(--ease-expo);
}
.rail-quick-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.rail-mini-btn {
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #262626;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.rail-mini-btn:hover { background: #000000; color: #ffffff; border-color: #000000; }

/* Main Studio Area */
.studio-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #ffffff;
}
.studio-topbar {
  height: 58px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
}
.studio-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  position: relative;
}
.mobile-rail-btn {
  display: none;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.model-picker-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: #000000;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.model-picker-btn:hover { border-color: #000000; background: #fafafa; }

.model-popover {
  position: absolute;
  top: 44px;
  left: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 16px;
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.18);
  padding: 12px;
  z-index: 40;
  display: none;
  flex-direction: column;
  gap: 8px;
}
.model-popover.is-open { display: flex; animation: popIn 0.18s var(--ease-expo); }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.model-pop-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.model-pop-item {
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 9px 11px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background 0.12s ease;
}
.model-pop-item:hover { background: #f4f4f5; }
.model-pop-item.is-selected { background: #000000; color: #ffffff; }
.model-pop-item.is-selected .pop-sub { color: rgba(255, 255, 255, 0.72); }
.pop-name { font-size: 13.5px; font-weight: 600; display: block; }
.pop-sub { font-size: 12px; color: #737373; }
.pop-weight {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.06);
}
.model-pop-item.is-selected .pop-weight { background: rgba(255, 255, 255, 0.18); color: #ffffff; }

.mode-pills {
  display: inline-flex;
  padding: 3px;
  border-radius: 9999px;
  background: #f2f2f3;
  border: 1px solid var(--border);
  gap: 2px;
}
.mode-pill {
  height: 28px;
  padding: 0 12px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: #525252;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.mode-pill.is-active { background: #000000; color: #ffffff; }

.studio-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.zdr-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #f4f4f5;
  color: #262626;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.zdr-dot { width: 6px; height: 6px; border-radius: 9999px; background: var(--success); }

.account-chip {
  height: 34px;
  padding: 0 12px 0 6px;
  border-radius: 9999px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: #000000;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.account-chip:hover { border-color: #000000; background: #fafafa; }
.avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: #000000;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Studio Message Feed */
.studio-feed {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px 36px;
}
.studio-feed-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.studio-empty {
  padding: 64px 0 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.studio-empty h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.035em;
}
.studio-empty p { margin: 0; color: #737373; max-width: 520px; }
.empty-prompts {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 680px;
}
.empty-prompt-card {
  border: 1px solid var(--border);
  background: #fafafa;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.14s var(--ease-spring);
}
.empty-prompt-card:hover { border-color: #000000; background: #ffffff; transform: translateY(-1px); }
.empty-prompt-title { font-size: 14px; font-weight: 600; color: #000000; margin-bottom: 3px; }
.empty-prompt-sub { font-size: 12.5px; color: #737373; }

.msg-user {
  align-self: flex-end;
  max-width: 78%;
  background: #f4f4f5;
  border: 1px solid var(--border);
  border-radius: 18px 18px 4px 18px;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.56;
  color: #000000;
  white-space: pre-wrap;
}
.msg-assistant {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.msg-model-badge {
  font-size: 13.5px;
  font-weight: 600;
  color: #000000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.msg-telemetry {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #737373;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.msg-cost-pill {
  background: #f0f0f2;
  color: #000000;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
}
.msg-body {
  font-size: 14.5px;
  line-height: 1.66;
  color: #171717;
}
.msg-body pre {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
  margin: 10px 0;
}
.msg-visual-img {
  width: 100%;
  max-width: 440px;
  border-radius: 14px;
  border: 1px solid var(--border);
  display: block;
  margin-top: 10px;
}

/* Split ×2 Compare Message Block inside /app */
.split-msg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.split-col-card {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  min-width: 0;
}
.synth-trigger-bar {
  position: relative;
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  background: linear-gradient(90deg, #171717 0%, #3a3a40 32%, #000000 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  transition: filter 0.2s ease, transform 0.14s var(--ease-spring);
}
.synth-trigger-bar:hover { filter: brightness(1.12); }
.synth-trigger-bar:active { transform: scale(0.99); }

/* Bottom Composer */
.studio-composer-wrap {
  padding: 12px 24px 20px;
  border-top: 1px solid var(--border);
  background: #ffffff;
  flex-shrink: 0;
}
.studio-composer {
  max-width: 860px;
  margin: 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 20px;
  padding: 12px 14px 10px 16px;
  background: #ffffff;
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.10);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.16s ease;
}
.studio-composer:focus-within { border-color: #000000; }
.composer-input {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: #000000;
  min-height: 44px;
}
.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.composer-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.composer-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.attach-chip {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #ededed;
  color: #000000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.send-circle {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  border: none;
  background: #000000;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.14s var(--ease-spring);
}
.send-circle:hover { background: #262626; transform: scale(1.04); }
.send-circle:disabled { opacity: 0.4; cursor: not-allowed; }

/* ==================== VIEW 3: ACCOUNT, LEDGER, BILLING, KEYS & SECURITY (/account/*) ==================== */
/* Grounded in Refero fal.ai (774190b9) + Cofounder (399ce73a) + Lovable (4742c1eb) */
.account-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  background: #ffffff;
}
.account-rail {
  background: var(--rail);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.rail-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #525252;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}
.rail-back-btn:hover { background: rgba(0, 0, 0, 0.05); color: #000000; }

.rail-search {
  width: 100%;
  height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.rail-search:focus { border-color: #000000; }

.acc-nav-group { display: flex; flex-direction: column; gap: 3px; }
.acc-nav-heading {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8c8c94;
  padding: 6px 10px 4px;
}
.acc-nav-item {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #404040;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}
.acc-nav-item:hover { background: rgba(0, 0, 0, 0.045); color: #000000; }
.acc-nav-item.is-active { background: #e9e9ec; color: #000000; font-weight: 600; }

.account-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.account-topbar {
  height: 58px;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(20px);
  z-index: 20;
}
.account-body {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 28px 84px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.page-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.page-sub { margin: 6px 0 0; font-size: 14.5px; color: #737373; }

/* Summary Row (Lovable 4742c1eb + Cofounder 399ce73a 2-column top) */
.summary-split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
}
.surface-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.surface-card.soft { background: #fafafa; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.kpi-card {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-label { font-size: 12.5px; color: #737373; font-weight: 500; }
.kpi-val {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.kpi-sub { font-size: 12px; color: #737373; font-family: var(--font-mono); }

.dual-progress {
  height: 10px;
  border-radius: 9999px;
  background: #ededed;
  overflow: hidden;
  display: flex;
}
.dual-seg-a { background: #000000; height: 100%; transition: width 0.45s var(--ease-expo); }
.dual-seg-b { background: #737373; height: 100%; transition: width 0.45s var(--ease-expo); }

/* Usage SVG Chart */
.chart-box {
  width: 100%;
  overflow-x: auto;
}
.usage-svg { width: 100%; height: 220px; display: block; }
.chart-tooltip {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #525252;
  min-height: 20px;
}

/* Model Breakdown List */
.breakdown-list { display: flex; flex-direction: column; gap: 12px; }
.breakdown-row { display: flex; flex-direction: column; gap: 5px; }
.breakdown-meta { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 500; }

/* Audit-Grade Ruled Tables (Credit Ledger, API Keys, Invoices) */
.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  height: 32px;
  padding: 0 13px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #525252;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.filter-pill.is-active { background: #000000; color: #ffffff; border-color: #000000; }

.data-table-wrap {
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
  font-size: 13px;
}
.data-table thead th {
  background: #fafafa;
  color: #525252;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  color: #171717;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #fcfcfd; }

.delta-neg { font-family: var(--font-mono); font-weight: 600; color: #000000; white-space: nowrap; }
.delta-pos { font-family: var(--font-mono); font-weight: 600; color: var(--success); white-space: nowrap; }

.tag-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f2f2f3;
  color: #262626;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.tag-chip.ok { background: var(--success-bg); color: var(--success); border-color: rgba(21, 128, 61, 0.2); }
.tag-chip.revoked { background: var(--danger-bg); color: var(--danger); border-color: rgba(185, 28, 28, 0.2); }

/* Billing Plans Grid & Top-up Packs */
.acc-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.acc-plan-card {
  background: #f5f5f6;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.acc-plan-card.is-inverted { background: #000000; color: #ffffff; border-color: #000000; }
.acc-plan-card.is-inverted .plan-muted { color: #a3a3a8; }
.plan-muted { font-size: 13.5px; color: #737373; margin: 0; }

.bf-banner {
  background: #0a0a0c;
  color: #ffffff;
  border-radius: 16px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.bf-banner-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.bf-pill-dark {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 9999px;
  background: #ffffff;
  color: #000000;
}
.bf-code-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}
.price-strike {
  font-family: var(--font-mono);
  font-size: 14px;
  color: #8c8c94;
  text-decoration: line-through;
}
.acc-plan-card.is-inverted .price-strike { color: #71717a; }

.packs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.pack-card {
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 18px 20px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Secret Key Reveal Banner */
.secret-banner {
  padding: 16px 18px;
  border-radius: 14px;
  background: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.code-snippet {
  background: #0a0a0c;
  color: #e4e4e7;
  border-radius: 14px;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 0;
}

/* Modal & Crisp Bottom-Right Toast (fal.ai 774190b9) */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.dialog-backdrop.is-open { display: flex; }
.dialog-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 32px 72px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast-item {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 14px;
  padding: 13px 16px;
  box-shadow: 0 18px 42px -12px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toastIn 0.24s var(--ease-expo);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.toast-dot { width: 8px; height: 8px; border-radius: 9999px; margin-top: 6px; flex-shrink: 0; background: var(--success); }
.toast-dot.err { background: var(--danger); }
.toast-title { font-size: 13.5px; font-weight: 600; color: #000000; }
.toast-sub { font-size: 12.5px; color: #737373; margin-top: 2px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 980px) {
  .auth-split { grid-template-columns: minmax(0, 1fr); }
  .auth-cinema { min-height: 220px; padding: 24px; }
  .studio-shell, .account-shell { grid-template-columns: minmax(0, 1fr); }
  .studio-rail, .account-rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 272px;
    z-index: 70;
    transform: translateX(-105%);
    transition: transform 0.26s var(--ease-expo);
    box-shadow: 16px 0 40px rgba(0, 0, 0, 0.16);
  }
  .studio-rail.is-open, .account-rail.is-open { transform: translateX(0); }
  .mobile-rail-btn { display: inline-flex; }
  .summary-split, .kpi-grid, .acc-plans-grid, .packs-grid, .split-msg-grid, .empty-prompts {
    grid-template-columns: minmax(0, 1fr);
  }
  .account-body { padding: 24px 18px 64px; }
  .account-topbar { padding: 0 16px; }
  .zdr-pill { display: none; }
}
@media (max-width: 760px) {
  .acc-crumb-sep, .acc-crumb-text { display: none; }
  .toast-stack { right: 14px; left: 14px; bottom: 14px; }
  .toast-item { min-width: 0; max-width: none; }
}
