:root {
  --brand-blue: #1a73e8;
  --brand-navy: #1d2129;
  --text-muted: #8a9199;
  --border-light: #e8eaed;
  --icon-bg: #e8f1fc;
  --page-bg: #ffffff;
  --card-hover-shadow: 0 8px 24px rgba(26, 115, 232, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--brand-navy);
  background: var(--page-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
}

/* Header */
.site-header {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

.logo-link {
  display: inline-block;
  text-decoration: none;
}

.logo-img {
  max-width:200px;
  width: 100%;
  height: auto;
}

/* Search */
.search-wrap {
  max-width: 640px;
  margin: 1.75rem auto 0;
}

.search-box {
  position: relative;
}

.search-box .search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 2;
}

.search-input {
  height: 52px;
  padding-left: 3.25rem !important;
  padding-right: 1.5rem !important;
  border-radius: 999px !important;
  border: 1px solid var(--border-light) !important;
  background: #fff !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  font-size: 0.95rem;
  color: var(--brand-navy);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder {
  color: #b0b6be;
}

.search-input:focus {
  border-color: var(--brand-blue) !important;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15) !important;
}

/* Shared tool search suggestions */
.tool-search-results {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  left: 0;
  z-index: 50;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.45rem;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(16, 24, 40, 0.13);
}

.tool-search-results[hidden] {
  display: none;
}

.tool-search-result {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 0.7rem;
  align-items: center;
  min-height: 58px;
  padding: 0.55rem 0.65rem;
  color: inherit;
  border-radius: 9px;
  text-decoration: none;
  cursor: pointer;
}

.tool-search-result:hover,
.tool-search-result.is-active {
  color: inherit;
  background: #f4f7fb;
}

.tool-search-result.is-unavailable {
  cursor: default;
  opacity: 0.68;
}

.tool-search-result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--brand-blue);
  background: var(--icon-bg);
  border-radius: 10px;
  font-size: 1rem;
}

.tool-search-result-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tool-search-result-copy strong {
  overflow: hidden;
  color: var(--brand-navy);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-search-result-copy small {
  overflow: hidden;
  margin-top: 0.1rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-search-status {
  padding: 0.18rem 0.45rem;
  color: #667085;
  background: #eef1f5;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
}

.tool-search-all {
  display: block;
  margin-top: 0.3rem;
  padding: 0.65rem;
  color: var(--brand-blue);
  border-top: 1px solid var(--border-light);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.tool-search-all:hover {
  color: #155fc0;
}

.tool-search-empty {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}

.tool-search-empty strong {
  color: var(--brand-navy);
  font-size: 0.86rem;
}

/* Categories entry */
.section-categories {
  padding: 1.75rem 0 0.5rem;
}

.category-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  height: 100%;
  min-height: 118px;
  padding: 1.15rem 0.75rem;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.category-entry:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-hover-shadow);
  border-color: rgba(26, 115, 232, 0.25);
  color: inherit;
}

.category-entry-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--icon-bg);
  color: var(--brand-blue);
  font-size: 1.35rem;
}

.category-entry-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-navy);
  line-height: 1.3;
}

/* Section */
.section-tools {
  padding: 2rem 0 3rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: var(--brand-navy);
}

.section-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Category panels (Featured Tools) */
.cat-panel {
  height: 100%;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.cat-panel-header {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #f08a24 0%, #f6b042 100%);
}

.tone-finance {
  background: linear-gradient(90deg, #f08a24 0%, #f6b042 100%);
}

.tone-health {
  background: linear-gradient(90deg, #e35d6a 0%, #f08a94 100%);
}

.tone-math {
  background: linear-gradient(90deg, #1a73e8 0%, #4d9aef 100%);
}

.tone-unit {
  background: linear-gradient(90deg, #6d5ae6 0%, #9588f0 100%);
}

.tone-time {
  background: linear-gradient(90deg, #0f9d6e 0%, #3cb98e 100%);
}

.tone-engineering {
  background: linear-gradient(90deg, #0e7490 0%, #2aa4bd 100%);
}

.cat-panel-body {
  padding: 0.9rem 1rem 1rem;
}

.cat-panel-desc {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #5f6b7a;
}

.cat-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.cat-featured-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.65rem;
  text-decoration: none;
  color: inherit;
  background: #f7f8fa;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.cat-featured-item:hover {
  background: #fff;
  border-color: rgba(26, 115, 232, 0.28);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.08);
  color: inherit;
}

.cat-featured-icon {
  flex-shrink: 0;
  font-size: 1.55rem;
  line-height: 1;
  color: #4b5563;
  margin-top: 0.1rem;
}

.cat-featured-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.cat-featured-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--brand-navy);
  line-height: 1.25;
}

.cat-featured-desc {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.cat-tool-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.85rem;
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
}

.cat-tool-list a {
  display: block;
  font-size: 0.84rem;
  color: #5f6b7a;
  text-decoration: none;
  line-height: 1.35;
  transition: color 0.15s;
}

.cat-tool-list a:hover {
  color: var(--brand-blue);
}

/* About + Share */
.section-about {
  padding: 0.5rem 0 2.5rem;
}

.about-row {
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-light);
}

.about-title {
  margin: 0 0 0.85rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-navy);
}

.about-text {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: #5f6b7a;
  max-width: 38rem;
}

.about-text:last-child {
  margin-bottom: 0;
}

.share-panel {
  padding: 1.25rem 1.35rem;
  background: #f7f8fa;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  height: 100%;
}

.share-title {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-navy);
}

.share-desc {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.share-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.share-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border-light);
  color: #5f6b7a;
  font-size: 1.15rem;
  text-decoration: none;
  transition: transform 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.share-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(16, 24, 40, 0.08);
}

.share-facebook:hover {
  color: #1877f2;
  border-color: rgba(24, 119, 242, 0.35);
}

.share-x:hover {
  color: #111;
  border-color: rgba(17, 17, 17, 0.25);
}

.share-linkedin:hover {
  color: #0a66c2;
  border-color: rgba(10, 102, 194, 0.35);
}

.share-whatsapp:hover {
  color: #25d366;
  border-color: rgba(37, 211, 102, 0.4);
}

.share-reddit:hover {
  color: #ff4500;
  border-color: rgba(255, 69, 0, 0.35);
}

.share-telegram:hover {
  color: #229ed9;
  border-color: rgba(34, 158, 217, 0.35);
}

.share-email:hover {
  color: var(--brand-blue);
  border-color: rgba(26, 115, 232, 0.35);
}

/* Footer */
.site-footer {
  padding: 1.5rem 0 2.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-light);
}

.site-footer p {
  margin: 0;
}

/* Responsive */
@media (max-width: 575.98px) {
  .site-header {
    padding-top: 1.75rem;
  }

  .logo-img {
    max-width: 180px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .category-entry {
    min-height: 104px;
    padding: 1rem 0.5rem;
  }

  .category-entry-name {
    font-size: 0.82rem;
  }

  .cat-featured {
    grid-template-columns: 1fr;
  }

  .cat-tool-list {
    grid-template-columns: 1fr;
  }
}
