/* ============================================================
   DevTools - Developer Utility Suite
   Design System & Styles
   ============================================================ */

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2129;
  --bg-card: #161b22;
  --bg-input: #0d1117;
  --bg-hover: #1c2129;
  --bg-code: #0d1117;

  --border-primary: #30363d;
  --border-secondary: #21262d;
  --border-accent: #30363d;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-tertiary: #6e7681;
  --text-link: #58a6ff;

  --accent-blue: #58a6ff;
  --accent-green: #3fb950;
  --accent-orange: #d2991d;
  --accent-red: #f85149;
  --accent-purple: #a371f7;
  --accent-cyan: #39d2c0;
  --accent-pink: #f778ba;

  --accent: var(--accent-blue);
  --accent-hover: #79c0ff;
  --accent-subtle: rgba(88, 166, 255, 0.1);

  --sidebar-width: 240px;
  --header-height: 0px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", "Fira Code", "SF Mono", Consolas, "Liberation Mono", monospace;

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* Selection */
::selection { background: rgba(88, 166, 255, 0.3); color: #fff; }

/* ============================================================
   Layout: Sidebar + Main
   ============================================================ */

.app { display: flex; width: 100%; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-secondary);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sidebar-logo .logo-version {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-left: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  overflow-y: auto;
}

.nav-category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  padding: 16px 10px 6px;
  user-select: none;
}

.nav-category:first-child { padding-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-subtle);
  color: var(--accent-blue);
  font-weight: 500;
}

.nav-item .nav-icon {
  width: 18px; text-align: center;
  font-size: 13px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-secondary);
  font-size: 12px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-footer .dot {
  width: 6px; height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 18px;
  align-items: center;
  justify-content: center;
}

/* Language toggle (top-right) */
.lang-toggle {
  position: fixed;
  top: 12px; right: 16px;
  z-index: 200;
  height: 32px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.lang-toggle:hover {
  background: var(--bg-tertiary, var(--bg-secondary));
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}
.lang-toggle:active {
  transform: translateY(1px);
}

/* --- Main Content --- */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Tool Section --- */
.tool-section {
  display: none;
  flex: 1;
  padding: 32px 40px;
  max-width: 1100px;
  width: 100%;
}

.tool-section.active { display: block; }

.tool-header {
  margin-bottom: 28px;
}

.tool-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.tool-header .tool-desc {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ============================================================
   Home Page
   ============================================================ */

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--bg-hover);
}

.tool-card .card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.card-icon.blue { background: rgba(88,166,255,0.12); color: var(--accent-blue); }
.card-icon.green { background: rgba(63,185,80,0.12); color: var(--accent-green); }
.card-icon.orange { background: rgba(210,153,29,0.12); color: var(--accent-orange); }
.card-icon.purple { background: rgba(163,113,247,0.12); color: var(--accent-purple); }
.card-icon.cyan { background: rgba(57,210,192,0.12); color: var(--accent-cyan); }
.card-icon.red { background: rgba(248,81,73,0.12); color: var(--accent-red); }
.card-icon.pink { background: rgba(247,119,186,0.12); color: var(--accent-pink); }

.tool-card .card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.tool-card .card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================================
   Form Components
   ============================================================ */

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

textarea,
input[type="text"],
input[type="url"],
input[type="number"],
input[type="password"],
select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  transition: border-color var(--transition-fast);
  resize: vertical;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

textarea { min-height: 200px; }
textarea.small { min-height: 100px; }
textarea.large { min-height: 350px; }

select {
  font-family: var(--font-sans);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

input[type="color"] {
  width: 40px; height: 36px;
  padding: 2px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  cursor: pointer;
}

input[type="file"] {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
}

input[type="file"]::file-selector-button {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 6px 14px;
  margin-right: 12px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  transition: background var(--transition-fast);
}

input[type="file"]::file-selector-button:hover {
  background: var(--bg-hover);
}

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border-primary);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--accent-blue);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg-primary);
}

/* Checkbox */
.checkbox-row {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  font-size: 13px; color: var(--text-secondary);
}

.checkbox-row input[type="checkbox"] {
  accent-color: var(--accent-blue);
  width: 15px; height: 15px;
  cursor: pointer;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-green);
  color: #000;
  border-color: var(--accent-green);
}

.btn-primary:hover {
  background: #46c756;
  border-color: #46c756;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-primary);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-tertiary);
}

.btn-danger {
  background: transparent;
  color: var(--accent-red);
  border-color: var(--accent-red);
}

.btn-danger:hover {
  background: rgba(248,81,73,0.1);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ============================================================
   Result / Output Areas
   ============================================================ */

.result-area {
  background: var(--bg-code);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow: auto;
  max-height: 500px;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-primary);
  min-height: 80px;
}

.result-area.empty {
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 14px;
}

/* ============================================================
   Tool-specific Layouts
   ============================================================ */

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.tool-grid.full { grid-template-columns: 1fr; }

@media (max-width: 800px) {
  .tool-grid { grid-template-columns: 1fr; }
}

.preview-box {
  background: var(--bg-code);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
}

.preview-box img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-sm);
}

.qrcode-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.qrcode-container canvas {
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px;
}

/* Color swatch */
.color-swatch {
  width: 60px; height: 60px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-primary);
  flex-shrink: 0;
}

.color-row {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
}

/* Copy button inside result */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

/* ============================================================
   Toast Notification
   ============================================================ */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 1.7s forwards;
  pointer-events: none;
}

.toast.success { border-color: var(--accent-green); }
.toast.error { border-color: var(--accent-red); }

@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ============================================================
   Markdown Preview
   ============================================================ */

.markdown-preview {
  background: var(--bg-code);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 24px;
  line-height: 1.7;
  overflow: auto;
  max-height: 600px;
}

.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 {
  margin-top: 20px; margin-bottom: 10px;
  color: var(--text-primary);
  font-weight: 600;
}

.markdown-preview h1 { font-size: 1.5em; border-bottom: 1px solid var(--border-primary); padding-bottom: 8px; }
.markdown-preview h2 { font-size: 1.3em; border-bottom: 1px solid var(--border-secondary); padding-bottom: 6px; }
.markdown-preview h3 { font-size: 1.1em; }

.markdown-preview p { margin-bottom: 12px; }
.markdown-preview code {
  background: var(--bg-primary);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.markdown-preview pre {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 14px;
  overflow-x: auto;
  margin: 12px 0;
}

.markdown-preview pre code {
  background: none;
  padding: 0;
}

.markdown-preview table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
}

.markdown-preview th, .markdown-preview td {
  border: 1px solid var(--border-primary);
  padding: 8px 12px;
  text-align: left;
  font-size: 13px;
}

.markdown-preview th { background: var(--bg-tertiary); font-weight: 600; }
.markdown-preview blockquote {
  border-left: 3px solid var(--accent-blue);
  padding-left: 14px;
  color: var(--text-secondary);
  margin: 12px 0;
}
.markdown-preview a { color: var(--accent-blue); }
.markdown-preview ul, .markdown-preview ol { padding-left: 24px; margin: 8px 0; }
.markdown-preview img { max-width: 100%; border-radius: var(--radius-sm); }

/* ============================================================
   Diff styles
   ============================================================ */

.diff-added { background: rgba(63,185,80,0.15); color: #7ee787; }
.diff-removed { background: rgba(248,81,73,0.15); color: #ffa198; }
.diff-line {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 1px 10px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ============================================================
   JSON Diff (structural compare)
   ============================================================ */

.jd-tree {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
}

.jd-row {
  padding: 1px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  border-left: 3px solid transparent;
}

.jd-row .jd-marker {
  display: inline-block;
  width: 14px;
  color: var(--text-tertiary);
  text-align: center;
  margin-right: 6px;
  user-select: none;
}

.jd-row-added {
  background: rgba(63, 185, 80, 0.12);
  border-left-color: var(--accent-green);
}
.jd-row-added .jd-marker { color: var(--accent-green); font-weight: 700; }

.jd-row-removed {
  background: rgba(248, 81, 73, 0.12);
  border-left-color: var(--accent-red);
}
.jd-row-removed .jd-marker { color: var(--accent-red); font-weight: 700; }

.jd-tree .jd-key { color: var(--accent-blue); }
.jd-tree .jd-index { color: var(--text-tertiary); }
.jd-tree .json-string { color: var(--accent-orange); }
.jd-tree .json-number { color: var(--accent-green); }
.jd-tree .json-boolean { color: var(--accent-cyan); }
.jd-tree .json-null { color: var(--text-tertiary); }

.jd-summary {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}

.jd-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  font-family: var(--font-mono);
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.jd-chip-added {
  color: var(--accent-green);
  border-color: rgba(63, 185, 80, 0.4);
  background: rgba(63, 185, 80, 0.08);
}
.jd-chip-removed {
  color: var(--accent-red);
  border-color: rgba(248, 81, 73, 0.4);
  background: rgba(248, 81, 73, 0.08);
}
.jd-chip-changed {
  color: var(--accent-orange);
  border-color: rgba(210, 153, 29, 0.4);
  background: rgba(210, 153, 29, 0.08);
}
.jd-chip-unchanged {
  color: var(--text-tertiary);
}

/* ============================================================
   JSON Tree View
   ============================================================ */

.json-tree {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
}

.json-tree .json-key { color: var(--accent-blue); }
.json-tree .json-string { color: var(--accent-orange); }
.json-tree .json-number { color: var(--accent-green); }
.json-tree .json-boolean { color: var(--accent-cyan); }
.json-tree .json-null { color: var(--text-tertiary); }

.json-tree .json-toggle {
  cursor: pointer;
  color: var(--text-tertiary);
  margin-right: 2px;
  user-select: none;
  display: inline-block;
  width: 14px;
}

/* ============================================================
   JWT Decoder
   ============================================================ */

.jwt-parts {
  display: flex; flex-direction: column; gap: 12px;
}

.jwt-part {
  background: var(--bg-code);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.jwt-part-header {
  background: var(--bg-tertiary);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.jwt-part-content {
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow: auto;
  max-height: 300px;
  color: var(--text-primary);
}

/* ============================================================
   Stats bar
   ============================================================ */

.stats-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.stats-bar span {
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: 4px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-toggle { display: flex; }

  .main {
    margin-left: 0;
  }

  .tool-section {
    padding: 20px 16px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .tool-header h1 { font-size: 22px; }
}

/* Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

.sidebar-overlay.show { display: block; }

/* ============================================================
   Text Stats Grid
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-blue);
}

/* ============================================================
   CSS Gradient Generator
   ============================================================ */

.gradient-preview {
  width: 100%;
  height: 240px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
}

.grad-stop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  background: var(--bg-tertiary);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-secondary);
}

.grad-stop-row input[type="color"] {
  width: 40px;
  height: 30px;
  flex-shrink: 0;
}

.grad-stop-row input[type="number"] {
  width: 80px;
  flex-shrink: 0;
  padding: 6px 8px;
  font-size: 12px;
}

.grad-stop-row .grad-stop-pos-label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.grad-stop-row .grad-stop-remove {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border-primary);
  color: var(--accent-red);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.grad-stop-row .grad-stop-remove:hover {
  background: rgba(248,81,73,0.1);
}

/* ============================================================
   HTTP Status List
   ============================================================ */

.http-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.http-item {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.http-item .http-code {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
}

.http-item .http-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.http-item .http-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.http-item.cat-1 .http-code { color: var(--accent-cyan); }
.http-item.cat-2 .http-code { color: var(--accent-green); }
.http-item.cat-3 .http-code { color: var(--accent-blue); }
.http-item.cat-4 .http-code { color: var(--accent-orange); }
.http-item.cat-5 .http-code { color: var(--accent-red); }

/* ============================================================
   Filter / Preset button active state
   ============================================================ */

.btn-secondary.active,
.hash-algo.active,
.case-algo.active,
.http-filter.active,
.jd-mode.active {
  background: var(--accent-subtle);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

/* ============================================================
   Page Footer
   ============================================================ */

.page-footer {
  margin: 40px 40px 24px;
  padding: 18px 0 0;
  border-top: 1px solid var(--border-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.page-footer a {
  color: var(--accent-blue);
  text-decoration: none;
  font-family: var(--font-mono);
}

.page-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .page-footer { margin: 24px 16px 16px; }
}
