/* Icon buttons of the Settings row, one flat square box. The dialog-openers wear the accent
   fill (a filled square opens something); the toggles stay ghosts until on. */
#settings-btn, #visuals-btn, #info-btn, #fullscreen-toggle, #incognito-toggle {
    background: transparent;
    /* The box is drawn in the ink of the glyph inside it (user report: a --border-main
       outline vanished on the dark theme and smudged on the light one). */
    border: 1px solid var(--ui-outline) !important;
    color: var(--text-main);
    font-size: 18px;
    padding: 7px 11px;
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
/* #chat-btn takes its CONNECTIONS & LINKS siblings' box (40x32). The idle outline is an inset
   shadow: a border would add 2px when idle only and the icon would jump on toggle. */
#chat-btn {
    background: transparent;
    border: none !important;
    box-shadow: inset 0 0 0 1px var(--ui-outline);
    color: var(--text-main);
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
#chat-btn.active { box-shadow: none; }
/* The voice-chat toggle: the same ghost box and accent fill while on. */
#voice-chat-btn {
    background: transparent;
    border: none !important;
    box-shadow: inset 0 0 0 1px var(--ui-outline);
    color: var(--text-main);
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
#voice-chat-btn:not(.active):hover { background: var(--bg-info); }
#voice-chat-btn.active { background: var(--accent); color: var(--on-accent); }
#voice-chat-btn.active:hover { background: var(--accent-2); }
#voice-chat-btn:disabled { opacity: 0.45; cursor: not-allowed; background: transparent; }
/* Work in flight behind a closed chat: a pulsing corner dot that reads on the idle box and the
   accent fill. No unread dot: an answer that lands while the chat is away toasts. */
#chat-btn { position: relative; }
#chat-btn.chat-working::before {
    content: "";
    position: absolute;
    top: 4px; right: 4px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px var(--bg-controls);
    pointer-events: none;
}
/* On the accent-filled (open) state the dot inverts, so it stays visible either way. */
#chat-btn.active.chat-working::before {
    background: var(--on-accent);
    box-shadow: 0 0 0 2px var(--accent);
}
#chat-btn.chat-working::before { animation: statusPulse 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
    #chat-btn.chat-working::before { animation: none; }
}
/* A refused server session says so in the Servers tooltip only; a corner badge read as damage. */

/* #zoom-fit gets the ghost box too: accent-filled after the % input it read as a third zoom
   step. Its id outranks button:disabled's grey, so its disabled face is spelled out below. */
#zoom-fit {
    background: var(--accent);
    border: none !important;
    box-shadow: inset 0 0 0 1px var(--accent);
    color: var(--on-accent);
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
/* Disabled, the zoom steppers' grey chip; a faded accent read as active behind glass. */
#zoom-fit:disabled {
    background: var(--disabled-bg);
    box-shadow: none;
    color: var(--disabled-text);
    cursor: not-allowed;
}
/* Glyphs stay the plain ink; the accent is the hover border (user decision; desktop twin:
   theme.cpp QToolButton:hover). !important as the ghosts' resting border is. */
/* The three dialog-openers: the accent fill the ghost box above would otherwise cover. */
#settings-btn, #visuals-btn, #info-btn {
    background: var(--accent);
    border-color: var(--accent) !important;
    color: var(--on-accent);
}
#settings-btn:not(:disabled):hover, #visuals-btn:not(:disabled):hover,
#info-btn:not(:disabled):hover {
    background: var(--accent-2);
    border-color: var(--accent-2) !important;
}
#incognito-toggle:not(.active):hover,
#chat-btn:not(.active):hover { background: var(--bg-info); }
#zoom-fit:not(:disabled):hover { background: var(--accent-2); box-shadow: inset 0 0 0 1px var(--accent-2); }
/* An idle toggle shows the accent on its hover border alone (user decision; desktop twin: theme.cpp). */
#incognito-toggle:not(.active):not(:disabled):hover { border-color: var(--accent) !important; }
/* The inset-ring three take the same accent on that ring. */
#chat-btn:not(.active):not(:disabled):hover,
#voice-chat-btn:not(.active):not(:disabled):hover { box-shadow: inset 0 0 0 1px var(--accent); }
/* Fullscreen is filled either way: it acts on press, and its glyph says which way. */
#fullscreen-toggle {
    background: var(--accent);
    border-color: var(--accent) !important;
    color: var(--on-accent);
}
#fullscreen-toggle:not(:disabled):hover {
    background: var(--accent-2);
    border-color: var(--accent-2) !important;
}
/* Active toggle → accent fill (matches the primary toolbar icons). */
#fullscreen-toggle.active, #incognito-toggle.active, #chat-btn.active {
    background: var(--accent);
    border-color: var(--accent) !important;
    color: var(--on-accent);
}
#fullscreen-toggle.active:hover, #incognito-toggle.active:hover,
#chat-btn.active:hover { background: var(--accent-2); border-color: var(--accent-2) !important; }

