/* AI Text Humanizer — professional dashboard UI */
.tool-widget:has(.ath-app) {
    padding: 0;
    overflow: hidden;
    background: transparent;
    border: none;
    box-shadow: none;
}

.ath-app {
    --ath-accent: #00aeef;
    --ath-accent-2: #38bdf8;
    --ath-ok: #34d399;
    --ath-warn: #f87171;
    --ath-card: rgba(15, 23, 42, 0.82);
    --ath-border: rgba(148, 163, 184, 0.16);
    --ath-muted: #94a3b8;
    width: 100%;
}

.ath-app [hidden] {
    display: none !important;
}

.ath-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.ath-shell {
    border: 1px solid var(--ath-border);
    border-radius: 20px;
    background:
        radial-gradient(ellipse 70% 45% at 0% 0%, rgba(0, 174, 239, .14), transparent 50%),
        radial-gradient(ellipse 50% 35% at 100% 0%, rgba(167, 139, 250, .1), transparent 45%),
        linear-gradient(180deg, #111827 0%, #0b1220 100%);
    padding: 1.15rem 1.2rem 1.35rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.ath-trust {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .95rem;
}

.ath-trust-item {
    padding: .35rem .7rem;
    border-radius: 999px;
    border: 1px solid var(--ath-border);
    background: rgba(2, 8, 20, .45);
    font-size: .72rem;
    font-weight: 700;
    color: #e2e8f0;
}

.ath-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
    align-items: start;
}

.ath-intro {
    position: sticky;
    top: 1rem;
    padding: 1.2rem;
    border-radius: 18px;
    border: 1px solid var(--ath-border);
    background:
        radial-gradient(circle at top left, rgba(0, 174, 239, .18), transparent 55%),
        linear-gradient(165deg, #111827, #0b1220 70%);
}

.ath-kicker {
    margin: 0 0 .45rem;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ath-accent-2);
}

.ath-intro-title {
    margin: 0 0 .7rem;
    font-size: 1.4rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #e0f2fe, #7dd3fc 40%, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ath-intro-text {
    margin: 0 0 1rem;
    color: var(--ath-muted);
    font-size: .9rem;
    line-height: 1.6;
}

.ath-cta {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin-bottom: 1rem;
    min-height: 46px;
    font-weight: 800;
}

.ath-why {
    padding: 1rem;
    border-radius: 14px;
    background: rgba(0, 174, 239, .07);
    border: 1px solid rgba(0, 174, 239, .18);
}

.ath-why h3 {
    margin: 0 0 .55rem;
    font-size: .9rem;
    color: #e2e8f0;
}

.ath-why ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--ath-muted);
    font-size: .84rem;
    line-height: 1.55;
}

.ath-why li + li {
    margin-top: .28rem;
}

.ath-workspace {
    min-width: 0;
}

.ath-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .15rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--ath-border);
}

.ath-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--ath-muted);
    font-size: .88rem;
    font-weight: 700;
    padding: .65rem .9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.ath-tab:hover { color: #e2e8f0; }

.ath-tab.active {
    color: var(--ath-accent-2);
    border-bottom-color: var(--ath-accent);
}

.ath-panel { display: none; }
.ath-panel.active { display: block; }

.ath-dual {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: .75rem;
    align-items: stretch;
}

.ath-card {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid var(--ath-border);
    background: var(--ath-card);
}

.ath-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .7rem;
}

.ath-head-actions {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
}

.ath-card-head h3 {
    margin: 0;
    font-size: .9rem;
    font-weight: 800;
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.ath-step {
    display: inline-grid;
    place-items: center;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
    color: #0b1220;
    background: linear-gradient(145deg, #38bdf8, #0ea5e9);
}

.ath-link-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--ath-accent-2);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.ath-link-btn:hover { color: #e0f2fe; }

.ath-textarea {
    width: 100%;
    min-height: 220px;
    resize: vertical;
    border-radius: 12px;
    border: 1px solid var(--ath-border);
    background: rgba(2, 8, 20, .55);
    color: #e2e8f0;
    padding: .85rem 1rem;
    font-size: .93rem;
    line-height: 1.55;
    font-family: inherit;
}

.ath-textarea:focus {
    outline: none;
    border-color: rgba(56, 189, 248, .55);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .15);
}

#athOutput {
    background: linear-gradient(180deg, rgba(6, 78, 59, .13), rgba(2, 8, 20, .55));
    border-color: rgba(52, 211, 153, .2);
}

#athOutput:focus {
    border-color: rgba(52, 211, 153, .5);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, .12);
}

.ath-pane-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    flex-wrap: wrap;
    margin-top: .65rem;
    font-size: .78rem;
    color: var(--ath-muted);
}

.ath-pane-actions {
    display: flex;
    gap: .35rem;
}

.ath-icon-btn {
    appearance: none;
    min-height: 30px;
    padding: 0 .65rem;
    border-radius: 8px;
    border: 1px solid var(--ath-border);
    background: rgba(30, 41, 59, .7);
    color: #cbd5e1;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
}

.ath-icon-btn:hover {
    border-color: rgba(56, 189, 248, .45);
    color: #e0f2fe;
}

.ath-mid {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
}

.ath-go-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(145deg, #0284c7, #38bdf8);
    box-shadow: 0 10px 24px rgba(14, 165, 233, .35);
    display: grid;
    place-items: center;
    transition: transform .15s ease, filter .15s ease;
    position: relative;
}

.ath-go-btn span {
    position: absolute;
    top: calc(100% + .35rem);
    left: 50%;
    transform: translateX(-50%);
    color: #7dd3fc;
    font-size: .68rem;
    font-weight: 800;
    white-space: nowrap;
}

.ath-go-btn:hover {
    filter: brightness(1.08);
    transform: scale(1.05);
}

.ath-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.ath-settings-grid > .ath-card:first-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem 1.2rem;
}

.ath-settings-grid > .ath-card:first-child > .ath-card-head {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.ath-settings-grid > .ath-card:first-child .ath-setting {
    margin-bottom: 0;
    padding: .75rem;
    border-radius: 12px;
    background: rgba(2, 8, 20, .3);
    border: 1px solid rgba(148, 163, 184, .1);
}

.ath-setting {
    margin-bottom: .85rem;
}

.ath-setting:last-child {
    margin-bottom: 0;
}

.ath-setting-label {
    display: block;
    margin-bottom: .45rem;
    font-size: .78rem;
    font-weight: 700;
    color: #cbd5e1;
}

.ath-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.ath-chip {
    appearance: none;
    border: 1px solid var(--ath-border);
    background: rgba(30, 41, 59, .65);
    color: #cbd5e1;
    font-size: .76rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .38rem .75rem;
    cursor: pointer;
}

.ath-chip:hover {
    border-color: rgba(56, 189, 248, .4);
    color: #e0f2fe;
}

.ath-chip.active {
    background: rgba(14, 165, 233, .22);
    border-color: rgba(56, 189, 248, .55);
    color: #7dd3fc;
}

.ath-app button:focus-visible,
.ath-app textarea:focus-visible,
.ath-app a:focus-visible {
    outline: 3px solid rgba(56, 189, 248, .45);
    outline-offset: 3px;
}

.ath-gauges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.ath-gauge {
    text-align: center;
}

.ath-gauge-ring {
    --ath-pct: 0;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--ath-ring, #f87171) calc(var(--ath-pct) * 1%), rgba(30, 41, 59, .9) 0);
    margin: 0 auto;
}

.ath-gauge--before .ath-gauge-ring { --ath-ring: #f87171; }
.ath-gauge--after .ath-gauge-ring { --ath-ring: #34d399; }

.ath-gauge-inner {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #0b1220;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .1rem;
}

.ath-gauge-inner strong {
    font-size: 1.15rem;
    color: #e2e8f0;
}

.ath-gauge-inner span {
    font-size: .62rem;
    font-weight: 700;
    color: var(--ath-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.ath-gauge-label {
    margin: .45rem 0 0;
    font-size: .78rem;
    font-weight: 700;
    color: #cbd5e1;
}

.ath-gauge-arrow {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ath-accent-2);
}

.ath-gauge-note {
    margin: .85rem 0 0;
    font-size: .78rem;
    color: var(--ath-muted);
    text-align: center;
}

.ath-checklist {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ath-checklist li {
    position: relative;
    padding: .4rem 0 .4rem 1.45rem;
    font-size: .84rem;
    color: var(--ath-muted);
    border-bottom: 1px solid rgba(148, 163, 184, .1);
}

.ath-checklist li:last-child {
    border-bottom: 0;
}

.ath-checklist li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .55rem;
    width: .85rem;
    height: .85rem;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, .35);
    background: transparent;
}

.ath-checklist li.is-on {
    color: #e2e8f0;
}

.ath-checklist li.is-on::before {
    border-color: var(--ath-ok);
    background: var(--ath-ok);
    box-shadow: inset 0 0 0 2px #0b1220;
}

.ath-reword {
    margin: .75rem 0 0;
    font-size: .78rem;
    color: var(--ath-accent-2);
    font-weight: 700;
    min-height: 1.1rem;
}

.ath-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: 1rem;
}

.ath-actions .btn {
    min-height: 42px;
    font-weight: 700;
}

.ath-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem;
    margin-top: 1.1rem;
}

.ath-feature {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: .85rem .75rem;
    border-radius: 14px;
    border: 1px solid var(--ath-border);
    background: rgba(15, 23, 42, .55);
}

.ath-feature strong {
    font-size: .8rem;
    color: #e2e8f0;
}

.ath-feature span {
    font-size: .72rem;
    color: var(--ath-muted);
    line-height: 1.4;
}

.ath-howto h3 {
    margin: 0 0 .75rem;
}

.ath-howto ol,
.ath-howto p {
    margin: 0;
    color: var(--ath-muted);
    font-size: .9rem;
    line-height: 1.65;
}

.ath-howto ol {
    padding-left: 1.2rem;
}

.ath-howto li + li {
    margin-top: .35rem;
}

.ath-howto p + p {
    margin-top: .75rem;
}

.ath-related a {
    color: #7dd3fc;
    font-weight: 700;
}

.ath-history {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.ath-history-item {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: center;
    padding: .65rem .75rem;
    border-radius: 12px;
    border: 1px solid var(--ath-border);
    background: rgba(2, 8, 20, .35);
}

.ath-history-item p {
    margin: 0;
    font-size: .84rem;
    color: #e2e8f0;
}

.ath-history-item small {
    font-size: .72rem;
    color: var(--ath-muted);
}

.ath-empty {
    margin: 0;
    color: var(--ath-muted);
    font-size: .86rem;
}

@media (max-width: 1100px) {
    .ath-settings-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ath-features {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 960px) {
    .ath-layout {
        grid-template-columns: 1fr;
    }

    .ath-intro {
        position: static;
    }

    .ath-dual {
        grid-template-columns: 1fr;
    }

    .ath-mid {
        order: 2;
    }

    .ath-go-btn {
        width: min(100%, 320px);
        height: 48px;
        border-radius: 12px;
        display: inline-flex;
        gap: .5rem;
    }

    .ath-go-btn svg {
        transform: rotate(90deg);
    }

    .ath-go-btn span {
        position: static;
        transform: none;
        color: #fff;
        font-size: .8rem;
    }

    .ath-features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ath-shell { padding: .85rem; border-radius: 16px; }
    .ath-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .ath-tab { white-space: nowrap; }
    .ath-settings-grid { grid-template-columns: 1fr; }
    .ath-settings-grid > .ath-card:first-child {
        grid-template-columns: 1fr;
    }
    .ath-settings-grid > .ath-card:first-child > .ath-card-head {
        grid-column: 1;
    }
    .ath-textarea { min-height: 190px; }

    .ath-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
        width: 100%;
    }

    .ath-actions .btn {
        flex: none;
        width: 100%;
        min-height: 48px;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ath-app *,
    .ath-app *::before,
    .ath-app *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
