/* Three account-owned views of the same tool catalog. */
@media screen {
  .nordic-shell main.tools-library {
    --tool-row: 52px;
    background: var(--da-panel);
  }
  .tools-library .tools-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 22px;
  }
  .tools-library .tools-heading h1 {
    font-size: 30px;
    margin: 0;
  }
  .tools-heading > label {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .tools-heading select {
    min-width: 190px;
  }
  .tools-heading p {
    flex-basis: 100%;
    font-size: 12px;
    margin: 0;
  }
  .tools-heading p:empty {
    display: none;
  }
  .tools-library .tools-groups {
    column-count: 2;
    column-gap: 38px;
  }
  .tools-library .tool-group {
    break-inside: avoid;
    margin: 0 0 28px;
  }
  .tools-library .tool-group > .section-title {
    font-size: 22px;
    margin: 0 0 6px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--da-line);
    position: relative;
  }
  .tools-library .tool-group > .section-title::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 70px;
    border-bottom: 3px solid var(--da-teal);
  }
  .tools-library .tool-group > .grid {
    display: block;
  }
  .nordic-shell .tools-library .module {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: var(--tool-row);
    border: 0;
    border-bottom: 1px solid var(--da-line);
    border-radius: 0;
    padding: 7px 0;
    box-shadow: none;
    background: transparent;
    cursor: pointer;
  }
  .tools-library .module:hover {
    background: var(--da-soft);
  }
  .tools-library .module:focus-within {
    outline: 2px solid var(--da-teal);
    outline-offset: 2px;
  }
  .tools-library .module[hidden],
  .tools-library .tool-group[hidden],
  .tools-library .grid[hidden],
  .tools-library [hidden] {
    display: none !important;
  }
  .tool-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    object-fit: contain;
  }
  .tool-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 4px 8px;
    align-items: center;
    flex-wrap: wrap;
  }
  .nordic-shell .tools-library .module h3 {
    font-size: 14px;
    font-family: var(--da-font, Inter, sans-serif);
    line-height: 1.45;
    letter-spacing: 0;
    font-weight: 600;
    margin: 0;
    padding: 0;
    min-width: 0;
  }
  .tools-library .tool-open {
    background: transparent !important;
    border: 0 !important;
    padding: 4px 0 !important;
    margin: 0 !important;
    color: var(--da-text) !important;
    text-align: left;
    box-shadow: none;
    white-space: normal;
    font-size: 14px;
    font-weight: 600;
    min-height: 32px;
  }
  .tools-library .tool-open:disabled {
    cursor: not-allowed;
  }
  .nordic-shell .tools-library .module p {
    margin: 0;
    line-height: 1.4;
    flex-basis: 100%;
    font-size: 12px;
  }
  .tools-library .tool-copy > p {
    display: none;
  }
  .tools-library .module[data-tool-id="ventstudio"] .tool-copy > p {
    display: block;
  }
  .tools-library .module .badge {
    position: static;
    font-size: 10px;
    padding: 2px 6px;
    border: 0;
    background: var(--da-soft);
    color: var(--da-muted);
  }
  .tools-library .module .badge[data-state="published"] {
    display: none;
  }
  .tool-category {
    display: none;
  }
  .tool-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
  }
  .nordic-shell .tools-library .da-favorite {
    position: static;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 5px;
    border: 0 !important;
    background: transparent !important;
    color: var(--da-text);
  }
  .tool-row-actions img {
    width: 18px;
    height: 18px;
  }
  .tool-arrow {
    display: flex;
    align-items: center;
  }
  .tool-more {
    position: relative;
  }
  .tool-more > summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    cursor: pointer;
    border-radius: 4px;
  }
  .tool-more > summary::-webkit-details-marker {
    display: none;
  }
  .tool-more[open] {
    z-index: 30;
  }
  .tool-more[open] > summary {
    background: var(--da-soft);
  }
  .tool-popup {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    width: 250px;
    max-width: calc(100vw - 40px);
    padding: 14px;
    background: var(--da-panel);
    border: 1px solid var(--da-line);
    border-radius: 8px;
    box-shadow: 0 8px 24px #142b401a;
    cursor: default;
  }
  .tools-library .tool-popup .developer-quick {
    display: grid;
    gap: 8px;
    margin: 0 0 10px;
    padding: 0;
    border: 0;
  }
  .tool-popup select,
  .tool-popup button {
    width: 100%;
  }
  .tool-popup p,
  .tool-popup small {
    display: block;
    font-size: 12px !important;
    line-height: 1.5;
  }
  .tool-popup small {
    color: var(--da-muted);
    margin-top: 8px;
  }
  .tool-favorites {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--da-soft);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 24px;
  }
  .tool-favorites > img {
    width: 20px;
    height: 20px;
  }
  .tool-favorites > strong {
    font-size: 14px;
    margin-right: 8px;
  }
  .tool-favorites > button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent !important;
    border: 0 !important;
    padding: 5px 8px;
    min-height: 32px;
    font-size: 13px;
  }
  .tool-favorites button img {
    width: 16px;
    height: 16px;
  }
  .tools-library[data-tool-layout="list"] .tools-groups {
    column-count: auto;
  }
  .tools-library[data-tool-layout="list"] .tool-group,
  .tools-library[data-tool-layout="list"] .tool-group > .grid {
    display: contents;
  }
  .tools-library[data-tool-layout="list"] .tool-group > .section-title {
    display: none;
  }
  .tools-library[data-tool-layout="list"] .tool-copy {
    display: block;
  }
  .tools-library[data-tool-layout="list"] .tool-copy > p {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .tools-library[data-tool-layout="list"] .tool-category {
    display: block;
    width: 140px;
    flex-shrink: 0;
    color: var(--da-muted);
    font-size: 12px;
  }
  .tools-library[data-tool-layout="list"] .tool-copy > .badge {
    display: none;
  }
  .tools-library[data-tool-layout="tiles"] .tools-groups {
    column-count: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
  .tools-library[data-tool-layout="tiles"] .tool-group,
  .tools-library[data-tool-layout="tiles"] .tool-group > .grid {
    display: contents;
  }
  .tools-library[data-tool-layout="tiles"] .tool-group > .section-title {
    display: none;
  }
  .nordic-shell .tools-library[data-tool-layout="tiles"] .module {
    position: relative;
    align-items: flex-start;
    min-height: 118px;
    padding: 16px 12px;
    border: 1px solid var(--da-line);
    border-radius: 8px;
    background: var(--da-panel);
    gap: 10px;
  }
  .tools-library[data-tool-layout="tiles"] .tool-row-actions {
    position: absolute;
    bottom: 5px;
    right: 5px;
  }
  .tools-library[data-tool-layout="tiles"] .tool-copy > p {
    display: none;
  }
  .tools-library[data-tool-layout="tiles"] .tool-arrow {
    display: none;
  }
  .tools-library[data-tool-layout="tiles"] .tool-copy {
    padding-bottom: 20px;
  }
  [data-da-theme="dark"] .tools-library img {
    filter: brightness(0) invert(0.9);
  }
  @media (max-width: 1100px) {
    .tools-library .tools-groups {
      column-gap: 24px;
    }
    .tools-library[data-tool-layout="tiles"] .tools-groups {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .tool-arrow {
      display: none;
    }
  }
  @media (max-width: 800px) {
    .tools-library .tools-groups {
      column-count: 1;
    }
    .tools-library[data-tool-layout="tiles"] .tools-groups {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .tools-library[data-tool-layout="list"] .tool-category {
      display: none;
    }
    .tools-library .tools-heading > label {
      margin-left: 0;
    }
    .tools-library .tools-heading h1 {
      font-size: 26px;
    }
    .tools-library .tool-more > summary,
    .nordic-shell .tools-library .da-favorite {
      min-width: 36px;
      min-height: 36px;
    }
    .tools-library .tool-open {
      min-height: 36px;
    }
    .tools-library .tool-row-actions {
      gap: 2px;
    }
    .tools-library[data-tool-layout="tiles"] .tool-popup {
      position: fixed;
      left: 16px;
      right: 16px;
      bottom: 16px;
      top: auto;
      width: auto;
      max-width: none;
      max-height: 70dvh;
      overflow: auto;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .tools-library * {
      scroll-behavior: auto;
    }
  }
}
