@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root {
  --bg: #0F0F13;
  --card: rgba(25, 25, 30, 0.6);
  --primary: #FE2C55;
  --primary-hover: #E02447;
  --cyan: #25F4EE;
  --cyan-hover: #1DD2CD;
  --success: #10b981;
  --txt: #FFFFFF;
  --txt-mut: #D1D5DB;
  --border: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(37, 244, 238, 0.5);
  --glow-pink: rgba(254, 44, 85, 0.15);
  --glow-cyan: rgba(37, 244, 238, 0.15);
}
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}
html, body {
  width: 360px; 
  height: 600px;
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 0% 0%, var(--glow-pink) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, var(--glow-cyan) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--txt); 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-y: auto; 
  overflow-x: hidden;
}
body::-webkit-scrollbar {
  width: 6px;
}
body::-webkit-scrollbar-track {
  background: transparent;
}
body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
.app { 
  padding: 20px 16px; 
  display: flex; 
  flex-direction: column; 
  gap: 16px; 
}
.hdr { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  padding-bottom: 16px; 
  border-bottom: 1px solid var(--border); 
}
.logo { 
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: none;
}
.logo img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.hdr-tt h1 { 
  font-size: 16px; 
  font-weight: 700; 
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #FFFFFF, #E2E2E2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hdr-tt p { 
  font-size: 12px; 
  color: var(--cyan); 
  font-weight: 500;
  margin-top: 2px;
}
.status-badge { 
  margin-left: auto; 
  font-size: 11px; 
  font-weight: 600; 
  padding: 4px 10px; 
  border-radius: 20px; 
  background: rgba(255, 255, 255, 0.1); 
  color: #E5E7EB; 
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}
.status-badge.active { 
  background: rgba(37, 244, 238, 0.1); 
  color: var(--cyan); 
  border-color: rgba(37, 244, 238, 0.3);
  box-shadow: 0 0 10px rgba(37, 244, 238, 0.2);
}
.card { 
  background: var(--card); 
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); 
  border-radius: 16px; 
  padding: 16px; 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}
.card-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}
.card h3 { 
  font-size: 14px; 
  font-weight: 600; 
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h3 svg {
  color: var(--txt-mut);
}
.desc { 
  font-size: 12px; 
  color: var(--txt-mut); 
  line-height: 1.4; 
}
.field-group { 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
}
.label { 
  font-size: 11px; 
  font-weight: 600; 
  color: var(--txt-mut); 
  letter-spacing: 0.02em;
}
.input { 
  background: rgba(0, 0, 0, 0.4); 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  padding: 10px 12px; 
  color: var(--txt); 
  font-size: 13px; 
  font-family: 'Inter', sans-serif;
  outline: none; 
  width: 100%;
  transition: all 0.2s ease;
}
.input:focus { 
  border-color: var(--cyan); 
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 0 3px rgba(37, 244, 238, 0.15);
}
.input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.file-picker { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
}
.file-name { 
  font-size: 11px; 
  color: var(--cyan); 
  word-break: break-all; 
  background: rgba(37, 244, 238, 0.05);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px dashed rgba(37, 244, 238, 0.2);
}
.qa-builder { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
}
.qa-list { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  max-height: 140px; 
  overflow-y: auto; 
  padding-right: 4px;
}
.qa-list::-webkit-scrollbar {
  width: 4px;
}
.qa-list::-webkit-scrollbar-track {
  background: transparent;
}
.qa-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.qa-item { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  background: rgba(0, 0, 0, 0.3); 
  border: 1px solid var(--border); 
  padding: 8px 12px; 
  border-radius: 8px; 
  font-size: 12px; 
  transition: all 0.2s ease;
}
.qa-item:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.15);
}
.qa-item-trig { 
  color: var(--cyan); 
  font-weight: 600; 
}
.btn { 
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none; 
  border-radius: 10px; 
  padding: 12px; 
  font-size: 13px; 
  font-weight: 600; 
  cursor: pointer; 
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
  width: 100%;
  font-family: 'Inter', sans-serif;
}
.btn:active {
  transform: scale(0.98);
}
.btn.primary { 
  background: var(--primary); 
  color: white; 
  box-shadow: 0 4px 12px rgba(254, 44, 85, 0.25);
}
.btn.primary:hover { 
  background: var(--primary-hover); 
  box-shadow: 0 6px 16px rgba(254, 44, 85, 0.35);
}
.btn.success { 
  background: var(--primary); 
  color: white; 
  box-shadow: 0 4px 12px rgba(254, 44, 85, 0.25);
}
.btn.success:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(254, 44, 85, 0.35);
}
.btn.ghost { 
  background: rgba(255, 255, 255, 0.05); 
  color: var(--txt); 
  border: 1px solid var(--border); 
}
.btn.ghost:hover { 
  background: rgba(255, 255, 255, 0.1); 
  border-color: rgba(255, 255, 255, 0.2);
}
.btn.danger {
  background: rgba(254, 44, 85, 0.15);
  color: var(--primary);
  border: 1px solid rgba(254, 44, 85, 0.3);
}
.btn.danger:hover {
  background: rgba(254, 44, 85, 0.25);
  border-color: rgba(254, 44, 85, 0.5);
}
.switch { 
  position: relative; 
  display: inline-block; 
  width: 44px; 
  height: 24px; 
}
.switch input { 
  opacity: 0; 
  width: 0; 
  height: 0; 
}
.slider { 
  position: absolute; 
  cursor: pointer; 
  top: 0; left: 0; right: 0; bottom: 0; 
  background-color: rgba(255, 255, 255, 0.15); 
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1); 
  border-radius: 24px; 
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.slider:before { 
  position: absolute; 
  content: ""; 
  height: 18px; 
  width: 18px; 
  left: 2px; 
  bottom: 2px; 
  background-color: white; 
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1); 
  border-radius: 50%; 
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider { 
  background-color: var(--cyan); 
  border-color: var(--cyan);
}
input:checked + .slider:before { 
  transform: translateX(20px); 
}
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.tabs-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 16px;
}
.tab-btn {
  flex: 1;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 6px;
  color: var(--txt-mut);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--txt);
}
.tab-btn.active {
  background: rgba(37, 244, 238, 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
}
.tab-content {
  display: none;
  flex-direction: column;
  gap: 16px;
}
.tab-content.active {
  display: flex;
}

/* SaaS Login Overlay */
#login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 19, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
#login-overlay.hidden {
  display: none;
}
.login-box {
  width: 100%;
  max-width: 320px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.login-box h2 {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, #FFFFFF, #E2E2E2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-box p {
  font-size: 12px;
  color: var(--txt-mut);
  line-height: 1.4;
}
#login-error {
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  display: none;
}
