:root {
    --primary: #059669;
    --primary-hover: #047857;
    --primary-light: #ecfdf5;
    --secondary: #0284c7;
    --accent-amber: #d97706;
    --bg: #ffffff;
    --surface: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --card-border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    text-align: center;
}

#global-header {
    min-height: 61px;
    width: 100%;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 16px 40px;
    width: 100%;
    max-width: 100%;
}

.word-studio-wrap {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
}

/* Pill Badge & Title */
.badge-editorial {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.2);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

h1.word-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 8px;
}

h1.word-title span {
    color: var(--primary);
}

p.word-desc {
    font-size: 0.95rem;
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto 22px;
    line-height: 1.5;
}

/* Word Sets Quick Bar */
.word-presets-bar {
    width: 100%;
    margin-bottom: 20px;
    text-align: left;
}

.word-presets-title {
    font-size: 0.74rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
}

.word-pills-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

.word-chip {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.word-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Main Workspace Card */
.studio-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03);
    text-align: left;
    overflow: hidden;
    margin-bottom: 30px;
}

.studio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 480px;
}

@media (max-width: 860px) {
    .studio-grid {
        grid-template-columns: 1fr;
    }
}

.studio-col {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.studio-col-input {
    background: #fbfcfd;
    border-right: 1px solid var(--border);
}

@media (max-width: 860px) {
    .studio-col-input {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

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

.col-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input Controls */
input.word-single-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input.word-single-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

/* Casing Buttons */
.casing-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.case-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    margin-right: 2px;
}

.case-btn {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.case-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.case-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* Repetition Multipliers */
.multiplier-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.mult-pill {
    background: #ffffff;
    border: 1.5px solid var(--border);
    padding: 9px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #334155;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.mult-pill:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.mult-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

/* Delimiter Options */
.delimiters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.del-box {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.del-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
}

select.del-select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    background: #ffffff;
    outline: none;
}

.btn-multiply {
    width: 100%;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin-top: auto;
}

.btn-multiply:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.35);
}

/* Right Column: Output */
.studio-col-output {
    background: #ffffff;
}

textarea.word-output {
    width: 100%;
    flex: 1;
    min-height: 260px;
    padding: 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.88rem;
    font-family: inherit;
    resize: none;
    outline: none;
    color: var(--text);
    background: #f8fafc;
    line-height: 1.6;
}

.word-stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    padding: 4px 2px;
}

.word-actions-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 8px;
}

.btn-action {
    border: none;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-act-copy {
    background: #0f172a;
    color: #ffffff;
}

.btn-act-copy:hover {
    background: #000000;
}

.btn-act-csv {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid var(--border);
}

.btn-act-csv:hover {
    background: #e2e8f0;
}

/* SEO Article Sections */
.seo-content {
    text-align: left;
    max-width: 900px;
    margin: 0 auto;
    color: #334155;
    line-height: 1.7;
}

.seo-content h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    margin: 36px 0 14px;
    letter-spacing: -0.02em;
}

.seo-content p {
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-box {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
}

.feature-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.feature-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}

.feature-desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}

/* FAQ Accordion */
.faq-block {
    margin-top: 36px;
}

.faq-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-q {
    width: 100%;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
}

.faq-card.open .faq-q span.arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

.faq-a {
    display: none;
    padding: 0 20px 16px;
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.6;
}

.faq-card.open .faq-a {
    display: block;
}

#toast {
    visibility: hidden;
    min-width: 240px;
    background: #0f172a;
    color: #ffffff;
    text-align: center;
    border-radius: 999px;
    padding: 12px 24px;
    position: fixed;
    z-index: 10000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

#toast.show {
    visibility: visible;
    opacity: 1;
}

/* AdSense Unit Styling (Zero-CLS & Responsive) */
.in-content-ad-wrapper {
    text-align: center;
    margin: 24px auto;
    max-width: 728px;
    width: 100%;
    min-height: 90px;
    contain: layout;
}

.in-article-ad-wrapper {
    text-align: center;
    margin: 28px auto;
    max-width: 800px;
    width: 100%;
    min-height: 90px;
    contain: layout;
}

.ad-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted, #64748b);
    margin-bottom: 6px;
    text-align: center;
}
