/* SEO Text Drafting — extracted from the inline <style> block in new.html.haml,
   prompt_rules.css pattern. Scoped to .seo-drafting because the sibling
   seo_text_drafts tool reuses several seo-* class names with its own styles. */

/* The original page-local universal reset also reached <body> */
body:has(.seo-drafting) { margin: 0; padding: 0; }

.seo-drafting,
.seo-drafting *,
.seo-drafting *::before,
.seo-drafting *::after { box-sizing: border-box; margin: 0; padding: 0; }
.seo-drafting .seo-picker { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - 80px); background: #141414; font-family: system-ui, -apple-system, sans-serif; padding: 2.5rem 2rem; gap: 2.5rem; }
.seo-drafting .seo-picker-headline { text-align: center; }
.seo-drafting .seo-picker-headline h1 { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: #666; }
.seo-drafting .seo-picker-headline p { font-size: 1.5rem; font-weight: 700; color: #fff; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 0.4rem; }
.seo-drafting .seo-picker-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; width: 100%; max-width: 680px; }
.seo-drafting .brand-btn { display: flex; align-items: center; justify-content: center; padding: 2rem 1.75rem; min-height: 190px; border: 1.5px solid transparent; border-radius: 14px; cursor: pointer; font-family: inherit; transition: transform 0.12s, box-shadow 0.12s, border-color 0.15s; position: relative; overflow: hidden; }
.seo-drafting .brand-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,0.35); }
.seo-drafting .brand-btn--duotone { background: #000; border-color: #333; }
.seo-drafting .brand-btn--duotone:hover { border-color: #555; }
.seo-drafting .brand-btn--ion { background: #fff; border-color: #e8e8e8; }
.seo-drafting .brand-btn--ion:hover { border-color: #E20B14; }
.seo-drafting .brand-btn--lea { background: #080c1a; border-color: #1a2540; padding: 0; overflow: hidden; min-height: 190px; }
.seo-drafting .brand-btn--lea { cursor: default; }
.seo-drafting .brand-btn--lea img { width: 100%; height: 100%; object-fit: cover; object-position: center top; position: absolute; inset: 0; display: block; }
.seo-drafting .brand-btn--lea .brand-btn-meta { position: absolute; bottom: 0; left: 0; right: 0; padding: 0.75rem 1.25rem; background: linear-gradient(transparent, rgba(0,0,0,0.75)); margin-top: 0; }
.seo-drafting .brand-btn--lea .brand-btn-sub { color: #e0f2fe; }
.seo-drafting .brand-btn--sqlab { background: #fff; border-color: #e8e8e8; }
.seo-drafting .brand-btn--sqlab:hover { border-color: #F2A93C; }
.seo-drafting .brand-btn--auto { background: #1e1e1e; border: 2px dashed #444; color: #aaa; flex-direction: column; gap: 0.6rem; }
.seo-drafting .brand-btn--auto:hover { border-color: #888; color: #eee; }
.seo-drafting .brand-btn__icon { font-size: 2rem; line-height: 1; }
.seo-drafting .brand-btn__label { font-size: 0.9rem; font-weight: 600; letter-spacing: 0.04em; text-align: center; line-height: 1.35; }
.seo-drafting .seo-wizard { display: none; flex-direction: column; min-height: calc(100vh - 80px); background: #141414; font-family: system-ui, -apple-system, sans-serif; align-items: center; justify-content: center; padding: 2.5rem 2rem; }
.seo-drafting .seo-wizard.is-active { display: flex; }
.seo-drafting .seo-wizard__inner { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 1.5rem; }
.seo-drafting .seo-wizard__step { display: flex; flex-direction: column; gap: 14px; }
.seo-drafting .seo-wizard__question { font-size: 1.1rem; font-weight: 600; color: #fff; line-height: 1.4; }
.seo-drafting .seo-wizard__question em { font-style: normal; color: #f0c040; }
.seo-drafting .seo-wizard input[type="text"],
.seo-drafting .seo-wizard textarea { width: 100%; padding: 0.85rem 1rem; font-size: 1rem; border: 1.5px solid #333; border-radius: 10px; background: #1e1e1e; color: #fff; font-family: inherit; line-height: 1.6; outline: none; }
.seo-drafting .seo-wizard input[type="text"]:focus,
.seo-drafting .seo-wizard textarea:focus { border-color: #666; }
.seo-drafting .seo-wizard textarea { resize: vertical; }
.seo-drafting .seo-wizard__btn { align-self: flex-start; padding: 0.75rem 1.75rem; background: #fff; color: #1a1a1a; border: none; border-radius: 10px; font-size: 1rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.12s; }
.seo-drafting .seo-wizard__btn:hover:not(:disabled) { background: #e8e8e8; }
.seo-drafting .seo-wizard__btn:disabled { opacity: 0.35; cursor: default; }
.seo-drafting .seo-wizard__back { background: none; border: none; color: #666; cursor: pointer; font-size: 0.875rem; font-family: inherit; margin-top: 8px; align-self: flex-start; padding: 0; transition: color 0.12s; }
.seo-drafting .seo-wizard__back:hover { color: #aaa; }
.seo-drafting .seo-autocomplete-wrap { position: relative; }
.seo-drafting .seo-autocomplete__list { position: absolute; top: 100%; left: 0; right: 0; background: #2a2a2a; border: 1px solid #444; border-radius: 8px; z-index: 100; list-style: none; margin: 4px 0 0; padding: 4px 0; max-height: 240px; overflow-y: auto; }
.seo-drafting .seo-autocomplete__list li { padding: 8px 14px; cursor: pointer; font-size: 0.9rem; color: #ddd; line-height: 1.4; }
.seo-drafting .seo-autocomplete__list li:hover,
.seo-drafting .seo-autocomplete__list li.active { background: #3a3a3a; color: #fff; }
.seo-drafting .seo-predecessor-badge { border: 1.5px solid #444; border-radius: 10px; padding: 12px 14px; background: #1e1e1e; }
.seo-drafting .seo-predecessor-badge__header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seo-drafting .seo-predecessor-badge__header strong { color: #fff; font-size: 0.95rem; }
.seo-drafting .seo-predecessor-badge__caveat { font-size: 0.75rem; color: #888; margin: 8px 0 4px; }
.seo-drafting .seo-predecessor-badge details summary { font-size: 0.8rem; color: #888; cursor: pointer; margin-top: 8px; user-select: none; }
.seo-drafting .seo-predecessor-badge details p { font-size: 0.82rem; color: #aaa; margin-top: 6px; line-height: 1.55; max-height: 160px; overflow-y: auto; }
.seo-drafting .brand-label { font-size: 0.72rem; color: #aaa; background: #2e2e2e; border-radius: 4px; padding: 2px 7px; flex-shrink: 0; }
.seo-drafting .muted { font-size: 0.82rem; color: #666; }
.seo-drafting .clear-btn { margin-left: auto; background: none; border: none; color: #666; cursor: pointer; font-size: 0.9rem; padding: 0 4px; line-height: 1; }
.seo-drafting .clear-btn:hover { color: #aaa; }
.seo-drafting .seo-style-level { margin-top: 4px; }
.seo-drafting .seo-style-level__label { font-size: 0.875rem; color: #aaa; margin-bottom: 8px; }
.seo-drafting .seo-style-level__track { display: flex; border: 1.5px solid #444; border-radius: 10px; overflow: hidden; }
.seo-drafting .seo-style-level__btn { flex: 1; padding: 0.5rem 0.25rem; font-size: 0.72rem; background: #1e1e1e; color: #aaa; border: none; border-right: 1px solid #444; cursor: pointer; font-family: inherit; transition: background 0.12s, color 0.12s; text-align: center; line-height: 1.3; }
.seo-drafting .seo-style-level__btn:last-child { border-right: none; }
.seo-drafting .seo-style-level__btn:hover { background: #2a2a2a; color: #ddd; }
.seo-drafting .seo-style-level__btn--active { background: #fff; color: #1a1a1a; font-weight: 600; }
.seo-drafting .seo-style-level__description { font-size: 0.8rem; color: #666; margin-top: 8px; min-height: 2.4em; }
.seo-drafting .seo-error { color: #f87171; font-size: 0.875rem; }
.seo-drafting .seo-chat { display: none; flex-direction: column; height: calc(100vh - 80px); font-family: system-ui, -apple-system, sans-serif; background: #f7f7f7; }
.seo-drafting .seo-chat.is-active { display: flex; }
.seo-drafting .seo-header { padding: 0.85rem 1.5rem; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(0,0,0,0.1); }
.seo-drafting .seo-header[data-brand="duotone"] { background: #000; }
.seo-drafting .seo-header[data-brand="ion"] { background: #fff; }
.seo-drafting .seo-header[data-brand="sqlab"] { background: #fff; }
.seo-drafting .seo-header-logo { display: flex; align-items: center; gap: 0.75rem; }
.seo-drafting .seo-header-subtitle { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
.seo-drafting .seo-header[data-brand="duotone"] .seo-header-subtitle { color: #666; }
.seo-drafting .seo-header[data-brand="ion"]     .seo-header-subtitle { color: #888; }
.seo-drafting .seo-header[data-brand="sqlab"]   .seo-header-subtitle { color: #888; }
.seo-drafting .seo-messages { flex: 1; overflow-y: auto; padding: 1.5rem 1.5rem 1rem; display: flex; flex-direction: column; gap: 1rem; }
.seo-drafting .message-row { display: flex; align-items: flex-end; gap: 0.6rem; }
.seo-drafting .message-row--user { flex-direction: row-reverse; }
.seo-drafting .bubble { max-width: 78%; padding: 0.85rem 1.1rem; border-radius: 16px; line-height: 1.65; font-size: 1rem; }
.seo-drafting .bubble--claude { background: #fff; border: 1px solid #e5e5e5; border-bottom-left-radius: 4px; }
.seo-drafting .bubble--user { background: #1a1a1a; color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; font-size: 1rem; }
.seo-drafting .bubble--error { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.seo-drafting .debug-warn { font-size: 0.8rem; color: #92400e; padding: 2px 8px; opacity: 0.8; }
.seo-drafting .bubble-content h1,
.seo-drafting .bubble-content h2,
.seo-drafting .bubble-content h3 { margin: 0.8em 0 0.4em; font-weight: 600; line-height: 1.3; }
.seo-drafting .bubble-content h1 { font-size: 1.1rem; }
.seo-drafting .bubble-content h2 { font-size: 1rem; }
.seo-drafting .bubble-content h3 { font-size: 0.95rem; }
.seo-drafting .bubble-content p { margin: 0.5em 0; }
.seo-drafting .bubble-content ul,
.seo-drafting .bubble-content ol { margin: 0.5em 0 0.5em 1.4em; }
.seo-drafting .bubble-content li { margin: 0.2em 0; }
.seo-drafting .bubble-content strong { font-weight: 600; }
.seo-drafting .bubble-content em { font-style: italic; }
.seo-drafting .bubble-content code { background: #f0f0f0; padding: 0.1em 0.3em; border-radius: 3px; font-size: 0.9em; font-family: monospace; }
.seo-drafting .bubble-content pre { background: #f0f0f0; padding: 0.75rem; border-radius: 6px; overflow-x: auto; margin: 0.5em 0; }
.seo-drafting .bubble-content pre code { background: none; padding: 0; }
.seo-drafting .bubble-content blockquote { border-left: 3px solid #ccc; padding-left: 0.8em; color: #666; margin: 0.5em 0; }
.seo-drafting .copy-card { border: 1px solid #e0e0e0; border-radius: 10px; margin: 0.6rem 0; overflow: hidden; background: #fafafa; }
.seo-drafting .copy-card-header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.9rem; background: #f0f0f0; border-bottom: 1px solid #e0e0e0; gap: 1rem; }
.seo-drafting .copy-card-title { font-size: 0.78rem; font-weight: 700; color: #333; letter-spacing: 0.02em; }
.seo-drafting .copy-btn { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.22rem 0.65rem; font-size: 0.72rem; font-family: inherit; background: #fff; border: 1px solid #ccc; border-radius: 5px; cursor: pointer; color: #555; white-space: nowrap; flex-shrink: 0; transition: background 0.12s, color 0.12s, border-color 0.12s; }
.seo-drafting .copy-btn:hover { background: #e8e8e8; }
.seo-drafting .copy-btn.copied { color: #2a7a2a; border-color: #2a7a2a; background: #f0faf0; }
.seo-drafting .copy-card-body { padding: 0.85rem 0.9rem; font-size: 0.95rem; line-height: 1.7; color: #222; }
.seo-drafting .copy-card-body p { margin: 0.4em 0; }
.seo-drafting .copy-card-body ul,
.seo-drafting .copy-card-body ol { margin: 0.4em 0 0.4em 1.3em; }
.seo-drafting .copy-card-body li { margin: 0.15em 0; }
.seo-drafting .copy-card-body strong { font-weight: 600; }
.seo-drafting .seo-status { padding: 0.3rem 0 0; font-size: 0.76rem; color: #aaa; min-height: 1.4rem; }
.seo-drafting .seo-input-bar { flex-shrink: 0; background: #fff; border-radius: 12px; box-shadow: 0 -4px 16px rgba(0,0,0,.08); margin: 0 12px 12px; padding: 0.5rem 1.5rem 1rem; }
.seo-drafting .seo-input-bar form { display: flex; gap: 0.65rem; align-items: flex-end; }
.seo-drafting .seo-input-bar textarea { flex: 1; padding: 0.85rem 1rem; font-size: 1.05rem; border: 1.5px solid #d0d0d0; border-radius: 10px; resize: vertical; font-family: inherit; line-height: 1.6; outline: none; min-height: 80px; }
.seo-drafting .seo-input-bar textarea:focus { border-color: #1a1a1a; }
.seo-drafting .seo-input-bar input[type="submit"] { padding: 0.85rem 1.4rem; background: #1a1a1a; color: #fff; border: none; border-radius: 10px; font-size: 1rem; font-weight: 600; cursor: pointer; flex-shrink: 0; align-self: flex-end; letter-spacing: 0.02em; transition: background 0.12s; }
.seo-drafting .seo-input-bar input[type="submit"]:hover:not(:disabled) { background: #333; }
.seo-drafting .seo-input-bar input[type="submit"]:disabled { opacity: 0.35; cursor: default; }
.seo-drafting .debug-thinking { margin: 0.4rem 0; border-left: 3px solid #e6a817; background: #fffbea; border-radius: 4px; font-size: 0.82rem; }
.seo-drafting .debug-thinking summary { padding: 0.35rem 0.75rem; cursor: pointer; font-style: italic; color: #888; user-select: none; }
.seo-drafting .debug-thinking pre { margin: 0; padding: 0.5rem 0.75rem 0.6rem; white-space: pre-wrap; word-break: break-word; color: #555; border-top: 1px solid #f0e0a0; font-family: system-ui, sans-serif; font-size: 0.82rem; line-height: 1.5; }
.seo-drafting .debug-tool { margin: 0.4rem 0; padding: 0.35rem 0.75rem; background: #f0f4ff; border-left: 3px solid #4a6fa5; border-radius: 4px; font-size: 0.82rem; font-family: monospace; color: #444; }
.seo-drafting .bubble-spinner { display: flex; gap: 5px; align-items: center; padding: 0.2rem 0; }
.seo-drafting .bubble-spinner span { width: 7px; height: 7px; border-radius: 50%; background: #ccc; animation: bounce 1.2s infinite ease-in-out; }
.seo-drafting .bubble-spinner span:nth-child(2) { animation-delay: 0.2s; }
.seo-drafting .bubble-spinner span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce { 0%,80%,100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-5px); opacity: 1; } }

/* Keep the global .hidden utility winning over the scoped display rules above
   (originally the inline <style> loaded before application.css, so .hidden won
   by source order; scoping raised our specificity — restore the override). */
.seo-drafting .hidden { display: none; }
