:root {
  --bg-main: #090c13;
  --bg-sidebar: #0d121c;
  --bg-card: #121824;
  --bg-card-hover: #182030;
  --bg-input: #111723;
  --border: #1c2638;
  --border-active: #2f4060;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-purple: #8a2be2;
  --accent-emerald: #10b981;
  --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #8a2be2 100%);
  --sidebar-width: 280px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

/* App Layout */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}

.sidebar-header {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.35);
}

.brand-title {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 1.5px;
  display: block;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-actions {
  padding: 16px;
}

.btn-new-chat {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-new-chat:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.15);
  transform: translateY(-1px);
}

.chat-history-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

.history-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 10px 8px 6px 8px;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.chat-item:hover {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

.chat-item.active {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
  border-left: 3px solid var(--accent-cyan);
}

.chat-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 8px;
}

.chat-item-del {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
}

.chat-item:hover .chat-item-del {
  display: block;
}

.chat-item-del:hover {
  color: #ef4444;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.btn-settings-footer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-settings-footer:hover {
  background-color: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}

.user-profile-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.user-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-pill {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.plan-pill.free { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.plan-pill.pro { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.plan-pill.ultra { background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(138, 43, 226, 0.2)); color: #00f2fe; border: 1px solid rgba(0, 242, 254, 0.3); }
.plan-pill.admin { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

.user-quota-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-sidebar-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  color: var(--accent-cyan);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 6px;
  transition: all 0.2s;
}

.btn-sidebar-link:hover {
  background: rgba(0, 242, 254, 0.16);
  border-color: var(--accent-cyan);
}

.btn-logout-footer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
  margin-top: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-logout-footer:hover {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.08);
}

/* Main Workspace */
.main-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  background: radial-gradient(circle at 50% 10%, #101626 0%, var(--bg-main) 70%);
}

/* Header */
.workspace-header {
  height: 64px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background-color: rgba(13, 18, 28, 0.7);
  backdrop-filter: blur(12px);
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.btn-icon:hover {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

#btn-close-sidebar {
  display: none;
}

/* Model Selector */
.model-selector-wrapper {
  position: relative;
}

.model-badge-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.model-badge-btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-active);
}

.provider-pill {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
}

.provider-pill.gemini {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
}

/* Dropdown */
.models-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 200;
  max-height: 480px;
  overflow-y: auto;
}

.models-dropdown.open {
  display: flex;
}

.dropdown-header {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 8px 10px 4px 10px;
}

.dropdown-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  padding: 8px 10px 4px 10px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.dropdown-group-title:first-of-type {
  border-top: none;
  margin-top: 0;
}

.model-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.model-option:hover {
  background-color: var(--bg-card-hover);
}

.model-option.active {
  background-color: rgba(0, 242, 254, 0.1);
  border-left: 3px solid var(--accent-cyan);
}

.opt-name {
  font-size: 13.5px;
  font-weight: 500;
}

.opt-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.tag-astra {
  background: linear-gradient(135deg, #00f2fe, #8a2be2);
  color: #000;
}

.tag-flagship {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.tag-fast {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.tag-reasoning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.tag-gemini {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.status-indicator-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  background-color: var(--bg-card);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

/* Messages Area */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
}

.welcome-screen {
  max-width: 760px;
  margin: auto;
  text-align: center;
  padding: 40px 16px;
}

.welcome-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(0, 242, 254, 0.25);
  margin-bottom: 20px;
}

.welcome-title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 36px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.prompt-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  text-align: left;
}

.prompt-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prompt-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Chat Messages */
.messages-list {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.message-row {
  display: flex;
  gap: 14px;
  width: 100%;
}

.message-row.user {
  justify-content: flex-end;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.avatar.assistant {
  background: var(--accent-gradient);
  color: #000;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
}

.avatar.user {
  background-color: #3b82f6;
  color: #fff;
}

.message-body {
  max-width: 85%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.message-row.user .message-body {
  max-width: 75%;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.model-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent-cyan);
}

.message-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
}

.message-row.user .message-content {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-color: #334155;
  color: #f8fafc;
}

/* Reasoning Thought Block */
.reasoning-accordion {
  background-color: rgba(18, 24, 36, 0.6);
  border: 1px solid #1e2d45;
  border-left: 3px solid #f59e0b;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.reasoning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: rgba(245, 158, 11, 0.06);
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  font-weight: 600;
  color: #fbbf24;
}

.reasoning-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reasoning-icon {
  animation: pulseBrain 2s infinite ease-in-out;
}

@keyframes pulseBrain {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.reasoning-content {
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #cbd5e1;
  font-family: 'JetBrains Mono', monospace;
  white-space: pre-wrap;
  border-top: 1px solid #1e2d45;
  background-color: #0b0f19;
  max-height: 300px;
  overflow-y: auto;
}

.reasoning-accordion.collapsed .reasoning-content {
  display: none;
}

/* Markdown styling inside assistant messages */
.message-content p {
  margin-bottom: 12px;
}
.message-content p:last-child {
  margin-bottom: 0;
}

.message-content pre {
  background-color: #090c13;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 12px 0;
  overflow-x: auto;
  position: relative;
}

.code-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background-color: #111723;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.btn-copy-code {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-copy-code:hover {
  color: var(--accent-cyan);
}

.message-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
}

.message-content pre code {
  display: block;
  padding: 12px 14px;
}

.message-content ul, .message-content ol {
  margin: 8px 0 12px 20px;
}

.message-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
  font-size: 13.5px;
}

.message-content th, .message-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.message-content th {
  background-color: var(--bg-card-hover);
  font-weight: 600;
}

/* Input Dock */
.input-dock {
  padding: 0 20px 20px 20px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}

.input-card {
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 14px 8px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s;
}

.input-card:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 18px rgba(0, 242, 254, 0.15);
}

.input-meta-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}

.meta-label {
  color: var(--text-muted);
  font-weight: 600;
}

.btn-effort {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-effort.active {
  background-color: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fbbf24;
  font-weight: 600;
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

#chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  max-height: 200px;
  outline: none;
  padding: 6px 0;
}

.btn-send, .btn-stop {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-send {
  background: var(--accent-gradient);
  color: #000;
}

.btn-send:hover {
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.4);
  transform: scale(1.04);
}

.btn-stop {
  background-color: #ef4444;
  color: #fff;
}

.input-footer-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.modal-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, .form-group textarea {
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--accent-cyan);
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.modal-footer {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border);
  background-color: rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: var(--accent-gradient);
  border: none;
  color: #000;
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.4);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
}

/* PIN Modal specific */
.modal-pin-card {
  text-align: center;
  padding: 36px 28px;
}

.pin-brand-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px auto;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.modal-pin-card h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.modal-pin-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.btn-block {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  margin-top: 12px;
}

.pin-error {
  color: #ef4444;
  font-size: 12px;
  margin-top: 6px;
}

/* Responsive Mobile */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    height: 100%;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
  }

  #btn-close-sidebar {
    display: flex;
  }

  .workspace-header {
    padding: 0 16px;
  }

  .welcome-title {
    font-size: 28px;
  }

  .message-body {
    max-width: 92%;
  }

  .input-dock {
    padding: 0 12px 12px 12px;
  }
}

/* PC Agent Badge */
.pc-agent-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
}

.pc-agent-badge.online {
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.pc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #64748b;
}

.pc-agent-badge.online .pc-dot {
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Install PWA Button */
.btn-install-pwa {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: var(--accent-cyan);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-install-pwa:hover {
  background: var(--accent-gradient);
  color: #000;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

/* Key status in settings */
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.key-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.key-status-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.key-status-badge.missing {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-block {
  width: 100%;
}

/* Sovereign Auth Overlay (Integrated into main app - No /login.html in URL) */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 20%, #151d30 0%, #080b11 85%);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10000;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 242, 254, 0.08);
  transition: max-width 0.25s ease;
}

.auth-card.wide-plans {
  max-width: 620px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand .brand-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 12px auto;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-tabs {
  display: flex;
  background-color: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.auth-tab.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-error {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: none;
  margin-bottom: 16px;
}

.auth-success {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: none;
  margin-bottom: 16px;
}

.auth-footer-note {
  text-align: center;
  margin-top: 20px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Cakto Plans Selection Grid */
.auth-plans-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plans-pitch-note {
  font-size: 12.5px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.45;
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid rgba(0, 242, 254, 0.15);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.checkout-plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 4px;
}

@media (max-width: 560px) {
  .checkout-plans-grid {
    grid-template-columns: 1fr;
  }
  .auth-card {
    max-width: 100% !important;
  }
}

.checkout-plan-card {
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.2s;
}

.checkout-plan-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.checkout-plan-card.popular {
  border-color: rgba(0, 242, 254, 0.5);
  background: linear-gradient(180deg, rgba(14, 26, 46, 0.9) 0%, rgba(17, 23, 35, 0.9) 100%);
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.12);
}

.checkout-plan-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  align-self: flex-start;
  margin-bottom: 8px;
}

.checkout-plan-badge.pro {
  background: rgba(79, 172, 254, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(79, 172, 254, 0.3);
}

.checkout-plan-badge.ultra {
  background: var(--accent-gradient);
  color: #000;
  font-weight: 800;
}

.checkout-plan-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.checkout-plan-price {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.checkout-plan-price span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.checkout-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.checkout-plan-features li {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.checkout-plan-card.popular .checkout-plan-features li {
  color: var(--text-primary);
}

.btn-checkout-plan {
  display: block;
  text-align: center;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: auto;
}

.btn-checkout-plan.pro {
  background: rgba(79, 172, 254, 0.15);
  border: 1px solid rgba(79, 172, 254, 0.4);
  color: #60a5fa;
}

.btn-checkout-plan.pro:hover {
  background: rgba(79, 172, 254, 0.3);
  color: #fff;
  box-shadow: 0 0 12px rgba(79, 172, 254, 0.3);
}

.btn-checkout-plan.ultra {
  background: var(--accent-gradient);
  border: none;
  color: #000;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.3);
}

.btn-checkout-plan.ultra:hover {
  transform: scale(1.02);
  box-shadow: 0 0 22px rgba(0, 242, 254, 0.5);
}



