/* =====================================================================
   Billoff AI Lab — Prompt Editor · Liquid Glass Dark Theme
   ===================================================================== */

/* ─── Page base ─────────────────────────────────────────────────────── */
.editor-page {
  background-color: #070B14;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 60px 60px;
  min-height: 100vh;
  padding-bottom: 100px;
  color: rgba(255,255,255,.9);
}

/* ─── Top bar ───────────────────────────────────────────────────────── */
.editor-topbar {
  position: sticky;
  top: 58px;
  z-index: 90;
  background: rgba(7,11,20,.82);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 4px 20px rgba(0,0,0,.4);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.editor-topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 58px;
}

/* ─── Method tabs ────────────────────────────────────────────────────── */
.editor-method-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  flex-shrink: 0;
}
.e-method-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 9px;
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
  transition: all .18s;
  font-family: inherit;
}
.e-method-tab:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(224,75,75,.4);
  color: rgba(255,255,255,.85);
}
.e-method-tab.active {
  background: #E04B4B;
  border-color: rgba(255,255,255,.15);
  color: #fff;
  box-shadow: 0 0 18px rgba(224,75,75,.35), inset 0 1px 0 rgba(255,255,255,.12);
}
.e-tab-icon { font-size: 15px; }
.e-tab-model {
  font-size: 10px; font-weight: 500; opacity: .7; margin-left: 4px;
}
.e-method-tab.active .e-tab-model { opacity: .85; }

/* ─── Top bar actions ────────────────────────────────────────────────── */
.editor-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.e-save-status {
  font-size: 12px;
  color: #6EE7B7;
  font-weight: 600;
  transition: opacity .4s;
  min-width: 180px;
  text-align: right;
}

/* ─── Buttons ────────────────────────────────────────────────────────── */
.e-btn {
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  border: 1px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}
.e-btn-sm { padding: 5px 10px; font-size: 12px; }
.e-btn-primary {
  background: #E04B4B; color: #fff;
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 0 18px rgba(224,75,75,.3), inset 0 1px 0 rgba(255,255,255,.12);
}
.e-btn-primary:hover { background: #c93d3d; box-shadow: 0 0 28px rgba(224,75,75,.45); }
.e-btn-outline {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.65);
  border-color: rgba(255,255,255,.10);
  backdrop-filter: blur(8px);
}
.e-btn-outline:hover {
  background: rgba(255,255,255,.10);
  border-color: rgba(224,75,75,.4);
  color: rgba(255,255,255,.9);
}
.e-btn-ghost {
  background: transparent;
  color: rgba(255,255,255,.4);
  border-color: transparent;
}
.e-btn-ghost:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.8); }

/* ─── Layout: sidebar + main ──────────────────────────────────────────── */
.editor-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 0;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar { display: none; }
}

/* ─── Sidebar ─────────────────────────────────────────────────────────── */
.editor-sidebar {
  position: sticky;
  top: 130px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  padding: 16px 12px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.06);
}
.e-sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.35);
  padding: 0 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: 8px;
}
.e-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.e-sidebar-item:hover {
  background: rgba(255,255,255,.07);
  color: #E04B4B;
  text-decoration: none;
}

/* ─── Panel ────────────────────────────────────────────────────────────── */
.e-panel { display: flex; flex-direction: column; gap: 16px; }
.e-panel.hidden { display: none; }

/* ─── Sections ─────────────────────────────────────────────────────────── */
.e-section {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow .22s, border-color .22s;
  scroll-margin-top: 140px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.06);
}
.e-section::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  position: relative;
  margin-top: -1px;
}
.e-section.highlighted {
  border-color: rgba(224,75,75,.4);
  box-shadow: 0 0 0 1px rgba(224,75,75,.15), 0 8px 32px rgba(0,0,0,.45);
}
.e-section-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.04);
}
.e-section-icon { font-size: 20px; margin-top: 2px; flex-shrink: 0; }
.e-section-title { font-size: 16px; font-weight: 700; color: rgba(255,255,255,.92); }
.e-section-sub   { font-size: 12px; color: rgba(255,255,255,.4); margin-top: 3px; }
.e-section-badge {
  margin-left: auto; flex-shrink: 0;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
}
.e-section-badge.v1 {
  background: rgba(224,75,75,.15);
  color: #FCA5A5;
  border: 1px solid rgba(224,75,75,.3);
}
.e-section-body { padding: 24px; display: flex; flex-direction: column; gap: 18px; }

/* ─── Form elements ──────────────────────────────────────────────────────── */
.e-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.e-field { display: flex; flex-direction: column; gap: 6px; }
.e-field label {
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,.65);
}
.e-input, .e-select {
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
  transition: border-color .15s, background .15s;
  outline: none;
}
.e-input:focus, .e-select:focus {
  border-color: rgba(224,75,75,.5);
  background: rgba(255,255,255,.09);
  box-shadow: 0 0 0 3px rgba(224,75,75,.08);
}
.e-select option { background: #0E1220; color: rgba(255,255,255,.9); }
.e-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
  resize: vertical;
  outline: none;
  transition: border-color .15s, background .15s;
  box-sizing: border-box;
  line-height: 1.6;
}
.e-textarea:focus {
  border-color: rgba(224,75,75,.5);
  background: rgba(255,255,255,.09);
}
.e-textarea::placeholder { color: rgba(255,255,255,.25); }
.e-textarea.e-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  background: rgba(0,0,0,.3);
  color: #A5F3FC;
}
.e-range {
  width: 100%;
  accent-color: #E04B4B;
}
.e-val {
  font-weight: 700;
  color: #E04B4B;
  text-shadow: 0 0 10px rgba(224,75,75,.4);
  margin-left: 6px;
}
.e-tone-info {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  padding: 8px 12px;
  background: rgba(255,255,255,.04);
  border-radius: 8px;
  font-style: italic;
  border: 1px solid rgba(255,255,255,.06);
}

/* ─── Fields grid ─────────────────────────────────────────────────────────── */
.e-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.e-field-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.65);
}
.e-field-check:hover {
  border-color: rgba(224,75,75,.4);
  background: rgba(224,75,75,.07);
  color: rgba(255,255,255,.9);
}
.e-field-check.required { opacity: .6; cursor: default; }
.e-field-check input { accent-color: #E04B4B; width: 16px; height: 16px; }
.e-required-badge {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(224,75,75,.15);
  color: #FCA5A5;
  border: 1px solid rgba(224,75,75,.25);
}

/* ─── Search passes ───────────────────────────────────────────────────────── */
.e-search-pass {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 11px;
  overflow: hidden;
  background: rgba(255,255,255,.03);
}
.e-pass-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.e-pass-num {
  padding: 2px 8px;
  border-radius: 6px;
  background: #E04B4B;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(224,75,75,.3);
}
.e-pass-label { font-size: 13px; font-weight: 600; flex: 1; color: rgba(255,255,255,.8); }
.e-pass-cost { font-size: 12px; color: rgba(255,255,255,.35); font-weight: 500; }
.e-search-pass .e-textarea { border: none; border-radius: 0; background: rgba(0,0,0,.2); }

/* ─── Variable hints ──────────────────────────────────────────────────────── */
.e-var-hint {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  padding: 10px 14px;
  line-height: 1.7;
}
.e-var-hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,.09);
  font-size: 11px;
  font-family: monospace;
  color: #A5F3FC;
  margin: 0 2px;
}
.e-var-hint p { margin: 6px 0 0; }

/* ─── Article plan list ───────────────────────────────────────────────────── */
.e-plan-list { display: flex; flex-direction: column; gap: 8px; }
.e-plan-item {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 11px;
  overflow: hidden;
  background: rgba(255,255,255,.04);
}
.e-plan-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,.05);
}
.e-plan-toggle input { width: 17px; height: 17px; accent-color: #E04B4B; cursor: pointer; }
.e-plan-num {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.35);
  min-width: 24px;
}
.e-plan-title-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  transition: border-color .15s;
}
.e-plan-title-input:focus { border-color: rgba(224,75,75,.5); }
.e-plan-expand {
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 6px;
  font-size: 11px;
  background: rgba(255,255,255,.05);
  cursor: pointer;
  color: rgba(255,255,255,.45);
  transition: all .15s;
}
.e-plan-expand:hover { background: rgba(255,255,255,.1); color: rgba(255,255,255,.8); }
.e-plan-hint {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.15);
  font-size: 12px;
  color: rgba(255,255,255,.45);
  line-height: 1.6;
}
.e-plan-hint.collapsed { display: none; }
.e-plan-hint p { margin: 0 0 8px; }

/* ─── Method banners (V2/V3/V4) ─────────────────────────────────────────── */
.e-method-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 13px;
  margin-bottom: 4px;
}
.v2-banner {
  background: rgba(59,130,246,.09);
  border: 1px solid rgba(59,130,246,.25);
}
.v3-banner {
  background: rgba(6,182,212,.09);
  border: 1px solid rgba(6,182,212,.25);
}
.v4-banner {
  background: rgba(168,85,247,.09);
  border: 1px solid rgba(168,85,247,.25);
}
.e-banner-icon { font-size: 28px; }
.e-method-banner strong { font-size: 15px; font-weight: 700; display: block; color: rgba(255,255,255,.9); }
.e-method-banner span  { font-size: 12px; color: rgba(255,255,255,.45); }
.e-banner-model {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.7);
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.10);
}

/* ─── Preview ─────────────────────────────────────────────────────────────── */
.e-preview {
  background: rgba(0,0,0,.5);
  color: #A5F3FC;
  padding: 16px;
  border-radius: 10px;
  font-size: 11px;
  font-family: 'SF Mono','Fira Code',monospace;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.55;
  border: 1px solid rgba(255,255,255,.08);
}

/* ─── Bottom save bar ──────────────────────────────────────────────────────── */
.editor-bottom-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(7,11,20,.92);
  border-top: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 -4px 24px rgba(0,0,0,.5);
  padding: 14px 24px;
  transform: translateY(100%);
  transition: transform .22s cubic-bezier(.2,.8,.3,1);
  z-index: 100;
  backdrop-filter: blur(20px);
}
.editor-bottom-bar.dirty { transform: translateY(0); }
.editor-bottom-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.e-unsaved-msg { font-size: 13px; font-weight: 600; color: #FCD34D; }
.editor-bottom-actions { display: flex; gap: 10px; align-items: center; }

/* ─── Rewrite Architecture Compare ──────────────────────────────────────── */
.e-section-info { background: rgba(255,255,255,.03); }
.e-arch-compare {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.e-arch-card {
  flex: 1;
  min-width: 200px;
  border-radius: 11px;
  padding: 14px 16px;
  border: 1px solid;
}
.e-arch-v1 {
  background: rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.3);
}
.e-arch-rewrite {
  background: rgba(16,185,129,.08);
  border-color: rgba(16,185,129,.3);
}
.e-arch-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.e-arch-v1 .e-arch-label { color: #FCD34D; }
.e-arch-rewrite .e-arch-label { color: #6EE7B7; }
.e-arch-desc { font-size: 12px; color: rgba(255,255,255,.55); line-height: 1.55; margin-bottom: 6px; }
.e-arch-cost {
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px; display: inline-block;
}
.e-arch-v1 .e-arch-cost { background: rgba(245,158,11,.2); color: #FCD34D; }
.e-arch-rewrite .e-arch-cost { background: rgba(16,185,129,.2); color: #6EE7B7; }
.e-arch-arrow { font-size: 24px; color: rgba(255,255,255,.25); flex-shrink: 0; }

/* ─── Plan description list ──────────────────────────────────────────────── */
.e-plan-descriptions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 700px) { .e-plan-descriptions { grid-template-columns: 1fr; } }
.e-plan-desc-item {
  font-size: 12px;
  line-height: 1.55;
  padding: 10px 12px;
  background: rgba(255,255,255,.04);
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.55);
}
.e-plan-desc-item strong { color: rgba(255,255,255,.82); display: block; margin-bottom: 3px; }
