.tool-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
  overflow-x: hidden;
}

.tool-hero,
.tool-card,
.guide-card,
.faq-card,
.related-tools-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}

.tool-hero {
  padding: 1.8rem;
  margin-bottom: 1.5rem;
  background:
    radial-gradient(circle at top right, rgba(115, 210, 222, 0.24), transparent 34%),
    linear-gradient(135deg, #ffffff, #f7fcfd);
}

.tool-category-tag {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(23, 149, 168, 0.1);
  color: var(--primary-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.tool-hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
  margin-bottom: 0.7rem;
}

.tool-hero p,
.helper-text,
.result-meta,
.empty-result,
.guide-card p,
.guide-card li,
.faq-card p,
.related-tools-header p,
.related-tool-link span {
  color: var(--text-muted);
}

.tool-card {
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.file-tools-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 0.8fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 0.45rem;
}

.control-field {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.control-field label,
.text-panel label,
.results-panel h2 {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-main);
}

.control-field input,
.control-field select,
.text-panel textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font: inherit;
  color: var(--text-main);
  background: #fff;
}

.control-field input,
.control-field select {
  min-height: 42px;
  padding: 0.55rem 0.65rem;
}

.control-field input[type="file"] {
  min-height: 54px;
  padding: 0.58rem 0.65rem;
  line-height: 1.5;
}

.control-field input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 0.65rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff;
  color: var(--text-main);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.helper-text {
  font-size: 0.84rem;
  line-height: 1.45;
}

.file-helper {
  margin: 0 0 1rem;
}

.text-panel {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.text-panel textarea {
  min-height: 320px;
  resize: vertical;
  padding: 1rem;
  line-height: 1.55;
  font-family: Consolas, "Courier New", monospace;
  overflow: auto;
  max-width: 100%;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.action-row button,
.secondary-btn {
  min-height: 44px;
  width: 100%;
  white-space: normal;
  line-height: 1.2;
}

.secondary-btn {
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-main);
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.secondary-btn:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.summary-item {
  padding: 0.8rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  min-width: 0;
}

.summary-item span {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-item strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.results-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.result-list {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
}

.result-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f9fdfe);
  font-family: Consolas, "Courier New", monospace;
  overflow-wrap: anywhere;
  min-width: 0;
}

.result-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.result-list span {
  color: var(--text-muted);
  font-family: "Outfit", sans-serif;
  font-size: 0.82rem;
  white-space: nowrap;
}

.empty-result {
  padding: 1rem;
  border: 1px dashed rgba(23, 149, 168, 0.35);
  border-radius: 10px;
  background: rgba(125, 211, 252, 0.08);
}

.guide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.guide-card,
.faq-card,
.related-tools-card {
  padding: 1.25rem;
}

.guide-card h2,
.faq-card h3,
.related-tools-header h2 {
  margin-bottom: 0.55rem;
}

.guide-card ul {
  list-style: none;
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.content-depth-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.content-depth-card {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}

.content-depth-card h2,
.content-depth-card h3 {
  margin-bottom: 0.55rem;
}

.content-depth-card p,
.content-depth-card li {
  color: var(--text-muted);
  line-height: 1.6;
}

.content-depth-card ul {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.guide-card li {
  position: relative;
  padding-left: 1rem;
}

.guide-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--primary);
}

.related-tools-section {
  margin: 1.5rem 0;
}

.related-tools-header {
  margin-bottom: 1rem;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.related-tool-link {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition);
  min-width: 0;
}

.related-tool-link:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 149, 168, 0.28);
  box-shadow: 0 10px 24px rgba(23, 149, 168, 0.1);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%) translateY(18px);
  background: #111827;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 1000;
  max-width: min(92vw, 520px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

  .action-row,
  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .related-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .file-tools-grid,
  .guide-grid,
  .content-depth-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .tool-shell {
    padding: 1rem 0.75rem;
  }

  .tool-hero,
  .tool-card,
  .guide-card,
  .faq-card,
  .related-tools-card,
  .content-depth-card {
    border-radius: 14px;
    padding: 1rem;
  }

  .controls-grid,
  .action-row,
  .summary-strip,
  .related-tools-grid {
    grid-template-columns: 1fr;
  }

  .results-header,
  .result-list li {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-list span {
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .tool-hero h1 {
    font-size: 1.65rem;
  }

  .control-field input,
  .control-field select,
  .text-panel textarea,
  .action-row button {
    font-size: 0.95rem;
  }
}
