:root {
    --bg-primary: #0f0f12;
    --bg-secondary: #1a1a24;
    --bg-tertiary: #252532;
    --text-primary: #e8e6e3;
    --text-secondary: #a09d96;
    --accent: #c9a227;
    --accent-hover: #dbb84d;
    --border: #3a3a4a;
    --success: #4ade80;
    --error: #f87171;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo svg {
    width: 32px;
    height: 32px;
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--accent);
}

.hero {
    padding: 4rem 0 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent) 0%, #e8d5a3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.generator {
    padding: 2rem 0;
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-group select {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.control-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-primary {
    padding: 0.875rem 2rem;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    padding: 0.625rem 1.25rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.result {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.result-placeholder {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.result-placeholder svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-layer {
    padding: 1.25rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}

.result-layer .label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.result-layer p {
    font-size: 1.125rem;
    line-height: 1.7;
}

.result-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.result-meta span {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.result-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.history {
    padding: 3rem 0;
}

.history h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    position: relative;
}

.history-item .surface {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.history-item .hidden {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.history-item .hook {
    color: var(--accent);
    font-size: 0.9375rem;
    font-style: italic;
}

.history-item .delete-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.25rem;
    transition: color 0.2s;
}

.history-item .delete-btn:hover {
    color: var(--error);
}

.empty-state {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

.guide {
    padding: 3rem 0;
    background: var(--bg-secondary);
}

.guide h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--accent);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.guide-card {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.guide-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.guide-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.tips {
    margin-bottom: 3rem;
}

.tips h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.tips ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tips li {
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.tips li strong {
    color: var(--accent);
}

.examples h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.example-card {
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.example-layer {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.example-layer:last-child {
    border-bottom: none;
}

.example-layer .label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.example-layer p {
    color: var(--text-secondary);
}

.faq {
    padding: 3rem 0;
}

.faq h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--accent);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-list details {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.faq-list summary {
    padding: 1.25rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--accent);
    transition: transform 0.2s;
}

.faq-list details[open] summary::after {
    content: '−';
}

.faq-list details p {
    padding: 0 1.25rem 1.25rem;
    color: var(--text-secondary);
}

.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
}

.site-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.site-footer a {
    color: var(--accent);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.875rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .controls {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

@media print {
    .site-header,
    .site-footer,
    .controls,
    .result-actions,
    .history,
    .guide,
    .faq {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .result {
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .result-layer {
        border-left: 4px solid #333;
    }
    
    .result-layer .label {
        color: #333;
    }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
