*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --text: #111827; --text-muted: #64748b; --border: #0f172a;
  --bg: #F9FAFB; --white: #FFFFFF; --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.07); --shadow-md: 0 4px 16px rgba(0,0,0,.08);
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* HEADER */
.site-header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1300px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 800; background: linear-gradient(135deg,#F97316,#EC4899,#2563eb); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.header-badges { display: flex; gap: 6px; }
.badge { background: #F3F4F6; color: #374151; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }

/* MAIN */
.app-main { max-width: 1300px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 24px; }

/* CONTROLS BAR */
.controls-bar { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ctrl-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 6px; display: block; }

.seed-control { display: flex; flex-direction: column; }
.color-input-wrap { display: flex; align-items: center; gap: 8px; }
.color-picker { width: 44px; height: 38px; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; padding: 2px; background: none; }
.hex-input { width: 90px; padding: 9px 10px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; font-family: monospace; font-weight: 700; outline: none; text-transform: uppercase; }
.hex-input:focus { border-color: #2563eb; }

.harmony-control { flex: 1; display: flex; flex-direction: column; }
.harmony-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.htab { padding: 7px 14px; border: 1.5px solid var(--border); border-radius: 20px; background: var(--white); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; color: var(--text-muted); transition: all .12s; white-space: nowrap; }
.htab.active { border-color: #2563eb; background: #EEF2FF; color: #2563eb; }
.htab:hover:not(.active) { border-color: #5b6878; color: var(--text); }

.action-controls { display: flex; flex-direction: column; gap: 6px; }
.btn-random, .btn-export { padding: 9px 16px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .12s; }
.btn-random { background: var(--white); color: var(--text-muted); }
.btn-random:hover { border-color: #2563eb; color: #2563eb; }
.btn-export { background: #2563eb; color: white; border-color: transparent; }
.btn-export:hover { background: #2563eb; }

/* PALETTE */
.palette-display { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); min-height: 200px; }
.swatch { display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; cursor: pointer; transition: transform .15s; min-height: 200px; position: relative; }
.swatch:hover { transform: scaleY(1.03); z-index: 1; }
.swatch-info { }
.swatch-hex { font-size: 15px; font-weight: 800; font-family: monospace; letter-spacing: .03em; }
.swatch-rgb { font-size: 11px; opacity: .75; margin-top: 2px; font-family: monospace; }
.swatch-hsl { font-size: 11px; opacity: .6; font-family: monospace; }
.swatch-name { font-size: 12px; opacity: .8; margin-top: 4px; font-weight: 600; }
.swatch-copy { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.15); border: none; border-radius: 5px; padding: 4px 8px; font-size: 11px; color: inherit; cursor: pointer; opacity: 0; transition: opacity .12s; font-family: inherit; font-weight: 600; }
.swatch:hover .swatch-copy { opacity: 1; }
.swatch-copy:hover { background: rgba(0,0,0,.3); }
.swatch-base-badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.2); border-radius: 4px; padding: 2px 7px; font-size: 10px; font-weight: 700; letter-spacing: .05em; }

/* TINTS */
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 12px; }
.tints-grid { display: grid; gap: 12px; }
.tint-row { display: flex; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.tint-cell { flex: 1; min-height: 60px; display: flex; flex-direction: column; justify-content: flex-end; padding: 6px 8px; cursor: pointer; transition: flex .15s; }
.tint-cell:hover { flex: 1.4; }
.tint-hex { font-size: 11px; font-family: monospace; font-weight: 700; }
.tint-label { font-size: 10px; opacity: .7; }

/* EXPORT */
.export-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.export-tabs { display: flex; border-bottom: 1px solid var(--border); }
.etab { flex: 1; padding: 10px; border: none; background: var(--bg); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; color: var(--text-muted); border-right: 1px solid var(--border); transition: background .12s; }
.etab:last-child { border-right: none; }
.etab.active { background: var(--white); color: #2563eb; }
.export-output-wrap { position: relative; }
.export-output { padding: 16px; font-family: 'Courier New', monospace; font-size: 12px; line-height: 1.6; color: var(--text); white-space: pre; overflow-x: auto; max-height: 280px; overflow-y: auto; }
.btn-copy-export { position: absolute; top: 10px; right: 10px; background: #2563eb; color: white; border: none; border-radius: 6px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-copy-export.copied { background: #059669; }

/* CONTRAST */
.contrast-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.contrast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.contrast-card { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.contrast-preview { padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.contrast-preview-text { font-size: 16px; font-weight: 700; }
.contrast-preview-small { font-size: 12px; }
.contrast-info { padding: 8px 12px; background: var(--bg); border-top: 1px solid var(--border); }
.contrast-ratio { font-size: 18px; font-weight: 800; }
.contrast-badges { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
.wcag-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.wcag-pass { background: #D1FAE5; color: #065F46; }
.wcag-fail { background: #FEE2E2; color: #991B1B; }

/* GUIDE */
.guide-section { border-top: 1px solid var(--border); padding: 32px 0; }
.guide-inner h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.guide-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 800px) { .guide-grid { grid-template-columns: 1fr 1fr; } }
.guide-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.guide-swatch { height: 60px; }
.guide-card h3 { font-size: 13px; font-weight: 700; padding: 12px 14px 4px; }
.guide-card p { font-size: 12px; color: var(--text-muted); padding: 0 14px 14px; line-height: 1.5; }

/* FOOTER */
.site-footer { border-top: 1px solid var(--border); text-align: center; padding: 20px; color: var(--text-muted); font-size: 13px; line-height: 1.8; background: var(--white); }
.footer-small { font-size: 11px; color: #5b6878; }
