/* ============================================================================
   AI Text Humanizer - Tool Styles  (scoped: .ah-)
   Relies on common.css for hero, content sections, FAQ, sidebar, ad slots.
   ============================================================================ */

:root {
    --ah-accent: #FF8C00;
    --ah-accent-dark: #e67e00;
    --ah-ink: #252525;
    --ah-border: #e5e7eb;
    --ah-muted: #64748b;
    --ah-bg-soft: #f8fafc;
}

.ah-card {
    background: #fff;
    border: 1px solid var(--ah-border);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
    overflow: hidden;
}

/* ---- Toolbar: strength + options ---- */
.ah-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--ah-border);
    background: var(--ah-bg-soft);
}

.ah-tool-group { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.ah-group-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ah-muted);
}

.ah-strength-group {
    display: inline-flex;
    background: #eef2f7;
    border-radius: 12px;
    padding: 4px;
    gap: 2px;
}
.ah-strength-btn {
    border: none;
    background: transparent;
    color: var(--ah-muted);
    font-weight: 600;
    font-size: .85rem;
    padding: .5rem .95rem;
    border-radius: 9px;
    cursor: pointer;
    transition: all .18s ease;
}
.ah-strength-btn:hover { color: var(--ah-ink); }
.ah-strength-btn.active {
    background: var(--ah-accent);
    color: #fff;
    box-shadow: 0 3px 10px rgba(255, 140, 0, 0.35);
}

.ah-opts { display: flex; flex-wrap: wrap; gap: .5rem; }
.ah-opt {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: 1px solid var(--ah-border);
    background: #fff;
    color: var(--ah-muted);
    font-size: .82rem;
    font-weight: 600;
    padding: .45rem .8rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all .15s ease;
}
.ah-opt iconify-icon { font-size: 1rem; }
.ah-opt:hover { border-color: var(--ah-accent); color: var(--ah-ink); }
.ah-opt.active {
    background: rgba(255, 140, 0, 0.1);
    border-color: var(--ah-accent);
    color: var(--ah-accent-dark);
}
.ah-opt.active iconify-icon { color: var(--ah-accent); }

/* ---- Panels grid ---- */
.ah-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.ah-panel { display: flex; flex-direction: column; min-height: 340px; }
.ah-panel:first-child { border-right: 1px solid var(--ah-border); }

.ah-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--ah-border);
}
.ah-panel-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .95rem;
    font-weight: 700;
    color: var(--ah-ink);
    margin: 0;
}
.ah-panel-title iconify-icon { color: var(--ah-accent); font-size: 1.15rem; }

.ah-panel-actions { display: flex; gap: .35rem; }
.ah-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border: 1px solid var(--ah-border);
    background: #fff;
    color: var(--ah-muted);
    font-size: .8rem;
    font-weight: 600;
    padding: .4rem .6rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s ease;
}
.ah-icon-btn:hover { border-color: var(--ah-accent); color: var(--ah-accent-dark); background: rgba(255,140,0,.06); }
.ah-icon-btn.primary { background: var(--ah-accent); color: #fff; border-color: var(--ah-accent); }
.ah-icon-btn.primary:hover { background: var(--ah-accent-dark); }
.ah-icon-btn iconify-icon { font-size: 1rem; }

.ah-textarea {
    flex: 1;
    width: 100%;
    border: none;
    resize: vertical;
    padding: 1rem;
    font-size: .95rem;
    line-height: 1.7;
    color: var(--ah-ink);
    font-family: inherit;
    background: #fff;
    outline: none;
    min-height: 260px;
}
.ah-textarea::placeholder { color: #aab2c0; }
.ah-textarea:focus { background: #fffdf9; }

.ah-output-wrap { position: relative; flex: 1; display: flex; }
.ah-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    color: #aab2c0;
    text-align: center;
    padding: 1.5rem;
    pointer-events: none;
}
.ah-empty iconify-icon { font-size: 2.5rem; color: #d6dbe3; }
.ah-empty span { font-size: .9rem; max-width: 240px; }

.ah-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 1rem;
    border-top: 1px solid var(--ah-border);
    font-size: .78rem;
    color: var(--ah-muted);
    background: var(--ah-bg-soft);
}
.ah-count.over { color: #ef4444; font-weight: 700; }

/* ---- Action bar ---- */
.ah-action-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.1rem;
    border-top: 1px solid var(--ah-border);
    background: var(--ah-bg-soft);
}
.ah-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    border: none;
    background: linear-gradient(135deg, var(--ah-accent), var(--ah-accent-dark));
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    padding: .85rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.32);
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.ah-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(255, 140, 0, 0.42); }
.ah-btn-primary:disabled { opacity: .7; cursor: not-allowed; transform: none; }
.ah-btn-primary iconify-icon { font-size: 1.2rem; }
.ah-hint { font-size: .78rem; color: var(--ah-muted); }
.ah-hint kbd {
    background: #fff; border: 1px solid var(--ah-border); border-bottom-width: 2px;
    border-radius: 5px; padding: 1px 6px; font-size: .72rem; font-family: inherit;
}

.ah-spin { animation: ah-rot 0.8s linear infinite; }
@keyframes ah-rot { to { transform: rotate(360deg); } }

/* ---- Stats ---- */
.ah-stats { margin-top: 1.25rem; display: grid; gap: 1rem; grid-template-columns: 1.3fr 1fr; }
.ah-score-card, .ah-metric-card {
    background: #fff;
    border: 1px solid var(--ah-border);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
}
.ah-card-title {
    display: flex; align-items: center; gap: .45rem;
    font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--ah-muted); margin: 0 0 .9rem;
}
.ah-card-title iconify-icon { color: var(--ah-accent); }

.ah-score-row { margin-bottom: .9rem; }
.ah-score-row:last-child { margin-bottom: 0; }
.ah-score-head { display: flex; justify-content: space-between; font-size: .82rem; font-weight: 600; color: var(--ah-ink); margin-bottom: .35rem; }
.ah-score-head .muted { color: var(--ah-muted); font-weight: 500; }
.ah-bar { height: 10px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.ah-bar-fill { height: 100%; width: 0; border-radius: 999px; transition: width .8s cubic-bezier(.22,1,.36,1); background: var(--ah-accent); }
.ah-bar-fill.good { background: linear-gradient(90deg, #22c55e, #16a34a); }
.ah-bar-fill.mid  { background: linear-gradient(90deg, #f59e0b, #f97316); }
.ah-bar-fill.low  { background: linear-gradient(90deg, #ef4444, #dc2626); }
.ah-score-note { font-size: .72rem; color: var(--ah-muted); margin: .8rem 0 0; line-height: 1.5; }

.ah-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.ah-metric { text-align: center; }
.ah-metric-val { font-size: 1.5rem; font-weight: 800; color: var(--ah-ink); line-height: 1.1; }
.ah-metric-lbl { font-size: .72rem; color: var(--ah-muted); margin-top: .25rem; }

/* ---- Honesty / disclaimer note ---- */
.ah-notice {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    margin-top: 1.25rem;
    padding: .9rem 1.1rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    color: #9a3412;
    font-size: .85rem;
    line-height: 1.55;
}
.ah-notice iconify-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }

/* ---- Toasts ---- */
.ah-toast-container {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    display: flex; flex-direction: column; gap: .6rem;
}
.ah-toast {
    display: flex; align-items: center; gap: .6rem;
    background: #1f2937; color: #fff;
    padding: .8rem 1.1rem; border-radius: 10px;
    font-size: .88rem; box-shadow: 0 10px 30px rgba(0,0,0,.2);
    transform: translateX(120%); opacity: 0; transition: all .3s ease;
}
.ah-toast.show { transform: translateX(0); opacity: 1; }
.ah-toast.success { background: #16a34a; }
.ah-toast.error { background: #dc2626; }
.ah-toast iconify-icon { font-size: 1.2rem; }

/* ---- Responsive ---- */
@media (max-width: 820px) {
    .ah-grid { grid-template-columns: 1fr; }
    .ah-panel:first-child { border-right: none; border-bottom: 1px solid var(--ah-border); }
    .ah-stats { grid-template-columns: 1fr; }
    .ah-toolbar { gap: .9rem; }
}
@media (max-width: 480px) {
    .ah-metrics { gap: .4rem; }
    .ah-metric-val { font-size: 1.25rem; }
    .ah-icon-btn span { display: none; }
    .ah-btn-primary { width: 100%; justify-content: center; }
    .ah-action-bar { flex-direction: column; }
    .ah-toast-container { left: 16px; right: 16px; bottom: 16px; }
    .ah-toast { transform: translateY(120%); }
    .ah-toast.show { transform: translateY(0); }
}
