:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111;
  --bg-card: #161616;
  --bg-card-hover: #1a1a1a;
  --text-primary: #e0e0e0;
  --text-secondary: #707070;
  --text-muted: #454545;
  --border: #222;
  --accent: #00d992;
  --accent-dim: #00d99220;
  --radius: 4px;
  --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
}

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

html {
  font-size: 13px;
}

body {
  font-family: var(--font-mono);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.header h1 {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header h1::before {
  content: '~';
  color: var(--text-muted);
}

.main {
  flex: 1;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.group {
  flex: 1;
  min-width: 160px;
  max-width: 240px;
}

.group-title {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.group-title::before {
  content: '#';
  color: var(--text-muted);
}

.app-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.app-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.15s ease;
  font-size: 0.975rem;
  user-select: none;
}

.app-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.app-card:hover .app-icon {
  opacity: 1;
}

.app-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 2px;
}

.app-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.footer {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.empty-state,
.error-state {
  padding: 3rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state p,
.error-state p {
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
}

.empty-state code {
  color: var(--accent);
}

.error-state h2 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.retry-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.375rem 0.75rem;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.75rem;
  transition: all 0.15s ease;
}

.retry-link:hover {
  background: var(--accent-dim);
}

/* Context Menu */
.context-menu {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 0;
  min-width: 140px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  display: none;
}

.context-menu.show {
  display: block;
}

.context-menu-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.1s ease;
}

.context-menu-item:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  width: 320px;
  max-width: 90vw;
}

.modal-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.modal-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.modal-input:focus {
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: flex-end;
}

.modal-btn {
  padding: 0.375rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-btn-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.modal-btn-cancel:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.modal-btn-save {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--bg-primary);
}

.modal-btn-save:hover {
  opacity: 0.9;
}

@media (max-width: 640px) {
  html {
    font-size: 12px;
  }

  .container {
    padding: 1.5rem 1rem;
  }

  .main {
    flex-direction: column;
    gap: 1.5rem;
  }

  .group {
    max-width: none;
    width: 100%;
  }

  .app-grid {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .app-card {
    flex: 1;
    min-width: 140px;
  }
}
