/* ColorGadget - Light Theme, Mobile-First */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-card: #ffffff;
    --bg-elevated: #f1f5f9;
    --bg-hover: #e2e8f0;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: #eef2ff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --success: #22c55e;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-full: 50px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Header - Always visible */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
}
.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-icon svg { width: 20px; height: 20px; fill: white; }

/* Nav */
.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--bg-elevated); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: 0.2s;
    font-family: var(--font);
}
.dropdown-btn:hover { color: var(--text); background: var(--bg-elevated); }
.dropdown-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; transition: 0.2s; }
.dropdown:hover .dropdown-btn svg { transform: rotate(180deg); }
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: 0.2s;
    box-shadow: var(--shadow-lg);
}
.dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(4px); }
.dropdown-menu a {
    display: block;
    padding: 0.6rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: 0.15s;
}
.dropdown-menu a:hover { background: var(--bg-elevated); color: var(--text); }

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    padding: 0.5rem;
    cursor: pointer;
}
.menu-toggle svg { width: 24px; height: 24px; stroke: currentColor; fill: none; }

/* Hero Section */
.hero {
    padding: 7rem 1.5rem 4rem;
    text-align: center;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid var(--border);
}
.hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text);
}
.hero h1 span {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Color Input in Hero */
.hero-input-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.hero-secondary {
    margin-bottom: 1.5rem;
}
.btn-secondary-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font);
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: 0.2s;
}
.btn-secondary-action:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}
.btn-secondary-action svg {
    flex-shrink: 0;
}
.color-picker-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.35rem;
    box-shadow: var(--shadow);
    transition: 0.2s;
}
.color-picker-box:focus-within { border-color: var(--accent); }
.color-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}
.color-circle input {
    width: 70px;
    height: 70px;
    margin: -13px;
    cursor: pointer;
    border: none;
}
.hex-input {
    width: 100px;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
}
.hex-input:focus { outline: none; }

.btn-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.btn-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }
.btn-icon input[type="file"] { display: none; }

.btn-generate {
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    color: white;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5); }
.btn-generate:active { transform: translateY(0); }

.hero-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.hero-hint kbd {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.8rem;
}

/* Sticky Bar - Appears BELOW header on scroll */
.sticky-bar {
    position: fixed;
    top: 58px; /* Below header with gap */
    left: 0;
    right: 0;
    z-index: 99;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.sticky-bar.visible { 
    transform: translateY(0); 
    opacity: 1;
}
.sticky-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.sticky-bar .color-picker-box {
    padding: 0.25rem;
    box-shadow: none;
}
.sticky-bar .color-circle { width: 36px; height: 36px; }
.sticky-bar .color-circle input { width: 60px; height: 60px; margin: -12px; }
.sticky-bar .hex-input { width: 85px; font-size: 0.9rem; }
.sticky-bar .btn-icon { width: 36px; height: 36px; }
.sticky-bar .btn-icon svg { width: 18px; height: 18px; }
.sticky-bar .btn-generate { padding: 0.5rem 1.25rem; font-size: 0.9rem; }

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

/* Palettes Header */
.palettes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
    font-family: var(--font);
}
.tab:hover { border-color: var(--accent); color: var(--accent); }
.tab.active { background: var(--accent); border-color: var(--accent); color: white; }

/* Palette Blocks */
.palette-block { margin-bottom: 2rem; }
.palette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}
.palette-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.palette-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, #6366f1, #a855f7);
    border-radius: 2px;
}
.palette-actions { display: flex; gap: 0.5rem; }
.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: 0.2s;
    font-family: var(--font);
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }

/* Palette Row - Vertical Layout */
.palette-row {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.palette-color {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    min-height: 52px;
}
.palette-color:hover { 
    padding-left: 1.5rem;
    filter: brightness(1.05);
}
.color-code {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    transition: 0.15s;
}
.palette-color:hover .color-code { 
    background: rgba(255,255,255,0.35);
}
.copy-hint {
    font-size: 0.75rem;
    opacity: 0;
    transition: 0.15s;
    margin-left: auto;
    padding-left: 1rem;
}
.palette-color:hover .copy-hint { opacity: 0.7; }
.palette-row.collapsed .palette-color:nth-child(n+6) { display: none; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: 0.2s;
    padding: 1rem;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    border-radius: var(--radius-sm);
    transition: 0.15s;
}
.modal-close:hover { background: var(--bg-elevated); color: var(--text); }
.modal-body { padding: 1.25rem; }
.modal-section { margin-bottom: 1.25rem; }
.modal-section:last-child { margin-bottom: 0; }
.modal-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}
.export-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.export-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    transition: 0.15s;
    font-family: var(--font);
}
.export-btn:hover { border-color: var(--accent); background: var(--accent-light); }
.export-btn span { font-size: 0.85rem; font-weight: 600; }
.export-btn small { font-size: 0.7rem; color: var(--text-muted); }
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
}
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.checkbox-row label { font-size: 0.9rem; color: var(--text-secondary); cursor: pointer; }

/* Extracted color buttons */
.extracted-color {
    padding: 0.75rem 1rem;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: 0.15s;
    flex: 1;
    min-width: 100px;
}
.extracted-color:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0;
    transition: 0.3s;
    z-index: 300;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Tools Section */
.tools-section {
    background: var(--bg-alt);
    padding: 4rem 1rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
}
.tools-section h2 { text-align: center; font-size: 1.75rem; font-weight: 800; margin-bottom: 0.5rem; }
.tools-section > p { text-align: center; color: var(--text-secondary); margin-bottom: 2.5rem; }
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}
.tool-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    transition: 0.2s;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.tool-card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tool-card-icon svg { width: 24px; height: 24px; stroke: white; fill: none; }
.tool-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; color: var(--text); }
.tool-card p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* Footer */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 3rem 1rem 2rem;
}
.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}
.footer-section h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
    margin-bottom: 1rem;
}
.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.footer-nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: 0.2s;
}
.footer-nav a:hover {
    color: var(--accent);
}
.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.footer-bottom small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 150;
    padding: 1rem;
    transform: translateX(100%);
    transition: 0.3s;
}
.mobile-menu.active { transform: translateX(0); }
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.mobile-menu-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: none;
    border-radius: 50%;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}
.mobile-menu-links a {
    display: block;
    padding: 1rem;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .hero { padding: 6rem 1rem 3rem; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    
    .nav { display: none; }
    .menu-toggle { display: flex; }
    
    /* Header stays visible, sticky bar goes below it with gap */
    .header { padding: 0.6rem 1rem; }
    .sticky-bar { top: 54px; padding: 0.6rem 1rem; }
    .sticky-bar-inner { justify-content: center; }
    
    .palette-color { 
        padding: 0.85rem 1rem;
        min-height: 46px;
    }
    .color-code { font-size: 0.8rem; }
    .copy-hint { display: none; }
    
    .export-grid { grid-template-columns: 1fr; }
    
    .tools-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.75rem; }
    .hero-input-wrap { flex-direction: column; }
    .color-picker-box { width: 100%; max-width: 280px; }
    .btn-generate { width: 100%; max-width: 280px; }
    
    .tools-grid { grid-template-columns: 1fr; }
}

/* Page styles for sub-pages */
.page-header {
    padding: 6rem 1rem 2rem;
    text-align: center;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.page-header p { color: var(--text-secondary); }
.page-content { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; }
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.9rem; }
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    transition: 0.2s;
    background: var(--bg);
}
.form-input:focus { outline: none; border-color: var(--accent); }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: 0.2s;
    font-family: var(--font);
}
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-secondary {
    background: var(--bg-alt);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.prose { line-height: 1.8; }
.prose h2 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.prose p { color: var(--text-secondary); margin-bottom: 1rem; }

/* Color Action Menu */
.color-action-menu {
    position: fixed;
    z-index: 1000;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 0.75rem;
    display: none;
    min-width: 180px;
    animation: popIn 0.15s ease;
}
.color-action-menu.active { display: block; }
@keyframes popIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.color-action-preview {
    width: 100%;
    height: 50px;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}
.color-action-hex {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.75rem;
    color: var(--text);
}
.color-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.color-action-buttons button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font);
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text);
    transition: 0.15s;
}
.color-action-buttons button:hover {
    background: var(--bg-alt);
    color: var(--accent);
}
.color-action-buttons button svg {
    flex-shrink: 0;
}

/* Tool Page Layouts - Mobile First */
.tool-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.tool-grid {
    display: grid;
    gap: 1.5rem;
}
.tool-grid-2 { grid-template-columns: 1fr; }
.tool-grid-3 { grid-template-columns: 1fr; }
.tool-preview {
    aspect-ratio: 1;
    border-radius: var(--radius);
    min-height: 150px;
}
.tool-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.input-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.input-row .form-input {
    flex: 1;
    min-width: 60px;
}
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}
.btn-row .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

/* Container for tool pages */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Content sections */
.content-section {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
}
.content-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.content-section h3 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.5rem;
}
.content-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Ad containers */
.ad-container {
    background: var(--bg-alt);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 1.5rem 0;
}

/* Form inputs improvements */
.form-input-mono {
    font-family: 'SF Mono', Monaco, monospace;
}
.form-input-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

/* Tablet and up */
@media (min-width: 640px) {
    .tool-grid-2 { grid-template-columns: 200px 1fr; }
    .tool-panel { padding: 1.5rem; }
    .btn-row .btn { flex: 0 1 auto; }
}

/* Desktop */
@media (min-width: 900px) {
    .tool-grid-2 { grid-template-columns: 250px 1fr; }
    .tool-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}
