.common-tools-panel[hidden] { display: none !important; }
body.tools-catalog-mode #cardsScroll,
body.tools-catalog-mode .lottery-inline-panel,
body.tools-catalog-mode .collector-catalog-panel { display: none !important; }
body.tools-catalog-mode .page-shell > .site-footer { display: none !important; }

.common-tools-panel {
  margin-top: 0;
  padding: 0 0 22px;
}

/* The tools page is a section of the active site scene, not a second page
   surface. Keep its outer shell transparent while the groups and cards retain
   their own hierarchy. */
html.ng-skin-active .page-shell .common-tools-panel {
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--ng-ink);
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.common-tools-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 0;
}

.common-tools-heading > div { flex: 1 1 auto; min-width: 0; }
.common-tools-heading p,
.common-tools-group-head p {
  margin: 0;
  color: #6b7890;
  font-size: 14px;
}

.common-tools-group {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #e0e7f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16, 24, 40, .05);
}

.common-tools-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.common-tools-group-head h3 {
  margin: 0;
  color: #172338;
  font-size: 18px;
}

.common-tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.common-tool-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 11px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #e2e8f2;
  border-radius: 15px;
  background: #f9fbff;
}

.common-tool-mark {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(145deg, #2f6bff, #5b91ff);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.02em;
  box-shadow: 0 8px 18px rgba(47, 107, 255, .22);
}
.common-tool-mark.has-logo {
  overflow: hidden;
  border: 1px solid rgba(116, 134, 171, .2);
  background: #fff;
  box-shadow: 0 8px 18px rgba(34, 52, 88, .12);
}
.common-tool-mark img {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 5px;
  border-radius: inherit;
  object-fit: contain;
  background: #fff;
}

.common-tool-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.common-tool-copy strong {
  overflow: hidden;
  color: #18243a;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.common-tool-copy span {
  overflow: hidden;
  margin-top: 3px;
  color: #758198;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.common-tool-download {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-top: 2px;
  border: 1px solid #cbdafe;
  border-radius: 10px;
  background: #edf3ff;
  color: #285edb;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.common-tool-download:hover {
  border-color: #2f6bff;
  background: #2f6bff;
  color: #fff;
}

.common-tools-empty { padding: 42px 20px; border: 1px dashed #cfd9e8; border-radius: 16px; background: #fff; color: #718096; text-align: center; }

/* Six-skin surfaces: section cards remain distinct without covering the
   underlying theme scene. */
html.ng-skin-active .common-tools-group {
  border-color: var(--ng-line);
  color: var(--ng-ink);
  background-color: var(--ng-panel-solid);
  background-image:
    radial-gradient(circle at 100% 0, rgba(var(--ng-accent-rgb), .09), transparent 38%),
    linear-gradient(145deg, color-mix(in srgb, var(--ng-panel) 92%, transparent), var(--ng-panel-solid));
  box-shadow: var(--ng-shadow);
}
html.ng-skin-active .common-tools-group::before {
  background: var(--ng-title-mark);
}
html.ng-skin-active .common-tools-group-head {
  background:
    radial-gradient(circle at 100% 0, rgba(var(--ng-accent-rgb), .1), transparent 38%),
    color-mix(in srgb, var(--ng-panel) 88%, transparent);
}
html.ng-skin-active .common-tools-group-head h3,
html.ng-skin-active .common-tool-copy strong { color: var(--ng-ink); }
html.ng-skin-active .common-tools-heading p,
html.ng-skin-active .common-tools-group-head p,
html.ng-skin-active .common-tool-copy span { color: var(--ng-muted); }
html.ng-skin-active .common-tool-card {
  border-color: var(--ng-line);
  color: var(--ng-ink);
  background-color: var(--ng-panel);
  box-shadow: var(--ng-shadow);
}
html.ng-skin-active .common-tool-download {
  border-color: color-mix(in srgb, var(--ng-accent) 30%, var(--ng-line));
  color: color-mix(in srgb, var(--ng-ink) 88%, var(--ng-accent));
  background: color-mix(in srgb, var(--ng-control) 88%, var(--ng-panel-solid));
}
html.ng-skin-active .common-tool-download:hover {
  border-color: var(--ng-button-edge);
  color: var(--ng-on-accent, #fff);
  background: var(--ng-button);
  box-shadow: var(--ng-button-shadow);
}

@media (max-width: 820px) {
  .common-tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .common-tools-panel { margin-top: 0; padding-right: 0; padding-left: 0; }
  .common-tools-heading { align-items: flex-start; }
  .common-tools-heading p { max-width: 240px; font-size: 12px; }
  .common-tools-group { padding: 12px; border-radius: 15px; }
  .common-tools-group-head { display: block; }
  .common-tools-group-head p { margin-top: 4px; font-size: 12px; }
  .common-tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .common-tool-card { grid-template-columns: 38px minmax(0, 1fr); gap: 8px; padding: 10px; }
  .common-tool-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 12px; }
  .common-tool-copy strong { font-size: 13px; }
  .common-tool-copy span { font-size: 10px; }
  .common-tool-download { min-height: 32px; font-size: 12px; }
}
