/* ============================================
   AI Sensitive Data Masker - Styles
   Fresh mint theme · Glassmorphism · Responsive
   ============================================ */

:root {
    /* Colors */
    --mint-50: #ecfdf5;
    --mint-100: #d1fae5;
    --mint-200: #a7f3d0;
    --mint-300: #6ee7b7;
    --mint-400: #34d399;
    --mint-500: #10b981;
    --mint-600: #059669;
    --mint-700: #047857;
    --mint-800: #065f46;
    --mint-900: #064e3b;

    --coral: #fb7185;
    --coral-light: #fda4af;
    --amber: #fbbf24;

    --ink-50: #f8fafc;
    --ink-100: #f1f5f9;
    --ink-200: #e2e8f0;
    --ink-300: #cbd5e1;
    --ink-400: #94a3b8;
    --ink-500: #64748b;
    --ink-600: #475569;
    --ink-700: #334155;
    --ink-800: #1e293b;
    --ink-900: #0f172a;

    /* Typography */
    --font-display: 'Fraunces', 'Noto Sans SC', 'Noto Sans JP', serif;
    --font-body: 'Plus Jakarta Sans', 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans Arabic', 'Noto Sans Devanagari', sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 40px -10px rgba(16, 185, 129, 0.15), 0 8px 16px -8px rgba(15, 23, 42, 0.1);
    --shadow-mint: 0 8px 24px -8px rgba(16, 185, 129, 0.35);

    /* Radii */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 24px;
    --r-full: 9999px;

    /* Transitions */
    --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink-700);
    background: var(--ink-50);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* RTL support for Arabic */
[dir="rtl"] {
    text-align: right;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   Background Decoration
   ============================================ */
.bg-decoration {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-mesh {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(at 20% 20%, rgba(16, 185, 129, 0.12) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(110, 231, 183, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 80%, rgba(167, 243, 208, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(52, 211, 153, 0.08) 0px, transparent 50%),
        linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.bg-noise {
    position: absolute;
    inset: 0;
    opacity: 0.4;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.3), transparent 70%);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(110, 231, 183, 0.25), transparent 70%);
    bottom: -50px;
    left: -50px;
    animation-delay: -7s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(251, 113, 133, 0.15), transparent 70%);
    top: 40%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ============================================
   Header
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248, 250, 252, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink-900);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    transition: opacity var(--t-fast);
}

.logo:hover { opacity: 0.8; }

.logo-text {
    letter-spacing: -0.02em;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language Switcher */
.lang-switcher {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: white;
    border: 1px solid var(--ink-200);
    border-radius: var(--r-full);
    color: var(--ink-700);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
    box-shadow: var(--shadow-sm);
}

.lang-btn:hover {
    border-color: var(--mint-400);
    color: var(--mint-700);
    box-shadow: var(--shadow-md);
}

.lang-btn[aria-expanded="true"] {
    border-color: var(--mint-500);
    color: var(--mint-700);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: white;
    border: 1px solid var(--ink-200);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    list-style: none;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--t-base);
    z-index: 200;
    max-height: 400px;
    overflow-y: auto;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--ink-700);
    transition: all var(--t-fast);
}

.lang-dropdown li:hover {
    background: var(--mint-50);
    color: var(--mint-800);
}

.lang-dropdown li.active {
    background: var(--mint-100);
    color: var(--mint-900);
    font-weight: 600;
}

.lang-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    background: var(--mint-500);
    color: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.github-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--r-full);
    color: var(--ink-600);
    transition: all var(--t-fast);
}

.github-link:hover {
    background: var(--ink-100);
    color: var(--ink-900);
}

/* ============================================
   Main
   ============================================ */
.main {
    padding: 48px 0 80px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 32px 0 56px;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: var(--mint-100);
    color: var(--mint-800);
    border: 1px solid var(--mint-200);
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
    letter-spacing: 0.01em;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--ink-900);
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--ink-900) 0%, var(--mint-800) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.7;
    color: var(--ink-600);
    max-width: 640px;
    margin: 0 auto 32px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-num {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--mint-700);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--ink-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   Tool Section
   ============================================ */
.tool-section {
    margin-bottom: 48px;
}

.tool-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.tool-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ink-100);
    background: rgba(248, 250, 252, 0.5);
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--r-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--mint-500), var(--mint-600));
    color: white;
    box-shadow: var(--shadow-mint);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--mint-600), var(--mint-700));
    box-shadow: 0 12px 28px -8px rgba(16, 185, 129, 0.5);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--ink-600);
    border: 1px solid var(--ink-200);
}

.btn-ghost:hover {
    background: white;
    border-color: var(--mint-300);
    color: var(--mint-700);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Panels */
.tool-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.panel {
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.input-panel {
    border-right: 1px solid var(--ink-100);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.panel-header label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-800);
}

.char-count {
    font-size: 12px;
    color: var(--ink-400);
    font-variant-numeric: tabular-nums;
}

.output-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mask-count {
    font-size: 12px;
    color: var(--mint-700);
    font-weight: 600;
    background: var(--mint-50);
    padding: 4px 10px;
    border-radius: var(--r-full);
    border: 1px solid var(--mint-200);
}

.textarea {
    flex: 1;
    width: 100%;
    min-height: 280px;
    padding: 16px;
    border: 1px solid var(--ink-200);
    border-radius: var(--r-md);
    background: white;
    color: var(--ink-800);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
    transition: all var(--t-fast);
    outline: none;
}

.textarea:focus {
    border-color: var(--mint-400);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.textarea::placeholder {
    color: var(--ink-400);
}

.output-text {
    background: var(--mint-50);
    border-color: var(--mint-200);
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}

.output-text:empty::before {
    content: attr(data-empty);
    color: var(--ink-400);
}

/* Highlighted masked tokens */
.mask-token {
    display: inline;
    background: linear-gradient(135deg, var(--coral), var(--coral-light));
    color: white;
    padding: 1px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.92em;
    margin: 0 1px;
    box-shadow: 0 1px 3px rgba(251, 113, 133, 0.3);
}

/* Rules Panel */
.rules-panel {
    padding: 24px;
    border-top: 1px solid var(--ink-100);
    background: rgba(248, 250, 252, 0.6);
    animation: slideDown var(--t-base) ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.rules-section {
    margin-bottom: 24px;
}

.rules-section:last-child { margin-bottom: 0; }

.rules-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-800);
    margin-bottom: 14px;
}

.rules-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: white;
    border: 1px solid var(--ink-200);
    border-radius: var(--r-md);
    transition: all var(--t-fast);
}

.rule-item:hover {
    border-color: var(--mint-300);
    box-shadow: var(--shadow-sm);
}

.rule-item.disabled {
    opacity: 0.5;
}

.rule-info {
    flex: 1;
    min-width: 0;
}

.rule-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-800);
    margin-bottom: 2px;
}

.rule-desc {
    font-size: 11px;
    color: var(--ink-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Toggle switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--ink-300);
    border-radius: var(--r-full);
    transition: var(--t-fast);
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: var(--t-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider {
    background: var(--mint-500);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

/* Custom rules list */
.custom-rules-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-rule-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr auto auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    background: white;
    border: 1px solid var(--ink-200);
    border-radius: var(--r-md);
}

.custom-rule-input {
    padding: 6px 10px;
    border: 1px solid var(--ink-200);
    border-radius: var(--r-sm);
    font-size: 13px;
    font-family: var(--font-body);
    background: var(--ink-50);
    color: var(--ink-800);
    outline: none;
    transition: all var(--t-fast);
}

.custom-rule-input:focus {
    border-color: var(--mint-400);
    background: white;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.custom-rule-input.regex {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 12px;
}

.custom-empty {
    text-align: center;
    padding: 24px;
    color: var(--ink-400);
    font-size: 14px;
    border: 1px dashed var(--ink-200);
    border-radius: var(--r-md);
}

.delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--ink-400);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all var(--t-fast);
}

.delete-btn:hover {
    background: #fef2f2;
    color: var(--coral);
}

/* ============================================
   Ad Section
   ============================================ */
.ad-section {
    margin: 48px 0;
    min-height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ============================================
   Examples Section
   ============================================ */
.examples-section, .docs-section {
    margin-bottom: 64px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    color: var(--ink-900);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.section-desc {
    font-size: 15px;
    color: var(--ink-500);
    margin-bottom: 32px;
    max-width: 640px;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.example-card {
    background: white;
    border: 1px solid var(--ink-200);
    border-radius: var(--r-lg);
    padding: 24px;
    cursor: pointer;
    transition: all var(--t-base);
    position: relative;
    overflow: hidden;
}

.example-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--mint-400), var(--mint-600));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t-base);
}

.example-card:hover {
    border-color: var(--mint-300);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.example-card:hover::before {
    transform: scaleX(1);
}

.example-tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--mint-100);
    color: var(--mint-800);
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.example-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--ink-900);
    margin-bottom: 8px;
}

.example-preview {
    font-size: 13px;
    color: var(--ink-500);
    line-height: 1.6;
    background: var(--ink-50);
    padding: 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--ink-100);
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.example-preview::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, var(--ink-50));
}

/* ============================================
   Docs Section
   ============================================ */
.docs-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: start;
}

.docs-nav {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.docs-link {
    display: block;
    padding: 8px 14px;
    color: var(--ink-500);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--r-sm);
    border-left: 2px solid transparent;
    transition: all var(--t-fast);
}

.docs-link:hover {
    color: var(--mint-700);
    background: var(--mint-50);
}

.docs-link.active {
    color: var(--mint-800);
    background: var(--mint-50);
    border-left-color: var(--mint-500);
    font-weight: 600;
}

.docs-content {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.docs-article h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--ink-900);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.docs-body {
    font-size: 15px;
    line-height: 1.8;
    color: var(--ink-600);
}

.docs-body h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-800);
    margin: 20px 0 8px;
}

.docs-body p {
    margin-bottom: 12px;
}

.docs-body ul, .docs-body ol {
    margin: 12px 0 12px 24px;
}

.docs-body li {
    margin-bottom: 6px;
}

.docs-body code {
    background: var(--mint-50);
    color: var(--mint-800);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 13px;
}

.docs-body strong {
    color: var(--ink-800);
    font-weight: 600;
}

.docs-body .rule-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.docs-body .rule-table th,
.docs-body .rule-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--ink-100);
}

.docs-body .rule-table th {
    background: var(--mint-50);
    color: var(--mint-900);
    font-weight: 600;
    font-size: 13px;
}

.docs-body .rule-table td code {
    background: transparent;
    color: var(--ink-700);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--ink-900);
    color: var(--ink-300);
    padding: 48px 0 32px;
    margin-top: 80px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: white;
    display: block;
    margin-bottom: 8px;
}

.footer-tagline {
    font-size: 14px;
    color: var(--ink-400);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: var(--ink-300);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--t-fast);
}

.footer-links a:hover {
    color: var(--mint-400);
}

.footer-copy {
    font-size: 13px;
    color: var(--ink-500);
}

.footer-copy a {
    color: var(--ink-300);
    text-decoration: none;
}

.footer-copy a:hover {
    color: var(--mint-400);
}

/* ============================================
   Toast
   ============================================ */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--ink-900);
    color: white;
    padding: 12px 24px;
    border-radius: var(--r-full);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all var(--t-base);
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--mint-600);
}

.toast.error {
    background: var(--coral);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .tool-panels {
        grid-template-columns: 1fr;
    }

    .input-panel {
        border-right: none;
        border-bottom: 1px solid var(--ink-100);
    }

    .panel {
        min-height: 240px;
    }

    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
        gap: 8px;
    }

    .docs-link {
        white-space: nowrap;
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    .docs-link.active {
        border-left: none;
        border-bottom-color: var(--mint-500);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header-inner {
        height: 56px;
    }

    .logo-text {
        font-size: 16px;
    }

    .main {
        padding: 24px 0 60px;
    }

    .hero {
        padding: 16px 0 40px;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-num {
        font-size: 24px;
    }

    .tool-toolbar {
        padding: 12px;
    }

    .toolbar-left, .toolbar-right {
        width: 100%;
        justify-content: center;
    }

    .panel {
        padding: 16px;
        min-height: 200px;
    }

    .textarea {
        min-height: 180px;
        font-size: 13px;
    }

    .custom-rule-row {
        grid-template-columns: 1fr 1fr;
    }

    .custom-rule-row > *:nth-child(3),
    .custom-rule-row > *:nth-child(4),
    .custom-rule-row > *:nth-child(5) {
        grid-column: span 1;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .btn span {
        display: inline;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }

    .hero-stats {
        gap: 16px;
    }

    .stat-num {
        font-size: 20px;
    }

    .btn span {
        font-size: 12px;
    }

    .lang-btn span:not(.lang-flag) {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

:focus-visible {
    outline: 2px solid var(--mint-500);
    outline-offset: 2px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--ink-100);
}

::-webkit-scrollbar-thumb {
    background: var(--ink-300);
    border-radius: var(--r-full);
    border: 2px solid var(--ink-100);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--mint-400);
}
