@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Noto+Sans+SC:wght@400;500;600&display=swap");

:root {
  --mt-primary: #f54e00;
  --mt-primary-active: #d04200;
  --mt-ink: #26251e;
  --mt-body: #5a5852;
  --mt-muted: #807d72;
  --mt-muted-soft: #a09c92;
  --mt-hairline: #e6e5e0;
  --mt-hairline-soft: #efeee8;
  --mt-hairline-strong: #cfcdc4;
  --mt-canvas: #f7f7f4;
  --mt-canvas-soft: #fafaf7;
  --mt-card: #ffffff;
  --mt-surface-strong: #e6e5e0;
  --mt-success: #1f8a65;
  --mt-error: #cf2d56;
  --mt-font: "Noto Sans SC", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mt-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
  --mt-radius-md: 8px;
  --mt-radius-lg: 12px;
  --mt-nav-height: 64px;
  --mt-nav-width: 236px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--mt-canvas);
}

body,
body.app-nav-active {
  min-height: 100vh;
  margin: 0;
  max-width: none;
  padding: 48px 32px 48px calc(var(--mt-nav-width) + 32px);
  background: var(--mt-canvas);
  color: var(--mt-body);
  font-family: var(--mt-font);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 var(--mt-nav-width);
  width: 1px;
  background: var(--mt-hairline);
  z-index: 998;
}

body.app-nav-active :where(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  a,
  button,
  label,
  input,
  select,
  option,
  li,
  th,
  td,
  span,
  div
) {
  font-family: var(--mt-font) !important;
}

body.app-nav-active :where(
  textarea,
  pre,
  code,
  kbd,
  samp,
  .editor,
  .font-mono
) {
  font-family: var(--mt-mono) !important;
}

.app-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1000;
  width: var(--mt-nav-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px 16px;
  background: rgba(247, 247, 244, 0.94);
  border-right: 1px solid var(--mt-hairline);
  color: var(--mt-ink);
  font-family: var(--mt-font);
  backdrop-filter: blur(16px);
}

.app-nav-header a,
.app-nav-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--mt-ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.app-nav-header {
  padding: 0 0 18px;
  border-bottom: 1px solid var(--mt-hairline);
}

.app-nav-logo {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--mt-primary);
  color: #ffffff;
  font-family: var(--mt-mono);
  font-size: 13px;
  line-height: 1;
}

.app-nav-title {
  display: block;
  padding: 18px 4px 8px;
  color: var(--mt-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-nav-list {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.app-nav-list::-webkit-scrollbar {
  display: none;
}

.app-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--mt-radius-md);
  color: var(--mt-body);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.app-nav-item:hover {
  background: var(--mt-card);
  border-color: var(--mt-hairline);
  color: var(--mt-ink);
}

.app-nav-item.active {
  background: var(--mt-ink);
  border-color: var(--mt-ink);
  color: var(--mt-canvas);
}

.app-nav-item .icon {
  font-size: 14px;
  line-height: 1;
}

.app-nav-actions {
  display: flex;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--mt-hairline);
  align-items: center;
  gap: 12px;
}

.app-nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 10px 18px;
  border-radius: var(--mt-radius-md);
  background: var(--mt-primary);
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}

.app-nav-cta:hover {
  background: var(--mt-primary-active);
}

.app-nav-footer {
  display: none;
}

.grid-bg,
.particles,
.particle {
  display: none;
}

.container,
.max-w-7xl {
  max-width: 1200px;
  width: 100%;
  margin-inline: auto;
}

.container {
  padding: 0;
}

body.app-tool > .container {
  max-width: 900px;
  padding: 32px;
  border: 1px solid var(--mt-hairline);
  border-radius: var(--mt-radius-lg);
  background: var(--mt-card);
  box-shadow: none;
}

body.app-tool > .container:has(> .section),
body.app-page-html-preview > .container {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.header,
header {
  margin: 0 0 48px;
  color: var(--mt-body);
  text-align: center;
}

.header h1,
header h1,
h1 {
  margin: 0 0 12px;
  color: var(--mt-ink);
  font-family: var(--mt-font);
  font-size: clamp(32px, 6vw, 72px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-shadow: none;
  background: none;
  -webkit-text-fill-color: currentColor;
}

body.app-tool .header h1,
body.app-tool header h1,
body.app-tool h1 {
  font-size: clamp(36px, 4vw, 56px);
  letter-spacing: -0.02em;
}

.header h1::after,
.header p::before,
.header p::after {
  display: none;
}

.header p,
header p,
.description,
p {
  color: var(--mt-body);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 64px;
}

.tool-card,
.panel,
.section,
.input-section,
.output-section,
.options,
.controls,
.info-section,
.instructions,
.bg-white {
  background: var(--mt-card);
  border: 1px solid var(--mt-hairline);
  border-radius: var(--mt-radius-lg);
  box-shadow: none;
  color: var(--mt-body);
}

.panel,
.section,
.input-section,
.output-section,
.options,
.controls,
.info-section,
.instructions {
  padding: 24px;
}

.tool-card {
  min-height: 260px;
  padding: 24px;
  opacity: 1;
  animation: none;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease;
}

.tool-card::before,
.tool-icon::after,
.tool-content h3::after {
  display: none;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--mt-hairline-strong);
  box-shadow: none;
}

.tool-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--mt-hairline);
  border-radius: var(--mt-radius-md);
  background: var(--mt-canvas-soft);
  font-size: 20px;
}

.tool-sql .tool-icon,
.tool-string .tool-icon,
.tool-camel .tool-icon,
.tool-dedupe .tool-icon,
.tool-excel .tool-icon,
.tool-dash .tool-icon,
.tool-json .tool-icon,
.tool-markdown .tool-icon,
.tool-time .tool-icon,
.tool-preview .tool-icon,
.tool-code .tool-icon {
  background: var(--mt-canvas-soft);
}

.tool-content h3,
.panel h2,
.panel-title,
.section-title,
.info-section h3,
.option-title,
h2,
h3 {
  color: var(--mt-ink);
  font-family: var(--mt-font);
  font-weight: 600;
  letter-spacing: 0;
}

.tool-content h3 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.4;
}

.tool-content p {
  min-height: 72px;
  margin: 0 0 20px;
  color: var(--mt-body);
  font-size: 14px;
  line-height: 1.5;
}

button,
.btn,
.copy-button,
.toggle-button,
.save-button,
.history-button,
.tool-link,
#pasteBtn,
#copyBtn,
.btn-primary,
.btn-warning,
.primary-btn,
.secondary-btn,
.danger-btn {
  min-height: 40px;
  padding: 10px 18px;
  border: 1px solid var(--mt-hairline-strong);
  border-radius: var(--mt-radius-md);
  background: var(--mt-card);
  color: var(--mt-ink);
  box-shadow: none;
  font-family: var(--mt-font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

button:hover,
.btn:hover,
.copy-button:hover,
.toggle-button:hover,
.tool-link:hover,
#pasteBtn:hover,
#copyBtn:hover {
  transform: translateY(-1px);
  background: var(--mt-canvas-soft);
  border-color: var(--mt-ink);
  box-shadow: none;
  opacity: 1;
}

.tool-link,
.btn-primary,
.primary-btn,
.copy-button,
.toggle-button {
  background: var(--mt-primary);
  border-color: var(--mt-primary);
  color: #ffffff;
}

.tool-link:hover,
.btn-primary:hover,
.primary-btn:hover,
.copy-button:hover,
.toggle-button:hover {
  background: var(--mt-primary-active);
  border-color: var(--mt-primary-active);
  color: #ffffff;
}

.secondary-btn,
.btn-secondary,
.btn-warning,
.danger-btn {
  background: var(--mt-card);
  border-color: var(--mt-hairline-strong);
  color: var(--mt-ink);
}

body.app-nav-active [class*="shadow"],
body.app-nav-active [class*="shadow-"] {
  box-shadow: none;
}

body.app-nav-active .bg-white,
body.app-nav-active .bg-slate-50,
body.app-nav-active .bg-gray-50,
body.app-nav-active .bg-gray-100,
body.app-nav-active .bg-gray-200,
body.app-nav-active .hover\:bg-gray-50:hover,
body.app-nav-active .hover\:bg-blue-50:hover,
body.app-nav-active .hover\:bg-green-50:hover,
body.app-nav-active .hover\:bg-yellow-50:hover {
  background: var(--mt-card);
}

body.app-nav-active button.bg-blue-600,
body.app-nav-active button.bg-yellow-500,
body.app-nav-active button.bg-green-500,
body.app-nav-active button.bg-cyan-500,
body.app-nav-active button.hover\:bg-blue-700:hover,
body.app-nav-active button.hover\:bg-yellow-600:hover,
body.app-nav-active button.hover\:bg-green-600:hover {
  background: var(--mt-primary);
  border-color: var(--mt-primary);
  color: #ffffff;
}

body.app-nav-active button.bg-gray-200,
body.app-nav-active button.hover\:bg-gray-300:hover {
  background: var(--mt-card);
  border-color: var(--mt-hairline-strong);
  color: var(--mt-ink);
}

body.app-nav-active .border-gray-100,
body.app-nav-active .border-gray-200,
body.app-nav-active .border-gray-300,
body.app-nav-active .border-blue-500,
body.app-nav-active .border-green-500,
body.app-nav-active .border-cyan-500,
body.app-nav-active .border-yellow-500 {
  border-color: var(--mt-hairline);
}

body.app-nav-active .text-blue-500,
body.app-nav-active .text-pink-400,
body.app-nav-active .text-yellow-500,
body.app-nav-active .text-green-600,
body.app-nav-active .text-cyan-600,
body.app-nav-active .text-gray-400,
body.app-nav-active .text-gray-500,
body.app-nav-active .text-gray-600,
body.app-nav-active .text-gray-700,
body.app-nav-active .text-gray-800 {
  color: var(--mt-body);
}

body.app-nav-active .font-bold {
  font-weight: 400;
}

body.app-nav-active .font-medium,
body.app-nav-active .font-semibold {
  font-weight: 600;
}

textarea,
input[type="text"],
input[type="number"],
input[type="search"],
select,
.filter-select,
.search-box,
.editor {
  border: 1px solid var(--mt-hairline);
  border-radius: var(--mt-radius-md);
  background: var(--mt-canvas-soft);
  color: var(--mt-ink);
  box-shadow: none;
  font-family: var(--mt-mono);
}

textarea,
.editor {
  padding: 16px;
  font-size: 13px;
  line-height: 1.5;
}

textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
.editor:focus {
  outline: none;
  border-color: var(--mt-primary);
  box-shadow: 0 0 0 3px rgba(245, 78, 0, 0.12);
}

label,
.label,
.format-label,
.char-count,
.stats,
.text-gray-500,
.text-gray-600,
.text-gray-700,
.text-gray-800 {
  color: var(--mt-body);
}

.stats,
.char-count,
.format-label {
  font-size: 13px;
}

code,
pre,
.font-mono {
  font-family: var(--mt-mono);
}

.main-content,
.converter-wrapper {
  gap: 16px;
}

.results-table,
table {
  width: 100%;
  border-collapse: collapse;
  color: var(--mt-body);
}

.results-table th,
.results-table td,
th,
td {
  border-bottom: 1px solid var(--mt-hairline);
}

.results-table th,
th {
  background: var(--mt-canvas-soft);
  color: var(--mt-ink);
}

.field-type,
.stat-item,
.badge,
.upload-area {
  border: 1px solid var(--mt-hairline);
  border-radius: var(--mt-radius-md);
  background: var(--mt-surface-strong);
  color: var(--mt-ink);
}

.toast,
#toast,
.success-message,
.copy-notification {
  border: 1px solid var(--mt-hairline-strong);
  border-radius: var(--mt-radius-md);
  background: var(--mt-ink);
  color: var(--mt-canvas);
  box-shadow: none;
  font-family: var(--mt-font);
}

.error-message {
  border: 1px solid rgba(207, 45, 86, 0.24);
  background: rgba(207, 45, 86, 0.08);
  color: var(--mt-error);
}

.footer,
footer {
  border-top: 1px solid var(--mt-hairline);
  color: var(--mt-body);
}

@media (max-width: 1024px) {
  body,
  body.app-nav-active {
    padding: 40px 24px 40px calc(var(--mt-nav-width) + 24px);
  }

  .app-nav {
    padding-inline: 14px;
  }

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

@media (max-width: 640px) {
  :root {
    --mt-nav-width: 188px;
  }

  body,
  body.app-nav-active {
    padding: 32px 16px 32px calc(var(--mt-nav-width) + 16px);
  }

  .app-nav {
    gap: 12px;
    padding-inline: 12px;
  }

  .app-nav-header a,
  .app-nav-home {
    font-size: 14px;
  }

  .app-nav-item {
    min-height: 36px;
    padding: 8px;
    font-size: 13px;
  }

  .tools-grid,
  .main-content,
  .converter-wrapper {
    grid-template-columns: 1fr;
  }

  .header h1,
  header h1,
  h1 {
    font-size: 32px;
  }
}

body.app-page-html-preview {
  height: 100vh;
  padding: 0 0 0 var(--mt-nav-width);
  overflow: hidden;
}

body.app-page-html-preview .navbar {
  min-height: 72px;
  padding: 16px 24px;
  background: var(--mt-card);
  border-bottom: 1px solid var(--mt-hairline);
}

body.app-page-html-preview .title {
  margin: 0;
  color: var(--mt-ink);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.0125em;
}

body.app-page-html-preview .container {
  max-width: none;
  height: calc(100vh - 72px);
}

body.app-page-html-preview .editor-container,
body.app-page-html-preview .preview-container {
  border-top: 1px solid var(--mt-hairline);
}

body.app-page-html-preview .preview {
  background: #ffffff;
}

body.app-page-html-preview .sidebar {
  background: var(--mt-card);
  border-left: 1px solid var(--mt-hairline);
  box-shadow: none;
}

body.app-page-html-preview .sidebar-header {
  border-bottom-color: var(--mt-hairline);
}

body.app-page-html-preview .sidebar-title {
  color: var(--mt-ink);
}

body.app-page-html-preview .history-item {
  background: var(--mt-canvas-soft);
  border: 1px solid var(--mt-hairline);
}

body.app-page-html-preview .history-item-title {
  color: var(--mt-ink);
}

body.app-page-html-preview .history-item-preview,
body.app-page-html-preview .history-item-date,
body.app-page-html-preview .empty-message {
  color: var(--mt-body);
}

body.app-page-html-preview .sidebar-close,
body.app-page-html-preview .history-item-delete {
  min-height: 0;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--mt-ink);
  font-size: 24px;
  line-height: 1;
}

body.app-page-html-preview .history-item-delete {
  color: var(--mt-error);
  font-size: 16px;
}
