:root {
  --bg-dark: #080c14;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-card-active: rgba(30, 41, 59, 0.95);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-sky: #0ea5e9;
  --accent-sky-hover: #0284c7;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --code-bg: #030712;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px -5px rgba(99, 102, 241, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Background Ambient Glows */
.glow-bg {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}
.glow-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  right: -100px;
  background: radial-gradient(circle, #6366f1, #3b82f6 70%, transparent);
}
.glow-2 {
  width: 450px;
  height: 450px;
  bottom: 50px;
  left: -100px;
  background: radial-gradient(circle, #0ea5e9, #8b5cf6 70%, transparent);
}

/* App Layout */
.app-layout {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-sky));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}
.brand-text h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.brand-text h1 span {
  background: linear-gradient(to right, #818cf8, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-tag {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Header Center Active Switcher */
.header-center {
  display: flex;
  align-items: center;
}
.active-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.active-badge-pill:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}
.active-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.active-badge-pill strong {
  font-size: 0.9rem;
  color: #e0e7ff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.server-status-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: #6ee7b7;
}
.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  flex: 1;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}
.tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(14, 165, 233, 0.2));
  color: #ffffff;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.tab-badge {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.75rem;
  padding: 1px 7px;
  border-radius: 9999px;
}

/* Tab panes */
.tab-pane {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.25s ease-out;
}
.tab-pane.active {
  display: flex;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards general */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

/* Active Hero Card */
.hero-workspace-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-color: rgba(99, 102, 241, 0.25);
  position: relative;
  overflow: hidden;
}
.hero-workspace-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--accent-primary), var(--accent-sky), var(--accent-emerald));
}
.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #38bdf8;
  margin-bottom: 0.25rem;
}
.hero-title-area h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Handover Notice Box in Workspace Tab */
.handover-notice-box {
  display: flex;
  gap: 0.9rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  align-items: flex-start;
}
.notice-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.notice-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.notice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.notice-header strong {
  font-size: 0.92rem;
  color: #a7f3d0;
}
.notice-action {
  font-size: 0.88rem;
  color: #e2e8f0;
}
.notice-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-top: 0.4rem;
  border-top: 1px dashed rgba(16, 185, 129, 0.2);
}
.author-tag {
  font-size: 0.78rem;
  color: #94a3b8;
}
.btn-link {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color 0.2s;
}
.btn-link:hover {
  color: #7dd3fc;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-accent {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid var(--border-glass);
}

/* Export Section */
.export-banner {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: #e2e8f0;
}
.export-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.25rem;
  margin-bottom: 1.25rem;
}

/* Action Cards Grid */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.action-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  gap: 1.25rem;
  transition: all 0.2s ease;
}
.action-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}
.vscode-card {
  border-left: 3px solid #007acc;
}
.antigravity-card {
  border-left: 3px solid var(--accent-primary);
}
.action-card-header {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}
.action-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vscode-icon {
  background: rgba(0, 122, 204, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(0, 122, 204, 0.3);
}
.agy-icon {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.action-card-text h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}
.action-card-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.action-card-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.btn-group-row {
  display: flex;
  gap: 0.5rem;
}
.btn-group-row .btn {
  flex: 1;
}

/* Buttons general */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  line-height: 1;
  min-height: 42px;
}
.btn:active {
  transform: scale(0.98);
}
.btn-block {
  width: 100%;
}
.btn-sm {
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  min-height: 36px;
}
.btn-lg {
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  min-height: 48px;
}
.btn-primary {
  background: #0284c7;
  color: white;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}
.btn-primary:hover {
  background: #0369a1;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}
.btn-accent {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.btn-accent:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-color: var(--border-glass);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}
.btn-outline {
  background: transparent;
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
}
.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.3);
}
.btn-danger:hover {
  background: rgba(244, 63, 94, 0.3);
  color: white;
}

/* Tools Overview */
.tools-overview-section {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.section-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chip {
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 10px;
  border-radius: 9999px;
  color: var(--text-muted);
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.tool-pill-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: all 0.2s;
}
.tool-pill-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.3);
}
.tool-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: #a5b4fc;
}
.tool-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Code Preview Section */
.code-preview-section {
  background: var(--code-bg);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-glass);
}
.code-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: #cbd5e1;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-copy:hover {
  background: rgba(255, 255, 255, 0.16);
  color: white;
}
pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.5;
  color: #c7d2fe;
}
.setup-hint {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: rgba(99, 102, 241, 0.08);
  border-top: 1px solid rgba(99, 102, 241, 0.15);
  font-size: 0.82rem;
  color: #c7d2fe;
}
.setup-hint code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  color: #f1f5f9;
  font-family: var(--font-mono);
}

/* ============================================================== */
/* WORKLOG & HANDOVER TAB STYLING                                */
/* ============================================================== */
.worklog-container-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.worklog-top-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-glass);
}
.chip-enforce {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}
.worklog-title-area h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}
.worklog-current-status-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 220px;
}
.worklog-current-status-box .label {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.worklog-current-status-box strong {
  font-size: 1.15rem;
  color: #fff;
}
.status-indicator-tag {
  font-size: 0.82rem;
  font-weight: 600;
  color: #6ee7b7;
}

/* Form for New Worklog Entry */
.new-entry-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.new-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border-glass);
}
.new-entry-header h3 {
  font-size: 1.1rem;
  color: #e2e8f0;
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-group {
  margin-bottom: 0.9rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}
.required {
  color: var(--accent-rose);
}
.form-group input, .form-group textarea, .form-select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.35);
  color: white;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(0, 0, 0, 0.5);
}
.form-select {
  cursor: pointer;
}
.form-actions-right {
  display: flex;
  justify-content: flex-end;
}

/* Timeline */
.worklog-history-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.history-header h3 {
  font-size: 1.15rem;
  color: #e2e8f0;
}
.worklog-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.timeline-item {
  display: flex;
  gap: 1rem;
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 36px;
  left: 17px;
  bottom: -15px;
  width: 2px;
  background: rgba(255, 255, 255, 0.1);
}
.timeline-marker {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  border: 2px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #a5b4fc;
}
.timeline-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.timeline-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.timeline-date {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}
.timeline-details {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #cbd5e1;
}
.timeline-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.timeline-label {
  color: var(--text-muted);
  font-weight: 600;
  min-width: 120px;
}

/* Tab 3: All MCPs Grid */
.section-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.mcps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.mcp-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.25s ease;
  position: relative;
}
.mcp-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.mcp-card.is-active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 25px -5px rgba(99, 102, 241, 0.35);
}
.mcp-card-top {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.mcp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mcp-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mcp-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}
.mcp-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mcp-card-worklog-badge {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.worklog-status-line {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  color: #e2e8f0;
}
.worklog-note-snippet {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mcp-card-tools-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}
.tool-tag {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 2px 7px;
  border-radius: 4px;
  color: #94a3b8;
}
.mcp-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-glass);
}
.card-btn-row {
  display: flex;
  gap: 0.5rem;
}
.card-btn-row .btn {
  flex: 1;
}

/* Tab 4: Create Form */
.form-card {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}
.form-header {
  margin-bottom: 1.5rem;
}
.form-help {
  display: block;
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 1;
  transition: opacity 0.25s ease;
}
.modal-overlay.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}
.modal-dialog {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px -10px rgba(99, 102, 241, 0.25);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.modal-large {
  max-width: 900px;
}
@keyframes modalPop {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
}
.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.modal-icon {
  font-size: 1.75rem;
}
.modal-title-wrap h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}
.modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.2);
}

/* Modal MCP Grid Selection */
.modal-mcp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
.modal-mcp-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 1rem;
}
.modal-mcp-card:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateX(3px);
}
.modal-mcp-card.active-selected {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.18);
}
.modal-mcp-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.modal-mcp-info h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.modal-mcp-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.modal-mcp-last-handover {
  font-size: 0.78rem;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 0.2rem;
}

/* File Explorer Layout in Modal */
.file-explorer-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  min-height: 380px;
}
.file-sidebar {
  border-right: 1px solid var(--border-glass);
  padding-right: 0.75rem;
}
.sidebar-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}
.file-tree-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.file-tree-item {
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s;
}
.file-tree-item:hover, .file-tree-item.active {
  background: rgba(99, 102, 241, 0.2);
  color: #e0e7ff;
}
.file-content-pane {
  display: flex;
  flex-direction: column;
  background: var(--code-bg);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.file-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: #94a3b8;
}
.file-content-pane pre {
  flex: 1;
  max-height: 400px;
  overflow: auto;
}

/* Toast Container */
.toast-container {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #1e293b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  animation: slideToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}
.toast-success {
  border-left: 4px solid var(--accent-emerald);
}
.toast-info {
  border-left: 4px solid var(--accent-sky);
}
@keyframes slideToast {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================== */
/* MOBILE & RESPONSIVE DESIGN OPTIMIZATIONS                     */
/* ============================================================== */
@media (max-width: 840px) {
  .action-grid {
    grid-template-columns: 1fr;
  }
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  .file-explorer-layout {
    grid-template-columns: 1fr;
  }
  .file-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.75rem;
  }
}

@media (max-width: 640px) {
  body {
    padding: 0;
  }
  .app-layout {
    padding: 0.75rem 0.65rem 4rem 0.65rem;
    gap: 1rem;
  }
  .app-header {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem;
    gap: 0.75rem;
  }
  .header-brand {
    justify-content: space-between;
  }
  .header-center {
    width: 100%;
  }
  .active-badge-pill {
    width: 100%;
    justify-content: center;
    padding: 0.6rem;
  }
  .header-actions {
    justify-content: space-between;
    width: 100%;
  }
  .hero-workspace-card {
    padding: 1.1rem;
    gap: 1.1rem;
  }
  .hero-title-area h2 {
    font-size: 1.5rem;
  }
  .card {
    padding: 1.1rem;
    border-radius: var(--radius-md);
  }
  .export-banner {
    padding: 1rem 0.85rem;
  }
  .action-card {
    padding: 1rem 0.85rem;
  }
  .btn-group-row {
    flex-direction: column;
  }
  .tools-grid {
    grid-template-columns: 1fr;
  }
  .mcps-grid {
    grid-template-columns: 1fr;
  }
  .modal-dialog {
    max-height: 90vh;
    border-radius: var(--radius-md);
  }
  .modal-header {
    padding: 1rem;
  }
  .modal-body {
    padding: 1rem;
  }
  .modal-footer {
    padding: 0.75rem 1rem;
    flex-direction: column-reverse;
  }
  .modal-footer .btn {
    width: 100%;
  }
  .modal-mcp-card {
    padding: 0.85rem;
    flex-direction: column;
    align-items: flex-start;
  }
  .modal-mcp-card .btn {
    width: 100%;
  }
  .timeline-label {
    min-width: 90px;
  }
}
