.profile-menu { position: relative; flex: none; }
.profile-menu [hidden] { display: none !important; }
.profile-trigger, .profile-action, .profile-pin-button {
    font: inherit; color: var(--text, #e9f0f7); cursor: pointer;
    border: 1px solid var(--outline, #293341); border-radius: 10px;
    background: #1a2532; min-height: 44px;
}
.profile-trigger { width: 44px; display: grid; place-items: center; border-radius: 50%; }
.profile-icon { width: 22px; height: 26px; position: relative; overflow: hidden; }
.profile-icon::before, .profile-icon::after { content: ''; position: absolute; background: currentColor; }
.profile-icon::before { width: 10px; height: 10px; border-radius: 50%; top: 1px; left: 6px; }
.profile-icon::after { width: 22px; height: 13px; border-radius: 50% 50% 0 0; bottom: 0; left: 0; }
.profile-actions {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
    width: 210px; padding: 6px; background: #0e151f;
    border: 1px solid var(--outline, #293341); border-radius: 12px;
    box-shadow: 0 10px 30px #0006;
}
.profile-action { display: block; width: 100%; text-align: left; border-color: transparent; background: transparent; padding: 10px 12px; }
.profile-action:hover, .profile-pin-button:hover { background: #253448; }
.profile-menu button:focus-visible, .profile-pin-dialog :focus-visible { outline: 2px solid var(--brand, #5b9dff); outline-offset: 2px; }
.profile-pin-dialog {
    box-sizing: border-box; width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
    padding: 22px; overflow-y: auto; background: #0e151f; color: var(--text, #e9f0f7);
    border: 1px solid var(--outline, #293341); border-radius: 16px; box-shadow: 0 10px 30px #0006;
}
.profile-pin-dialog::backdrop { background: #0009; }
.profile-pin-dialog h3 { margin: 0 0 12px; }
.profile-pin-intro, .profile-pin-status, .profile-pin-help { color: var(--muted, #a6b3c2); font-size: 13px; line-height: 1.5; }
.profile-pin-status:empty { display: none; }
.profile-pin-list { display: grid; gap: 8px; margin-top: 10px; max-height: 50vh; overflow-y: auto; }
.profile-pin-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--outline, #293341); border-radius: 10px; background: #ffffff05; }
.profile-pin-meta { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.profile-pin-title { font-weight: 600; }
.profile-pin-group { color: var(--muted, #a6b3c2); font-size: 12px; }
.profile-pin-url { color: var(--muted, #a6b3c2); font: 11px ui-monospace, Menlo, Consolas, monospace; word-break: break-all; margin-top: 4px; }
.profile-pin-links { display: flex; flex-direction: column; gap: 6px; flex: none; }
.profile-pin-button { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; font-size: 14px; font-weight: 600; text-decoration: none; }
.profile-pin-help { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--outline, #293341); }
.profile-pin-help b { color: var(--text, #e9f0f7); }
.profile-pin-footer { display: flex; justify-content: flex-end; margin-top: 16px; }
.api-info-btn {
    flex: none; width: 36px; min-height: 36px; padding: 0; font: bold 16px ui-monospace, Consolas, monospace;
    color: var(--muted, #a6b3c2); background: #ffffff05; cursor: pointer;
    border: 1px solid var(--outline, #293341); border-radius: 9px;
}
.api-info-btn:hover { color: var(--brand, #5b9dff); border-color: currentColor; }
.api-dialog { width: min(720px, calc(100% - 32px)); }
.api-dialog [hidden] { display: none !important; }
.api-dialog .api-content { min-width: 0; }
.api-code {
    margin: 12px 0; padding: 12px; background: #080e16; border: 1px solid var(--outline, #293341);
    border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere;
    font: 12px/1.6 ui-monospace, Consolas, monospace; user-select: text;
}
.api-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.api-call { border-top: 1px solid var(--outline, #293341); margin-top: 20px; padding-top: 16px; }
.api-call h4 { margin: 0 0 8px; }
.api-endpoint { font-size: 12px; color: var(--muted, #a6b3c2); overflow-wrap: anywhere; }
.api-key-label { display: block; font-size: 13px; margin-bottom: 6px; }
.api-key-field { display: flex; align-items: center; gap: 8px; }
.api-key-field .api-key-input { flex: 1; min-width: 0; }
.api-key-field button { flex: none; }
.api-key-input {
    box-sizing: border-box; width: 100%; min-height: 44px; padding: 8px 12px; font: inherit;
    color: var(--text, #e9f0f7); background: #0c131c;
    border: 1px solid var(--outline, #293341); border-radius: 10px;
}
.api-dialog button:disabled { opacity: .5; cursor: default; }
@media (max-width: 640px), (pointer: coarse) {
    .api-info-btn { width: 44px; min-height: 44px; }
}
