/* ============================================
   DevTools Box — Design System v3
   "Engineering Workbench" — refined
   ============================================ */

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* --- CSS Variables --- */
:root {
  /* Typography */
  --font-sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;

  /* Backgrounds — deep neutral, faint cool cast */
  --bg-body: #07090d;
  --bg-surface: #0c0f15;
  --bg-card: #0e1118;
  --bg-card-hover: #11151d;
  --bg-input: #090b10;
  --bg-input-focus: #0c0f16;
  --bg-sidebar: #090b10;
  --bg-elevated: #141821;

  /* Accent — mint, used sparingly as a scarce resource */
  --accent: #5eead4;
  --accent-hover: #8af3e1;
  --accent-strong: #2dd4bf;
  --accent-ink: #04130f;
  --accent-dim: rgba(94, 234, 212, 0.09);
  --accent-glow: rgba(94, 234, 212, 0.20);
  --accent-edge: rgba(94, 234, 212, 0.28);

  /* Text */
  --text-1: #f0f2f5;
  --text-2: #9aa2af;
  --text-3: #565d6b;
  --text-link: #5eead4;

  /* Status */
  --success: #5eead4;
  --success-dim: rgba(94, 234, 212, 0.11);
  --error: #f4747f;
  --error-dim: rgba(244, 116, 127, 0.11);
  --warning: #f5b942;

  /* Borders — neutral by default, accent is reserved */
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(255, 255, 255, 0.16);
  --hairline: rgba(255, 255, 255, 0.05);

  /* Engineering grid + corner ticks */
  --tick: rgba(255, 255, 255, 0.16);
  --tick-accent: var(--accent-edge);

  /* Misc */
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-card: 0 14px 44px rgba(0, 0, 0, 0.42);
  --shadow-pop: 0 22px 60px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 0 1px var(--accent-edge), 0 14px 44px rgba(0, 0, 0, 0.5);
  --transition: 0.16s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --sidebar-width: 256px;
  --content-max: 1180px;
}

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* SIGNATURE: blueprint grid — visible but quiet, fades with depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 620px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 620px);
}

/* SIGNATURE: single ambient light source, top-left, cool */
body::after {
  content: '';
  position: fixed;
  top: -340px;
  left: 180px;
  width: 680px;
  height: 620px;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(94, 234, 212, 0.055) 0%, transparent 68%);
}

.layout, .mobile-header, .toast-container, .command-palette {
  position: relative;
  z-index: 1;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

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

::selection {
  background: rgba(94, 234, 212, 0.26);
  color: #fff;
}

/* --- Scrollbar — neutral --- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.16);
  background-clip: padding-box;
}

/* ============================================
   LAYOUT
   ============================================ */
.layout { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.32s var(--ease-out);
}

.sidebar-header {
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
}

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

.sidebar-logo-mark,
.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.sidebar-logo-mark { display: block; border-radius: var(--radius-sm); }

.sidebar-logo-icon {
  border-radius: var(--radius-sm);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--accent-ink);
  font-weight: 700;
}

.sidebar-logo-wordmark,
.sidebar-logo-text {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1;
  white-space: nowrap;
  color: var(--text-1);
}

.sidebar-logo-wordmark span,
.sidebar-logo-text span {
  color: var(--accent);
}

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 14px 4px;
  padding: 8px 10px 8px 11px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-family: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.sidebar-search:hover {
  border-color: var(--border-hover);
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.045);
}

.sidebar-search-icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  flex-shrink: 0;
}

.sidebar-search-label {
  flex: 1;
}

.sidebar-search-kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-3);
  white-space: nowrap;
}

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

.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-3);
  padding: 16px 10px 8px;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-1);
}

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
}

/* accent reserved for the active marker only */
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
}

.sidebar-link .icon {
  width: 16px;
  height: 16px;
  opacity: 0.5;
  flex-shrink: 0;
  transition: opacity var(--transition);
}

.sidebar-link:hover .icon { opacity: 0.85; }
.sidebar-link.active .icon { opacity: 1; color: var(--accent); }

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.sidebar-footer a {
  color: var(--text-3);
  margin-right: 14px;
  transition: color var(--transition);
}
.sidebar-footer a:hover { color: var(--accent); }

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

.main-content {
  flex: 1;
  padding: 56px 56px 64px;
  width: 100%;
  max-width: calc(var(--content-max) + 112px);
}

/* --- Mobile header --- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 54px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  align-items: center;
  padding: 0 14px;
  gap: 12px;
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--text-1);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
}
.menu-toggle:hover { background: rgba(255, 255, 255, 0.05); }
.menu-toggle svg { width: 21px; height: 21px; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  z-index: 99;
  backdrop-filter: blur(3px);
}
.sidebar-overlay.visible { display: block; animation: fadeIn 0.2s ease; }

/* ============================================
   PAGE HEADER — dramatic scale
   ============================================ */
.page-header {
  margin-bottom: 44px;
  max-width: 760px;
}

.page-title {
  font-family: var(--font-sans);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1.4px;
  margin-bottom: 14px;
  line-height: 1.1;
  color: var(--text-1);
}

.page-title .accent {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.page-desc {
  font-size: 16px;
  color: var(--text-2);
  max-width: 620px;
  line-height: 1.65;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); }

/* --- Privacy badge --- */
.notice-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  padding: 6px 13px;
  border-radius: 100px;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.notice-badge svg { width: 13px; height: 13px; color: var(--accent); }

/* --- Homepage hero --- */
.hero-panel { max-width: 900px; }

.privacy-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.privacy-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg-card);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  transition: border-color var(--transition), color var(--transition);
}

.privacy-chip::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.privacy-chip:hover {
  border-color: var(--border-hover);
  color: var(--text-1);
}

.hero-analytics-note {
  margin: 14px 0 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.2px;
}

/* ============================================
   SIGNATURE: panel with engineering corner ticks
   ============================================ */
.panel-ticks,
.smart-entry,
.tool-workspace {
  position: relative;
}
.panel-ticks::before,
.panel-ticks::after,
.smart-entry::before,
.smart-entry::after,
.tool-workspace::before,
.tool-workspace::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 7px;
  pointer-events: none;
  z-index: 2;
}
/* top-left + bottom-right L-shaped ticks */
.panel-ticks::before,
.smart-entry::before,
.tool-workspace::before {
  top: -1px; left: -1px;
  border-top: 1px solid var(--tick);
  border-left: 1px solid var(--tick);
}
.panel-ticks::after,
.smart-entry::after,
.tool-workspace::after {
  bottom: -1px; right: -1px;
  border-bottom: 1px solid var(--tick);
  border-right: 1px solid var(--tick);
}

.smart-entry {
  margin-top: 34px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.smart-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.smart-entry-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.smart-entry-title::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.smart-entry-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.smart-input {
  display: block;
  width: 100%;
  min-height: 168px;
  padding: 18px;
  background: var(--bg-input);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
  outline: none;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
}
.smart-input:focus { background: var(--bg-input-focus); }
.smart-input::placeholder { color: var(--text-3); }

.smart-results { padding: 16px; display: grid; gap: 12px; }
.smart-results.is-empty {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}

.smart-results-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
}

.smart-result-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  padding: 15px;
  transition: border-color var(--transition);
}
.smart-result-card:hover { border-color: var(--border-hover); }

.smart-result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
}

.smart-result-meta span:last-child {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.smart-result-card p {
  color: var(--text-3);
  font-size: 12.5px;
  margin-bottom: 13px;
}

.smart-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.section-heading { margin: 56px 0 0; }

.section-heading h2 {
  font-family: var(--font-sans);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-1);
}

.section-heading p {
  color: var(--text-3);
  font-size: 13.5px;
  margin-top: 5px;
}

/* ============================================
   TOOL CARDS
   ============================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  transition: border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out), background 0.2s var(--ease-out);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* SIGNATURE: corner tick appears on hover, top-right */
.tool-card::after {
  content: '';
  position: absolute;
  top: 11px; right: 11px;
  width: 8px; height: 8px;
  border-top: 1.5px solid var(--accent);
  border-right: 1.5px solid var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.tool-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  background: var(--bg-card-hover);
}
.tool-card:hover::after { opacity: 1; }

.tool-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--text-2);
  transition: color var(--transition), border-color var(--transition);
}

.tool-card:hover .tool-card-icon {
  color: var(--accent);
  border-color: var(--accent-edge);
}

.tool-card-icon svg { width: 20px; height: 20px; }

.tool-card h3 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: 7px;
  color: var(--text-1);
}

.tool-card p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  flex: 1;
}

.tool-card-arrow {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color var(--transition), gap var(--transition);
}

.tool-card:hover .tool-card-arrow {
  color: var(--accent);
  gap: 9px;
}

/* ============================================
   TOOL WORKSPACE
   ============================================ */
.tool-workspace {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.tool-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  background: var(--bg-surface);
}

.tool-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 400px;
}

.tool-panel { display: flex; flex-direction: column; }
.tool-panel + .tool-panel { border-left: 1px solid var(--border); }

.tool-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.tool-panel-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-3);
}

.tool-textarea {
  flex: 1;
  width: 100%;
  min-height: 350px;
  padding: 16px;
  background: var(--bg-input);
  color: var(--text-1);
  border: none;
  outline: none;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  tab-size: 2;
}
.tool-textarea:focus { background: var(--bg-input-focus); }
.tool-textarea::placeholder { color: var(--text-3); }

.tool-single { padding: 24px; }

/* --- Results --- */
.result-group { margin-bottom: 20px; }

.result-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-3);
  margin-bottom: 7px;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  margin-bottom: 8px;
  transition: border-color var(--transition);
}
.result-row:hover { border-color: var(--border-hover); }

.result-value {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-1);
  word-break: break-all;
  user-select: all;
}

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

.option-group { display: flex; align-items: center; gap: 8px; }

.option-label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}

.btn svg { width: 15px; height: 15px; }

/* Primary — the loudest use of accent */
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.btn-primary:active { transform: translateY(1px); }

/* Secondary — neutral */
.btn-secondary {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-2);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-1);
  border-color: var(--border-hover);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-3);
}
.btn-ghost:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.04);
}

/* Icon-only */
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  border: 1px solid transparent;
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-1);
}

.send-to-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.send-to-select {
  min-width: 128px;
  max-width: 180px;
  height: 32px;
  padding: 6px 10px;
}

.send-to-button { height: 32px; padding: 7px 12px; }

.btn-lg {
  padding: 11px 22px;
  font-size: 12.5px;
  border-radius: var(--radius-md);
}

.btn-sm { padding: 6px 11px; font-size: 11px; }

/* --- Select --- */
.select {
  padding: 7px 12px;
  background-color: var(--bg-input);
  color: var(--text-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23565d6b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.select:focus { border-color: var(--accent); }

.input-number {
  width: 80px;
  padding: 7px 12px;
  background: var(--bg-input);
  color: var(--text-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  outline: none;
  transition: border-color var(--transition);
}
.input-number:focus { border-color: var(--accent); }

.input-text {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  color: var(--text-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}
.input-text:focus {
  border-color: var(--accent);
  background: var(--bg-input-focus);
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  animation: toastIn 0.32s var(--ease-out);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-pop);
}

.toast-success { color: var(--success); }
.toast-success svg { color: var(--success); }
.toast-error { color: var(--error); }
.toast-error svg { color: var(--error); }

.toast svg { width: 15px; height: 15px; flex-shrink: 0; }
.toast-exit { animation: toastOut 0.2s ease forwards; }

/* ============================================
   INFO / SEO SECTIONS
   ============================================ */
.info-section {
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.info-section h2 {
  font-family: var(--font-sans);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 16px;
  color: var(--text-1);
}

.info-section p {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.8;
  max-width: 760px;
  margin-bottom: 13px;
}

.info-section code {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 1.5px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--accent);
}

.faq-item { margin-bottom: 22px; }

.faq-item h3 {
  font-family: var(--font-sans);
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text-1);
}

.faq-item p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
}

/* --- Related tools --- */
.related-tools {
  margin-top: 40px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
}

.related-tools-header { margin-bottom: 18px; }

.related-tools-header h2 {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 5px;
  color: var(--text-1);
}

.related-tools-header p {
  color: var(--text-3);
  font-size: 13px;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.related-tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 102px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--transition), transform var(--transition);
  position: relative;
}

/* corner tick on hover */
.related-tool-card::after {
  content: '';
  position: absolute;
  top: 9px; right: 9px;
  width: 7px; height: 7px;
  border-top: 1.5px solid var(--accent);
  border-right: 1.5px solid var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.related-tool-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.related-tool-card:hover::after { opacity: 1; }

.related-tool-title {
  font-family: var(--font-sans);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
}

.related-tool-desc {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.55;
}

/* ============================================
   FEATURES STRIP
   ============================================ */
.features-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 44px 0;
}

.feature-item {
  text-align: left;
  padding: 22px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}
.feature-item:hover { border-color: var(--border-hover); }

.feature-icon { font-size: 22px; margin-bottom: 10px; }

.feature-title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-1);
}

.feature-desc { font-size: 12px; color: var(--text-3); line-height: 1.6; }

/* ============================================
   FOOTER
   ============================================ */
.main-footer {
  padding: 28px 56px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  letter-spacing: 0.2px;
}

/* ============================================
   PROSE / GUIDES
   ============================================ */
.prose { max-width: 720px; }

.prose h2 {
  font-family: var(--font-sans);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin: 36px 0 12px;
  color: var(--text-1);
}

.prose h3 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  margin: 26px 0 8px;
  color: var(--text-1);
}

.prose p {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.8;
  margin-bottom: 13px;
}

.prose ul { padding-left: 20px; margin-bottom: 13px; }

.prose li {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.8;
  margin-bottom: 5px;
}

.prose code {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 1.5px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--accent);
}

.prose a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-edge);
  transition: border-color var(--transition);
}
.prose a:hover { border-bottom-color: var(--accent); }

.guide-article { max-width: 820px; }

.code-block {
  margin: 16px 0 20px;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  position: relative;
}

/* engineering tick on code blocks */
.code-block::before {
  content: '';
  position: absolute;
  top: 8px; left: 8px;
  width: 6px; height: 6px;
  border-top: 1px solid var(--tick);
  border-left: 1px solid var(--tick);
}

.code-block code {
  color: inherit;
  white-space: pre;
  background: none;
  border: none;
  padding: 0;
}

.guides-grid { max-width: 760px; }

/* ============================================
   STATUS BAR
   ============================================ */
.status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 16px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-surface);
}

.status-item { display: flex; align-items: center; gap: 6px; }

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* ============================================
   COMMAND PALETTE
   ============================================ */
.command-palette {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.command-palette.open { display: block; }

.command-palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(6px);
}

.command-palette-dialog {
  position: relative;
  width: min(620px, calc(100vw - 32px));
  margin: 13vh auto 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.command-palette-input {
  width: 100%;
  height: 54px;
  padding: 0 18px;
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
  background: var(--bg-input);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 14px;
}
.command-palette-input::placeholder { color: var(--text-3); }

.command-palette-results {
  max-height: min(430px, 56vh);
  overflow-y: auto;
  padding: 8px;
}

.command-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-1);
  cursor: pointer;
  text-align: left;
}

.command-result:hover,
.command-result.is-selected {
  background: rgba(255, 255, 255, 0.05);
}

.command-result.is-selected {
  border-color: var(--accent-edge);
}

.command-result-title {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
}

.command-result-meta {
  flex-shrink: 0;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}

.command-empty {
  padding: 18px 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

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

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(16px); }
}

.animate-in {
  animation: fadeInUp 0.5s var(--ease-out) both;
}
.animate-in:nth-child(2) { animation-delay: 0.05s; }
.animate-in:nth-child(3) { animation-delay: 0.1s; }
.animate-in:nth-child(4) { animation-delay: 0.15s; }
.animate-in:nth-child(5) { animation-delay: 0.2s; }
.animate-in:nth-child(6) { animation-delay: 0.25s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .main-content { padding: 44px 32px 48px; }
  .page-title { font-size: 32px; }
  .tool-panels { grid-template-columns: 1fr; }
  .tool-panel + .tool-panel {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .tool-textarea { min-height: 200px; }
  .features-strip { grid-template-columns: repeat(2, 1fr); }
  .smart-entry-header { flex-direction: column; align-items: flex-start; }
  .send-to-control { width: 100%; margin-left: 0; }
  .send-to-select { flex: 1; max-width: none; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { display: flex; }
  .main { margin-left: 0; }
  .main-content { padding: 70px 16px 32px; }
  .main-footer { padding: 22px 16px; }
  .page-header { margin-bottom: 32px; }
  .page-title { font-size: 27px; letter-spacing: -1px; }
  .page-desc { font-size: 15px; }
  .section-heading { margin-top: 40px; }
  .tools-grid { grid-template-columns: 1fr; }
  .features-strip { grid-template-columns: 1fr 1fr; gap: 10px; }
  .feature-item { padding: 16px 14px; }
  .privacy-chips { gap: 6px; }
  .smart-input { min-height: 150px; }
  .smart-actions .btn { width: 100%; }
  .command-palette-dialog { margin-top: 70px; }
  .tool-toolbar { padding: 10px 12px; }
  .options-row { flex-direction: column; align-items: flex-start; }
}
