:root {
    --bg: #f5f5f7; --bg2: #ffffff; --text: #1d1d1f; --text2: #6e6e73;
    --border: #d2d2d7; --primary: #6c5ce7; --primary-hover: #5a4bd1;
    --accent: #00b894; --shadow: rgba(0,0,0,0.08); --radius: 12px;
}
[data-theme="dark"] {
    --bg: #1a1a2e; --bg2: #16213e; --text: #eaeaea; --text2: #a0a0b0;
    --border: #2a2a4a; --primary: #a29bfe; --primary-hover: #6c5ce7;
    --accent: #55efc4; --shadow: rgba(0,0,0,0.3);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; transition: background .3s, color .3s; }
header { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 16px 24px; position: sticky; top: 0; z-index: 100; }
.header-content { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.header-content h1 { font-size: 1.6rem; font-weight: 700; }
.logo-icon { color: var(--primary); }
.tagline { color: var(--text2); font-size: .9rem; flex: 1; }
.header-actions { display: flex; gap: 8px; }
#theme-toggle { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 1.1rem; cursor: pointer; color: var(--text); }
.premium-badge { background: linear-gradient(135deg, #f39c12, #e74c3c); color: #fff; border: none; border-radius: 8px; padding: 6px 14px; font-weight: 700; font-size: .85rem; cursor: pointer; }
main { max-width: 1200px; margin: 0 auto; padding: 20px 24px; }
.controls-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px; background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 20px; }
.control-group { display: flex; align-items: center; gap: 6px; }
.control-group label { font-size: .85rem; color: var(--text2); font-weight: 500; }
.control-group select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: .9rem; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 10px 20px; font-size: .95rem; font-weight: 600; cursor: pointer; transition: background .2s, transform .1s; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(.97); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; font-size: .9rem; cursor: pointer; transition: background .2s; }
.btn-secondary:hover { background: var(--border); }
.shortcut-hint { font-size: .75rem; opacity: .7; }
.base-color-wrap { display: flex; align-items: center; gap: 6px; }
.base-color-wrap input[type="color"] { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; padding: 1px; }
.hex-input { width: 80px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-family: monospace; font-size: .85rem; background: var(--bg); color: var(--text); }
.hex-input:focus { outline: none; border-color: var(--primary); }
.checkbox-inline { display: inline-flex !important; align-items: center; gap: 4px; font-size: .82rem; cursor: pointer; white-space: nowrap; }
.checkbox-inline input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.gradient-preview { height: 40px; border-radius: 8px; margin-bottom: 16px; overflow: hidden; box-shadow: 0 2px 8px var(--shadow); }
.palette-container { display: flex; min-height: 320px; border-radius: var(--radius); overflow: hidden; box-shadow: 0 8px 32px var(--shadow); margin-bottom: 20px; transition: all .3s; }
.color-swatch { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 20px 8px; cursor: pointer; position: relative; transition: flex .3s; min-width: 60px; }
.color-swatch:hover { flex: 1.3; }
.color-swatch .color-info { background: rgba(0,0,0,.45); backdrop-filter: blur(8px); border-radius: 8px; padding: 8px 12px; text-align: center; color: #fff; width: 100%; max-width: 160px; }
.color-info .hex { font-size: 1rem; font-weight: 700; font-family: 'Courier New', monospace; letter-spacing: .5px; }
.color-info .rgb, .color-info .hsl { font-size: .7rem; opacity: .85; margin-top: 2px; }
.swatch-actions { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; opacity: 0; transition: opacity .2s; }
.color-swatch:hover .swatch-actions { opacity: 1; }
.swatch-btn { width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,.25); backdrop-filter: blur(4px); color: #fff; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.swatch-btn:hover { background: rgba(255,255,255,.45); }
.swatch-btn.locked { background: rgba(255,255,255,.6); color: #333; }
.color-picker-input { position: absolute; top: 12px; left: 12px; width: 36px; height: 36px; border: 2px solid rgba(255,255,255,.4); border-radius: 50%; cursor: pointer; opacity: 0; }
.color-swatch:hover .color-picker-input { opacity: 1; }
.action-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
.btn-icon { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 16px; font-size: .9rem; cursor: pointer; color: var(--text); transition: all .2s; }
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }
.usage-counter { margin-left: auto; font-size: .85rem; color: var(--text2); }
/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px); }
.modal[hidden] { display: none; }
.modal-content { background: var(--bg2); border-radius: var(--radius); padding: 24px; max-width: 600px; width: 90%; max-height: 85vh; overflow-y: auto; box-shadow: 0 16px 48px rgba(0,0,0,.2); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text2); padding: 4px 8px; }
.export-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 8px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text2); cursor: pointer; font-size: .85rem; transition: all .2s; }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.export-output { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 16px; max-height: 300px; overflow: auto; }
#export-code { font-family: 'Courier New', monospace; font-size: .85rem; white-space: pre-wrap; word-break: break-all; }
.modal-actions { display: flex; gap: 8px; }
/* Saved palettes */
.saved-section, .contrast-section, .seo-content { margin-bottom: 40px; }
.saved-section h2, .contrast-section h2, .seo-content h2 { font-size: 1.2rem; margin-bottom: 16px; }
.section-desc { color: var(--text2); font-size: .85rem; margin-bottom: 12px; }
.saved-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.saved-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.saved-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--shadow); }
.saved-card-colors { display: flex; height: 60px; }
.saved-card-colors div { flex: 1; }
.saved-card-info { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; }
.saved-card-info span { font-size: .8rem; color: var(--text2); }
.saved-card-delete { background: none; border: none; color: var(--text2); cursor: pointer; font-size: 1rem; padding: 2px 6px; }
.saved-card-delete:hover { color: #e74c3c; }
.empty-message { color: var(--text2); font-size: .9rem; grid-column: 1 / -1; text-align: center; padding: 24px; }
/* Contrast checker */
.contrast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.contrast-card { border-radius: 8px; padding: 16px; text-align: center; border: 1px solid var(--border); }
.contrast-ratio { font-size: 1.4rem; font-weight: 700; margin: 8px 0; }
.contrast-label { font-size: .75rem; padding: 3px 8px; border-radius: 4px; font-weight: 600; display: inline-block; }
.contrast-label.pass-aaa { background: #00b894; color: #fff; }
.contrast-label.pass-aa { background: #fdcb6e; color: #333; }
.contrast-label.fail { background: #e17055; color: #fff; }
.contrast-colors { font-size: .75rem; color: var(--text2); margin-top: 6px; }
/* SEO */
.seo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.seo-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.seo-card h3 { font-size: 1rem; margin-bottom: 8px; }
.seo-card p { font-size: .85rem; color: var(--text2); line-height: 1.6; }
/* Premium */
.premium-features ul { list-style: none; margin-bottom: 24px; }
.premium-features li { padding: 8px 0; font-size: .95rem; border-bottom: 1px solid var(--border); }
.premium-pricing { display: flex; gap: 16px; flex-wrap: wrap; }
.price-card { flex: 1; min-width: 200px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.price-card.recommended { border-color: var(--primary); position: relative; }
.recommended-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 2px 12px; border-radius: 10px; font-size: .75rem; font-weight: 600; }
.price { font-size: 2rem; font-weight: 700; margin: 12px 0; }
.price span { font-size: .9rem; font-weight: 400; color: var(--text2); }
.savings { font-size: .8rem; color: var(--accent); margin-bottom: 12px; }
/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 12px 24px; border-radius: 8px; font-size: .9rem; z-index: 2000; animation: toastIn .3s ease; }
.toast[hidden] { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
/* Ads */
.ad-banner { text-align: center; padding: 8px; }
.ad-placeholder { background: var(--bg2); border: 2px dashed var(--border); border-radius: 8px; padding: 20px; color: var(--text2); font-size: .8rem; }
.side-ad { position: fixed; right: 8px; top: 50%; transform: translateY(-50%); z-index: 50; }
footer { text-align: center; padding: 24px; color: var(--text2); font-size: .8rem; border-top: 1px solid var(--border); }
/* Why Section */
.why-section { max-width: 1200px; margin: 2.5rem auto; padding: 0 1rem; }
.why-section h2 { text-align: center; font-size: 1.5rem; margin-bottom: 1.5rem; color: var(--text); }
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.why-card { background: var(--bg2); padding: 1.5rem; border-radius: var(--radius); box-shadow: 0 2px 12px var(--shadow); border-left: 4px solid var(--primary); }
.why-card h3 { font-size: 1rem; color: var(--primary); margin-bottom: 0.5rem; }
.why-card p { font-size: .85rem; color: var(--text2); line-height: 1.7; }
/* Feedback Section */
.feedback-section { max-width: 600px; margin: 2rem auto; text-align: center; padding: 0 1rem; }
.feedback-section h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.feedback-section p { font-size: .9rem; color: var(--text2); margin-bottom: 1rem; }
.btn-feedback { display: inline-block; padding: 0.6rem 2rem; background: var(--bg2); color: var(--primary); border: 2px solid var(--primary); border-radius: 8px; text-decoration: none; font-weight: 600; font-size: .9rem; transition: all .2s; }
.btn-feedback:hover { background: var(--primary); color: #fff; }
/* Responsive */
@media (max-width: 768px) {
    .palette-container { flex-direction: column; min-height: auto; }
    .color-swatch { min-height: 100px; flex-direction: row; justify-content: center; padding: 12px; }
    .color-swatch:hover { flex: 1; }
    .swatch-actions { opacity: 1; top: 50%; right: 8px; transform: translateY(-50%); flex-direction: row; }
    .color-picker-input { opacity: 1; }
    .side-ad { display: none; }
    .controls-bar { gap: 8px; }
    .header-content { justify-content: center; text-align: center; }
    .tagline { flex: none; width: 100%; }
    .why-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .premium-pricing { flex-direction: column; }
    .controls-bar { padding: 10px; }
    .btn-primary, .btn-secondary { padding: 8px 12px; font-size: .85rem; }
}
.skip-to-content{position:absolute;top:-100%;left:0;background:var(--accent,#4a6cf7);color:#fff;padding:8px 16px;z-index:10000;font-size:.9rem;border-radius:0 0 4px 0;transition:top .2s}.skip-to-content:focus{top:0}
