/* ===================================================================
   Instyment — Main Stylesheet
   Modern dark SaaS design with glassmorphism
   =================================================================== */

/* ── Google Font ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ── */
:root {
    /* Colors — Deep dark palette with vibrant accents */
    --bg-primary:    #0a0a0f;
    --bg-secondary:  #12121a;
    --bg-card:       rgba(22, 22, 35, 0.75);
    --bg-card-hover: rgba(30, 30, 48, 0.85);
    --bg-glass:      rgba(255, 255, 255, 0.04);
    --bg-input:      rgba(255, 255, 255, 0.06);

    --border-subtle:  rgba(255, 255, 255, 0.06);
    --border-light:   rgba(255, 255, 255, 0.10);
    --border-accent:  rgba(99, 102, 241, 0.4);

    --text-primary:   #f0f0f5;
    --text-secondary: #8b8b9e;
    --text-muted:     #55556a;

    --accent:         #6366f1;
    --accent-hover:   #818cf8;
    --accent-glow:    rgba(99, 102, 241, 0.25);
    --accent-soft:    rgba(99, 102, 241, 0.10);

    --success:        #10b981;
    --success-soft:   rgba(16, 185, 129, 0.12);
    --error:          #ef4444;
    --error-soft:     rgba(239, 68, 68, 0.12);
    --warning:        #f59e0b;

    /* Category colors */
    --cat-image:  #8b5cf6;
    --cat-pdf:    #ef4444;
    --cat-dev:    #06b6d4;
    --cat-text:   #f59e0b;
    --cat-misc:   #10b981;

    /* Gradients */
    --gradient-accent: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-card:   linear-gradient(145deg, rgba(22,22,35,0.8), rgba(15,15,25,0.9));
    --gradient-hero:   radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.12) 0%, transparent 60%);

    /* Shadows */
    --shadow-sm:   0 2px 8px rgba(0,0,0,0.3);
    --shadow-md:   0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg:   0 8px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(99,102,241,0.15);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition:      0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Font */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background ambient glow */
body::before {
    content: '';
    position: fixed;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 60%;
    background: radial-gradient(ellipse, rgba(99,102,241,0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

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

img { max-width: 100%; }

/* ── Layout ── */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ── Header ── */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-glow);
}

/* ── Search ── */
.search-wrap {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font);
    outline: none;
    transition: var(--transition);
}

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

.search-input:focus {
    border-color: var(--border-accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

/* ── Hero Section ── */
.hero {
    text-align: center;
    padding: 60px 0 40px;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse, rgba(99,102,241,0.08), transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* ── Category Tabs ── */
.categories {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
    padding: 0 16px;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.category-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.category-tab.active {
    background: var(--accent-soft);
    color: var(--accent-hover);
    border-color: var(--border-accent);
}

.category-tab .cat-icon {
    font-size: 1rem;
}

/* ── Tool Cards Grid ── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    opacity: 0;
    transition: opacity var(--transition);
}

.tool-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card-icon {
    font-size: 2.2rem;
    margin-bottom: 16px;
    display: block;
    width: 56px;
    height: 56px;
    background: var(--accent-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.tool-card:hover .tool-card-icon {
    transform: scale(1.08);
    background: rgba(99, 102, 241, 0.18);
}

/* Category-specific icon colors */
.tool-card[data-category="image"] .tool-card-icon { background: rgba(139,92,246,0.12); }
.tool-card[data-category="pdf"] .tool-card-icon   { background: rgba(239,68,68,0.12); }
.tool-card[data-category="dev"] .tool-card-icon   { background: rgba(6,182,212,0.12); }
.tool-card[data-category="text"] .tool-card-icon  { background: rgba(245,158,11,0.12); }

.tool-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tool-card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
}

.tool-card-category {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Card animation on appear */
.tool-card {
    animation: cardAppear 0.4s ease backwards;
}

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

/* Stagger animation */
.tool-card:nth-child(1) { animation-delay: 0.02s; }
.tool-card:nth-child(2) { animation-delay: 0.04s; }
.tool-card:nth-child(3) { animation-delay: 0.06s; }
.tool-card:nth-child(4) { animation-delay: 0.08s; }
.tool-card:nth-child(5) { animation-delay: 0.10s; }
.tool-card:nth-child(6) { animation-delay: 0.12s; }
.tool-card:nth-child(7) { animation-delay: 0.14s; }
.tool-card:nth-child(8) { animation-delay: 0.16s; }
.tool-card:nth-child(9) { animation-delay: 0.18s; }
.tool-card:nth-child(10) { animation-delay: 0.20s; }
.tool-card:nth-child(11) { animation-delay: 0.22s; }
.tool-card:nth-child(12) { animation-delay: 0.24s; }
.tool-card:nth-child(13) { animation-delay: 0.26s; }

/* Hide card when filtered out */
.tool-card.hidden {
    display: none;
}

/* ── Tool Page ── */
.tool-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: var(--transition-fast);
}
.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb .sep {
    opacity: 0.3;
}

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

.tool-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.tool-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* ── Upload Zone ── */
.upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-xl);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    background: var(--bg-glass);
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-accent);
    opacity: 0;
    transition: opacity var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.upload-zone.dragover::before {
    opacity: 0.05;
}

.upload-zone-content {
    position: relative;
    z-index: 1;
}

.upload-zone-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0.6;
}

.upload-zone h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-zone p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.upload-zone .paste-hint {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.paste-hint kbd {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-family: var(--font);
}

.upload-zone input[type="file"] {
    display: none;
}

/* File List */
.file-list {
    margin-top: 24px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}

.file-item-preview {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-input);
    flex-shrink: 0;
}

.file-item-info {
    flex: 1;
    min-width: 0;
}

.file-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-item-remove {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--error-soft);
    color: var(--error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.file-item-remove:hover {
    background: var(--error);
    color: white;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(99,102,241,0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    filter: brightness(1.1);
}

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

/* ── Options Panel ── */
.options-panel {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.options-panel h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.option-row:last-child {
    margin-bottom: 0;
}

.option-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 120px;
}

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

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

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px var(--accent-glow);
}

.option-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 40px;
    text-align: right;
}

/* Select */
select {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

select:focus {
    border-color: var(--border-accent);
}

/* ── Progress Bar ── */
.progress-wrap {
    margin-top: 24px;
    display: none;
}

.progress-wrap.active {
    display: block;
}

.progress-bar-outer {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-inner {
    height: 100%;
    width: 0%;
    background: var(--gradient-accent);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ── Result Area ── */
.result-area {
    margin-top: 24px;
    display: none;
}

.result-area.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.result-success {
    padding: 20px;
    background: var(--success-soft);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    text-align: center;
}

.result-success h3 {
    color: var(--success);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.result-error {
    padding: 20px;
    background: var(--error-soft);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--error);
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.result-item-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.result-item-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Text Areas & Inputs ── */
textarea,
input[type="text"],
input[type="number"],
input[type="url"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font);
    outline: none;
    transition: var(--transition);
    resize: vertical;
}

textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="url"]:focus {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
    min-height: 120px;
    line-height: 1.6;
}

/* ── Toast / Notification ── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    backdrop-filter: blur(20px);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.toast-error {
    border-color: rgba(239, 68, 68, 0.3);
}

.toast.toast-success {
    border-color: rgba(16, 185, 129, 0.3);
}

/* ── Spinner ── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── No Results ── */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-subtle);
}

/* ── Copy Button ── */
.copy-btn {
    padding: 6px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition-fast);
}
.copy-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}
.copy-btn.copied {
    background: var(--success-soft);
    color: var(--success);
    border-color: rgba(16,185,129,0.3);
}

/* ── Tool-specific: Output Text ── */
.output-box {
    position: relative;
    margin-top: 16px;
}

.output-box textarea {
    padding-right: 80px;
}

.output-box .copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* ── Two-column layout for text tools ── */
.text-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.text-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.text-column label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Swap Button ── */
.swap-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
    align-self: center;
}

.swap-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--border-accent);
    transform: rotate(180deg);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .search-wrap {
        max-width: 100%;
        order: 3;
        flex-basis: 100%;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero {
        padding: 40px 0 24px;
    }

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

    .tool-page {
        padding: 24px 16px 40px;
    }

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

    .categories {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .categories::-webkit-scrollbar {
        display: none;
    }

    .btn-group {
        flex-direction: column;
    }

    .option-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .upload-zone {
        padding: 32px 16px;
    }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ── Selection ── */
::selection {
    background: var(--accent);
    color: white;
}
