.tool-page {
  background: #f8f4ef;
}

.tool-page .container {
  position: static;
  z-index: auto;
  padding-bottom: 0;
}

.tool-header {
  background: #fff7ee;
  border-bottom: 1px solid rgba(19, 33, 43, 0.08);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.header-search {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.header-search-input {
  padding: 0.5rem 2.2rem 0.5rem 0.95rem;
  font-size: 0.95rem;
  border: 1px solid rgba(19, 33, 43, 0.12);
  border-radius: 999px;
  background: #ffffff;
}

.header-search-input:focus {
  border-color: rgba(203, 75, 55, 0.5);
}

.header-search-icon {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  transform: translateY(-50%);
  color: var(--accent-deep);
  font-size: 1rem;
  pointer-events: none;
}

.header-search-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(19, 33, 43, 0.12);
  box-shadow: 0 18px 40px rgba(19, 33, 43, 0.12);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  padding: 0.35rem;
}

.header-search-results {
  display: grid;
  gap: 0.25rem;
}

.header-search-item {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.header-search-item:hover,
.header-search-item:focus {
  background: #f3ede5;
  color: var(--ink);
}

.header-search-item.is-active {
  background: #f5e1d7;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.header-actions {
  display: inline-flex;
  gap: 1.2rem;
}

.header-actions .nav-link {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.header-actions .nav-link:hover {
  color: var(--accent-deep);
}

.header-actions .nav-icon {
  display: none;
  font-size: 1.05rem;
}

.tool-hero {
  margin-top: 1.8rem;
  margin-bottom: 2rem;
}

.tool-hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.tool-hero h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.tool-description {
  color: var(--muted);
  max-width: 640px;
}

.tool-shell {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  border: none;
}

.tool-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.tool-panel {
  background: #fdfaf6;
  border-radius: 18px;
  padding: 1.4rem;
  border: 1px solid rgba(19, 33, 43, 0.08);
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.tool-status {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.tool-hint {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
}

.tool-list {
  display: grid;
  gap: 1.2rem;
}

.tool-section {
  margin-bottom: 2.5rem;
}

.tool-section h2 {
  font-family: "Fraunces", serif;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.tool-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 1.2rem 1.4rem;
  border: 1px solid rgba(19, 33, 43, 0.08);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.tool-card.is-link {
  cursor: pointer;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(19, 33, 43, 0.12);
}

.tool-card.is-disabled {
  opacity: 0.65;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.tool-card.is-disabled:hover {
  transform: none;
  box-shadow: none;
}

.badge-muted {
  background: #f0ebe4;
  color: #7a5a47;
}

.bookmark-toggle {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 1rem;
  color: #1c5b56;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1;
}

.bookmark-toggle i {
  font-size: 1.1rem;
}

.bookmark-toggle.is-active {
  color: #1c5b56;
}

.tool-card .bookmark-toggle {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
}

.tool-card .bookmark-toggle i {
  font-size: 0.95rem;
}

.bookmark-hero {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .tool-hero-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .header-row {
    display: grid;
    grid-template-columns: auto minmax(140px, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
  }

  .header-search {
    max-width: 220px;
  }

  .header-search-input {
    font-size: 0.85rem;
    padding: 0.4rem 2rem 0.4rem 0.85rem;
  }

  .header-actions {
    gap: 0.6rem;
  }

  .header-actions .nav-link {
    font-size: 0.85rem;
  }

  .header-actions .bookmarks-link .nav-text {
    display: none;
  }

  .header-actions .bookmarks-link .nav-icon {
    display: inline-flex;
  }
}
