.kiki-topnav-link {
    position: relative;
}

.kiki-topnav-icon {
    font-size: 22px;
}

.kiki-topnav-dot {
    position: absolute;
    top: 8px;
    right: 4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 2px #fff;
}

.kiki-topnav-link[aria-expanded="true"] .kiki-topnav-dot {
    background: #059669;
}

.kiki-root[hidden] {
    display: none !important;
}

.kiki-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    z-index: 80000;
}

@media (min-width: 992px) {
    .kiki-overlay {
        background: transparent;
        pointer-events: none;
    }

    .kiki-panel {
        pointer-events: auto;
    }
}

.kiki-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 100vw);
    height: 100vh;
    background: #fff;
    z-index: 80010;
    display: flex;
    flex-direction: column;
    box-shadow: -16px 0 40px rgba(15, 23, 42, 0.16);
    transform: translateX(100%);
    transition: transform 0.22s ease;
}

.kiki-root.is-open .kiki-panel {
    transform: translateX(0);
}

.kiki-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.kiki-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kiki-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #ecfdf5;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.kiki-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.kiki-subtitle {
    margin: 0;
    font-size: 12px;
    color: #64748b;
}

.kiki-header-actions {
    display: flex;
    gap: 4px;
}

.kiki-icon-btn,
.kiki-send {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.kiki-icon-btn:hover,
.kiki-send:hover,
.kiki-icon-btn[aria-expanded="true"] {
    background: #ecfdf5;
    color: #047857;
}

.kiki-icon-btn:focus-visible,
.kiki-send:focus-visible,
.kiki-chip:focus-visible,
.kiki-topnav-link:focus-visible,
.kiki-input:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

.kiki-history {
    border-bottom: 1px solid #e2e8f0;
    max-height: 40%;
    overflow: auto;
    background: #f8fafc;
}

.kiki-history-head {
    padding: 10px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.kiki-history-row {
    display: flex;
    align-items: flex-start;
}

.kiki-history-row.is-active,
.kiki-history-row:hover {
    background: #ecfdf5;
}

.kiki-history-item {
    flex: 1;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 10px 16px;
    cursor: pointer;
    display: block;
}

.kiki-history-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.kiki-history-date {
    display: block;
    font-size: 11px;
    color: #94a3b8;
}

.kiki-history-delete {
    float: right;
    border: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.kiki-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 20px 16px;
}

.kiki-hello {
    margin: 8px 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.kiki-prompt {
    margin: 0 0 16px;
    color: #475569;
}

.kiki-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kiki-chip {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
    color: #334155;
    cursor: pointer;
}

.kiki-chip:hover {
    border-color: #10b981;
    color: #047857;
}

.kiki-msg {
    max-width: 88%;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
}

.kiki-msg--user {
    margin-left: auto;
    background: #10b981;
    color: #fff;
    white-space: pre-wrap;
}

.kiki-msg--assistant {
    margin-right: auto;
    background: #f1f5f9;
    color: #0f172a;
}

.kiki-msg--assistant a {
    color: #047857;
}

.kiki-msg--thinking,
.kiki-msg--error {
    background: #fff7ed;
    color: #9a3412;
}

.kiki-retry {
    margin-top: 8px;
    border: 0;
    background: transparent;
    color: #b45309;
    font-weight: 700;
    cursor: pointer;
}

.kiki-sources {
    margin-top: 8px;
    font-size: 11px;
    color: #64748b;
}

.kiki-composer {
    border-top: 1px solid #e2e8f0;
    padding: 12px 16px 16px;
    flex-shrink: 0;
}

.kiki-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    resize: none;
    min-height: 56px;
    font: inherit;
    color: #0f172a;
}

.kiki-composer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.kiki-count {
    font-size: 11px;
    color: #94a3b8;
}

.kiki-send {
    background: #10b981;
    color: #fff;
}

.kiki-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

@media (max-width: 767px) {
    .kiki-panel {
        width: 100vw;
    }
}
