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

:root {
    --bg: #080b12;
    --bg2: #0e1220;
    --bg3: #141927;
    --bg4: #1e2535;
    --border: rgba(255,255,255,0.07);
    --accent: #00e5ff;
    --accent2: #7b5cfa;
    --text: #e8eaf0;
    --muted: #6b7280;
    --green: #00ff9d;
    --red: #ff5f57;
    --diff-add-bg: rgba(0, 255, 157, 0.08);
    --diff-add-border: rgba(0, 255, 157, 0.3);
    --diff-remove-bg: rgba(255, 95, 87, 0.08);
    --diff-remove-border: rgba(255, 95, 87, 0.3);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,229,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,229,255,0.025) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* ===================== NAV ===================== */
nav {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(8,11,18,0.9);
    backdrop-filter: blur(12px);
}

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}
.logo-bracket { color: var(--accent); }

.nav-links { display: flex; gap: 1.5rem; list-style: none; align-items: center; }
.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.nav-badge {
    background: rgba(0,229,255,0.1);
    border: 1px solid rgba(0,229,255,0.2);
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

/* ===================== FOOTER ===================== */
footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted);
}

/* ===================== HERO ===================== */
.hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 6rem 2rem 3rem;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0,229,255,0.06);
    border: 1px solid rgba(0,229,255,0.15);
    border-radius: 20px;
    padding: 0.35rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.hero-tag::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.2rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1rem;
    color: var(--muted);
    max-width: 500px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.search-bar {
    display: flex;
    align-items: center;
    max-width: 440px;
    margin: 0 auto;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar:focus-within {
    border-color: rgba(0,229,255,0.3);
    box-shadow: 0 0 0 3px rgba(0,229,255,0.05);
}

.search-bar svg { color: var(--muted); flex-shrink: 0; }

.search-bar input {
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    width: 100%;
}

.search-bar input::placeholder { color: var(--muted); }

.kbd {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: var(--muted);
    white-space: nowrap;
}

/* ===================== STATS ===================== */
.stats {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 1.5rem 2rem 2rem;
}

.stat { text-align: center; }

.stat-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    font-weight: 700;
}
.stat-num span { color: var(--accent); }

.stat-label {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.2rem;
}

/* ===================== TOOLS SECTION ===================== */
.section {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 2rem 5rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    white-space: nowrap;
}

.section-line { flex: 1; height: 1px; background: var(--border); min-width: 20px; }

.privacy-legend {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ===================== TOOL CARDS ===================== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.tool-card {
    background: var(--bg);
    padding: 1.8rem;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    text-decoration: none;
    display: block;
}

.tool-card:hover { background: var(--bg2); }
.tool-card.disabled { opacity: 0.45; pointer-events: none; }
.tool-card:hover .card-arrow { transform: translate(3px, -3px); opacity: 1; }

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-privacy {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    color: var(--green);
    background: rgba(0,255,157,0.08);
    border: 1px solid rgba(0,255,157,0.2);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    white-space: nowrap;
}

.badge-privacy-inline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--green);
    background: rgba(0,255,157,0.06);
    border: 1px solid rgba(0,255,157,0.15);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
}

.card-icon {
    width: 40px; height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
}

.icon-cyan   { background: rgba(0,229,255,0.1);  color: var(--accent); }
.icon-purple { background: rgba(123,92,250,0.1); color: var(--accent2); }
.icon-green  { background: rgba(0,255,157,0.1);  color: var(--green); }
.icon-orange { background: rgba(255,165,0,0.1);  color: orange; }

.card-arrow {
    color: var(--muted);
    font-size: 1rem;
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.4;
}

.card-tag {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: var(--muted);
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.12rem 0.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.card-title { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 0.35rem; }
.card-desc  { font-size: 0.82rem; color: var(--muted); line-height: 1.6; }

.card-featured {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
}

/* ===================== TOOL PAGE ===================== */
.breadcrumb {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 2rem;
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted);
    flex-wrap: wrap;
}

.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: 0.3; }
.breadcrumb .current { color: var(--accent); }

.page-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 280px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 110px);
}

.tool-area {
    padding: 2rem;
    border-right: 1px solid var(--border);
}

.tool-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.4rem;
    display: block;
}

.tool-header h1 {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.tool-header p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
    margin-bottom: 1.5rem;
    max-width: 600px;
}

/* ===================== BUTTONS ===================== */
.tool-actions { display: flex; gap: 0.5rem; margin-bottom: 1.2rem; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.btn-primary {
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    color: #080b12;
}
.btn-primary:hover { opacity: 0.88; }

.btn-ghost {
    background: var(--bg3);
    color: var(--muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }

/* ===================== EDITOR ===================== */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.panel  { display: flex; flex-direction: column; gap: 0.5rem; }

.panel-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.lines-count {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-size: 0.62rem;
}

.editor {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.editor-top {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg4);
    flex-shrink: 0;
}

.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-r { background: var(--red); }
.dot-y { background: #ffbd2e; }
.dot-g { background: #28c840; }

.editor-filename {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: var(--muted);
    margin-left: 0.3rem;
}

.editor textarea {
    width: 100%;
    height: 400px;
    background: transparent;
    border: none;
    outline: none;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text);
    resize: vertical;
    line-height: 1.65;
}

.editor textarea::placeholder { color: var(--muted); opacity: 0.5; }

.status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-top: 1px solid var(--border);
    background: var(--bg4);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    flex-shrink: 0;
}

.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.status-dot.ok  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.err { background: var(--red);   box-shadow: 0 0 6px var(--red); }
.status-text { color: var(--muted); }

/* ===================== SEO SECTION ===================== */
.seo-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.seo-section h2 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text); }
.seo-section p  { font-size: 0.85rem; color: var(--muted); line-height: 1.7; }

/* ===================== DIFF OUTPUT ===================== */
.diff-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.diff-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.diff-stats {
    display: flex;
    gap: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
}

.diff-stat-added   { color: var(--green); }
.diff-stat-removed { color: var(--red); }
.diff-stat-same    { color: var(--muted); }

.diff-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.diff-panel { background: var(--bg2); }

.diff-panel-label {
    padding: 0.5rem 0.8rem;
    background: var(--bg4);
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.diff-content {
    overflow-x: auto;
    min-height: 100px;
}

.diff-line {
    display: flex;
    align-items: stretch;
    min-height: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
}

.diff-line-same    { background: transparent; }
.diff-line-added   { background: var(--diff-add-bg); border-left: 3px solid var(--diff-add-border); }
.diff-line-removed { background: var(--diff-remove-bg); border-left: 3px solid var(--diff-remove-border); }
.diff-line-empty   { background: rgba(255,255,255,0.01); }

.diff-line-num {
    min-width: 40px;
    padding: 0.15rem 0.6rem;
    color: var(--muted);
    font-size: 0.7rem;
    border-right: 1px solid var(--border);
    text-align: right;
    user-select: none;
    opacity: 0.5;
    flex-shrink: 0;
}

.diff-line-prefix {
    width: 20px;
    padding: 0.15rem 0.3rem;
    flex-shrink: 0;
    font-weight: 700;
}

.diff-line-added   .diff-line-prefix { color: var(--green); }
.diff-line-removed .diff-line-prefix { color: var(--red); }
.diff-line-same    .diff-line-prefix { color: var(--muted); }
.diff-line-empty   .diff-line-prefix { color: transparent; }

.diff-line-text {
    padding: 0.15rem 0.5rem;
    white-space: pre;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.diff-line-added   .diff-line-text { color: var(--green); }
.diff-line-removed .diff-line-text { color: var(--red); opacity: 0.8; }
.diff-line-same    .diff-line-text { color: var(--text); }

/* ===================== SIDEBAR ===================== */
.sidebar {
    padding: 1.5rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ad-unit {
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: 8px;
    overflow: hidden;
}

.ad-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.8rem;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px dashed rgba(255,255,255,0.07);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.ad-placeholder {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.01);
    padding: 1rem;
}

.ad-loading-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted);
    opacity: 0.4;
}

.ad-support-msg {
    padding: 0.6rem 0.8rem;
    background: rgba(0,229,255,0.03);
    border-top: 1px dashed rgba(255,255,255,0.07);
    font-size: 0.7rem;
    color: var(--muted);
    line-height: 1.6;
    text-align: center;
}

.sidebar-section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.6rem;
}

.tips-box {
    background: rgba(0,229,255,0.03);
    border: 1px solid rgba(0,229,255,0.1);
    border-radius: 8px;
    padding: 1rem;
}

.tips-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.7rem;
}

.tips-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tips-box li {
    list-style: none;
    font-size: 0.78rem;
    color: var(--muted);
    display: flex;
    gap: 0.5rem;
    line-height: 1.4;
    align-items: flex-start;
}

.tips-box li::before {
    content: '→';
    color: var(--accent);
    flex-shrink: 0;
    font-size: 0.7rem;
}

.related-tool {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.8rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 0.5rem;
}

.related-tool:hover {
    border-color: rgba(0,229,255,0.2);
    background: var(--bg3);
}

.related-icon {
    width: 30px; height: 30px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    font-weight: 700;
    flex-shrink: 0;
}

.related-info { flex: 1; }
.related-name { font-size: 0.78rem; font-weight: 600; color: var(--text); margin-bottom: 0.1rem; }
.related-desc { font-size: 0.68rem; color: var(--muted); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
    .page-layout { grid-template-columns: 1fr; min-height: auto; }
    .tool-area { border-right: none; padding: 1rem; }
    .sidebar { border-top: 1px solid var(--border); }
    .panels { grid-template-columns: 1fr; }
    .diff-panels { grid-template-columns: 1fr; }
    .tools-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 520px) {
    nav { padding: 0.8rem 1rem; }
    .hero { padding: 3.5rem 1rem 2rem; }
    .search-bar { max-width: 100%; }
    .hero p { max-width: 100%; }
    .stats { gap: 1.5rem; }
    .section-header { flex-direction: column; align-items: flex-start; }
}

.btn-explore {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.8rem;
    background: transparent;
    border: 1px solid rgba(0,229,255,0.3);
    color: var(--accent);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    animation: bounce 2s infinite;
}

.btn-explore:hover {
    background: rgba(0,229,255,0.08);
    border-color: var(--accent);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

.char-added {
    background: rgba(0, 255, 157, 0.3);
    border-radius: 2px;
    color: #00ff9d;
}

.char-removed {
    background: rgba(255, 95, 87, 0.3);
    border-radius: 2px;
    color: #ff5f57;
    text-decoration: line-through;
}

.single-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #e6edf3;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    padding: 1rem;
}

.copy-btn {
    opacity: 0;
    background: transparent;
    border: none;
    color: #8b949e;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.editor:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    color: #e6edf3;
    transform: scale(1.1);
}