:root {
  color-scheme: light;
  --bg: #f3f7ff;
  --bg-alt: #e9f0ff;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --line: #d3def4;
  --text: #102a43;
  --muted: #52667d;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --success: #16a34a;
  --danger: #dc2626;

  /* ===== ADDED: filter color states ===== */
  --chip-bg: #ffffff;
  --chip-hover: #f1f5ff;
  --chip-active-bg: #4f46e5;
  --chip-active-text: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Segoe UI, system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #dbeafe 0%, #f0f9ff 35%, #fef3c7 100%);
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 320px 1fr; }

.sidebar {
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
  border-right: 1px solid var(--line);
}

.workspace { padding: 1rem 1.2rem 2rem; }

.muted { color: var(--muted); }

.tool-list {
  display: grid;
  gap: .5rem;
  max-height: 72vh;
  overflow: auto;
}

.tool-btn {
  width: 100%;
  text-align: left;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: .7rem;
  padding: .65rem .7rem;
  cursor: pointer;
  transition: all .2s ease; /* ADDED */
}

.tool-btn small { display: block; color: var(--muted); }

.tool-btn:hover { background: #eef3ff; } /* ADDED */

.tool-btn.active {
  border-color: var(--accent);
  background: #e9e7ff;
}


/* ===================================================== */
/* ===== FILTER CHIPS (IMPROVED VISIBILITY) ============= */
/* ===================================================== */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .75rem 0;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .8rem;
  cursor: pointer;
  background: var(--chip-bg);
  color: var(--text);
  transition: all .2s ease; /* ADDED */
}

/* hover effect */
.chip:hover {
  background: var(--chip-hover);
  border-color: var(--accent);
}

/* ACTIVE FILTER */
.chip.active {
  border-color: var(--accent);
  background: var(--chip-active-bg);   /* CHANGED */
  color: var(--chip-active-text);      /* CHANGED */
  font-weight: 600;                    /* ADDED */
  box-shadow: 0 3px 10px rgba(79,70,229,.25); /* ADDED */
}


/* ===================================================== */

#tool-search, input, select, textarea, button {
  border-radius: .55rem;
  border: 1px solid #c7d6f2;
  background: #fff;
  color: var(--text);
  padding: .55rem .65rem;
}

button {
  cursor: pointer;
  border: none;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

button.secondary {
  background: #fff;
  border: 1px solid #c7d6f2;
  color: var(--text);
}

button.danger { background: var(--danger); }

.drop-zone {
  border: 2px dashed #93b4f4;
  border-radius: .8rem;
  padding: 1rem;
  text-align: center;
  color: #23406d;
  margin-bottom: .9rem;
  background: rgba(255,255,255,.65);
}

.drop-zone.active {
  border-color: var(--accent);
  background: #e9e7ff;
}

.panel {
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: .9rem;
  padding: 1rem;
  display: grid;
  gap: .8rem;
}

.row {
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-wrap: wrap;
}

.status {
  min-height: 1.4rem;
  color: #1d4ed8;
  margin-bottom: .5rem;
  font-weight: 500;
}

.progress {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #86efac);
  transition: width .2s;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
}

.thumb {
  border: 1px solid #dbe3f5;
  border-radius: .5rem;
  padding: .35rem;
  background: #fff;
}

.drag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}

.drag-item {
  padding: .5rem .65rem;
  border: 1px solid #dbe3f5;
  border-radius: .5rem;
  background: #fff;
  cursor: grab;
}

textarea {
  width: 100%;
  min-height: 180px;
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); }
}
