#aetheris-tool-library {
  --tool-bg-glass: rgba(25, 32, 42, 0.4);
  --tool-bg-glass-strong: rgba(25, 32, 42, 0.58);
  --tool-text-primary: #f5fbff;
  --tool-text-secondary: rgba(226, 236, 246, 0.68);
  --tool-accent: #7ef4e5;
  --tool-accent-strong: #37d8c5;
  --tool-border: rgba(126, 244, 229, 0.22);
  --tool-border-soft: rgba(255, 255, 255, 0.1);
  --tool-danger: #ff7c9b;
  --tool-radius: 22px;
  --tool-radius-sm: 14px;
  --tool-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  --tool-font-sans: "Geist", "Hanken Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tool-font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  position: relative;
  z-index: 20;
  width: 100%;
  height: min(700px, calc(100vh - 110px));
  min-height: 440px;
  padding: clamp(12px, 2vw, 24px);
  color: var(--tool-text-primary);
  font-family: var(--tool-font-sans);
  box-sizing: border-box;
  isolation: isolate;
}

.page-work.aetheris-page-active > .work-layout,
.page-work.aetheris-page-active > #agentConfigurator,
.page-work.aetheris-page-active > #agentWorkbench,
.page-work.aetheris-page-active > #projectModal {
  display: none !important;
}

.page-work.aetheris-page-active {
  display: grid;
  place-items: center;
  padding: clamp(54px, 7vh, 68px) clamp(12px, 2.6vw, 36px) clamp(16px, 3vh, 24px);
  overflow: hidden;
}

#aetheris-tool-library *,
#aetheris-tool-library *::before,
#aetheris-tool-library *::after {
  box-sizing: border-box;
}

#aetheris-tool-library .atl-shell {
  width: min(1420px, 100%);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(460px, 1.18fr);
  gap: clamp(18px, 2.4vw, 32px);
  align-items: stretch;
}

#aetheris-tool-library .atl-glass {
  background: var(--tool-bg-glass);
  border: 1px solid var(--tool-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--tool-shadow);
}

#aetheris-tool-library .atl-panel {
  border-radius: var(--tool-radius);
  padding: clamp(16px, 1.8vw, 22px);
  overflow: hidden;
}

#aetheris-tool-library .atl-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 244, 229, 0.38) transparent;
}

#aetheris-tool-library .atl-left::-webkit-scrollbar { width: 6px; }
#aetheris-tool-library .atl-left::-webkit-scrollbar-thumb {
  background: rgba(126, 244, 229, 0.26);
  border-radius: 999px;
}

#aetheris-tool-library .atl-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--tool-border);
  border-radius: 999px;
  color: var(--tool-accent);
  font-family: var(--tool-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(126, 244, 229, 0.06);
}

#aetheris-tool-library .atl-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--tool-accent);
  box-shadow: 0 0 18px var(--tool-accent);
}

#aetheris-tool-library .atl-title {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 760;
}

#aetheris-tool-library .atl-title span {
  color: var(--tool-accent);
  text-shadow: 0 0 28px rgba(126, 244, 229, 0.34);
}

#aetheris-tool-library .atl-desc {
  margin: 0;
  max-width: 58ch;
  color: var(--tool-text-secondary);
  font-size: 13px;
  line-height: 1.58;
}

#aetheris-tool-library .atl-filter-grid {
  display: grid;
  gap: 9px;
}

#aetheris-tool-library .atl-field {
  display: grid;
  gap: 7px;
}

#aetheris-tool-library .atl-label {
  color: rgba(245, 251, 255, 0.78);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--tool-font-mono);
}

#aetheris-tool-library .atl-select-wrap {
  position: relative;
}

#aetheris-tool-library .atl-select-wrap::after {
  content: "keyboard_arrow_down";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-family: "Material Symbols Rounded";
  font-size: 21px;
  color: var(--tool-accent);
}

#aetheris-tool-library select,
#aetheris-tool-library textarea,
#aetheris-tool-library button {
  font: inherit;
}

#aetheris-tool-library select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--tool-border-soft);
  border-radius: var(--tool-radius-sm);
  background: rgba(7, 12, 18, 0.32);
  color: var(--tool-text-primary);
  min-height: 40px;
  padding: 0 44px 0 14px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  cursor: pointer;
}

#aetheris-tool-library select:hover,
#aetheris-tool-library select:focus {
  border-color: var(--tool-border);
  background: rgba(7, 12, 18, 0.46);
  box-shadow: 0 0 0 3px rgba(126, 244, 229, 0.08);
}

#aetheris-tool-library option {
  background: #111822;
  color: #f5fbff;
}

#aetheris-tool-library .atl-tool-card,
#aetheris-tool-library .atl-selected-tools {
  display: grid;
  gap: 10px;
  padding: 13px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--tool-border-soft);
}

#aetheris-tool-library .atl-tool-head,
#aetheris-tool-library .atl-selected-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

#aetheris-tool-library .atl-tool-name,
#aetheris-tool-library .atl-selected-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 720;
}

#aetheris-tool-library .atl-tool-meta {
  color: var(--tool-text-secondary);
  font-size: 12px;
  line-height: 1.48;
  margin: 4px 0 0;
}

#aetheris-tool-library .atl-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  color: #06110f;
  background: var(--tool-accent);
  box-shadow: 0 0 24px rgba(126, 244, 229, 0.42);
  font-family: "Material Symbols Rounded";
  font-size: 24px;
}

#aetheris-tool-library .atl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#aetheris-tool-library .atl-tag {
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(126, 244, 229, 0.18);
  background: rgba(126, 244, 229, 0.06);
  color: rgba(236, 250, 249, 0.82);
  font-size: 12px;
}

#aetheris-tool-library .atl-selected-count {
  color: var(--tool-accent);
  font-family: var(--tool-font-mono);
  font-size: 12px;
}

#aetheris-tool-library .atl-selected-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#aetheris-tool-library .atl-selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--tool-border-soft);
  border-radius: 14px;
  background: rgba(7, 12, 18, 0.28);
}

#aetheris-tool-library .atl-selected-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#aetheris-tool-library .atl-remove,
#aetheris-tool-library .atl-add-tool,
#aetheris-tool-library .atl-next {
  border: 1px solid var(--tool-border-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--tool-text-primary);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

#aetheris-tool-library .atl-remove {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--tool-danger);
}

#aetheris-tool-library .atl-add-tool,
#aetheris-tool-library .atl-next {
  min-height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
}

#aetheris-tool-library .atl-remove:hover,
#aetheris-tool-library .atl-add-tool:hover,
#aetheris-tool-library .atl-next:hover {
  transform: translateY(-1px);
  border-color: var(--tool-border);
  background: rgba(126, 244, 229, 0.08);
  color: var(--tool-accent);
}

#aetheris-tool-library .atl-route {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

#aetheris-tool-library .atl-route-item {
  min-height: 72px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--tool-border-soft);
  background: rgba(255, 255, 255, 0.035);
}

#aetheris-tool-library .atl-route-step {
  display: block;
  color: var(--tool-accent);
  font-family: var(--tool-font-mono);
  font-size: 11px;
  margin-bottom: 6px;
}

#aetheris-tool-library .atl-route-item strong {
  display: block;
  font-size: 12px;
  line-height: 1.35;
}

#aetheris-tool-library .atl-route-item p {
  margin: 4px 0 0;
  color: var(--tool-text-secondary);
  font-size: 11px;
  line-height: 1.38;
}

#aetheris-tool-library .atl-left-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 2px;
}

#aetheris-tool-library .atl-right {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  border-radius: var(--tool-radius);
  overflow: hidden;
}

#aetheris-tool-library .atl-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--tool-border-soft);
  background: rgba(255, 255, 255, 0.035);
}

#aetheris-tool-library .atl-dots {
  display: flex;
  gap: 8px;
}

#aetheris-tool-library .atl-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

#aetheris-tool-library .atl-dot:nth-child(1) { background: #ff7b7b; }
#aetheris-tool-library .atl-dot:nth-child(2) { background: #ffd166; }
#aetheris-tool-library .atl-dot:nth-child(3) { background: var(--tool-accent); }

#aetheris-tool-library .atl-window-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--tool-font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#aetheris-tool-library .atl-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--tool-text-secondary);
  font-family: var(--tool-font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#aetheris-tool-library .atl-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--tool-accent);
  animation: atl-idle-pulse 1.7s infinite;
}

@keyframes atl-idle-pulse {
  0% { box-shadow: 0 0 0 0 rgba(126, 244, 229, 0.56); }
  70% { box-shadow: 0 0 0 10px rgba(126, 244, 229, 0); }
  100% { box-shadow: 0 0 0 0 rgba(126, 244, 229, 0); }
}

#aetheris-tool-library .atl-chat {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(12px, 1.6vw, 20px);
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 244, 229, 0.38) transparent;
}

#aetheris-tool-library .atl-chat::-webkit-scrollbar { width: 8px; }
#aetheris-tool-library .atl-chat::-webkit-scrollbar-thumb {
  background: rgba(126, 244, 229, 0.3);
  border-radius: 999px;
}

#aetheris-tool-library .atl-message {
  width: min(88%, 640px);
  padding: 12px 13px;
  border-radius: 18px;
  border: 1px solid var(--tool-border-soft);
  color: rgba(245, 251, 255, 0.9);
  line-height: 1.75;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.045);
}

#aetheris-tool-library .atl-message.agent {
  align-self: flex-start;
  border-color: rgba(126, 244, 229, 0.18);
  background: rgba(126, 244, 229, 0.07);
}

#aetheris-tool-library .atl-message.user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.07);
}

#aetheris-tool-library .atl-message strong {
  color: var(--tool-accent);
  font-weight: 700;
}

#aetheris-tool-library .atl-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

#aetheris-tool-library .atl-result {
  padding: 9px;
  border-radius: 14px;
  border: 1px solid rgba(126, 244, 229, 0.16);
  background: rgba(8, 14, 20, 0.26);
}

#aetheris-tool-library .atl-result b {
  display: block;
  color: var(--tool-text-primary);
  font-size: 13px;
  margin-bottom: 5px;
}

#aetheris-tool-library .atl-result span {
  color: var(--tool-text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

#aetheris-tool-library .atl-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 14px 10px;
  border-top: 1px solid var(--tool-border-soft);
  background: rgba(255, 255, 255, 0.025);
}

#aetheris-tool-library .atl-prompt {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(126, 244, 229, 0.16);
  border-radius: 999px;
  background: rgba(126, 244, 229, 0.06);
  color: rgba(236, 250, 249, 0.86);
  cursor: pointer;
}

#aetheris-tool-library .atl-prompt:hover {
  border-color: var(--tool-border);
  color: var(--tool-accent);
}

#aetheris-tool-library .atl-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--tool-border-soft);
  background: rgba(255, 255, 255, 0.035);
}

#aetheris-tool-library .atl-textarea-wrap {
  position: relative;
  min-width: 0;
  grid-column: 1 / 2;
  grid-row: 1;
}

#aetheris-tool-library textarea {
  width: 100%;
  min-height: 44px;
  max-height: 150px;
  resize: none;
  overflow: hidden;
  padding: 11px 13px;
  border-radius: 16px;
  outline: none;
  border: 1px solid var(--tool-border-soft);
  background: rgba(7, 12, 18, 0.34);
  color: var(--tool-text-primary);
  line-height: 1.55;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

#aetheris-tool-library textarea::placeholder {
  color: rgba(226, 236, 246, 0.42);
}

#aetheris-tool-library textarea:hover,
#aetheris-tool-library textarea:focus {
  border-color: var(--tool-border);
  background: rgba(7, 12, 18, 0.48);
  box-shadow: 0 0 0 3px rgba(126, 244, 229, 0.08);
}

#aetheris-tool-library .atl-send {
  width: 46px;
  height: 46px;
  grid-column: 2 / 3;
  grid-row: 1;
  border: 0;
  border-radius: 17px;
  color: #06110f;
  background: var(--tool-accent);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 0 22px rgba(126, 244, 229, 0.34);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

#aetheris-tool-library .atl-send:hover {
  transform: translateY(-2px);
  background: var(--tool-accent-strong);
  box-shadow: 0 0 34px rgba(126, 244, 229, 0.58);
}

#aetheris-tool-library .atl-send:active {
  transform: translateY(0);
}

#aetheris-tool-library .atl-run-controls {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

#aetheris-tool-library .atl-file-control,
#aetheris-tool-library .atl-output-control {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--tool-border-soft);
  border-radius: 999px;
  background: rgba(7, 12, 18, 0.28);
  color: rgba(236, 250, 249, 0.82);
  font-size: 12px;
}

#aetheris-tool-library .atl-file-control {
  max-width: min(100%, 330px);
  padding: 0 12px;
}

#aetheris-tool-library .atl-file-control input {
  min-width: 0;
  max-width: 245px;
  color: var(--tool-text-secondary);
  font: inherit;
  font-size: 12px;
}

#aetheris-tool-library .atl-file-control input::file-selector-button {
  min-height: 26px;
  margin-right: 8px;
  border: 1px solid rgba(126, 244, 229, 0.2);
  border-radius: 999px;
  background: rgba(126, 244, 229, 0.08);
  color: var(--tool-accent);
  cursor: pointer;
}

#aetheris-tool-library .atl-output-control {
  padding-left: 12px;
}

#aetheris-tool-library .atl-output-control select {
  width: auto;
  min-width: 132px;
  min-height: 32px;
  border: 0;
  border-left: 1px solid var(--tool-border-soft);
  border-radius: 0 999px 999px 0;
  background: rgba(255, 255, 255, 0.04);
}

#aetheris-tool-library .atl-control-label {
  color: var(--tool-accent);
  font-family: var(--tool-font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

#aetheris-tool-library .material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400;
}

@media (max-width: 980px) {
  .page-work.aetheris-page-active {
    overflow-y: auto;
    place-items: start stretch;
  }

  #aetheris-tool-library {
    height: auto;
    min-height: auto;
    padding: 24px 16px;
  }

  #aetheris-tool-library .atl-shell {
    grid-template-columns: 1fr;
  }

  #aetheris-tool-library .atl-left,
  #aetheris-tool-library .atl-right {
    min-height: auto;
    height: auto;
  }

  #aetheris-tool-library .atl-right {
    min-height: 620px;
  }

  #aetheris-tool-library .atl-route,
  #aetheris-tool-library .atl-result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .page-work.aetheris-page-active {
    padding: 78px 10px 28px;
  }

  #aetheris-tool-library .atl-composer,
  #aetheris-tool-library .atl-left-footer {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  #aetheris-tool-library .atl-add-tool,
  #aetheris-tool-library .atl-next,
  #aetheris-tool-library .atl-send {
    width: 100%;
  }

  #aetheris-tool-library .atl-textarea-wrap,
  #aetheris-tool-library .atl-send,
  #aetheris-tool-library .atl-run-controls {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  #aetheris-tool-library .atl-file-control,
  #aetheris-tool-library .atl-output-control,
  #aetheris-tool-library .atl-output-control select {
    width: 100%;
    max-width: none;
  }

  #aetheris-tool-library .atl-message {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #aetheris-tool-library *,
  #aetheris-tool-library *::before,
  #aetheris-tool-library *::after {
    animation: none !important;
    transition: none !important;
  }
}
