:root {
  --bg:         #0d1117;
  --bg2:        #161b22;
  --bg3:        #1c2331;
  --bg4:        #21262d;
  --border:     rgba(255,255,255,0.08);
  --border-h:   rgba(255,255,255,0.14);
  --text:       #e6edf3;
  --text2:      #8b949e;
  --text3:      #6e7681;
  --accent:     #2f81f7;
  --accent-h:   #388bfd;
  --accent-bg:  rgba(47,129,247,0.10);
  --accent-bg2: rgba(47,129,247,0.18);
  --green:      #3fb950;
  --green-bg:   rgba(63,185,80,0.10);
  --amber:      #e3b341;
  --amber-bg:   rgba(227,179,65,0.10);
  --red:        #f85149;
  --red-bg:     rgba(248,81,73,0.10);
  --purple:     #bc8cff;
  --purple-bg:  rgba(188,140,255,0.10);
  --teal:       #38bda4;
  --teal-bg:    rgba(56,189,164,0.10);
  --mono:       'JetBrains Mono', monospace;
  --sans:       'DM Sans', sans-serif;
  --radius:     10px;
  --radius-lg:  14px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* NAV */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,17,23,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 52px;
  display: flex; align-items: center;
  padding: 0 1.5rem; gap: 12px;
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; font-size: 14px; font-weight: 600; color: var(--text);
}
.nav-brand-icon {
  width: 26px; height: 26px; background: var(--accent);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.nav-brand-icon svg { width: 13px; height: 13px; fill: #fff; }
.nav-brand span { color: var(--accent); }
.nav-sep { color: var(--text3); font-size: 18px; font-weight: 200; }
.nav-tool-name { font-size: 13px; color: var(--text2); font-weight: 400; }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-back {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text3); text-decoration: none;
  padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--border); transition: all 0.15s;
}
.nav-back:hover { color: var(--text); border-color: var(--border-h); }

/* TOOL LAYOUT */
.tool-page { flex: 1; display: flex; flex-direction: column; padding: 24px; gap: 16px; max-width: 1600px; width: 100%; margin: 0 auto; }
.tool-header { display: flex; align-items: center; gap: 12px; }
.tool-icon-lg {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.tool-icon-lg.blue   { background: var(--accent-bg2); color: var(--accent); }
.tool-icon-lg.green  { background: var(--green-bg);   color: var(--green); }
.tool-icon-lg.amber  { background: var(--amber-bg);   color: var(--amber); }
.tool-icon-lg.red    { background: var(--red-bg);     color: var(--red); }
.tool-icon-lg.purple { background: var(--purple-bg);  color: var(--purple); }
.tool-icon-lg.teal   { background: var(--teal-bg);    color: var(--teal); }
.tool-title { font-size: 18px; font-weight: 600; }
.tool-subtitle { font-size: 12px; color: var(--text2); margin-top: 1px; }

/* PANELS */
.panel {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--bg3); gap: 8px; flex-wrap: wrap;
}
.panel-title { font-size: 12px; font-weight: 500; color: var(--text2); text-transform: uppercase; letter-spacing: 0.06em; }

/* TEXTAREA */
textarea {
  width: 100%; background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--mono); font-size: 13px;
  line-height: 1.7; resize: none; padding: 14px;
  min-height: 240px;
}
textarea::placeholder { color: var(--text3); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 7px; font-family: var(--sans);
  font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--border);
  background: var(--bg4); color: var(--text2); transition: all 0.15s; white-space: nowrap;
}
.btn:hover { border-color: var(--border-h); color: var(--text); background: var(--bg3); }
.btn-primary {
  background: var(--accent); color: #fff; border-color: transparent;
}
.btn-primary:hover { background: var(--accent-h); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 6px 8px; }

/* INPUTS */
input[type=text], input[type=number], select {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 7px; padding: 7px 11px; color: var(--text);
  font-family: var(--sans); font-size: 13px; outline: none;
  transition: border-color 0.15s;
}
input[type=text]:focus, input[type=number]:focus, select:focus { border-color: var(--accent); }
select option { background: var(--bg2); }

/* TOOLBAR */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 0;
}

/* DIFF COLORS */
.diff-add    { background: rgba(63,185,80,0.15);  color: var(--green); }
.diff-remove { background: rgba(248,81,73,0.15);  color: var(--red); }
.diff-change { background: rgba(227,179,65,0.12); color: var(--amber); }
.diff-add-inline    { background: rgba(63,185,80,0.3); }
.diff-remove-inline { background: rgba(248,81,73,0.3); text-decoration: line-through; }

/* RESULT BOX */
.result-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px; font-family: var(--mono);
  font-size: 13px; line-height: 1.8; overflow-x: auto;
}

/* BADGE */
.badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber); }
.badge-blue   { background: var(--accent-bg); color: var(--accent); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }

/* STAT ROW */
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-chip {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text2);
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px;
}
.stat-chip strong { color: var(--text); font-weight: 600; }

/* GRID HELPERS */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .two-col, .three-col { grid-template-columns: 1fr; } }

/* EMPTY STATE */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 48px 20px; color: var(--text3); text-align: center;
}
.empty-state-icon { font-size: 32px; opacity: 0.4; }
.empty-state p { font-size: 13px; }

/* COPY TOAST */
#copy-toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--green); color: #fff;
  padding: 8px 16px; border-radius: 8px; font-size: 13px;
  opacity: 0; transform: translateY(6px); transition: all 0.2s; pointer-events: none;
  z-index: 999;
}
#copy-toast.show { opacity: 1; transform: translateY(0); }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
