/* DIMA Tools Web Studio — Neon Studio Design System */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #4f46e5;
  --accent-2: #0ea5e9;
  --accent-soft: #eef2ff;
  --accent-ink: #3730a3;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --dark-bg: #0b1120;
  --dark-surface: #111827;
  --dark-line: #1e293b;
  --dark-ink: #f8fafc;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 12px 32px -12px rgba(15, 23, 42, 0.18);
  --font-sans: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html[lang="ko"] {
  --font-sans: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
}

html[lang="ja"] {
  --font-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg, canvas, video {
  max-width: 100%;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Header / Navigation */
.mt-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.mt-nav-in {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.mt-brand {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.mt-brand span {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  letter-spacing: 0.01em;
}

.mt-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mt-nav-links a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
  padding: 6px 11px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.mt-nav-links a:hover {
  background: var(--surface-2);
  color: var(--accent);
}

.mt-langs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.mt-langs a {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.mt-langs a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.mt-langs a.is-on {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: rgba(79, 70, 229, 0.25);
}

/* Main container */
.mt-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px 64px;
  min-width: 0;
}

/* Hub Hero */
.mt-hero {
  background: radial-gradient(120% 140% at 10% 0%, #eef2ff 0%, #ffffff 55%, #f0f9ff 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.mt-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid rgba(5, 150, 105, 0.22);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.mt-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.mt-hero h1,
.mt-thead h1 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.mt-hero p,
.mt-thead p {
  margin: 0;
  max-width: 760px;
  color: var(--ink-2);
  font-size: 0.98rem;
}

/* Category Filters */
.mt-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.mt-cat {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.mt-cat:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mt-cat.is-on {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* Tool Card Grid */
.mt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mt-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  min-width: 0;
}

.mt-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.mt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.24s ease;
}

.mt-card:hover .mt-thumb img {
  transform: scale(1.03);
}

.mt-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

.mt-card:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 70, 229, 0.45);
  box-shadow: var(--shadow-lg);
}

.mt-pill {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
}

.mt-card h2,
.mt-card h3 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.mt-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Tool Page Header */
.mt-crumb {
  font-size: 0.83rem;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mt-crumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.mt-thead {
  margin-bottom: 20px;
}

/* Interactive Tool Stage */
.mt-stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.mt-wb {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}

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

.mt-wb-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.mt-panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.mt-panel-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mt-preview {
  background: var(--dark-bg);
  border: 1px solid var(--dark-line);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: hidden;
  position: relative;
  min-width: 0;
}

.mt-preview-light {
  background: repeating-conic-gradient(#f1f5f9 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
  border-color: var(--line);
}

.mt-preview canvas,
.mt-preview svg {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

/* Form Controls */
.mt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.mt-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mt-label span {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  font-size: 0.78rem;
}

.mt-input,
.mt-select,
.mt-textarea {
  width: 100%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mt-input:focus,
.mt-select:focus,
.mt-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

.mt-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.55;
}

.mt-code {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  tab-size: 2;
}

.mt-code-dark {
  background: var(--dark-bg);
  color: var(--dark-ink);
  border-color: var(--dark-line);
}

.mt-code-dark:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.mt-range {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.mt-color {
  width: 42px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}

.mt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.mt-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.mt-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.mt-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

/* Buttons & Chips */
.mt-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mt-btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.mt-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.mt-btn-pri {
  background: linear-gradient(135deg, var(--accent), #4338ca);
  border-color: transparent;
  color: #fff;
}

.mt-btn-pri:hover {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(79, 70, 229, 0.55);
}

.mt-btn-sm {
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 8px;
}

.mt-chip {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.mt-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mt-chip.is-on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Dropzone */
.mt-dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mt-dropzone:hover,
.mt-dropzone.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* Code Output & Tables */
.mt-pre {
  margin: 0;
  background: var(--dark-bg);
  color: var(--dark-ink);
  border: 1px solid var(--dark-line);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-x: auto;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}

.mt-mark {
  background: rgba(250, 204, 21, 0.35);
  color: #fef08a;
  border-bottom: 2px solid #eab308;
  border-radius: 3px;
  padding: 0 2px;
}

.mt-err {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 600;
}

.mt-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mt-stat {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.mt-stat-add {
  background: var(--ok-soft);
  color: var(--ok);
}

.mt-stat-del {
  background: var(--danger-soft);
  color: var(--danger);
}

.mt-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.mt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.mt-table th,
.mt-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.mt-table th {
  background: var(--surface-2);
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
}

.mt-table tr:last-child td {
  border-bottom: none;
}

/* Diff viewer */
.mt-diff-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
}

.mt-diff-scroll {
  overflow-x: auto;
  max-height: 460px;
  overflow-y: auto;
}

.mt-diff-row {
  display: grid;
  grid-template-columns: 44px 44px 20px minmax(0, 1fr);
  border-bottom: 1px solid rgba(226, 232, 240, 0.55);
}

.mt-diff-side {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px minmax(0, 1fr);
  border-bottom: 1px solid rgba(226, 232, 240, 0.55);
}

.mt-diff-ln {
  padding: 3px 6px;
  text-align: right;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.03);
  user-select: none;
  border-right: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.mt-diff-sg {
  padding: 3px 4px;
  text-align: center;
  font-weight: 700;
  user-select: none;
}

.mt-diff-tx {
  padding: 3px 8px;
  white-space: pre-wrap;
  word-break: break-word;
  min-width: 0;
}

.mt-diff-add {
  background: #ecfdf5;
  color: #065f46;
}

.mt-diff-del {
  background: #fef2f2;
  color: #991b1b;
}

.mt-diff-empty {
  background: #f8fafc;
  color: #94a3b8;
}

/* Cron Big Summary */
.mt-cron-human {
  background: linear-gradient(135deg, #eef2ff, #f0f9ff);
  border: 1px solid rgba(79, 70, 229, 0.22);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.mt-cron-expr {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
}

/* Ad slot */
.mt-ad {
  margin: 24px 0;
  min-height: 16px;
  overflow: hidden;
}

/* Content Sections (How-To, FAQ, Related) */
.mt-sec {
  margin-top: 36px;
}

.mt-sec h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.mt-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mt-steps li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.mt-steps b {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}

.mt-steps h3 {
  margin: 0 0 4px;
  font-size: 0.96rem;
}

.mt-steps p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.mt-kws {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mt-kws span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
}

.mt-faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mt-faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.mt-faq summary {
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mt-faq summary::-webkit-details-marker {
  display: none;
}

.mt-faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
}

.mt-faq details[open] summary::after {
  content: "−";
}

.mt-faq details p {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--ink-2);
}

/* Footer */
.mt-foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 48px;
}

.mt-foot-in {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--muted);
}

/* Responsive Breakpoints */
@media (max-width: 980px) {
  .mt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mt-wb,
  .mt-wb-eq {
    grid-template-columns: minmax(0, 1fr);
  }
  .mt-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .mt-nav-in {
    padding: 10px 14px;
    gap: 8px;
  }
  .mt-wrap {
    padding: 18px 14px 48px;
  }
  .mt-hero {
    padding: 22px 18px;
    border-radius: 16px;
  }
  .mt-stage {
    padding: 14px;
    border-radius: 14px;
  }
  .mt-panel {
    padding: 12px;
  }
  .mt-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .mt-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mt-grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mt-diff-side {
    grid-template-columns: 30px minmax(0, 1fr) 30px minmax(0, 1fr);
    font-size: 0.74rem;
  }
}
