/* ============================================================
   Free AI writer tools (/ai-writer/*) and the /ai-writer hub.
   Prefix .aiw-. Each tool sets --aiw-accent on #aiw.
   The site template gives bare <section> 60px padding and clips
   overflow, so these pages use divs only.
   ============================================================ */

.aiw {
    --aiw-accent: #4f46e5;
    --aiw-ink: #121a33;
    --aiw-ink-2: #465070;
    --aiw-ink-3: #7a84a0;
    --aiw-line: #e3e7f1;
    --aiw-soft: color-mix(in srgb, var(--aiw-accent) 9%, #fff);
    --aiw-soft-2: color-mix(in srgb, var(--aiw-accent) 16%, #fff);
    --aiw-ring: color-mix(in srgb, var(--aiw-accent) 26%, transparent);
    --aiw-bg: #f5f7fc;
    --aiw-radius: 22px;
    color: var(--aiw-ink);
    background: var(--aiw-bg);
    overflow-x: clip;
    font-size: 15px;
}
.aiw *, .aiw *::before, .aiw *::after { box-sizing: border-box; }
.aiw [hidden] { display: none !important; }
.aiw-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:where(.aiw) :where(h1, h2, h3, p, ul, ol) { margin-top: 0; }
.aiw button { font-family: inherit; }

/* ---------------- hero ---------------- */
.aiw-hero {
    position: relative; isolation: isolate; overflow: hidden;
    padding: 54px 20px 118px; color: #fff; text-align: center;
    background:
        radial-gradient(820px 460px at 6% -12%, color-mix(in srgb, var(--aiw-accent) 85%, #000) 0%, transparent 62%),
        radial-gradient(760px 420px at 100% 115%, color-mix(in srgb, var(--aiw-accent) 55%, #0e7490) 0%, transparent 60%),
        linear-gradient(135deg, #0a1030 0%, color-mix(in srgb, var(--aiw-accent) 30%, #0b1440) 55%, #0a1a33 100%);
}
.aiw-hero-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.aiw-blob { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .45; animation: aiw-drift 18s ease-in-out infinite; }
.aiw-blob.b1 { width: 320px; height: 320px; left: -80px; top: 20px; background: var(--aiw-accent); }
.aiw-blob.b2 { width: 280px; height: 280px; right: -60px; top: -80px; background: #22d3ee; opacity: .28; animation-delay: -6s; }
.aiw-spark { position: absolute; color: rgba(255,255,255,.55); font-size: 18px; animation: aiw-twinkle 4s ease-in-out infinite; }
.aiw-spark.s1 { left: 12%; top: 32%; }
.aiw-spark.s2 { right: 14%; top: 22%; font-size: 26px; animation-delay: -1.3s; }
.aiw-spark.s3 { right: 26%; bottom: 30%; font-size: 13px; animation-delay: -2.6s; }

.aiw-hero-in { position: relative; max-width: 880px; margin: 0 auto; }
.aiw-eyebrow {
    display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 6px 14px; border-radius: 999px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); font-size: 13.5px; font-weight: 600; color: #e1e7ff;
}
.aiw-eyebrow-icon { font-size: 15px; line-height: 1; }
.aiw-title { margin: 0 0 14px; font-size: clamp(28px, 4.4vw, 50px); line-height: 1.1; font-weight: 800; letter-spacing: -.03em; color: #fff; overflow-wrap: anywhere; }
.aiw-lede { max-width: 660px; margin: 0 auto; font-size: clamp(15.5px, 1.6vw, 18px); line-height: 1.6; color: #cdd6f5; }
.aiw-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin: 24px 0 0; padding: 0; list-style: none; font-size: 14px; color: #cdd6f5; }
.aiw-trust li { display: inline-flex; align-items: center; gap: 7px; }

/* ---------------- workspace ---------------- */
.aiw-workspace {
    position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 22px; align-items: start;
    max-width: 1260px; margin: -84px auto 0; padding: 0 20px;
}
.aiw-card {
    background: #fff; border: 1px solid var(--aiw-line); border-radius: var(--aiw-radius);
    box-shadow: 0 22px 54px rgba(18, 26, 51, .1); padding: 22px; min-width: 0;
    animation: aiw-rise .45s ease both;
}
.aiw-output { position: sticky; top: 16px; animation-delay: .06s; display: flex; flex-direction: column; min-height: 460px; }
.aiw-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.aiw-h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; color: var(--aiw-ink); line-height: 1.25; }
.aiw-h2:focus { outline: none; }
.aiw-h2:focus-visible { outline: 3px solid var(--aiw-ring); outline-offset: 4px; border-radius: 6px; }
.aiw-h3 { margin: 22px 0 10px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--aiw-ink-3); }
.aiw-muted { margin: 2px 0 0; font-size: 13.5px; color: var(--aiw-ink-3); }
.aiw-step-dot { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 9px; background: var(--aiw-soft-2); color: var(--aiw-accent); font-size: 13px; font-weight: 800; vertical-align: 2px; }

.aiw-link {
    border: 0; background: transparent; padding: 6px 10px; border-radius: 10px; cursor: pointer;
    color: var(--aiw-ink-2); font-weight: 700; font-size: 13.5px;
}
.aiw-link:hover { background: #f1f3f9; color: var(--aiw-ink); }
.aiw-link:focus-visible { outline: 3px solid var(--aiw-ring); }

/* presets */
.aiw-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; padding: 12px; border-radius: 16px; background: var(--aiw-soft); border: 1px dashed var(--aiw-soft-2); }
.aiw-presets-label { font-size: 13px; font-weight: 700; color: var(--aiw-ink-2); margin-right: 2px; }
.aiw-preset {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--aiw-soft-2); background: #fff; color: var(--aiw-ink); font-size: 13.5px; font-weight: 600;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.aiw-preset::before { content: "\2728"; font-size: 12px; }
.aiw-preset:hover { border-color: var(--aiw-accent); transform: translateY(-1px); box-shadow: 0 6px 14px var(--aiw-ring); }
.aiw-preset:focus-visible { outline: 3px solid var(--aiw-ring); outline-offset: 2px; }

/* fields */
.aiw-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
.aiw-field { position: relative; display: flex; flex-direction: column; min-width: 0; }
.aiw-field.is-wide { grid-column: 1 / -1; }
.aiw-label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--aiw-ink); }
.aiw-optional { font-weight: 500; color: var(--aiw-ink-3); }
.aiw-input {
    width: 100%; min-width: 0; height: 46px; padding: 0 13px; border: 1px solid #d8deeb; border-radius: 13px; background: #fbfcff;
    color: var(--aiw-ink); font-size: 15px; font-family: inherit; outline: none; appearance: none; -webkit-appearance: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.aiw-input::placeholder { color: #9aa2bd; }
.aiw-input:hover { border-color: #c3cbe0; }
.aiw-input:focus { border-color: var(--aiw-accent); background: #fff; box-shadow: 0 0 0 4px var(--aiw-ring); }
.aiw-textarea { height: auto; min-height: 96px; padding: 12px 13px; line-height: 1.55; resize: vertical; }
.aiw-select {
    padding-right: 36px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237a84a0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 13px center;
}
.aiw-select:disabled { cursor: not-allowed; color: var(--aiw-ink-3); background-color: #f3f5fa; }
.aiw-count { align-self: flex-end; margin-top: 5px; font-size: 12px; color: var(--aiw-ink-3); font-variant-numeric: tabular-nums; }
.aiw-count.is-near { color: #b45309; font-weight: 700; }
.aiw-help, .aiw-field-msg { margin: 5px 0 0; font-size: 12.5px; color: var(--aiw-ink-3); }
.aiw-field-msg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #b45309; font-weight: 600; }
.aiw-field-msg button { border: 1px solid #f2c48b; background: #fff7ed; color: #9a3412; border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.aiw-field.is-invalid .aiw-input { border-color: #e11d48; background: #fff5f7; box-shadow: 0 0 0 4px rgba(225, 29, 72, .14); }
.aiw-field.is-invalid .aiw-label { color: #be123c; }
.aiw-field.is-invalid .aiw-chips { box-shadow: 0 0 0 3px rgba(225, 29, 72, .2); border-radius: 12px; }
.aiw-field.is-invalid { animation: aiw-shake .35s ease; }

/* chips (radio inputs are visually hidden but stay focusable) */
.aiw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.aiw-chip-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.aiw-chip {
    display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 8px 13px; border-radius: 999px; cursor: pointer; user-select: none;
    border: 1px solid #d8deeb; background: #fff; color: var(--aiw-ink-2); font-size: 13.5px; font-weight: 600; line-height: 1.2;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.aiw-chip:hover { border-color: var(--aiw-accent); color: var(--aiw-ink); }
.aiw-chip-input:checked + .aiw-chip {
    background: var(--aiw-accent); border-color: var(--aiw-accent); color: #fff;
    box-shadow: 0 6px 14px var(--aiw-ring);
}
.aiw-chip-input:checked + .aiw-chip::before { content: ""; width: 7px; height: 4px; margin-right: 1px; border: solid #fff; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.aiw-chip-input:focus-visible + .aiw-chip { outline: 3px solid var(--aiw-ring); outline-offset: 2px; }

/* more options */
.aiw-more { margin: 18px 0 0; border: 1px solid var(--aiw-line); border-radius: 16px; background: #fbfcff; }
.aiw-more > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; cursor: pointer; list-style: none;
    font-weight: 700; font-size: 14.5px; color: var(--aiw-ink); border-radius: 16px;
}
.aiw-more > summary::-webkit-details-marker { display: none; }
.aiw-more > summary::after { content: ""; width: 9px; height: 9px; border: solid var(--aiw-ink-3); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s ease; margin-top: -4px; }
.aiw-more[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.aiw-more > summary:focus-visible { outline: 3px solid var(--aiw-ring); }
.aiw-more > .aiw-fields { padding: 4px 16px 16px; }

/* error */
.aiw-error {
    display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; padding: 11px 14px; border-radius: 13px;
    background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; font-weight: 600; font-size: 14.5px; line-height: 1.45;
    animation: aiw-rise .25s ease both;
}
.aiw-error::before { content: "!"; flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #e11d48; color: #fff; font-size: 13px; font-weight: 800; margin-top: 1px; }

/* submit */
.aiw-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 18px 0 0; }
.aiw-generate {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px; flex: 1 1 220px;
    height: 54px; padding: 0 26px; border: 0; border-radius: 16px; cursor: pointer; overflow: hidden;
    color: #fff; font-weight: 800; font-size: 16.5px; letter-spacing: -.005em;
    background: linear-gradient(120deg, var(--aiw-accent) 0%, color-mix(in srgb, var(--aiw-accent) 70%, #06b6d4) 100%);
    box-shadow: 0 12px 26px var(--aiw-ring);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.aiw-generate::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-120%);
    background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.28) 50%, transparent 80%);
    transition: transform .7s ease;
}
.aiw-generate:hover { transform: translateY(-1px); box-shadow: 0 16px 32px var(--aiw-ring); }
.aiw-generate:hover::after { transform: translateX(120%); }
.aiw-generate:focus-visible { outline: 3px solid #ffd166; outline-offset: 3px; }
.aiw-generate[disabled] { cursor: progress; filter: saturate(.75) brightness(.97); transform: none; }
.aiw-generate[aria-busy="true"] .aiw-generate-icon { animation: aiw-spin 1.1s linear infinite; }
.aiw-generate-icon { font-size: 18px; line-height: 1; }
.aiw-kbd { font-size: 12.5px; color: var(--aiw-ink-3); padding: 4px 8px; border: 1px solid var(--aiw-line); border-bottom-width: 2px; border-radius: 8px; background: #fff; white-space: nowrap; }
.aiw-usage { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 13px; color: var(--aiw-ink-3); }
.aiw-usage::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.aiw-usage.is-low::before { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.aiw-usage.is-out::before { background: #e11d48; box-shadow: 0 0 0 3px rgba(225,29,72,.18); }

/* ---------------- output ---------------- */
.aiw-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.aiw-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border-radius: 11px; cursor: pointer;
    border: 1px solid var(--aiw-line); background: #fff; color: var(--aiw-ink-2); font-size: 13.5px; font-weight: 700; white-space: nowrap;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.aiw-btn svg { width: 15px; height: 15px; flex: none; }
.aiw-btn:hover { border-color: var(--aiw-accent); color: var(--aiw-accent); }
.aiw-btn:focus-visible { outline: 3px solid var(--aiw-ring); outline-offset: 1px; }
.aiw-btn.is-primary { background: var(--aiw-accent); border-color: var(--aiw-accent); color: #fff; }
.aiw-btn.is-primary:hover { filter: brightness(1.07); color: #fff; }
.aiw-btn.is-done { background: #16a34a; border-color: #16a34a; color: #fff; }

.aiw-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 26px 10px; border: 2px dashed var(--aiw-line); border-radius: 18px; background: linear-gradient(180deg, #fff, #fafbff); }
.aiw-empty-art {
    display: grid; place-items: center; width: 74px; height: 74px; margin: 0 0 14px; border-radius: 24px; font-size: 34px;
    background: var(--aiw-soft); box-shadow: inset 0 0 0 1px var(--aiw-soft-2); animation: aiw-float 5s ease-in-out infinite;
}
.aiw-empty-title { margin: 0 0 12px; font-size: 17px; font-weight: 800; color: var(--aiw-ink); }
.aiw-tips { display: grid; gap: 8px; max-width: 440px; margin: 0; padding: 0; list-style: none; text-align: left; }
.aiw-tips li { position: relative; padding-left: 24px; font-size: 14px; line-height: 1.5; color: var(--aiw-ink-2); }
.aiw-tips li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 10px; height: 10px; border-radius: 3px; background: var(--aiw-accent); opacity: .55; transform: rotate(45deg); }

.aiw-loading { flex: 1; padding: 8px 2px; }
.aiw-loading-text { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-weight: 700; color: var(--aiw-ink-2); }
.aiw-loading-text .aiw-elapsed { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--aiw-ink-3); font-variant-numeric: tabular-nums; }
.aiw-pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--aiw-accent); animation: aiw-ping 1.4s ease-out infinite; }
.aiw-dots span { animation: aiw-blink 1.2s infinite; }
.aiw-dots span:nth-child(2) { animation-delay: .2s; }
.aiw-dots span:nth-child(3) { animation-delay: .4s; }
.aiw-skel {
    display: block; height: 14px; margin: 0 0 12px; border-radius: 8px;
    background: linear-gradient(90deg, #eef1f7 0%, var(--aiw-soft-2) 45%, #eef1f7 90%); background-size: 220% 100%;
    animation: aiw-shimmer 1.3s ease-in-out infinite;
}
.aiw-skel.is-head { height: 22px; width: 55%; margin-bottom: 20px; }
.aiw-skel.w90 { width: 92%; } .aiw-skel.w80 { width: 80%; } .aiw-skel.w70 { width: 70%; } .aiw-skel.w50 { width: 48%; }
.aiw-skel.gap { margin-top: 24px; }

.aiw-result {
    flex: 1; min-width: 0; font-size: 15.5px; line-height: 1.72; color: #1f2742; overflow-wrap: anywhere;
    animation: aiw-rise .35s ease both;
}
.aiw-result > :last-child { margin-bottom: 0; }
.aiw-result p { margin: 0 0 12px; }
.aiw-result h3 { margin: 22px 0 8px; font-size: 18px; line-height: 1.35; font-weight: 800; color: var(--aiw-ink); letter-spacing: -.01em; }
.aiw-result h3:first-child { margin-top: 0; }
.aiw-result strong { font-weight: 700; color: var(--aiw-ink); }
.aiw-result ul, .aiw-result ol { margin: 0 0 14px; padding-left: 22px; }
.aiw-result li { margin: 0 0 6px; padding-left: 2px; }
.aiw-result ul li::marker { color: var(--aiw-accent); }
.aiw-result ol li::marker { color: var(--aiw-accent); font-weight: 800; }
.aiw-result .aiw-callout { padding: 10px 14px; border-radius: 12px; background: var(--aiw-soft); border-left: 4px solid var(--aiw-accent); font-size: 14.5px; }

.aiw-subject { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 12px 12px 16px; border-radius: 15px; background: var(--aiw-soft); border: 1px solid var(--aiw-soft-2); }
.aiw-subject-in { flex: 1; min-width: 0; }
.aiw-subject-label { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--aiw-accent); }
.aiw-subject-text { display: block; font-size: 16.5px; font-weight: 800; line-height: 1.4; color: var(--aiw-ink); }
.aiw-preview-text { display: block; margin-top: 3px; font-size: 13.5px; line-height: 1.45; color: var(--aiw-ink-2); }
.aiw-preview-text b { font-weight: 700; }
.aiw-email-body { padding: 4px 2px 0; }

.aiw-list-kind ol { list-style: none; padding: 0; counter-reset: aiw-n; }
.aiw-list-kind ol > li {
    counter-increment: aiw-n; display: flex; align-items: flex-start; gap: 12px; margin: 0 0 8px; padding: 10px 10px 10px 12px;
    border: 1px solid var(--aiw-line); border-radius: 13px; background: #fff; line-height: 1.5;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.aiw-list-kind ol > li:hover { border-color: var(--aiw-soft-2); box-shadow: 0 6px 16px rgba(18,26,51,.06); }
.aiw-list-kind ol > li::before { content: counter(aiw-n); flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; background: var(--aiw-soft-2); color: var(--aiw-accent); font-size: 13px; font-weight: 800; }
.aiw-li-text { flex: 1; min-width: 0; padding-top: 2px; }
.aiw-li-copy { flex: none; border: 0; background: transparent; color: var(--aiw-ink-3); border-radius: 8px; padding: 4px 8px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.aiw-li-copy:hover, .aiw-li-copy:focus-visible { background: var(--aiw-soft); color: var(--aiw-accent); outline: none; }

.aiw-result-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--aiw-line); }
.aiw-foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.aiw-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--aiw-ink-2); }
.aiw-meta span { padding: 4px 10px; border-radius: 999px; background: #f1f3f9; font-weight: 600; }
.aiw-undo { display: inline-flex; align-items: center; gap: 6px; }
.aiw-truncated { margin: 0 0 12px; padding: 9px 12px; border-radius: 12px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 13.5px; font-weight: 600; }
.aiw-refine { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.aiw-refine-label { font-size: 13px; font-weight: 800; color: var(--aiw-ink-2); margin-right: 2px; }
.aiw-chip-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--aiw-soft-2); background: var(--aiw-soft); color: var(--aiw-ink); font-size: 13px; font-weight: 700;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.aiw-chip-btn:hover:not([disabled]) { border-color: var(--aiw-accent); transform: translateY(-1px); }
.aiw-chip-btn:focus-visible { outline: 3px solid var(--aiw-ring); outline-offset: 2px; }
.aiw-chip-btn[disabled] { opacity: .55; cursor: not-allowed; }
.aiw-chip-btn.is-busy::before { content: ""; width: 12px; height: 12px; border: 2px solid var(--aiw-soft-2); border-top-color: var(--aiw-accent); border-radius: 50%; animation: aiw-spin .8s linear infinite; }
.aiw-disclaimer { margin: 12px 0 0; font-size: 12.5px; color: var(--aiw-ink-3); }

/* limit card */
.aiw-limit { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 26px 16px; border-radius: 18px; background: linear-gradient(160deg, #fff7ed, #fff); border: 1px solid #fed7aa; animation: aiw-rise .35s ease both; }
.aiw-limit-icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 12px; border-radius: 20px; background: #ffedd5; font-size: 30px; }
.aiw-limit-title { margin: 0 0 8px; font-size: 18px; font-weight: 800; color: #7c2d12; }
.aiw-limit p { max-width: 420px; margin: 0 0 6px; color: #9a3412; font-size: 14.5px; line-height: 1.55; }

/* ---------------- lower page ---------------- */
.aiw-shell { max-width: 1260px; margin: 0 auto; padding: 26px 20px 30px; }
.aiw-ad { margin: 8px 0 22px; text-align: center; }
.aiw-ad:not(:has(.a2z-ad)) { display: none; }
.aiw-ad-label { display: block; margin: 0 0 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--aiw-ink-3); }
.aiw-block { margin: 0 0 22px; padding: 26px; border-radius: var(--aiw-radius); background: #fff; border: 1px solid var(--aiw-line); }
.aiw-block > .aiw-h2 { margin-bottom: 16px; }
.aiw-block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.aiw-history-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.aiw-history-item { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border: 1px solid var(--aiw-line); border-radius: 14px; background: #fbfcff; animation: aiw-rise .3s ease both; }
.aiw-history-item:hover { border-color: var(--aiw-soft-2); background: #fff; }
.aiw-history-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--aiw-soft); font-size: 16px; }
.aiw-history-main { flex: 1; min-width: 0; }
.aiw-history-preview { display: block; font-weight: 700; font-size: 14.5px; color: var(--aiw-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aiw-history-time { display: block; font-size: 12.5px; color: var(--aiw-ink-3); }
.aiw-history-btns { flex: none; display: flex; gap: 6px; }
.aiw-icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--aiw-line); background: #fff; color: var(--aiw-ink-3); cursor: pointer; }
.aiw-icon-btn svg { width: 16px; height: 16px; }
.aiw-icon-btn:hover { border-color: #fecdd3; color: #e11d48; background: #fff1f2; }
.aiw-icon-btn:focus-visible { outline: 3px solid var(--aiw-ring); }

.aiw-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.aiw-step { position: relative; padding: 20px; border-radius: 18px; background: linear-gradient(180deg, var(--aiw-soft), #fff); border: 1px solid var(--aiw-line); }
.aiw-step-n { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 12px; border-radius: 12px; background: var(--aiw-accent); color: #fff; font-weight: 800; box-shadow: 0 8px 18px var(--aiw-ring); }
.aiw-step h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; color: var(--aiw-ink); }
.aiw-step p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--aiw-ink-2); }

.aiw-tip-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: aiw-tip; }
.aiw-tip-card { counter-increment: aiw-tip; position: relative; padding: 18px 18px 18px 56px; border-radius: 16px; border: 1px solid var(--aiw-line); background: #fbfcff; font-size: 14.5px; line-height: 1.55; color: var(--aiw-ink-2); }
.aiw-tip-card::before { content: counter(aiw-tip); position: absolute; left: 16px; top: 16px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--aiw-soft-2); color: var(--aiw-accent); font-weight: 800; font-size: 13px; }

.aiw-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.aiw-tool-card {
    --tc: var(--aiw-accent);
    display: flex; align-items: center; gap: 11px; height: 100%; padding: 12px 14px; border-radius: 14px;
    border: 1px solid var(--aiw-line); background: #fff; color: var(--aiw-ink) !important; text-decoration: none !important; font-weight: 700; font-size: 14.5px;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.aiw-tool-card:hover { border-color: var(--tc); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(18,26,51,.08); }
.aiw-tool-card:focus-visible { outline: 3px solid var(--aiw-ring); outline-offset: 2px; }
.aiw-tool-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; font-size: 19px; background: color-mix(in srgb, var(--tc) 12%, #fff); }
.aiw-tool-name { min-width: 0; }

/* toast */
.aiw-toast {
    position: fixed; left: 50%; bottom: 22px; z-index: 1000; max-width: calc(100vw - 32px); transform: translate(-50%, 16px); opacity: 0;
    padding: 11px 18px; border-radius: 14px; background: #121a33; color: #fff; font-weight: 700; font-size: 14.5px;
    box-shadow: 0 18px 40px rgba(3, 8, 30, .35); transition: opacity .2s ease, transform .2s ease; pointer-events: none;
}
.aiw-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- hub ---------------- */
.aiw-hub .aiw-hero { padding-bottom: 64px; }
.aiw-hub-search {
    display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 26px auto 0; padding: 8px 8px 8px 16px; border-radius: 18px;
    background: #fff; box-shadow: 0 22px 50px rgba(3, 8, 30, .4); text-align: left;
}
.aiw-hub-search svg { flex: none; width: 20px; height: 20px; color: var(--aiw-ink-3); }
.aiw-hub-search input { flex: 1; min-width: 0; height: 46px; border: 0; outline: none; background: transparent; font-size: 16px; color: var(--aiw-ink); }
.aiw-hub-search:focus-within { box-shadow: 0 22px 50px rgba(3, 8, 30, .4), 0 0 0 4px rgba(255,255,255,.35); }
.aiw-hub-count { flex: none; padding: 6px 11px; border-radius: 11px; background: var(--aiw-soft); color: var(--aiw-accent); font-size: 13px; font-weight: 800; white-space: nowrap; }
.aiw-hub-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.aiw-hub-filter { padding: 8px 14px; border-radius: 999px; border: 1px solid #d8deeb; background: #fff; color: var(--aiw-ink-2); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.aiw-hub-filter:hover { border-color: var(--aiw-accent); }
.aiw-hub-filter[aria-pressed="true"] { background: var(--aiw-accent); border-color: var(--aiw-accent); color: #fff; }
.aiw-hub-filter:focus-visible { outline: 3px solid var(--aiw-ring); outline-offset: 2px; }
.aiw-hub-group { margin: 0 0 26px; }
.aiw-hub-group > .aiw-h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.aiw-hub-group-n { padding: 2px 9px; border-radius: 999px; background: #eef1f8; font-size: 12.5px; font-weight: 800; color: var(--aiw-ink-3); }
.aiw-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.aiw-hub-card {
    --tc: var(--aiw-accent);
    position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 20px; border-radius: 20px; overflow: hidden;
    background: #fff; border: 1px solid var(--aiw-line); color: var(--aiw-ink) !important; text-decoration: none !important;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.aiw-hub-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--tc); opacity: .85; }
.aiw-hub-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--tc) 40%, #fff); box-shadow: 0 18px 36px rgba(18,26,51,.1); }
.aiw-hub-card:focus-visible { outline: 3px solid var(--aiw-ring); outline-offset: 3px; }
.aiw-hub-card .aiw-tool-icon { width: 46px; height: 46px; border-radius: 14px; font-size: 23px; }
.aiw-hub-card-name { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.aiw-hub-card-lede { flex: 1; margin: 0; font-size: 14px; line-height: 1.55; color: var(--aiw-ink-2); }
.aiw-hub-card-go { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 800; color: var(--tc); }
.aiw-hub-card-go::after { content: "\2192"; transition: transform .15s ease; }
.aiw-hub-card:hover .aiw-hub-card-go::after { transform: translateX(3px); }
.aiw-hub-empty { padding: 26px; border-radius: 18px; border: 2px dashed var(--aiw-line); text-align: center; color: var(--aiw-ink-2); font-weight: 600; }
.aiw-hub-main { position: relative; z-index: 1; max-width: 1260px; margin: -30px auto 0; padding: 0 20px; }
.aiw-hub-panel { padding: 24px; border-radius: var(--aiw-radius); background: #fff; border: 1px solid var(--aiw-line); box-shadow: 0 22px 54px rgba(18,26,51,.08); }
.aiw-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.aiw-fact { padding: 16px; border-radius: 16px; background: #fbfcff; border: 1px solid var(--aiw-line); }
.aiw-fact b { display: block; margin-bottom: 4px; font-size: 15px; color: var(--aiw-ink); }
.aiw-fact span { font-size: 14px; line-height: 1.5; color: var(--aiw-ink-2); }
.aiw-faq { display: grid; gap: 10px; }
.aiw-faq details { border: 1px solid var(--aiw-line); border-radius: 14px; background: #fbfcff; }
.aiw-faq summary { padding: 14px 16px; cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.aiw-faq summary::-webkit-details-marker { display: none; }
.aiw-faq summary::after { content: "+"; flex: none; font-size: 20px; line-height: 1; color: var(--aiw-accent); transition: transform .2s ease; }
.aiw-faq details[open] summary::after { transform: rotate(45deg); }
.aiw-faq summary:focus-visible { outline: 3px solid var(--aiw-ring); border-radius: 14px; }
.aiw-faq p { margin: 0; padding: 0 16px 14px; color: var(--aiw-ink-2); line-height: 1.6; }
.aiw-page-content { max-width: 1260px; margin: 0 auto; padding: 0 20px 20px; }

/* ---------------- animation ---------------- */
@keyframes aiw-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes aiw-drift { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(26px, 18px) scale(1.08); } }
@keyframes aiw-twinkle { 0%, 100% { opacity: .2; transform: scale(.8); } 50% { opacity: .8; transform: scale(1.1); } }
@keyframes aiw-shimmer { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
@keyframes aiw-spin { to { transform: rotate(360deg); } }
@keyframes aiw-blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes aiw-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes aiw-ping { 0% { box-shadow: 0 0 0 0 var(--aiw-ring); } 100% { box-shadow: 0 0 0 12px transparent; } }
@keyframes aiw-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

@media (prefers-reduced-motion: reduce) {
    .aiw *, .aiw *::before, .aiw *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
    .aiw-tip-cards { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
    .aiw-workspace { grid-template-columns: minmax(0, 1fr); }
    .aiw-output { position: static; min-height: 0; }
    .aiw-empty { padding: 20px 10px; }
}
@media (max-width: 640px) {
    .aiw-hero { padding: 36px 16px 96px; }
    .aiw-hub .aiw-hero { padding-bottom: 50px; }
    .aiw-trust { gap: 8px 14px; font-size: 13px; }
    .aiw-workspace, .aiw-shell, .aiw-hub-main, .aiw-page-content { padding-left: 12px; padding-right: 12px; }
    .aiw-card, .aiw-block, .aiw-hub-panel { padding: 16px; border-radius: 18px; }
    .aiw-fields { grid-template-columns: minmax(0, 1fr); }
    .aiw-steps { grid-template-columns: 1fr; }
    .aiw-kbd { display: none; }
    .aiw-card-head { align-items: flex-start; }
    .aiw-actions { width: 100%; }
    .aiw-actions .aiw-btn { flex: 1 1 auto; justify-content: center; padding: 0 9px; }
    .aiw-history-item { flex-wrap: wrap; }
    .aiw-history-btns { margin-left: auto; }
    .aiw-subject { flex-wrap: wrap; }
    .aiw-hub-count { display: none; }
}
