:root {
    /* Brand palette */
    --brand-primary: #046BD2;
    --brand-primary-strong: #0058BB;
    --brand-navy: #1E293B;
    --brand-gradient-start: #046BD2;
    --brand-gradient-end: #6067CB;
    --brand-accent-purple: #8563c0;
    --brand-accent-yellow: #f9f871;
    --brand-accent-coral: #ff6d89;
    --brand-accent-sky: #6ba2ff;
    --brand-deep: #002e88;

    --gradient-primary: linear-gradient(135deg, var(--brand-gradient-start), var(--brand-gradient-end));
    --primary-soft-bg: #046BD212;
    --primary-soft-border: #046BD233;
    --primary-ghost: #046BD20f;
    --secondary-soft-bg: #8563c010;
    --secondary-soft-border: #8563c026;
    --coral-soft-bg: rgba(255, 109, 137, 0.14);
    --yellow-soft-bg: rgba(249, 248, 113, 0.7);

    --color: var(--brand-navy);
    --font-color: var(--brand-navy);

    --background: rgba(255, 255, 255, 0.37);
    --background-grey: #e9e9e9;

    --aiw-border: 1px solid #e7ebf5;
    --aiw-shadow-0: 0 2px 10px rgba(15, 23, 42, 0.05);
    --aiw-shadow-1: 0 10px 26px rgba(15, 23, 42, 0.08);

    --border: var(--aiw-border);
    --border-radius: 5px;

    --primaryColor: var(--brand-primary);
    --primaryColor-hover: var(--brand-primary-strong);

    --bg-primaryColor: var(--primary-soft-bg);
    --border-primaryColor: var(--primary-soft-border);

    --bg-secondaryColor: var(--secondary-soft-bg);
    --border-secondaryColor: var(--secondary-soft-border);

    --bg-shade-200: #f2eedf;
    --bg-shade-outline: #e0ddcf;

    --gap: 2rem;

    --universal-transition: all 0.4s ease-in-out;

    --box-shadow: var(--aiw-shadow-0);
    --box-shadow-hover: var(--aiw-shadow-1);

    --select-bg: #fff;
    --select-fg: var(--font-color, #1E293B);
    --select-bd: var(--border, 1px solid rgba(181,181,181,.30));
    --select-radius: var(--border-radius, 10px);


    --sb-left-expanded: clamp(230px, 15vw, 260px);
    --sb-left-collapsed: 72px;
    --sb-left:  var(--sb-left-expanded);
    --sb-right: clamp(210px, 15vw, 260px);

    --ast-global-color-0: var(--brand-primary);
    --ast-global-color-1: var(--brand-primary-strong);
    --ast-global-color-2: var(--brand-navy);
    --ast-global-color-3: #233353;
    --ast-global-color-7: #d1d5db;

}

body.aiw-sb-collapsed {
    --sb-left: var(--sb-left-collapsed);
}
@media (max-width: 900px) {
    body.aiw-sb-collapsed {
        --sb-left: var(--sb-left-expanded);
    }
}

label {
    font-weight: 600;
}

/* Flat controls (avoids stacked shadows when nested inside cards) */
.aiwriter-main-container .aiwriter-control,
.aiwriter-main-container select.aiseo-count-select,
.aiwriter-main-container select.aiwriter-control {
    background-color: var(--select-bg);
    color: var(--select-fg);
    border: var(--aiw-border);
    border-radius: var(--select-radius);
    padding: 6px 16px;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    min-height: 36px;
    height: 36px;
    width: 100%;
    box-shadow: none;
    transition: border-color 0.16s ease, outline-color 0.16s ease, background-color 0.16s ease;
}
.aiwriter-main-container select.aiseo-count-select,
.aiwriter-main-container select.aiwriter-control {
    /* Reset native UI */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 44px; /* room for the arrow on the right */
    cursor: pointer;
    /* Custom caret (SVG, inherits currentColor) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
}

.aiwriter-main-container .aiwriter-control:hover,
.aiwriter-main-container select.aiseo-count-select:hover,
.aiwriter-main-container select.aiwriter-control:hover {
    border-color: var(--primaryColor);
}
.aiwriter-main-container .aiwriter-control:focus,
.aiwriter-main-container select.aiseo-count-select:focus,
.aiwriter-main-container select.aiwriter-control:focus {
    border-color: var(--primaryColor);
    outline: 2px solid var(--primary-soft-border);
    outline-offset: 1px;
    box-shadow: none;
    background-color: #fff;
}
.aiwriter-main-container .aiwriter-control::placeholder {
    color: #9aa3b5;
    font-weight: 500;
}
.aiwriter-main-container input.aiwriter-control {
    min-height: 46px;
}
.aiwriter-main-container textarea.aiwriter-control,
.aiwriter-main-container .aiwriter-control[contenteditable="true"] {
    line-height: 1.5;
    min-height: 120px;
    resize: vertical;
}

/* TinyMCE toolbar select: keep flat and button-like */
.aiwriter-main-container .aiwriter-toolbar-group select {
    border: var(--aiw-border);
    background: #fff;
    box-shadow: none;
    padding: 6px 24px 6px 10px;
    border-radius: 6px;
    height: auto;
    line-height: 1.1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23343f5e' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}
.aiwriter-main-container .aiwriter-toolbar-group select:focus {
    outline: 2px solid var(--primary-soft-border);
    border-color: var(--primaryColor);
}
#ai-stream-test-btn,
#percentage-description {
    display: none;
}

/* Disabled state */
.aiwriter-main-container .aiwriter-control:disabled,
.aiwriter-main-container select.aiseo-count-select:disabled,
.aiwriter-main-container select.aiwriter-control:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* Firefox: trim internal right padding slightly */
@supports (-moz-appearance:none) {
    .aiwriter-main-container select.aiseo-count-select,
    .aiwriter-main-container select.aiwriter-control {
        padding-right: 38px;
    }
}

/* Old IE/Edge: hide native arrow */
.aiwriter-main-container select.aiseo-count-select::-ms-expand,
.aiwriter-main-container select.aiwriter-control::-ms-expand {
    display: none;
}



.site-navigation ul.menu li a {
    display: block;
    padding: 8px 15px;
    color: var(--brand-navy);
    /*font-family: "Heebo", Sans-serif;*/
}

.site-header .site-branding .site-logo img {
    max-width: 180px;
}

/*.site-content {*/
/*    background-color: #f1edff !important;*/
/*}*/

/* Liquid glass gradient background */
.aiwriter-bg {
    min-height: 100vh;
    width: 100vw; /* breakout from theme container */
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    overflow-x: clip;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 0;
    box-sizing: border-box;
}
/*.aiwriter-bg h1 {*/
/*    margin-bottom: 30px;*/
/*    text-align: center;*/
/*}*/

.aiwriter-bg.no-right-sidebar {
    --sb-right: 0px;
    justify-content: flex-start;
}

    /* Layout */
.aiwriter-main-container {
    display: flex;
    flex-direction: row;
    gap: 42px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 1380px;
}

.aiwriter-bg.no-right-sidebar .aiwriter-main-container {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
    padding-left: calc(var(--sb-left) + clamp(12px, 2vw, 30px));
    padding-right: clamp(18px, 3vw, 44px);
}

.aiwriter-center-col {
    flex: 1 1 500px;
    min-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: stretch;
}

.aiwriter-center-col,
.aiwriter-right-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.aiwriter-left-col {
    min-width: 230px;
}

.aiwriter-bg.no-right-sidebar .aiwriter-center-col {
    flex: 1 1 auto;
    min-width: 0;
    max-width: min(100%, 1680px);
}

.aiwriter-center-col {
    flex: 1 1 500px;
    min-width: 400px;
    align-items: stretch;
}

/* Card (liquid glass) styles */
.aiwriter-card {
    backdrop-filter: blur(10px);
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--aiw-shadow-0);
    border: var(--aiw-border);
    padding: 10px 20px;
    font-size: 1rem;
    color: var(--brand-navy);
    font-weight: 400;
    transition: background 0.2s;
}

.aiwriter-right-col {
    min-width: 220px;
    max-width: 300px;
    align-items: center;
    position: sticky;
    top: 80px;
    height: 80vh;
    padding: 10px;
    display: flex;
    justify-content: space-between;
}

.aiwriter-card:focus-within,
.aiwriter-card:focus {
    background: rgba(255, 255, 255, 0.36);
}

.aiwriter-group {
    border: var(--aiw-border);
    /*background-color: var(--bg-primaryColor);*/
    border-color: var(--border-primaryColor);
    border-radius: var(--border-radius);
    box-shadow: var(--aiw-shadow-0);
    padding: 10px 20px;
}


#aiwriter-keywords {
    margin: 30px 0 20px;
    border: 2px solid white;
}

/* Buttons */
.aiwriter-button {
    color: white;
    background: var(--ast-global-color-0);
    border: none;
    border-radius: var(--border-radius);
    padding: 14px 34px;
    cursor: pointer;
    margin-bottom: 10px;
    font-size: 1rem;
    transition: var(--universal-transition);
    box-shadow: var(--box-shadow);
}
.aiwriter-button.small-button{
    padding: 7px 17px;
    border-radius: 4px;
}

.aiseo-action-groups{
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
}
.aiseo-action-group{
    display: flex;
    gap: 8px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e7ebf5;
    border-radius: calc(var(--border-radius) + 2px);
    box-shadow: var(--box-shadow);
    flex: 1 1 260px;
}
.aiseo-action-group.primary{
    background: var(--bg-primaryColor);
    border-color: var(--border-primaryColor);
}
.aiseo-action-group.subtle{
    background: #f8f9ff;
}
.aiseo-action-group .aiwriter-button{
    margin-bottom: 0;
    flex: 1 1 0;
}
.aiseo-action-group .aiwriter-button.small-button{
    padding: 10px 16px;
    min-width: 140px;
}
@media (max-width: 720px){
    .aiseo-action-group{
        flex-basis: 100%;
    }
}

.aiwriter2 .aiwriter-grid.two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 18px;
}

.aiwriter2 .aiwriter-group {
    background: #ffffff;
    border: var(--aiw-border);
    box-shadow: none;
    border-radius: var(--border-radius);
    padding: 18px 20px;
}

/* SEO Writer 2: soften lines/shadows */
.aiseo-writer2-flat .aiwriter-group {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 6px 0;
}

.aiseo-writer2-flat .aiwriter-card {
    border-color: #eef2f7;
    box-shadow: none;
}

.aiseo-writer2-flat .aiwriter-card:not(input):not(textarea):not(select) {
    background: #fff;
}

.aiseo-writer2-flat .aiwriter-tools-btns button {
    background: #f6f8fc;
    border-color: #e6ebf5;
    box-shadow: none;
}

.aiseo-writer2-flat .aiwriter-tools-btns button.active {
    box-shadow: none;
}

.aiseo-writer2-flat .aiwriter-button.small-button {
    box-shadow: none;
}

.aiseo-writer2-flat .aiseo-speed-card {
    box-shadow: none;
    border-color: #e6ebf5;
}

.aiwriter2 .group-title {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 12px;
}

.aiwriter2 .group-title h3 {
    margin: 2px 0 0;
    font-size: 1.35rem;
}

.aiwriter2 .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: #5b6a90;
    margin: 0 0 4px;
    font-weight: 700;
}

.aiwriter2 .pill-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.aiwriter2 .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--border-radius);
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-primaryColor);
    border: 1px solid var(--border-primaryColor);
    color: var(--primaryColor);
}

.aiwriter2 .pill.soft {
    background: var(--primary-ghost);
    border-color: #e5e7eb;
    color: var(--brand-navy);
}

.aiwriter2 .aiwriter-card {
    border: var(--aiw-border);
    /* box-shadow: var(--aiw-shadow-0); */
    border-radius: var(--border-radius);
    background: #fff;
}

.aiwriter2 input.aiwriter-card,
.aiwriter2 textarea.aiwriter-card {
    width: 100%;
    padding: 14px 16px;
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--brand-navy);
    min-height: 48px;
    background: #fff;
    border: var(--aiw-border);
    border-radius: var(--border-radius);
    box-shadow: none;
    transition: border-color 0.16s ease, outline-color 0.16s ease;
}

.aiwriter2 textarea.aiwriter-card {
    min-height: 80px;
    resize: vertical;
}

.aiwriter2 input.aiwriter-card::placeholder,
.aiwriter2 textarea.aiwriter-card::placeholder {
    color: #9aa3b5;
    font-weight: 500;
}

.aiwriter2 input.aiwriter-card:focus,
.aiwriter2 textarea.aiwriter-card:focus {
    outline: 2px solid var(--primary-soft-border);
    border-color: var(--primaryColor);
    box-shadow: none;
}

.aiwriter2 .aiwriter-tools-label {
    display: block;
    font-size: 0.92rem;
    color: #4b5563;
    margin: 8px 0 6px;
}

.aiwriter2 .row {
    display: flex;
    align-items: center;
    width: 100%;
}

.aiwriter2 .row.between {
    justify-content: space-between;
}

.aiwriter2 .row.wrap {
    flex-wrap: wrap;
}

.aiwriter2 .stacked {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aiwriter2 .aiwriter-button.small-button {
    padding: 8px 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: var(--box-shadow);
}

.aiwriter2 .aiwriter-button.ghost {
    background: #1E293B0a;
    color: var(--brand-navy);
    box-shadow: none;
    border: 1px solid #e5e7eb;
}

.aiwriter2 .aiwriter-button.ghost:hover {
    background: #1E293B14;
    color: var(--brand-navy);
}

.aiwriter2 .aiwriter-tools-btns {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}

.aiwriter2 .aiwriter-tools-btns button {
    border: 1px solid #e7ebf5;
    background: #f8f9ff;
    color: var(--brand-navy);
    padding: 8px 14px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all .18s ease;
}

.aiwriter2 .aiwriter-tools-btns button.active {
    background: var(--primaryColor);
    color: #fff;
    border-color: var(--primaryColor);
    box-shadow: var(--box-shadow-hover);
}

.aiwriter2 .aiwriter-tools-btns button:hover {
    transform: translateY(-1px);
}

.aiwriter2 .aiwriter-card.compact {
    padding: 10px 12px;
    min-width: 220px;
}

.aiwriter2 .aiwriter-card.compact input,
.aiwriter2 .aiwriter-card.compact textarea {
    border: none;
    box-shadow: none;
    padding: 8px 0;
}

.aiwriter2 .aiwriter-card.compact input:focus,
.aiwriter2 .aiwriter-card.compact textarea:focus {
    outline: none;
    box-shadow: none;
}

.aiwriter2 .aiwriter-card.compact label {
    margin: 0 0 4px;
}

/* .aiwriter2 .aiseo-range {
    padding: 10px 6px 4px;
    border-radius: 12px;
    background: linear-gradient(180deg, #f7f8fb 0%, #ffffff 100%);
    border: 1px solid #e6e9f0; 
}*/
.aiwriter2 .aiseo-range input[type="range"] {
    width: 100%;
    accent-color: var(--primaryColor);
    height: 12px;
}
.aiwriter2 .aiseo-range-row {
    margin-top: 6px;
    font-weight: 700;
    color: var(--brand-navy);
}
.aiwriter2 #aiseo-text-size-out {
    background: #eef2ff;
    border: 1px solid #d8defa;
    border-radius: var(--border-radius);
    padding: 6px 10px;
    color: var(--primaryColor);
    font-weight: 800;
}
.aiwriter2 .aiseo-range-min,
.aiwriter2 .aiseo-range-max {
    color: #6b7280;
    font-weight: 600;
}

/* Generate block: button row + stacked SEO fields */
.aiwriter2 .aiseo-generate-row .generate-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
.aiwriter2 .aiseo-generate-row .generate-actions {
    display: flex;
    align-items: flex-start;
}
.aiwriter2 .aiseo-generate-row .generate-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}
@media (max-width: 900px) {
    .aiwriter2 .aiseo-generate-row .generate-actions button {
        width: 100%;
    }
}

/* Range readability */
.aiwriter2 .aiseo-range {
    display: grid;
    gap: 6px;
}
.aiwriter2 .aiseo-range-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: #4b5563;
}
.aiwriter2 #aiseo-text-size-out {
    background: var(--primary-ghost);
    border: 1px solid #d5def7;
    padding: 6px 10px;
    border-radius: var(--border-radius);
    color: var(--primaryColor);
    font-weight: 700;
}

/* Button groups uniform sizing */
.aiwriter2 .aiwriter-tools-btns {
    width: 100%;
}
.aiwriter2 .aiwriter-tools-btns button {
    flex: 1;
    min-width: 110px;
    justify-content: center;
}
.aiwriter2 .aiwriter-tools-btns[data-group="aiseo-multi"] button {
    flex: 1 1 120px;
}

/* Lists / FAQ / Sources grid */
.aiwriter2 .lists-grid {
    display: flex;
    /* grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); */
    gap: 8px;
}
.aiwriter2 .lists-grid select {
    width: 100%;
}

/* Group padding and spacing */
.aiwriter2 .aiwriter-group {
    padding: 18px 20px;
}
/* .aiwriter2 .aiwriter-group + .aiwriter-group {
    margin-top: 6px;
} */

.aiwriter-button:hover {
color: white;
background: var(--ast-global-color-1);

box-shadow: var(--box-shadow-hover);
}

/* Textarea styling */
.aiwriter-center-col textarea,
.aiwriter-center-col input[type="text"] {
    width: 100%;
    min-height: 60px;
    max-height: 320px;
    resize: vertical;
    font-size: 1.11rem;
    font-family: inherit;
    padding: 20px;
    border: var(--aiw-border);
    outline: none;
    background: #ffffffc4;
    /* box-shadow: var(--box-shadow); */
    margin-bottom: 5px;
    color: var(--brand-navy);
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--universal-transition);

}

/* Optional: Placeholder style */
.aiwriter-center-col ::placeholder {
    color: #b0b4bb;
    font-size: 1.03em;
    font-style: italic;
    opacity: 1;
    transition: color 0.2s;
}

/* Add a slight hover effect */
.aiwriter-center-col textarea:hover {
    box-shadow: var(--box-shadow-hover);
    background: white;
}

/* For copying icon (optional, if you want a "copy" button over result textarea) */
.aicopy-btn {
    position: absolute;
    right: 20px;
    top: 18px;
    background: rgba(255, 255, 255, 0.78);
    border: none;
    border-radius: var(--border-radius);
    padding: 6px 8px;
    font-size: 1.1rem;
    color: #ff6d89;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    transition: background 0.18s;
}

.aicopy-btn:hover {
    background: var(--yellow-soft-bg);
}

/* Website selector */
.aiwriter-site-btn {
    width: 100%;
    margin-bottom: 8px;
    border: 2px solid transparent;
    transition: border 0.2s, background 0.2s;
}

.aiwriter-site-selected,
.aiwriter-site-btn:active {
    border: 2px solid var(--primaryColor-hover);
    background: var(--gradient-primary);
    color: #fff;
}

.aiwriter-sites-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: -webkit-fill-available;
}

.aiwriter-site-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: var(--background-grey);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 12px 16px;
    font-size: 1.05rem;
    transition: box-shadow 0.18s cubic-bezier(0.19, 1, 0.22, 1), background 0.3s;
    cursor: pointer;
    user-select: none;
    gap: 10px;
}

.aiwriter-site-row.selected,
.aiwriter-site-row:hover {
    background: var(--bg-primaryColor);
    color: var(--brand-navy);
    box-shadow: var(--box-shadow-hover);
}

.ai-site-select-btn {
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 18px;
    cursor: pointer;
    font-size: 1.02rem;
    box-shadow: var(--box-shadow);
    transition: background 0.13s, transform 0.13s;
}

.ai-site-select-btn:hover {
    background: linear-gradient(99deg, var(--brand-gradient-end) 0%, var(--brand-primary) 100%);
    transform: scale(1.04);
}

/* Animated step cards */
.aicard-step {
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1),
    box-shadow 0.3s cubic-bezier(0.19, 1, 0.22, 1), background 0.2s;
    /* cursor: pointer; */
}

.aicard-step:hover,
.aicard-step:focus {
    transform: scale(1.01) translateY(-2px);
    box-shadow: var(--box-shadow-hover);
    background: rgba(255, 255, 255, 0.38);
}

/* Intro block - larger & softer */
.aicard-intro {
    font-size: 1.12rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.37);
    box-shadow: var(--box-shadow);
}

.aicard-steps-group {
    display: flex;
    gap: 14px;
    margin-bottom: 12px;
}

/* Modal background */
.aiwriter-modal-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: rgba(30, 41, 59, 0.24);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

/* Modal window */
.aiwriter-modal-window {
    min-width: 320px;
    min-height: 125px;
    max-width: 96vw;
    max-height: 90vh;
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-hover);
    padding: 34px 28px 24px 28px;
    position: relative;
    animation: aiwriter-modal-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;

    justify-content: center;
    align-items: center;
}

@keyframes aiwriter-modal-in {
    from {
        transform: translateY(40px) scale(0.95);
        opacity: 0.2;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Close button */
.aiwriter-modal-close {
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 2.4rem;
    line-height: 1;
    background: whitesmoke;
    border: none;
    color: #b6b7c4;
    cursor: pointer;
    padding: 0px 10px 0px 10px;
    transition: color 0.15s;
}

.aiwriter-modal-close:hover {
    color: #ff6d89;
}

/* Content */
.aiwriter-modal-content {
    font-size: 1.09rem;
    color: var(--brand-navy);
    max-width: 520px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
    min-height: 40px;
    text-align: left;
}

ul.aiwriter-faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    list-style: none;
    width: 100%;
    margin: 0;
}

/* svg */
circle-expand {
    --svg-length: 1.5rem;

    display: flex;

    svg {
        width: var(--svg-length);
        height: var(--svg-length);

        circle {
            stroke-dasharray: var(--circle-length);
            stroke-dashoffset: 0;
            transition: var(--universal-transition);
        }

        path:nth-of-type(2) {
            stroke-dasharray: var(--top-length);
            stroke-dashoffset: 0;
            transition: var(--universal-transition);
        }

        path:nth-of-type(3) {
            stroke-dasharray: var(--bottom-length);
            stroke-dashoffset: 0;
            transition: var(--universal-transition);
        }
    }
}

summary[expanded] {
    circle-expand {
        svg {
            circle {
                stroke-dashoffset: var(--circle-length);
            }

            path:nth-of-type(2) {
                stroke-dashoffset: var(--top-length);
            }

            path:nth-of-type(3) {
                stroke-dashoffset: var(--bottom-length);
            }
        }
    }
}

details {
    position: relative;
    border: var(--border);
    box-shadow: var(--box-shadow);
    padding: 10px 20px;
    margin-bottom: 15px;
    border-radius: var(--border-radius);
    transition: var(--universal-transition);

    details-content {
        display: block;
        overflow: hidden;
        height: 0;
        transition: var(--universal-transition);
    }

    &:has(summary[expanded]) {
        /*background-color: var(--bg-primaryColor);*/
        border-color: var(--border-primaryColor);

        p {
            opacity: 1;
        }
    }

    p.aiwriter-faq-note {
        opacity: 0;
        line-height: 1.5;
        transition: var(--universal-transition);
    }
}

summary {
    color: var(--color);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
    list-style: none;
    cursor: pointer;
    transition: var(--universal-transition);
    padding: 20px 20px 20px 0;
    font-size: larger;

    /* avoid Windows insertion caret */
    caret-color: transparent;
}

summary::-webkit-details-marker {
    display: none;
}

summary::marker {
    content: "";
}

.aiwriter-tools-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    margin-bottom: 25px;
}

.aiwriter-tools-label {
    margin: 0 0 1px 0;
    font-size: 0.8rem;
    z-index: 1;
    position: relative;
}

.aiwriter-tools-btns {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
}

.aiwriter-tools-btns button {
    min-width: 110px;
    flex: 1 1 0;
    background: var(--background);
    border: 1px solid var(--border-primaryColor);
    color: var(--font-color);
    font-weight: 600;
    border-radius: var(--border-radius);
    padding: 12px 0;
    font-size: 1.04em;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    transition: var(--universal-transition);
    outline: none;
    letter-spacing: 0.01em;
    position: relative;
}

.aiwriter-tools-btns button:hover {
    background: var(--ast-global-color-1);
    border-color: var(--ast-global-color-0);
    color: white;
    box-shadow: var(--box-shadow-hover);
}

/*[type=button]:focus, [type=button]:hover, [type=submit]:focus, [type=submit]:hover, button:focus, button:hover{*/
/*    background: var(--background);*/
/*    border-color: var(--border-primaryColor);*/
/*    color: var(--font-color);*/
/*    box-shadow: var(--box-shadow-hover);*/
/*}*/



.aiwriter-tools-btns button.active,
.aiwriter-tools-btns button.selected,
.aiwriter-tools-btns button:active {
    background: var(--ast-global-color-0);
    border-color: var(--ast-global-color-0);
    color: #fff;
    box-shadow: var(--box-shadow-hover);
    z-index: 1;
}

.site-content .ast-container {
    flex-wrap: wrap;
}

.aiwriter-tools-btns[data-group="features"] button {
    white-space: nowrap;
    padding: 10px 18px;
    font-size: 1em;
    flex: 0 0 auto;
    box-sizing: border-box;
}

/*********/

.aiwriter-site-select {
    position: relative;
    width: 100%;
}

#aiwriter-site-dropdown {
    width: 100%;
    border-radius: var(--border-radius);
    padding: 15px 16px;
    border: none;
    margin-bottom: -5px;
    box-shadow: var(--box-shadow);
}

.aiwriter-site-list {
    position: absolute;
    z-index: 30;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: var(--box-shadow);
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #eee;
    display: none;
}

.aiwriter-site-list .site-option {
    padding: 12px 18px;
    cursor: pointer;
    transition: 0.1s;
    font-size: 1rem;
    border: var(--border);
}

.aiwriter-site-list .site-option.selected,
.aiwriter-site-list .site-option:hover {
    background: var(--bg-primaryColor);
    color: var(--ast-global-color-0);
    border: 1px solid var(--border-primaryColor);
}

/****/

/* Wrapper for relative positioning */
.aiwriter-rewrite-wrapper {
    position: relative;
}

/* Tools block positioned over textarea */
.aiwriter-rewrite-tools {
    position: absolute;
    right: 10px;
    bottom: 20px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

/* Buttons for copy, paste, clear (mini tools) */
.aiwriter-rewrite-tool-btn {
    background: var(--background, rgba(255, 255, 255, 0.93));
    border-radius: calc(var(--border-radius, 10px) - 3px);

    padding: 9px;
    box-shadow: var(--box-shadow);

    cursor: pointer;
    transition: background 0.15s, color 0.16s;
}

.aiwriter-rewrite-tool-btn:hover,
.aiwriter-rewrite-tool-btn:focus {
    background: var(--yellow-soft-bg);
    color: var(--ast-global-color-0);
}

/* Personas group — multiple rows, modern look */
.aiwriter-tools-btns#aiwriter-personas-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    padding-bottom: 2px;
    justify-content: flex-start;
}

/* Persona button: same width, no text break, glassy look */
.aiwriter-tools-btns#aiwriter-personas-group .aiwriter-button {
    min-width: 150px;
    flex: 1 1 150px;
    max-width: 220px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    padding: 11px 18px;
    margin-bottom: 0;
    font-size: 1.04em;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    display: flex;
    text-align: center;
    border-radius: var(--border-radius, 10px);
    /*background: var(--bg-primaryColor, #046BD20d);*/
    border: 1.5px solid var(--border-primaryColor, #046BD233);
    color: var(--font-color, #1E293B);
    font-weight: 600;
    box-shadow: var(--box-shadow);
    transition: var(--universal-transition, all 0.4s ease-in-out);
}


.aiwriter-tools-btns#aiwriter-personas-group .aiwriter-button:hover,
.aiwriter-tools-btns#aiwriter-personas-group .aiwriter-button:focus {
    background: var(--ast-global-color-1);
    color: #fff;
    border-color: var(--ast-global-color-1);
}

.aiwriter-tools-btns#aiwriter-personas-group .aiwriter-button.active,
.aiwriter-tools-btns#aiwriter-personas-group .aiwriter-button.selected,
.aiwriter-tools-btns#aiwriter-personas-group .aiwriter-button:active {
    background: var(--ast-global-color-0);
    color: #fff;
    border-color: var(--ast-global-color-0);
    box-shadow: var(--box-shadow-hover);
    z-index: 1;
}

/* Toast notification, uses variables for color, shadow, etc */
.aiwriter-toast {
    position: fixed;
    left: 50%;
    bottom: 44px;
    transform: translateX(-50%);
    background: var(--color, #1E293B);
    color: #fff;
    padding: 16px 26px;
    border-radius: var(--border-radius, 12px);
    font-size: 1.07em;
    box-shadow: var(--box-shadow-hover);
    opacity: 0;
    pointer-events: none;
    z-index: 100000;
    transition: opacity 0.38s cubic-bezier(0.37, 0.7, 0.54, 0.87), bottom 0.28s;
    min-width: 120px;
    text-align: center;
}

.aiwriter-toast.show {
    opacity: 1;
    bottom: 56px;
}

/*WYSIWYG*/

.aiwriter-wysiwyg-toolbar {
    background: var(--background, rgba(255, 255, 255, 0.65));
    border-radius: var(--border-radius, 10px);
    padding: 7px 10px;
    margin-bottom: 10px;
    box-shadow: var(--box-shadow);
    display: flex;
    gap: 12px;
    align-items: center;
}

.aiwriter-wysiwyg-btn {
    background: var(--bg-primaryColor, #046BD20d);
    color: var(--font-color, #1E293B);
    font-size: 1.06em;
    font-weight: 500;
    padding: 6px 13px;
    cursor: pointer;
    border-radius: calc(var(--border-radius, 10px) - 3px);
    transition: var(--universal-transition, all 0.4s ease-in-out);
    box-shadow: var(--box-shadow);
    outline: none;
    border: 1px solid var(--border-primaryColor, #046BD233);
    border-radius: calc(var(--border-radius, 10px) - 3px);
}

.aiwriter-wysiwyg-btn:hover,
.aiwriter-wysiwyg-btn:focus {
    background: var(--bg-primaryColor);
    border-color: var(--ast-global-color-0);
}

.aiwriter-wysiwyg[contenteditable="true"] {
    min-height: 280px;
    max-height: 620px;
    overflow-y: auto;
    padding: 18px 20px;
    border-radius: 0 0 5px 5px;
    border: var(--border, 1px solid rgb(181 181 181 / 30%));
    background: var(--background, rgba(255, 255, 255, 0.37));
    box-shadow: var(--box-shadow);
    font-size: 1rem;
    color: var(--font-color, #1E293B);
    font-family: inherit;
    font-weight: 400;
    transition: var(--universal-transition, all 0.4s ease-in-out);
}

.aiwriter-wysiwyg[contenteditable="true"]:focus {
    outline: 2px solid var(--primaryColor, #046BD2);
    background: #fff;
}

.aiwriter-wysiwyg.empty:before {
    content: attr(data-placeholder);
    color: #b0b4bb;
    font-style: italic;
    pointer-events: none;
    position: absolute;
}

#aiwriter-rewrite-wysiwyg-undo,
#aiwriter-wysiwyg-copy,
#aiwriter-rewrite-wysiwyg-copy,
#aiwriter-rewrite-wysiwyg-clear,
#aiwriter-wysiwyg-clear {
    background: none;
    color: #ff6d89;
    border: 1.2px solid var(--border-primaryColor, #046BD233);
    border-radius: calc(var(--border-radius, 10px) - 3px);
    padding: 6px 14px;
    font-weight: 500;
    font-size: 1em;
    /*margin-left: auto;*/
    transition: var(--universal-transition, all 0.4s ease-in-out);
}

#aiwriter-wysiwyg-copy,
#aiwriter-rewrite-wysiwyg-copy {
    color: var(--primaryColor, #1E293B);
    margin-left: auto;
}

#aiwriter-rewrite-wysiwyg-undo {
    color: var(--color, #1E293B);
    margin-left: auto;
}

/*#aiwriter-wysiwyg-autoheader{*/
/*    color: var(--color, #1E293B);*/
/*    margin-right: auto;*/
/*    margin-left: 0;*/
/*}*/

#aiwriter-rewrite-wysiwyg-clear:hover,
#aiwriter-rewrite-wysiwyg-clear:focus,
#aiwriter-wysiwyg-clear:hover,
#aiwriter-wysiwyg-clear:focus {
    background: var(--coral-soft-bg);
    color: var(--brand-accent-coral);
    border-color: rgba(255, 109, 137, 0.35);
}

#aiwriter-wysiwyg-copy:hover,
#aiwriter-rewrite-wysiwyg-copy:hover {
    background: var(--bg-primaryColor);
    border-color: var(--ast-global-color-0);
}

.aiwriter-wysiwyg[contenteditable="true"].empty:before {
    content: attr(placeholder);
    color: #aaa;
    pointer-events: none;
    display: block;
}

/* --- COPY BUTTON ROW --- */
.aiwriter-copy-row {
    display: flex;
    gap: 60px;
    margin: 50px 0;
    justify-content: center;
}

.aiwriter-copy-btn {
    font-size: 1.08em;
    padding: 18px 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--ast-global-color-0);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    cursor: pointer;
    transition: var(--universal-transition);
    font-weight: 600;
    outline: none;
}

.aiwriter-copy-btn:hover,
.aiwriter-copy-btn:focus {
    background: var(--ast-global-color-0);
    color: white;
}

.aiwriter-copy-arrow {
    width: 26px;
    height: 26px;
    display: inline-block;
    vertical-align: middle;
    /* you can adjust margin if needed */
}

.right-col-div {
    border: var(--border, 1px solid #e0e0e0);
    border-radius: var(--border-radius, 10px);
    padding: 16px 18px 12px 18px;
    width: 100%;
}

/*.aiwriter-detectors-title {*/
/*    font-weight: 600;*/
/*    margin-bottom: 11px;*/
/*    font-size: 1.08em;*/
/*}*/
.aiwriter-detectors-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aiwriter-detector-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    font-weight: 500;
    text-decoration: none;
    color: var(--brand-navy);
    padding: 10px 15px;
    transition: background 0.18s, box-shadow 0.18s;
}

.aiwriter-detector-btn:hover {
    background: var(--bg-primaryColor, #eef5ff);
    box-shadow: var(--box-shadow-hover);
    color: var(--ast-global-color-1);
}

.aiwriter-detector-btn img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    background: none;
    border-radius: var(--border-radius);
    display: block;
}

/* Simple modal for link dialog */
#aiwriter-link-modal {
    z-index: 99;
}

#aiwriter-link-modal .aiwriter-modal-window {
    min-width: 320px;
    max-width: 98vw;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-hover);
    padding: 24px;
    position: relative;
}

#aiwriter-link-modal .aiwriter-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 2em;
    color: #888;
    cursor: pointer;
}

#aiwriter-link-modal .aiwriter-link-modal-content input[type="text"] {
    font-size: 1.09em;
    padding: 7px 10px;
}

#aiwriter-link-modal .aiwriter-button {
    margin-top: 10px;
}


/* ===========================================================================
   AIWriter Modal: Choose a Tool (Large Grid Modal)
   All styles scoped inside .aiwriter-modal-bg context to prevent conflicts.
   =========================================================================== */

/* Modal overlay (background dim) */
.aiwriter-modal-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30, 41, 59, 0.14);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important; /* No scroll on overlay */
}

/* Modal window (main container) */
.aiwriter-modal-bg .aiwriter-modal-window.large {
    background: #fff;
    border-radius: var(--border-radius);
    max-width: 1100px;
    width: 100%;
    padding: 34px 28px 18px 28px;
    position: relative;
    box-shadow: var(--box-shadow-hover);
    /* Make modal content scrollable if overflow */
    max-height: 92vh;
    min-height: unset;
    display: flex;
    flex-direction: column;
    animation: modal-pop 0.2s;
}
@keyframes modal-pop {
    from { opacity:0; transform: scale(0.96);}
    to { opacity:1; transform: scale(1);}
}

/* Modal close button (top right) */
.aiwriter-modal-bg .aiwriter-modal-close {
    position: absolute;
    top: 20px; right: 22px;
    background: none; border: none;
    font-size: 2.2em; color: #a0a7c6;
    cursor: pointer; padding: 0; z-index: 10;
    transition: color 0.17s;
}
.aiwriter-modal-bg .aiwriter-modal-close:hover {
    color: var(--ast-global-color-1);
}

/* Modal content wrapper (scrollable area) */
.aiwriter-modal-bg .aiwriter-tools-modal-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 8px;
    display: flex;
    flex-direction: column;
}

/* Modal title and subtitle */
.aiwriter-selected-tool #aiwriter-tool-message,
.aiwriter-modal-bg .aiwriter-modal-title {
    font-size: 1.36em;
    font-weight: 700;
    margin-bottom: 7px;
    letter-spacing: 0.02em;
}
.aiwriter-modal-bg .aiwriter-modal-subtitle {
    font-size: 1.1em;
    color: #6172a6;
    margin-bottom: 30px;
}

/* Grid of tools */
.aiwriter-modal-bg .aiwriter-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px 20px;
    flex: 0 0 auto;
    margin-bottom: 18px;
}

/* Tool tile (selectable button) */
.aiwriter-modal-bg .aiwriter-tool-tile {
    border-radius: var(--border-radius);
    background: #f8faff;
    box-shadow: var(--box-shadow);
    padding: 11px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.14s, background 0.12s;
    outline: none;
    max-width: 290px;
    min-height: 84px;
    flex-wrap: wrap;
}
.aiwriter-modal-bg .aiwriter-tool-tile:hover,
.aiwriter-modal-bg .aiwriter-tool-tile:focus {
    border: 2px solid var(--ast-global-color-1);
    background: #eef3ff;
}
.aiwriter-modal-bg .tool-title {
    font-size: 1.08em;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--brand-navy);
}
.aiwriter-modal-bg .tool-desc {
    font-size: 0.9em;
    color: #7c85a7;
    line-height: 1.15;
    text-wrap: balance;
    text-align: left;
}

/* Custom tool block (input your own document type) */
.aiwriter-modal-bg .aiwriter-modal-custom-tool-block {
    margin-top: 14px;
    padding-top: 16px;
    border-top: 1px solid #e4e9f8;
    flex: 0 0 auto;
}
.aiwriter-modal-bg .custom-tool-title {
    font-weight: 600;
    font-size: 1.08em;
    margin-bottom: 5px;
}
.aiwriter-modal-bg .custom-tool-desc {
    color: #6d74a7;
    font-size: 0.97em;
    margin-bottom: 10px;
}
.aiwriter-modal-bg #aiwriter-custom-tool-input {
    flex: 1 1 60px;
    min-width: 0;
    font-size: 1em;
    border: 1px solid #e4e9f8;
    border-radius: var(--border-radius);
    padding: 7px 10px;
    margin-right: 8px;
    background: #fff;
}
.aiwriter-modal-bg #aiwriter-custom-tool-btn {
    flex: 0 0 90px;
    font-size: 1em;
    border-radius: var(--border-radius);
    border: none;
    background: var(--ast-global-color-0);
    color: #fff;
    padding: 7px 0;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.14s, color 0.14s;
}
.aiwriter-modal-bg #aiwriter-custom-tool-btn:hover {
    background: var(--brand-primary-strong);
    color: #fff;
}

/* Scrollbar styles for modal content only */
.aiwriter-modal-bg .aiwriter-tools-modal-content {
    scrollbar-width: thin;
    scrollbar-color: #c6cfff #f8faff;
}
.aiwriter-modal-bg .aiwriter-tools-modal-content::-webkit-scrollbar {
    width: 7px;
    background: #f8faff;
}
.aiwriter-modal-bg .aiwriter-tools-modal-content::-webkit-scrollbar-thumb {
    background: #6ba2ff;
    border-radius: var(--border-radius);
}

/* Responsive/adaptive grid for modal */
@media (max-width: 1100px) {
    .aiwriter-modal-bg .aiwriter-modal-window.large { max-width: 99vw; padding: 20px 2vw;}
    .aiwriter-modal-bg .aiwriter-tools-grid { grid-template-columns: repeat(3, 1fr);}
}
@media (max-width: 900px) {
    .aiwriter-modal-bg .aiwriter-modal-window.large { padding: 8px 1vw;}
    .aiwriter-modal-bg .aiwriter-tools-grid { grid-template-columns: repeat(2, 1fr);}
}
@media (max-width: 600px) {
    .aiwriter-modal-bg .aiwriter-tools-grid { grid-template-columns: 1fr;}
    .aiwriter-modal-bg .aiwriter-tool-tile { padding: 13px 3px; }
    .aiwriter-modal-bg .aiwriter-modal-window.large { padding: 6px 2vw;}
}
/* End AIWriter Modal Styles */



/* Keep selects usable even if parent groups have overflow rules */
.aiseo-additional-selects {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    width: 100%;
    overflow: visible;
    align-items: flex-start;
    justify-content: space-between;
    margin-top: 30px;
}
.aiseo-select-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
    position: relative;        /* Helps with dropdown stacking */
}
.aiseo-select-block select.aiseo-count-select {
    width: 100%;
    z-index: 2;                /* Keep the dropdown above neighbors */
}
.aiseo-select-label {
    font-weight: 600;
}
.aiseo-hint {
    color: #a0a7c6;
    font-size: 0.88em;
    line-height: 1.35;
}
#aiseo-additionally-group {
    margin-bottom: 16px;
}


/* Local styles for the structure block */
#aiseo-structure-wrap{
    display:flex; gap:16px; align-items:flex-start;
}
#aiseo-structure-left{ flex:0 1 60%; }
#aiseo-structure-right{ flex:1 1 40%; display:flex; flex-direction:column; gap:10px; }
#aiseo-structure-right .tips{ color:#6d74a7; font-size:0.9em; line-height:1.45; }
#aiseo-structure-right ul{ margin:6px 0 0; padding-left:18px; }
@media (max-width: 900px){
    #aiseo-structure-wrap{ flex-direction:column; }
    #aiseo-structure-left, #aiseo-structure-right{ flex-basis:100%; }
}


.site-navigation ul.menu li.menu-item-has-children:after {
    max-height: 38px;
}

.emoji {
    width: 24px;
    height: 16px;
}



/* --- Minimal, isolated styles for Template Name: User Dashboard --- */
.ais-dash * { box-sizing: border-box; }
.ais-dash { max-width: 1200px; margin: 0 auto; padding: 24px; }
.ais-row { display: grid; gap: 18px; grid-template-columns: 1fr; }

/* 4 columns on desktop, responsive down to 1 */
.ais-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1200px){ .ais-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px){  .ais-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px){  .ais-grid { grid-template-columns: 1fr; } }

.ais-card { background:#fff; border:1px solid #e9eef4; border-radius: var(--border-radius); padding:16px; box-shadow:var(--box-shadow); }
.ais-muted { color:#6b7390; }
.ais-h1 { font-size:1.6rem; margin: 4px 0 10px; }
.ais-h2 { font-size:1.2rem; margin: 0 0 10px; }
.ais-flex { display:flex; gap:12px; align-items:center; }
.ais-avatar { width:64px; height:64px; border-radius:999px; }
.ais-btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 16px; border-radius: var(--border-radius); background:var(--ast-global-color-0); color:#fff; text-decoration:none; border:none; cursor:pointer; font-weight:600; }
.ais-btn.secondary { background:#eef2ff; color:var(--brand-primary-strong) !important; }
.ais-btn[disabled] { opacity:.55; cursor:not-allowed; }
.ais-search { width:100%; padding:12px 14px; border-radius: var(--border-radius); border:1px solid #dfe6f3; outline:none; }
.ais-tool-card { display:flex; flex-direction:column; gap:10px; border:1px solid #e9eef4; border-radius: var(--border-radius); padding:14px; background:#f9fbff; }
.ais-tool-title { font-weight:700; }
.ais-chip-row { display:flex; flex-wrap:wrap; gap:8px; }
.ais-chip { padding:6px 10px; border-radius: var(--border-radius); font-size:.9rem; background:var(--bg-primaryColor); color:var(--primaryColor); }
.ais-tools-wrap details { border:1px dashed #cfe0ff; padding:10px 12px; border-radius: var(--border-radius); background:#fbfdff; }
.ais-tools-wrap summary { cursor:pointer; font-weight:600; }
.ais-announce li { margin:6px 0; }
.ais-foot { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }

/* Locked state */
.ais-tool-card.is-locked { position: relative; background:#f9fafc; opacity:.95; }
.ais-lock-badge { position:absolute; top:10px; right:10px; font-size:.75rem; background:var(--coral-soft-bg); color:var(--brand-accent-coral); border-radius:999px; padding:4px 8px; }
@media (max-width: 640px){ .ais-flex{align-items:flex-start;} }

/* Dashboard tool title link */
.ais-tool-title a.ais-tool-link{ color:inherit; text-decoration:none; }
.ais-tool-card:hover .ais-tool-title a.ais-tool-link{ text-decoration:underline; }



/* Full-card link behavior for dashboard tool tiles */
.ais-tool-card-link{
    /* Make anchor look like a card */
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 12px;

    padding:16px;
    text-decoration:none;
    color: var(--font-color, #1E293B);
    /*background: var(--background, rgba(255,255,255,0.37));*/
    border: var(--border, 1px solid rgba(181,181,181,.30));
    border-radius: var(--border-radius, 5px);
    box-shadow: var(--box-shadow);

    transition: var(--universal-transition);
    position: relative; /* for lock badge */
    min-height: 76px;
}
.ais-tool-card-link .ais-tool-title{
    margin:0;
    font-weight: 700;
    font-size: 1.16rem;
    line-height: 1.35;
    letter-spacing: .2px;
}



/* Keep lock badge readable over brand hover */
.ais-tool-card-link.is-locked .ais-lock-badge{
    background: var(--coral-soft-bg);
    color: var(--brand-accent-coral);
}

/* Keyboard focus ring for accessibility */
.ais-tool-card-link:focus-visible{
    outline: none;
    box-shadow:
      var(--box-shadow-hover),
      0 0 0 2px #fff,
      0 0 0 6px var(--ast-global-color-1, #0058BB);
}




.user-card-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;}

.user-card-buttons .aiwriter-button{
    text-align: center;
}
.aiwriter-widget.aiwriter-card {
    width: 100%;
}


/* Hairline divider for sub-sections inside a block */
.aiwriter-subline{
    height:1px;
    background: linear-gradient(to right, rgba(109,116,167,.18), rgba(109,116,167,.06));
    border:0;
    margin:22px 0;
}
/* Small responsive helper (optional) */
.aiw-two-col{ display:grid; gap:10px; grid-template-columns:1fr; }
@media (min-width:880px){ .aiw-two-col{ grid-template-columns:1fr 1fr; } }




/* --- Text size slider (scoped to the existing block) --- */
#aiseo-text-size .aiseo-range {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#aiseo-text-size .aiseo-range-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .95rem;
    color: #6d74a7;
}
#aiseo-text-size input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: var(--border-radius);
    background: linear-gradient(90deg,#eef2ff,#f3f4f6);
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.05);
}
#aiseo-text-size input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--ast-global-color-0);
    border: 2px solid #fff;
    box-shadow: var(--box-shadow);
    cursor: pointer;
    transition: transform .12s ease;
}
#aiseo-text-size input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.06);
}
#aiseo-text-size input[type="range"]::-moz-range-thumb {
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--ast-global-color-0);
    border: 2px solid #fff;
    box-shadow: var(--box-shadow);
    cursor: pointer;
}
#aiseo-text-size .aiseo-range-hint {
    color: #a0a7c6;
    font-size: .86rem;
}



.wrytix-gauge-widget {
  /* horizontal by default: number on the left, gauge on the right */
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: center;
  margin: 12px 0 12px 0;
}
.wrytix-gauge-widget.stack {
  /* vertical layout: gauge under number */
  flex-direction: column;
  align-items: flex-start;
}
.wrytix-gauge-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
  justify-content: flex-end;
  height: 110px;
}
.wrytix-gauge-label {
  font-size: 0.8rem;
  color: var(--ast-global-color-3, #334155);
}
.wrytix-gauge-number {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ast-global-color-2, #1E293B);
  min-width: 4ch;
}
.wrytix-gauge-svg {
  width: 220px;
  height: 120px;
  display: block;
  top: -10px;
  position: absolute;
}
.wrytix-gauge-track {
  stroke: var(--ast-global-color-7, #d1d5db);
  stroke-width: 12;
  fill: none;
  stroke-linecap: butt;
  opacity: 0.35; /* flat ends on track for cleaner look */
}
.wrytix-gauge-arc {
  stroke: var(--ast-global-color-1, #0058BB);
  stroke-width: 12;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100; /* 0..100% */
  transition: stroke-dashoffset 0.3s ease;
} /* --- Overlay layout: number on the left, gauge absolutely positioned --- */
.wrytix-gauge-widget.overlay {
  position: relative;
  align-items: flex-start;
  padding-bottom: 14px; /* room for arc thickness */
  min-height: 120px; /* ensure space for semicircle */
}
.wrytix-gauge-widget.overlay .wrytix-gauge-metric {
  position: relative;
  z-index: 2;
}
.wrytix-gauge-widget.overlay .wrytix-gauge-number {
  font-size: 2.8rem;
}
.wrytix-gauge-widget.overlay .wrytix-gauge-svg {
  position: absolute;
  right: 0;
  bottom: -6px;
  width: 240px;
  height: 120px;
  pointer-events: none;
  opacity: 0.98;
}
@media (max-width: 520px) {
  .wrytix-gauge-svg {
    width: 170px;
    height: 85px;
  }
  .wrytix-gauge-number {
    font-size: 2.1rem;
  }
  .wrytix-gauge-widget.overlay {
    min-height: 100px;
    padding-bottom: 10px;
  }
  .wrytix-gauge-widget.overlay .wrytix-gauge-svg {
    width: 200px;
    height: 100px;
    right: -4px;
    bottom: -4px;
  }
}


/* Mobile styles: stack buttons */
@media (max-width: 700px) {
    .aiwriter-copy-row {
        flex-direction: column;
        gap: 12px;
        margin: 24px 0 10px 0;
        align-items: stretch;
    }

    .aiwriter-copy-btn {
        justify-content: center;
        width: 100%;
        font-size: 1em;
        padding: 14px 0;
    }
}

@media (max-width: 1180px) {
    .aiwriter-bg.no-right-sidebar .aiwriter-main-container {
        padding-left: calc(var(--sb-left) + clamp(8px, 3vw, 22px));
    }
}

@media (max-width: 901px) {
    .aiwriter-main-container {
        flex-direction: column;
        align-items: stretch;
        gap: 28px;
        padding: 0 18px;
    }

    .aiwriter-bg.no-right-sidebar .aiwriter-main-container {
        padding-right: clamp(18px, 5vw, 26px);
        padding-left: clamp(52px, 14vw, 72px);
    }

    .aiwriter-left-col,
    .aiwriter-center-col,
    .aiwriter-right-col {
        min-width: 0;
        width: 100%;
        align-items: stretch;
    }
    
    .site-navigation,
    .ast-builder-grid-row {
  padding-left: 45px;
}


    .aiwriter-center-col {
  padding-left: 25px;
}




.site-content .wrytix-aiapps-tile {

    justify-content: space-between;
    gap: 14px;
    min-height: 50px;
    padding: 18px 16px;


}


}

@media (min-width: 1761px)  {
    .aiwriter-center-col {
        max-width: 1200px;
    }
    .aiwriter-center-col.page-center-col {
        max-width: 1200px;
    }
    .aiwriter-bg.no-right-sidebar .aiwriter-center-col {
        max-width: 1480px;
    }
}
@media (min-width: 1920px) {
    .aiwriter-bg.no-right-sidebar .aiwriter-center-col {
        max-width: clamp(1400px, 82vw, 1960px);
    }
}
@media (min-width:1180px) and (max-width:1760px){
    /* Remove hard cap on the flex wrapper in this range */
    .aiwriter-main-container{ max-width: none; }

    .site-header .header-inner,
    .aiwriter-center-col{
        flex: 0 1 auto;

        width: clamp(720px,
        calc(100vw - (var(--sb-left) + var(--sb-right) + 70px)),
        1160px);

        margin-left: auto;
        margin-right: auto;
    }
    .aiwriter-bg.no-right-sidebar .aiwriter-center-col{
        width: clamp(820px,
        calc(100vw - (var(--sb-left) + 80px)),
        1420px);
        margin-left: 0;
        margin-right: clamp(18px, 3vw, 36px);
    }
    .site-header .site-branding .site-logo img {
        max-width: 130px;
    }
    .site-navigation #menu-item-1274{
        margin-left: 15px;
    }
    .aiwriter-card {
        padding: 10px;
    }

}

/* --- Generate buttons (Step 6) --- */
.aiseo-speed-grid {
    display: flex;
    /* grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); */
    gap: var(--gap);
    justify-content: space-around;
    width: 100%;
}

.aiseo-speed-card {
    border: 1px solid #e1e6f5;
    border-radius: var(--border-radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: var(--gap);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease, color 0.12s ease, filter 0.12s ease;
    text-align: left;
    width: min(100%, 425px);
    background: var(--gradient-primary);
    box-shadow: var(--box-shadow-hover);
    color: #fff;
}

.aiseo-speed-card .aiseo-speed-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.aiseo-speed-title {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

.aiseo-speed-sub {
    font-size: 13px;
    color: var(--brand-accent-sky);
}

.aiseo-speed-pill {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: var(--border-radius);
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.35);
    color: #ffffff;
    font-weight: 700;
}

.aiseo-speed-icon img {
    width: 20px;
    height: 30px;
    transition: filter 0.12s ease;
}

.aiseo-speed-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--box-shadow-hover);
    background: linear-gradient(135deg, #f7f8fb, #eef1fb);
    border-color: #e1e6f5;
    color: #1E293B;
}

.aiseo-speed-card:hover .aiseo-speed-title {
    color: #1E293B;
}

.aiseo-speed-card:hover .aiseo-speed-sub {
    color: #4d5a7a;
}

.aiseo-speed-card:hover .aiseo-speed-pill {
    background: #eef2ff;
    border-color: #d9def5;
    color: var(--brand-accent-purple);
}

.aiseo-speed-card:hover .aiseo-speed-icon img {
    filter: brightness(0) saturate(100%) invert(27%) sepia(22%) saturate(1400%) hue-rotate(206deg) brightness(92%) contrast(92%);
}

.aiseo-speed-card:active {
    transform: translateY(0);
    box-shadow: var(--box-shadow);
}

.aiseo-speed-card:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
