:root {
  --bg: #06080e;
  --surface: rgba(15, 22, 36, 0.85);
  --surface-hover: rgba(23, 33, 54, 0.95);
  --border: rgba(255, 255, 255, 0.08);
  --cyan: #00e5ff;
  --emerald: #10b981;
  --violet: #8b5cf6;
  --amber: #f59e0b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --subtle: #64748b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 10% 10%, rgba(0, 229, 255, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.07) 0%, transparent 45%);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
}

.os-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.4rem 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(16px);
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 0.9rem; }

.os-orb {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(139, 92, 246, 0.25));
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.15);
}

.brand h1 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.accent { color: var(--cyan); }
.subtitle { font-size: 0.78rem; color: var(--muted); }

.spotlight-trigger {
  flex: 1;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

.spotlight-trigger:hover { border-color: rgba(0, 229, 255, 0.4); color: var(--text); }
.spotlight-trigger kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }

.btn-engine {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn-engine:hover { border-color: var(--cyan); }

.engine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}
.engine-dot.online { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.95rem;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-github:hover { background: rgba(255, 255, 255, 0.12); }

/* Hero */
.hero-banner {
  background: linear-gradient(135deg, rgba(15, 22, 36, 0.9), rgba(24, 18, 46, 0.85));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.6rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-copy { max-width: 720px; }
.pill-live {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}

.hero-copy h2 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.45rem; }
.gradient-text {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-copy p { font-size: 0.9rem; color: var(--muted); }
.hero-copy code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.hero-metrics { display: flex; gap: 1.25rem; }
.h-metric {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  text-align: center;
  min-width: 110px;
}
.h-metric b { display: block; font-family: var(--font-mono); font-size: 1.5rem; color: var(--cyan); }
.h-metric span { font-size: 0.75rem; color: var(--muted); }

/* Filters */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.filter-pills { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.filter-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s;
}
.filter-pill:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); }
.filter-pill.active {
  background: rgba(0, 229, 255, 0.14);
  border-color: rgba(0, 229, 255, 0.45);
  color: var(--cyan);
}
.shortcut-hint { font-size: 0.78rem; color: var(--subtle); }
.shortcut-hint kbd {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--text);
}

/* Main Workspace */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 370px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 1080px) {
  .workspace-grid { grid-template-columns: 1fr; }
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.1rem;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 229, 255, 0.4);
  background: var(--surface-hover);
}

.app-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.app-icon-title { display: flex; align-items: center; gap: 0.7rem; }
.app-emoji {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}
.app-card h3 { font-size: 1.05rem; font-weight: 700; }
.app-day { font-family: var(--font-mono); font-size: 0.7rem; color: var(--cyan); }
.app-desc { font-size: 0.84rem; color: var(--muted); flex: 1; }

.app-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.app-actions {
  display: flex;
  gap: 0.6rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  transition: all 0.2s;
}
.btn-primary {
  flex: 1;
  background: linear-gradient(135deg, var(--cyan), #00a8ff);
  color: #06080e;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }

/* Digest Sidebar */
.digest-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panel-head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-head h3 { font-size: 0.95rem; font-weight: 700; }
.panel-sub { font-size: 0.74rem; color: var(--subtle); }
.btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 7px;
  cursor: pointer;
}
.digest-body {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 500px;
  overflow-y: auto;
}
.digest-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.75rem 0.9rem;
}
.digest-item a {
  color: var(--cyan);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  display: block;
  margin-bottom: 0.25rem;
}
.digest-item a:hover { text-decoration: underline; }
.digest-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--subtle); }
.loading-box { font-size: 0.82rem; color: var(--muted); padding: 1.5rem 0; text-align: center; }

.panel-foot {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.8rem;
}
.panel-foot a { color: var(--cyan); text-decoration: none; font-weight: 600; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 10, 0.78);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 1rem;
}
.modal-backdrop.hidden { display: none; }

.spotlight-box {
  width: 100%;
  max-width: 600px;
  background: #0d1322;
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}
.spotlight-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid var(--border);
  color: var(--cyan);
}
.spotlight-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.98rem;
  outline: none;
  font-family: var(--font-sans);
}
.spotlight-input-wrap kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  color: var(--muted);
}
.spotlight-results { max-height: 360px; overflow-y: auto; padding: 0.5rem; }
.spot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border-radius: 9px;
  text-decoration: none;
  color: var(--text);
  gap: 0.8rem;
}
.spot-item:hover { background: rgba(0, 229, 255, 0.12); }
.spot-left { display: flex; align-items: center; gap: 0.75rem; }
.spot-sub { font-size: 0.76rem; color: var(--muted); display: block; }

.settings-box {
  width: 100%;
  max-width: 520px;
  background: #0d1322;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; }
.btn-close { background: none; border: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; }
.modal-desc { font-size: 0.82rem; color: var(--muted); }
.modal-desc code { font-family: var(--font-mono); color: var(--cyan); }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.form-group input, .form-group select {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: var(--cyan); }
.form-group select option { background: #0d1322; }
.test-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--emerald);
}
.test-status.error {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fda4af;
}
.test-status.hidden { display: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.7rem; margin-top: 0.4rem; }

.os-footer {
  margin-top: auto;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--subtle);
}
.os-footer a { color: var(--cyan); text-decoration: none; }

