.spektr-ws-btn,
.spektr-ws-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    border: 1px solid hsl(var(--border));
    border-radius: 10px;
    background: hsl(var(--background));
    color: inherit;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    position: relative;
}
.spektr-ws-chrome {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 8px;
}
.spektr-ws-search-ico {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.spektr-ws-icon { width: 36px; padding: 0; }
.spektr-ws-btn:hover, .spektr-ws-icon:hover { background: hsl(var(--accent)); }
#spektr-ws-app { padding: 0 12px; text-decoration: none; white-space: nowrap; }
.spektr-ws-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: grid;
    place-items: center;
}
.spektr-overlay-ui {
    position: fixed;
    inset: 0;
    z-index: 85000;
    background: rgba(2, 6, 23, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 16px 16px;
}
.spektr-palette, .spektr-panel {
    width: min(640px, 100%);
    max-height: 70vh;
    overflow: auto;
    background: hsl(var(--card));
    color: hsl(var(--card-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.spektr-palette input, .spektr-panel input, .spektr-panel select, .spektr-panel textarea {
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    border: 1px solid hsl(var(--border));
    border-radius: 10px;
    background: hsl(var(--background));
    color: inherit;
    font: inherit;
    padding: 0 12px;
}
.spektr-palette input { height: 48px; border: 0; border-bottom: 1px solid hsl(var(--border)); border-radius: 16px 16px 0 0; font-size: 16px; }
.spektr-hit {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 10px 14px;
    cursor: pointer;
}
.spektr-hit:hover, .spektr-hit.is-on { background: hsl(var(--accent)); }
.spektr-hit small { display: block; color: hsl(var(--muted-foreground)); font-size: 12px; }
.spektr-panel { padding: 16px; }
.spektr-panel h2 { margin: 0 0 12px; font-size: 16px; }
.spektr-note { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid hsl(var(--border)); cursor: pointer; flex-wrap: wrap; align-items: center; }
.spektr-note.is-read { opacity: .6; }
.spektr-chipbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
.spektr-chip {
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid hsl(var(--border));
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.spektr-chip.is-on { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: transparent; }
.spektr-file-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; }
.spektr-file-tools input { max-width: 280px; height: 36px; flex: 1 1 180px; padding: 0 12px; border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--background)); color: inherit; font: inherit; }
.spektr-reply {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    border-top: 1px solid hsl(var(--border));
    background: hsl(var(--muted) / .4);
    font-size: 12px;
}
.spektr-typing { padding: 0 16px 6px; font-size: 12px; color: hsl(var(--muted-foreground)); }
.spektr-quote {
    font-size: 12px;
    opacity: .75;
    border-left: 2px solid hsl(var(--primary));
    padding: 0 0 4px 8px;
    margin-bottom: 4px;
}
.spektr-mention {
    position: absolute;
    z-index: 86000;
    min-width: 220px;
    max-height: 200px;
    overflow: auto;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.spektr-counter { font-size: 12px; color: hsl(var(--muted-foreground)); margin-left: 8px; }
.spektr-form-grid { display: grid; gap: 8px; margin: 12px 0; }
.spektr-user-pass {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1 1 100%;
    margin-top: 6px;
}
.spektr-user-pass input {
    flex: 1;
    min-width: 160px;
    height: 36px;
    box-sizing: border-box;
    border: 1px solid hsl(var(--border));
    border-radius: 10px;
    background: hsl(var(--background));
    color: inherit;
    font: inherit;
    padding: 0 12px;
}
@media (max-width: 1023px) {
    header {
        height: auto !important;
        min-height: 3.5rem;
        flex-wrap: wrap !important;
        row-gap: 6px;
        padding-top: 6px;
        padding-bottom: 6px;
    }
    header > .flex.items-center.gap-3.min-w-0 {
        flex: 1 1 auto;
        min-width: 0;
    }
    header > .flex.items-center.gap-2.shrink-0:has([data-testid="button-upload"]),
    header > .flex.items-center.gap-2.shrink-0:has([data-testid="button-new-task"]) {
        flex: 1 1 100%;
        justify-content: flex-end;
    }
    .spektr-file-tools input {
        flex: 1 1 220px;
        max-width: none;
        height: 40px;
        font-size: 16px;
    }
    .spektr-overlay-ui { padding-top: 8vh; }
    .spektr-viewer { width: 100% !important; height: 100% !important; max-height: none; border-radius: 0; }
    .spektr-overlay { padding: 0; align-items: stretch; }
    [data-testid^="row-node-"] { min-height: 48px; }
    main aside.w-60.shrink-0 {
        display: none !important;
    }
}
@media (max-width: 767px) {
    .spektr-ws-search-label { display: none; }
    #spektr-ws-search {
        width: 36px;
        padding: 0;
    }
    .spektr-file-tools input {
        flex: 1 1 100%;
    }
    [data-act="reply-msg"] {
        height: 28px;
        padding: 0 8px;
        font-size: 12px;
    }
}
